From fee228a5475e5a435befe37b06bb6f196fcff7ea Mon Sep 17 00:00:00 2001 From: Seoin Date: Sun, 1 Dec 2024 19:44:37 +0900 Subject: [PATCH 1/9] =?UTF-8?q?state,=20setState,=20render=20class?= =?UTF-8?q?=EB=A1=9C=20=EA=B5=AC=ED=98=84,=20=EB=AA=A8=EB=93=88=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Items.ts | 26 + src/core/Component.ts | 26 + src/main.ts | 15 +- yarn.lock | 1748 +++++++-------------------------------- 4 files changed, 386 insertions(+), 1429 deletions(-) create mode 100644 src/components/Items.ts create mode 100644 src/core/Component.ts diff --git a/src/components/Items.ts b/src/components/Items.ts new file mode 100644 index 0000000..4273bb9 --- /dev/null +++ b/src/components/Items.ts @@ -0,0 +1,26 @@ +import Component from "../core/Component"; + +export default class Items extends Component { + setup() { + this.state = { items: ['item1', 'item2'] } + } + + template() { + const { items } = this.state; + return ` + + + ` + } + + + setEvent() { + const button = this.$target.querySelector('button') + button?.addEventListener('click', () => { + const { items } = this.state; + this.setState({ items: [...items, `item${items.length + 1}`] }) + }) + } +} \ No newline at end of file diff --git a/src/core/Component.ts b/src/core/Component.ts new file mode 100644 index 0000000..2891d04 --- /dev/null +++ b/src/core/Component.ts @@ -0,0 +1,26 @@ +interface IState { + [key: string]: any; +} + +export default class Component { + $target: HTMLElement; + state: IState; + + constructor($target: HTMLElement) { + this.$target = $target; + this.state = {}; + this.setup(); + this.render(); + } + setup() { }; + template() { return ''; } + render() { + this.$target.innerHTML = this.template(); + this.setEvent(); + } + setEvent() { } + setState(newState: IState) { + this.state = { ...this.state, newState }; + this.render() + } +} \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 1075ac5..88dbd63 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1 +1,14 @@ -// your Code +import Items from "./components/Items"; + +class Main { + constructor(){ + const $main: Element | null = document.querySelector('#app'); + if ($main instanceof HTMLElement) { + new Items($main); + } else { + console.error('Element with ID "app" not found.'); + } + } +} + +new Main() \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 50126cd..f70a7be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,1428 +1,320 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - -__metadata: - version: 8 - cacheKey: 10c0 - -"@esbuild/aix-ppc64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/aix-ppc64@npm:0.24.0" - conditions: os=aix & cpu=ppc64 - languageName: node - linkType: hard - -"@esbuild/android-arm64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/android-arm64@npm:0.24.0" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - -"@esbuild/android-arm@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/android-arm@npm:0.24.0" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - -"@esbuild/android-x64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/android-x64@npm:0.24.0" - conditions: os=android & cpu=x64 - languageName: node - linkType: hard - -"@esbuild/darwin-arm64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/darwin-arm64@npm:0.24.0" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - -"@esbuild/darwin-x64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/darwin-x64@npm:0.24.0" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - -"@esbuild/freebsd-arm64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/freebsd-arm64@npm:0.24.0" - conditions: os=freebsd & cpu=arm64 - languageName: node - linkType: hard - -"@esbuild/freebsd-x64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/freebsd-x64@npm:0.24.0" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - -"@esbuild/linux-arm64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/linux-arm64@npm:0.24.0" - conditions: os=linux & cpu=arm64 - languageName: node - linkType: hard - -"@esbuild/linux-arm@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/linux-arm@npm:0.24.0" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - -"@esbuild/linux-ia32@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/linux-ia32@npm:0.24.0" - conditions: os=linux & cpu=ia32 - languageName: node - linkType: hard - -"@esbuild/linux-loong64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/linux-loong64@npm:0.24.0" - conditions: os=linux & cpu=loong64 - languageName: node - linkType: hard - -"@esbuild/linux-mips64el@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/linux-mips64el@npm:0.24.0" - conditions: os=linux & cpu=mips64el - languageName: node - linkType: hard - -"@esbuild/linux-ppc64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/linux-ppc64@npm:0.24.0" - conditions: os=linux & cpu=ppc64 - languageName: node - linkType: hard - -"@esbuild/linux-riscv64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/linux-riscv64@npm:0.24.0" - conditions: os=linux & cpu=riscv64 - languageName: node - linkType: hard - -"@esbuild/linux-s390x@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/linux-s390x@npm:0.24.0" - conditions: os=linux & cpu=s390x - languageName: node - linkType: hard - -"@esbuild/linux-x64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/linux-x64@npm:0.24.0" - conditions: os=linux & cpu=x64 - languageName: node - linkType: hard - -"@esbuild/netbsd-x64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/netbsd-x64@npm:0.24.0" - conditions: os=netbsd & cpu=x64 - languageName: node - linkType: hard - -"@esbuild/openbsd-arm64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/openbsd-arm64@npm:0.24.0" - conditions: os=openbsd & cpu=arm64 - languageName: node - linkType: hard - -"@esbuild/openbsd-x64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/openbsd-x64@npm:0.24.0" - conditions: os=openbsd & cpu=x64 - languageName: node - linkType: hard - -"@esbuild/sunos-x64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/sunos-x64@npm:0.24.0" - conditions: os=sunos & cpu=x64 - languageName: node - linkType: hard - -"@esbuild/win32-arm64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/win32-arm64@npm:0.24.0" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - -"@esbuild/win32-ia32@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/win32-ia32@npm:0.24.0" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - -"@esbuild/win32-x64@npm:0.24.0": - version: 0.24.0 - resolution: "@esbuild/win32-x64@npm:0.24.0" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - -"@isaacs/cliui@npm:^8.0.2": - version: 8.0.2 - resolution: "@isaacs/cliui@npm:8.0.2" - dependencies: - string-width: "npm:^5.1.2" - string-width-cjs: "npm:string-width@^4.2.0" - strip-ansi: "npm:^7.0.1" - strip-ansi-cjs: "npm:strip-ansi@^6.0.1" - wrap-ansi: "npm:^8.1.0" - wrap-ansi-cjs: "npm:wrap-ansi@^7.0.0" - checksum: 10c0/b1bf42535d49f11dc137f18d5e4e63a28c5569de438a221c369483731e9dac9fb797af554e8bf02b6192d1e5eba6e6402cf93900c3d0ac86391d00d04876789e - languageName: node - linkType: hard - -"@npmcli/agent@npm:^2.0.0": - version: 2.2.2 - resolution: "@npmcli/agent@npm:2.2.2" - dependencies: - agent-base: "npm:^7.1.0" - http-proxy-agent: "npm:^7.0.0" - https-proxy-agent: "npm:^7.0.1" - lru-cache: "npm:^10.0.1" - socks-proxy-agent: "npm:^8.0.3" - checksum: 10c0/325e0db7b287d4154ecd164c0815c08007abfb07653cc57bceded17bb7fd240998a3cbdbe87d700e30bef494885eccc725ab73b668020811d56623d145b524ae - languageName: node - linkType: hard - -"@npmcli/fs@npm:^3.1.0": - version: 3.1.1 - resolution: "@npmcli/fs@npm:3.1.1" - dependencies: - semver: "npm:^7.3.5" - checksum: 10c0/c37a5b4842bfdece3d14dfdb054f73fe15ed2d3da61b34ff76629fb5b1731647c49166fd2a8bf8b56fcfa51200382385ea8909a3cbecdad612310c114d3f6c99 - languageName: node - linkType: hard - -"@pkgjs/parseargs@npm:^0.11.0": - version: 0.11.0 - resolution: "@pkgjs/parseargs@npm:0.11.0" - checksum: 10c0/5bd7576bb1b38a47a7fc7b51ac9f38748e772beebc56200450c4a817d712232b8f1d3ef70532c80840243c657d491cf6a6be1e3a214cff907645819fdc34aadd - languageName: node - linkType: hard - -"@rollup/rollup-android-arm-eabi@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.27.4" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - -"@rollup/rollup-android-arm64@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-android-arm64@npm:4.27.4" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - -"@rollup/rollup-darwin-arm64@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-darwin-arm64@npm:4.27.4" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - -"@rollup/rollup-darwin-x64@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-darwin-x64@npm:4.27.4" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - -"@rollup/rollup-freebsd-arm64@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-freebsd-arm64@npm:4.27.4" - conditions: os=freebsd & cpu=arm64 - languageName: node - linkType: hard - -"@rollup/rollup-freebsd-x64@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-freebsd-x64@npm:4.27.4" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - -"@rollup/rollup-linux-arm-gnueabihf@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.27.4" - conditions: os=linux & cpu=arm & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-arm-musleabihf@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.27.4" - conditions: os=linux & cpu=arm & libc=musl - languageName: node - linkType: hard - -"@rollup/rollup-linux-arm64-gnu@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.27.4" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-arm64-musl@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.27.4" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.27.4" - conditions: os=linux & cpu=ppc64 & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-riscv64-gnu@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.27.4" - conditions: os=linux & cpu=riscv64 & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-s390x-gnu@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.27.4" - conditions: os=linux & cpu=s390x & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-x64-gnu@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.27.4" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-x64-musl@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.27.4" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - -"@rollup/rollup-win32-arm64-msvc@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.27.4" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - -"@rollup/rollup-win32-ia32-msvc@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.27.4" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - -"@rollup/rollup-win32-x64-msvc@npm:4.27.4": - version: 4.27.4 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.27.4" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - -"@types/estree@npm:1.0.6": - version: 1.0.6 - resolution: "@types/estree@npm:1.0.6" - checksum: 10c0/cdfd751f6f9065442cd40957c07fd80361c962869aa853c1c2fd03e101af8b9389d8ff4955a43a6fcfa223dd387a089937f95be0f3eec21ca527039fd2d9859a - languageName: node - linkType: hard - -"abbrev@npm:^2.0.0": - version: 2.0.0 - resolution: "abbrev@npm:2.0.0" - checksum: 10c0/f742a5a107473946f426c691c08daba61a1d15942616f300b5d32fd735be88fef5cba24201757b6c407fd564555fb48c751cfa33519b2605c8a7aadd22baf372 - languageName: node - linkType: hard - -"agent-base@npm:^7.0.2, agent-base@npm:^7.1.0, agent-base@npm:^7.1.1": - version: 7.1.1 - resolution: "agent-base@npm:7.1.1" - dependencies: - debug: "npm:^4.3.4" - checksum: 10c0/e59ce7bed9c63bf071a30cc471f2933862044c97fd9958967bfe22521d7a0f601ce4ed5a8c011799d0c726ca70312142ae193bbebb60f576b52be19d4a363b50 - languageName: node - linkType: hard - -"aggregate-error@npm:^3.0.0": - version: 3.1.0 - resolution: "aggregate-error@npm:3.1.0" - dependencies: - clean-stack: "npm:^2.0.0" - indent-string: "npm:^4.0.0" - checksum: 10c0/a42f67faa79e3e6687a4923050e7c9807db3848a037076f791d10e092677d65c1d2d863b7848560699f40fc0502c19f40963fb1cd1fb3d338a7423df8e45e039 - languageName: node - linkType: hard - -"ansi-regex@npm:^5.0.1": - version: 5.0.1 - resolution: "ansi-regex@npm:5.0.1" - checksum: 10c0/9a64bb8627b434ba9327b60c027742e5d17ac69277960d041898596271d992d4d52ba7267a63ca10232e29f6107fc8a835f6ce8d719b88c5f8493f8254813737 - languageName: node - linkType: hard - -"ansi-regex@npm:^6.0.1": - version: 6.1.0 - resolution: "ansi-regex@npm:6.1.0" - checksum: 10c0/a91daeddd54746338478eef88af3439a7edf30f8e23196e2d6ed182da9add559c601266dbef01c2efa46a958ad6f1f8b176799657616c702b5b02e799e7fd8dc - languageName: node - linkType: hard - -"ansi-styles@npm:^4.0.0": - version: 4.3.0 - resolution: "ansi-styles@npm:4.3.0" - dependencies: - color-convert: "npm:^2.0.1" - checksum: 10c0/895a23929da416f2bd3de7e9cb4eabd340949328ab85ddd6e484a637d8f6820d485f53933446f5291c3b760cbc488beb8e88573dd0f9c7daf83dccc8fe81b041 - languageName: node - linkType: hard - -"ansi-styles@npm:^6.1.0": - version: 6.2.1 - resolution: "ansi-styles@npm:6.2.1" - checksum: 10c0/5d1ec38c123984bcedd996eac680d548f31828bd679a66db2bdf11844634dde55fec3efa9c6bb1d89056a5e79c1ac540c4c784d592ea1d25028a92227d2f2d5c - languageName: node - linkType: hard - -"balanced-match@npm:^1.0.0": - version: 1.0.2 - resolution: "balanced-match@npm:1.0.2" - checksum: 10c0/9308baf0a7e4838a82bbfd11e01b1cb0f0cf2893bc1676c27c2a8c0e70cbae1c59120c3268517a8ae7fb6376b4639ef81ca22582611dbee4ed28df945134aaee - languageName: node - linkType: hard - -"brace-expansion@npm:^2.0.1": - version: 2.0.1 - resolution: "brace-expansion@npm:2.0.1" - dependencies: - balanced-match: "npm:^1.0.0" - checksum: 10c0/b358f2fe060e2d7a87aa015979ecea07f3c37d4018f8d6deb5bd4c229ad3a0384fe6029bb76cd8be63c81e516ee52d1a0673edbe2023d53a5191732ae3c3e49f - languageName: node - linkType: hard - -"cacache@npm:^18.0.0": - version: 18.0.4 - resolution: "cacache@npm:18.0.4" - dependencies: - "@npmcli/fs": "npm:^3.1.0" - fs-minipass: "npm:^3.0.0" - glob: "npm:^10.2.2" - lru-cache: "npm:^10.0.1" - minipass: "npm:^7.0.3" - minipass-collect: "npm:^2.0.1" - minipass-flush: "npm:^1.0.5" - minipass-pipeline: "npm:^1.2.4" - p-map: "npm:^4.0.0" - ssri: "npm:^10.0.0" - tar: "npm:^6.1.11" - unique-filename: "npm:^3.0.0" - checksum: 10c0/6c055bafed9de4f3dcc64ac3dc7dd24e863210902b7c470eb9ce55a806309b3efff78033e3d8b4f7dcc5d467f2db43c6a2857aaaf26f0094b8a351d44c42179f - languageName: node - linkType: hard - -"chownr@npm:^2.0.0": - version: 2.0.0 - resolution: "chownr@npm:2.0.0" - checksum: 10c0/594754e1303672171cc04e50f6c398ae16128eb134a88f801bf5354fd96f205320f23536a045d9abd8b51024a149696e51231565891d4efdab8846021ecf88e6 - languageName: node - linkType: hard - -"clean-stack@npm:^2.0.0": - version: 2.2.0 - resolution: "clean-stack@npm:2.2.0" - checksum: 10c0/1f90262d5f6230a17e27d0c190b09d47ebe7efdd76a03b5a1127863f7b3c9aec4c3e6c8bb3a7bbf81d553d56a1fd35728f5a8ef4c63f867ac8d690109742a8c1 - languageName: node - linkType: hard - -"color-convert@npm:^2.0.1": - version: 2.0.1 - resolution: "color-convert@npm:2.0.1" - dependencies: - color-name: "npm:~1.1.4" - checksum: 10c0/37e1150172f2e311fe1b2df62c6293a342ee7380da7b9cfdba67ea539909afbd74da27033208d01d6d5cfc65ee7868a22e18d7e7648e004425441c0f8a15a7d7 - languageName: node - linkType: hard - -"color-name@npm:~1.1.4": - version: 1.1.4 - resolution: "color-name@npm:1.1.4" - checksum: 10c0/a1a3f914156960902f46f7f56bc62effc6c94e84b2cae157a526b1c1f74b677a47ec602bf68a61abfa2b42d15b7c5651c6dbe72a43af720bc588dff885b10f95 - languageName: node - linkType: hard - -"cross-spawn@npm:^7.0.0": - version: 7.0.6 - resolution: "cross-spawn@npm:7.0.6" - dependencies: - path-key: "npm:^3.1.0" - shebang-command: "npm:^2.0.0" - which: "npm:^2.0.1" - checksum: 10c0/053ea8b2135caff68a9e81470e845613e374e7309a47731e81639de3eaeb90c3d01af0e0b44d2ab9d50b43467223b88567dfeb3262db942dc063b9976718ffc1 - languageName: node - linkType: hard - -"debug@npm:4, debug@npm:^4.3.4": - version: 4.3.7 - resolution: "debug@npm:4.3.7" - dependencies: - ms: "npm:^2.1.3" - peerDependenciesMeta: - supports-color: - optional: true - checksum: 10c0/1471db19c3b06d485a622d62f65947a19a23fbd0dd73f7fd3eafb697eec5360cde447fb075919987899b1a2096e85d35d4eb5a4de09a57600ac9cf7e6c8e768b - languageName: node - linkType: hard - -"eastasianwidth@npm:^0.2.0": - version: 0.2.0 - resolution: "eastasianwidth@npm:0.2.0" - checksum: 10c0/26f364ebcdb6395f95124fda411f63137a4bfb5d3a06453f7f23dfe52502905bd84e0488172e0f9ec295fdc45f05c23d5d91baf16bd26f0fe9acd777a188dc39 - languageName: node - linkType: hard - -"emoji-regex@npm:^8.0.0": - version: 8.0.0 - resolution: "emoji-regex@npm:8.0.0" - checksum: 10c0/b6053ad39951c4cf338f9092d7bfba448cdfd46fe6a2a034700b149ac9ffbc137e361cbd3c442297f86bed2e5f7576c1b54cc0a6bf8ef5106cc62f496af35010 - languageName: node - linkType: hard - -"emoji-regex@npm:^9.2.2": - version: 9.2.2 - resolution: "emoji-regex@npm:9.2.2" - checksum: 10c0/af014e759a72064cf66e6e694a7fc6b0ed3d8db680427b021a89727689671cefe9d04151b2cad51dbaf85d5ba790d061cd167f1cf32eb7b281f6368b3c181639 - languageName: node - linkType: hard - -"encoding@npm:^0.1.13": - version: 0.1.13 - resolution: "encoding@npm:0.1.13" - dependencies: - iconv-lite: "npm:^0.6.2" - checksum: 10c0/36d938712ff00fe1f4bac88b43bcffb5930c1efa57bbcdca9d67e1d9d6c57cfb1200fb01efe0f3109b2ce99b231f90779532814a81370a1bd3274a0f58585039 - languageName: node - linkType: hard - -"env-paths@npm:^2.2.0": - version: 2.2.1 - resolution: "env-paths@npm:2.2.1" - checksum: 10c0/285325677bf00e30845e330eec32894f5105529db97496ee3f598478e50f008c5352a41a30e5e72ec9de8a542b5a570b85699cd63bd2bc646dbcb9f311d83bc4 - languageName: node - linkType: hard - -"err-code@npm:^2.0.2": - version: 2.0.3 - resolution: "err-code@npm:2.0.3" - checksum: 10c0/b642f7b4dd4a376e954947550a3065a9ece6733ab8e51ad80db727aaae0817c2e99b02a97a3d6cecc648a97848305e728289cf312d09af395403a90c9d4d8a66 - languageName: node - linkType: hard - -"esbuild@npm:^0.24.0": - version: 0.24.0 - resolution: "esbuild@npm:0.24.0" - dependencies: - "@esbuild/aix-ppc64": "npm:0.24.0" - "@esbuild/android-arm": "npm:0.24.0" - "@esbuild/android-arm64": "npm:0.24.0" - "@esbuild/android-x64": "npm:0.24.0" - "@esbuild/darwin-arm64": "npm:0.24.0" - "@esbuild/darwin-x64": "npm:0.24.0" - "@esbuild/freebsd-arm64": "npm:0.24.0" - "@esbuild/freebsd-x64": "npm:0.24.0" - "@esbuild/linux-arm": "npm:0.24.0" - "@esbuild/linux-arm64": "npm:0.24.0" - "@esbuild/linux-ia32": "npm:0.24.0" - "@esbuild/linux-loong64": "npm:0.24.0" - "@esbuild/linux-mips64el": "npm:0.24.0" - "@esbuild/linux-ppc64": "npm:0.24.0" - "@esbuild/linux-riscv64": "npm:0.24.0" - "@esbuild/linux-s390x": "npm:0.24.0" - "@esbuild/linux-x64": "npm:0.24.0" - "@esbuild/netbsd-x64": "npm:0.24.0" - "@esbuild/openbsd-arm64": "npm:0.24.0" - "@esbuild/openbsd-x64": "npm:0.24.0" - "@esbuild/sunos-x64": "npm:0.24.0" - "@esbuild/win32-arm64": "npm:0.24.0" - "@esbuild/win32-ia32": "npm:0.24.0" - "@esbuild/win32-x64": "npm:0.24.0" - dependenciesMeta: - "@esbuild/aix-ppc64": - optional: true - "@esbuild/android-arm": - optional: true - "@esbuild/android-arm64": - optional: true - "@esbuild/android-x64": - optional: true - "@esbuild/darwin-arm64": - optional: true - "@esbuild/darwin-x64": - optional: true - "@esbuild/freebsd-arm64": - optional: true - "@esbuild/freebsd-x64": - optional: true - "@esbuild/linux-arm": - optional: true - "@esbuild/linux-arm64": - optional: true - "@esbuild/linux-ia32": - optional: true - "@esbuild/linux-loong64": - optional: true - "@esbuild/linux-mips64el": - optional: true - "@esbuild/linux-ppc64": - optional: true - "@esbuild/linux-riscv64": - optional: true - "@esbuild/linux-s390x": - optional: true - "@esbuild/linux-x64": - optional: true - "@esbuild/netbsd-x64": - optional: true - "@esbuild/openbsd-arm64": - optional: true - "@esbuild/openbsd-x64": - optional: true - "@esbuild/sunos-x64": - optional: true - "@esbuild/win32-arm64": - optional: true - "@esbuild/win32-ia32": - optional: true - "@esbuild/win32-x64": - optional: true - bin: - esbuild: bin/esbuild - checksum: 10c0/9f1aadd8d64f3bff422ae78387e66e51a5e09de6935a6f987b6e4e189ed00fdc2d1bc03d2e33633b094008529c8b6e06c7ad1a9782fb09fec223bf95998c0683 - languageName: node - linkType: hard - -"exponential-backoff@npm:^3.1.1": - version: 3.1.1 - resolution: "exponential-backoff@npm:3.1.1" - checksum: 10c0/160456d2d647e6019640bd07111634d8c353038d9fa40176afb7cd49b0548bdae83b56d05e907c2cce2300b81cae35d800ef92fefb9d0208e190fa3b7d6bb579 - languageName: node - linkType: hard - -"foreground-child@npm:^3.1.0": - version: 3.3.0 - resolution: "foreground-child@npm:3.3.0" - dependencies: - cross-spawn: "npm:^7.0.0" - signal-exit: "npm:^4.0.1" - checksum: 10c0/028f1d41000553fcfa6c4bb5c372963bf3d9bf0b1f25a87d1a6253014343fb69dfb1b42d9625d7cf44c8ba429940f3d0ff718b62105d4d4a4f6ef8ca0a53faa2 - languageName: node - linkType: hard - -"fs-minipass@npm:^2.0.0": - version: 2.1.0 - resolution: "fs-minipass@npm:2.1.0" - dependencies: - minipass: "npm:^3.0.0" - checksum: 10c0/703d16522b8282d7299337539c3ed6edddd1afe82435e4f5b76e34a79cd74e488a8a0e26a636afc2440e1a23b03878e2122e3a2cfe375a5cf63c37d92b86a004 - languageName: node - linkType: hard - -"fs-minipass@npm:^3.0.0": - version: 3.0.3 - resolution: "fs-minipass@npm:3.0.3" - dependencies: - minipass: "npm:^7.0.3" - checksum: 10c0/63e80da2ff9b621e2cb1596abcb9207f1cf82b968b116ccd7b959e3323144cce7fb141462200971c38bbf2ecca51695069db45265705bed09a7cd93ae5b89f94 - languageName: node - linkType: hard - -"fsevents@npm:~2.3.2, fsevents@npm:~2.3.3": - version: 2.3.3 - resolution: "fsevents@npm:2.3.3" - dependencies: - node-gyp: "npm:latest" - checksum: 10c0/a1f0c44595123ed717febbc478aa952e47adfc28e2092be66b8ab1635147254ca6cfe1df792a8997f22716d4cbafc73309899ff7bfac2ac3ad8cf2e4ecc3ec60 - conditions: os=darwin - languageName: node - linkType: hard - -"fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin, fsevents@patch:fsevents@npm%3A~2.3.3#optional!builtin": - version: 2.3.3 - resolution: "fsevents@patch:fsevents@npm%3A2.3.3#optional!builtin::version=2.3.3&hash=df0bf1" - dependencies: - node-gyp: "npm:latest" - conditions: os=darwin - languageName: node - linkType: hard - -"glob@npm:^10.2.2, glob@npm:^10.3.10": - version: 10.4.5 - resolution: "glob@npm:10.4.5" - dependencies: - foreground-child: "npm:^3.1.0" - jackspeak: "npm:^3.1.2" - minimatch: "npm:^9.0.4" - minipass: "npm:^7.1.2" - package-json-from-dist: "npm:^1.0.0" - path-scurry: "npm:^1.11.1" - bin: - glob: dist/esm/bin.mjs - checksum: 10c0/19a9759ea77b8e3ca0a43c2f07ecddc2ad46216b786bb8f993c445aee80d345925a21e5280c7b7c6c59e860a0154b84e4b2b60321fea92cd3c56b4a7489f160e - languageName: node - linkType: hard - -"graceful-fs@npm:^4.2.6": - version: 4.2.11 - resolution: "graceful-fs@npm:4.2.11" - checksum: 10c0/386d011a553e02bc594ac2ca0bd6d9e4c22d7fa8cfbfc448a6d148c59ea881b092db9dbe3547ae4b88e55f1b01f7c4a2ecc53b310c042793e63aa44cf6c257f2 - languageName: node - linkType: hard - -"http-cache-semantics@npm:^4.1.1": - version: 4.1.1 - resolution: "http-cache-semantics@npm:4.1.1" - checksum: 10c0/ce1319b8a382eb3cbb4a37c19f6bfe14e5bb5be3d09079e885e8c513ab2d3cd9214902f8a31c9dc4e37022633ceabfc2d697405deeaf1b8f3552bb4ed996fdfc - languageName: node - linkType: hard - -"http-proxy-agent@npm:^7.0.0": - version: 7.0.2 - resolution: "http-proxy-agent@npm:7.0.2" - dependencies: - agent-base: "npm:^7.1.0" - debug: "npm:^4.3.4" - checksum: 10c0/4207b06a4580fb85dd6dff521f0abf6db517489e70863dca1a0291daa7f2d3d2d6015a57bd702af068ea5cf9f1f6ff72314f5f5b4228d299c0904135d2aef921 - languageName: node - linkType: hard - -"https-proxy-agent@npm:^7.0.1": - version: 7.0.5 - resolution: "https-proxy-agent@npm:7.0.5" - dependencies: - agent-base: "npm:^7.0.2" - debug: "npm:4" - checksum: 10c0/2490e3acec397abeb88807db52cac59102d5ed758feee6df6112ab3ccd8325e8a1ce8bce6f4b66e5470eca102d31e425ace904242e4fa28dbe0c59c4bafa7b2c - languageName: node - linkType: hard - -"iconv-lite@npm:^0.6.2": - version: 0.6.3 - resolution: "iconv-lite@npm:0.6.3" - dependencies: - safer-buffer: "npm:>= 2.1.2 < 3.0.0" - checksum: 10c0/98102bc66b33fcf5ac044099d1257ba0b7ad5e3ccd3221f34dd508ab4070edff183276221684e1e0555b145fce0850c9f7d2b60a9fcac50fbb4ea0d6e845a3b1 - languageName: node - linkType: hard - -"imurmurhash@npm:^0.1.4": - version: 0.1.4 - resolution: "imurmurhash@npm:0.1.4" - checksum: 10c0/8b51313850dd33605c6c9d3fd9638b714f4c4c40250cff658209f30d40da60f78992fb2df5dabee4acf589a6a82bbc79ad5486550754bd9ec4e3fc0d4a57d6a6 - languageName: node - linkType: hard - -"indent-string@npm:^4.0.0": - version: 4.0.0 - resolution: "indent-string@npm:4.0.0" - checksum: 10c0/1e1904ddb0cb3d6cce7cd09e27a90184908b7a5d5c21b92e232c93579d314f0b83c246ffb035493d0504b1e9147ba2c9b21df0030f48673fba0496ecd698161f - languageName: node - linkType: hard - -"ip-address@npm:^9.0.5": - version: 9.0.5 - resolution: "ip-address@npm:9.0.5" - dependencies: - jsbn: "npm:1.1.0" - sprintf-js: "npm:^1.1.3" - checksum: 10c0/331cd07fafcb3b24100613e4b53e1a2b4feab11e671e655d46dc09ee233da5011284d09ca40c4ecbdfe1d0004f462958675c224a804259f2f78d2465a87824bc - languageName: node - linkType: hard - -"is-fullwidth-code-point@npm:^3.0.0": - version: 3.0.0 - resolution: "is-fullwidth-code-point@npm:3.0.0" - checksum: 10c0/bb11d825e049f38e04c06373a8d72782eee0205bda9d908cc550ccb3c59b99d750ff9537982e01733c1c94a58e35400661f57042158ff5e8f3e90cf936daf0fc - languageName: node - linkType: hard - -"is-lambda@npm:^1.0.1": - version: 1.0.1 - resolution: "is-lambda@npm:1.0.1" - checksum: 10c0/85fee098ae62ba6f1e24cf22678805473c7afd0fb3978a3aa260e354cb7bcb3a5806cf0a98403188465efedec41ab4348e8e4e79305d409601323855b3839d4d - languageName: node - linkType: hard - -"isexe@npm:^2.0.0": - version: 2.0.0 - resolution: "isexe@npm:2.0.0" - checksum: 10c0/228cfa503fadc2c31596ab06ed6aa82c9976eec2bfd83397e7eaf06d0ccf42cd1dfd6743bf9aeb01aebd4156d009994c5f76ea898d2832c1fe342da923ca457d - languageName: node - linkType: hard - -"isexe@npm:^3.1.1": - version: 3.1.1 - resolution: "isexe@npm:3.1.1" - checksum: 10c0/9ec257654093443eb0a528a9c8cbba9c0ca7616ccb40abd6dde7202734d96bb86e4ac0d764f0f8cd965856aacbff2f4ce23e730dc19dfb41e3b0d865ca6fdcc7 - languageName: node - linkType: hard - -"jackspeak@npm:^3.1.2": - version: 3.4.3 - resolution: "jackspeak@npm:3.4.3" - dependencies: - "@isaacs/cliui": "npm:^8.0.2" - "@pkgjs/parseargs": "npm:^0.11.0" - dependenciesMeta: - "@pkgjs/parseargs": - optional: true - checksum: 10c0/6acc10d139eaefdbe04d2f679e6191b3abf073f111edf10b1de5302c97ec93fffeb2fdd8681ed17f16268aa9dd4f8c588ed9d1d3bffbbfa6e8bf897cbb3149b9 - languageName: node - linkType: hard - -"jsbn@npm:1.1.0": - version: 1.1.0 - resolution: "jsbn@npm:1.1.0" - checksum: 10c0/4f907fb78d7b712e11dea8c165fe0921f81a657d3443dde75359ed52eb2b5d33ce6773d97985a089f09a65edd80b11cb75c767b57ba47391fee4c969f7215c96 - languageName: node - linkType: hard - -"lru-cache@npm:^10.0.1, lru-cache@npm:^10.2.0": - version: 10.4.3 - resolution: "lru-cache@npm:10.4.3" - checksum: 10c0/ebd04fbca961e6c1d6c0af3799adcc966a1babe798f685bb84e6599266599cd95d94630b10262f5424539bc4640107e8a33aa28585374abf561d30d16f4b39fb - languageName: node - linkType: hard - -"make-fetch-happen@npm:^13.0.0": - version: 13.0.1 - resolution: "make-fetch-happen@npm:13.0.1" - dependencies: - "@npmcli/agent": "npm:^2.0.0" - cacache: "npm:^18.0.0" - http-cache-semantics: "npm:^4.1.1" - is-lambda: "npm:^1.0.1" - minipass: "npm:^7.0.2" - minipass-fetch: "npm:^3.0.0" - minipass-flush: "npm:^1.0.5" - minipass-pipeline: "npm:^1.2.4" - negotiator: "npm:^0.6.3" - proc-log: "npm:^4.2.0" - promise-retry: "npm:^2.0.1" - ssri: "npm:^10.0.0" - checksum: 10c0/df5f4dbb6d98153b751bccf4dc4cc500de85a96a9331db9805596c46aa9f99d9555983954e6c1266d9f981ae37a9e4647f42b9a4bb5466f867f4012e582c9e7e - languageName: node - linkType: hard - -"minimatch@npm:^9.0.4": - version: 9.0.5 - resolution: "minimatch@npm:9.0.5" - dependencies: - brace-expansion: "npm:^2.0.1" - checksum: 10c0/de96cf5e35bdf0eab3e2c853522f98ffbe9a36c37797778d2665231ec1f20a9447a7e567cb640901f89e4daaa95ae5d70c65a9e8aa2bb0019b6facbc3c0575ed - languageName: node - linkType: hard - -"minipass-collect@npm:^2.0.1": - version: 2.0.1 - resolution: "minipass-collect@npm:2.0.1" - dependencies: - minipass: "npm:^7.0.3" - checksum: 10c0/5167e73f62bb74cc5019594709c77e6a742051a647fe9499abf03c71dca75515b7959d67a764bdc4f8b361cf897fbf25e2d9869ee039203ed45240f48b9aa06e - languageName: node - linkType: hard - -"minipass-fetch@npm:^3.0.0": - version: 3.0.5 - resolution: "minipass-fetch@npm:3.0.5" - dependencies: - encoding: "npm:^0.1.13" - minipass: "npm:^7.0.3" - minipass-sized: "npm:^1.0.3" - minizlib: "npm:^2.1.2" - dependenciesMeta: - encoding: - optional: true - checksum: 10c0/9d702d57f556274286fdd97e406fc38a2f5c8d15e158b498d7393b1105974b21249289ec571fa2b51e038a4872bfc82710111cf75fae98c662f3d6f95e72152b - languageName: node - linkType: hard - -"minipass-flush@npm:^1.0.5": - version: 1.0.5 - resolution: "minipass-flush@npm:1.0.5" - dependencies: - minipass: "npm:^3.0.0" - checksum: 10c0/2a51b63feb799d2bb34669205eee7c0eaf9dce01883261a5b77410c9408aa447e478efd191b4de6fc1101e796ff5892f8443ef20d9544385819093dbb32d36bd - languageName: node - linkType: hard - -"minipass-pipeline@npm:^1.2.4": - version: 1.2.4 - resolution: "minipass-pipeline@npm:1.2.4" - dependencies: - minipass: "npm:^3.0.0" - checksum: 10c0/cbda57cea20b140b797505dc2cac71581a70b3247b84480c1fed5ca5ba46c25ecc25f68bfc9e6dcb1a6e9017dab5c7ada5eab73ad4f0a49d84e35093e0c643f2 - languageName: node - linkType: hard - -"minipass-sized@npm:^1.0.3": - version: 1.0.3 - resolution: "minipass-sized@npm:1.0.3" - dependencies: - minipass: "npm:^3.0.0" - checksum: 10c0/298f124753efdc745cfe0f2bdfdd81ba25b9f4e753ca4a2066eb17c821f25d48acea607dfc997633ee5bf7b6dfffb4eee4f2051eb168663f0b99fad2fa4829cb - languageName: node - linkType: hard - -"minipass@npm:^3.0.0": - version: 3.3.6 - resolution: "minipass@npm:3.3.6" - dependencies: - yallist: "npm:^4.0.0" - checksum: 10c0/a114746943afa1dbbca8249e706d1d38b85ed1298b530f5808ce51f8e9e941962e2a5ad2e00eae7dd21d8a4aae6586a66d4216d1a259385e9d0358f0c1eba16c - languageName: node - linkType: hard - -"minipass@npm:^5.0.0": - version: 5.0.0 - resolution: "minipass@npm:5.0.0" - checksum: 10c0/a91d8043f691796a8ac88df039da19933ef0f633e3d7f0d35dcd5373af49131cf2399bfc355f41515dc495e3990369c3858cd319e5c2722b4753c90bf3152462 - languageName: node - linkType: hard - -"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.2, minipass@npm:^7.0.3, minipass@npm:^7.1.2": - version: 7.1.2 - resolution: "minipass@npm:7.1.2" - checksum: 10c0/b0fd20bb9fb56e5fa9a8bfac539e8915ae07430a619e4b86ff71f5fc757ef3924b23b2c4230393af1eda647ed3d75739e4e0acb250a6b1eb277cf7f8fe449557 - languageName: node - linkType: hard - -"minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": - version: 2.1.2 - resolution: "minizlib@npm:2.1.2" - dependencies: - minipass: "npm:^3.0.0" - yallist: "npm:^4.0.0" - checksum: 10c0/64fae024e1a7d0346a1102bb670085b17b7f95bf6cfdf5b128772ec8faf9ea211464ea4add406a3a6384a7d87a0cd1a96263692134323477b4fb43659a6cab78 - languageName: node - linkType: hard - -"mkdirp@npm:^1.0.3": - version: 1.0.4 - resolution: "mkdirp@npm:1.0.4" - bin: - mkdirp: bin/cmd.js - checksum: 10c0/46ea0f3ffa8bc6a5bc0c7081ffc3907777f0ed6516888d40a518c5111f8366d97d2678911ad1a6882bf592fa9de6c784fea32e1687bb94e1f4944170af48a5cf - languageName: node - linkType: hard - -"ms@npm:^2.1.3": - version: 2.1.3 - resolution: "ms@npm:2.1.3" - checksum: 10c0/d924b57e7312b3b63ad21fc5b3dc0af5e78d61a1fc7cfb5457edaf26326bf62be5307cc87ffb6862ef1c2b33b0233cdb5d4f01c4c958cc0d660948b65a287a48 - languageName: node - linkType: hard - -"nanoid@npm:^3.3.7": - version: 3.3.8 - resolution: "nanoid@npm:3.3.8" - bin: - nanoid: bin/nanoid.cjs - checksum: 10c0/4b1bb29f6cfebf3be3bc4ad1f1296fb0a10a3043a79f34fbffe75d1621b4318319211cd420549459018ea3592f0d2f159247a6f874911d6d26eaaadda2478120 - languageName: node - linkType: hard - -"negotiator@npm:^0.6.3": - version: 0.6.4 - resolution: "negotiator@npm:0.6.4" - checksum: 10c0/3e677139c7fb7628a6f36335bf11a885a62c21d5390204590a1a214a5631fcbe5ea74ef6a610b60afe84b4d975cbe0566a23f20ee17c77c73e74b80032108dea - languageName: node - linkType: hard - -"node-gyp@npm:latest": - version: 10.2.0 - resolution: "node-gyp@npm:10.2.0" - dependencies: - env-paths: "npm:^2.2.0" - exponential-backoff: "npm:^3.1.1" - glob: "npm:^10.3.10" - graceful-fs: "npm:^4.2.6" - make-fetch-happen: "npm:^13.0.0" - nopt: "npm:^7.0.0" - proc-log: "npm:^4.1.0" - semver: "npm:^7.3.5" - tar: "npm:^6.2.1" - which: "npm:^4.0.0" - bin: - node-gyp: bin/node-gyp.js - checksum: 10c0/00630d67dbd09a45aee0a5d55c05e3916ca9e6d427ee4f7bc392d2d3dc5fad7449b21fc098dd38260a53d9dcc9c879b36704a1994235d4707e7271af7e9a835b - languageName: node - linkType: hard - -"nopt@npm:^7.0.0": - version: 7.2.1 - resolution: "nopt@npm:7.2.1" - dependencies: - abbrev: "npm:^2.0.0" - bin: - nopt: bin/nopt.js - checksum: 10c0/a069c7c736767121242037a22a788863accfa932ab285a1eb569eb8cd534b09d17206f68c37f096ae785647435e0c5a5a0a67b42ec743e481a455e5ae6a6df81 - languageName: node - linkType: hard - -"p-map@npm:^4.0.0": - version: 4.0.0 - resolution: "p-map@npm:4.0.0" - dependencies: - aggregate-error: "npm:^3.0.0" - checksum: 10c0/592c05bd6262c466ce269ff172bb8de7c6975afca9b50c975135b974e9bdaafbfe80e61aaaf5be6d1200ba08b30ead04b88cfa7e25ff1e3b93ab28c9f62a2c75 - languageName: node - linkType: hard - -"package-json-from-dist@npm:^1.0.0": - version: 1.0.1 - resolution: "package-json-from-dist@npm:1.0.1" - checksum: 10c0/62ba2785eb655fec084a257af34dbe24292ab74516d6aecef97ef72d4897310bc6898f6c85b5cd22770eaa1ce60d55a0230e150fb6a966e3ecd6c511e23d164b - languageName: node - linkType: hard - -"path-key@npm:^3.1.0": - version: 3.1.1 - resolution: "path-key@npm:3.1.1" - checksum: 10c0/748c43efd5a569c039d7a00a03b58eecd1d75f3999f5a28303d75f521288df4823bc057d8784eb72358b2895a05f29a070bc9f1f17d28226cc4e62494cc58c4c - languageName: node - linkType: hard - -"path-scurry@npm:^1.11.1": - version: 1.11.1 - resolution: "path-scurry@npm:1.11.1" - dependencies: - lru-cache: "npm:^10.2.0" - minipass: "npm:^5.0.0 || ^6.0.2 || ^7.0.0" - checksum: 10c0/32a13711a2a505616ae1cc1b5076801e453e7aae6ac40ab55b388bb91b9d0547a52f5aaceff710ea400205f18691120d4431e520afbe4266b836fadede15872d - languageName: node - linkType: hard - -"picocolors@npm:^1.1.1": - version: 1.1.1 - resolution: "picocolors@npm:1.1.1" - checksum: 10c0/e2e3e8170ab9d7c7421969adaa7e1b31434f789afb9b3f115f6b96d91945041ac3ceb02e9ec6fe6510ff036bcc0bf91e69a1772edc0b707e12b19c0f2d6bcf58 - languageName: node - linkType: hard - -"postcss@npm:^8.4.49": - version: 8.4.49 - resolution: "postcss@npm:8.4.49" - dependencies: - nanoid: "npm:^3.3.7" - picocolors: "npm:^1.1.1" - source-map-js: "npm:^1.2.1" - checksum: 10c0/f1b3f17aaf36d136f59ec373459f18129908235e65dbdc3aee5eef8eba0756106f52de5ec4682e29a2eab53eb25170e7e871b3e4b52a8f1de3d344a514306be3 - languageName: node - linkType: hard - -"proc-log@npm:^4.1.0, proc-log@npm:^4.2.0": - version: 4.2.0 - resolution: "proc-log@npm:4.2.0" - checksum: 10c0/17db4757c2a5c44c1e545170e6c70a26f7de58feb985091fb1763f5081cab3d01b181fb2dd240c9f4a4255a1d9227d163d5771b7e69c9e49a561692db865efb9 - languageName: node - linkType: hard - -"promise-retry@npm:^2.0.1": - version: 2.0.1 - resolution: "promise-retry@npm:2.0.1" - dependencies: - err-code: "npm:^2.0.2" - retry: "npm:^0.12.0" - checksum: 10c0/9c7045a1a2928094b5b9b15336dcd2a7b1c052f674550df63cc3f36cd44028e5080448175b6f6ca32b642de81150f5e7b1a98b728f15cb069f2dd60ac2616b96 - languageName: node - linkType: hard - -"retry@npm:^0.12.0": - version: 0.12.0 - resolution: "retry@npm:0.12.0" - checksum: 10c0/59933e8501727ba13ad73ef4a04d5280b3717fd650408460c987392efe9d7be2040778ed8ebe933c5cbd63da3dcc37919c141ef8af0a54a6e4fca5a2af177bfe - languageName: node - linkType: hard - -"rollup@npm:^4.23.0": - version: 4.27.4 - resolution: "rollup@npm:4.27.4" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.27.4" - "@rollup/rollup-android-arm64": "npm:4.27.4" - "@rollup/rollup-darwin-arm64": "npm:4.27.4" - "@rollup/rollup-darwin-x64": "npm:4.27.4" - "@rollup/rollup-freebsd-arm64": "npm:4.27.4" - "@rollup/rollup-freebsd-x64": "npm:4.27.4" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.27.4" - "@rollup/rollup-linux-arm-musleabihf": "npm:4.27.4" - "@rollup/rollup-linux-arm64-gnu": "npm:4.27.4" - "@rollup/rollup-linux-arm64-musl": "npm:4.27.4" - "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.27.4" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.27.4" - "@rollup/rollup-linux-s390x-gnu": "npm:4.27.4" - "@rollup/rollup-linux-x64-gnu": "npm:4.27.4" - "@rollup/rollup-linux-x64-musl": "npm:4.27.4" - "@rollup/rollup-win32-arm64-msvc": "npm:4.27.4" - "@rollup/rollup-win32-ia32-msvc": "npm:4.27.4" - "@rollup/rollup-win32-x64-msvc": "npm:4.27.4" - "@types/estree": "npm:1.0.6" - fsevents: "npm:~2.3.2" - dependenciesMeta: - "@rollup/rollup-android-arm-eabi": - optional: true - "@rollup/rollup-android-arm64": - optional: true - "@rollup/rollup-darwin-arm64": - optional: true - "@rollup/rollup-darwin-x64": - optional: true - "@rollup/rollup-freebsd-arm64": - optional: true - "@rollup/rollup-freebsd-x64": - optional: true - "@rollup/rollup-linux-arm-gnueabihf": - optional: true - "@rollup/rollup-linux-arm-musleabihf": - optional: true - "@rollup/rollup-linux-arm64-gnu": - optional: true - "@rollup/rollup-linux-arm64-musl": - optional: true - "@rollup/rollup-linux-powerpc64le-gnu": - optional: true - "@rollup/rollup-linux-riscv64-gnu": - optional: true - "@rollup/rollup-linux-s390x-gnu": - optional: true - "@rollup/rollup-linux-x64-gnu": - optional: true - "@rollup/rollup-linux-x64-musl": - optional: true - "@rollup/rollup-win32-arm64-msvc": - optional: true - "@rollup/rollup-win32-ia32-msvc": - optional: true - "@rollup/rollup-win32-x64-msvc": - optional: true - fsevents: - optional: true - bin: - rollup: dist/bin/rollup - checksum: 10c0/1442650cfea5e4617ce14743784f6f578817e31db56f9c8aaf96a82daa9bc20b6ccd66c0d677dbf302a4da3e70664dc3bef11a1aec85e6aff3cecccb945b1d35 - languageName: node - linkType: hard - -"safer-buffer@npm:>= 2.1.2 < 3.0.0": - version: 2.1.2 - resolution: "safer-buffer@npm:2.1.2" - checksum: 10c0/7e3c8b2e88a1841c9671094bbaeebd94448111dd90a81a1f606f3f67708a6ec57763b3b47f06da09fc6054193e0e6709e77325415dc8422b04497a8070fa02d4 - languageName: node - linkType: hard - -"semver@npm:^7.3.5": - version: 7.6.3 - resolution: "semver@npm:7.6.3" - bin: - semver: bin/semver.js - checksum: 10c0/88f33e148b210c153873cb08cfe1e281d518aaa9a666d4d148add6560db5cd3c582f3a08ccb91f38d5f379ead256da9931234ed122057f40bb5766e65e58adaf - languageName: node - linkType: hard - -"shebang-command@npm:^2.0.0": - version: 2.0.0 - resolution: "shebang-command@npm:2.0.0" - dependencies: - shebang-regex: "npm:^3.0.0" - checksum: 10c0/a41692e7d89a553ef21d324a5cceb5f686d1f3c040759c50aab69688634688c5c327f26f3ecf7001ebfd78c01f3c7c0a11a7c8bfd0a8bc9f6240d4f40b224e4e - languageName: node - linkType: hard - -"shebang-regex@npm:^3.0.0": - version: 3.0.0 - resolution: "shebang-regex@npm:3.0.0" - checksum: 10c0/1dbed0726dd0e1152a92696c76c7f06084eb32a90f0528d11acd764043aacf76994b2fb30aa1291a21bd019d6699164d048286309a278855ee7bec06cf6fb690 - languageName: node - linkType: hard - -"signal-exit@npm:^4.0.1": - version: 4.1.0 - resolution: "signal-exit@npm:4.1.0" - checksum: 10c0/41602dce540e46d599edba9d9860193398d135f7ff72cab629db5171516cfae628d21e7bfccde1bbfdf11c48726bc2a6d1a8fb8701125852fbfda7cf19c6aa83 - languageName: node - linkType: hard - -"smart-buffer@npm:^4.2.0": - version: 4.2.0 - resolution: "smart-buffer@npm:4.2.0" - checksum: 10c0/a16775323e1404dd43fabafe7460be13a471e021637bc7889468eb45ce6a6b207261f454e4e530a19500cc962c4cc5348583520843b363f4193cee5c00e1e539 - languageName: node - linkType: hard - -"socks-proxy-agent@npm:^8.0.3": - version: 8.0.4 - resolution: "socks-proxy-agent@npm:8.0.4" - dependencies: - agent-base: "npm:^7.1.1" - debug: "npm:^4.3.4" - socks: "npm:^2.8.3" - checksum: 10c0/345593bb21b95b0508e63e703c84da11549f0a2657d6b4e3ee3612c312cb3a907eac10e53b23ede3557c6601d63252103494caa306b66560f43af7b98f53957a - languageName: node - linkType: hard - -"socks@npm:^2.8.3": - version: 2.8.3 - resolution: "socks@npm:2.8.3" - dependencies: - ip-address: "npm:^9.0.5" - smart-buffer: "npm:^4.2.0" - checksum: 10c0/d54a52bf9325165770b674a67241143a3d8b4e4c8884560c4e0e078aace2a728dffc7f70150660f51b85797c4e1a3b82f9b7aa25e0a0ceae1a243365da5c51a7 - languageName: node - linkType: hard - -"source-map-js@npm:^1.2.1": - version: 1.2.1 - resolution: "source-map-js@npm:1.2.1" - checksum: 10c0/7bda1fc4c197e3c6ff17de1b8b2c20e60af81b63a52cb32ec5a5d67a20a7d42651e2cb34ebe93833c5a2a084377e17455854fee3e21e7925c64a51b6a52b0faf - languageName: node - linkType: hard - -"sprintf-js@npm:^1.1.3": - version: 1.1.3 - resolution: "sprintf-js@npm:1.1.3" - checksum: 10c0/09270dc4f30d479e666aee820eacd9e464215cdff53848b443964202bf4051490538e5dd1b42e1a65cf7296916ca17640aebf63dae9812749c7542ee5f288dec - languageName: node - linkType: hard - -"ssri@npm:^10.0.0": - version: 10.0.6 - resolution: "ssri@npm:10.0.6" - dependencies: - minipass: "npm:^7.0.3" - checksum: 10c0/e5a1e23a4057a86a97971465418f22ea89bd439ac36ade88812dd920e4e61873e8abd6a9b72a03a67ef50faa00a2daf1ab745c5a15b46d03e0544a0296354227 - languageName: node - linkType: hard - -"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0": - version: 4.2.3 - resolution: "string-width@npm:4.2.3" - dependencies: - emoji-regex: "npm:^8.0.0" - is-fullwidth-code-point: "npm:^3.0.0" - strip-ansi: "npm:^6.0.1" - checksum: 10c0/1e525e92e5eae0afd7454086eed9c818ee84374bb80328fc41217ae72ff5f065ef1c9d7f72da41de40c75fa8bb3dee63d92373fd492c84260a552c636392a47b - languageName: node - linkType: hard - -"string-width@npm:^5.0.1, string-width@npm:^5.1.2": - version: 5.1.2 - resolution: "string-width@npm:5.1.2" - dependencies: - eastasianwidth: "npm:^0.2.0" - emoji-regex: "npm:^9.2.2" - strip-ansi: "npm:^7.0.1" - checksum: 10c0/ab9c4264443d35b8b923cbdd513a089a60de339216d3b0ed3be3ba57d6880e1a192b70ae17225f764d7adbf5994e9bb8df253a944736c15a0240eff553c678ca - languageName: node - linkType: hard - -"strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": - version: 6.0.1 - resolution: "strip-ansi@npm:6.0.1" - dependencies: - ansi-regex: "npm:^5.0.1" - checksum: 10c0/1ae5f212a126fe5b167707f716942490e3933085a5ff6c008ab97ab2f272c8025d3aa218b7bd6ab25729ca20cc81cddb252102f8751e13482a5199e873680952 - languageName: node - linkType: hard - -"strip-ansi@npm:^7.0.1": - version: 7.1.0 - resolution: "strip-ansi@npm:7.1.0" - dependencies: - ansi-regex: "npm:^6.0.1" - checksum: 10c0/a198c3762e8832505328cbf9e8c8381de14a4fa50a4f9b2160138158ea88c0f5549fb50cb13c651c3088f47e63a108b34622ec18c0499b6c8c3a5ddf6b305ac4 - languageName: node - linkType: hard - -"tar@npm:^6.1.11, tar@npm:^6.2.1": - version: 6.2.1 - resolution: "tar@npm:6.2.1" - dependencies: - chownr: "npm:^2.0.0" - fs-minipass: "npm:^2.0.0" - minipass: "npm:^5.0.0" - minizlib: "npm:^2.1.1" - mkdirp: "npm:^1.0.3" - yallist: "npm:^4.0.0" - checksum: 10c0/a5eca3eb50bc11552d453488344e6507156b9193efd7635e98e867fab275d527af53d8866e2370cd09dfe74378a18111622ace35af6a608e5223a7d27fe99537 - languageName: node - linkType: hard - -"typescript@npm:~5.6.2": - version: 5.6.3 - resolution: "typescript@npm:5.6.3" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 10c0/44f61d3fb15c35359bc60399cb8127c30bae554cd555b8e2b46d68fa79d680354b83320ad419ff1b81a0bdf324197b29affe6cc28988cd6a74d4ac60c94f9799 - languageName: node - linkType: hard - -"typescript@patch:typescript@npm%3A~5.6.2#optional!builtin": - version: 5.6.3 - resolution: "typescript@patch:typescript@npm%3A5.6.3#optional!builtin::version=5.6.3&hash=8c6c40" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 10c0/7c9d2e07c81226d60435939618c91ec2ff0b75fbfa106eec3430f0fcf93a584bc6c73176676f532d78c3594fe28a54b36eb40b3d75593071a7ec91301533ace7 - languageName: node - linkType: hard - -"unique-filename@npm:^3.0.0": - version: 3.0.0 - resolution: "unique-filename@npm:3.0.0" - dependencies: - unique-slug: "npm:^4.0.0" - checksum: 10c0/6363e40b2fa758eb5ec5e21b3c7fb83e5da8dcfbd866cc0c199d5534c42f03b9ea9ab069769cc388e1d7ab93b4eeef28ef506ab5f18d910ef29617715101884f - languageName: node - linkType: hard - -"unique-slug@npm:^4.0.0": - version: 4.0.0 - resolution: "unique-slug@npm:4.0.0" - dependencies: - imurmurhash: "npm:^0.1.4" - checksum: 10c0/cb811d9d54eb5821b81b18205750be84cb015c20a4a44280794e915f5a0a70223ce39066781a354e872df3572e8155c228f43ff0cce94c7cbf4da2cc7cbdd635 - languageName: node - linkType: hard - -"vite@npm:^6.0.1": - version: 6.0.1 - resolution: "vite@npm:6.0.1" - dependencies: - esbuild: "npm:^0.24.0" - fsevents: "npm:~2.3.3" - postcss: "npm:^8.4.49" - rollup: "npm:^4.23.0" - peerDependencies: - "@types/node": ^18.0.0 || ^20.0.0 || >=22.0.0 - jiti: ">=1.21.0" - less: "*" - lightningcss: ^1.21.0 - sass: "*" - sass-embedded: "*" - stylus: "*" - sugarss: "*" - terser: ^5.16.0 - tsx: ^4.8.1 - yaml: ^2.4.2 - dependenciesMeta: - fsevents: - optional: true - peerDependenciesMeta: - "@types/node": - optional: true - jiti: - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - sass-embedded: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - tsx: - optional: true - yaml: - optional: true - bin: - vite: bin/vite.js - checksum: 10c0/e4d853eb9042ff29fa4d7cee1484738faaee4b1d9dcf786a94783bebb736b39af0afa7ac1a209000530638098d0a1b240b51f509d32addb028b222453f862916 - languageName: node - linkType: hard - -"web-component@workspace:.": - version: 0.0.0-use.local - resolution: "web-component@workspace:." - dependencies: - typescript: "npm:~5.6.2" - vite: "npm:^6.0.1" - languageName: unknown - linkType: soft - -"which@npm:^2.0.1": - version: 2.0.2 - resolution: "which@npm:2.0.2" - dependencies: - isexe: "npm:^2.0.0" - bin: - node-which: ./bin/node-which - checksum: 10c0/66522872a768b60c2a65a57e8ad184e5372f5b6a9ca6d5f033d4b0dc98aff63995655a7503b9c0a2598936f532120e81dd8cc155e2e92ed662a2b9377cc4374f - languageName: node - linkType: hard - -"which@npm:^4.0.0": - version: 4.0.0 - resolution: "which@npm:4.0.0" - dependencies: - isexe: "npm:^3.1.1" - bin: - node-which: bin/which.js - checksum: 10c0/449fa5c44ed120ccecfe18c433296a4978a7583bf2391c50abce13f76878d2476defde04d0f79db8165bdf432853c1f8389d0485ca6e8ebce3bbcded513d5e6a - languageName: node - linkType: hard - -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": - version: 7.0.0 - resolution: "wrap-ansi@npm:7.0.0" - dependencies: - ansi-styles: "npm:^4.0.0" - string-width: "npm:^4.1.0" - strip-ansi: "npm:^6.0.0" - checksum: 10c0/d15fc12c11e4cbc4044a552129ebc75ee3f57aa9c1958373a4db0292d72282f54373b536103987a4a7594db1ef6a4f10acf92978f79b98c49306a4b58c77d4da - languageName: node - linkType: hard - -"wrap-ansi@npm:^8.1.0": - version: 8.1.0 - resolution: "wrap-ansi@npm:8.1.0" - dependencies: - ansi-styles: "npm:^6.1.0" - string-width: "npm:^5.0.1" - strip-ansi: "npm:^7.0.1" - checksum: 10c0/138ff58a41d2f877eae87e3282c0630fc2789012fc1af4d6bd626eeb9a2f9a65ca92005e6e69a75c7b85a68479fe7443c7dbe1eb8fbaa681a4491364b7c55c60 - languageName: node - linkType: hard - -"yallist@npm:^4.0.0": - version: 4.0.0 - resolution: "yallist@npm:4.0.0" - checksum: 10c0/2286b5e8dbfe22204ab66e2ef5cc9bbb1e55dfc873bbe0d568aa943eb255d131890dfd5bf243637273d31119b870f49c18fcde2c6ffbb7a7a092b870dc90625a - languageName: node - linkType: hard +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@esbuild/aix-ppc64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz#b57697945b50e99007b4c2521507dc613d4a648c" + integrity sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw== + +"@esbuild/android-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz#1add7e0af67acefd556e407f8497e81fddad79c0" + integrity sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w== + +"@esbuild/android-arm@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.24.0.tgz#ab7263045fa8e090833a8e3c393b60d59a789810" + integrity sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew== + +"@esbuild/android-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.24.0.tgz#e8f8b196cfdfdd5aeaebbdb0110983460440e705" + integrity sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ== + +"@esbuild/darwin-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz#2d0d9414f2acbffd2d86e98253914fca603a53dd" + integrity sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw== + +"@esbuild/darwin-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz#33087aab31a1eb64c89daf3d2cf8ce1775656107" + integrity sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA== + +"@esbuild/freebsd-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz#bb76e5ea9e97fa3c753472f19421075d3a33e8a7" + integrity sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA== + +"@esbuild/freebsd-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz#e0e2ce9249fdf6ee29e5dc3d420c7007fa579b93" + integrity sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ== + +"@esbuild/linux-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz#d1b2aa58085f73ecf45533c07c82d81235388e75" + integrity sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g== + +"@esbuild/linux-arm@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz#8e4915df8ea3e12b690a057e77a47b1d5935ef6d" + integrity sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw== + +"@esbuild/linux-ia32@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz#8200b1110666c39ab316572324b7af63d82013fb" + integrity sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA== + +"@esbuild/linux-loong64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz#6ff0c99cf647504df321d0640f0d32e557da745c" + integrity sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g== + +"@esbuild/linux-mips64el@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz#3f720ccd4d59bfeb4c2ce276a46b77ad380fa1f3" + integrity sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA== + +"@esbuild/linux-ppc64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz#9d6b188b15c25afd2e213474bf5f31e42e3aa09e" + integrity sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ== + +"@esbuild/linux-riscv64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz#f989fdc9752dfda286c9cd87c46248e4dfecbc25" + integrity sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw== + +"@esbuild/linux-s390x@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz#29ebf87e4132ea659c1489fce63cd8509d1c7319" + integrity sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g== + +"@esbuild/linux-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz#4af48c5c0479569b1f359ffbce22d15f261c0cef" + integrity sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA== + +"@esbuild/netbsd-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz#1ae73d23cc044a0ebd4f198334416fb26c31366c" + integrity sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg== + +"@esbuild/openbsd-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz#5d904a4f5158c89859fd902c427f96d6a9e632e2" + integrity sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg== + +"@esbuild/openbsd-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz#4c8aa88c49187c601bae2971e71c6dc5e0ad1cdf" + integrity sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q== + +"@esbuild/sunos-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz#8ddc35a0ea38575fa44eda30a5ee01ae2fa54dd4" + integrity sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA== + +"@esbuild/win32-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz#6e79c8543f282c4539db684a207ae0e174a9007b" + integrity sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA== + +"@esbuild/win32-ia32@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz#057af345da256b7192d18b676a02e95d0fa39103" + integrity sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw== + +"@esbuild/win32-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz#168ab1c7e1c318b922637fad8f339d48b01e1244" + integrity sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA== + +"@rollup/rollup-android-arm-eabi@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.28.0.tgz#462e7ecdd60968bc9eb95a20d185e74f8243ec1b" + integrity sha512-wLJuPLT6grGZsy34g4N1yRfYeouklTgPhH1gWXCYspenKYD0s3cR99ZevOGw5BexMNywkbV3UkjADisozBmpPQ== + +"@rollup/rollup-android-arm64@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.28.0.tgz#78a2b8a8a55f71a295eb860a654ae90a2b168f40" + integrity sha512-eiNkznlo0dLmVG/6wf+Ifi/v78G4d4QxRhuUl+s8EWZpDewgk7PX3ZyECUXU0Zq/Ca+8nU8cQpNC4Xgn2gFNDA== + +"@rollup/rollup-darwin-arm64@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.28.0.tgz#5b783af714f434f1e66e3cdfa3817e0b99216d84" + integrity sha512-lmKx9yHsppblnLQZOGxdO66gT77bvdBtr/0P+TPOseowE7D9AJoBw8ZDULRasXRWf1Z86/gcOdpBrV6VDUY36Q== + +"@rollup/rollup-darwin-x64@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.28.0.tgz#f72484e842521a5261978034e18e20f778a2850d" + integrity sha512-8hxgfReVs7k9Js1uAIhS6zq3I+wKQETInnWQtgzt8JfGx51R1N6DRVy3F4o0lQwumbErRz52YqwjfvuwRxGv1w== + +"@rollup/rollup-freebsd-arm64@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.28.0.tgz#3c919dff72b2fe344811a609c674a8347b033f62" + integrity sha512-lA1zZB3bFx5oxu9fYud4+g1mt+lYXCoch0M0V/xhqLoGatbzVse0wlSQ1UYOWKpuSu3gyN4qEc0Dxf/DII1bhQ== + +"@rollup/rollup-freebsd-x64@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.28.0.tgz#b62a3a8365b363b3fdfa6da11a9188b6ab4dca7c" + integrity sha512-aI2plavbUDjCQB/sRbeUZWX9qp12GfYkYSJOrdYTL/C5D53bsE2/nBPuoiJKoWp5SN78v2Vr8ZPnB+/VbQ2pFA== + +"@rollup/rollup-linux-arm-gnueabihf@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.28.0.tgz#0d02cc55bd229bd8ca5c54f65f916ba5e0591c94" + integrity sha512-WXveUPKtfqtaNvpf0iOb0M6xC64GzUX/OowbqfiCSXTdi/jLlOmH0Ba94/OkiY2yTGTwteo4/dsHRfh5bDCZ+w== + +"@rollup/rollup-linux-arm-musleabihf@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.28.0.tgz#c51d379263201e88a60e92bd8e90878f0c044425" + integrity sha512-yLc3O2NtOQR67lI79zsSc7lk31xjwcaocvdD1twL64PK1yNaIqCeWI9L5B4MFPAVGEVjH5k1oWSGuYX1Wutxpg== + +"@rollup/rollup-linux-arm64-gnu@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.28.0.tgz#93ce2addc337b5cfa52b84f8e730d2e36eb4339b" + integrity sha512-+P9G9hjEpHucHRXqesY+3X9hD2wh0iNnJXX/QhS/J5vTdG6VhNYMxJ2rJkQOxRUd17u5mbMLHM7yWGZdAASfcg== + +"@rollup/rollup-linux-arm64-musl@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.28.0.tgz#730af6ddc091a5ba5baac28a3510691725dc808b" + integrity sha512-1xsm2rCKSTpKzi5/ypT5wfc+4bOGa/9yI/eaOLW0oMs7qpC542APWhl4A37AENGZ6St6GBMWhCCMM6tXgTIplw== + +"@rollup/rollup-linux-powerpc64le-gnu@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.28.0.tgz#b5565aac20b4de60ca1e557f525e76478b5436af" + integrity sha512-zgWxMq8neVQeXL+ouSf6S7DoNeo6EPgi1eeqHXVKQxqPy1B2NvTbaOUWPn/7CfMKL7xvhV0/+fq/Z/J69g1WAQ== + +"@rollup/rollup-linux-riscv64-gnu@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.28.0.tgz#d488290bf9338bad4ae9409c4aa8a1728835a20b" + integrity sha512-VEdVYacLniRxbRJLNtzwGt5vwS0ycYshofI7cWAfj7Vg5asqj+pt+Q6x4n+AONSZW/kVm+5nklde0qs2EUwU2g== + +"@rollup/rollup-linux-s390x-gnu@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.28.0.tgz#eb2e3f3a06acf448115045c11a5a96868c95a556" + integrity sha512-LQlP5t2hcDJh8HV8RELD9/xlYtEzJkm/aWGsauvdO2ulfl3QYRjqrKW+mGAIWP5kdNCBheqqqYIGElSRCaXfpw== + +"@rollup/rollup-linux-x64-gnu@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.28.0.tgz#065952ef2aea7e837dc7e02aa500feeaff4fc507" + integrity sha512-Nl4KIzteVEKE9BdAvYoTkW19pa7LR/RBrT6F1dJCV/3pbjwDcaOq+edkP0LXuJ9kflW/xOK414X78r+K84+msw== + +"@rollup/rollup-linux-x64-musl@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.28.0.tgz#3435d484d05f5c4d1ffd54541b4facce2887103a" + integrity sha512-eKpJr4vBDOi4goT75MvW+0dXcNUqisK4jvibY9vDdlgLx+yekxSm55StsHbxUsRxSTt3JEQvlr3cGDkzcSP8bw== + +"@rollup/rollup-win32-arm64-msvc@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.28.0.tgz#69682a2a10d9fedc334f87583cfca83c39c08077" + integrity sha512-Vi+WR62xWGsE/Oj+mD0FNAPY2MEox3cfyG0zLpotZdehPFXwz6lypkGs5y38Jd/NVSbOD02aVad6q6QYF7i8Bg== + +"@rollup/rollup-win32-ia32-msvc@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.28.0.tgz#b64470f9ac79abb386829c56750b9a4711be3332" + integrity sha512-kN/Vpip8emMLn/eOza+4JwqDZBL6MPNpkdaEsgUtW1NYN3DZvZqSQrbKzJcTL6hd8YNmFTn7XGWMwccOcJBL0A== + +"@rollup/rollup-win32-x64-msvc@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.28.0.tgz#cb313feef9ac6e3737067fdf34f42804ac65a6f2" + integrity sha512-Bvno2/aZT6usSa7lRDL2+hMjVAGjuqaymF1ApZm31JXzniR/hvr14jpU+/z4X6Gt5BPlzosscyJZGUvguXIqeQ== + +"@types/estree@1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== + +esbuild@^0.24.0: + version "0.24.0" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.24.0.tgz#f2d470596885fcb2e91c21eb3da3b3c89c0b55e7" + integrity sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ== + optionalDependencies: + "@esbuild/aix-ppc64" "0.24.0" + "@esbuild/android-arm" "0.24.0" + "@esbuild/android-arm64" "0.24.0" + "@esbuild/android-x64" "0.24.0" + "@esbuild/darwin-arm64" "0.24.0" + "@esbuild/darwin-x64" "0.24.0" + "@esbuild/freebsd-arm64" "0.24.0" + "@esbuild/freebsd-x64" "0.24.0" + "@esbuild/linux-arm" "0.24.0" + "@esbuild/linux-arm64" "0.24.0" + "@esbuild/linux-ia32" "0.24.0" + "@esbuild/linux-loong64" "0.24.0" + "@esbuild/linux-mips64el" "0.24.0" + "@esbuild/linux-ppc64" "0.24.0" + "@esbuild/linux-riscv64" "0.24.0" + "@esbuild/linux-s390x" "0.24.0" + "@esbuild/linux-x64" "0.24.0" + "@esbuild/netbsd-x64" "0.24.0" + "@esbuild/openbsd-arm64" "0.24.0" + "@esbuild/openbsd-x64" "0.24.0" + "@esbuild/sunos-x64" "0.24.0" + "@esbuild/win32-arm64" "0.24.0" + "@esbuild/win32-ia32" "0.24.0" + "@esbuild/win32-x64" "0.24.0" + +fsevents@~2.3.2, fsevents@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +nanoid@^3.3.7: + version "3.3.8" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf" + integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w== + +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + +postcss@^8.4.49: + version "8.4.49" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.49.tgz#4ea479048ab059ab3ae61d082190fabfd994fe19" + integrity sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA== + dependencies: + nanoid "^3.3.7" + picocolors "^1.1.1" + source-map-js "^1.2.1" + +rollup@^4.23.0: + version "4.28.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.28.0.tgz#eb8d28ed43ef60a18f21d0734d230ee79dd0de77" + integrity sha512-G9GOrmgWHBma4YfCcX8PjH0qhXSdH8B4HDE2o4/jaxj93S4DPCIDoLcXz99eWMji4hB29UFCEd7B2gwGJDR9cQ== + dependencies: + "@types/estree" "1.0.6" + optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.28.0" + "@rollup/rollup-android-arm64" "4.28.0" + "@rollup/rollup-darwin-arm64" "4.28.0" + "@rollup/rollup-darwin-x64" "4.28.0" + "@rollup/rollup-freebsd-arm64" "4.28.0" + "@rollup/rollup-freebsd-x64" "4.28.0" + "@rollup/rollup-linux-arm-gnueabihf" "4.28.0" + "@rollup/rollup-linux-arm-musleabihf" "4.28.0" + "@rollup/rollup-linux-arm64-gnu" "4.28.0" + "@rollup/rollup-linux-arm64-musl" "4.28.0" + "@rollup/rollup-linux-powerpc64le-gnu" "4.28.0" + "@rollup/rollup-linux-riscv64-gnu" "4.28.0" + "@rollup/rollup-linux-s390x-gnu" "4.28.0" + "@rollup/rollup-linux-x64-gnu" "4.28.0" + "@rollup/rollup-linux-x64-musl" "4.28.0" + "@rollup/rollup-win32-arm64-msvc" "4.28.0" + "@rollup/rollup-win32-ia32-msvc" "4.28.0" + "@rollup/rollup-win32-x64-msvc" "4.28.0" + fsevents "~2.3.2" + +source-map-js@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" + integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== + +typescript@~5.6.2: + version "5.6.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b" + integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw== + +vite@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/vite/-/vite-6.0.1.tgz#24c9caf24998f0598de37bed67e50ec5b9dfeaf0" + integrity sha512-Ldn6gorLGr4mCdFnmeAOLweJxZ34HjKnDm4HGo6P66IEqTxQb36VEdFJQENKxWjupNfoIjvRUnswjn1hpYEpjQ== + dependencies: + esbuild "^0.24.0" + postcss "^8.4.49" + rollup "^4.23.0" + optionalDependencies: + fsevents "~2.3.3" From 1ceffeacabd0eaed4d298c8589c381f40d4d7cda Mon Sep 17 00:00:00 2001 From: Seoin Date: Sun, 1 Dec 2024 23:10:47 +0900 Subject: [PATCH 2/9] =?UTF-8?q?feat:=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80,=20=EC=82=AD=EC=A0=9C=20=EA=B8=B0=EB=8A=A5?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Items.ts | 24 +++++++++++++++++------- src/core/Component.ts | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/components/Items.ts b/src/components/Items.ts index 4273bb9..ad85211 100644 --- a/src/components/Items.ts +++ b/src/components/Items.ts @@ -9,18 +9,28 @@ export default class Items extends Component { const { items } = this.state; return `
    - ${items.map((item: any) => `
  • ${item}
  • `).join('')} + ${items.map((item: any, key: number) => + `
  • + ${item} + +
  • `).join('')}
