@dooboostore/simple-web-component 1.0.50 → 1.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +735 -354
- package/dist/cjs/SwcAppEngine.js.map +2 -2
- package/dist/cjs/decorators/addEventListener.js +64 -146
- package/dist/cjs/decorators/addEventListener.js.map +2 -2
- package/dist/cjs/decorators/applyAttribute.js +36 -48
- package/dist/cjs/decorators/applyAttribute.js.map +2 -2
- package/dist/cjs/decorators/applyClass.js +9 -12
- package/dist/cjs/decorators/applyClass.js.map +2 -2
- package/dist/cjs/decorators/applyNode.js +14 -22
- package/dist/cjs/decorators/applyNode.js.map +2 -2
- package/dist/cjs/decorators/applyProperty.js +12 -42
- package/dist/cjs/decorators/applyProperty.js.map +2 -2
- package/dist/cjs/decorators/applySlot.js +3 -3
- package/dist/cjs/decorators/applySlot.js.map +2 -2
- package/dist/cjs/decorators/applyStyle.js +9 -12
- package/dist/cjs/decorators/applyStyle.js.map +2 -2
- package/dist/cjs/decorators/around.js +124 -0
- package/dist/cjs/decorators/around.js.map +7 -0
- package/dist/cjs/decorators/changedAttribute.js +40 -12
- package/dist/cjs/decorators/changedAttribute.js.map +2 -2
- package/dist/cjs/decorators/elementDefine.js +224 -195
- package/dist/cjs/decorators/elementDefine.js.map +3 -3
- package/dist/cjs/decorators/emitCustomEvent.js +14 -12
- package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
- package/dist/cjs/decorators/eventMedia.js +36 -8
- package/dist/cjs/decorators/eventMedia.js.map +2 -2
- package/dist/cjs/decorators/fetch.js +278 -0
- package/dist/cjs/decorators/fetch.js.map +7 -0
- package/dist/cjs/decorators/index.js +5 -2
- package/dist/cjs/decorators/index.js.map +2 -2
- package/dist/cjs/decorators/intersectionObserver.js +33 -13
- package/dist/cjs/decorators/intersectionObserver.js.map +2 -2
- package/dist/cjs/decorators/lifecycles.js +11 -11
- package/dist/cjs/decorators/lifecycles.js.map +2 -2
- package/dist/cjs/decorators/mutationObserver.js +55 -39
- package/dist/cjs/decorators/mutationObserver.js.map +3 -3
- package/dist/cjs/decorators/parameter.js +92 -9
- package/dist/cjs/decorators/parameter.js.map +2 -2
- package/dist/cjs/decorators/publishSwcAppMessage.js +2 -2
- package/dist/cjs/decorators/publishSwcAppMessage.js.map +2 -2
- package/dist/cjs/decorators/query.js +11 -5
- package/dist/cjs/decorators/query.js.map +2 -2
- package/dist/cjs/decorators/requestAnimationFrame.js +7 -16
- package/dist/cjs/decorators/requestAnimationFrame.js.map +2 -2
- package/dist/cjs/decorators/resizeObserver.js +41 -17
- package/dist/cjs/decorators/resizeObserver.js.map +3 -3
- package/dist/cjs/decorators/setInterval.js +36 -25
- package/dist/cjs/decorators/setInterval.js.map +2 -2
- package/dist/cjs/decorators/setTimeout.js +36 -25
- package/dist/cjs/decorators/setTimeout.js.map +2 -2
- package/dist/cjs/decorators/state.js +13 -10
- package/dist/cjs/decorators/state.js.map +2 -2
- package/dist/cjs/decorators/{subscribeSwcAppMessageWhileConnected.js → subscribeSwcAppMessage.js} +20 -21
- package/dist/cjs/decorators/subscribeSwcAppMessage.js.map +7 -0
- package/dist/cjs/decorators/{subscribeSwcAppRouteChangeWhileConnected.js → subscribeSwcAppRouteChange.js} +23 -19
- package/dist/cjs/decorators/subscribeSwcAppRouteChange.js.map +7 -0
- package/dist/cjs/decorators/swcAppRoute.js +149 -0
- package/dist/cjs/decorators/swcAppRoute.js.map +7 -0
- package/dist/cjs/elements/SwcApp.js +70 -0
- package/dist/cjs/elements/SwcApp.js.map +2 -2
- package/dist/cjs/elements/SwcAppMixin.js +256 -83
- package/dist/cjs/elements/SwcAppMixin.js.map +3 -3
- package/dist/cjs/types/index.js +5 -1
- package/dist/cjs/types/index.js.map +2 -2
- package/dist/cjs/utils/Utils.js +36 -15
- package/dist/cjs/utils/Utils.js.map +2 -2
- package/dist/esm/SwcAppEngine.js.map +2 -2
- package/dist/esm/decorators/addEventListener.js +64 -146
- package/dist/esm/decorators/addEventListener.js.map +2 -2
- package/dist/esm/decorators/applyAttribute.js +36 -48
- package/dist/esm/decorators/applyAttribute.js.map +2 -2
- package/dist/esm/decorators/applyClass.js +9 -12
- package/dist/esm/decorators/applyClass.js.map +2 -2
- package/dist/esm/decorators/applyNode.js +15 -23
- package/dist/esm/decorators/applyNode.js.map +2 -2
- package/dist/esm/decorators/applyProperty.js +12 -42
- package/dist/esm/decorators/applyProperty.js.map +2 -2
- package/dist/esm/decorators/applySlot.js +3 -3
- package/dist/esm/decorators/applySlot.js.map +2 -2
- package/dist/esm/decorators/applyStyle.js +9 -12
- package/dist/esm/decorators/applyStyle.js.map +2 -2
- package/dist/esm/decorators/around.js +105 -0
- package/dist/esm/decorators/around.js.map +7 -0
- package/dist/esm/decorators/changedAttribute.js +40 -12
- package/dist/esm/decorators/changedAttribute.js.map +2 -2
- package/dist/esm/decorators/elementDefine.js +222 -193
- package/dist/esm/decorators/elementDefine.js.map +3 -3
- package/dist/esm/decorators/emitCustomEvent.js +15 -13
- package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
- package/dist/esm/decorators/eventMedia.js +36 -8
- package/dist/esm/decorators/eventMedia.js.map +2 -2
- package/dist/esm/decorators/fetch.js +259 -0
- package/dist/esm/decorators/fetch.js.map +7 -0
- package/dist/esm/decorators/index.js +5 -2
- package/dist/esm/decorators/index.js.map +2 -2
- package/dist/esm/decorators/intersectionObserver.js +33 -13
- package/dist/esm/decorators/intersectionObserver.js.map +2 -2
- package/dist/esm/decorators/lifecycles.js +11 -11
- package/dist/esm/decorators/lifecycles.js.map +2 -2
- package/dist/esm/decorators/mutationObserver.js +55 -39
- package/dist/esm/decorators/mutationObserver.js.map +3 -3
- package/dist/esm/decorators/parameter.js +92 -9
- package/dist/esm/decorators/parameter.js.map +2 -2
- package/dist/esm/decorators/publishSwcAppMessage.js +2 -2
- package/dist/esm/decorators/publishSwcAppMessage.js.map +2 -2
- package/dist/esm/decorators/query.js +11 -5
- package/dist/esm/decorators/query.js.map +2 -2
- package/dist/esm/decorators/requestAnimationFrame.js +8 -17
- package/dist/esm/decorators/requestAnimationFrame.js.map +2 -2
- package/dist/esm/decorators/resizeObserver.js +41 -17
- package/dist/esm/decorators/resizeObserver.js.map +2 -2
- package/dist/esm/decorators/setInterval.js +37 -26
- package/dist/esm/decorators/setInterval.js.map +2 -2
- package/dist/esm/decorators/setTimeout.js +37 -26
- package/dist/esm/decorators/setTimeout.js.map +2 -2
- package/dist/esm/decorators/state.js +13 -10
- package/dist/esm/decorators/state.js.map +2 -2
- package/dist/esm/decorators/subscribeSwcAppMessage.js +53 -0
- package/dist/esm/decorators/subscribeSwcAppMessage.js.map +7 -0
- package/dist/esm/decorators/{subscribeSwcAppRouteChangeWhileConnected.js → subscribeSwcAppRouteChange.js} +20 -16
- package/dist/esm/decorators/subscribeSwcAppRouteChange.js.map +7 -0
- package/dist/esm/decorators/swcAppRoute.js +130 -0
- package/dist/esm/decorators/swcAppRoute.js.map +7 -0
- package/dist/esm/elements/SwcApp.js +70 -0
- package/dist/esm/elements/SwcApp.js.map +2 -2
- package/dist/esm/elements/SwcAppMixin.js +258 -85
- package/dist/esm/elements/SwcAppMixin.js.map +3 -3
- package/dist/esm/types/index.js +5 -1
- package/dist/esm/types/index.js.map +2 -2
- package/dist/esm/utils/Utils.js +36 -15
- package/dist/esm/utils/Utils.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +1886 -999
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/SwcAppEngine.d.ts +1 -0
- package/dist/types/SwcAppEngine.d.ts.map +1 -1
- package/dist/types/decorators/addEventListener.d.ts +923 -960
- package/dist/types/decorators/addEventListener.d.ts.map +1 -1
- package/dist/types/decorators/applyAttribute.d.ts +26 -38
- package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
- package/dist/types/decorators/applyClass.d.ts +1 -3
- package/dist/types/decorators/applyClass.d.ts.map +1 -1
- package/dist/types/decorators/applyNode.d.ts +15 -17
- package/dist/types/decorators/applyNode.d.ts.map +1 -1
- package/dist/types/decorators/applyProperty.d.ts +25 -45
- package/dist/types/decorators/applyProperty.d.ts.map +1 -1
- package/dist/types/decorators/applyStyle.d.ts +1 -3
- package/dist/types/decorators/applyStyle.d.ts.map +1 -1
- package/dist/types/decorators/around.d.ts +87 -0
- package/dist/types/decorators/around.d.ts.map +1 -0
- package/dist/types/decorators/changedAttribute.d.ts +21 -1
- package/dist/types/decorators/changedAttribute.d.ts.map +1 -1
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/decorators/emitCustomEvent.d.ts +0 -1
- package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
- package/dist/types/decorators/eventMedia.d.ts +24 -1
- package/dist/types/decorators/eventMedia.d.ts.map +1 -1
- package/dist/types/decorators/fetch.d.ts +139 -0
- package/dist/types/decorators/fetch.d.ts.map +1 -0
- package/dist/types/decorators/index.d.ts +5 -2
- package/dist/types/decorators/index.d.ts.map +1 -1
- package/dist/types/decorators/intersectionObserver.d.ts +24 -11
- package/dist/types/decorators/intersectionObserver.d.ts.map +1 -1
- package/dist/types/decorators/lifecycles.d.ts +8 -7
- package/dist/types/decorators/lifecycles.d.ts.map +1 -1
- package/dist/types/decorators/mutationObserver.d.ts +26 -13
- package/dist/types/decorators/mutationObserver.d.ts.map +1 -1
- package/dist/types/decorators/parameter.d.ts +84 -6
- package/dist/types/decorators/parameter.d.ts.map +1 -1
- package/dist/types/decorators/publishSwcAppMessage.d.ts +0 -1
- package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -1
- package/dist/types/decorators/query.d.ts +7 -7
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/requestAnimationFrame.d.ts +1 -1
- package/dist/types/decorators/requestAnimationFrame.d.ts.map +1 -1
- package/dist/types/decorators/resizeObserver.d.ts +26 -13
- package/dist/types/decorators/resizeObserver.d.ts.map +1 -1
- package/dist/types/decorators/setInterval.d.ts +10 -0
- package/dist/types/decorators/setInterval.d.ts.map +1 -1
- package/dist/types/decorators/setTimeout.d.ts +10 -0
- package/dist/types/decorators/setTimeout.d.ts.map +1 -1
- package/dist/types/decorators/state.d.ts.map +1 -1
- package/dist/types/decorators/subscribeSwcAppMessage.d.ts +44 -0
- package/dist/types/decorators/subscribeSwcAppMessage.d.ts.map +1 -0
- package/dist/types/decorators/subscribeSwcAppRouteChange.d.ts +60 -0
- package/dist/types/decorators/subscribeSwcAppRouteChange.d.ts.map +1 -0
- package/dist/types/decorators/swcAppRoute.d.ts +94 -0
- package/dist/types/decorators/swcAppRoute.d.ts.map +1 -0
- package/dist/types/elements/SwcApp.d.ts.map +1 -1
- package/dist/types/elements/SwcAppMixin.d.ts +423 -388
- package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +43 -4
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/utils/Utils.d.ts +15 -5
- package/dist/types/utils/Utils.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +1886 -999
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +8 -6
- package/src/SwcAppEngine.ts +1 -0
- package/src/decorators/addEventListener.ts +102 -96
- package/src/decorators/applyAttribute.ts +76 -138
- package/src/decorators/applyClass.ts +8 -14
- package/src/decorators/applyNode.ts +33 -41
- package/src/decorators/applyProperty.ts +51 -99
- package/src/decorators/applySlot.ts +3 -3
- package/src/decorators/applyStyle.ts +8 -14
- package/src/decorators/around.ts +196 -0
- package/src/decorators/changedAttribute.ts +39 -15
- package/src/decorators/elementDefine.ts +270 -219
- package/src/decorators/emitCustomEvent.ts +17 -13
- package/src/decorators/eventMedia.ts +50 -9
- package/src/decorators/fetch.ts +454 -0
- package/src/decorators/index.ts +5 -2
- package/src/decorators/intersectionObserver.ts +38 -24
- package/src/decorators/lifecycles.ts +24 -22
- package/src/decorators/mutationObserver.ts +71 -52
- package/src/decorators/parameter.ts +145 -14
- package/src/decorators/publishSwcAppMessage.ts +3 -4
- package/src/decorators/query.ts +22 -14
- package/src/decorators/requestAnimationFrame.ts +10 -19
- package/src/decorators/resizeObserver.ts +50 -29
- package/src/decorators/setInterval.ts +37 -26
- package/src/decorators/setTimeout.ts +37 -26
- package/src/decorators/state.ts +19 -13
- package/src/decorators/subscribeSwcAppMessage.ts +106 -0
- package/src/decorators/subscribeSwcAppRouteChange.ts +131 -0
- package/src/decorators/swcAppRoute.ts +231 -0
- package/src/elements/SwcApp.ts +40 -10
- package/src/elements/SwcAppMixin.ts +330 -101
- package/src/types/index.ts +38 -5
- package/src/utils/Utils.ts +50 -18
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +0 -7
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +0 -7
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +0 -54
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +0 -7
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +0 -7
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +0 -23
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +0 -1
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +0 -31
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +0 -1
- package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +0 -91
- package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +0 -107
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/elementDefine.ts"],
|
|
4
|
-
"sourcesContent": ["import {ActionExpression, FunctionUtils, ReflectUtils} from '@dooboostore/core';\nimport {EventListenerLifeCycler} from './addEventListener';\nimport {MutationObserverLifeCycler} from './mutationObserver';\nimport {ResizeObserverLifeCycler} from './resizeObserver';\nimport {IntersectionObserverLifeCycler} from './intersectionObserver';\nimport {findAllLifecycleMetadata, findAllOnConnectedAfterMetadata, findAllOnConnectedBeforeMetadata, findAllOnConnectedMetadata, ON_AFTER_ADOPTED_METADATA_KEY, ON_AFTER_DISCONNECTED_METADATA_KEY, ON_BEFORE_ADOPTED_METADATA_KEY, ON_BEFORE_DISCONNECTED_METADATA_KEY, ON_CONNECTED_COMPLETED_METADATA_KEY, ON_INITIALIZE_METADATA_KEY} from './lifecycles';\nimport {EmitCustomEventLifeCycler} from './emitCustomEvent';\nimport {ChangedAttributeLifeCycler} from './changedAttribute';\nimport {findAllAttributeApplyMetadata, findAllAttributeMetadata} from './applyAttribute';\nimport {getQueryMetadata, getQueryAllMetadata} from './query';\nimport {SwcUtils} from '../utils/Utils';\nimport {DOM_EVENT_NAMES, HTML_TAG_ENTRIES} from '../config/config';\nimport {SituationTypeContainer, SituationTypeContainers} from '@dooboostore/simple-boot/decorators/inject/Inject';\nimport {FirstCheckMaker} from '@dooboostore/simple-boot';\nimport {buildSwcParameterArgs, getParameterMetadata} from './parameter';\nimport {ElementDefineLifeCycler, HelperHostSet, HostSet, InjectSituationType, IntersectionObserverSet, MutationObserverSet, OnConnectedResult, ResizeObserverSet, ResizeObserverSetEntry, SwcRootType} from '../types';\nimport {ConvertUtils, ElementApply} from '@dooboostore/core-web';\nimport {isSSR} from \"../elements/SwcAppMixin\";\nimport {findAllStateMetadata} from \"./state\";\nimport {findAllPropertyMetadata} from \"./applyProperty\";\nimport {MessageSubscribeLifeCycler} from \"./subscribeSwcAppMessageWhileConnected\";\nimport {RouteSubscribeLifeCycler} from \"./subscribeSwcAppRouteChangeWhileConnected\";\nimport {SetIntervalLifeCycler} from \"./setInterval\";\nimport {SetTimeoutLifeCycler} from \"./setTimeout\";\nimport {RequestAnimationFrameLifeCycler} from \"./requestAnimationFrame\";\nimport {EventMediaLifeCycler} from \"./eventMedia\";\n\n// --- Core Interfaces & Types ---\n\nexport const ELEMENT_CONFIG_KEY = Symbol.for('simple-web-component:element-config');\n\nexport interface ElementConfig {\n extends?: string;\n observedAttributes?: string[];\n customElementRegistry?: any;\n window?: Window;\n useShadow?: boolean | 'open' | 'closed';\n}\n\nexport interface ElementMetadata extends Omit<ElementConfig, 'window'> {\n name: string;\n window: Window;\n}\n\nexport const getElementConfig = (target: any): ElementMetadata | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ELEMENT_CONFIG_KEY, constructor);\n};\n\nexport const ensureInit = (inst: any) => { // HTMLElement\n if (!inst.__swc_initialized) {\n inst._swcId = inst?.getAttribute?.('swc-use-ssr') ?? 's' + Math.random().toString(36).substring(2, 11).toLowerCase();\n inst._emitHandlers = new Map();\n inst.__swc_initialized = true;\n // const attributeList = findAllQ(inst);\n // attributeList.forEach(meta => {\n // delete (inst as any)[meta.propertyKey];\n // });\n\n const target = inst instanceof Function ? inst : inst.constructor;\n\n // \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\n // \u2551 decorator \uD544\uB4DC\uC758 own property \uC0AD\uC81C \u2551\n // \u2551 \u2551\n // \u2551 \uC774\uC720: own property\uAC00 \uC788\uC73C\uBA74 prototype\uC758 getter/setter\uB294 \uC808\uB300 \uC548 \uD0C4\uB2E4 \u2551\n // \u2551 1. TypeScript\uB294 \uCD08\uAE30\uAC12\uC774 \uC788\uB294 \uD544\uB4DC\uB97C constructor\uC5D0\uC11C own property\uB85C \uC0DD\uC131 \u2551\n // \u2551 @attributeThis('id') myId: string = \"default\" \u2192 this.myId = \"default\" \u2551\n // \u2551 \u2551\n // \u2551 2. JavaScript\uC758 property lookup\uC740 own property\uB97C \uBA3C\uC800 \uCC3E\uC74C \u2551\n // \u2551 - this.myId \uC811\uADFC \u2551\n // \u2551 - 1\uC21C\uC704: instance\uC758 own property \uC788\uB098? \u2192 \uC788\uC73C\uBA74 \uADF8\uAC83 \uBC18\uD658 \u2551\n // \u2551 - 2\uC21C\uC704: prototype\uC758 getter \uC788\uB098? \u2192 \uC788\uC73C\uBA74 \uD638\uCD9C \u2551\n // \u2551 \u2551\n // \u2551 3. own property\uAC00 \uC788\uC73C\uBA74 prototype\uC758 getter\uB294 \uC808\uB300 \uD638\uCD9C\uB418\uC9C0 \uC54A\uC74C \u2551\n // \u2551 \uB530\uB77C\uC11C getter\uC5D0\uC11C \uC815\uC758\uB41C DOM \uB3D9\uAE30\uD654 \uB85C\uC9C1\uC774 \uC791\uB3D9\uD558\uC9C0 \uC54A\uC74C \u2551\n // \u2551 \u2551\n // \u2551 4. own property\uB97C \uC0AD\uC81C\uD558\uBA74 JavaScript\uAC00 prototype\uC758 getter\uB97C \uCC3E\uAC8C \uB428 \u2551\n // \u2551 \u2192 getter \uD638\uCD9C\uB428 \u2192 DOM \uC18D\uC131 \uAC12 \uB3D9\uAE30\uD654\uB428 \u2551\n // \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D\n // \uD568\uC218\uB294 decorator\uC5D0\uC11C \uAC12\uC790\uCCB4\uB97C descriptor.value = function (...args: any[]) {...\n\n // @attribute \uD544\uB4DC\uC758 own property \uC0AD\uC81C \u2192 getter/setter \uC791\uB3D9\n // const attributeList = findAllAttributeMetadata(target);\n const attributeAllList = findAllAttributeMetadata(target).filter(it => it.type === 'property');\n if (attributeAllList) {\n attributeAllList.forEach(meta => {\n // const initUserData = (inst as any)[meta.propertyKey];\n delete (inst as any)[meta.propertyKey];\n // (inst as any)[meta.propertyKey] = initUserData;\n });\n }\n\n // @query \uD544\uB4DC\uC758 own property \uC0AD\uC81C \u2192 getter \uC791\uB3D9\n const queryList = getQueryMetadata(target);\n if (queryList) {\n queryList.forEach(meta => {\n delete (inst as any)[meta.propertyKey];\n });\n }\n\n // @queryAll \uD544\uB4DC\uC758 own property \uC0AD\uC81C \u2192 getter \uC791\uB3D9\n const queryAllList = getQueryAllMetadata(target);\n if (queryAllList) {\n queryAllList.forEach(meta => {\n delete (inst as any)[meta.propertyKey];\n });\n }\n // const slotAllList = findAllApplySlotMetadata(target);\n // if (slotAllList) {\n // slotAllList.filter(it => it.type === 'property').forEach(meta => {\n // delete (inst as any)[meta.propertyKey];\n // });\n // }\n\n\n const propertyAllList = findAllPropertyMetadata(target).filter(it => it.type === 'property');\n if (propertyAllList) {\n propertyAllList.forEach(meta => {\n delete (inst as any)[meta.propertyKey];\n });\n }\n\n const stateAllList = findAllStateMetadata(target);\n if (stateAllList) {\n stateAllList.forEach(meta => {\n const initUserData = (inst as any)[meta.propertyKey];\n delete (inst as any)[meta.propertyKey];\n (inst as any)[meta.propertyKey] = initUserData;\n });\n }\n\n // Call constructor script if present\n const hostSet = SwcUtils.getHostSet(inst);\n const appHosts = SwcUtils.findAllAppHostsIncludingSelfDirect(inst);\n inst._executeSwcScript?.('swc-on-constructor', hostSet);\n\n // Call @onInitialize lifecycle methods\n const cMethods = findAllLifecycleMetadata(inst, ON_INITIALIZE_METADATA_KEY);\n for (const m of cMethods) inst._invokeLifecycleMethod(m.propertyKey, hostSet);\n }\n};\n\n\n// \uD6D4 \uC774\uAC8C\uB9DE\uB098?? global\uB85C \uAD00\uB9AC\uD558\uB294\uAC8C..\uD6D4... \uC65C\uC774\uB807\uAC8C \uD588\uC744\uAE4C..\n// --- Global Event Handling ---\nconst globalDelegatedRoots = new WeakSet<Node>();\n// \uC5EC\uAE30\uC5D0\uC11C \uC911\uBCF5 \uD638\uCD9C\uC548\uB418\uAC8C \uC798\uB9C9\uC544\uC900\uB2E4 ..\nconst handleGlobalSwcEvent = async (event: Event) => {\n if ((event as any).__swc_handled) return;\n const path = event.composedPath();\n const type = event.type;\n const attrName = `swc-on-${type}`;\n\n for (const node of path) {\n if (!(node instanceof HTMLElement)) continue;\n const script = node.getAttribute?.(attrName);\n if (script && !getElementConfig(node)) {\n const host: any = SwcUtils.findNearestSwcHostIncludingSelf(node);\n if (host && host.isConnected && typeof host.__swc_executeAttributeEvent === 'function') {\n await host.__swc_executeAttributeEvent(node, attrName, script, event);\n (event as any).__swc_handled = true;\n break;\n }\n }\n }\n};\n\nfunction buildEnv(configWindow: Window) {\n const win: Window = configWindow;\n const doc: Document = win?.document;\n const builtInTagMap = new Map<any, string>();\n for (const [cls, tag] of HTML_TAG_ENTRIES) {\n if ((win as any)?.[cls]) builtInTagMap.set((win as any)[cls], tag);\n }\n const domHelpers = SwcUtils.getHelperSet(win);\n\n return {win, doc, builtInTagMap, domHelpers};\n}\n\nconst getHandlers = (inst: any) => {\n if (!inst.__swc_attributeEventHandlers) inst.__swc_attributeEventHandlers = new Map();\n return inst.__swc_attributeEventHandlers;\n};\n\nconst setupPrototype = (proto: any, win: Window) => {\n if (proto.__swc_proto_setup) return;\n proto.__swc_proto_setup = true;\n\n\n // proto.createSlotString = function (id: string) {\n // return NodeSlot.slot(`${this._swcId}-${id}`);\n // }\n // proto.createEaHtml = function (id: string, script: string) {\n // return ElementApply.html(id, script);\n // }\n // proto.createEaText = function (id: string, script: string) {\n // return ElementApply.text(id, script);\n // }\n // proto.createEaAttribute = function (id: string, name: string, script: string) {\n // return ElementApply.attribute(id, name, script);\n // }\n // proto.createEaEvent = function (id: string, name: string, script: string) {\n // return ElementApply.event(id, name, script);\n // }\n // proto.createEaProperty = function (id: string, name: string, script: string) {\n // return ElementApply.property(id, name, script);\n // }\n\n // swc-id-asdasdasdasd-click=\" :value=\"\" {: value fsdfsdafsad :} {html: aaa :} {text: asdas :}\n\n proto._executeSwcScript = function (attrName: string, hostSet: HostSet, extraArgs: Record<string, any> = {}) {\n ensureInit(this);\n const script = this.getAttribute(attrName);\n if (script) {\n try {\n const conf = getElementConfig(this);\n const currentWin = (this as any)._resolveWindow(conf);\n const helpers = SwcUtils.getHelperSet(currentWin);\n const args = {...hostSet, ...helpers, ...extraArgs, $el: this, $root: this.getRootNode()};\n FunctionUtils.execute({script, context: this, args});\n } catch (e) {\n console.error(`[SWC] Failed to execute ${attrName}:`, e);\n }\n }\n };\n\n proto._resolveWindow = function (localConfig?: ElementConfig): Window {\n ensureInit(this);\n if (localConfig?.window) return localConfig.window;\n const ancestors = SwcUtils.findAllSwcHostsIncludingSelf(this as any);\n for (let i = ancestors.length - 1; i >= 0; i--) {\n const aConf = getElementConfig(ancestors[i]);\n if (aConf?.window) return aConf.window;\n }\n return getElementConfig(this).window ?? ((typeof window !== 'undefined' ? window : undefined) as Window);\n };\n\n proto._invokeLifecycleMethod = function (methodName: string | symbol, hostSet?: HostSet, extraArgs: any[] = []) {\n ensureInit(this);\n if (typeof (this as any)[methodName] !== 'function') return;\n const useHostSet = hostSet ?? SwcUtils.getHelperAndHostSet(win, this);\n const app = useHostSet?.$appHost?.simpleApplication;\n\n // @hostSet/@helperHostSet/@helperSet(parameter.ts)\uB97C \uC704\uD55C \uAC12. lifecycle \uBA54\uC11C\uB4DC\uB294\n // event/matched \uAC1C\uB150\uC774 \uC5C6\uC73C\uBBC0\uB85C \uC774 \uC138 \uAC00\uC9C0\uB9CC \uCC44\uC6B4\uB2E4.\n const helperSetValue = SwcUtils.getHelperSet(win);\n const helperHostSetValue = {...helperSetValue, ...useHostSet, $this: this};\n const kindValues = {hostSet: useHostSet, helperHostSet: helperHostSetValue, helperSet: helperSetValue};\n\n // console.log('---->hh',app, this, methodName);\n if (app) {\n const otherStorage = new Map<any, any>();\n const situations = new SituationTypeContainers([new SituationTypeContainer({situationType: InjectSituationType.HOST_SET, data: useHostSet}), new SituationTypeContainer({situationType: InjectSituationType.APP_HOST, data: useHostSet.$appHost}), new SituationTypeContainer({situationType: InjectSituationType.APP_HOSTS, data: useHostSet.$appHosts}), new SituationTypeContainer({\n situationType: InjectSituationType.HOST,\n data: useHostSet.$host\n }), new SituationTypeContainer({situationType: InjectSituationType.HOSTS, data: useHostSet.$hosts}), new SituationTypeContainer({situationType: InjectSituationType.FIRST_HOST, data: useHostSet.$firstHost}), new SituationTypeContainer({situationType: InjectSituationType.LAST_HOST, data: useHostSet.$lastHost}), new SituationTypeContainer({\n situationType: InjectSituationType.FIRST_APP_HOST,\n data: useHostSet.$firstAppHost\n }), new SituationTypeContainer({situationType: InjectSituationType.LAST_APP_HOST, data: useHostSet.$lastAppHost})]);\n otherStorage.set(SituationTypeContainers, situations);\n\n // @hostSet/@helperHostSet/@helperSet\uAC00 \uBD99\uC740 \uD30C\uB77C\uBBF8\uD130\uB294 @Inject/situationType \uAE30\uBC18\n // \uD574\uC11D\uBCF4\uB2E4 \uBA3C\uC800 \uCC98\uB9AC\uB418\uACE0(firstCheckMaker), \uADF8 \uC678 \uD30C\uB77C\uBBF8\uD130\uB294 \uAE30\uC874\uCC98\uB7FC @Inject/\uD0C0\uC785\n // \uAE30\uBC18\uC73C\uB85C \uC815\uC0C1 \uD574\uC11D\uB41C\uB2E4 \u2014 \uAC19\uC740 \uBA54\uC11C\uB4DC\uC5D0\uC11C \uB450 \uBC29\uC2DD\uC744 \uC11E\uC5B4 \uC368\uB3C4 \uB41C\uB2E4.\n const firstCheckMaker: FirstCheckMaker = ({target, targetKey}, token, idx) => {\n const saves = getParameterMetadata(target, targetKey!);\n const found = saves.find(s => s.index === idx);\n return found ? (kindValues as any)[found.kind] : undefined;\n };\n\n return app.simstanceManager.executeBindParameterSim(\n {\n target: this,\n targetKey: methodName,\n inputParameters: extraArgs,\n firstCheckMaker: [firstCheckMaker]\n },\n otherStorage\n );\n } else {\n // SimpleApplication(DI \uCEE8\uD14C\uC774\uB108)\uC774 \uC5C6\uB294 standalone \uC0AC\uC6A9 \uC2DC\uC5D0\uB3C4 @hostSet/@helperHostSet/\n // @helperSet\uB9CC\uD07C\uC740 buildSwcParameterArgs\uB85C \uC8FC\uC785\uD574\uC900\uB2E4 \u2014 \uD574\uB2F9 \uB370\uCF54\uB808\uC774\uD130\uAC00 \uD558\uB098\uB3C4 \uC5C6\uC73C\uBA74\n // extraArgs\uB97C \uADF8\uB300\uB85C \uBC18\uD658\uD558\uBBC0\uB85C(\uAE30\uC874 \uB3D9\uC791 \uADF8\uB300\uB85C) \uD558\uC704\uD638\uD658 \uAE68\uC9C0\uC9C0 \uC54A\uB294\uB2E4.\n const args = buildSwcParameterArgs(this, methodName, kindValues, extraArgs);\n return (this as any)[methodName](...args);\n }\n };\n\n proto._bindAttributeEvent = function (el: HTMLElement, attrName: string, script: string, eventName?: string) {\n ensureInit(this);\n if (!eventName) {\n if (!attrName.startsWith('swc-on-')) return;\n eventName = attrName.substring(7);\n }\n const elHandlers = getHandlers(this);\n let handlers = elHandlers.get(el);\n if (!handlers) {\n handlers = new Map();\n elHandlers.set(el, handlers);\n }\n\n const oldHandler = handlers.get(attrName);\n if (oldHandler) el.removeEventListener(eventName, oldHandler);\n\n const handler = async (event: any) => {\n const hostSet = SwcUtils.getHostSet(el);\n const conf = getElementConfig(this);\n const currentWin = (this as any)._resolveWindow(conf);\n const helpers = SwcUtils.getHelperSet(currentWin);\n const args = {\n event,\n $data: (event as CustomEvent).detail,\n ...hostSet,\n ...helpers,\n $el: el,\n $root: this.getRootNode()\n };\n await FunctionUtils.execute({script, context: el, args});\n };\n\n el.addEventListener(eventName, handler);\n handlers.set(attrName, handler);\n };\n\n proto.__swc_executeAttributeEvent = async function (el: HTMLElement, attrName: string, script: string, event: Event) {\n ensureInit(this);\n\n const hostSet = SwcUtils.getHostSet(el);\n const conf = getElementConfig(this);\n const currentWin = (this as any)._resolveWindow(conf);\n const currentHelpers = SwcUtils.getHelperSet(currentWin);\n const detail = (event as CustomEvent).detail;\n const args = {\n event,\n $event: event,\n $data: detail,\n $detail: detail,\n ...hostSet,\n ...currentHelpers,\n $el: el,\n $root: this.getRootNode()\n };\n await FunctionUtils.execute({script, context: el, args});\n };\n};\n\nexport const elementDefine =\n (name: string, config: Partial<ElementConfig> = {}): ClassDecorator =>\n (constructor: any) => {\n const { win, doc, builtInTagMap: BUILT_IN_TAG_MAP, domHelpers: SWC_DOM_HELPERS } = buildEnv(config.window);\n const metadata: ElementMetadata = { ...config, name, window: win };\n\n if (!metadata.window) {\n throw new Error('window is required');\n }\n\n let extendsTagName = metadata.extends;\n if (!extendsTagName) {\n let proto = constructor;\n const BaseHTMLElement = (win as any).HTMLElement;\n while (proto && proto !== BaseHTMLElement && proto !== Function.prototype) {\n extendsTagName = BUILT_IN_TAG_MAP.get(proto);\n if (extendsTagName) break;\n proto = Object.getPrototypeOf(proto);\n }\n metadata.extends = extendsTagName;\n }\n\n const attributeList = findAllAttributeMetadata(constructor);\n const applyAttributeMap = findAllAttributeApplyMetadata(constructor);\n\n const swcLifecycleAttributes = ['swc-on-constructor', 'swc-on-connected', 'swc-on-disconnected', 'swc-on-before-connected', 'swc-on-after-connected', 'swc-on-before-disconnected', 'swc-on-after-disconnected', 'swc-on-before-adopted', 'swc-on-after-adopted', 'swc-on-attribute-changed'];\n const swcOnEvents = DOM_EVENT_NAMES.map(e => `swc-on-${e}`);\n\n const attributeApplyNames = Array.from(applyAttributeMap.values())\n .map(it => it.targetAttributeName)\n .filter(Boolean) as string[];\n const hostAttributes = attributeList.filter(it => it.selector === '$this').map(it => it.propertyKey || String(it.propertyKey));\n // Get original static observedAttributes before they're overwritten by Object.defineProperty\n const originalStaticObservedAttributes = (constructor.observedAttributes ?? []) as string[];\n\n const proto = constructor.prototype;\n setupPrototype(proto, win);\n\n // \uAC12\uC744 \uAE30\uB300\uD558\uC9C0\uC54A\uB294\uB2E4.\n let helperHostSet: HelperHostSet | null = null;\n // \u2500\u2500 cyclers: \uB370\uCF54\uB808\uC774\uD130\uBCC4 \uB77C\uC774\uD504\uC0AC\uC774\uD074 \uC704\uC784 \uD074\uB798\uC2A4 (elementDefine \uC2DC 1\uD68C \uC0DD\uC131, \uACC4\uC18D \uC7AC\uC0AC\uC6A9) \u2500\u2500\n const eventCycler = new EventListenerLifeCycler();\n const cyclers: ElementDefineLifeCycler[] = [\n eventCycler,\n new ChangedAttributeLifeCycler(),\n new EmitCustomEventLifeCycler(),\n new ResizeObserverLifeCycler(),\n new IntersectionObserverLifeCycler(),\n new MutationObserverLifeCycler(),\n new MessageSubscribeLifeCycler(),\n new RouteSubscribeLifeCycler(),\n new SetIntervalLifeCycler(),\n new SetTimeoutLifeCycler(),\n new RequestAnimationFrameLifeCycler(),\n new EventMediaLifeCycler(),\n ];\n\n // observedAttributes \uAE30\uC5EC cycler (define-time, constructor \uAE30\uBC18)\n const cyclerObservedAttributes = cyclers.flatMap(c => c.getObservedAttributeNames?.(constructor) ?? []);\n const mergedObservedAttributes = [...new Set([...(metadata.observedAttributes ?? []), ...originalStaticObservedAttributes, ...cyclerObservedAttributes, ...attributeApplyNames, ...hostAttributes, ...swcLifecycleAttributes, ...swcOnEvents])];\n\n // \uB80C\uB354 \uD6C4 \uBAA8\uB4E0 \uC2DC\uD074\uB7EC onConnected \uD638\uCD9C \u2192 Set \uC218\uC9D1 \uD6C4 observer \uC0DD\uC131\n const buildObservers = async (helperHostSet: HelperHostSet): Promise<void> => {\n const inst = helperHostSet.$this;\n const observers: Array<MutationObserver | ResizeObserver | IntersectionObserver> = [];\n let resizeObserverSet: ResizeObserverSet = [];\n let mutationObserverSet: MutationObserverSet = [];\n let intersectionObserverSet: IntersectionObserverSet = [];\n\n // delegate \uCD94\uC801 root \uD574\uC11D: shadow/light/auto/all \u2192 \uC2E4\uC81C root \uBAA9\uB85D\n const resolveDelegateRoots = (delegateRoot: SwcRootType | undefined): (HTMLElement | ShadowRoot)[] => {\n const r = delegateRoot || 'auto';\n const roots: (HTMLElement | ShadowRoot)[] = [];\n if (r === 'auto') roots.push(inst.shadowRoot || inst);\n else if (r === 'light') roots.push(inst);\n else if (r === 'shadow' && inst.shadowRoot) roots.push(inst.shadowRoot);\n else if (r === 'all') { roots.push(inst); if (inst.shadowRoot) roots.push(inst.shadowRoot); }\n return roots;\n };\n\n // 1. \uBAA8\uB4E0 \uC2DC\uD074\uB7EC onConnected \u2192 observer Set \uC218\uC9D1 (\uC5EC\uB7EC \uC2DC\uD074\uB7EC\uAC00 \uBC18\uD658\uD55C Set \uC744 \uC804\uBD80 \uB204\uC801)\n for (const c of cyclers) {\n const result = (await c.onConnected?.(helperHostSet, resizeObserverSet)) as OnConnectedResult | void;\n if (!result) continue;\n if (result.resizeObserverSet?.length) resizeObserverSet = [...resizeObserverSet, ...result.resizeObserverSet];\n if (result.mutationObserverSet?.length) mutationObserverSet = [...mutationObserverSet, ...result.mutationObserverSet];\n if (result.intersectionObserverSet?.length) intersectionObserverSet = [...intersectionObserverSet, ...result.intersectionObserverSet];\n }\n\n // 2. \uD0C0\uC785\uBCC4\uB85C observer \uC0DD\uC131\n // ResizeObserver \uBA3C\uC800: mutation callback \uC774 observe/unobserve \uB97C \uC8FC\uC785\uBC1B\uC544\uC57C \uD568\n // observeTargets \uC911 delegate \uD56D\uBAA9\uC740 \uC140\uB809\uD130 \uBB38\uC790\uC5F4\uC774\uB77C \uCD08\uAE30 observe \uD558\uC9C0 \uC54A\uB294\uB2E4 (\uB3D9\uC801 \uCD94\uC801 \uC804\uC6A9).\n // \uB3D9\uC801 observe/unobserve \uB294 \uC911\uBCF5 \uD638\uCD9C\uC744 \uB9C9\uAE30 \uC704\uD574 observe \uB300\uC0C1 WeakSet \uC73C\uB85C \uCD94\uC801\uD55C\uB2E4.\n const resizeDelegates = (resizeObserverSet ?? []).filter(t => t.delegate && typeof t.target === 'string') as Array<ResizeObserverSetEntry & { target: string }>;\n let resizeObserve: ((el: Element, opts?: ResizeObserverOptions) => void) | undefined;\n let resizeUnobserve: ((el: Element) => void) | undefined;\n const resizeObserved = new WeakSet<Element>();\n if (resizeObserverSet?.length) {\n const roCallbacks = [...new Set(resizeObserverSet.map(e => e.callback))];\n const ro = new win.ResizeObserver((entries, obs) => {\n for (const cb of roCallbacks) cb(entries, obs);\n });\n for (const e of resizeObserverSet) {\n if (e.delegate) continue;\n if (typeof e.target === 'string') {\n // \uBB38\uC790\uC5F4(non-delegate)\uC774\uBA74 root \uC5D0\uC11C \uAC80\uC0C9\uB41C \uC694\uC18C\uB4E4\uC744 observe \uB300\uC0C1\uC73C\uB85C \uCD94\uAC00\uD55C\uB2E4.\n const scope = resolveDelegateRoots(e.delegateRoot);\n for (const sr of scope) {\n sr.querySelectorAll(e.target).forEach(el => {\n if (!resizeObserved.has(el)) { ro.observe(el, e.options); resizeObserved.add(el); }\n });\n }\n continue;\n }\n ro.observe(e.target as Element, e.options);\n if (e.target instanceof Element) resizeObserved.add(e.target);\n }\n resizeObserve = (el, opts) => {\n if (resizeObserved.has(el)) return;\n ro.observe(el, opts);\n resizeObserved.add(el);\n };\n resizeUnobserve = (el) => {\n if (!resizeObserved.has(el)) return;\n ro.unobserve(el);\n resizeObserved.delete(el);\n };\n observers.push(ro);\n }\n\n // IntersectionObserver: \uC635\uC158 \uADF8\uB8F9\uBCC4\uB85C 1\uAC1C\uC529 \uC0DD\uC131.\n // delegate \uD56D\uBAA9\uC740 \uB3D9\uC801 \uCD94\uC801\uC6A9 \uC140\uB809\uD130\uC774\uBBC0\uB85C observe/unobserve \uD568\uC218\uB97C MutationObserver \uCF5C\uBC31\uC5D0 \uB118\uAE34\uB2E4.\n // \uB3D9\uC801 observe/unobserve \uC911\uBCF5 \uBC29\uC9C0\uB97C \uC704\uD574 \uADF8\uB8F9\uBCC4 WeakSet \uC73C\uB85C \uCD94\uC801\uD55C\uB2E4.\n const intersectionDelegates: Array<{ target: string; delegateRoot?: SwcRootType; observe: (el: Element) => void; unobserve: (el: Element) => void }> = [];\n for (const group of intersectionObserverSet) {\n const ioCallbacks = [...new Set(group.observeTargets.map(e => e.callback))];\n const io = new win.IntersectionObserver((entries, obs) => {\n for (const cb of ioCallbacks) cb(entries, obs);\n }, group.options);\n const ioObserved = new WeakSet<Element>();\n for (const e of group.observeTargets) {\n if (e.delegate) {\n const target = e.target as string;\n const observe = (el: Element) => {\n if (ioObserved.has(el)) return;\n io.observe(el);\n ioObserved.add(el);\n };\n const unobserve = (el: Element) => {\n if (!ioObserved.has(el)) return;\n io.unobserve(el);\n ioObserved.delete(el);\n };\n intersectionDelegates.push({ target, delegateRoot: e.delegateRoot, observe, unobserve });\n continue;\n }\n if (typeof e.target === 'string') {\n // \uBB38\uC790\uC5F4(non-delegate)\uC774\uBA74 root \uC5D0\uC11C \uAC80\uC0C9\uB41C \uC694\uC18C\uB4E4\uC744 observe \uB300\uC0C1\uC73C\uB85C \uCD94\uAC00\uD55C\uB2E4.\n const scope = resolveDelegateRoots(e.delegateRoot);\n for (const sr of scope) {\n sr.querySelectorAll(e.target).forEach(el => {\n if (!ioObserved.has(el)) { io.observe(el); ioObserved.add(el); }\n });\n }\n continue;\n }\n io.observe(e.target as Element);\n if (e.target instanceof Element) ioObserved.add(e.target);\n }\n observers.push(io);\n }\n\n // resize/intersection delegate \uB3D9\uC801 \uCD94\uC801 \u2014 MutationObserver \uCF5C\uBC31\uC5D0\uC11C \uCD94\uAC00/\uC81C\uAC70\uB41C \uC694\uC18C\uB97C observe/unobserve \uD55C\uB2E4.\n const handleResizeDelegate = (n: Node, observe: boolean) => {\n if (!resizeObserve || !resizeUnobserve || n.nodeType !== 1) return;\n const el = n as HTMLElement;\n for (const d of resizeDelegates) {\n const isThis = d.target === '$this' || d.target === '';\n const matchesSel = (node: any) => {\n if (!node || node.nodeType !== 1) return false;\n if (isThis) return true;\n return (node as HTMLElement).matches?.(d.target) || !!(node as HTMLElement).closest?.(d.target);\n };\n if (matchesSel(el)) {\n observe ? resizeObserve(el, d.options)\n : resizeUnobserve(el);\n } else if (!isThis) {\n el.querySelectorAll(d.target).forEach(sub => {\n observe ? resizeObserve(sub as HTMLElement, d.options)\n : resizeUnobserve(sub as HTMLElement);\n });\n }\n }\n };\n const handleIntersectionDelegate = (n: Node, observe: boolean) => {\n if (n.nodeType !== 1) return;\n const el = n as HTMLElement;\n for (const d of intersectionDelegates) {\n const isThis = d.target === '$this' || d.target === '';\n const matchesSel = (node: any) => {\n if (!node || node.nodeType !== 1) return false;\n if (isThis) return true;\n return (node as HTMLElement).matches?.(d.target) || !!(node as HTMLElement).closest?.(d.target);\n };\n if (matchesSel(el)) {\n observe ? d.observe(el) : d.unobserve(el);\n } else if (!isThis) {\n el.querySelectorAll(d.target).forEach(sub => {\n observe ? d.observe(sub as HTMLElement) : d.unobserve(sub as HTMLElement);\n });\n }\n }\n };\n\n if (mutationObserverSet?.length || resizeDelegates.length > 0 || intersectionDelegates.length > 0) {\n // \uD558\uB098\uC758 MutationObserver \uB85C resize/intersection delegate \uB3D9\uC801 \uCD94\uC801 + mutation \uCF5C\uBC31\uC744 \uD568\uAED8 \uCC98\uB9AC\n const callbacks = [...new Set((mutationObserverSet ?? []).map(e => e.callback))];\n const mo = new win.MutationObserver((mutations, obs) => {\n for (const mut of mutations) {\n Array.from(mut.addedNodes || []).forEach(n => { handleResizeDelegate(n as Node, true); handleIntersectionDelegate(n as Node, true); });\n Array.from(mut.removedNodes || []).forEach(n => { handleResizeDelegate(n as Node, false); handleIntersectionDelegate(n as Node, false); });\n }\n for (const cb of callbacks) cb(mutations, obs);\n });\n\n // observe \uB300\uC0C1 \uC804\uCCB4(\uC5D4\uD2B8\uB9AC + delegate \uCD94\uC801 root)\uB97C \uD558\uB098\uB85C \uBAA8\uC544 \uC911\uBCF5 observe \uB97C \uC81C\uAC70\uD55C\uB2E4.\n // \uAC19\uC740 target \uC774 \uC5EC\uB7EC \uC18C\uC2A4\uC5D0\uC11C \uC9C0\uC815\uB418\uBA74 MutationObserverInit \uC744 \uD569\uC9D1\uD569(\uCD5C\uB300 \uAC10\uC9C0\uBC94\uC704)\uC73C\uB85C \uBCD1\uD569\uD55C\uB2E4.\n const moObserveTargets = new Map<Element | ShadowRoot, MutationObserverInit>();\n const mergeMutationInit = (existing: MutationObserverInit | undefined, next: MutationObserverInit): MutationObserverInit => {\n if (!existing) return next;\n const mergedFilter = existing.attributeFilter || next.attributeFilter\n ? [...new Set([...(existing.attributeFilter ?? []), ...(next.attributeFilter ?? [])])]\n : undefined;\n return {\n childList: existing.childList || next.childList,\n attributes: existing.attributes || next.attributes,\n characterData: existing.characterData || next.characterData,\n subtree: existing.subtree || next.subtree,\n attributeOldValue: existing.attributeOldValue || next.attributeOldValue,\n characterDataOldValue: existing.characterDataOldValue || next.characterDataOldValue,\n attributeFilter: mergedFilter,\n };\n };\n const addObserveTarget = (target: Element | ShadowRoot, options: MutationObserverInit) => {\n moObserveTargets.set(target, mergeMutationInit(moObserveTargets.get(target), options));\n };\n\n // 1) mutationObserverSet \uC5D4\uD2B8\uB9AC\n for (const e of mutationObserverSet ?? []) {\n if (e.delegate) continue;\n const init = e.options ?? { childList: true };\n if (typeof e.target === 'string') {\n // \uBB38\uC790\uC5F4(non-delegate)\uC774\uBA74 root \uC5D0\uC11C \uAC80\uC0C9\uB41C \uC694\uC18C\uB4E4\uC744 observe \uB300\uC0C1\uC73C\uB85C \uCD94\uAC00\uD55C\uB2E4.\n const scope = resolveDelegateRoots(e.delegateRoot);\n for (const sr of scope) {\n sr.querySelectorAll(e.target).forEach(el => addObserveTarget(el, init));\n }\n continue;\n }\n addObserveTarget(e.target, init);\n }\n\n // 2) delegate \uCD94\uC801 root: shadow/light/all/auto \uB85C \uD574\uC11D\uD574 \uC804\uBD80 observe\n for (const d of resizeDelegates) {\n for (const r of resolveDelegateRoots(d.delegateRoot)) addObserveTarget(r, { childList: true, subtree: true });\n }\n for (const d of intersectionDelegates) {\n for (const r of resolveDelegateRoots(d.delegateRoot)) addObserveTarget(r, { childList: true, subtree: true });\n }\n\n for (const [target, options] of moObserveTargets) {\n mo.observe(target, options);\n }\n observers.push(mo);\n }\n\n inst.__swc_observers = observers;\n };\n\n const originalConnected = proto.connectedCallback;\n proto.connectedCallback = async function () {\n ensureInit(this);\n // \uC7AC\uC5F0\uACB0 \uC2DC \uB204\uC801 \uBC29\uC9C0 \u2014 cycler \uB0B4\uBD80 \uB9AC\uC18C\uC2A4 \uCD08\uAE30\uD654\n helperHostSet = SwcUtils.getHelperAndHostSet(win, this as any);\n const appHost = helperHostSet.$appHost;\n const useSsr = isSSR(this);\n try {\n if (appHost && typeof (appHost as any)._connected === 'function') {\n await (appHost as any)._connected(this);\n } else if (appHost && typeof (appHost as any)) {\n (appHost as any)._connected_safari_and_standby ??= [];\n (appHost as any)._connected_safari_and_standby.push(this);\n }\n\n const conf = getElementConfig(this);\n const currentWin = (this as any)._resolveWindow(conf);\n\n // before-connected \uB77C\uC774\uD504\uC0AC\uC774\uD074 \uBA54\uC11C\uB4DC (@onConnectedBefore)\n for (const m of findAllOnConnectedBeforeMetadata(this)) await (this as any)._invokeLifecycleMethod(m.propertyKey, helperHostSet);\n (this as any)._executeSwcScript('swc-on-before-connected', helperHostSet);\n\n // \u2500\u2500 \uB80C\uB354 (@onConnected / @onConnectedBody*) \u2014 elementDefine \uCC45\uC784 \u2500\u2500\n const targetConnectedList = useSsr ? [] : findAllOnConnectedMetadata(constructor);\n const shadowMode = conf?.useShadow || targetConnectedList.find(it => it.options.useShadow)?.options.useShadow;\n if (shadowMode && !this.shadowRoot) {\n const mode = shadowMode === true ? 'open' : shadowMode;\n this.attachShadow({ mode: mode as ShadowRootMode });\n }\n\n const stateContext: any = { ...helperHostSet };\n findAllStateMetadata(this).forEach(it => {\n stateContext[it.name] = this[it.propertyKey];\n });\n\n const shadowChildren: Node[] = [];\n const lightChildren: Node[] = [];\n\n if (targetConnectedList.length > 0) {\n for (const meta of targetConnectedList) {\n let res = await (this as any)._invokeLifecycleMethod(meta.propertyKey, helperHostSet);\n if (typeof res === 'string') {\n const htmlTemplateElement = doc.createElement('template');\n htmlTemplateElement.innerHTML = res;\n res = htmlTemplateElement.content;\n }\n if (res) {\n const nodes = Array.isArray(res) ? res : [res];\n if (meta.options.useShadow || conf?.useShadow) {\n shadowChildren.push(...nodes);\n } else {\n lightChildren.push(...nodes);\n }\n }\n }\n try {\n if (this.shadowRoot) {\n const applyShadowChildren = SwcUtils.projectProcessHtml(this._swcId, shadowChildren, doc);\n this.shadowRoot.replaceChildren(...applyShadowChildren);\n }\n if (lightChildren.length) {\n const applyLightChildren = SwcUtils.projectProcessHtml(this._swcId, lightChildren, doc);\n this.replaceChildren(...applyLightChildren);\n }\n } catch (e) {\n console.error('[ElementDefine] innerHTML setting error:', e);\n }\n new ElementApply(this, { id: this._swcId }).apply({ context: stateContext, bind: this });\n } else {\n new ElementApply(this, { id: this._swcId }).apply({ exclude: { html: true, text: true, attribute: true }, context: stateContext, bind: this });\n }\n\n // global delegate event\n const root = this.getRootNode();\n if (!globalDelegatedRoots.has(root)) {\n DOM_EVENT_NAMES.forEach(type => {\n root.addEventListener(type, handleGlobalSwcEvent);\n });\n globalDelegatedRoots.add(root);\n }\n\n // \u2500\u2500 cycler \uC2E4\uD589 (\uB80C\uB354 \uD6C4): \uBAA8\uB4E0 \uC2DC\uD074\uB7EC onConnected \u2192 observer Set \uC218\uC9D1 \u2192 observer \uC0DD\uC131 \u2500\u2500\n // helperHostSet \uC740 \uD074\uB85C\uC800 \uBCC0\uC218\uB77C async \uD750\uB984\uC5D0\uC11C \uB2E4\uB978 \uC778\uC2A4\uD134\uC2A4\uB85C \uB36E\uC5B4\uC368\uC9C8 \uC218 \uC788\uB2E4.\n // \uBC18\uB4DC\uC2DC \uD604\uC7AC \uC778\uC2A4\uD134\uC2A4(this)\uB85C \uC7AC\uACC4\uC0B0\uD55C \uAC12\uC744 \uC0AC\uC6A9\uD55C\uB2E4.\n await buildObservers(SwcUtils.getHelperAndHostSet(win, this as any));\n\n if (originalConnected) await originalConnected.apply(this);\n\n // after-connected \uB77C\uC774\uD504\uC0AC\uC774\uD074 \uBA54\uC11C\uB4DC (@onConnectedAfter)\n for (const m of findAllOnConnectedAfterMetadata(this)) await (this as any)._invokeLifecycleMethod(m.propertyKey, helperHostSet);\n (this as any)._executeSwcScript('swc-on-connected', helperHostSet);\n (this as any)._executeSwcScript('swc-on-after-connected', helperHostSet);\n (this as any).__swc_connected = true;\n } finally {\n for (const m of findAllLifecycleMetadata(this, ON_CONNECTED_COMPLETED_METADATA_KEY)) await (this as any)._invokeLifecycleMethod(m.propertyKey, helperHostSet);\n if (appHost && typeof (appHost as any)._connectedDone === 'function') {\n await (appHost as any)._connectedDone(this);\n }\n }\n };\n\n /////////////////////////////////////////////////\n // disconnectedCallback\n ////////////////////////////////////////////////\n const originalDisconnected = proto.disconnectedCallback;\n proto.disconnectedCallback = function () {\n const appHost = helperHostSet?.$appHost;\n if (appHost && typeof (appHost as any)._disconnected === 'function') {\n (appHost as any)._disconnected(this);\n }\n\n (this as any)._executeSwcScript('swc-on-before-disconnected', helperHostSet);\n for (const m of findAllLifecycleMetadata(this, ON_BEFORE_DISCONNECTED_METADATA_KEY)) (this as any)._invokeLifecycleMethod(m.propertyKey, helperHostSet);\n for (const c of cyclers) c.onDisconnected?.(helperHostSet!);\n\n for (const o of (this as any).__swc_observers ?? []) {\n try { (o as any)?.disconnect?.(); } catch (e) { console.error('[SWC] observer disconnect error:', e); }\n }\n (this as any).__swc_observers = [];\n\n // elementApply event listener \uC815\uB9AC\n new ElementApply(this, { id: this._swcId }).removeAllEventListener();\n\n if (originalDisconnected) originalDisconnected.apply(this);\n\n for (const m of findAllLifecycleMetadata(this, ON_AFTER_DISCONNECTED_METADATA_KEY)) (this as any)._invokeLifecycleMethod(m.propertyKey, helperHostSet);\n (this as any)._executeSwcScript('swc-on-disconnected', helperHostSet);\n (this as any)._executeSwcScript('swc-on-after-disconnected', helperHostSet);\n (this as any).__swc_connected = false;\n };\n\n const originalAdopted = proto.adoptedCallback;\n proto.adoptedCallback = function () {\n const hostSet = SwcUtils.getHostSet(this as any);\n (this as any)._executeSwcScript('swc-on-before-adopted', hostSet);\n for (const m of findAllLifecycleMetadata(this, ON_BEFORE_ADOPTED_METADATA_KEY)) (this as any)._invokeLifecycleMethod(m.propertyKey, hostSet);\n for (const c of cyclers) c.onAdopted?.(helperHostSet!);\n\n if (originalAdopted) originalAdopted.apply(this);\n\n for (const m of findAllLifecycleMetadata(this, ON_AFTER_ADOPTED_METADATA_KEY)) (this as any)._invokeLifecycleMethod(m.propertyKey, hostSet);\n (this as any)._executeSwcScript('swc-on-adopted', hostSet);\n (this as any)._executeSwcScript('swc-on-after-adopted', hostSet);\n };\n\n const originalAttributeChanged = proto.attributeChangedCallback;\n proto.attributeChangedCallback = function (name: string, old: string | null, newVal: string | null) {\n if (originalAttributeChanged) originalAttributeChanged.apply(this, [name, old, newVal]);\n\n // attributeChangedCallback \uC740 connected \uC774\uC804\uC5D0\uB3C4 \uD638\uCD9C\uB420 \uC218 \uC788\uC73C\uBBC0\uB85C\n // \uD074\uB85C\uC800\uC758 helperHostSet(null \uAC00\uB2A5) \uB300\uC2E0 \uC774 \uC2DC\uC810\uC5D0 \uC0C8\uB85C \uACC4\uC0B0\uD55C\uB2E4.\n const helperAndHostSet = SwcUtils.getHelperAndHostSet(win, this as any);\n\n // Process expression directive before passing to handlers\n let processedVal: any = newVal;\n if (newVal !== null) {\n const ae = new ActionExpression(newVal);\n const expr = ae.getFirstExpression('callReturn');\n if (expr) {\n const win = (this as any)._resolveWindow?.() || ((typeof window !== 'undefined' ? window : undefined) as any);\n const exprHelperAndHostSet = SwcUtils.getHelperAndHostSet(win, this as any);\n const script = ConvertUtils.decodeHtmlEntity(expr.script, win.document);\n try {\n const result = FunctionUtils.executeReturn({\n script: script,\n context: this,\n args: exprHelperAndHostSet\n });\n processedVal = result;\n } catch (e) {\n console.error(`[SWC] Failed to execute directive {{= ${expr.script} }} on attribute ${name}: ${exprHelperAndHostSet}`, e);\n processedVal = newVal;\n }\n }\n }\n\n if (name.startsWith('swc-on-') && !swcLifecycleAttributes.includes(name)) {\n if (newVal !== null) {\n const eventName = name.substring(7);\n (this as any)._bindAttributeEvent(this as any, name, newVal, eventName);\n }\n }\n\n // cycler \uC704\uC784: attribute \uC635\uC800\uBE59(@emitCustomEvent(attributeName) / @changedAttribute \uB4F1)\n for (const c of cyclers) c.onAttributeChanged?.(helperAndHostSet, name, old, processedVal);\n };\n\n Object.defineProperty(constructor, 'observedAttributes', {\n get: () => mergedObservedAttributes,\n configurable: true\n });\n\n ReflectUtils.defineMetadata(ELEMENT_CONFIG_KEY, metadata, constructor);\n const registry = metadata.customElementRegistry || (win as any)?.customElements;\n if (registry && !registry.get(metadata.name)) {\n registry.define(metadata.name, constructor as any, metadata.extends ? { extends: metadata.extends } : undefined);\n }\n return constructor;\n };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA4D;AAC5D,8BAAsC;AACtC,8BAAyC;AACzC,4BAAuC;AACvC,kCAA6C;AAC7C,wBAA+U;AAC/U,6BAAwC;AACxC,8BAAyC;AACzC,4BAAsE;AACtE,mBAAoD;AACpD,mBAAuB;AACvB,oBAAgD;AAChD,oBAA8D;AAE9D,uBAA0D;AAC1D,mBAA4M;AAC5M,sBAAyC;AACzC,yBAAoB;AACpB,mBAAmC;AACnC,2BAAsC;AACtC,kDAAyC;AACzC,sDAAuC;AACvC,yBAAoC;AACpC,wBAAmC;AACnC,mCAA8C;AAC9C,wBAAmC;AAI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S,6BAAa,iBAAiB,KAAK,QAAQA,KAAI,QAAQ;AACtE,YAAI;AACF,gBAAM,SAAS,0BAAc,cAAc;AAAA,YACzC;AAAA,YACA,SAAS;AAAA,YACT,MAAM;AAAA,UACR,CAAC;AACD,yBAAe;AAAA,QACjB,SAAS,GAAG;AACV,kBAAQ,MAAM,yCAAyC,KAAK,MAAM,oBAAoBD,KAAI,KAAK,oBAAoB,IAAI,CAAC;AACxH,yBAAe;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAEA,QAAIA,MAAK,WAAW,SAAS,KAAK,CAAC,uBAAuB,SAASA,KAAI,GAAG;AACxE,UAAI,WAAW,MAAM;AACnB,cAAM,YAAYA,MAAK,UAAU,CAAC;AAClC,QAAC,KAAa,oBAAoB,MAAaA,OAAM,QAAQ,SAAS;AAAA,MACxE;AAAA,IACF;AAGA,eAAW,KAAK,QAAS,GAAE,qBAAqB,kBAAkBA,OAAM,KAAK,YAAY;AAAA,EAC3F;AAEA,SAAO,eAAe,aAAa,sBAAsB;AAAA,IACvD,KAAK,MAAM;AAAA,IACX,cAAc;AAAA,EAChB,CAAC;AAED,2BAAa,eAAe,oBAAoB,UAAU,WAAW;AACrE,QAAM,WAAW,SAAS,yBAA0B,KAAa;AACjE,MAAI,YAAY,CAAC,SAAS,IAAI,SAAS,IAAI,GAAG;AAC5C,aAAS,OAAO,SAAS,MAAM,aAAoB,SAAS,UAAU,EAAE,SAAS,SAAS,QAAQ,IAAI,MAAS;AAAA,EACjH;AACA,SAAO;AACT;",
|
|
6
|
-
"names": ["proto", "
|
|
4
|
+
"sourcesContent": ["import {ActionExpression, FunctionUtils, ReflectUtils} from '@dooboostore/core';\nimport {EventListenerLifeCycler} from './addEventListener';\nimport {MutationObserverLifeCycler} from './mutationObserver';\nimport {ResizeObserverLifeCycler} from './resizeObserver';\nimport {IntersectionObserverLifeCycler} from './intersectionObserver';\nimport {findAllLifecycleMetadata, findAllOnConnectedAfterMetadata, findAllOnConnectedBeforeMetadata, findAllOnConnectedMetadata, ON_AFTER_ADOPTED_METADATA_KEY, ON_AFTER_DISCONNECTED_METADATA_KEY, ON_BEFORE_ADOPTED_METADATA_KEY, ON_BEFORE_DISCONNECTED_METADATA_KEY, ON_CONNECTED_COMPLETED_METADATA_KEY, ON_INITIALIZE_METADATA_KEY} from './lifecycles';\nimport {EmitCustomEventLifeCycler} from './emitCustomEvent';\nimport {ChangedAttributeLifeCycler} from './changedAttribute';\nimport {findAllAttributeApplyMetadata, findAllAttributeMetadata} from './applyAttribute';\nimport {getQueryMetadata, getQueryAllMetadata} from './query';\nimport {SwcUtils} from '../utils/Utils';\nimport {DOM_EVENT_NAMES, HTML_TAG_ENTRIES} from '../config/config';\nimport {SituationTypeContainer, SituationTypeContainers} from '@dooboostore/simple-boot/decorators/inject/Inject';\nimport {FirstCheckMaker} from '@dooboostore/simple-boot';\nimport {buildSwcParameterArgs, getParameterMetadata} from './parameter';\nimport {ElementDefineLifeCycler, HelperHostSet, HostSet, InjectSituationType, IntersectionObserverSet, MutationObserverSet, MutationObserverSetEntry, ObserverScope, OnConnectedResult, ResizeObserverSet, ResizeObserverSetEntry, SwcRootType} from '../types';\nimport {ConvertUtils, ElementApply} from '@dooboostore/core-web';\nimport {isSSR} from \"../elements/SwcAppMixin\";\nimport {findAllStateMetadata} from \"./state\";\nimport {findAllAroundMetadata} from \"./around\";\nimport {findAllPropertyMetadata} from \"./applyProperty\";\nimport {MessageSubscribeLifeCycler} from \"./subscribeSwcAppMessage\";\nimport {RouteSubscribeLifeCycler} from \"./subscribeSwcAppRouteChange\";\nimport {SetIntervalLifeCycler} from \"./setInterval\";\nimport {SetTimeoutLifeCycler} from \"./setTimeout\";\nimport {RequestAnimationFrameLifeCycler} from \"./requestAnimationFrame\";\nimport {EventMediaLifeCycler} from \"./eventMedia\";\nimport {FetchLifeCycler} from \"./fetch\";\n\n// --- Core Interfaces & Types ---\n\nexport const ELEMENT_CONFIG_KEY = Symbol.for('simple-web-component:element-config');\n\nexport interface ElementConfig {\n extends?: string;\n observedAttributes?: string[];\n customElementRegistry?: any;\n window?: Window;\n useShadow?: boolean | 'open' | 'closed';\n}\n\nexport interface ElementMetadata extends Omit<ElementConfig, 'window'> {\n name: string;\n window: Window;\n}\n\nexport const getElementConfig = (target: any): ElementMetadata | undefined => {\n const constructor = typeof target === 'function' ? target : target.constructor;\n return ReflectUtils.getMetadata(ELEMENT_CONFIG_KEY, constructor);\n};\n\nexport const ensureInit = (inst: any) => { // HTMLElement\n if (!inst.__swc_initialized) {\n inst._swcId = inst?.getAttribute?.('swc-use-ssr') ?? 's' + Math.random().toString(36).substring(2, 11).toLowerCase();\n inst._emitHandlers = new Map();\n inst.__swc_initialized = true;\n // const attributeList = findAllQ(inst);\n // attributeList.forEach(meta => {\n // delete (inst as any)[meta.propertyKey];\n // });\n\n const target = typeof inst === 'function' ? inst : inst.constructor;\n\n // \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\n // \u2551 decorator \uD544\uB4DC\uC758 own property \uC0AD\uC81C \u2551\n // \u2551 \u2551\n // \u2551 \uC774\uC720: own property\uAC00 \uC788\uC73C\uBA74 prototype\uC758 getter/setter\uB294 \uC808\uB300 \uC548 \uD0C4\uB2E4 \u2551\n // \u2551 1. TypeScript\uB294 \uCD08\uAE30\uAC12\uC774 \uC788\uB294 \uD544\uB4DC\uB97C constructor\uC5D0\uC11C own property\uB85C \uC0DD\uC131 \u2551\n // \u2551 @attributeThis('id') myId: string = \"default\" \u2192 this.myId = \"default\" \u2551\n // \u2551 \u2551\n // \u2551 2. JavaScript\uC758 property lookup\uC740 own property\uB97C \uBA3C\uC800 \uCC3E\uC74C \u2551\n // \u2551 - this.myId \uC811\uADFC \u2551\n // \u2551 - 1\uC21C\uC704: instance\uC758 own property \uC788\uB098? \u2192 \uC788\uC73C\uBA74 \uADF8\uAC83 \uBC18\uD658 \u2551\n // \u2551 - 2\uC21C\uC704: prototype\uC758 getter \uC788\uB098? \u2192 \uC788\uC73C\uBA74 \uD638\uCD9C \u2551\n // \u2551 \u2551\n // \u2551 3. own property\uAC00 \uC788\uC73C\uBA74 prototype\uC758 getter\uB294 \uC808\uB300 \uD638\uCD9C\uB418\uC9C0 \uC54A\uC74C \u2551\n // \u2551 \uB530\uB77C\uC11C getter\uC5D0\uC11C \uC815\uC758\uB41C DOM \uB3D9\uAE30\uD654 \uB85C\uC9C1\uC774 \uC791\uB3D9\uD558\uC9C0 \uC54A\uC74C \u2551\n // \u2551 \u2551\n // \u2551 4. own property\uB97C \uC0AD\uC81C\uD558\uBA74 JavaScript\uAC00 prototype\uC758 getter\uB97C \uCC3E\uAC8C \uB428 \u2551\n // \u2551 \u2192 getter \uD638\uCD9C\uB428 \u2192 DOM \uC18D\uC131 \uAC12 \uB3D9\uAE30\uD654\uB428 \u2551\n // \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D\n // \uD568\uC218\uB294 decorator\uC5D0\uC11C \uAC12\uC790\uCCB4\uB97C descriptor.value = function (...args: any[]) {...\n\n // @attribute \uD544\uB4DC\uC758 own property \uC0AD\uC81C \u2192 getter/setter \uC791\uB3D9\n // const attributeList = findAllAttributeMetadata(target);\n const attributeAllList = findAllAttributeMetadata(target).filter(it => it.type === 'property');\n if (attributeAllList) {\n attributeAllList.forEach(meta => {\n // const initUserData = (inst as any)[meta.propertyKey];\n delete (inst as any)[meta.propertyKey];\n // (inst as any)[meta.propertyKey] = initUserData;\n });\n }\n\n // @query \uD544\uB4DC\uC758 own property \uC0AD\uC81C \u2192 getter \uC791\uB3D9\n const queryList = getQueryMetadata(target);\n if (queryList) {\n queryList.forEach(meta => {\n delete (inst as any)[meta.propertyKey];\n });\n }\n\n // @queryAll \uD544\uB4DC\uC758 own property \uC0AD\uC81C \u2192 getter \uC791\uB3D9\n const queryAllList = getQueryAllMetadata(target);\n if (queryAllList) {\n queryAllList.forEach(meta => {\n delete (inst as any)[meta.propertyKey];\n });\n }\n // const slotAllList = findAllApplySlotMetadata(target);\n // if (slotAllList) {\n // slotAllList.filter(it => it.type === 'property').forEach(meta => {\n // delete (inst as any)[meta.propertyKey];\n // });\n // }\n\n\n const propertyAllList = findAllPropertyMetadata(target).filter(it => it.type === 'property');\n if (propertyAllList) {\n propertyAllList.forEach(meta => {\n // getter\uAC00 \uC5C6\uC73C\uBA74(\uC21C\uC218 \uD544\uB4DC: declare\u00B7\uD558\uC774\uB4DC\uB808\uC774\uC158 \uAC12 \uB4F1) \uC9C0\uC6B0\uC9C0 \uC54A\uC74C.\n // getter\uAC00 \uC788\uC744 \uB54C\uB9CC own \uAC12\uC744 \uC9C0\uC6CC getter\uAC00 DOM\uC744 \uC0C8\uB85C \uC77D\uAC8C \uD55C\uB2E4.\n let proto = Object.getPrototypeOf(inst);\n let hasGetter = false;\n while (proto && proto !== Object.prototype) {\n const d = Object.getOwnPropertyDescriptor(proto, meta.propertyKey);\n if (d) {\n hasGetter = typeof d.get === 'function';\n break;\n }\n proto = Object.getPrototypeOf(proto);\n }\n if (!hasGetter) return;\n delete (inst as any)[meta.propertyKey];\n });\n }\n\n const stateAllList = findAllStateMetadata(target);\n if (stateAllList) {\n stateAllList.forEach(meta => {\n // getter\uB85C \uC77D\uC73C\uBA74 \uC548 \uB428 \u2014 own\uC774 \uB0A8\uC544\uC788\uC744 \uB54C getter\uAC00 \uC774\uC8FC\uAE4C\uC9C0 \uD574\uBC84\uB824\n // setter \uC7AC\uB300\uC785\uACFC \uD569\uCE58\uBA74 DOM \uB3D9\uAE30\uD654\uAC00 \uC911\uBCF5 \uC2E4\uD589\uB428. descriptor\uC5D0\uC11C raw\uB97C \uAEBC\uB0B8\uB2E4.\n // own\uC774 \uC5C6\uC73C\uBA74(\uC774\uBBF8 \uC815\uB9AC\uB428) \uC2A4\uD0B5.\n const own = Object.getOwnPropertyDescriptor(inst, meta.propertyKey);\n if (own && 'value' in own) {\n const initUserData = own.value;\n delete (inst as any)[meta.propertyKey];\n (inst as any)[meta.propertyKey] = initUserData;\n }\n });\n }\n\n // @around \uD544\uB4DC\uC758 own property \uC815\uB9AC \u2192 setter \uACBD\uC720\uB85C \uC7AC\uB300\uC785 (\uCD08\uAE30\uAC12\uC5D0 set() \uC801\uC6A9).\n // attribute/query\uCC98\uB7FC plain delete\uD558\uBA74 \uCD08\uAE30\uAC12\uC774 \uB0A0\uC544\uAC04\uB2E4 \u2014 \uBC18\uB4DC\uC2DC \uC0B4\uB824\uC11C setter\uB85C \uB123\uB294\uB2E4.\n // getter\uB85C \uC77D\uC73C\uBA74 \uC548 \uB428(before \uBCC0\uD658\uAC12\uC774 \uC11E\uC784) \u2014 descriptor\uC5D0\uC11C raw\uB97C \uAEBC\uB0B8\uB2E4.\n // own\uC774 \uC5C6\uC73C\uBA74(\uC774\uBBF8 \uC815\uB9AC\uB428) \uC2A4\uD0B5 \u2014 \uADF8\uB798\uC57C \uC911\uBCF5 \uBCC0\uD658\uC774 \uC548 \uC0DD\uAE34\uB2E4.\n const aroundAllList = findAllAroundMetadata(target);\n if (aroundAllList) {\n aroundAllList.forEach(meta => {\n const own = Object.getOwnPropertyDescriptor(inst, meta.propertyKey);\n if (own && 'value' in own) {\n const initUserData = own.value;\n delete (inst as any)[meta.propertyKey];\n (inst as any)[meta.propertyKey] = initUserData;\n }\n });\n }\n\n // Call constructor script if present\n const hostSet = SwcUtils.getHostSet(inst);\n const appHosts = SwcUtils.findAllAppHostsIncludingSelfDirect(inst);\n inst._executeSwcScript?.('swc-on-constructor', hostSet);\n\n // Call @onInitialize lifecycle methods\n const cMethods = findAllLifecycleMetadata(inst, ON_INITIALIZE_METADATA_KEY);\n for (const m of cMethods) inst._invokeLifecycleMethod(m.propertyKey, hostSet);\n }\n};\n\n\n// \uD6D4 \uC774\uAC8C\uB9DE\uB098?? global\uB85C \uAD00\uB9AC\uD558\uB294\uAC8C..\uD6D4... \uC65C\uC774\uB807\uAC8C \uD588\uC744\uAE4C..\n// --- Global Event Handling ---\nconst globalDelegatedRoots = new WeakSet<Node>();\n// \uC5EC\uAE30\uC5D0\uC11C \uC911\uBCF5 \uD638\uCD9C\uC548\uB418\uAC8C \uC798\uB9C9\uC544\uC900\uB2E4 ..\nconst handleGlobalSwcEvent = async (event: Event) => {\n if ((event as any).__swc_handled) return;\n const path = event.composedPath();\n const type = event.type;\n const attrName = `swc-on-${type}`;\n\n for (const node of path) {\n if (!(node instanceof HTMLElement)) continue;\n const script = node.getAttribute?.(attrName);\n if (script && !getElementConfig(node)) {\n const host: any = SwcUtils.findNearestSwcAncestorHost(node);\n if (host && host.isConnected && typeof host.__swc_executeAttributeEvent === 'function') {\n await host.__swc_executeAttributeEvent(node, attrName, script, event);\n (event as any).__swc_handled = true;\n break;\n }\n }\n }\n};\n\nfunction buildEnv(configWindow: Window) {\n const win: Window = configWindow;\n const doc: Document = win?.document;\n const builtInTagMap = new Map<any, string>();\n for (const [cls, tag] of HTML_TAG_ENTRIES) {\n if ((win as any)?.[cls]) builtInTagMap.set((win as any)[cls], tag);\n }\n const domHelpers = SwcUtils.getHelperSet(win);\n\n return {win, doc, builtInTagMap, domHelpers};\n}\n\nconst getHandlers = (inst: any) => {\n if (!inst.__swc_attributeEventHandlers) inst.__swc_attributeEventHandlers = new Map();\n return inst.__swc_attributeEventHandlers;\n};\n\nconst setupPrototype = (proto: any, win: Window) => {\n if (proto.__swc_proto_setup) return;\n proto.__swc_proto_setup = true;\n\n\n // proto.createSlotString = function (id: string) {\n // return NodeSlot.slot(`${this._swcId}-${id}`);\n // }\n // proto.createEaHtml = function (id: string, script: string) {\n // return ElementApply.html(id, script);\n // }\n // proto.createEaText = function (id: string, script: string) {\n // return ElementApply.text(id, script);\n // }\n // proto.createEaAttribute = function (id: string, name: string, script: string) {\n // return ElementApply.attribute(id, name, script);\n // }\n // proto.createEaEvent = function (id: string, name: string, script: string) {\n // return ElementApply.event(id, name, script);\n // }\n // proto.createEaProperty = function (id: string, name: string, script: string) {\n // return ElementApply.property(id, name, script);\n // }\n\n // swc-id-asdasdasdasd-click=\" :value=\"\" {: value fsdfsdafsad :} {html: aaa :} {text: asdas :}\n\n proto._executeSwcScript = function (attrName: string, hostSet: HostSet, extraArgs: Record<string, any> = {}) {\n ensureInit(this);\n const script = this.getAttribute(attrName);\n if (script) {\n try {\n const currentWin = SwcUtils.resolveWindow(this);\n const helpers = SwcUtils.getHelperSet(currentWin);\n const args = {...hostSet, ...helpers, ...extraArgs, $el: this, $root: this.getRootNode()};\n FunctionUtils.execute({script, context: this, args});\n } catch (e) {\n console.error(`[SWC] Failed to execute ${attrName}:`, e);\n }\n }\n };\n\n proto._invokeLifecycleMethod = function (methodName: string | symbol, hostSet?: HostSet, extraArgs: any[] = []) {\n ensureInit(this);\n if (typeof (this as any)[methodName] !== 'function') return;\n const useHostSet = hostSet ?? SwcUtils.getHelperAndHostSet(this);\n const app = useHostSet?.$appHost?.simpleApplication;\n\n // @hostSet/@helperHostSet/@helperSet(parameter.ts)\uB97C \uC704\uD55C \uAC12. lifecycle \uBA54\uC11C\uB4DC\uB294\n // event/matched \uAC1C\uB150\uC774 \uC5C6\uC73C\uBBC0\uB85C \uC774 \uC138 \uAC00\uC9C0\uB9CC \uCC44\uC6B4\uB2E4.\n const helperSetValue = SwcUtils.getHelperSet(win);\n const helperHostSetValue = {...helperSetValue, ...useHostSet, $this: this};\n const kindValues = {hostSet: useHostSet, helperHostSet: helperHostSetValue, helperSet: helperSetValue};\n\n // console.log('---->hh',app, this, methodName);\n if (app) {\n const otherStorage = new Map<any, any>();\n const situations = new SituationTypeContainers([new SituationTypeContainer({situationType: InjectSituationType.HOST_SET, data: useHostSet}), new SituationTypeContainer({situationType: InjectSituationType.APP_HOST, data: useHostSet.$appHost}), new SituationTypeContainer({situationType: InjectSituationType.APP_HOSTS, data: useHostSet.$appHosts}), new SituationTypeContainer({\n situationType: InjectSituationType.HOST,\n data: useHostSet.$host\n }), new SituationTypeContainer({situationType: InjectSituationType.HOSTS, data: useHostSet.$hosts}), new SituationTypeContainer({situationType: InjectSituationType.FIRST_HOST, data: useHostSet.$firstHost}), new SituationTypeContainer({situationType: InjectSituationType.LAST_HOST, data: useHostSet.$lastHost}), new SituationTypeContainer({\n situationType: InjectSituationType.FIRST_APP_HOST,\n data: useHostSet.$firstAppHost\n }), new SituationTypeContainer({situationType: InjectSituationType.LAST_APP_HOST, data: useHostSet.$lastAppHost})]);\n otherStorage.set(SituationTypeContainers, situations);\n\n // @hostSet/@helperHostSet/@helperSet\uAC00 \uBD99\uC740 \uD30C\uB77C\uBBF8\uD130\uB294 @Inject/situationType \uAE30\uBC18\n // \uD574\uC11D\uBCF4\uB2E4 \uBA3C\uC800 \uCC98\uB9AC\uB418\uACE0(firstCheckMaker), \uADF8 \uC678 \uD30C\uB77C\uBBF8\uD130\uB294 \uAE30\uC874\uCC98\uB7FC @Inject/\uD0C0\uC785\n // \uAE30\uBC18\uC73C\uB85C \uC815\uC0C1 \uD574\uC11D\uB41C\uB2E4 \u2014 \uAC19\uC740 \uBA54\uC11C\uB4DC\uC5D0\uC11C \uB450 \uBC29\uC2DD\uC744 \uC11E\uC5B4 \uC368\uB3C4 \uB41C\uB2E4.\n // swc \uD30C\uB77C\uBBF8\uD130 \uB370\uCF54\uB808\uC774\uD130\uAC00 \uBD99\uC740 \uC790\uB9AC\uB294 DI \uB85C \uB118\uAE30\uC9C0 \uC54A\uB294\uB2E4. lifecycle \uC774 \uBABB \uCC44\uC6B0\uB294 kind\n // (\uC608: @fetchSettled \u2014 @fetch \uAC00 \uB098\uC911\uC5D0 \uCC44\uC6C0)\uB294 null. undefined \uB97C \uB3CC\uB824\uC8FC\uBA74\n // \"\uCC98\uB9AC \uC548 \uD568\"\uC73C\uB85C \uBCF4\uACE0 DI \uAC00 \uD30C\uB77C\uBBF8\uD130 \uD0C0\uC785(Object \uB4F1)\uC744 resolve \uD558\uB824\uB2E4 SimNoSuch \uB85C \uC8FD\uB294\uB2E4.\n const firstCheckMaker: FirstCheckMaker = ({target, targetKey}, token, idx) => {\n const saves = getParameterMetadata(target, targetKey!);\n const found = saves.find(s => s.index === idx);\n return found ? ((kindValues as any)[found.kind] ?? null) : undefined;\n };\n\n return app.simstanceManager.executeBindParameterSim(\n {\n target: this,\n targetKey: methodName,\n inputParameters: extraArgs,\n firstCheckMaker: [firstCheckMaker]\n },\n otherStorage\n );\n } else {\n // SimpleApplication(DI \uCEE8\uD14C\uC774\uB108)\uC774 \uC5C6\uB294 standalone \uC0AC\uC6A9 \uC2DC\uC5D0\uB3C4 @hostSet/@helperHostSet/\n // @helperSet\uB9CC\uD07C\uC740 buildSwcParameterArgs\uB85C \uC8FC\uC785\uD574\uC900\uB2E4 \u2014 \uD574\uB2F9 \uB370\uCF54\uB808\uC774\uD130\uAC00 \uD558\uB098\uB3C4 \uC5C6\uC73C\uBA74\n // extraArgs\uB97C \uADF8\uB300\uB85C \uBC18\uD658\uD558\uBBC0\uB85C(\uAE30\uC874 \uB3D9\uC791 \uADF8\uB300\uB85C) \uD558\uC704\uD638\uD658 \uAE68\uC9C0\uC9C0 \uC54A\uB294\uB2E4.\n const args = buildSwcParameterArgs(this, methodName, kindValues, extraArgs);\n return (this as any)[methodName](...args);\n }\n };\n\n proto._bindAttributeEvent = function (el: HTMLElement, attrName: string, script: string, eventName?: string) {\n ensureInit(this);\n if (!eventName) {\n if (!attrName.startsWith('swc-on-')) return;\n eventName = attrName.substring(7);\n }\n const elHandlers = getHandlers(this);\n let handlers = elHandlers.get(el);\n if (!handlers) {\n handlers = new Map();\n elHandlers.set(el, handlers);\n }\n\n const oldHandler = handlers.get(attrName);\n if (oldHandler) el.removeEventListener(eventName, oldHandler);\n\n const handler = async (event: any) => {\n const hostSet = SwcUtils.getHostSet(el);\n const currentWin = SwcUtils.resolveWindow(this);\n const helpers = SwcUtils.getHelperSet(currentWin);\n const args = {\n event,\n $data: (event as CustomEvent).detail,\n ...hostSet,\n ...helpers,\n $el: el,\n $root: this.getRootNode()\n };\n await FunctionUtils.execute({script, context: el, args});\n };\n\n el.addEventListener(eventName, handler);\n handlers.set(attrName, handler);\n };\n\n proto.__swc_executeAttributeEvent = async function (el: HTMLElement, attrName: string, script: string, event: Event) {\n ensureInit(this);\n\n const hostSet = SwcUtils.getHostSet(el);\n const currentWin = SwcUtils.resolveWindow(this);\n const currentHelpers = SwcUtils.getHelperSet(currentWin);\n const detail = (event as CustomEvent).detail;\n const args = {\n event,\n $event: event,\n $data: detail,\n $detail: detail,\n ...hostSet,\n ...currentHelpers,\n $el: el,\n $root: this.getRootNode()\n };\n await FunctionUtils.execute({script, context: el, args});\n };\n};\n\n// \uBD80\uBAA8 \uD074\uB798\uC2A4\uB3C4 elementDefine \uB410\uC73C\uBA74 proto.xxxCallback \uC740 \uBD80\uBAA8\uC758 swc \uB798\uD37C\uB2E4 \u2014 \uADF8\uAC78 \uC6D0\uB798 \uD568\uC218\uB85C \uBD80\uB974\uBA74 \uB77C\uC774\uD504\uC0AC\uC774\uD074\uC774 \uB450 \uBC88 \uB3C8\uB2E4.\n// \uB798\uD37C\uC5D0 \uAE30\uC5B5\uD574 \uB454 \uC0AC\uC6A9\uC790 \uC6D0\uB798 \uD568\uC218(\uC5C6\uC73C\uBA74 undefined)\uB97C \uC4F4\uB2E4.\nconst SWC_ORIGINAL_CALLBACK = Symbol.for('simple-web-component:original-callback');\nconst userCallback = (fn: any) => (typeof fn === 'function' && SWC_ORIGINAL_CALLBACK in fn ? fn[SWC_ORIGINAL_CALLBACK] : fn);\n\nexport const elementDefine =\n (name: string, config: Partial<ElementConfig> = {}): ClassDecorator =>\n (constructor: any) => {\n const { win, doc, builtInTagMap: BUILT_IN_TAG_MAP, domHelpers: SWC_DOM_HELPERS } = buildEnv(config.window);\n const metadata: ElementMetadata = { ...config, name, window: win };\n\n if (!metadata.window) {\n throw new Error('window is required');\n }\n\n let extendsTagName = metadata.extends;\n if (!extendsTagName) {\n let proto = constructor;\n const BaseHTMLElement = (win as any).HTMLElement;\n while (proto && proto !== BaseHTMLElement && proto !== Function.prototype) {\n extendsTagName = BUILT_IN_TAG_MAP.get(proto);\n if (extendsTagName) break;\n proto = Object.getPrototypeOf(proto);\n }\n metadata.extends = extendsTagName;\n }\n\n const attributeList = findAllAttributeMetadata(constructor);\n const applyAttributeMap = findAllAttributeApplyMetadata(constructor);\n\n const swcLifecycleAttributes = ['swc-on-constructor', 'swc-on-connected', 'swc-on-disconnected', 'swc-on-before-connected', 'swc-on-after-connected', 'swc-on-before-disconnected', 'swc-on-after-disconnected', 'swc-on-before-adopted', 'swc-on-after-adopted', 'swc-on-attribute-changed'];\n const swcOnEvents = DOM_EVENT_NAMES.map(e => `swc-on-${e}`);\n\n const attributeApplyNames = Array.from(applyAttributeMap.values())\n .map(it => it.targetAttributeName)\n .filter(Boolean) as string[];\n const hostAttributes = attributeList.filter(it => it.selector === '$this').map(it => it.propertyKey || String(it.propertyKey));\n // Get original static observedAttributes before they're overwritten by Object.defineProperty\n const originalStaticObservedAttributes = (constructor.observedAttributes ?? []) as string[];\n\n const proto = constructor.prototype;\n setupPrototype(proto, win);\n\n // helperHostSet \uC740 \uC778\uC2A4\uD134\uC2A4\uB9C8\uB2E4 \uB2E4\uB974\uB2E4 \u2014 \uD074\uB798\uC2A4 \uB2E8\uC704 \uBCC0\uC218\uB85C \uB450\uBA74 \uB2E4\uB978 \uC778\uC2A4\uD134\uC2A4\uC758 connect \uAC00 \uB36E\uC5B4\uC368\uC11C\n // disconnect \uB54C \uC5C9\uB6B1\uD55C \uC778\uC2A4\uD134\uC2A4\uAC00 \uC815\uB9AC\uB41C\uB2E4. connect \uC2DC\uC810 \uAC12\uC744 \uC778\uC2A4\uD134\uC2A4\uC5D0 \uC800\uC7A5\uD574 disconnect/adopt \uC5D0\uC11C \uC4F4\uB2E4.\n const connectedHelperHostSet = (inst: any): HelperHostSet => inst.__swc_helperHostSet ?? SwcUtils.getHelperAndHostSet(inst);\n // \u2500\u2500 cyclers: \uB370\uCF54\uB808\uC774\uD130\uBCC4 \uB77C\uC774\uD504\uC0AC\uC774\uD074 \uC704\uC784 \uD074\uB798\uC2A4 (elementDefine \uC2DC 1\uD68C \uC0DD\uC131, \uACC4\uC18D \uC7AC\uC0AC\uC6A9) \u2500\u2500\n const eventCycler = new EventListenerLifeCycler();\n const resizeCycler = new ResizeObserverLifeCycler();\n const intersectionCycler = new IntersectionObserverLifeCycler();\n const mutationCycler = new MutationObserverLifeCycler();\n const cyclers: ElementDefineLifeCycler[] = [\n eventCycler,\n new ChangedAttributeLifeCycler(),\n new EmitCustomEventLifeCycler(),\n resizeCycler,\n intersectionCycler,\n mutationCycler,\n new MessageSubscribeLifeCycler(),\n new RouteSubscribeLifeCycler(),\n new SetIntervalLifeCycler(),\n new SetTimeoutLifeCycler(),\n new RequestAnimationFrameLifeCycler(),\n new EventMediaLifeCycler(),\n new FetchLifeCycler(),\n ];\n\n // observedAttributes \uAE30\uC5EC cycler (define-time, constructor \uAE30\uBC18)\n const cyclerObservedAttributes = cyclers.flatMap(c => c.getObservedAttributeNames?.(constructor) ?? []);\n const mergedObservedAttributes = [...new Set([...(metadata.observedAttributes ?? []), ...originalStaticObservedAttributes, ...cyclerObservedAttributes, ...attributeApplyNames, ...hostAttributes, ...swcLifecycleAttributes, ...swcOnEvents])];\n\n // \u2500\u2500 observer \uBE4C\uB4DC (connect 1\uD68C\uB2F9 \uC0C1\uD0DC 1\uAC1C) \u2500\u2500\n // MutationObserver\u00B7ResizeObserver \uB294 \uC778\uC2A4\uD134\uC2A4\uB2F9 1\uAC1C\uC529\uB9CC \uB9CC\uB4E4\uACE0 \uBAA8\uB4E0 \uB370\uCF54\uB808\uC774\uD130\uAC00 \uACF5\uC720\uD55C\uB2E4 (delegate \uCD94\uC801 \uD3EC\uD568).\n // 'self'(\uB80C\uB354 \uC804): \uC790\uAE30 \uC790\uC2E0 \uB300\uC0C1 mutation/resize \uB9CC \uBD99\uC5EC \uCCAB \uB80C\uB354\uBD80\uD130 \uBCF8\uB2E4.\n // 'rest'(\uB80C\uB354 \uD6C4): \uB098\uBA38\uC9C0 \uC804\uBD80\uB97C \uAC19\uC740 \uC635\uC800\uBC84\uC5D0 \uB367\uBD99\uC778\uB2E4.\n // \uC2DC\uD074\uB7EC\uAC00 scope \uBCC4\uB85C \uC790\uAE30 \uBA54\uD0C0\uB9CC \uB2F4\uC740 \uCF5C\uBC31\uC744 \uC8FC\uACE0, \uBA54\uD0C0\uB294 \uC790\uAE30 \uB300\uC0C1 \uB808\uCF54\uB4DC/\uC5D4\uD2B8\uB9AC\uB9CC \uBC1B\uC73C\uBBC0\uB85C \uB530\uB85C \uB098\uB20C \uD544\uC694\uAC00 \uC5C6\uB2E4.\n // IntersectionObserver \uB294 \uC635\uC158 \uADF8\uB8F9\uBCC4\uB85C 1\uAC1C ('rest' \uC804\uC6A9).\n type IntersectionDelegate = { target: string; delegateRoot?: SwcRootType; observe: (el: Element) => void; unobserve: (el: Element) => void };\n interface ObserverState {\n observers: Array<MutationObserver | ResizeObserver | IntersectionObserver>;\n ro?: ResizeObserver;\n roCallbacks: Set<ResizeObserverSetEntry['callback']>;\n roObserved: WeakSet<Element>;\n resizeDelegates: Array<ResizeObserverSetEntry & { target: string }>;\n intersectionDelegates: IntersectionDelegate[];\n mo?: MutationObserver;\n moCallbacks: Set<MutationObserverSetEntry['callback']>;\n moTargets: Map<Element | ShadowRoot, MutationObserverInit>;\n }\n const newObserverState = (): ObserverState => ({\n observers: [], roCallbacks: new Set(), roObserved: new WeakSet(), resizeDelegates: [], intersectionDelegates: [],\n moCallbacks: new Set(), moTargets: new Map(),\n });\n\n // \uAC19\uC740 target \uC774 \uC5EC\uB7EC \uC18C\uC2A4\uC5D0\uC11C \uC9C0\uC815\uB418\uBA74 MutationObserverInit \uC744 \uD569\uC9D1\uD569(\uCD5C\uB300 \uAC10\uC9C0\uBC94\uC704)\uC73C\uB85C \uBCD1\uD569\uD55C\uB2E4.\n const mergeMutationInit = (existing: MutationObserverInit | undefined, next: MutationObserverInit): MutationObserverInit => {\n if (!existing) return next;\n const mergedFilter = existing.attributeFilter || next.attributeFilter\n ? [...new Set([...(existing.attributeFilter ?? []), ...(next.attributeFilter ?? [])])]\n : undefined;\n return {\n childList: existing.childList || next.childList,\n attributes: existing.attributes || next.attributes,\n characterData: existing.characterData || next.characterData,\n subtree: existing.subtree || next.subtree,\n attributeOldValue: existing.attributeOldValue || next.attributeOldValue,\n characterDataOldValue: existing.characterDataOldValue || next.characterDataOldValue,\n attributeFilter: mergedFilter,\n };\n };\n\n // delegate \uC140\uB809\uD130\uC5D0 \uB9DE\uB294 \uC694\uC18C(\uC790\uC2E0 \uB610\uB294 \uD558\uC704)\uB97C \uCC3E\uC544 observe/unobserve \u2014 MutationObserver \uCF5C\uBC31\uC5D0\uC11C \uB3D9\uC801 \uCD94\uC801\uC6A9\n const forDelegateMatches = (n: Node, selector: string, fn: (el: Element) => void) => {\n if (n.nodeType !== 1) return;\n const el = n as HTMLElement;\n const isThis = selector === '$this' || selector === '';\n if (isThis || el.matches?.(selector) || el.closest?.(selector)) fn(el);\n else el.querySelectorAll(selector).forEach(fn);\n };\n\n const buildObservers = async (helperHostSet: HelperHostSet, scope: ObserverScope, st: ObserverState, alive: () => boolean): Promise<void> => {\n const inst = helperHostSet.$this;\n // 'self' \uB294 \uC21C\uC218 \uC218\uC9D1\uAE30(observer \uC2DC\uD074\uB7EC)\uB9CC \uB3CC\uB9B0\uB2E4 \u2014 \uB9AC\uC2A4\uB108\u00B7\uD0C0\uC774\uBA38 \uB4F1 \uBD80\uC791\uC6A9 \uC2DC\uD074\uB7EC\uB294 'rest' \uC5D0\uC11C \uD55C \uBC88\uB9CC.\n const activeCyclers = scope === 'self' ? [resizeCycler, mutationCycler] : cyclers;\n\n // delegate \uCD94\uC801 root \uD574\uC11D: shadow/light/auto/all \u2192 \uC2E4\uC81C root \uBAA9\uB85D\n const resolveDelegateRoots = (delegateRoot: SwcRootType | undefined): (HTMLElement | ShadowRoot)[] => {\n const r = delegateRoot || 'auto';\n const roots: (HTMLElement | ShadowRoot)[] = [];\n if (r === 'auto') roots.push(inst.shadowRoot || inst);\n else if (r === 'light') roots.push(inst);\n else if (r === 'shadow' && inst.shadowRoot) roots.push(inst.shadowRoot);\n else if (r === 'all') { roots.push(inst); if (inst.shadowRoot) roots.push(inst.shadowRoot); }\n return roots;\n };\n\n // 1. \uC2DC\uD074\uB7EC onConnected \u2192 observer Set \uC218\uC9D1 (\uC5EC\uB7EC \uC2DC\uD074\uB7EC\uAC00 \uBC18\uD658\uD55C Set \uC744 \uC804\uBD80 \uB204\uC801)\n let resizeObserverSet: ResizeObserverSet = [];\n let mutationObserverSet: MutationObserverSet = [];\n let intersectionObserverSet: IntersectionObserverSet = [];\n for (const c of activeCyclers) {\n const result = (await c.onConnected?.(helperHostSet, resizeObserverSet, scope)) as OnConnectedResult | void;\n // await \uC0AC\uC774\uC5D0 \uB5BC\uC5B4\uC84C\uC73C\uBA74(\uC0C8 \uC5F0\uACB0\uC774 \uCC28\uB840\uB97C \uAC00\uC838\uAC14\uC73C\uBA74) \uC5EC\uAE30\uC11C \uBA48\uCD98\uB2E4 \u2014 \uC635\uC800\uBC84\uB97C \uB9CC\uB4E4\uBA74 \uC544\uBB34\uB3C4 disconnect \uD558\uC9C0 \uC54A\uC544 \uC0CC\uB2E4.\n if (!alive()) return;\n if (!result) continue;\n if (result.resizeObserverSet?.length) resizeObserverSet = [...resizeObserverSet, ...result.resizeObserverSet];\n if (result.mutationObserverSet?.length) mutationObserverSet = [...mutationObserverSet, ...result.mutationObserverSet];\n if (result.intersectionObserverSet?.length) intersectionObserverSet = [...intersectionObserverSet, ...result.intersectionObserverSet];\n }\n\n // 2. ResizeObserver (1\uAC1C). delegate \uD56D\uBAA9\uC740 \uC140\uB809\uD130 \uBB38\uC790\uC5F4\uC774\uB77C \uCD08\uAE30 observe \uD558\uC9C0 \uC54A\uACE0 MutationObserver \uB85C \uB3D9\uC801 \uCD94\uC801\uD55C\uB2E4.\n const resizeObserve = (el: Element, opts?: ResizeObserverOptions) => {\n if (!st.ro || st.roObserved.has(el)) return;\n st.ro.observe(el, opts);\n st.roObserved.add(el);\n };\n const resizeUnobserve = (el: Element) => {\n if (!st.ro || !st.roObserved.has(el)) return;\n st.ro.unobserve(el);\n st.roObserved.delete(el);\n };\n const newResizeDelegates: ObserverState['resizeDelegates'] = [];\n if (resizeObserverSet.length) {\n if (!st.ro) {\n st.ro = new win.ResizeObserver((entries, obs) => { for (const cb of st.roCallbacks) cb(entries, obs); });\n st.observers.push(st.ro);\n }\n for (const e of resizeObserverSet) {\n st.roCallbacks.add(e.callback);\n if (e.delegate) {\n if (typeof e.target === 'string') newResizeDelegates.push(e as ResizeObserverSetEntry & { target: string });\n continue;\n }\n if (typeof e.target === 'string') {\n // \uBB38\uC790\uC5F4(non-delegate)\uC774\uBA74 root \uC5D0\uC11C \uAC80\uC0C9\uB41C \uC694\uC18C\uB4E4\uC744 observe \uB300\uC0C1\uC73C\uB85C \uCD94\uAC00\uD55C\uB2E4.\n for (const r of resolveDelegateRoots(e.delegateRoot)) r.querySelectorAll(e.target).forEach(el => resizeObserve(el, e.options));\n continue;\n }\n st.ro.observe(e.target as Element, e.options);\n if (e.target instanceof Element) st.roObserved.add(e.target);\n }\n st.resizeDelegates.push(...newResizeDelegates);\n }\n\n // 3. IntersectionObserver: \uC635\uC158 \uADF8\uB8F9\uBCC4\uB85C 1\uAC1C. delegate \uD56D\uBAA9\uC740 MutationObserver \uB85C \uB3D9\uC801 \uCD94\uC801\uD55C\uB2E4.\n const newIntersectionDelegates: IntersectionDelegate[] = [];\n for (const group of intersectionObserverSet) {\n const ioCallbacks = [...new Set(group.observeTargets.map(e => e.callback))];\n const io = new win.IntersectionObserver((entries, obs) => { for (const cb of ioCallbacks) cb(entries, obs); }, group.options);\n const ioObserved = new WeakSet<Element>();\n const observe = (el: Element) => { if (ioObserved.has(el)) return; io.observe(el); ioObserved.add(el); };\n const unobserve = (el: Element) => { if (!ioObserved.has(el)) return; io.unobserve(el); ioObserved.delete(el); };\n for (const e of group.observeTargets) {\n if (e.delegate) { newIntersectionDelegates.push({ target: e.target as string, delegateRoot: e.delegateRoot, observe, unobserve }); continue; }\n if (typeof e.target === 'string') {\n for (const r of resolveDelegateRoots(e.delegateRoot)) r.querySelectorAll(e.target).forEach(observe);\n continue;\n }\n observe(e.target as Element);\n }\n st.observers.push(io);\n }\n st.intersectionDelegates.push(...newIntersectionDelegates);\n\n // 4. MutationObserver (1\uAC1C): mutation \uCF5C\uBC31 + resize/intersection delegate \uB3D9\uC801 \uCD94\uC801\uC744 \uD568\uAED8 \uCC98\uB9AC\uD55C\uB2E4.\n if (mutationObserverSet.length || newResizeDelegates.length || newIntersectionDelegates.length) {\n if (!st.mo) {\n st.mo = new win.MutationObserver((mutations, obs) => {\n for (const mut of mutations) {\n for (const [nodes, on] of [[mut.addedNodes, true], [mut.removedNodes, false]] as const) {\n for (const n of Array.from(nodes)) {\n for (const d of st.resizeDelegates) forDelegateMatches(n, d.target, el => on ? resizeObserve(el, d.options) : resizeUnobserve(el));\n for (const d of st.intersectionDelegates) forDelegateMatches(n, d.target, el => on ? d.observe(el) : d.unobserve(el));\n }\n }\n }\n for (const cb of st.moCallbacks) cb(mutations, obs);\n });\n st.observers.push(st.mo);\n }\n const addObserveTarget = (target: Element | ShadowRoot, options: MutationObserverInit) => {\n st.moTargets.set(target, mergeMutationInit(st.moTargets.get(target), options));\n };\n for (const e of mutationObserverSet) {\n st.moCallbacks.add(e.callback);\n if (e.delegate) continue;\n const init = e.options ?? { childList: true };\n if (typeof e.target === 'string') {\n for (const r of resolveDelegateRoots(e.delegateRoot)) r.querySelectorAll(e.target).forEach(el => addObserveTarget(el, init));\n continue;\n }\n addObserveTarget(e.target, init);\n }\n for (const d of [...newResizeDelegates, ...newIntersectionDelegates]) {\n for (const r of resolveDelegateRoots(d.delegateRoot)) addObserveTarget(r, { childList: true, subtree: true });\n }\n // \uAC19\uC740 \uB178\uB4DC\uB97C \uB2E4\uC2DC observe \uD558\uBA74 \uC635\uC158\uB9CC \uAD50\uCCB4\uB41C\uB2E4 (\uB4F1\uB85D\u00B7\uC804\uB2EC \uC911\uBCF5 \uC5C6\uC74C) \u2192 'self' \uBD84\uACFC \uD569\uCCD0\uC9C4 \uC635\uC158\uC73C\uB85C \uAC31\uC2E0\n for (const [target, options] of st.moTargets) st.mo.observe(target, options);\n }\n\n inst.__swc_observers = st.observers;\n };\n\n const originalConnected = userCallback(proto.connectedCallback);\n proto.connectedCallback = async function () {\n ensureInit(this);\n // \uC7AC\uC5F0\uACB0 \uC2DC \uB204\uC801 \uBC29\uC9C0 \u2014 cycler \uB0B4\uBD80 \uB9AC\uC18C\uC2A4 \uCD08\uAE30\uD654\n const helperHostSet = SwcUtils.getHelperAndHostSet(this as any);\n (this as any).__swc_helperHostSet = helperHostSet;\n const appHost = helperHostSet.$appHost;\n const useSsr = isSSR(this);\n // \uC5F0\uACB0 \uCC98\uB9AC\uB294 await \uB97C \uAC70\uCE5C\uB2E4. \uADF8 \uC0AC\uC774 \uB5A8\uC5B4\uC9C0\uAC70\uB098 \uB2E4\uC2DC \uBD99\uC73C\uBA74(disconnect / \uC0C8 connect \uAC00 \uCC28\uB840 \uBC88\uD638\uB97C \uC62C\uB9AC\uBA74) \uC774 \uC5F0\uACB0\uC740 \uBA48\uCD98\uB2E4 \u2014\n // \uC548 \uADF8\uB7EC\uBA74 \uB5BC\uC5B4\uC9C4 \uB4A4\uC5D0 \uB9AC\uC2A4\uB108\u00B7\uD0C0\uC774\uBA38\uAC00 \uB4F1\uB85D\uB3FC \uC0C8\uACE0, \uB2E4\uC2DC \uBD99\uC740 \uC5F0\uACB0\uACFC \uACB9\uCCD0 \uB450 \uBC88\uC529 \uB3C8\uB2E4.\n // (isConnected \uB294 \uBCF4\uC9C0 \uC54A\uB294\uB2E4 \u2014 \uC9C1\uC811 \uD638\uCD9C\uC774\uB098 SSR \uCC98\uB7FC \uBD99\uC5B4 \uC788\uC9C0 \uC54A\uC544\uB3C4 \uB77C\uC774\uD504\uC0AC\uC774\uD074\uC740 \uB3CC\uC544\uC57C \uD55C\uB2E4)\n const gen = ((this as any).__swc_connectGen = ((this as any).__swc_connectGen ?? 0) + 1);\n const alive = () => (this as any).__swc_connectGen === gen;\n const obsState = newObserverState();\n try {\n if (appHost && typeof (appHost as any)._connected === 'function') {\n await (appHost as any)._connected(this);\n if (!alive()) return;\n } else if (appHost && typeof (appHost as any)) {\n (appHost as any)._connected_safari_and_standby ??= [];\n (appHost as any)._connected_safari_and_standby.push(this);\n }\n\n const conf = getElementConfig(this);\n\n // before-connected \uB77C\uC774\uD504\uC0AC\uC774\uD074 \uBA54\uC11C\uB4DC (@onConnectedBefore)\n for (const m of findAllOnConnectedBeforeMetadata(this)) {\n await (this as any)._invokeLifecycleMethod(m.propertyKey, helperHostSet);\n if (!alive()) return;\n }\n (this as any)._executeSwcScript('swc-on-before-connected', helperHostSet);\n\n // \u2500\u2500 \uB80C\uB354 (@onConnected / @onConnectedBody*) \u2014 elementDefine \uCC45\uC784 \u2500\u2500\n const targetConnectedList = useSsr ? [] : findAllOnConnectedMetadata(constructor);\n const shadowMode = conf?.useShadow || targetConnectedList.find(it => it.options.useShadow)?.options.useShadow;\n if (shadowMode && !this.shadowRoot) {\n const mode = shadowMode === true ? 'open' : shadowMode;\n this.attachShadow({ mode: mode as ShadowRootMode });\n }\n\n // \uC790\uAE30 \uC790\uC2E0 \uB300\uC0C1 mutation/resize \uB294 \uB80C\uB354 \uC804\uC5D0 \uBD99\uC5EC \uCCAB \uB80C\uB354\uBD80\uD130 \uBCF8\uB2E4 (shadow root \uAC00 \uC0DD\uAE34 \uB4A4\uB77C $this \uAC00 \uB9DE\uB294 root \uB97C \uC7A1\uB294\uB2E4)\n await buildObservers(helperHostSet, 'self', obsState, alive);\n if (!alive()) return;\n\n const stateContext: any = { ...helperHostSet };\n findAllStateMetadata(this).forEach(it => {\n stateContext[it.name] = this[it.propertyKey];\n });\n\n const shadowChildren: Node[] = [];\n const lightChildren: Node[] = [];\n\n if (targetConnectedList.length > 0) {\n const toNodes = (value: any): Node[] => {\n if (!value) return [];\n if (typeof value === 'string') {\n const htmlTemplateElement = doc.createElement('template');\n htmlTemplateElement.innerHTML = value;\n return Array.from(htmlTemplateElement.content.childNodes);\n }\n if (Array.isArray(value)) return value;\n return [value];\n };\n // fallback: \uBE44\uB3D9\uAE30 \uB80C\uB354 \uB300\uAE30 \uC911\uC5D0 \uBA3C\uC800 \uBCF4\uC5EC\uC900\uB2E4. \uACB0\uACFC\uB294 \uBAA8\uB4E0 \uB80C\uB354 \uBA54\uC11C\uB4DC\uAC00 \uB05D\uB09C \uB4A4 \uD55C \uBC88\uC5D0 \uB4E4\uC5B4\uAC00\uBBC0\uB85C\n // \uADF8\uB54C \uAC19\uC774 \uAC77\uC5B4\uB0B8\uB2E4 (\uBA54\uC11C\uB4DC\uBCC4\uB85C \uAC77\uC73C\uBA74 \uB2E4\uC74C \uBA54\uC11C\uB4DC\uB97C \uAE30\uB2E4\uB9AC\uB294 \uB3D9\uC548 \uBE48 \uD654\uBA74\uC774 \uB41C\uB2E4).\n const shownFallbacks: Node[] = [];\n const removeFallbacks = () => shownFallbacks.splice(0).forEach(n => (n as ChildNode).remove());\n for (const meta of targetConnectedList) {\n const useShadowRoot = meta.options.useShadow || conf?.useShadow;\n if (meta.options.fallback) {\n const fb = typeof meta.options.fallback === 'function'\n ? (meta.options.fallback as any)(helperHostSet)\n : meta.options.fallback;\n const fallbackNodes = toNodes(fb);\n const parent = useShadowRoot ? this.shadowRoot : this;\n if (fallbackNodes.length && parent) {\n try {\n const processed = SwcUtils.projectProcessHtml(this._swcId, fallbackNodes, doc);\n parent.append(...processed);\n shownFallbacks.push(...processed);\n } catch (e) {\n console.error('[ElementDefine] fallback setting error:', e);\n }\n }\n }\n let res = await (this as any)._invokeLifecycleMethod(meta.propertyKey, helperHostSet);\n if (!alive()) { removeFallbacks(); return; }\n if (typeof res === 'string') {\n const htmlTemplateElement = doc.createElement('template');\n htmlTemplateElement.innerHTML = res;\n res = htmlTemplateElement.content;\n }\n if (res) {\n const nodes = Array.isArray(res) ? res : [res];\n if (meta.options.useShadow || conf?.useShadow) {\n shadowChildren.push(...nodes);\n } else {\n lightChildren.push(...nodes);\n }\n }\n }\n removeFallbacks();\n try {\n if (this.shadowRoot) {\n const applyShadowChildren = SwcUtils.projectProcessHtml(this._swcId, shadowChildren, doc);\n this.shadowRoot.replaceChildren(...applyShadowChildren);\n }\n if (lightChildren.length) {\n const applyLightChildren = SwcUtils.projectProcessHtml(this._swcId, lightChildren, doc);\n this.replaceChildren(...applyLightChildren);\n }\n } catch (e) {\n console.error('[ElementDefine] innerHTML setting error:', e);\n }\n new ElementApply(this, { id: this._swcId }).apply({ context: stateContext, bind: this });\n } else {\n new ElementApply(this, { id: this._swcId }).apply({ exclude: { html: true, text: true, attribute: true }, context: stateContext, bind: this });\n }\n\n // global delegate event\n const root = this.getRootNode();\n if (!globalDelegatedRoots.has(root)) {\n DOM_EVENT_NAMES.forEach(type => {\n root.addEventListener(type, handleGlobalSwcEvent);\n });\n globalDelegatedRoots.add(root);\n }\n\n // \u2500\u2500 cycler \uC2E4\uD589 (\uB80C\uB354 \uD6C4): \uB098\uBA38\uC9C0 \uC2DC\uD074\uB7EC onConnected \u2192 observer Set \uC218\uC9D1 \u2192 \uAC19\uC740 \uC635\uC800\uBC84\uC5D0 \uB367\uBD99\uC784 \u2500\u2500\n await buildObservers(helperHostSet, 'rest', obsState, alive);\n if (!alive()) return;\n\n if (originalConnected) await originalConnected.apply(this);\n if (!alive()) return;\n\n // after-connected \uB77C\uC774\uD504\uC0AC\uC774\uD074 \uBA54\uC11C\uB4DC (@onConnectedAfter)\n for (const m of findAllOnConnectedAfterMetadata(this)) {\n await (this as any)._invokeLifecycleMethod(m.propertyKey, helperHostSet);\n if (!alive()) return;\n }\n (this as any)._executeSwcScript('swc-on-connected', helperHostSet);\n (this as any)._executeSwcScript('swc-on-after-connected', helperHostSet);\n (this as any).__swc_connected = true;\n } finally {\n // \uBA48\uCD98 \uC5F0\uACB0\uC740 \uC644\uB8CC \uD6C5\uC744 \uBD80\uB974\uC9C0 \uC54A\uACE0, \uC571 host \uC5D0\uB294 \uC911\uB2E8\uB9CC \uC54C\uB9B0\uB2E4 (\uC790\uC2DD \uC5F0\uACB0 \uC218\uB9CC \uB9DE\uCD94\uACE0 \uC7AC\uC0DD\uC740 \uC548 \uD568)\n const aborted = !alive();\n if (!aborted) for (const m of findAllLifecycleMetadata(this, ON_CONNECTED_COMPLETED_METADATA_KEY)) await (this as any)._invokeLifecycleMethod(m.propertyKey, helperHostSet);\n if (appHost && typeof (appHost as any)._connectedDone === 'function') {\n await (appHost as any)._connectedDone(this, { aborted });\n }\n }\n };\n\n /////////////////////////////////////////////////\n // disconnectedCallback\n ////////////////////////////////////////////////\n const originalDisconnected = userCallback(proto.disconnectedCallback);\n proto.disconnectedCallback = function () {\n (this as any).__swc_connectGen = ((this as any).__swc_connectGen ?? 0) + 1; // \uC9C4\uD589 \uC911\uC778 \uC5F0\uACB0\uC740 \uBA48\uCD98\uB2E4\n // \uB5A8\uC5B4\uC9C4 \uB4A4\uB77C DOM \uC73C\uB85C\uB294 $appHost \uB97C \uB2E4\uC2DC \uBABB \uCC3E\uB294\uB2E4 \u2192 connect \uB54C \uC800\uC7A5\uD55C \uC774 \uC778\uC2A4\uD134\uC2A4\uC758 \uAC12\n const helperHostSet = connectedHelperHostSet(this);\n const appHost = helperHostSet.$appHost;\n if (appHost && typeof (appHost as any)._disconnected === 'function') {\n (appHost as any)._disconnected(this);\n }\n\n (this as any)._executeSwcScript('swc-on-before-disconnected', helperHostSet);\n for (const m of findAllLifecycleMetadata(this, ON_BEFORE_DISCONNECTED_METADATA_KEY)) (this as any)._invokeLifecycleMethod(m.propertyKey, helperHostSet);\n for (const c of cyclers) c.onDisconnected?.(helperHostSet);\n\n for (const o of (this as any).__swc_observers ?? []) {\n try { (o as any)?.disconnect?.(); } catch (e) { console.error('[SWC] observer disconnect error:', e); }\n }\n (this as any).__swc_observers = [];\n\n // elementApply event listener \uC815\uB9AC\n new ElementApply(this, { id: this._swcId }).removeAllEventListener();\n\n if (originalDisconnected) originalDisconnected.apply(this);\n\n for (const m of findAllLifecycleMetadata(this, ON_AFTER_DISCONNECTED_METADATA_KEY)) (this as any)._invokeLifecycleMethod(m.propertyKey, helperHostSet);\n (this as any)._executeSwcScript('swc-on-disconnected', helperHostSet);\n (this as any)._executeSwcScript('swc-on-after-disconnected', helperHostSet);\n (this as any).__swc_connected = false;\n };\n\n const originalAdopted = userCallback(proto.adoptedCallback);\n proto.adoptedCallback = function () {\n const hostSet = SwcUtils.getHostSet(this as any);\n (this as any)._executeSwcScript('swc-on-before-adopted', hostSet);\n for (const m of findAllLifecycleMetadata(this, ON_BEFORE_ADOPTED_METADATA_KEY)) (this as any)._invokeLifecycleMethod(m.propertyKey, hostSet);\n for (const c of cyclers) c.onAdopted?.(connectedHelperHostSet(this));\n\n if (originalAdopted) originalAdopted.apply(this);\n\n for (const m of findAllLifecycleMetadata(this, ON_AFTER_ADOPTED_METADATA_KEY)) (this as any)._invokeLifecycleMethod(m.propertyKey, hostSet);\n (this as any)._executeSwcScript('swc-on-adopted', hostSet);\n (this as any)._executeSwcScript('swc-on-after-adopted', hostSet);\n };\n\n const originalAttributeChanged = userCallback(proto.attributeChangedCallback);\n proto.attributeChangedCallback = function (name: string, old: string | null, newVal: string | null) {\n if (originalAttributeChanged) originalAttributeChanged.apply(this, [name, old, newVal]);\n\n // attributeChangedCallback \uC740 connected \uC774\uC804\uC5D0\uB3C4 \uD638\uCD9C\uB420 \uC218 \uC788\uC73C\uBBC0\uB85C\n // \uD074\uB85C\uC800\uC758 helperHostSet(null \uAC00\uB2A5) \uB300\uC2E0 \uC774 \uC2DC\uC810\uC5D0 \uC0C8\uB85C \uACC4\uC0B0\uD55C\uB2E4.\n const helperAndHostSet = SwcUtils.getHelperAndHostSet(this as any);\n\n // Process expression directive before passing to handlers\n let processedVal: any = newVal;\n if (newVal !== null) {\n const ae = new ActionExpression(newVal);\n const expr = ae.getFirstExpression('callReturn');\n if (expr) {\n const win = SwcUtils.resolveWindow(this);\n const exprHelperAndHostSet = SwcUtils.getHelperAndHostSet(this as any);\n const script = ConvertUtils.decodeHtmlEntity(expr.script, win.document);\n try {\n const result = FunctionUtils.executeReturn({\n script: script,\n context: this,\n args: exprHelperAndHostSet\n });\n processedVal = result;\n } catch (e) {\n console.error(`[SWC] Failed to execute directive {{= ${expr.script} }} on attribute ${name}: ${exprHelperAndHostSet}`, e);\n processedVal = newVal;\n }\n }\n }\n\n if (name.startsWith('swc-on-') && !swcLifecycleAttributes.includes(name)) {\n if (newVal !== null) {\n const eventName = name.substring(7);\n (this as any)._bindAttributeEvent(this as any, name, newVal, eventName);\n }\n }\n\n // cycler \uC704\uC784: attribute \uC635\uC800\uBE59(@emitCustomEvent(attributeName) / @changedAttribute \uB4F1)\n for (const c of cyclers) c.onAttributeChanged?.(helperAndHostSet, name, old, processedVal);\n };\n\n Object.defineProperty(constructor, 'observedAttributes', {\n get: () => mergedObservedAttributes,\n configurable: true\n });\n\n // \uC774 \uD074\uB798\uC2A4\uB97C \uB2E4\uC2DC \uC0C1\uC18D\uD574 elementDefine \uD558\uBA74 \uC790\uC2DD\uC774 \uC774 \uB798\uD37C \uB300\uC2E0 \uC6D0\uB798 \uC0AC\uC6A9\uC790 \uD568\uC218\uB97C \uBD80\uB974\uB3C4\uB85D \uAE30\uC5B5\uD574 \uB454\uB2E4\n proto.connectedCallback[SWC_ORIGINAL_CALLBACK] = originalConnected;\n proto.disconnectedCallback[SWC_ORIGINAL_CALLBACK] = originalDisconnected;\n proto.adoptedCallback[SWC_ORIGINAL_CALLBACK] = originalAdopted;\n proto.attributeChangedCallback[SWC_ORIGINAL_CALLBACK] = originalAttributeChanged;\n\n ReflectUtils.defineMetadata(ELEMENT_CONFIG_KEY, metadata, constructor);\n const registry = metadata.customElementRegistry || (win as any)?.customElements;\n if (registry && !registry.get(metadata.name)) {\n registry.define(metadata.name, constructor as any, metadata.extends ? { extends: metadata.extends } : undefined);\n }\n return constructor;\n };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA4D;AAC5D,8BAAsC;AACtC,8BAAyC;AACzC,4BAAuC;AACvC,kCAA6C;AAC7C,wBAA+U;AAC/U,6BAAwC;AACxC,8BAAyC;AACzC,4BAAsE;AACtE,mBAAoD;AACpD,mBAAuB;AACvB,oBAAgD;AAChD,oBAA8D;AAE9D,uBAA0D;AAC1D,mBAAqP;AACrP,sBAAyC;AACzC,yBAAoB;AACpB,mBAAmC;AACnC,oBAAoC;AACpC,2BAAsC;AACtC,oCAAyC;AACzC,wCAAuC;AACvC,yBAAoC;AACpC,wBAAmC;AACnC,mCAA8C;AAC9C,wBAAmC;AACnC,mBAA8B;AAIvB,MAAM,qBAAqB,OAAO,IAAI,qCAAqC;AAe3E,MAAM,mB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AAe;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAEA,QAAIA,MAAK,WAAW,SAAS,KAAK,CAAC,uBAAuB,SAASA,KAAI,GAAG;AACxE,UAAI,WAAW,MAAM;AACnB,cAAM,YAAYA,MAAK,UAAU,CAAC;AAClC,QAAC,KAAa,oBAAoB,MAAaA,OAAM,QAAQ,SAAS;AAAA,MACxE;AAAA,IACF;AAGA,eAAW,KAAK,QAAS,GAAE,qBAAqB,kBAAkBA,OAAM,KAAK,YAAY;AAAA,EAC3F;AAEA,SAAO,eAAe,aAAa,sBAAsB;AAAA,IACvD,KAAK,MAAM;AAAA,IACX,cAAc;AAAA,EAChB,CAAC;AAGD,QAAM,kBAAkB,qBAAqB,IAAI;AACjD,QAAM,qBAAqB,qBAAqB,IAAI;AACpD,QAAM,gBAAgB,qBAAqB,IAAI;AAC/C,QAAM,yBAAyB,qBAAqB,IAAI;AAExD,2BAAa,eAAe,oBAAoB,UAAU,WAAW;AACrE,QAAM,WAAW,SAAS,yBAA0B,KAAa;AACjE,MAAI,YAAY,CAAC,SAAS,IAAI,SAAS,IAAI,GAAG;AAC5C,aAAS,OAAO,SAAS,MAAM,aAAoB,SAAS,UAAU,EAAE,SAAS,SAAS,QAAQ,IAAI,MAAS;AAAA,EACjH;AACA,SAAO;AACT;",
|
|
6
|
+
"names": ["proto", "name", "win"]
|
|
7
7
|
}
|
|
@@ -26,7 +26,6 @@ __export(emitCustomEvent_exports, {
|
|
|
26
26
|
emitDocument: () => emitDocument,
|
|
27
27
|
emitLight: () => emitLight,
|
|
28
28
|
emitShadow: () => emitShadow,
|
|
29
|
-
emitThis: () => emitThis,
|
|
30
29
|
emitWindow: () => emitWindow,
|
|
31
30
|
getEmitCustomEventMetadataList: () => getEmitCustomEventMetadataList
|
|
32
31
|
});
|
|
@@ -55,7 +54,7 @@ function createEmitDecorator(selector, type, options) {
|
|
|
55
54
|
fullOptions.bubbles = true;
|
|
56
55
|
if (fullOptions.composed === void 0)
|
|
57
56
|
fullOptions.composed = true;
|
|
58
|
-
let list = import_core.ReflectUtils.
|
|
57
|
+
let list = import_core.ReflectUtils.getOwnMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor);
|
|
59
58
|
if (!list) {
|
|
60
59
|
list = [];
|
|
61
60
|
import_core.ReflectUtils.defineMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, list, constructor);
|
|
@@ -65,16 +64,22 @@ function createEmitDecorator(selector, type, options) {
|
|
|
65
64
|
descriptor.value = function(...args) {
|
|
66
65
|
(0, import_elementDefine.ensureInit)(this);
|
|
67
66
|
const res = original.apply(this, args);
|
|
68
|
-
const
|
|
67
|
+
const extractValue = (v) => {
|
|
68
|
+
const keyToUse = fullOptions.valueKey ?? EMIT_CUSTOM_EVENT_METADATA_KEY;
|
|
69
|
+
if (v && typeof v === "object" && keyToUse in v)
|
|
70
|
+
return v[keyToUse];
|
|
71
|
+
return v;
|
|
72
|
+
};
|
|
73
|
+
const handleResult = (result) => {
|
|
74
|
+
const detail = extractValue(result);
|
|
69
75
|
const event = new CustomEvent(type, {
|
|
70
76
|
detail,
|
|
71
77
|
bubbles: fullOptions.bubbles,
|
|
72
78
|
composed: fullOptions.composed,
|
|
73
79
|
cancelable: fullOptions.cancelable
|
|
74
80
|
});
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(currentWin, this);
|
|
81
|
+
const currentWin = import_Utils.SwcUtils.resolveWindow(this);
|
|
82
|
+
const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(this);
|
|
78
83
|
const eventTargets = [];
|
|
79
84
|
let resolvedSelector = selector;
|
|
80
85
|
if (typeof selector === "function") {
|
|
@@ -145,7 +150,7 @@ function createEmitDecorator(selector, type, options) {
|
|
|
145
150
|
}
|
|
146
151
|
t.dispatchEvent(event);
|
|
147
152
|
});
|
|
148
|
-
return
|
|
153
|
+
return result;
|
|
149
154
|
};
|
|
150
155
|
if (res instanceof Promise) {
|
|
151
156
|
return res.then(handleResult);
|
|
@@ -156,13 +161,10 @@ function createEmitDecorator(selector, type, options) {
|
|
|
156
161
|
};
|
|
157
162
|
}
|
|
158
163
|
const getEmitCustomEventMetadataList = (target) => {
|
|
159
|
-
const constructor = target
|
|
160
|
-
return import_core.ReflectUtils.
|
|
164
|
+
const constructor = typeof target === "function" ? target : target.constructor;
|
|
165
|
+
return import_core.ReflectUtils.findAllMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor).flat();
|
|
161
166
|
};
|
|
162
167
|
const emit = emitCustomEvent;
|
|
163
|
-
function emitThis(type, options) {
|
|
164
|
-
return emitCustomEvent("$this", type, options);
|
|
165
|
-
}
|
|
166
168
|
function emitAppHost(type, options) {
|
|
167
169
|
return emitCustomEvent("$appHost", type, options);
|
|
168
170
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/emitCustomEvent.ts"],
|
|
4
|
-
"sourcesContent": ["import {ReflectUtils} from '@dooboostore/core';\nimport { SpecialSelector, SwcQueryOptions, SwcFnSelector, SwcSelector, HelperHostSet } from '../types';\nimport {ensureInit, getElementConfig} from './elementDefine';\nimport {SwcUtils} from '../utils/Utils';\n\nexport type EmitCustomEventFnSelector = SwcFnSelector;\nexport type EmitCustomEventSelector = SwcSelector;\n\nexport interface EmitCustomEventBaseOptions {\n bubbles?: boolean;\n composed?: boolean;\n cancelable?: boolean;\n filter?: (target: EventTarget, detail: any, meta: { currentThis: any, helper: HelperHostSet }) => boolean;\n /**\n * Custom key to extract value from return object.\n * If not provided, uses EMIT_CUSTOM_EVENT_METADATA_KEY by default.\n * Useful when multiple @emitCustomEvent decorators are on the same method.\n * \n * Example:\n * @emitCustomEvent('$appHost', 'event1', { valueKey: 'detail1' })\n * @emitCustomEvent('$appHost', 'event2', { valueKey: 'detail2' })\n * myMethod() {\n * return {\n * detail1: { type: 'event1', data: 'value1' },\n * detail2: { type: 'event2', data: 'value2' }\n * };\n * }\n */\n valueKey?: symbol | string;\n}\n\ntype Options = (EmitCustomEventBaseOptions & SwcQueryOptions) | (EmitCustomEventBaseOptions & SwcQueryOptions & { attributeName?: string });\n\n// 문자열 셀렉터 전용 — root 허용\nexport type EmitCustomEventQueryOptions = Options;\n// 함수 셀렉터 전용 — root 금지\nexport type EmitCustomEventNonQueryOptions = EmitCustomEventBaseOptions | (EmitCustomEventBaseOptions & { attributeName?: string });\n// 셀렉터 종류에 따라 옵션 타입 분기\nexport type EmitCustomEventOptionsOf<S extends EmitCustomEventSelector> = S extends string ? EmitCustomEventQueryOptions : EmitCustomEventNonQueryOptions;\n\nexport interface EmitCustomEventMetadata {\n propertyKey: string | symbol;\n selector: EmitCustomEventSelector;\n type: string;\n options: Options;\n}\n\nexport const EMIT_CUSTOM_EVENT_METADATA_KEY = Symbol.for('simple-web-component:emit-custom-event');\n\nexport function emitCustomEvent(selector: string, type: string, options?: EmitCustomEventQueryOptions): MethodDecorator;\nexport function emitCustomEvent(selector: EmitCustomEventFnSelector, type: string, options?: EmitCustomEventNonQueryOptions): MethodDecorator;\nexport function emitCustomEvent(type: string, options?: EmitCustomEventQueryOptions): MethodDecorator;\nexport function emitCustomEvent(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\n/**\n * @emitCustomEvent decorator to dispatch custom events to a target.\n * \n * Usage:\n * - @emitCustomEvent('$this', 'event-name', options) - Emit from $this\n * - @emitCustomEvent('$appHost', 'event-name', options) - Emit from $appHost\n * - @emitCustomEvent((this, helper) => '.button', 'event-name', options) - Function-based selector\n * - @emitCustomEvent('event-name', options) - Emit from $this (defaults to $this)\n * - @emitCustomEvent('event-name') - Emit from $this with no options\n */\nexport function emitCustomEvent(selectorOrTarget: any, typeOrPropertyKey?: any, optionsOrDescriptor?: any): any {\n // Case 1: Bare decorator on property\n if (typeof selectorOrTarget === 'object' && typeof typeOrPropertyKey === 'string' && typeof optionsOrDescriptor === 'object' && 'value' in optionsOrDescriptor) {\n throw new Error(`@emitCustomEvent decorator cannot be used on properties. (Property: ${String(typeOrPropertyKey)})`);\n }\n\n // Case 2: With selector and type - @emitCustomEvent('selector', 'event-name', options)\n if ((typeof selectorOrTarget === 'string' || typeof selectorOrTarget === 'function') && typeof typeOrPropertyKey === 'string') {\n return createEmitDecorator(selectorOrTarget, typeOrPropertyKey, optionsOrDescriptor as Options);\n }\n\n // Case 3: Without selector (type only) - @emitCustomEvent('event-name', options)\n if (typeof selectorOrTarget === 'string' && typeOrPropertyKey !== 'string') {\n return createEmitDecorator('$this', selectorOrTarget, typeOrPropertyKey as Options);\n }\n\n // Fallback\n throw new Error('Invalid @emitCustomEvent usage');\n}\n\nfunction createEmitDecorator(selector: EmitCustomEventSelector, type: string, options?: Options) {\n return (targetObj: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = targetObj.constructor;\n\n const fullOptions: any = {...(options || {}), type};\n\n if (fullOptions.bubbles === undefined) fullOptions.bubbles = true;\n if (fullOptions.composed === undefined) fullOptions.composed = true;\n\n let list = ReflectUtils.getMetadata<EmitCustomEventMetadata[]>(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor);\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, list, constructor);\n }\n list.push({propertyKey, selector, type, options: fullOptions});\n\n const original = descriptor.value;\n descriptor.value = function (...args: any[]) {\n ensureInit(this);\n const res = original.apply(this, args);\n\n const handleResult = (detail: any) => {\n const event = new CustomEvent(type, {\n detail,\n bubbles: fullOptions.bubbles,\n composed: fullOptions.composed,\n cancelable: fullOptions.cancelable\n });\n\n const conf = getElementConfig(this);\n const currentWin = (this as any)._resolveWindow?.(conf) || ((typeof window !== 'undefined' ? window : undefined) as Window);\n const hostSet = SwcUtils.getHelperAndHostSet(currentWin, this as any);\n\n const eventTargets: EventTarget[] = [];\n \n // Resolve selector if it's a function\n let resolvedSelector: string | Node | Element | NodeList | Element[] | null = selector as any;\n if (typeof selector === 'function') {\n resolvedSelector = selector(this, hostSet);\n }\n\n // If selector function returned elements directly, use them\n if (resolvedSelector instanceof currentWin.Element) {\n eventTargets.push(resolvedSelector as EventTarget);\n } else if (resolvedSelector instanceof currentWin.NodeList) {\n eventTargets.push(...Array.from(resolvedSelector as EventTarget[]));\n } else if (Array.isArray(resolvedSelector)) {\n eventTargets.push(...(resolvedSelector as EventTarget[]));\n } else if (resolvedSelector === null) {\n // No targets\n } else {\n // Handle string selector\n const stringSelector = resolvedSelector as string;\n \n if (stringSelector === '$window') eventTargets.push(currentWin);\n else if (stringSelector === '$document') eventTargets.push(currentWin.document);\n else if (stringSelector === '$host') {\n if (hostSet.$host) eventTargets.push(hostSet.$host);\n } else if (stringSelector === '$parentHost') {\n if (hostSet.$parentHost) eventTargets.push(hostSet.$parentHost);\n } else if (stringSelector === '$appHost') {\n if (hostSet.$appHost) eventTargets.push(hostSet.$appHost);\n } else if (stringSelector === '$firstHost') {\n if (hostSet.$firstHost) eventTargets.push(hostSet.$firstHost);\n } else if (stringSelector === '$lastHost') {\n if (hostSet.$lastHost) eventTargets.push(hostSet.$lastHost);\n } else if (stringSelector === '$firstAppHost') {\n if (hostSet.$firstAppHost) eventTargets.push(hostSet.$firstAppHost);\n } else if (stringSelector === '$lastAppHost') {\n if (hostSet.$lastAppHost) eventTargets.push(hostSet.$lastAppHost);\n } else if (stringSelector === '$hosts') {\n hostSet.$hosts.forEach(h => eventTargets.push(h));\n } else if (stringSelector === '$appHosts') {\n hostSet.$appHosts.forEach(h => eventTargets.push(h));\n } else if (stringSelector === '$this' || !stringSelector) {\n eventTargets.push(this as any);\n } else {\n const r = fullOptions.root || 'auto';\n const searchRoots: (HTMLElement | ShadowRoot)[] = [];\n if (r === 'auto') searchRoots.push(this.shadowRoot || (this as any));\n else if (r === 'light') searchRoots.push(this as any);\n else if (r === 'shadow' && this.shadowRoot) searchRoots.push(this.shadowRoot);\n else if (r === 'all') {\n searchRoots.push(this as any);\n if (this.shadowRoot) searchRoots.push(this.shadowRoot);\n }\n\n searchRoots.forEach(sr => {\n sr.querySelectorAll(stringSelector).forEach(el => eventTargets.push(el));\n });\n }\n }\n\n eventTargets.forEach(t => {\n if (fullOptions.filter && !fullOptions.filter(t, detail, {currentThis: this, helper: hostSet})) {\n return;\n }\n t.dispatchEvent(event);\n });\n\n return detail;\n };\n\n if (res instanceof Promise) {\n return res.then(handleResult);\n } else {\n return handleResult(res);\n }\n };\n };\n}\n\nexport const getEmitCustomEventMetadataList = (target: any): EmitCustomEventMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor);\n};\n\n// --- Aliases: emit... ---\nexport const emit = emitCustomEvent;\n\n// ─── 편의 헬퍼 (selector/root 생략) ───\n\nexport function emitThis(type: string, options?: EmitCustomEventQueryOptions): MethodDecorator {\n return emitCustomEvent('$this', type, options);\n}\nexport function emitAppHost(type: string, options?: EmitCustomEventQueryOptions): MethodDecorator {\n return emitCustomEvent('$appHost', type, options);\n}\nexport function emitWindow(type: string, options?: EmitCustomEventQueryOptions): MethodDecorator {\n return emitCustomEvent('$window', type, options);\n}\nexport function emitDocument(type: string, options?: EmitCustomEventQueryOptions): MethodDecorator {\n return emitCustomEvent('$document', type, options);\n}\nexport function emitLight(selector: string, type: string, options?: Omit<EmitCustomEventQueryOptions, 'root'>): MethodDecorator {\n return emitCustomEvent(selector, type, {...options ?? {}, root: 'light'} as any);\n}\nexport function emitShadow(selector: string, type: string, options?: Omit<EmitCustomEventQueryOptions, 'root'>): MethodDecorator {\n return emitCustomEvent(selector, type, {...options ?? {}, root: 'shadow'} as any);\n}\nexport function emitAll(selector: string, type: string, options?: Omit<EmitCustomEventQueryOptions, 'root'>): MethodDecorator {\n return emitCustomEvent(selector, type, {...options ?? {}, root: 'all'} as any);\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// EmitCustomEventLifeCycler\n// ─────────────────────────────────────────────────────────────────────────────\nimport { ElementDefineLifeCycler } from '../types';\n\nexport class EmitCustomEventLifeCycler implements ElementDefineLifeCycler {\n private hostEmitMeta: EmitCustomEventMetadata[] | null = null;\n\n private getHostEmitMeta(inst: any): EmitCustomEventMetadata[] {\n if (!this.hostEmitMeta) {\n const all = getEmitCustomEventMetadataList(inst) ?? [];\n this.hostEmitMeta = all.filter(m => m.selector === '$this' || m.selector === '');\n }\n return this.hostEmitMeta;\n }\n\n /** observedAttributes 에 포함할 attributeName 목록 */\n getObservedAttributeNames(inst: any): string[] {\n return this.getHostEmitMeta(inst).map(m => (m.options as any).attributeName).filter(Boolean) as string[];\n }\n\n onConnected(_helperHostSet: HelperHostSet): void {\n // emit 처리는 descriptor.value 래핑으로 이미 완료. connected 시 별도 작업 없음\n }\n\n /** attributeChangedCallback 에서 elementDefine 이 직접 호출 */\n onAttributeChanged(helperHostSet: HelperHostSet, name: string, _old: string | null, newVal: string | null): void {\n const inst = helperHostSet.$this;\n const matched = this.getHostEmitMeta(inst).find(m => (m.options as any).attributeName === name);\n if (matched && newVal !== null) {\n inst._bindAttributeEvent?.(inst, name, newVal, matched.type);\n }\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA
|
|
4
|
+
"sourcesContent": ["import {ReflectUtils} from '@dooboostore/core';\nimport { SpecialSelector, SwcQueryOptions, SwcFnSelector, SwcSelector, HelperHostSet } from '../types';\nimport { ensureInit } from './elementDefine';\nimport {SwcUtils} from '../utils/Utils';\n\nexport type EmitCustomEventFnSelector = SwcFnSelector;\nexport type EmitCustomEventSelector = SwcSelector;\n\nexport interface EmitCustomEventBaseOptions {\n bubbles?: boolean;\n composed?: boolean;\n cancelable?: boolean;\n filter?: (target: EventTarget, detail: any, meta: { currentThis: any, helper: HelperHostSet }) => boolean;\n /**\n * Custom key to extract value from return object.\n * If not provided, uses EMIT_CUSTOM_EVENT_METADATA_KEY by default.\n * Useful when multiple @emitCustomEvent decorators are on the same method.\n * \n * Example:\n * @emitCustomEvent('$appHost', 'event1', { valueKey: 'detail1' })\n * @emitCustomEvent('$appHost', 'event2', { valueKey: 'detail2' })\n * myMethod() {\n * return {\n * detail1: { type: 'event1', data: 'value1' },\n * detail2: { type: 'event2', data: 'value2' }\n * };\n * }\n */\n valueKey?: symbol | string;\n}\n\ntype Options = (EmitCustomEventBaseOptions & SwcQueryOptions) | (EmitCustomEventBaseOptions & SwcQueryOptions & { attributeName?: string });\n\n// 문자열 셀렉터 전용 — root 허용\nexport type EmitCustomEventQueryOptions = Options;\n// 함수 셀렉터 전용 — root 금지\nexport type EmitCustomEventNonQueryOptions = EmitCustomEventBaseOptions | (EmitCustomEventBaseOptions & { attributeName?: string });\n// 셀렉터 종류에 따라 옵션 타입 분기\nexport type EmitCustomEventOptionsOf<S extends EmitCustomEventSelector> = S extends string ? EmitCustomEventQueryOptions : EmitCustomEventNonQueryOptions;\n\nexport interface EmitCustomEventMetadata {\n propertyKey: string | symbol;\n selector: EmitCustomEventSelector;\n type: string;\n options: Options;\n}\n\nexport const EMIT_CUSTOM_EVENT_METADATA_KEY = Symbol.for('simple-web-component:emit-custom-event');\n\nexport function emitCustomEvent(selector: string, type: string, options?: EmitCustomEventQueryOptions): MethodDecorator;\nexport function emitCustomEvent(selector: EmitCustomEventFnSelector, type: string, options?: EmitCustomEventNonQueryOptions): MethodDecorator;\nexport function emitCustomEvent(type: string, options?: EmitCustomEventQueryOptions): MethodDecorator;\nexport function emitCustomEvent(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\n/**\n * @emitCustomEvent decorator to dispatch custom events to a target.\n * \n * Usage:\n * - @emitCustomEvent('$this', 'event-name', options) - Emit from $this\n * - @emitCustomEvent('$appHost', 'event-name', options) - Emit from $appHost\n * - @emitCustomEvent((this, helper) => '.button', 'event-name', options) - Function-based selector\n * - @emitCustomEvent('event-name', options) - Emit from $this (defaults to $this)\n * - @emitCustomEvent('event-name') - Emit from $this with no options\n */\nexport function emitCustomEvent(selectorOrTarget: any, typeOrPropertyKey?: any, optionsOrDescriptor?: any): any {\n // Case 1: Bare decorator on property\n if (typeof selectorOrTarget === 'object' && typeof typeOrPropertyKey === 'string' && typeof optionsOrDescriptor === 'object' && 'value' in optionsOrDescriptor) {\n throw new Error(`@emitCustomEvent decorator cannot be used on properties. (Property: ${String(typeOrPropertyKey)})`);\n }\n\n // Case 2: With selector and type - @emitCustomEvent('selector', 'event-name', options)\n if ((typeof selectorOrTarget === 'string' || typeof selectorOrTarget === 'function') && typeof typeOrPropertyKey === 'string') {\n return createEmitDecorator(selectorOrTarget, typeOrPropertyKey, optionsOrDescriptor as Options);\n }\n\n // Case 3: Without selector (type only) - @emitCustomEvent('event-name', options)\n if (typeof selectorOrTarget === 'string' && typeOrPropertyKey !== 'string') {\n return createEmitDecorator('$this', selectorOrTarget, typeOrPropertyKey as Options);\n }\n\n // Fallback\n throw new Error('Invalid @emitCustomEvent usage');\n}\n\nfunction createEmitDecorator(selector: EmitCustomEventSelector, type: string, options?: Options) {\n return (targetObj: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = targetObj.constructor;\n\n const fullOptions: any = {...(options || {}), type};\n\n if (fullOptions.bubbles === undefined) fullOptions.bubbles = true;\n if (fullOptions.composed === undefined) fullOptions.composed = true;\n\n let list = ReflectUtils.getOwnMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor) as EmitCustomEventMetadata[] | undefined;\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, list, constructor);\n }\n list.push({propertyKey, selector, type, options: fullOptions});\n\n const original = descriptor.value;\n descriptor.value = function (...args: any[]) {\n ensureInit(this);\n const res = original.apply(this, args);\n\n // 리턴값이 객체이고 valueKey(기본 EMIT_CUSTOM_EVENT_METADATA_KEY) 를 가지면 그 값, 아니면 리턴값 전체를 detail 로\n const extractValue = (v: any) => {\n const keyToUse = fullOptions.valueKey ?? EMIT_CUSTOM_EVENT_METADATA_KEY;\n if (v && typeof v === 'object' && keyToUse in v) return v[keyToUse];\n return v;\n };\n\n const handleResult = (result: any) => {\n const detail = extractValue(result);\n const event = new CustomEvent(type, {\n detail,\n bubbles: fullOptions.bubbles,\n composed: fullOptions.composed,\n cancelable: fullOptions.cancelable\n });\n\n const currentWin = SwcUtils.resolveWindow(this);\n const hostSet = SwcUtils.getHelperAndHostSet(this as any);\n\n const eventTargets: EventTarget[] = [];\n \n // Resolve selector if it's a function\n let resolvedSelector: string | Node | Element | NodeList | Element[] | null = selector as any;\n if (typeof selector === 'function') {\n resolvedSelector = selector(this, hostSet);\n }\n\n // If selector function returned elements directly, use them\n if (resolvedSelector instanceof currentWin.Element) {\n eventTargets.push(resolvedSelector as EventTarget);\n } else if (resolvedSelector instanceof currentWin.NodeList) {\n eventTargets.push(...Array.from(resolvedSelector as NodeList));\n } else if (Array.isArray(resolvedSelector)) {\n eventTargets.push(...(resolvedSelector as EventTarget[]));\n } else if (resolvedSelector === null) {\n // No targets\n } else {\n // Handle string selector\n const stringSelector = resolvedSelector as string;\n \n if (stringSelector === '$window') eventTargets.push(currentWin);\n else if (stringSelector === '$document') eventTargets.push(currentWin.document);\n else if (stringSelector === '$host') {\n if (hostSet.$host) eventTargets.push(hostSet.$host);\n } else if (stringSelector === '$parentHost') {\n if (hostSet.$parentHost) eventTargets.push(hostSet.$parentHost);\n } else if (stringSelector === '$appHost') {\n if (hostSet.$appHost) eventTargets.push(hostSet.$appHost);\n } else if (stringSelector === '$firstHost') {\n if (hostSet.$firstHost) eventTargets.push(hostSet.$firstHost);\n } else if (stringSelector === '$lastHost') {\n if (hostSet.$lastHost) eventTargets.push(hostSet.$lastHost);\n } else if (stringSelector === '$firstAppHost') {\n if (hostSet.$firstAppHost) eventTargets.push(hostSet.$firstAppHost);\n } else if (stringSelector === '$lastAppHost') {\n if (hostSet.$lastAppHost) eventTargets.push(hostSet.$lastAppHost);\n } else if (stringSelector === '$hosts') {\n hostSet.$hosts.forEach(h => eventTargets.push(h));\n } else if (stringSelector === '$appHosts') {\n hostSet.$appHosts.forEach(h => eventTargets.push(h));\n } else if (stringSelector === '$this' || !stringSelector) {\n eventTargets.push(this as any);\n } else {\n const r = fullOptions.root || 'auto';\n const searchRoots: (HTMLElement | ShadowRoot)[] = [];\n if (r === 'auto') searchRoots.push(this.shadowRoot || (this as any));\n else if (r === 'light') searchRoots.push(this as any);\n else if (r === 'shadow' && this.shadowRoot) searchRoots.push(this.shadowRoot);\n else if (r === 'all') {\n searchRoots.push(this as any);\n if (this.shadowRoot) searchRoots.push(this.shadowRoot);\n }\n\n searchRoots.forEach(sr => {\n sr.querySelectorAll(stringSelector).forEach(el => eventTargets.push(el));\n });\n }\n }\n\n eventTargets.forEach(t => {\n if (fullOptions.filter && !fullOptions.filter(t, detail, {currentThis: this, helper: hostSet})) {\n return;\n }\n t.dispatchEvent(event);\n });\n\n return result;\n };\n\n if (res instanceof Promise) {\n return res.then(handleResult);\n } else {\n return handleResult(res);\n }\n };\n };\n}\n\nexport const getEmitCustomEventMetadataList = (target: any): EmitCustomEventMetadata[] | undefined => {\n const constructor = typeof target === 'function' ? target : target.constructor;\n return ReflectUtils.findAllMetadata<any[]>(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor).flat();\n};\n\n// --- Aliases: emit... ---\nexport const emit = emitCustomEvent;\n\n// ─── 편의 헬퍼 (selector/root 생략) ───\n\nexport function emitAppHost(type: string, options?: EmitCustomEventQueryOptions): MethodDecorator {\n return emitCustomEvent('$appHost', type, options);\n}\nexport function emitWindow(type: string, options?: EmitCustomEventQueryOptions): MethodDecorator {\n return emitCustomEvent('$window', type, options);\n}\nexport function emitDocument(type: string, options?: EmitCustomEventQueryOptions): MethodDecorator {\n return emitCustomEvent('$document', type, options);\n}\nexport function emitLight(selector: string, type: string, options?: Omit<EmitCustomEventQueryOptions, 'root'>): MethodDecorator {\n return emitCustomEvent(selector, type, {...options ?? {}, root: 'light'} as any);\n}\nexport function emitShadow(selector: string, type: string, options?: Omit<EmitCustomEventQueryOptions, 'root'>): MethodDecorator {\n return emitCustomEvent(selector, type, {...options ?? {}, root: 'shadow'} as any);\n}\nexport function emitAll(selector: string, type: string, options?: Omit<EmitCustomEventQueryOptions, 'root'>): MethodDecorator {\n return emitCustomEvent(selector, type, {...options ?? {}, root: 'all'} as any);\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// EmitCustomEventLifeCycler\n// ─────────────────────────────────────────────────────────────────────────────\nimport { ElementDefineLifeCycler } from '../types';\n\nexport class EmitCustomEventLifeCycler implements ElementDefineLifeCycler {\n private hostEmitMeta: EmitCustomEventMetadata[] | null = null;\n\n private getHostEmitMeta(inst: any): EmitCustomEventMetadata[] {\n if (!this.hostEmitMeta) {\n const all = getEmitCustomEventMetadataList(inst) ?? [];\n this.hostEmitMeta = all.filter(m => m.selector === '$this' || m.selector === '');\n }\n return this.hostEmitMeta;\n }\n\n /** observedAttributes 에 포함할 attributeName 목록 */\n getObservedAttributeNames(inst: any): string[] {\n return this.getHostEmitMeta(inst).map(m => (m.options as any).attributeName).filter(Boolean) as string[];\n }\n\n onConnected(_helperHostSet: HelperHostSet): void {\n // emit 처리는 descriptor.value 래핑으로 이미 완료. connected 시 별도 작업 없음\n }\n\n /** attributeChangedCallback 에서 elementDefine 이 직접 호출 */\n onAttributeChanged(helperHostSet: HelperHostSet, name: string, _old: string | null, newVal: string | null): void {\n const inst = helperHostSet.$this;\n const matched = this.getHostEmitMeta(inst).find(m => (m.options as any).attributeName === name);\n if (matched && newVal !== null) {\n inst._bindAttributeEvent?.(inst, name, newVal, matched.type);\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;kBAA2B;AAE3B,2BAA2B;AAC3B,mBAAuB;AA4ChB,MAAM,iCAAiC,OAAO,IAAI,wCAAwC;AAgB3F,SAAU,gBAAgB,kBAAuB,mBAAyB,qBAAyB;AAEvG,MAAI,OA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= __toCommonJS(eventMedia_exports);
|
|
29
29
|
var import_core = require("@dooboostore/core");
|
|
30
|
+
var import_Utils = require("../utils/Utils");
|
|
31
|
+
var import_parameter = require("./parameter");
|
|
30
32
|
const EVENT_MEDIA_METADATA_KEY = Symbol.for("simple-web-component:event-media");
|
|
31
|
-
function eventMedia(query, eventType) {
|
|
33
|
+
function eventMedia(query, eventType, options) {
|
|
32
34
|
return (target, propertyKey) => {
|
|
33
35
|
const constructor = target.constructor;
|
|
34
36
|
let metaList = import_core.ReflectUtils.getOwnMetadata(EVENT_MEDIA_METADATA_KEY, constructor);
|
|
@@ -36,14 +38,14 @@ function eventMedia(query, eventType) {
|
|
|
36
38
|
metaList = [];
|
|
37
39
|
import_core.ReflectUtils.defineMetadata(EVENT_MEDIA_METADATA_KEY, metaList, constructor);
|
|
38
40
|
}
|
|
39
|
-
metaList.push({ propertyKey, query, eventType });
|
|
41
|
+
metaList.push({ propertyKey, query, eventType, filter: options?.filter, before: options?.before, finally: options?.finally });
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
|
-
function eventMediaChange(query) {
|
|
43
|
-
return eventMedia(query, "change");
|
|
44
|
+
function eventMediaChange(query, options) {
|
|
45
|
+
return eventMedia(query, "change", options);
|
|
44
46
|
}
|
|
45
47
|
const findAllEventMediaMetadata = (target) => {
|
|
46
|
-
const constructor = target
|
|
48
|
+
const constructor = typeof target === "function" ? target : target.constructor;
|
|
47
49
|
return (import_core.ReflectUtils.findAllMetadata(EVENT_MEDIA_METADATA_KEY, constructor) || []).flat();
|
|
48
50
|
};
|
|
49
51
|
class EventMediaLifeCycler {
|
|
@@ -54,12 +56,38 @@ class EventMediaLifeCycler {
|
|
|
54
56
|
const inst = helperHostSet.$this;
|
|
55
57
|
const metaList = findAllEventMediaMetadata(inst);
|
|
56
58
|
if (metaList.length === 0) return;
|
|
59
|
+
const win = helperHostSet.$w;
|
|
57
60
|
const entries = [];
|
|
58
61
|
for (const meta of metaList) {
|
|
59
|
-
const mql =
|
|
60
|
-
const handler = (e) => {
|
|
62
|
+
const mql = win.matchMedia(meta.query);
|
|
63
|
+
const handler = async (e) => {
|
|
61
64
|
try {
|
|
62
|
-
|
|
65
|
+
const helper = import_Utils.SwcUtils.getHelperAndHostSet(inst);
|
|
66
|
+
if (meta.filter && !await meta.filter(e, { currentThis: inst, helper })) return;
|
|
67
|
+
const hostSet = import_Utils.SwcUtils.getHostSet(inst);
|
|
68
|
+
const helperSet = import_Utils.SwcUtils.getHelperSet(win);
|
|
69
|
+
const legacyArgs = [e, helperHostSet];
|
|
70
|
+
const buildArgs = (beforeReturn) => (0, import_parameter.buildSwcParameterArgs)(inst, meta.propertyKey, {
|
|
71
|
+
eventObject: e,
|
|
72
|
+
hostSet,
|
|
73
|
+
helperHostSet: helper,
|
|
74
|
+
helperSet,
|
|
75
|
+
eventMediaBeforeReturn: beforeReturn
|
|
76
|
+
}, legacyArgs);
|
|
77
|
+
let args = buildArgs(void 0);
|
|
78
|
+
if (meta.before) {
|
|
79
|
+
const beforeReturn = await meta.before(e, { currentThis: inst, helper }, args);
|
|
80
|
+
args = buildArgs(beforeReturn);
|
|
81
|
+
}
|
|
82
|
+
let result, error;
|
|
83
|
+
try {
|
|
84
|
+
result = await inst[meta.propertyKey](...args);
|
|
85
|
+
} catch (err) {
|
|
86
|
+
error = err;
|
|
87
|
+
} finally {
|
|
88
|
+
if (meta.finally) await meta.finally(e, { currentThis: inst, helper }, { args, result, error });
|
|
89
|
+
}
|
|
90
|
+
if (error) throw error;
|
|
63
91
|
} catch (err) {
|
|
64
92
|
console.error("[SWC] eventMedia handler error:", err);
|
|
65
93
|
}
|