@dooboostore/simple-web-component 1.0.48 → 1.0.49
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 +117 -19
- package/dist/cjs/config/config.js +1 -1
- package/dist/cjs/config/config.js.map +2 -2
- package/dist/cjs/decorators/addEventListener.js +387 -29
- package/dist/cjs/decorators/addEventListener.js.map +3 -3
- package/dist/cjs/decorators/applyAttribute.js +25 -0
- package/dist/cjs/decorators/applyAttribute.js.map +2 -2
- package/dist/cjs/decorators/applyClass.js +49 -18
- package/dist/cjs/decorators/applyClass.js.map +3 -3
- package/dist/cjs/decorators/applyNode.js +67 -1
- package/dist/cjs/decorators/applyNode.js.map +3 -3
- package/dist/cjs/decorators/applyProperty.js +101 -3
- package/dist/cjs/decorators/applyProperty.js.map +2 -2
- package/dist/cjs/decorators/applyStyle.js +36 -5
- package/dist/cjs/decorators/applyStyle.js.map +2 -2
- package/dist/cjs/decorators/changedAttribute.js +39 -0
- package/dist/cjs/decorators/changedAttribute.js.map +2 -2
- package/dist/cjs/decorators/elementDefine.js +237 -437
- package/dist/cjs/decorators/elementDefine.js.map +3 -3
- package/dist/cjs/decorators/emitCustomEvent.js +55 -0
- package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
- package/dist/cjs/decorators/index.js +3 -1
- package/dist/cjs/decorators/index.js.map +2 -2
- package/dist/cjs/decorators/intersectionObserver.js +209 -0
- package/dist/cjs/decorators/intersectionObserver.js.map +7 -0
- package/dist/cjs/decorators/mutationObserver.js +140 -0
- package/dist/cjs/decorators/mutationObserver.js.map +3 -3
- package/dist/cjs/decorators/query.js +117 -102
- package/dist/cjs/decorators/query.js.map +2 -2
- package/dist/cjs/decorators/resizeObserver.js +87 -0
- package/dist/cjs/decorators/resizeObserver.js.map +2 -2
- package/dist/cjs/decorators/setInterval.js +82 -0
- package/dist/cjs/decorators/setInterval.js.map +7 -0
- package/dist/cjs/decorators/setTimeout.js +82 -0
- package/dist/cjs/decorators/setTimeout.js.map +7 -0
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js +9 -0
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js +9 -0
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/esm/config/config.js +1 -1
- package/dist/esm/config/config.js.map +2 -2
- package/dist/esm/decorators/addEventListener.js +388 -29
- package/dist/esm/decorators/addEventListener.js.map +3 -3
- package/dist/esm/decorators/applyAttribute.js +25 -0
- package/dist/esm/decorators/applyAttribute.js.map +2 -2
- package/dist/esm/decorators/applyClass.js +49 -18
- package/dist/esm/decorators/applyClass.js.map +3 -3
- package/dist/esm/decorators/applyNode.js +67 -1
- package/dist/esm/decorators/applyNode.js.map +3 -3
- package/dist/esm/decorators/applyProperty.js +101 -3
- package/dist/esm/decorators/applyProperty.js.map +2 -2
- package/dist/esm/decorators/applyStyle.js +36 -5
- package/dist/esm/decorators/applyStyle.js.map +2 -2
- package/dist/esm/decorators/changedAttribute.js +40 -0
- package/dist/esm/decorators/changedAttribute.js.map +2 -2
- package/dist/esm/decorators/elementDefine.js +244 -444
- package/dist/esm/decorators/elementDefine.js.map +3 -3
- package/dist/esm/decorators/emitCustomEvent.js +55 -0
- package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
- package/dist/esm/decorators/index.js +3 -1
- package/dist/esm/decorators/index.js.map +2 -2
- package/dist/esm/decorators/intersectionObserver.js +191 -0
- package/dist/esm/decorators/intersectionObserver.js.map +7 -0
- package/dist/esm/decorators/mutationObserver.js +141 -0
- package/dist/esm/decorators/mutationObserver.js.map +3 -3
- package/dist/esm/decorators/query.js +117 -102
- package/dist/esm/decorators/query.js.map +2 -2
- package/dist/esm/decorators/resizeObserver.js +88 -0
- package/dist/esm/decorators/resizeObserver.js.map +2 -2
- package/dist/esm/decorators/setInterval.js +64 -0
- package/dist/esm/decorators/setInterval.js.map +7 -0
- package/dist/esm/decorators/setTimeout.js +64 -0
- package/dist/esm/decorators/setTimeout.js.map +7 -0
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +9 -0
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js +9 -0
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +2565 -1474
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/config/config.d.ts.map +1 -1
- package/dist/types/decorators/addEventListener.d.ts +84 -33
- package/dist/types/decorators/addEventListener.d.ts.map +1 -1
- package/dist/types/decorators/applyAttribute.d.ts +22 -34
- package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
- package/dist/types/decorators/applyClass.d.ts +34 -34
- package/dist/types/decorators/applyClass.d.ts.map +1 -1
- package/dist/types/decorators/applyNode.d.ts +30 -20
- package/dist/types/decorators/applyNode.d.ts.map +1 -1
- package/dist/types/decorators/applyProperty.d.ts +57 -34
- package/dist/types/decorators/applyProperty.d.ts.map +1 -1
- package/dist/types/decorators/applyStyle.d.ts +25 -12
- package/dist/types/decorators/applyStyle.d.ts.map +1 -1
- package/dist/types/decorators/changedAttribute.d.ts +11 -0
- package/dist/types/decorators/changedAttribute.d.ts.map +1 -1
- package/dist/types/decorators/elementDefine.d.ts +0 -14
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/decorators/emitCustomEvent.d.ts +28 -4
- package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
- package/dist/types/decorators/index.d.ts +3 -1
- package/dist/types/decorators/index.d.ts.map +1 -1
- package/dist/types/decorators/intersectionObserver.d.ts +49 -0
- package/dist/types/decorators/intersectionObserver.d.ts.map +1 -0
- package/dist/types/decorators/mutationObserver.d.ts +35 -25
- package/dist/types/decorators/mutationObserver.d.ts.map +1 -1
- package/dist/types/decorators/query.d.ts +57 -14
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/resizeObserver.d.ts +34 -23
- package/dist/types/decorators/resizeObserver.d.ts.map +1 -1
- package/dist/types/decorators/setInterval.d.ts +29 -0
- package/dist/types/decorators/setInterval.d.ts.map +1 -0
- package/dist/types/decorators/setTimeout.d.ts +29 -0
- package/dist/types/decorators/setTimeout.d.ts.map +1 -0
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +7 -1
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +1 -1
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +6 -0
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +104 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +2565 -1474
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +7 -5
- package/src/config/config.ts +1 -1
- package/src/decorators/addEventListener.ts +394 -34
- package/src/decorators/applyAttribute.ts +50 -36
- package/src/decorators/applyClass.ts +76 -26
- package/src/decorators/applyNode.ts +114 -36
- package/src/decorators/applyProperty.ts +152 -40
- package/src/decorators/applyStyle.ts +64 -17
- package/src/decorators/changedAttribute.ts +46 -0
- package/src/decorators/elementDefine.ts +281 -580
- package/src/decorators/emitCustomEvent.ts +73 -5
- package/src/decorators/index.ts +3 -1
- package/src/decorators/intersectionObserver.ts +259 -0
- package/src/decorators/mutationObserver.ts +215 -39
- package/src/decorators/query.ts +168 -126
- package/src/decorators/resizeObserver.ts +152 -46
- package/src/decorators/setInterval.ts +80 -0
- package/src/decorators/setTimeout.ts +80 -0
- package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +17 -0
- package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +19 -0
- package/src/types/index.ts +141 -0
- package/dist/cjs/decorators/queryAll.js +0 -181
- package/dist/cjs/decorators/queryAll.js.map +0 -7
- package/dist/esm/decorators/queryAll.js +0 -162
- package/dist/esm/decorators/queryAll.js.map +0 -7
- package/dist/types/decorators/queryAll.d.ts +0 -22
- package/dist/types/decorators/queryAll.d.ts.map +0 -1
- package/src/decorators/queryAll.ts +0 -186
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/elementDefine.ts"],
|
|
4
|
-
"sourcesContent": ["import {ActionExpression, FunctionUtils, ReflectUtils, Subject} from '@dooboostore/core';\nimport {debounceTime, distinctUntilChanged, throttleTime} from '@dooboostore/core/message/operators';\nimport {getAddEventListenerMetadata} from './addEventListener';\nimport {getMutationObserverMetadata} from './mutationObserver';\nimport type {MutationObserverBaseOptions, MutationObserverMetadata} from './mutationObserver';\nimport {getResizeObserverMetadata} from './resizeObserver';\nimport type {ResizeObserverMetadata} from './resizeObserver';\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 {getEmitCustomEventMetadataList} from './emitCustomEvent';\nimport {convertAttributeValue, findAllAttributeChangedMetadata} from './changedAttribute';\nimport {findAllAttributeApplyMetadata, findAllAttributeMetadata, getAttributeValue} from './applyAttribute';\nimport {getQueryMetadata} from './query';\nimport {getQueryAllMetadata} from './queryAll';\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 {HelperHostSet, HostSet, InjectSituationType} from '../types';\nimport {ConvertUtils, ElementApply} from '@dooboostore/core-web';\nimport {isSSR} from \"../elements/SwcAppMixin\";\nimport {findAllStateMetadata} from \"./state\";\nimport {findAllPropertyMetadata} from \"./applyProperty\";\n\n// --- Core Interfaces & Types ---\n\nexport const ELEMENT_CONFIG_KEY = Symbol.for('simple-web-component:element-config');\n\n/** \uBC14\uC778\uB529\uB41C \uC774\uBCA4\uD2B8 \uB9AC\uC2A4\uB108 \uD55C \uAC74 */\nexport interface BoundListener {\n target: EventTarget;\n type: string;\n handler: EventListener;\n options: AddEventListenerOptions;\n onRemoves?: Array<{ fn: (target: EventTarget, optionValue: unknown) => void; opts: unknown }>;\n subscription?: { unsubscribe: () => void };\n}\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 // 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 return app.simstanceManager.executeBindParameterSim(\n {\n target: this,\n targetKey: methodName,\n inputParameters: extraArgs\n },\n otherStorage\n );\n } else {\n return (this as any)[methodName](...extraArgs);\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 emitCustomEventList = getEmitCustomEventMetadataList(constructor) || [];\n const emitHostCustomEventList = emitCustomEventList.filter(meta => meta.selector === '$this' || meta.selector === '');\n const addEventListenerList = getAddEventListenerMetadata(constructor) || [];\n const mutationObserverList = getMutationObserverMetadata(constructor) || [];\n const resizeObserverList = getResizeObserverMetadata(constructor) || [];\n const attrChangeMap = findAllAttributeChangedMetadata(constructor);\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 const mergedObservedAttributes = [...new Set([...(metadata.observedAttributes ?? []), ...originalStaticObservedAttributes, ...attrChangeMap.keys(), ...attributeApplyNames, ...hostAttributes, ...emitHostCustomEventList.map(it => (it.options as any).attributeName).filter(Boolean), ...swcLifecycleAttributes, ...swcOnEvents])];\n // const connectedInnerHtmlList = getOnConnectedInnerHtmlMetadata(constructor) || [];\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 // \uC774\uBCA4\uD2B8 \uB9AC\uC2A4\uB108 / MutationObserver / ResizeObserver \uC778\uC2A4\uD134\uC2A4 (\uD074\uB85C\uC800 \uBCC0\uC218 \u2014 connected/disconnected \uACF5\uC720)\n let boundListeners: BoundListener[] = [];\n let shadowMutationObserver: MutationObserver | null = null;\n let lightMutationObserver: MutationObserver | null = null;\n let resizeObserver: ResizeObserver | null = null;\n // \uC0DD\uC131\uB41C \uBAA8\uB4E0 track(Mutation)Observer (disconnected \uC2DC \uC815\uB9AC)\n let resizeObservers: Array<ResizeObserver | MutationObserver> = [];\n // \uBA54\uD0C0\uBCC4 removeObserver \uCF5C\uBC31 \uBAA9\uB85D (disconnected \uC2DC \uD638\uCD9C)\n let removeObserverCallbacks: Array<{ fn: (target: Element, optionValue: unknown) => void; target: any; opts: unknown }> = [];\n const originalConnected = proto.connectedCallback;\n proto.connectedCallback = async function () {\n ensureInit(this);\n // \uC7AC\uC5F0\uACB0 \uC2DC \uB204\uC801 \uBC29\uC9C0 \u2014 \uD074\uB85C\uC800 \uBCC0\uC218 \uB9AC\uC14B\n boundListeners = [];\n resizeObservers = [];\n removeObserverCallbacks = [];\n // connected \uB410\uC744\uC2DC \uCD5C\uC2E0\uD654\n helperHostSet = SwcUtils.getHelperAndHostSet(win, this as any);\n const appHost = helperHostSet.$appHost;\n const useSsr = isSSR(this);\n // console.log('isSsr', useSsr, this);\n // console.log('----helperHostSet--->', this, helperHostSet, useSsr)\n // let connectedApp: SwcAppInterface |undefined;\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 hostSet = SwcUtils.getHostSet(this as any);\n const conf = getElementConfig(this);\n const currentWin = (this as any)._resolveWindow(conf);\n\n const bMethods = findAllOnConnectedBeforeMetadata(this); //.filter(it => useSsr ? !it.options.ssrFirst : true);\n // console.log('beforeConnected', bMethods)\n for (const m of bMethods) await (this as any)._invokeLifecycleMethod(m.propertyKey, helperHostSet);\n (this as any)._executeSwcScript('swc-on-before-connected', helperHostSet);\n\n // console.log('vvvvvvvvvvvvvvvu-seSsr-vvvvvvvvvv>', useSsr, this.tagName, this.getAttribute('seq'))\n // // ssr \uCC98\uB9AC\uB77C\uC11C \uC774\uBBF8 \uB0B4\uB824\uC900\uAC70\uADF8\uB300\uB85C \uC0C1\uC694\uD558\uBA74\uB41C\uB2E4 \uB530\uB77C\uC11C \uD638\uCD9C\uC548\uD55C\uB2E4\n // const targetConnectedList = findAllOnConnectedMetadata(constructor).filter(it => useSsr ? !it.options.ssrFirst : true);\n const targetConnectedList = useSsr ? [] : findAllOnConnectedMetadata(constructor);\n const shadowMode = conf?.useShadow || targetConnectedList.find(it => it.options.useShadow)?.options.useShadow;\n // console.log('--------->', this.tagName, shadowMode && !this.shadowRoot)\n if (shadowMode && !this.shadowRoot) {\n const mode = shadowMode === true ? 'open' : shadowMode;\n console.log('tagName=', this.tagName, 'mode', mode, this.shadowRoot);\n // if (this.tagName!=='INDEX-ROUTER') {\n this.attachShadow({ mode: mode as ShadowRootMode });\n // }\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 console.log('targetConnectList', this.tagName, targetConnectedList.length);\n if (targetConnectedList.length > 0) {\n // let sContent = '',\n // lContent = '';\n for (const meta of targetConnectedList) {\n // const res = (this as any)[meta.propertyKey]();\n let res = await (this as any)._invokeLifecycleMethod(meta.propertyKey, helperHostSet);\n // res = SwcUtils.projectProcessHtml(this, res);\n if (typeof res === 'string') {\n const htmlTemplateElement = doc.createElement('template');\n htmlTemplateElement.innerHTML = res; //SwcUtils.projectProcessHtml(this._swcId, res, doc);\n res = htmlTemplateElement.content;\n }\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 // Separate delegate and non-delegate listeners\n const delegateListeners: typeof addEventListenerList = [];\n const nonDelegateListeners: typeof addEventListenerList = [];\n\n addEventListenerList.forEach(meta => {\n // Function-based selectors cannot be used with delegate listeners\n const isStringSelector = typeof meta.selector === 'string';\n if (meta.options.delegate && isStringSelector && meta.selector !== '$window' && meta.selector !== '$document' && meta.selector !== '$host' && meta.selector !== '$appHost' && meta.selector !== '$firstHost' && meta.selector !== '$lastHost' && meta.selector !== '$firstAppHost' && meta.selector !== '$lastAppHost' && meta.selector !== '$hosts' && meta.selector !== '$appHosts' && meta.selector !== '$this' && meta.selector !== '') {\n delegateListeners.push(meta);\n } else {\n nonDelegateListeners.push(meta);\n }\n });\n\n const delegatesByTypeAndRoot = new Map<string, any[]>();\n delegateListeners.forEach(meta => {\n const r = meta.options.root || 'auto';\n const rootKey = `${meta.type}:${r}`;\n if (!delegatesByTypeAndRoot.has(rootKey)) {\n delegatesByTypeAndRoot.set(rootKey, []);\n }\n delegatesByTypeAndRoot.get(rootKey)!.push(meta);\n });\n\n delegatesByTypeAndRoot.forEach((metaList, typeRootKey) => {\n const [type, rStr] = typeRootKey.split(':');\n const r = rStr === 'auto' ? 'auto' : rStr;\n const opts = { capture: metaList[0].options.capture, once: metaList[0].options.once, passive: metaList[0].options.passive };\n\n const bindRoots: (HTMLElement | ShadowRoot)[] = [];\n if (r === 'auto') bindRoots.push(this.shadowRoot || (this as any));\n else if (r === 'light') bindRoots.push(this as any);\n else if (r === 'shadow' && this.shadowRoot) bindRoots.push(this.shadowRoot);\n else if (r === 'all') {\n bindRoots.push(this as any);\n if (this.shadowRoot) bindRoots.push(this.shadowRoot);\n }\n\n bindRoots.forEach(br => {\n const sortedMetaList = [...metaList].sort((a, b) => {\n const aStop = a.options.stopPropagation ? 1 : 0;\n const bStop = b.options.stopPropagation ? 1 : 0;\n return bStop - aStop;\n });\n\n const unifiedHandler = async (event: Event) => {\n for (const meta of sortedMetaList) {\n const { selector, options } = meta;\n const matchedEl = (event.target as HTMLElement)?.closest(selector);\n if (matchedEl && (br as any).contains(matchedEl)) {\n // Apply filter if specified\n if (options.filter) {\n const helper = SwcUtils.getHelperAndHostSet(currentWin, matchedEl);\n if (!options.filter(event, helper)) {\n continue; // Skip this listener if filter returns false\n }\n }\n if (options.stopPropagation) event.stopPropagation();\n if (options.stopImmediatePropagation) event.stopImmediatePropagation();\n if (options.preventDefault) event.preventDefault();\n const currentHostSet = SwcUtils.getHostSet(this as any);\n const args = { event, ...currentHostSet, $el: matchedEl, $root: br };\n await (this as any)[meta.propertyKey](event, { ...currentHostSet, $matchedElement: matchedEl }, args);\n if ((event as any).cancelBubble) break;\n }\n }\n };\n br.addEventListener(type, unifiedHandler, opts);\n // \uAC01 \uBA54\uD0C0\uC758 removeListener\uB97C \uBA54\uD0C0 \uC635\uC158\uACFC \uD568\uAED8 \uBCF4\uAD00 (delegate \uADF8\uB8F9\uC740 \uC5EC\uB7EC \uBA54\uD0C0 \uAC00\uB2A5)\n const onRemoves: Array<{ fn: (target: Element, optionValue: any) => void; opts: any }> = [];\n for (const m of sortedMetaList) {\n if (m.options.removeListener) {\n onRemoves.push({ fn: m.options.removeListener, opts: m.options });\n }\n }\n boundListeners.push({ target: br, type, handler: unifiedHandler, options: opts, onRemoves });\n });\n });\n\n nonDelegateListeners.forEach(meta => {\n const { selector, type, options } = meta;\n const opts = { capture: options.capture, once: options.once, passive: options.passive };\n const bindTargets: EventTarget[] = [];\n const r = options.root || 'auto';\n\n // Resolve selector if it's a function\n let resolvedSelector: string | null = null;\n if (typeof selector === 'function') {\n const hostSet = SwcUtils.getHelperAndHostSet(currentWin, this);\n const result = selector(this, hostSet);\n if (typeof result === 'string') {\n resolvedSelector = result;\n } else if (result instanceof currentWin.Element) {\n bindTargets.push(result as EventTarget);\n } else if (result instanceof currentWin.NodeList) {\n bindTargets.push(...Array.from(result as EventTarget[]));\n } else if (Array.isArray(result)) {\n bindTargets.push(...(result as EventTarget[]));\n }\n } else {\n resolvedSelector = selector;\n }\n\n const applyRootOption = (target: any) => {\n if (!target) return;\n if (r === 'auto') {\n bindTargets.push(target.shadowRoot || target);\n } else {\n if (r === 'light' || r === 'all') bindTargets.push(target);\n if ((r === 'shadow' || r === 'all') && target.shadowRoot) bindTargets.push(target.shadowRoot);\n }\n };\n\n if (resolvedSelector) {\n if (resolvedSelector === '$window') bindTargets.push(currentWin);\n else if (resolvedSelector === '$document') bindTargets.push(currentWin.document);\n else if (resolvedSelector === '$host') applyRootOption(helperHostSet.$host);\n else if (resolvedSelector === '$parentHost') applyRootOption(helperHostSet.$parentHost);\n else if (resolvedSelector === '$appHost') applyRootOption(helperHostSet.$appHost);\n else if (resolvedSelector === '$firstHost') applyRootOption(helperHostSet.$firstHost);\n else if (resolvedSelector === '$lastHost') applyRootOption(helperHostSet.$lastHost);\n else if (resolvedSelector === '$firstAppHost') applyRootOption(helperHostSet.$firstAppHost);\n else if (resolvedSelector === '$lastAppHost') applyRootOption(helperHostSet.$lastAppHost);\n else if (resolvedSelector === '$hosts') helperHostSet.$hosts.forEach(applyRootOption);\n else if (resolvedSelector === '$appHosts') helperHostSet.$appHosts.forEach(applyRootOption);\n else if (resolvedSelector === '$this' || !resolvedSelector) applyRootOption(this);\n else {\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(resolvedSelector).forEach(el => bindTargets.push(el));\n });\n }\n }\n\n bindTargets.forEach(t => {\n const handler = async (event: Event) => {\n // Apply filter if specified\n if (options.filter) {\n const helper = SwcUtils.getHelperAndHostSet(currentWin, t as HTMLElement);\n if (!options.filter(event, { currentThis: this, helper })) {\n return; // Skip if filter returns false\n }\n }\n if (options.stopPropagation) event.stopPropagation();\n if (options.stopImmediatePropagation) event.stopImmediatePropagation();\n if (options.preventDefault) event.preventDefault();\n const currentHostSet = SwcUtils.getHostSet(this as any);\n const args = { event, ...currentHostSet, $el: t, $root: t };\n await (this as any)[meta.propertyKey](event, { currentHostSet, $matchedElement: event.currentTarget }, args);\n };\n\n // Create event stream with Observable-based operators\n const eventSubject = new Subject<Event>();\n let eventStream = eventSubject as any;\n\n // Apply operators from @dooboostore/core/operators\n if (options.debounceTime !== undefined && options.debounceTime > 0) {\n eventStream = eventStream.pipe(debounceTime(options.debounceTime));\n }\n\n if (options.throttleTime !== undefined && options.throttleTime > 0) {\n eventStream = eventStream.pipe(throttleTime(options.throttleTime));\n }\n\n if (options.distinctUntilChanged !== undefined && options.distinctUntilChanged !== false) {\n if (typeof options.distinctUntilChanged === 'function') {\n eventStream = eventStream.pipe(distinctUntilChanged(options.distinctUntilChanged));\n } else {\n eventStream = eventStream.pipe(distinctUntilChanged());\n }\n }\n\n // Subscribe to the event stream\n const subscription = eventStream.subscribe({\n next: (event: Event) => {\n handler(event).catch((err: any) => console.error('Event handler error:', err));\n },\n error: (err: any) => console.error('Event stream error:', err)\n });\n\n // Create wrapper handler that emits to the subject\n const wrappedHandler = (event: Event) => {\n eventSubject.next(event);\n };\n\n t.addEventListener(type, wrappedHandler, opts);\n const onRemoves: Array<{ fn: (target: Element, optionValue: any) => void; opts: any }> = options.removeListener ? [{ fn: options.removeListener, opts }] : [];\n boundListeners.push({ target: t, type, handler: wrappedHandler, options: opts, subscription, onRemoves });\n });\n });\n\n // \u2500\u2500\u2500 MutationObserver / ResizeObserver \uCC98\uB9AC \u2500\u2500\u2500\n // shadow/light \uB8E8\uD2B8\uBCC4\uB85C \uAC01\uAC01 observer\uB97C \uB450\uACE0, \uD574\uB2F9 \uB8E8\uD2B8\uC5D0 \uB370\uCF54\uB808\uC774\uD130 \uBA54\uD0C0\uAC00 \uC788\uC73C\uBA74 observer\uB97C \uC0DD\uC131\uD55C\uB2E4.\n // \uB450 \uB8E8\uD2B8 \uBAA8\uB450 \uC788\uC73C\uBA74 observer 2\uAC1C, \uD55C\uCABD\uB9CC \uC788\uC73C\uBA74 1\uAC1C, \uC5C6\uC73C\uBA74 0\uAC1C.\n shadowMutationObserver = null;\n lightMutationObserver = null;\n resizeObserver = null;\n\n // ResizeObserver: @resizeObserver \uB370\uCF54\uB808\uC774\uD130\uAC00 \uD558\uB098\uB77C\uB3C4 \uC788\uC73C\uBA74 observer \uD558\uB098 \uC0DD\uC131 (shadow \uC788\uC73C\uBA74 shadow \uB8E8\uD2B8, \uC5C6\uC73C\uBA74 light)\n if (resizeObserverList.length > 0) {\n const root: HTMLElement | ShadowRoot = this.shadowRoot || (this as any);\n resizeObserver = new ResizeObserver((entries: ResizeObserverEntry[], obs: ResizeObserver) => {\n for (const m of resizeObserverList) {\n let matchedEls: HTMLElement[] = [];\n if (m.options.delegate && typeof m.selector === 'string') {\n const isThis = m.selector === '$this' || m.selector === '';\n const matchesSel = (node: any): boolean => {\n if (!node || node.nodeType !== 1) return false;\n if (isThis) return true;\n const el = node as HTMLElement;\n return el.matches?.(m.selector as string) || !!el.closest?.(m.selector as string);\n };\n matchedEls = entries.map(e => e.target as HTMLElement).filter(matchesSel);\n } else {\n matchedEls = entries.map(e => e.target as HTMLElement).filter(t => t && t.nodeType === 1);\n }\n if (matchedEls.length === 0) continue;\n if (m.options.filter) {\n const helper = SwcUtils.getHelperAndHostSet(currentWin, this);\n if (!m.options.filter(matchedEls, { currentThis: this, helper })) continue;\n }\n const hostSet = SwcUtils.getHostSet(this as any);\n (this as any)[m.propertyKey](matchedEls, entries, obs, { ...hostSet, $root: root });\n }\n });\n resizeObservers.push(resizeObserver);\n // resizeObserver \uBA54\uD0C0\uBCC4 removeObserver \uC218\uC9D1\n for (const m of resizeObserverList) {\n if (m.options.removeObserver) {\n removeObserverCallbacks.push({ fn: m.options.removeObserver, target: root, opts: m.options });\n }\n }\n }\n // MutationObserver: shadow/light \uB8E8\uD2B8\uBCC4 \uADF8\uB8F9\uD551\n const shadowMetas = mutationObserverList.filter(m => {\n const r = m.options.root || 'auto';\n return this.shadowRoot && (r === 'shadow' || r === 'all' || r === 'auto');\n });\n const lightMetas = mutationObserverList.filter(m => {\n const r = m.options.root || 'auto';\n return r === 'light' || r === 'all' || (!this.shadowRoot && r === 'auto');\n });\n\n const setupMutationObserver = (root: HTMLElement | ShadowRoot, metas: MutationObserverMetadata[], resizeDelegates: ResizeObserverMetadata[] = []): MutationObserver | null => {\n // mutation \uBA54\uD0C0\uAC00 \uC5C6\uC73C\uBA74 observer \uC0DD\uC131 \uC548 \uD568 (resize delegate\uB294 \uBCF4\uC870)\n if (metas.length === 0) return null;\n\n // \uC0AC\uC6A9\uC790\uAC00 \uC785\uB825\uD55C \uC635\uC158 \uADF8\uB300\uB85C (\uC544\uBB34\uAC83\uB3C4 \uC548 \uC8FC\uBA74 childList \uAE30\uBCF8)\n const initFrom = (o: MutationObserverBaseOptions): MutationObserverInit => {\n const init: MutationObserverInit = {\n childList: o.childList,\n attributes: o.attributes,\n characterData: o.characterData,\n subtree: o.subtree,\n attributeFilter: o.attributeFilter,\n attributeOldValue: o.attributeOldValue,\n characterDataOldValue: o.characterDataOldValue\n };\n // MutationObserver\uB294 \uCD5C\uC18C 1\uAC1C\uB294 true\uC5EC\uC57C \uD568\n if (!init.childList && !init.attributes && !init.characterData) init.childList = true;\n return init;\n };\n\n const observer = new MutationObserver((mutations: MutationRecord[], obs: MutationObserver) => {\n for (const meta of metas) {\n const { selector, options } = meta;\n let matchedEls: HTMLElement[] = [];\n\n if (options.delegate && typeof selector === 'string') {\n const isThis = selector === '$this' || selector === '';\n const matchesSel = (node: any): boolean => {\n if (!node || node.nodeType !== 1) return false;\n if (isThis) return true;\n const el = node as HTMLElement;\n return el.matches?.(selector as string) || !!el.closest?.(selector as string);\n };\n matchedEls = mutations.flatMap(m => {\n const els: HTMLElement[] = [];\n if (matchesSel(m.target)) els.push(m.target as HTMLElement);\n Array.from(m.addedNodes || [])\n .filter(matchesSel)\n .forEach(n => els.push(n as HTMLElement));\n Array.from(m.removedNodes || [])\n .filter(matchesSel)\n .forEach(n => els.push(n as HTMLElement));\n return els;\n });\n } else if (typeof selector === 'string') {\n // non-delegate: observe \uB300\uC0C1\uC774 \uB9E4\uCE6D \uC694\uC18C\uB4E4\uC774\uBBC0\uB85C \uADF8\uB4E4\uC758 mutation \uB300\uC0C1 + \uCD94\uAC00/\uC81C\uAC70 \uB178\uB4DC\n const isThis = selector === '$this' || selector === '';\n const matchesSel = (node: any): boolean => {\n if (!node || node.nodeType !== 1) return false;\n if (isThis) return true;\n return (node as HTMLElement).matches?.(selector as string);\n };\n matchedEls = mutations.flatMap(m => {\n const els: HTMLElement[] = [];\n if (matchesSel(m.target)) els.push(m.target as HTMLElement);\n Array.from(m.addedNodes || [])\n .filter(matchesSel)\n .forEach(n => els.push(n as HTMLElement));\n Array.from(m.removedNodes || [])\n .filter(matchesSel)\n .forEach(n => els.push(n as HTMLElement));\n return els;\n });\n } else {\n matchedEls = mutations.map(m => m.target as HTMLElement).filter(t => t && t.nodeType === 1);\n }\n\n if (matchedEls.length === 0) continue;\n if (options.filter) {\n const helper = SwcUtils.getHelperAndHostSet(currentWin, this);\n if (!options.filter(matchedEls, { currentThis: this, helper })) continue;\n }\n const hostSet = SwcUtils.getHostSet(this as any);\n // 1\uBC88\uC9F8: \uB9E4\uCE58\uB41C element \uBC30\uC5F4, 2\uBC88\uC9F8: \uC6D0\uBCF8 mutations, 3\uBC88\uC9F8: observer\n (this as any)[meta.propertyKey](matchedEls, mutations, obs, { ...hostSet, $root: root });\n }\n\n // \u2500\u2500\u2500 resizeObserver delegate \uB3D9\uC801 \uCD94\uC801 \u2500\u2500\u2500\n // \uCD94\uAC00/\uC0AD\uC81C\uB41C \uC694\uC18C\uAC00 delegate \uC140\uB809\uD130\uC640 \uB9E4\uCE6D\uB418\uBA74 resizeObserver\uC5D0 observe/unobserve\n if (resizeDelegates.length > 0 && resizeObserver) {\n const handle = (n: Node, observe: boolean) => {\n if (n.nodeType !== 1) return;\n const el = n as HTMLElement;\n for (const m of resizeDelegates) {\n if (typeof m.selector !== 'string') continue;\n const isThis = m.selector === '$this' || m.selector === '';\n const matchesSel = (node: any): boolean => {\n if (!node || node.nodeType !== 1) return false;\n if (isThis) return true;\n const e = node as HTMLElement;\n return e.matches?.(m.selector as string) || !!e.closest?.(m.selector as string);\n };\n if (matchesSel(el)) {\n if (observe) resizeObserver.observe(el, m.options.box ? { box: m.options.box } : undefined);\n else resizeObserver.unobserve(el);\n } else if (!isThis) {\n el.querySelectorAll(m.selector).forEach(sub => {\n if (observe) resizeObserver.observe(sub as HTMLElement, m.options.box ? { box: m.options.box } : undefined);\n else resizeObserver.unobserve(sub as HTMLElement);\n });\n }\n }\n };\n for (const m of mutations) {\n Array.from(m.addedNodes || []).forEach(n => handle(n, true));\n Array.from(m.removedNodes || []).forEach(n => handle(n, false));\n }\n }\n });\n\n // delegate \uBA54\uD0C0(mutation \uB610\uB294 resize)\uAC00 \uD558\uB098\uB77C\uB3C4 \uC788\uC73C\uBA74 \u2192 \uB8E8\uD2B8\uC5D0 subtree observe 1\uAC1C\uB85C \uC804\uBD80 \uAC10\uC9C0 (\uCF5C\uBC31\uC5D0\uC11C \uBA54\uD0C0\uBCC4 \uB9E4\uCE6D \uCC98\uB9AC)\n const hasDelegate = metas.some(m => m.options.delegate) || resizeDelegates.some(m => m.options.delegate);\n if (hasDelegate) {\n observer.observe(root, { childList: true, subtree: true });\n }\n\n // non-delegate \uBA54\uD0C0: \uC140\uB809\uD130 \uB9E4\uCE6D \uC694\uC18C\uB4E4\uC744 \uC0AC\uC6A9\uC790 \uC635\uC158 \uADF8\uB300\uB85C observe\n const nonDelegateMetas = metas.filter(m => !m.options.delegate);\n for (const m of nonDelegateMetas) {\n const { selector, options } = m;\n const mInit = initFrom(options);\n if (typeof selector === 'string') {\n if (selector === '$this' || selector === '') {\n observer.observe(root, mInit);\n } else {\n root.querySelectorAll(selector).forEach(el => observer.observe(el as HTMLElement, mInit));\n }\n } else if (typeof selector === 'function') {\n // \uD568\uC218 \uC140\uB809\uD130\uB294 \uB8E8\uD2B8 \uAD00\uCC30\uB85C \uB300\uCCB4 (\uB9E4\uCE6D \uD3C9\uAC00 \uBD88\uAC00)\n observer.observe(root, mInit);\n }\n }\n\n return observer;\n };\n\n // resizeObserver delegate \uBA54\uD0C0\uB3C4 \uB8E8\uD2B8\uBCC4\uB85C \uD544\uD130\uD574\uC11C \uB118\uAE40\n const shadowResizeDelegateMetas = resizeObserverList.filter(m => {\n if (!m.options.delegate) return false;\n const r = m.options.root || 'auto';\n return this.shadowRoot && (r === 'shadow' || r === 'all' || r === 'auto');\n });\n const lightResizeDelegateMetas = resizeObserverList.filter(m => {\n if (!m.options.delegate) return false;\n const r = m.options.root || 'auto';\n return r === 'light' || r === 'all' || (!this.shadowRoot && r === 'auto');\n });\n\n if (this.shadowRoot) shadowMutationObserver = setupMutationObserver(this.shadowRoot, shadowMetas, shadowResizeDelegateMetas);\n lightMutationObserver = setupMutationObserver(this as any, lightMetas, lightResizeDelegateMetas);\n\n // mutationObserver \uBA54\uD0C0\uBCC4 removeObserver \uC218\uC9D1\n for (const m of mutationObserverList) {\n if (m.options.removeObserver) {\n const rootForM = this.shadowRoot && (m.options.root === 'shadow' || m.options.root === 'all' || (m.options.root === 'auto' && this.shadowRoot)) ? this.shadowRoot : (this as any);\n removeObserverCallbacks.push({ fn: m.options.removeObserver, target: rootForM, opts: m.options });\n }\n }\n\n if (originalConnected) await originalConnected.apply(this);\n\n const aMethods = findAllOnConnectedAfterMetadata(this); //.filter(it => { return useSsr ? !it.options.ssrFirst : true; });\n // console.log('afterConnected', this.tagName, aMethods, getOnConnectedAfterMetadata(this))\n for (const m of aMethods) 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\n // Trigger @changedAttributeThis with while: 'connected'\n for (let [name, metaList] of Array.from(attrChangeMap)) {\n for (const meta of metaList) {\n if (meta.options.while === 'connected') {\n const val = getAttributeValue(this, name, { type: meta.options.type });\n if (val !== null) {\n await (this as any)[meta.propertyKey](val, null, name, helperHostSet);\n }\n }\n }\n }\n } finally {\n for (let m of findAllLifecycleMetadata(this, ON_CONNECTED_COMPLETED_METADATA_KEY)) {\n await (this as any)._invokeLifecycleMethod(m.propertyKey, helperHostSet);\n }\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 helperHostSet = SwcUtils.getHelperAndHostSet(win, this as any);\n // Remove from appHost LAST when disconnected\n // console.log('disconnnnnnnnnnnnnnnnnnn', helperHostSet, 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 const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_DISCONNECTED_METADATA_KEY);\n for (const m of bMethods) (this as any)._invokeLifecycleMethod(m.propertyKey, helperHostSet);\n // event listener \uC815\uB9AC\n if (boundListeners.length > 0) {\n boundListeners.forEach((l: BoundListener) => {\n l.target.removeEventListener(l.type, l.handler, l.options);\n // Cleanup Observable subscription if present\n if (l.subscription && typeof l.subscription.unsubscribe === 'function') {\n l.subscription.unsubscribe();\n }\n // \uC0AC\uC6A9\uC790 \uC815\uC758 \uC815\uB9AC \uCF5C\uBC31 \uD638\uCD9C\n if (Array.isArray(l.onRemoves)) {\n for (const r of l.onRemoves) {\n try {\n r.fn(l.target, r.opts);\n } catch (e) {\n console.error('[SWC] removeListener error:', e);\n }\n }\n }\n });\n boundListeners = [];\n }\n\n // MutationObserver / ResizeObserver \uC815\uB9AC\n const _obs: Array<MutationObserver | ResizeObserver | null> = [shadowMutationObserver, lightMutationObserver, resizeObserver, ...resizeObservers];\n for (const o of _obs) {\n try {\n (o as any)?.disconnect?.();\n } catch (e) {\n console.error('[SWC] observer disconnect error:', e);\n }\n }\n shadowMutationObserver = null;\n lightMutationObserver = null;\n resizeObserver = null;\n resizeObservers = [];\n\n // \uBA54\uD0C0\uBCC4 removeObserver \uCF5C\uBC31 \uD638\uCD9C\n for (const cb of removeObserverCallbacks) {\n try {\n cb.fn(cb.target, cb.opts);\n } catch (e) {\n console.error('[SWC] removeObserver error:', e);\n }\n }\n removeObserverCallbacks = [];\n\n // elementApply event listener \uC815\uB9AC\n new ElementApply(this, { id: this._swcId }).removeAllEventListener();\n\n // globalDelegatedRoots remove\n // const roots = [this, this.getRootNode()];\n // if (this.shadowRoot) {\n // roots.push(this.shadowRoot);\n // }\n // roots.forEach(root => {\n // DOM_EVENT_NAMES.forEach(type => {\n // root.removeEventListener(type, handleGlobalSwcEvent);\n // });\n // }\n // )\n\n if (originalDisconnected) originalDisconnected.apply(this);\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_DISCONNECTED_METADATA_KEY);\n for (const m of aMethods) (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 const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_ADOPTED_METADATA_KEY);\n for (const m of bMethods) (this as any)._invokeLifecycleMethod(m.propertyKey, hostSet);\n\n if (originalAdopted) originalAdopted.apply(this);\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_ADOPTED_METADATA_KEY);\n for (const m of aMethods) (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 const hSet = SwcUtils.getHostSet(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 helperAndHostSet = 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: helperAndHostSet\n });\n // Pass the result object directly without serialization\n processedVal = result;\n } catch (e) {\n console.error(`[SWC] Failed to execute directive {{= ${expr.script} }} on attribute ${name}: ${helperAndHostSet}`, 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 const hostCustomEventMeta = emitHostCustomEventList.find(it => (it.options as any).attributeName === name);\n if (hostCustomEventMeta && newVal !== null) {\n (this as any)._bindAttributeEvent(this as any, name, newVal, hostCustomEventMeta.type);\n }\n\n const metaList = attrChangeMap.get(name);\n if (metaList && Array.isArray(metaList)) {\n for (const meta of metaList) {\n if (meta.options.while === 'connected' && !(this as any).__swc_connected) {\n continue;\n }\n const convertedVal = convertAttributeValue(processedVal, meta.options.type);\n (this as any)[meta.propertyKey](convertedVal, old, name, hSet);\n }\n }\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,SAAQ,kBAAkB,eAAe,cAAc,eAAc;AACrE,SAAQ,cAAc,sBAAsB,oBAAmB;AAC/D,SAAQ,mCAAkC;AAC1C,SAAQ,mCAAkC;AAE1C,SAAQ,iCAAgC;AAExC,SAAQ,0BAA0B,iCAAiC,kCAAkC,4BAA4B,+BAA+B,oCAAoC,gCAAgC,qCAAqC,qCAAqC,kCAAiC;AAC/U,SAAQ,sCAAqC;AAC7C,SAAQ,uBAAuB,uCAAsC;AACrE,SAAQ,+BAA+B,0BAA0B,yBAAwB;AACzF,SAAQ,wBAAuB;AAC/B,SAAQ,2BAA0B;AAClC,SAAQ,gBAAe;AACvB,SAAQ,iBAAiB,wBAAuB;AAChD,SAAQ,wBAAwB,+BAA8B;AAC9D,SAAgC,2BAA0B;AAC1D,SAAQ,cAAc,oBAAmB;AACzC,SAAQ,aAAY;AACpB,SAAQ,4BAA2B;AACnC,SAAQ,+BAA8B;AAI/B,MAAM,qBAAqB,OAAO,IAAI,qCAAqC;AAyB3E,MA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AAS,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;AAEA,UAAM,sBAAsB,wBAAwB,KAAK,QAAO,GAAG,QAAgB,kBAAkBA,KAAI;AACzG,QAAI,uBAAuB,WAAW,MAAM;AAC1C,MAAC,KAAa,oBAAoB,MAAaA,OAAM,QAAQ,oBAAoB,IAAI;AAAA,IACvF;AAEA,UAAM,WAAW,cAAc,IAAIA,KAAI;AACvC,QAAI,YAAY,MAAM,QAAQ,QAAQ,GAAG;AACvC,iBAAW,QAAQ,UAAU;AAC3B,YAAI,KAAK,QAAQ,UAAU,eAAe,CAAE,KAAa,iBAAiB;AACxE;AAAA,QACF;AACA,cAAM,eAAe,sBAAsB,cAAc,KAAK,QAAQ,IAAI;AAC1E,QAAC,KAAa,KAAK,WAAW,EAAE,cAAc,KAAKA,OAAM,IAAI;AAAA,MAC/D;AAAA,IACF;AAAA,EACF;AAEA,SAAO,eAAe,aAAa,sBAAsB;AAAA,IACvD,KAAK,MAAM;AAAA,IACX,cAAc;AAAA,EAChB,CAAC;AAED,eAAa,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 {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\";\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 // 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 return app.simstanceManager.executeBindParameterSim(\n {\n target: this,\n targetKey: methodName,\n inputParameters: extraArgs\n },\n otherStorage\n );\n } else {\n return (this as any)[methodName](...extraArgs);\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 ];\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 as any).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 as any).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 as any).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,SAAQ,kBAAkB,eAAe,oBAAmB;AAC5D,SAAQ,+BAA8B;AACtC,SAAQ,kCAAiC;AACzC,SAAQ,gCAA+B;AACvC,SAAQ,sCAAqC;AAC7C,SAAQ,0BAA0B,iCAAiC,kCAAkC,4BAA4B,+BAA+B,oCAAoC,gCAAgC,qCAAqC,qCAAqC,kCAAiC;AAC/U,SAAQ,iCAAgC;AACxC,SAAQ,kCAAiC;AACzC,SAAQ,+BAA+B,gCAA+B;AACtE,SAAQ,kBAAkB,2BAA0B;AACpD,SAAQ,gBAAe;AACvB,SAAQ,iBAAiB,wBAAuB;AAChD,SAAQ,wBAAwB,+BAA8B;AAC9D,SAAyD,2BAAmJ;AAC5M,SAAQ,cAAc,oBAAmB;AACzC,SAAQ,aAAY;AACpB,SAAQ,4BAA2B;AACnC,SAAQ,+BAA8B;AACtC,SAAQ,kCAAiC;AACzC,SAAQ,gCAA+B;AACvC,SAAQ,6BAA4B;AACpC,SAAQ,4BAA2B;AAI5B,MAAM,qBAAqB,OAAO,IAAI,qCAAqC;AAe3E,MAAM,mBAAmB,CAAC,WAA6C;AAC5E,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,oBAAoB,WAAW;AACjE;AAEO,MAAM,aAAa,CAAC,SAAc;AACvC,MAAI,CAAC,KAAK,mBA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AAY,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", "helperHostSet", "name", "win"]
|
|
7
7
|
}
|
|
@@ -127,10 +127,65 @@ const getEmitCustomEventMetadataList = (target) => {
|
|
|
127
127
|
return ReflectUtils.getMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor);
|
|
128
128
|
};
|
|
129
129
|
const emit = emitCustomEvent;
|
|
130
|
+
function emitThis(type, options) {
|
|
131
|
+
return emitCustomEvent("$this", type, options);
|
|
132
|
+
}
|
|
133
|
+
function emitAppHost(type, options) {
|
|
134
|
+
return emitCustomEvent("$appHost", type, options);
|
|
135
|
+
}
|
|
136
|
+
function emitWindow(type, options) {
|
|
137
|
+
return emitCustomEvent("$window", type, options);
|
|
138
|
+
}
|
|
139
|
+
function emitDocument(type, options) {
|
|
140
|
+
return emitCustomEvent("$document", type, options);
|
|
141
|
+
}
|
|
142
|
+
function emitLight(selector, type, options) {
|
|
143
|
+
return emitCustomEvent(selector, type, { ...options ?? {}, root: "light" });
|
|
144
|
+
}
|
|
145
|
+
function emitShadow(selector, type, options) {
|
|
146
|
+
return emitCustomEvent(selector, type, { ...options ?? {}, root: "shadow" });
|
|
147
|
+
}
|
|
148
|
+
function emitAll(selector, type, options) {
|
|
149
|
+
return emitCustomEvent(selector, type, { ...options ?? {}, root: "all" });
|
|
150
|
+
}
|
|
151
|
+
class EmitCustomEventLifeCycler {
|
|
152
|
+
constructor() {
|
|
153
|
+
this.hostEmitMeta = null;
|
|
154
|
+
}
|
|
155
|
+
getHostEmitMeta(inst) {
|
|
156
|
+
if (!this.hostEmitMeta) {
|
|
157
|
+
const all = getEmitCustomEventMetadataList(inst) ?? [];
|
|
158
|
+
this.hostEmitMeta = all.filter((m) => m.selector === "$this" || m.selector === "");
|
|
159
|
+
}
|
|
160
|
+
return this.hostEmitMeta;
|
|
161
|
+
}
|
|
162
|
+
/** observedAttributes 에 포함할 attributeName 목록 */
|
|
163
|
+
getObservedAttributeNames(inst) {
|
|
164
|
+
return this.getHostEmitMeta(inst).map((m) => m.options.attributeName).filter(Boolean);
|
|
165
|
+
}
|
|
166
|
+
onConnected(_helperHostSet) {
|
|
167
|
+
}
|
|
168
|
+
/** attributeChangedCallback 에서 elementDefine 이 직접 호출 */
|
|
169
|
+
onAttributeChanged(helperHostSet, name, _old, newVal) {
|
|
170
|
+
const inst = helperHostSet.$this;
|
|
171
|
+
const matched = this.getHostEmitMeta(inst).find((m) => m.options.attributeName === name);
|
|
172
|
+
if (matched && newVal !== null) {
|
|
173
|
+
inst._bindAttributeEvent?.(inst, name, newVal, matched.type);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
130
177
|
export {
|
|
131
178
|
EMIT_CUSTOM_EVENT_METADATA_KEY,
|
|
179
|
+
EmitCustomEventLifeCycler,
|
|
132
180
|
emit,
|
|
181
|
+
emitAll,
|
|
182
|
+
emitAppHost,
|
|
133
183
|
emitCustomEvent,
|
|
184
|
+
emitDocument,
|
|
185
|
+
emitLight,
|
|
186
|
+
emitShadow,
|
|
187
|
+
emitThis,
|
|
188
|
+
emitWindow,
|
|
134
189
|
getEmitCustomEventMetadataList
|
|
135
190
|
};
|
|
136
191
|
//# sourceMappingURL=emitCustomEvent.js.map
|
|
@@ -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, HelperHostSet } from '../types';\nimport {ensureInit, getElementConfig} from './elementDefine';\nimport {SwcUtils} from '../utils/Utils';\n\nexport type EmitCustomEventSelector = string | ((currentThis: any, helper: HelperHostSet) => NodeList | Element | Element[] | null);\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\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(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function emitCustomEvent(selector: EmitCustomEventSelector, type: string, options?: Options): MethodDecorator;\nexport function emitCustomEvent(type: string, options?: Options): MethodDecorator;\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 | 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"],
|
|
5
|
-
"mappings": "AAAA,SAAQ,oBAAmB;AAE3B,SAAQ,YAAY,wBAAuB;AAC3C,SAAQ,gBAAe;
|
|
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,SAAQ,oBAAmB;AAE3B,SAAQ,YAAY,wBAAuB;AAC3C,SAAQ,gBAAe;AA4ChB,MAAM,iCAAiC,OAAO,IAAI,wCAAwC;AAgB3F,SAAU,gBAAgB,kBAAuB,mBAAyB,qBAAyB;AAEvG,MAAI,OAAO,qBAAqB,YAAY,OAAO,sBAAsB,YAAY,OAAO,wBAAwB,YAAY,WAAW,qBAAqB;AAC9J,UAAM,IAAI,MAAM,uEAAuE,OAAO,iBAAiB,CAAC,GAAG;EACrH;AAGA,OAAK,OAAO,qBAAqB,YAAY,OAAO,qBAAqB,eAAe,OAAO,sBAAsB,UAAU;AAC7H,WAAO,oBAAoB,kBAAkB,mBAAmB,mBAA8B;EAChG;AAGA,MAAI,OAAO,qBAAqB,YAAY,sBAAsB,UAAU;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B,MAAc,SAAmD;AACzG,SAAO,gBAAgB,UAAU,MAAM,EAAC,GAAG,WAAW,CAAA,GAAI,MAAM,MAAK,CAAQ;AAC/E;AAOM,MAAO,0BAAyB;EAAtC,cAAA;AACU,SAAA,eAAiD;EA2B3D;EAzBU,gBAAgB,MAAS;AAC/B,QAAI,CAAC,KAAK,cAAc;AACtB,YAAM,MAAM,+BAA+B,IAAI,KAAK,CAAA;AACpD,WAAK,eAAe,IAAI,OAAO,OAAK,EAAE,aAAa,WAAW,EAAE,aAAa,EAAE;IACjF;AACA,WAAO,KAAK;EACd;;EAGA,0BAA0B,MAAS;AACjC,WAAO,KAAK,gBAAgB,IAAI,EAAE,IAAI,OAAM,EAAE,QAAgB,aAAa,EAAE,OAAO,OAAO;EAC7F;EAEA,YAAY,gBAA6B;EAEzC;;EAGA,mBAAmB,eAA8B,MAAc,MAAqB,QAAqB;AACvG,UAAM,OAAO,cAAc;AAC3B,UAAM,UAAU,KAAK,gBAAgB,IAAI,EAAE,KAAK,OAAM,EAAE,QAAgB,kBAAkB,IAAI;AAC9F,QAAI,WAAW,WAAW,MAAM;AAC9B,WAAK,sBAAsB,MAAM,MAAM,QAAQ,QAAQ,IAAI;IAC7D;EACF;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./addEventListener.js";
|
|
2
2
|
export * from "./mutationObserver.js";
|
|
3
3
|
export * from "./resizeObserver.js";
|
|
4
|
+
export * from "./intersectionObserver.js";
|
|
4
5
|
export * from "./applyAttribute.js";
|
|
5
6
|
export * from "./elementDefine.js";
|
|
6
7
|
export * from "./changedAttribute.js";
|
|
@@ -8,7 +9,6 @@ export * from "./emitCustomEvent.js";
|
|
|
8
9
|
export * from "./applyNode.js";
|
|
9
10
|
export * from "./lifecycles.js";
|
|
10
11
|
export * from "./query.js";
|
|
11
|
-
export * from "./queryAll.js";
|
|
12
12
|
export * from "./applyClass.js";
|
|
13
13
|
export * from "./applyStyle.js";
|
|
14
14
|
export * from "./applyAttribute.js";
|
|
@@ -18,4 +18,6 @@ export * from "./subscribeSwcAppMessageWhileConnected.js";
|
|
|
18
18
|
export * from "./publishSwcAppMessage.js";
|
|
19
19
|
export * from "./applySlot.js";
|
|
20
20
|
export * from "./state.js";
|
|
21
|
+
export * from "./setInterval.js";
|
|
22
|
+
export * from "./setTimeout.js";
|
|
21
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './addEventListener';\nexport * from './mutationObserver';\nexport * from './resizeObserver';\nexport * from './
|
|
5
|
-
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
4
|
+
"sourcesContent": ["export * from './addEventListener';\nexport * from './mutationObserver';\nexport * from './resizeObserver';\nexport * from './intersectionObserver';\nexport * from './applyAttribute';\nexport * from './elementDefine';\nexport * from './changedAttribute';\nexport * from './emitCustomEvent';\nexport * from './applyNode';\nexport * from './lifecycles';\nexport * from './query';\nexport * from './applyClass';\nexport * from './applyStyle';\nexport * from './applyAttribute';\nexport * from './applyProperty';\nexport * from './subscribeSwcAppRouteChangeWhileConnected';\nexport * from './subscribeSwcAppMessageWhileConnected';\nexport * from './publishSwcAppMessage';\nexport * from './applySlot';\nexport * from './state';\nexport * from './setInterval';\nexport * from './setTimeout';\n"],
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|