- + ` } setEvent() { - const button = this.$target.querySelector('button') - button?.addEventListener('click', () => { - const { items } = this.state; - this.setState({ items: [...items, `item${items.length + 1}`] }) - }) + this.$target.querySelectorAll('.deleteButton')?.forEach(deleteButton => deleteButton?.addEventListener('click', ({target}) => { + const items = [...this.state.items]; + if (target instanceof HTMLElement && target.dataset.index) { + items.splice(Number(target?.dataset?.index), 1) + } + this.setState({ items }) + })) + this.$target.querySelector('.addButton')?.addEventListener('click', () => { + const { items } = this.state; + this.setState({ items: [...items, `item${items.length + 1}`] }) + }) } } \ No newline at end of file diff --git a/src/core/Component.ts b/src/core/Component.ts index 2891d04..7235ede 100644 --- a/src/core/Component.ts +++ b/src/core/Component.ts @@ -20,7 +20,7 @@ export default class Component { } setEvent() { } setState(newState: IState) { - this.state = { ...this.state, newState }; + this.state = { ...this.state, ...newState }; this.render() } } \ No newline at end of file From 3cd9ce125c98f9e59429dfa808eb0691c8525b8b Mon Sep 17 00:00:00 2001 From: Seoin Date: Sun, 1 Dec 2024 23:44:31 +0900 Subject: [PATCH 3/9] =?UTF-8?q?refactor:=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20?= =?UTF-8?q?=EB=B2=84=EB=B8=94=EB=A7=81=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Items.ts | 34 +++++++++++++++++++++++++--------- src/core/Component.ts | 2 +- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/components/Items.ts b/src/components/Items.ts index ad85211..6c94f75 100644 --- a/src/components/Items.ts +++ b/src/components/Items.ts @@ -21,16 +21,32 @@ export default class Items extends Component { setEvent() { - this.$target.querySelectorAll('.deleteButton')?.forEach(deleteButton => deleteButton?.addEventListener('click', ({target}) => { - const items = [...this.state.items]; - if (target instanceof HTMLElement && target.dataset.index) { - items.splice(Number(target?.dataset?.index), 1) + this.$target.addEventListener('click', ({ target }) => { + if (!target || !(target instanceof HTMLElement)) return; + const items = [...this.state.items]; + + if (target && target.classList && target.classList.contains('addButton')) { + this.setState({ items: [...items, `item${items.length + 1}`] }) + } + + if (target && target.classList && target.classList.contains('deleteButton')) { + if (target instanceof HTMLElement && target.dataset.index) { + items.splice(Number(target?.dataset?.index), 1) + } + this.setState({ items }) } - this.setState({ items }) - })) - this.$target.querySelector('.addButton')?.addEventListener('click', () => { - const { items } = this.state; - this.setState({ items: [...items, `item${items.length + 1}`] }) }) + //이벤트 버블링 적용 전 코드 + // this.$target.querySelectorAll('.deleteButton')?.forEach(deleteButton => deleteButton?.addEventListener('click', ({target}) => { + // const items = [...this.state.items]; + // if (target instanceof HTMLElement && target.dataset.index) { + // items.splice(Number(target?.dataset?.index), 1) + // } + // this.setState({ items }) + // })) + // this.$target.querySelector('.addButton')?.addEventListener('click', () => { + // const { items } = this.state; + // this.setState({ items: [...items, `item${items.length + 1}`] }) + // }) } } \ No newline at end of file diff --git a/src/core/Component.ts b/src/core/Component.ts index 7235ede..5b79da7 100644 --- a/src/core/Component.ts +++ b/src/core/Component.ts @@ -9,6 +9,7 @@ export default class Component { constructor($target: HTMLElement) { this.$target = $target; this.state = {}; + this.setEvent(); this.setup(); this.render(); } @@ -16,7 +17,6 @@ export default class Component { template() { return ''; } render() { this.$target.innerHTML = this.template(); - this.setEvent(); } setEvent() { } setState(newState: IState) { From 3aa2d8f1ec99eb622c8bbdab1c94f7d4a9655e36 Mon Sep 17 00:00:00 2001 From: Seoin Date: Mon, 2 Dec 2024 00:00:38 +0900 Subject: [PATCH 4/9] =?UTF-8?q?refactor:=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20?= =?UTF-8?q?=EB=B2=84=EB=B8=94=EB=A7=81=20=EC=B6=94=EC=83=81=ED=99=94=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Items.ts | 39 ++++++++++++++++++++++++++------------- src/core/Component.ts | 8 ++++++++ 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/src/components/Items.ts b/src/components/Items.ts index 6c94f75..5c36b75 100644 --- a/src/components/Items.ts +++ b/src/components/Items.ts @@ -21,22 +21,35 @@ export default class Items extends Component { setEvent() { - this.$target.addEventListener('click', ({ target }) => { - if (!target || !(target instanceof HTMLElement)) return; + // 이벤트 버블링 추상화 적용한 코드 + this.addEvent('click', '.addButton', ({ target }) => { + const { items } = this.state; + this.setState({ items: [...items, `item${items.length + 1}`] }) + }) + this.addEvent('click', '.deleteButton', ({ target }) => { const items = [...this.state.items]; - - if (target && target.classList && target.classList.contains('addButton')) { - this.setState({ items: [...items, `item${items.length + 1}`] }) - } - - if (target && target.classList && target.classList.contains('deleteButton')) { if (target instanceof HTMLElement && target.dataset.index) { - items.splice(Number(target?.dataset?.index), 1) - } - this.setState({ items }) - } + items.splice(Number(target?.dataset?.index), 1) + } + this.setState({ items }) }) - //이벤트 버블링 적용 전 코드 + // 이벤트 버블링 적용한 코드 + // this.$target.addEventListener('click', ({ target }) => { + // if (!target || !(target instanceof HTMLElement)) return; + // const items = [...this.state.items]; + + // if (target && target.classList && target.classList.contains('addButton')) { + // this.setState({ items: [...items, `item${items.length + 1}`] }) + // } + + // if (target && target.classList && target.classList.contains('deleteButton')) { + // if (target instanceof HTMLElement && target.dataset.index) { + // items.splice(Number(target?.dataset?.index), 1) + // } + // this.setState({ items }) + // } + // }) + // 이벤트 버블링 적용 전 코드 // this.$target.querySelectorAll('.deleteButton')?.forEach(deleteButton => deleteButton?.addEventListener('click', ({target}) => { // const items = [...this.state.items]; // if (target instanceof HTMLElement && target.dataset.index) { diff --git a/src/core/Component.ts b/src/core/Component.ts index 5b79da7..51bf046 100644 --- a/src/core/Component.ts +++ b/src/core/Component.ts @@ -23,4 +23,12 @@ export default class Component { this.state = { ...this.state, ...newState }; this.render() } + + addEvent(eventType: string, selector: string, callback: (event: Event) => void ) { + const children = [...this.$target.querySelectorAll(selector)]; + this.$target.addEventListener(eventType, event => { + if (event && event.target instanceof HTMLElement && !event.target.closest(selector)) return false; + callback(event) + }) + } } \ No newline at end of file From 5e441cf16b636f758b43dc8225d56c502cbbe6ae Mon Sep 17 00:00:00 2001 From: Seoin Date: Wed, 4 Dec 2024 14:41:29 +0900 Subject: [PATCH 5/9] =?UTF-8?q?feat:=20=ED=86=A0=EA=B8=80=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Items.ts | 95 ++++++++++++++++++++++++++++++++++------- src/core/Component.ts | 5 +-- 2 files changed, 81 insertions(+), 19 deletions(-) diff --git a/src/components/Items.ts b/src/components/Items.ts index 5c36b75..0087a86 100644 --- a/src/components/Items.ts +++ b/src/components/Items.ts @@ -1,38 +1,101 @@ import Component from "../core/Component"; +interface IItem { + id: number; + content: string; + active: boolean; +} + export default class Items extends Component { setup() { - this.state = { items: ['item1', 'item2'] } + this.state = { isFilter: 0, items: [{ id: 1, content: 'item1', active: false }, { id: 2, content: 'item2', active: true }] } + } + + get filteredItems(): IItem[] { + const { isFilter, items } = this.state; + return items.filter(({ active }: { active: boolean }) => (isFilter === 1 && active) || (isFilter === 2 && !active) || (isFilter === 0) ) } template() { - const { items } = this.state; return ` -
    - ${items.map((item: any, key: number) => - `
  • - ${item} - -
  • `).join('')} -
- +
+ +
+
+
    + ${this.filteredItems.map(({ id, content, active }) => + `
  • + ${content} + + +
  • `).join('')} +
+
+
+ + + +
` } setEvent() { - // 이벤트 버블링 추상화 적용한 코드 - this.addEvent('click', '.addButton', ({ target }) => { + this.addEvent('keyup', '.appender', (event) => { + const { key, target } = event + if (key !== 'Enter') return; const { items } = this.state; - this.setState({ items: [...items, `item${items.length + 1}`] }) + const id = Math.max(0, ...items.map((v: IItem) => v.id)) + 1; + const content = (target as HTMLInputElement)?.value; + const active = false; + this.setState({ + items: [ + ...items, + {id, content, active} + ] + }) }) + this.addEvent('click', '.deleteButton', ({ target }) => { const items = [...this.state.items]; - if (target instanceof HTMLElement && target.dataset.index) { - items.splice(Number(target?.dataset?.index), 1) - } + if (target instanceof HTMLElement && target.dataset.id) { + const id = Number(target?.dataset?.id) + const index = items.findIndex(item => item.id === id) + items.splice(index, 1) + this.setState({ items }) + } + }) + + this.addEvent('click', '.toggleButton', ({ target }) => { + const items = [...this.state.items]; + if (target instanceof HTMLElement && target.dataset.id) { + const id = Number(target?.dataset?.id) + const index = items.findIndex(v => v.id === id); + items[index].active = !items[index].active; + } this.setState({ items }) }) + + this.addEvent('click', '.filterButton', ({ target }) => { + if (target instanceof HTMLElement && target.dataset.isFilter) { + this.setState({ isFilter: Number(target.dataset.isFilter) }) + } + }) + + // 이벤트 버블링 추상화 적용한 코드 + // this.addEvent('click', '.addButton', ({ target }) => { + // const items = [...this.state.items]; + // this.setState({ items: [...items, `item${items.length + 1}`] }) + // }) + // this.addEvent('click', '.deleteButton', ({ target }) => { + // const items = [...this.state.items]; + // if (target instanceof HTMLElement && target.dataset.index) { + // items.splice(Number(target?.dataset?.index), 1) + // } + // this.setState({ items }) + // }) // 이벤트 버블링 적용한 코드 // this.$target.addEventListener('click', ({ target }) => { // if (!target || !(target instanceof HTMLElement)) return; diff --git a/src/core/Component.ts b/src/core/Component.ts index 51bf046..b5d2c74 100644 --- a/src/core/Component.ts +++ b/src/core/Component.ts @@ -24,11 +24,10 @@ export default class Component { this.render() } - addEvent(eventType: string, selector: string, callback: (event: Event) => void ) { - const children = [...this.$target.querySelectorAll(selector)]; + addEvent(eventType: string, selector: string, callback: (event: T) => void ) { this.$target.addEventListener(eventType, event => { if (event && event.target instanceof HTMLElement && !event.target.closest(selector)) return false; - callback(event) + callback(event as T) }) } } \ No newline at end of file From 5d355f5a332e5a43a33ab6f752423e4f67395e62 Mon Sep 17 00:00:00 2001 From: Seoin Date: Thu, 5 Dec 2024 11:39:27 +0900 Subject: [PATCH 6/9] =?UTF-8?q?refactor:=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=EB=B6=84=ED=95=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.ts | 185 +++++++++++++++++++++++++++++++++ src/components/ItemAppender.ts | 18 ++++ src/components/ItemFilter.ts | 31 ++++++ src/components/Items.ts | 102 ++---------------- src/core/Component.ts | 10 +- src/main.ts | 8 +- 6 files changed, 254 insertions(+), 100 deletions(-) create mode 100644 src/App.ts create mode 100644 src/components/ItemAppender.ts create mode 100644 src/components/ItemFilter.ts diff --git a/src/App.ts b/src/App.ts new file mode 100644 index 0000000..3a3d2fb --- /dev/null +++ b/src/App.ts @@ -0,0 +1,185 @@ +import Component from "./core/Component"; +import Items from "./components/Items"; +import ItemAppender from "./components/ItemAppender"; +import ItemFilter from "./components/ItemFilter"; + +interface IItem { + id: number; + content: string; + active: boolean; +} + +export default class App extends Component { + setup() { + this.state = { isFilter: 0, items: [{ id: 1, content: 'item1', active: false }, { id: 2, content: 'item2', active: true }] } + } + + template() { + return ` +
+
+
+ ` + // return ` + //
+ // + //
+ //
+ //
    + // ${this.filteredItems.map(({ id, content, active }) => + // `
  • + // ${content} + // + // + //
  • `).join('')} + //
+ //
+ //
+ // + // + // + //
+ // ` + } + + mounted() { + const { filteredItems, addItem, deleteItem, toggleItem, filterItem } = this; + const $itemAppender = this.$target.querySelector('[data-component="item-appender"]') + const $items = this.$target.querySelector('[data-component="items"]') + const $itemFilter = this.$target.querySelector('[data-component="item-filter"]') + + new ItemAppender(($itemAppender as HTMLElement), { + addItem: addItem.bind(this) + }) + + new Items(($items as HTMLElement), { + filteredItems, + deleteItem: deleteItem.bind(this), + toggleItem: toggleItem.bind(this) + }) + + new ItemFilter(($itemFilter as HTMLElement), { + filterItem: filterItem.bind(this) + }) + } + + get filteredItems(): IItem[] { + const { isFilter, items } = this.state; + return items.filter(({ active }: { active: boolean }) => (isFilter === 1 && active) || (isFilter === 2 && !active) || (isFilter === 0) ) + } + + addItem(content: string) { + const { items } = this.state; + const id = Math.max(0, ...items.map((v: IItem) => v.id)) + 1; + const active = false; + this.setState({ + items: [ + ...items, + {id, content, active} + ] + }) + } + + deleteItem(id: number) { + const items = [...this.state.items]; + const index = items.findIndex(item => item.id === id) + items.splice(index, 1) + this.setState({ items }) + } + + toggleItem(id: number) { + const items = [...this.state.items]; + const index = items.findIndex(v => v.id === id); + items[index].active = !items[index].active; + this.setState({ items }) + } + + filterItem(isFilter: number) { + this.setState({ isFilter }) + } + + // setEvent() { + // this.addEvent('keyup', '.appender', (event) => { + // const { key, target } = event + // if (key !== 'Enter') return; + // const { items } = this.state; + // const id = Math.max(0, ...items.map((v: IItem) => v.id)) + 1; + // const content = (target as HTMLInputElement)?.value; + // const active = false; + // this.setState({ + // items: [ + // ...items, + // {id, content, active} + // ] + // }) + // }) + + // this.addEvent('click', '.deleteButton', ({ target }) => { + // const items = [...this.state.items]; + // if (target instanceof HTMLElement && target.dataset.id) { + // const id = Number(target?.dataset?.id) + // const index = items.findIndex(item => item.id === id) + // items.splice(index, 1) + // this.setState({ items }) + // } + // }) + + // this.addEvent('click', '.toggleButton', ({ target }) => { + // const items = [...this.state.items]; + // if (target instanceof HTMLElement && target.dataset.id) { + // const id = Number(target?.dataset?.id) + // const index = items.findIndex(v => v.id === id); + // items[index].active = !items[index].active; + // } + // this.setState({ items }) + // }) + + // this.addEvent('click', '.filterButton', ({ target }) => { + // if (target instanceof HTMLElement && target.dataset.isFilter) { + // this.setState({ isFilter: Number(target.dataset.isFilter) }) + // } + // }) + + // 이벤트 버블링 추상화 적용한 코드 + // this.addEvent('click', '.addButton', ({ target }) => { + // const items = [...this.state.items]; + // this.setState({ items: [...items, `item${items.length + 1}`] }) + // }) + // this.addEvent('click', '.deleteButton', ({ target }) => { + // const items = [...this.state.items]; + // if (target instanceof HTMLElement && target.dataset.index) { + // items.splice(Number(target?.dataset?.index), 1) + // } + // this.setState({ items }) + // }) + // 이벤트 버블링 적용한 코드 + // this.$target.addEventListener('click', ({ target }) => { + // if (!target || !(target instanceof HTMLElement)) return; + // const items = [...this.state.items]; + + // if (target && target.classList && target.classList.contains('addButton')) { + // this.setState({ items: [...items, `item${items.length + 1}`] }) + // } + + // if (target && target.classList && target.classList.contains('deleteButton')) { + // if (target instanceof HTMLElement && target.dataset.index) { + // items.splice(Number(target?.dataset?.index), 1) + // } + // this.setState({ items }) + // } + // }) + // 이벤트 버블링 적용 전 코드 + // this.$target.querySelectorAll('.deleteButton')?.forEach(deleteButton => deleteButton?.addEventListener('click', ({target}) => { + // const items = [...this.state.items]; + // if (target instanceof HTMLElement && target.dataset.index) { + // items.splice(Number(target?.dataset?.index), 1) + // } + // this.setState({ items }) + // })) + // this.$target.querySelector('.addButton')?.addEventListener('click', () => { + // const { items } = this.state; + // this.setState({ items: [...items, `item${items.length + 1}`] }) + // }) +} \ No newline at end of file diff --git a/src/components/ItemAppender.ts b/src/components/ItemAppender.ts new file mode 100644 index 0000000..0760edf --- /dev/null +++ b/src/components/ItemAppender.ts @@ -0,0 +1,18 @@ +import Component from "../core/Component"; + +export default class ItemAppender extends Component { + template() { + return ` + + ` + } + + setEvent() { + const { addItem } = this.props + this.addEvent('keyup', '.appender', (event) => { + const { key, target } = event + if (key !== 'Enter') return; + addItem((target as HTMLInputElement)?.value) + }) + } +} \ No newline at end of file diff --git a/src/components/ItemFilter.ts b/src/components/ItemFilter.ts new file mode 100644 index 0000000..9f1a69d --- /dev/null +++ b/src/components/ItemFilter.ts @@ -0,0 +1,31 @@ +import Component from "../core/Component"; + +interface IItemFilter { + filterItem: (isFilter: number ) => void; +} + +export default class ItemFilter extends Component { + props: IItemFilter; + + constructor($target: HTMLElement, props: IItemFilter) { + super($target, props); + this.props = props; + } + + template() { + return ` + + + + ` + } + + setEvent() { + const { filterItem } = this.props + this.addEvent('click', '.filterButton', ({ target }) => { + if (target instanceof HTMLElement && target.dataset.isFilter) { + filterItem(Number(target.dataset.isFilter)) + } + }) + } +} \ No newline at end of file diff --git a/src/components/Items.ts b/src/components/Items.ts index 0087a86..2b492d0 100644 --- a/src/components/Items.ts +++ b/src/components/Items.ts @@ -7,24 +7,12 @@ interface IItem { } export default class Items extends Component { - setup() { - this.state = { isFilter: 0, items: [{ id: 1, content: 'item1', active: false }, { id: 2, content: 'item2', active: true }] } - } - - get filteredItems(): IItem[] { - const { isFilter, items } = this.state; - return items.filter(({ active }: { active: boolean }) => (isFilter === 1 && active) || (isFilter === 2 && !active) || (isFilter === 0) ) - } - template() { + const { filteredItems } = this.props return ` -
- -
-
    - ${this.filteredItems.map(({ id, content, active }) => - `
  • + ${filteredItems.map(({ id, content, active }: IItem) => + `
  • ${content}
  • `).join('')}
-
-
- - - -
` } - setEvent() { - this.addEvent('keyup', '.appender', (event) => { - const { key, target } = event - if (key !== 'Enter') return; - const { items } = this.state; - const id = Math.max(0, ...items.map((v: IItem) => v.id)) + 1; - const content = (target as HTMLInputElement)?.value; - const active = false; - this.setState({ - items: [ - ...items, - {id, content, active} - ] - }) - }) - + const { deleteItem, toggleItem } = this.props this.addEvent('click', '.deleteButton', ({ target }) => { - const items = [...this.state.items]; if (target instanceof HTMLElement && target.dataset.id) { - const id = Number(target?.dataset?.id) - const index = items.findIndex(item => item.id === id) - items.splice(index, 1) - this.setState({ items }) - } + deleteItem(Number(target?.dataset?.id)) + } }) this.addEvent('click', '.toggleButton', ({ target }) => { - const items = [...this.state.items]; if (target instanceof HTMLElement && target.dataset.id) { - const id = Number(target?.dataset?.id) - const index = items.findIndex(v => v.id === id); - items[index].active = !items[index].active; + toggleItem(Number(target?.dataset?.id)) } - this.setState({ items }) }) - - this.addEvent('click', '.filterButton', ({ target }) => { - if (target instanceof HTMLElement && target.dataset.isFilter) { - this.setState({ isFilter: Number(target.dataset.isFilter) }) - } - }) - - // 이벤트 버블링 추상화 적용한 코드 - // this.addEvent('click', '.addButton', ({ target }) => { - // const items = [...this.state.items]; - // this.setState({ items: [...items, `item${items.length + 1}`] }) - // }) - // this.addEvent('click', '.deleteButton', ({ target }) => { - // const items = [...this.state.items]; - // if (target instanceof HTMLElement && target.dataset.index) { - // items.splice(Number(target?.dataset?.index), 1) - // } - // this.setState({ items }) - // }) - // 이벤트 버블링 적용한 코드 - // this.$target.addEventListener('click', ({ target }) => { - // if (!target || !(target instanceof HTMLElement)) return; - // const items = [...this.state.items]; - - // if (target && target.classList && target.classList.contains('addButton')) { - // this.setState({ items: [...items, `item${items.length + 1}`] }) - // } - - // if (target && target.classList && target.classList.contains('deleteButton')) { - // if (target instanceof HTMLElement && target.dataset.index) { - // items.splice(Number(target?.dataset?.index), 1) - // } - // this.setState({ items }) - // } - // }) - // 이벤트 버블링 적용 전 코드 - // this.$target.querySelectorAll('.deleteButton')?.forEach(deleteButton => deleteButton?.addEventListener('click', ({target}) => { - // const items = [...this.state.items]; - // if (target instanceof HTMLElement && target.dataset.index) { - // items.splice(Number(target?.dataset?.index), 1) - // } - // this.setState({ items }) - // })) - // this.$target.querySelector('.addButton')?.addEventListener('click', () => { - // const { items } = this.state; - // this.setState({ items: [...items, `item${items.length + 1}`] }) - // }) } } \ No newline at end of file diff --git a/src/core/Component.ts b/src/core/Component.ts index b5d2c74..4c2799d 100644 --- a/src/core/Component.ts +++ b/src/core/Component.ts @@ -2,21 +2,29 @@ interface IState { [key: string]: any; } +interface IProps { + [key: string]: any; +} + export default class Component { $target: HTMLElement; + props: IProps; state: IState; - constructor($target: HTMLElement) { + constructor($target: HTMLElement, props: IProps = {}) { this.$target = $target; + this.props = props; this.state = {}; this.setEvent(); this.setup(); this.render(); } setup() { }; + mounted() { }; template() { return ''; } render() { this.$target.innerHTML = this.template(); + this.mounted() } setEvent() { } setState(newState: IState) { diff --git a/src/main.ts b/src/main.ts index 88dbd63..9984dd0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,10 +1,10 @@ -import Items from "./components/Items"; +import App from './App' class Main { constructor(){ - const $main: Element | null = document.querySelector('#app'); - if ($main instanceof HTMLElement) { - new Items($main); + const $app: Element | null = document.querySelector('#app'); + if ($app instanceof HTMLElement) { + new App($app); } else { console.error('Element with ID "app" not found.'); } From a5f8155a114b67545eed3847079fb70965fb0ba1 Mon Sep 17 00:00:00 2001 From: Seoin Date: Thu, 5 Dec 2024 11:59:26 +0900 Subject: [PATCH 7/9] =?UTF-8?q?chore:=20=EC=A3=BC=EC=84=9D=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.ts | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/App.ts b/src/App.ts index 3a3d2fb..769d3a1 100644 --- a/src/App.ts +++ b/src/App.ts @@ -20,6 +20,7 @@ export default class App extends Component {
` + // 컴포넌트 분할 전 // return ` //
// @@ -100,21 +101,22 @@ export default class App extends Component { this.setState({ isFilter }) } + // 컴포넌트 분할 전 // setEvent() { - // this.addEvent('keyup', '.appender', (event) => { - // const { key, target } = event - // if (key !== 'Enter') return; - // const { items } = this.state; - // const id = Math.max(0, ...items.map((v: IItem) => v.id)) + 1; - // const content = (target as HTMLInputElement)?.value; - // const active = false; - // this.setState({ - // items: [ - // ...items, - // {id, content, active} - // ] - // }) - // }) + // this.addEvent('keyup', '.appender', (event) => { + // const { key, target } = event + // if (key !== 'Enter') return; + // const { items } = this.state; + // const id = Math.max(0, ...items.map((v: IItem) => v.id)) + 1; + // const content = (target as HTMLInputElement)?.value; + // const active = false; + // this.setState({ + // items: [ + // ...items, + // {id, content, active} + // ] + // }) + // }) // this.addEvent('click', '.deleteButton', ({ target }) => { // const items = [...this.state.items]; @@ -140,7 +142,7 @@ export default class App extends Component { // if (target instanceof HTMLElement && target.dataset.isFilter) { // this.setState({ isFilter: Number(target.dataset.isFilter) }) // } - // }) + // }) // 이벤트 버블링 추상화 적용한 코드 // this.addEvent('click', '.addButton', ({ target }) => { @@ -170,6 +172,7 @@ export default class App extends Component { // this.setState({ items }) // } // }) + // 이벤트 버블링 적용 전 코드 // this.$target.querySelectorAll('.deleteButton')?.forEach(deleteButton => deleteButton?.addEventListener('click', ({target}) => { // const items = [...this.state.items]; From d1a0a6310fd42a4999ddf8398cd0dbf68edad977 Mon Sep 17 00:00:00 2001 From: Seoin Date: Thu, 5 Dec 2024 16:41:26 +0900 Subject: [PATCH 8/9] =?UTF-8?q?refactor:=20=EC=B2=98=EC=9D=8C=20=EB=A0=8C?= =?UTF-8?q?=EB=8D=94=EB=A7=81=20=EC=8B=9C=EC=97=90=EB=A7=8C=20=EB=A7=88?= =?UTF-8?q?=EC=9A=B4=ED=8A=B8=20=EC=8B=A4=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/Component.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/Component.ts b/src/core/Component.ts index 4c2799d..5abe31c 100644 --- a/src/core/Component.ts +++ b/src/core/Component.ts @@ -10,21 +10,27 @@ export default class Component { $target: HTMLElement; props: IProps; state: IState; + isMounted: boolean; constructor($target: HTMLElement, props: IProps = {}) { this.$target = $target; this.props = props; this.state = {}; + this.isMounted = false; this.setEvent(); this.setup(); this.render(); } setup() { }; - mounted() { }; + mounted() { + if (!this.isMounted) { + this.isMounted = true; + } + }; template() { return ''; } render() { this.$target.innerHTML = this.template(); - this.mounted() + !this.isMounted && this.mounted() } setEvent() { } setState(newState: IState) { From 5ae065137fe4d0a1987811902d1350d2a1fa6689 Mon Sep 17 00:00:00 2001 From: Seoin Date: Sun, 8 Dec 2024 19:03:56 +0900 Subject: [PATCH 9/9] =?UTF-8?q?refactor:=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.ts | 26 +++++++++++------------ src/components/ItemAdd.ts | 22 +++++++++++++++++++ src/components/ItemAppender.ts | 18 ---------------- src/components/ItemFilter.ts | 9 +------- src/components/{Items.ts => ListItems.ts} | 8 ++++++- src/core/Component.ts | 23 ++++++++------------ src/main.ts | 2 +- 7 files changed, 53 insertions(+), 55 deletions(-) create mode 100644 src/components/ItemAdd.ts delete mode 100644 src/components/ItemAppender.ts rename src/components/{Items.ts => ListItems.ts} (84%) diff --git a/src/App.ts b/src/App.ts index 769d3a1..d7cb642 100644 --- a/src/App.ts +++ b/src/App.ts @@ -1,6 +1,6 @@ import Component from "./core/Component"; -import Items from "./components/Items"; -import ItemAppender from "./components/ItemAppender"; +import ListItems from "./components/ListItems"; +import ItemAdd from "./components/ItemAdd"; import ItemFilter from "./components/ItemFilter"; interface IItem { @@ -16,7 +16,7 @@ export default class App extends Component { template() { return ` -
+
` @@ -46,32 +46,32 @@ export default class App extends Component { } mounted() { - const { filteredItems, addItem, deleteItem, toggleItem, filterItem } = this; - const $itemAppender = this.$target.querySelector('[data-component="item-appender"]') - const $items = this.$target.querySelector('[data-component="items"]') - const $itemFilter = this.$target.querySelector('[data-component="item-filter"]') + const { filteredItems, addListItem, deleteItem, toggleItem, filterItem } = this; + const $itemAdd = this.$target.querySelector('[data-component="item-add"]') as HTMLInputElement; + const $listItems = this.$target.querySelector('[data-component="items"]') as HTMLUListElement; + const $itemFilter = this.$target.querySelector('[data-component="item-filter"]') as HTMLButtonElement; - new ItemAppender(($itemAppender as HTMLElement), { - addItem: addItem.bind(this) + new ItemAdd(($itemAdd), { + addListItem: addListItem.bind(this) }) - new Items(($items as HTMLElement), { + new ListItems(($listItems), { filteredItems, deleteItem: deleteItem.bind(this), toggleItem: toggleItem.bind(this) }) - new ItemFilter(($itemFilter as HTMLElement), { + new ItemFilter(($itemFilter), { filterItem: filterItem.bind(this) }) } get filteredItems(): IItem[] { const { isFilter, items } = this.state; - return items.filter(({ active }: { active: boolean }) => (isFilter === 1 && active) || (isFilter === 2 && !active) || (isFilter === 0) ) + return items.filter(({ active }: IItem) => (isFilter === 1 && active) || (isFilter === 2 && !active) || (isFilter === 0) ) } - addItem(content: string) { + addListItem(content: string) { const { items } = this.state; const id = Math.max(0, ...items.map((v: IItem) => v.id)) + 1; const active = false; diff --git a/src/components/ItemAdd.ts b/src/components/ItemAdd.ts new file mode 100644 index 0000000..8315137 --- /dev/null +++ b/src/components/ItemAdd.ts @@ -0,0 +1,22 @@ +import Component from "../core/Component"; + +interface IItemAdd { + addListItem: (content: string) => void; +} + +export default class ItemAdd extends Component { + template() { + return ` + + ` + } + + setEvent() { + const { addListItem } = this.props + this.addEvent('keyup', '.addListItem', (event) => { + const { key, target } = event + if (key !== 'Enter') return; + addListItem((target as HTMLInputElement)?.value) + }) + } +} \ No newline at end of file diff --git a/src/components/ItemAppender.ts b/src/components/ItemAppender.ts deleted file mode 100644 index 0760edf..0000000 --- a/src/components/ItemAppender.ts +++ /dev/null @@ -1,18 +0,0 @@ -import Component from "../core/Component"; - -export default class ItemAppender extends Component { - template() { - return ` - - ` - } - - setEvent() { - const { addItem } = this.props - this.addEvent('keyup', '.appender', (event) => { - const { key, target } = event - if (key !== 'Enter') return; - addItem((target as HTMLInputElement)?.value) - }) - } -} \ No newline at end of file diff --git a/src/components/ItemFilter.ts b/src/components/ItemFilter.ts index 9f1a69d..b520a76 100644 --- a/src/components/ItemFilter.ts +++ b/src/components/ItemFilter.ts @@ -4,14 +4,7 @@ interface IItemFilter { filterItem: (isFilter: number ) => void; } -export default class ItemFilter extends Component { - props: IItemFilter; - - constructor($target: HTMLElement, props: IItemFilter) { - super($target, props); - this.props = props; - } - +export default class ItemFilter extends Component { template() { return ` diff --git a/src/components/Items.ts b/src/components/ListItems.ts similarity index 84% rename from src/components/Items.ts rename to src/components/ListItems.ts index 2b492d0..effba60 100644 --- a/src/components/Items.ts +++ b/src/components/ListItems.ts @@ -6,7 +6,13 @@ interface IItem { active: boolean; } -export default class Items extends Component { +interface IListItems { + filteredItems: IItem[]; + deleteItem: (id: number) => void; + toggleItem: (id: number) => void; +} + +export default class ListItems extends Component { template() { const { filteredItems } = this.props return ` diff --git a/src/core/Component.ts b/src/core/Component.ts index 5abe31c..53d5bbe 100644 --- a/src/core/Component.ts +++ b/src/core/Component.ts @@ -1,21 +1,15 @@ -interface IState { - [key: string]: any; -} +type TComponentData = Record -interface IProps { - [key: string]: any; -} - -export default class Component { +export default class Component { $target: HTMLElement; - props: IProps; - state: IState; + props: Props; + state: State; isMounted: boolean; - constructor($target: HTMLElement, props: IProps = {}) { + constructor($target: HTMLElement, props: Props) { this.$target = $target; this.props = props; - this.state = {}; + this.state = {} as State; this.isMounted = false; this.setEvent(); this.setup(); @@ -24,6 +18,7 @@ export default class Component { setup() { }; mounted() { if (!this.isMounted) { + console.log(this.mounted) this.isMounted = true; } }; @@ -33,12 +28,12 @@ export default class Component { !this.isMounted && this.mounted() } setEvent() { } - setState(newState: IState) { + setState(newState: State) { this.state = { ...this.state, ...newState }; this.render() } - addEvent(eventType: string, selector: string, callback: (event: T) => void ) { + addEvent(eventType: keyof HTMLElementEventMap, selector: keyof HTMLElementTagNameMap | string, callback: (event: T) => void ) { this.$target.addEventListener(eventType, event => { if (event && event.target instanceof HTMLElement && !event.target.closest(selector)) return false; callback(event as T) diff --git a/src/main.ts b/src/main.ts index 9984dd0..792f4bb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,7 +4,7 @@ class Main { constructor(){ const $app: Element | null = document.querySelector('#app'); if ($app instanceof HTMLElement) { - new App($app); + new App($app, {}); } else { console.error('Element with ID "app" not found.'); }