@dooboostore/simple-web-component 1.0.43 → 1.0.44

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.
Files changed (144) hide show
  1. package/README.md +298 -49
  2. package/dist/cjs/SwcAppEngine.js +3 -1
  3. package/dist/cjs/SwcAppEngine.js.map +2 -2
  4. package/dist/cjs/decorators/addEventListener.js.map +2 -2
  5. package/dist/cjs/decorators/applyAttribute.js +30 -28
  6. package/dist/cjs/decorators/applyAttribute.js.map +2 -2
  7. package/dist/cjs/decorators/applyClass.js +57 -21
  8. package/dist/cjs/decorators/applyClass.js.map +3 -3
  9. package/dist/cjs/decorators/applyNode.js +165 -105
  10. package/dist/cjs/decorators/applyNode.js.map +2 -2
  11. package/dist/cjs/decorators/applyProperty.js +11 -28
  12. package/dist/cjs/decorators/applyProperty.js.map +2 -2
  13. package/dist/cjs/decorators/applyStyle.js +39 -15
  14. package/dist/cjs/decorators/applyStyle.js.map +3 -3
  15. package/dist/cjs/decorators/{changedAttributeThis.js → changedAttribute.js} +6 -6
  16. package/dist/cjs/decorators/changedAttribute.js.map +7 -0
  17. package/dist/cjs/decorators/elementDefine.js +37 -6
  18. package/dist/cjs/decorators/elementDefine.js.map +3 -3
  19. package/dist/cjs/decorators/emitCustomEvent.js +56 -42
  20. package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
  21. package/dist/cjs/decorators/index.js +1 -1
  22. package/dist/cjs/decorators/index.js.map +2 -2
  23. package/dist/cjs/decorators/publishSwcAppMessage.js +5 -5
  24. package/dist/cjs/decorators/publishSwcAppMessage.js.map +3 -3
  25. package/dist/cjs/decorators/query.js +96 -145
  26. package/dist/cjs/decorators/query.js.map +3 -3
  27. package/dist/cjs/decorators/queryAll.js +104 -131
  28. package/dist/cjs/decorators/queryAll.js.map +3 -3
  29. package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
  30. package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
  31. package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
  32. package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
  33. package/dist/cjs/elements/SwcAppMixin.js +17 -2
  34. package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
  35. package/dist/cjs/examples/RxJSOperatorsExample.js +285 -0
  36. package/dist/cjs/examples/RxJSOperatorsExample.js.map +7 -0
  37. package/dist/cjs/index.js +1 -0
  38. package/dist/cjs/index.js.map +2 -2
  39. package/dist/cjs/router/ElementRouter.js +4 -0
  40. package/dist/cjs/router/ElementRouter.js.map +2 -2
  41. package/dist/esm/SwcAppEngine.js +3 -1
  42. package/dist/esm/SwcAppEngine.js.map +2 -2
  43. package/dist/esm/decorators/addEventListener.js.map +2 -2
  44. package/dist/esm/decorators/applyAttribute.js +30 -28
  45. package/dist/esm/decorators/applyAttribute.js.map +2 -2
  46. package/dist/esm/decorators/applyClass.js +57 -21
  47. package/dist/esm/decorators/applyClass.js.map +3 -3
  48. package/dist/esm/decorators/applyNode.js +165 -105
  49. package/dist/esm/decorators/applyNode.js.map +2 -2
  50. package/dist/esm/decorators/applyProperty.js +11 -28
  51. package/dist/esm/decorators/applyProperty.js.map +2 -2
  52. package/dist/esm/decorators/applyStyle.js +39 -15
  53. package/dist/esm/decorators/applyStyle.js.map +3 -3
  54. package/dist/esm/decorators/{changedAttributeThis.js → changedAttribute.js} +3 -3
  55. package/dist/esm/decorators/changedAttribute.js.map +7 -0
  56. package/dist/esm/decorators/elementDefine.js +35 -4
  57. package/dist/esm/decorators/elementDefine.js.map +2 -2
  58. package/dist/esm/decorators/emitCustomEvent.js +56 -42
  59. package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
  60. package/dist/esm/decorators/index.js +1 -1
  61. package/dist/esm/decorators/index.js.map +1 -1
  62. package/dist/esm/decorators/publishSwcAppMessage.js +5 -5
  63. package/dist/esm/decorators/publishSwcAppMessage.js.map +3 -3
  64. package/dist/esm/decorators/query.js +96 -145
  65. package/dist/esm/decorators/query.js.map +3 -3
  66. package/dist/esm/decorators/queryAll.js +104 -131
  67. package/dist/esm/decorators/queryAll.js.map +3 -3
  68. package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
  69. package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
  70. package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
  71. package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
  72. package/dist/esm/elements/SwcAppMixin.js +18 -3
  73. package/dist/esm/elements/SwcAppMixin.js.map +2 -2
  74. package/dist/esm/examples/RxJSOperatorsExample.js +266 -0
  75. package/dist/esm/examples/RxJSOperatorsExample.js.map +7 -0
  76. package/dist/esm/index.js +1 -0
  77. package/dist/esm/index.js.map +2 -2
  78. package/dist/esm/router/ElementRouter.js +4 -0
  79. package/dist/esm/router/ElementRouter.js.map +2 -2
  80. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +759 -512
  81. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
  82. package/dist/types/SwcAppEngine.d.ts.map +1 -1
  83. package/dist/types/decorators/addEventListener.d.ts +17 -14
  84. package/dist/types/decorators/addEventListener.d.ts.map +1 -1
  85. package/dist/types/decorators/applyAttribute.d.ts +35 -20
  86. package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
  87. package/dist/types/decorators/applyClass.d.ts +16 -36
  88. package/dist/types/decorators/applyClass.d.ts.map +1 -1
  89. package/dist/types/decorators/applyNode.d.ts +172 -30
  90. package/dist/types/decorators/applyNode.d.ts.map +1 -1
  91. package/dist/types/decorators/applyProperty.d.ts +27 -18
  92. package/dist/types/decorators/applyProperty.d.ts.map +1 -1
  93. package/dist/types/decorators/applyStyle.d.ts +7 -7
  94. package/dist/types/decorators/applyStyle.d.ts.map +1 -1
  95. package/dist/types/decorators/{changedAttributeThis.d.ts → changedAttribute.d.ts} +2 -2
  96. package/dist/types/decorators/changedAttribute.d.ts.map +1 -0
  97. package/dist/types/decorators/elementDefine.d.ts.map +1 -1
  98. package/dist/types/decorators/emitCustomEvent.d.ts +3 -10
  99. package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
  100. package/dist/types/decorators/index.d.ts +1 -1
  101. package/dist/types/decorators/index.d.ts.map +1 -1
  102. package/dist/types/decorators/publishSwcAppMessage.d.ts +1 -1
  103. package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -1
  104. package/dist/types/decorators/query.d.ts +3 -26
  105. package/dist/types/decorators/query.d.ts.map +1 -1
  106. package/dist/types/decorators/queryAll.d.ts +3 -20
  107. package/dist/types/decorators/queryAll.d.ts.map +1 -1
  108. package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +1 -0
  109. package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +1 -1
  110. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +2 -0
  111. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -1
  112. package/dist/types/elements/SwcAppMixin.d.ts +4 -4
  113. package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
  114. package/dist/types/examples/RxJSOperatorsExample.d.ts +94 -0
  115. package/dist/types/examples/RxJSOperatorsExample.d.ts.map +1 -0
  116. package/dist/types/index.d.ts +1 -0
  117. package/dist/types/index.d.ts.map +1 -1
  118. package/dist/types/router/ElementRouter.d.ts.map +1 -1
  119. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +759 -512
  120. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
  121. package/package.json +3 -3
  122. package/src/SwcAppEngine.ts +3 -1
  123. package/src/decorators/addEventListener.ts +28 -24
  124. package/src/decorators/applyAttribute.ts +109 -63
  125. package/src/decorators/applyClass.ts +89 -15
  126. package/src/decorators/applyNode.ts +357 -100
  127. package/src/decorators/applyProperty.ts +42 -63
  128. package/src/decorators/applyStyle.ts +59 -11
  129. package/src/decorators/{changedAttributeThis.ts → changedAttribute.ts} +1 -1
  130. package/src/decorators/elementDefine.ts +47 -4
  131. package/src/decorators/emitCustomEvent.ts +44 -36
  132. package/src/decorators/index.ts +1 -1
  133. package/src/decorators/publishSwcAppMessage.ts +1 -1
  134. package/src/decorators/query.ts +90 -159
  135. package/src/decorators/queryAll.ts +92 -134
  136. package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +1 -0
  137. package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +3 -1
  138. package/src/elements/SwcAppMixin.ts +43 -24
  139. package/src/examples/RxJSOperatorsExample.ts +279 -0
  140. package/src/index.ts +2 -0
  141. package/src/router/ElementRouter.ts +4 -0
  142. package/dist/cjs/decorators/changedAttributeThis.js.map +0 -7
  143. package/dist/esm/decorators/changedAttributeThis.js.map +0 -7
  144. package/dist/types/decorators/changedAttributeThis.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/elementDefine.ts"],
4
- "sourcesContent": ["import {ActionExpression, FunctionUtils, ReflectUtils} from '@dooboostore/core';\nimport {getAddEventListenerMetadata} from './addEventListener';\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 './changedAttributeThis';\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, NodeSlot} from '@dooboostore/core-web';\nimport {isSSR} from \"../elements/SwcAppMixin\";\nimport {findAllApplySlotMetadata} from \"./applySlot\";\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\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._boundListeners = [];\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 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 const originalConnected = proto.connectedCallback;\n proto.connectedCallback = async function () {\n ensureInit(this);\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 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\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\n // Separate delegate and non-delegate listeners\n const delegateListeners: typeof addEventListenerList = [];\n const nonDelegateListeners: typeof addEventListenerList = [];\n\n addEventListenerList.forEach(meta => {\n if (meta.options.delegate && 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 (this as any)._boundListeners.push({target: br, type, handler: unifiedHandler, options: opts});\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 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 (selector === '$window') bindTargets.push(currentWin);\n else if (selector === '$document') bindTargets.push(currentWin.document);\n else if (selector === '$host') applyRootOption(helperHostSet.$host);\n else if (selector === '$parentHost') applyRootOption(helperHostSet.$parentHost);\n else if (selector === '$appHost') applyRootOption(helperHostSet.$appHost);\n else if (selector === '$firstHost') applyRootOption(helperHostSet.$firstHost);\n else if (selector === '$lastHost') applyRootOption(helperHostSet.$lastHost);\n else if (selector === '$firstAppHost') applyRootOption(helperHostSet.$firstAppHost);\n else if (selector === '$lastAppHost') applyRootOption(helperHostSet.$lastAppHost);\n else if (selector === '$hosts') helperHostSet.$hosts.forEach(applyRootOption);\n else if (selector === '$appHosts') helperHostSet.$appHosts.forEach(applyRootOption);\n else if (selector === '$this' || !selector) 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(selector).forEach(el => bindTargets.push(el));\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 t.addEventListener(type, handler, opts);\n (this as any)._boundListeners.push({target: t, type, handler, options: opts});\n });\n });\n\n if (originalConnected) await (originalConnected.apply(this));\n\n const aMethods = findAllOnConnectedAfterMetadata(this).filter(it => {\n return useSsr ? !it.options.ssrFirst : true;\n });\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 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\n if ((this as any)._boundListeners) {\n (this as any)._boundListeners.forEach((l: any) => l.target.removeEventListener(l.type, l.handler, l.options));\n (this as any)._boundListeners = [];\n }\n\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,oBAAmB;AAC5D,SAAQ,mCAAkC;AAC1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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,EAAC,SAAS,SAAS,QAAO,IAAI,MAAS;AAAA,EAC/G;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import {ActionExpression, FunctionUtils, ReflectUtils} from '@dooboostore/core';\nimport {Observable, Subject} from '@dooboostore/core';\nimport {debounceTime, throttleTime, distinctUntilChanged} from '@dooboostore/core/message/operators';\nimport {getAddEventListenerMetadata} from './addEventListener';\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, NodeSlot} from '@dooboostore/core-web';\nimport {isSSR} from \"../elements/SwcAppMixin\";\nimport {findAllApplySlotMetadata} from \"./applySlot\";\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\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._boundListeners = [];\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 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 const originalConnected = proto.connectedCallback;\n proto.connectedCallback = async function () {\n ensureInit(this);\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 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\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\n // Separate delegate and non-delegate listeners\n const delegateListeners: typeof addEventListenerList = [];\n const nonDelegateListeners: typeof addEventListenerList = [];\n\n addEventListenerList.forEach(meta => {\n if (meta.options.delegate && 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 (this as any)._boundListeners.push({target: br, type, handler: unifiedHandler, options: opts});\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 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 (selector === '$window') bindTargets.push(currentWin);\n else if (selector === '$document') bindTargets.push(currentWin.document);\n else if (selector === '$host') applyRootOption(helperHostSet.$host);\n else if (selector === '$parentHost') applyRootOption(helperHostSet.$parentHost);\n else if (selector === '$appHost') applyRootOption(helperHostSet.$appHost);\n else if (selector === '$firstHost') applyRootOption(helperHostSet.$firstHost);\n else if (selector === '$lastHost') applyRootOption(helperHostSet.$lastHost);\n else if (selector === '$firstAppHost') applyRootOption(helperHostSet.$firstAppHost);\n else if (selector === '$lastAppHost') applyRootOption(helperHostSet.$lastAppHost);\n else if (selector === '$hosts') helperHostSet.$hosts.forEach(applyRootOption);\n else if (selector === '$appHosts') helperHostSet.$appHosts.forEach(applyRootOption);\n else if (selector === '$this' || !selector) 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(selector).forEach(el => bindTargets.push(el));\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 (this as any)._boundListeners.push({target: t, type, handler: wrappedHandler, options: opts, subscription});\n });\n });\n\n if (originalConnected) await (originalConnected.apply(this));\n\n const aMethods = findAllOnConnectedAfterMetadata(this).filter(it => {\n return useSsr ? !it.options.ssrFirst : true;\n });\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 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\n if ((this as any)._boundListeners) {\n (this as any)._boundListeners.forEach((l: any) => {\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 });\n (this as any)._boundListeners = [];\n }\n\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,oBAAmB;AAC5D,SAAoB,eAAc;AAClC,SAAQ,cAAc,cAAc,4BAA2B;AAC/D,SAAQ,mCAAkC;AAC1C,SAAQ,0BAA0B,iCAAiC,kCAAkC,4BAA4B,+BAA+B,oCAAoC,gCAAgC,qCAAqC,q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AAM,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,EAAC,SAAS,SAAS,QAAO,IAAI,MAAS;AAAA,EAC/G;AACA,SAAO;AACT;",
6
6
  "names": ["proto", "name", "win"]
7
7
  }
@@ -2,18 +2,32 @@ import { ReflectUtils } from "@dooboostore/core";
2
2
  import { ensureInit, getElementConfig } from "./elementDefine.js";
3
3
  import { SwcUtils } from "../utils/Utils.js";
4
4
  const EMIT_CUSTOM_EVENT_METADATA_KEY = Symbol.for("simple-web-component:emit-custom-event");
5
- function emitCustomEvent(selectorOrTarget, type, options = {}) {
5
+ function emitCustomEvent(selectorOrTarget, typeOrPropertyKey, optionsOrDescriptor) {
6
+ if (typeof selectorOrTarget === "object" && typeof typeOrPropertyKey === "string" && typeof optionsOrDescriptor === "object" && "value" in optionsOrDescriptor) {
7
+ throw new Error(`@emitCustomEvent decorator cannot be used on properties. (Property: ${String(typeOrPropertyKey)})`);
8
+ }
9
+ if (typeof selectorOrTarget === "string" && typeof typeOrPropertyKey === "string") {
10
+ return createEmitDecorator(selectorOrTarget, typeOrPropertyKey, optionsOrDescriptor);
11
+ }
12
+ if (typeof selectorOrTarget === "string" && typeOrPropertyKey !== "string") {
13
+ return createEmitDecorator("$this", selectorOrTarget, typeOrPropertyKey);
14
+ }
15
+ throw new Error("Invalid @emitCustomEvent usage");
16
+ }
17
+ function createEmitDecorator(selector, type, options) {
6
18
  return (targetObj, propertyKey, descriptor) => {
7
19
  const constructor = targetObj.constructor;
8
- const fullOptions = { ...options, type };
9
- if (fullOptions.bubbles === void 0) fullOptions.bubbles = true;
10
- if (fullOptions.composed === void 0) fullOptions.composed = true;
20
+ const fullOptions = { ...options || {}, type };
21
+ if (fullOptions.bubbles === void 0)
22
+ fullOptions.bubbles = true;
23
+ if (fullOptions.composed === void 0)
24
+ fullOptions.composed = true;
11
25
  let list = ReflectUtils.getMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor);
12
26
  if (!list) {
13
27
  list = [];
14
28
  ReflectUtils.defineMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, list, constructor);
15
29
  }
16
- list.push({ propertyKey, selector: selectorOrTarget, type, options: fullOptions });
30
+ list.push({ propertyKey, selector, type, options: fullOptions });
17
31
  const original = descriptor.value;
18
32
  descriptor.value = function(...args) {
19
33
  ensureInit(this);
@@ -29,40 +43,53 @@ function emitCustomEvent(selectorOrTarget, type, options = {}) {
29
43
  const conf = getElementConfig(this);
30
44
  const currentWin = this._resolveWindow?.(conf) || (typeof window !== "undefined" ? window : void 0);
31
45
  const eventTargets = [];
32
- if (selectorOrTarget === "$window") eventTargets.push(currentWin);
33
- else if (selectorOrTarget === "$document") eventTargets.push(currentWin.document);
34
- else if (selectorOrTarget === "$host") {
35
- if (hostSet.$host) eventTargets.push(hostSet.$host);
36
- } else if (selectorOrTarget === "$parentHost") {
37
- if (hostSet.$parentHost) eventTargets.push(hostSet.$parentHost);
38
- } else if (selectorOrTarget === "$appHost") {
39
- if (hostSet.$appHost) eventTargets.push(hostSet.$appHost);
40
- } else if (selectorOrTarget === "$firstHost") {
41
- if (hostSet.$firstHost) eventTargets.push(hostSet.$firstHost);
42
- } else if (selectorOrTarget === "$lastHost") {
43
- if (hostSet.$lastHost) eventTargets.push(hostSet.$lastHost);
44
- } else if (selectorOrTarget === "$firstAppHost") {
45
- if (hostSet.$firstAppHost) eventTargets.push(hostSet.$firstAppHost);
46
- } else if (selectorOrTarget === "$lastAppHost") {
47
- if (hostSet.$lastAppHost) eventTargets.push(hostSet.$lastAppHost);
48
- } else if (selectorOrTarget === "$hosts") {
46
+ if (selector === "$window")
47
+ eventTargets.push(currentWin);
48
+ else if (selector === "$document")
49
+ eventTargets.push(currentWin.document);
50
+ else if (selector === "$host") {
51
+ if (hostSet.$host)
52
+ eventTargets.push(hostSet.$host);
53
+ } else if (selector === "$parentHost") {
54
+ if (hostSet.$parentHost)
55
+ eventTargets.push(hostSet.$parentHost);
56
+ } else if (selector === "$appHost") {
57
+ if (hostSet.$appHost)
58
+ eventTargets.push(hostSet.$appHost);
59
+ } else if (selector === "$firstHost") {
60
+ if (hostSet.$firstHost)
61
+ eventTargets.push(hostSet.$firstHost);
62
+ } else if (selector === "$lastHost") {
63
+ if (hostSet.$lastHost)
64
+ eventTargets.push(hostSet.$lastHost);
65
+ } else if (selector === "$firstAppHost") {
66
+ if (hostSet.$firstAppHost)
67
+ eventTargets.push(hostSet.$firstAppHost);
68
+ } else if (selector === "$lastAppHost") {
69
+ if (hostSet.$lastAppHost)
70
+ eventTargets.push(hostSet.$lastAppHost);
71
+ } else if (selector === "$hosts") {
49
72
  hostSet.$hosts.forEach((h) => eventTargets.push(h));
50
- } else if (selectorOrTarget === "$appHosts") {
73
+ } else if (selector === "$appHosts") {
51
74
  hostSet.$appHosts.forEach((h) => eventTargets.push(h));
52
- } else if (selectorOrTarget === "$this" || !selectorOrTarget) {
75
+ } else if (selector === "$this" || !selector) {
53
76
  eventTargets.push(this);
54
77
  } else {
55
78
  const r = fullOptions.root || "auto";
56
79
  const searchRoots = [];
57
- if (r === "auto") searchRoots.push(this.shadowRoot || this);
58
- else if (r === "light") searchRoots.push(this);
59
- else if (r === "shadow" && this.shadowRoot) searchRoots.push(this.shadowRoot);
80
+ if (r === "auto")
81
+ searchRoots.push(this.shadowRoot || this);
82
+ else if (r === "light")
83
+ searchRoots.push(this);
84
+ else if (r === "shadow" && this.shadowRoot)
85
+ searchRoots.push(this.shadowRoot);
60
86
  else if (r === "all") {
61
87
  searchRoots.push(this);
62
- if (this.shadowRoot) searchRoots.push(this.shadowRoot);
88
+ if (this.shadowRoot)
89
+ searchRoots.push(this.shadowRoot);
63
90
  }
64
91
  searchRoots.forEach((sr) => {
65
- sr.querySelectorAll(selectorOrTarget).forEach((el) => eventTargets.push(el));
92
+ sr.querySelectorAll(selector).forEach((el) => eventTargets.push(el));
66
93
  });
67
94
  }
68
95
  eventTargets.forEach((t) => {
@@ -86,23 +113,10 @@ const getEmitCustomEventMetadataList = (target) => {
86
113
  return ReflectUtils.getMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor);
87
114
  };
88
115
  const emit = emitCustomEvent;
89
- function emitCustomEventThis(type, optionsOrAttributeaName) {
90
- if (optionsOrAttributeaName && typeof optionsOrAttributeaName === "string") {
91
- return emitCustomEventThis(type, { attributeName: optionsOrAttributeaName });
92
- } else if (optionsOrAttributeaName && typeof optionsOrAttributeaName === "object") {
93
- if (!optionsOrAttributeaName.attributeName) {
94
- optionsOrAttributeaName.attributeName = `on-emit-${type}`;
95
- }
96
- return emitCustomEvent("$this", type, optionsOrAttributeaName);
97
- } else {
98
- return emitCustomEvent("$this", type, { attributeName: `on-emit-${type}` });
99
- }
100
- }
101
116
  export {
102
117
  EMIT_CUSTOM_EVENT_METADATA_KEY,
103
118
  emit,
104
119
  emitCustomEvent,
105
- emitCustomEventThis,
106
120
  getEmitCustomEventMetadataList
107
121
  };
108
122
  //# 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 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: string;\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: SpecialSelector, type: string, options?: Options): MethodDecorator;\nexport function emitCustomEvent(selector: string, type: string, options?: Options): MethodDecorator;\n/**\n * @emitCustomEvent decorator to dispatch custom events to a target.\n */\nexport function emitCustomEvent(selectorOrTarget: string, type: string, options: any = {}): MethodDecorator {\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: selectorOrTarget, 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 hostSet = SwcUtils.getHostSet(this as any);\n const conf = getElementConfig(this);\n const currentWin = (this as any)._resolveWindow?.(conf) || ((typeof window !== 'undefined' ? window : undefined) as Window);\n\n const eventTargets: EventTarget[] = [];\n if (selectorOrTarget === '$window') eventTargets.push(currentWin);\n else if (selectorOrTarget === '$document') eventTargets.push(currentWin.document);\n else if (selectorOrTarget === '$host') {\n if (hostSet.$host) eventTargets.push(hostSet.$host);\n } else if (selectorOrTarget === '$parentHost') {\n if (hostSet.$parentHost) eventTargets.push(hostSet.$parentHost);\n } else if (selectorOrTarget === '$appHost') {\n if (hostSet.$appHost) eventTargets.push(hostSet.$appHost);\n } else if (selectorOrTarget === '$firstHost') {\n if (hostSet.$firstHost) eventTargets.push(hostSet.$firstHost);\n } else if (selectorOrTarget === '$lastHost') {\n if (hostSet.$lastHost) eventTargets.push(hostSet.$lastHost);\n } else if (selectorOrTarget === '$firstAppHost') {\n if (hostSet.$firstAppHost) eventTargets.push(hostSet.$firstAppHost);\n } else if (selectorOrTarget === '$lastAppHost') {\n if (hostSet.$lastAppHost) eventTargets.push(hostSet.$lastAppHost);\n } else if (selectorOrTarget === '$hosts') {\n hostSet.$hosts.forEach(h => eventTargets.push(h));\n } else if (selectorOrTarget === '$appHosts') {\n hostSet.$appHosts.forEach(h => eventTargets.push(h));\n } else if (selectorOrTarget === '$this' || !selectorOrTarget) {\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(selectorOrTarget).forEach(el => eventTargets.push(el));\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/**\n * @emitCustomEventThis decorator - simplified version of @emitCustomEvent for $this selector\n */\nexport function emitCustomEventThis(type: string, options: EmitCustomEventBaseOptions & SwcQueryOptions & { attributeName?: string }): MethodDecorator ;\nexport function emitCustomEventThis(type: string, attributeName: string): MethodDecorator ;\nexport function emitCustomEventThis(type: string): MethodDecorator;\nexport function emitCustomEventThis(type: string, optionsOrAttributeaName?: string | (EmitCustomEventBaseOptions & SwcQueryOptions & { attributeName?: string })): MethodDecorator {\n if (optionsOrAttributeaName && typeof optionsOrAttributeaName === 'string') {\n return emitCustomEventThis(type, {attributeName: optionsOrAttributeaName});\n } else if (optionsOrAttributeaName && typeof optionsOrAttributeaName === 'object') {\n if (!optionsOrAttributeaName.attributeName) {\n optionsOrAttributeaName.attributeName = `on-emit-${type}`;\n }\n return emitCustomEvent('$this', type, optionsOrAttributeaName);\n } else {\n return emitCustomEvent('$this', type, {attributeName: `on-emit-${type}`});\n }\n}\n"],
5
- "mappings": "AAAA,SAAQ,oBAAmB;AAE3B,SAAQ,YAAY,wBAA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C,YAAY,OAAO,GAAG,QAAQ,EAAC,aAAa,MAAM,QAAQ,QAAO,CAAC,GAAG;AAC9F;AAAA,UACF;AACA,YAAE,cAAc,KAAK;AAAA,QACvB,CAAC;AAED,eAAO;AAAA,MACT;AAEA,UAAI,eAAe,SAAS;AAC1B,eAAO,IAAI,KAAK,YAAY;AAAA,MAC9B,OAAO;AACL,eAAO,aAAa,GAAG;AAAA,MACzB;AAAA,IACF;AAAA,EACF;AACF;AAEO,MAAM,iCAAiC,CAAC,WAAuD;AACpG,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,gCAAgC,WAAW;AAC7E;AAGO,MAAM,OAAO;AAQb,SAAS,oBAAoB,MAAc,yBAAiI;AACjL,MAAI,2BAA2B,OAAO,4BAA4B,UAAU;AAC1E,WAAO,oBAAoB,MAAM,EAAC,eAAe,wBAAuB,CAAC;AAAA,EAC3E,WAAW,2BAA2B,OAAO,4BAA4B,UAAU;AACjF,QAAI,CAAC,wBAAwB,eAAe;AAC1C,8BAAwB,gBAAgB,WAAW,IAAI;AAAA,IACzD;AACA,WAAO,gBAAgB,SAAS,MAAM,uBAAuB;AAAA,EAC/D,OAAO;AACL,WAAO,gBAAgB,SAAS,MAAM,EAAC,eAAe,WAAW,IAAI,GAAE,CAAC;AAAA,EAC1E;AACF;",
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 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: string;\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: string, 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('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 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: string, 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 hostSet = SwcUtils.getHostSet(this as any);\n const conf = getElementConfig(this);\n const currentWin = (this as any)._resolveWindow?.(conf) || ((typeof window !== 'undefined' ? window : undefined) as Window);\n\n const eventTargets: EventTarget[] = [];\n if (selector === '$window') eventTargets.push(currentWin);\n else if (selector === '$document') eventTargets.push(currentWin.document);\n else if (selector === '$host') {\n if (hostSet.$host) eventTargets.push(hostSet.$host);\n } else if (selector === '$parentHost') {\n if (hostSet.$parentHost) eventTargets.push(hostSet.$parentHost);\n } else if (selector === '$appHost') {\n if (hostSet.$appHost) eventTargets.push(hostSet.$appHost);\n } else if (selector === '$firstHost') {\n if (hostSet.$firstHost) eventTargets.push(hostSet.$firstHost);\n } else if (selector === '$lastHost') {\n if (hostSet.$lastHost) eventTargets.push(hostSet.$lastHost);\n } else if (selector === '$firstAppHost') {\n if (hostSet.$firstAppHost) eventTargets.push(hostSet.$firstAppHost);\n } else if (selector === '$lastAppHost') {\n if (hostSet.$lastAppHost) eventTargets.push(hostSet.$lastAppHost);\n } else if (selector === '$hosts') {\n hostSet.$hosts.forEach(h => eventTargets.push(h));\n } else if (selector === '$appHosts') {\n hostSet.$appHosts.forEach(h => eventTargets.push(h));\n } else if (selector === '$this' || !selector) {\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(selector).forEach(el => eventTargets.push(el));\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;AAkChB,MAAM,iCAAiC,OAAO,IAAI,wCAAwC;AAc3F,SAAU,gBAAgB,kBAAuB,mBAAyB,qBAAyB;AAEvG,MAAI,OAAO,qBAAqB,YAAY,OAAO,sBAAsB,YAAY,OAAO,wBAAwB,YAAY,WAAW,qBAAqB;AAC9J,UAAM,IAAI,MAAM,uEAAuE,OAAO,iBAA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AU,CAAC,YAAY,OAAO,GAAG,QAAQ,EAAC,aAAa,MAAM,QAAQ,QAAO,CAAC,GAAG;AAC9F;UACF;AACA,YAAE,cAAc,KAAK;QACvB,CAAC;AAED,eAAO;MACT;AAEA,UAAI,eAAe,SAAS;AAC1B,eAAO,IAAI,KAAK,YAAY;MAC9B,OAAO;AACL,eAAO,aAAa,GAAG;MACzB;IACF;EACF;AACF;AAEO,MAAM,iCAAiC,CAAC,WAAsD;AACnG,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,gCAAgC,WAAW;AAC7E;AAGO,MAAM,OAAO;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  export * from "./addEventListener.js";
2
2
  export * from "./applyAttribute.js";
3
3
  export * from "./elementDefine.js";
4
- export * from "./changedAttributeThis.js";
4
+ export * from "./changedAttribute.js";
5
5
  export * from "./emitCustomEvent.js";
6
6
  export * from "./applyNode.js";
7
7
  export * from "./lifecycles.js";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/index.ts"],
4
- "sourcesContent": ["export * from './addEventListener';\nexport * from './applyAttribute';\nexport * from './elementDefine';\nexport * from './changedAttributeThis';\nexport * from './emitCustomEvent';\nexport * from './applyNode';\nexport * from './lifecycles';\nexport * from './query';\nexport * from './queryAll';\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';\n"],
4
+ "sourcesContent": ["export * from './addEventListener';\nexport * from './applyAttribute';\nexport * from './elementDefine';\nexport * from './changedAttribute';\nexport * from './emitCustomEvent';\nexport * from './applyNode';\nexport * from './lifecycles';\nexport * from './query';\nexport * from './queryAll';\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';\n"],
5
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;",
6
6
  "names": []
7
7
  }
@@ -23,7 +23,7 @@ function createPublishSwcAppMessage(messageType, options) {
23
23
  }
24
24
  return v;
25
25
  };
26
- const publishMessage = (data) => {
26
+ const publishMessage2 = (data) => {
27
27
  const appHost = SwcUtils.getAppHost(this);
28
28
  if (appHost) {
29
29
  appHost.publishMessage({
@@ -36,13 +36,13 @@ function createPublishSwcAppMessage(messageType, options) {
36
36
  if (result instanceof Promise) {
37
37
  result.then((data) => {
38
38
  const extracted = extractValue(data);
39
- publishMessage(extracted);
39
+ publishMessage2(extracted);
40
40
  }).catch((err) => {
41
41
  console.warn("publishSwcAppMessage async error:", err);
42
42
  });
43
43
  } else {
44
44
  const extracted = extractValue(result);
45
- publishMessage(extracted);
45
+ publishMessage2(extracted);
46
46
  }
47
47
  return result;
48
48
  };
@@ -67,7 +67,7 @@ function publishSwcAppMessage(targetOrMessageTypeOrOptions, propertyKeyOrOptions
67
67
  }
68
68
  return createPublishSwcAppMessage(messageType, options);
69
69
  }
70
- const publish = publishSwcAppMessage;
70
+ const publishMessage = publishSwcAppMessage;
71
71
  const getPublishSwcAppMessageMetadata = (target) => {
72
72
  const constructor = target instanceof Function ? target : target.constructor;
73
73
  return ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor);
@@ -75,7 +75,7 @@ const getPublishSwcAppMessageMetadata = (target) => {
75
75
  export {
76
76
  PUBLISH_SWC_APP_MESSAGE_METADATA_KEY,
77
77
  getPublishSwcAppMessageMetadata,
78
- publish,
78
+ publishMessage,
79
79
  publishSwcAppMessage
80
80
  };
81
81
  //# sourceMappingURL=publishSwcAppMessage.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/publishSwcAppMessage.ts"],
4
- "sourcesContent": ["import {ReflectUtils} from '@dooboostore/core';\nimport {SwcUtils} from '../utils/Utils';\n\nexport const PUBLISH_SWC_APP_MESSAGE_METADATA_KEY = Symbol.for('simple-web-component:publish-swc-app-message');\n\nexport interface PublishSwcAppMessageMetadata {\n propertyKey: string | symbol;\n messageType?: string;\n}\n\nexport interface PublishSwcAppMessageOptions {\n messageType?: string;\n /**\n * Custom key to extract value from return object.\n * If not provided, uses PUBLISH_SWC_APP_MESSAGE_METADATA_KEY by default.\n * Useful when multiple @publishSwcAppMessage decorators are on the same method.\n * \n * Example:\n * @publishSwcAppMessage('event1', { valueKey: 'detail1' })\n * @publishSwcAppMessage('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\nfunction createPublishSwcAppMessage(messageType?: string, options?: PublishSwcAppMessageOptions): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor) as PublishSwcAppMessageMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, messageType });\n \n if (!descriptor) {\n return descriptor;\n }\n\n // \uBA54\uC11C\uB4DC \uB798\uD551 - \uC6D0\uBCF8 \uBA54\uC11C\uB4DC\uC758 \uBC18\uD658\uAC12\uC744 \uCEA1\uCC98\uD558\uC5EC \uBA54\uC2DC\uC9C0 \uBC1C\uD589\n const originalMethod = descriptor.value;\n descriptor.value = function (...args: any[]) {\n // \uC6D0\uBCF8 \uBA54\uC11C\uB4DC \uC2E4\uD589\n const result = originalMethod.apply(this, args);\n\n /**\n * Extract value for this decorator from method return value\n * \n * If return value is an object with this decorator's key,\n * use that value. Otherwise use the entire return value.\n * \n * Uses valueKey from options if provided, otherwise uses PUBLISH_SWC_APP_MESSAGE_METADATA_KEY.\n */\n const extractValue = (v: any) => {\n const keyToUse = options?.valueKey ?? PUBLISH_SWC_APP_MESSAGE_METADATA_KEY;\n if (v && typeof v === 'object' && keyToUse in v) {\n return v[keyToUse];\n }\n return v;\n };\n\n const publishMessage = (data: any) => {\n // appHost \uCC3E\uC544\uC11C \uBA54\uC2DC\uC9C0 \uBC1C\uD589\n const appHost = SwcUtils.getAppHost(this as HTMLElement);\n if (appHost) {\n appHost.publishMessage({\n publisher: this,\n data,\n type: messageType\n });\n }\n };\n \n // Promise \uCCB4\uD06C\n if (result instanceof Promise) {\n result.then((data) => {\n const extracted = extractValue(data);\n publishMessage(extracted);\n }).catch((err) => {\n console.warn('publishSwcAppMessage async error:', err);\n });\n } else {\n // \uB3D9\uAE30 \uD638\uCD9C - \uBC14\uB85C \uBA54\uC2DC\uC9C0 \uBC1C\uD589\n const extracted = extractValue(result);\n publishMessage(extracted);\n }\n \n return result;\n };\n\n return descriptor;\n };\n}\n\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uC9C1\uC811 \uC0AC\uC6A9 (\uAD04\uD638 \uC5C6\uC74C)\nexport function publishSwcAppMessage(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C)\nexport function publishSwcAppMessage(): MethodDecorator;\nexport function publishSwcAppMessage(messageType: string): MethodDecorator;\nexport function publishSwcAppMessage(messageType: string, options: PublishSwcAppMessageOptions): MethodDecorator;\nexport function publishSwcAppMessage(options: PublishSwcAppMessageOptions): MethodDecorator;\n\nexport function publishSwcAppMessage(targetOrMessageTypeOrOptions?: any, propertyKeyOrOptions?: string | symbol | PublishSwcAppMessageOptions, descriptor?: PropertyDescriptor): any {\n // \uC9C1\uC811 \uB370\uCF54\uB808\uC774\uD130\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC5C6\uC74C): @publishSwcAppMessage\n if (targetOrMessageTypeOrOptions && typeof targetOrMessageTypeOrOptions === 'object' && \n propertyKeyOrOptions && (typeof propertyKeyOrOptions === 'string' || typeof propertyKeyOrOptions === 'symbol') &&\n descriptor) {\n const target = targetOrMessageTypeOrOptions;\n return createPublishSwcAppMessage()(target, propertyKeyOrOptions, descriptor);\n }\n\n // \uD568\uC218\uB85C \uD638\uCD9C\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC788\uC74C): @publishSwcAppMessage() / @publishSwcAppMessage('messageType') / @publishSwcAppMessage({...})\n let messageType: string | undefined;\n let options: PublishSwcAppMessageOptions | undefined;\n\n if (typeof targetOrMessageTypeOrOptions === 'string') {\n // \uBA54\uC2DC\uC9C0 \uD0C0\uC785 \uC804\uB2EC: @publishSwcAppMessage('messageType')\n messageType = targetOrMessageTypeOrOptions;\n if (typeof propertyKeyOrOptions === 'object' && propertyKeyOrOptions !== null) {\n options = propertyKeyOrOptions as PublishSwcAppMessageOptions;\n }\n } else if (typeof targetOrMessageTypeOrOptions === 'object' && targetOrMessageTypeOrOptions !== null) {\n // \uC635\uC158 \uAC1D\uCCB4 \uC804\uB2EC: @publishSwcAppMessage({...})\n options = targetOrMessageTypeOrOptions as PublishSwcAppMessageOptions;\n messageType = options.messageType;\n }\n\n return createPublishSwcAppMessage(messageType, options);\n}\n\n// --- Aliases: publish... ---\nexport const publish = publishSwcAppMessage;\n\n// Helper function to retrieve publish message metadata\nexport const getPublishSwcAppMessageMetadata = (target: any): PublishSwcAppMessageMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor);\n};\n"],
5
- "mappings": "AAAA,SAAQ,oBAAmB;AAC3B,SAAQ,gBAAe;AAEhB,MAAM,uCAAuC,OAAO,IAAI,8CAA8C;AA2B7G,SAAS,2BAA2B,aAAsB,SAAwD;AAChH,SAAO,CAAC,QAAgB,aAA8B,eAAoC;AACxF,UAAM,cAAc,OAAO;AAC3B,QAAI,OAAO,aAAa,eAAe,sCAAsC,WAAW;AACxF,QAAI,CAAC,MAAM;AACT,aAAO,CAAC;AACR,mBAAa,eAAe,sCAAsC,MAAM,WAAW;AAAA,IACrF;AACA,SAAK,KAAK,EAAE,aAAa,YAAY,CAAC;AAEtC,QAAI,CAAC,YAAY;AACf,aAAO;AAAA,IACT;AAGA,UAAM,iBAAiB,WAAW;AAClC,eAAW,QAAQ,YAAa,MAAa;AAE3C,YAAM,SAAS,eAAe,MAAM,MAAM,IAAI;AAU9C,YAAM,eAAe,CAAC,MAAW;AAC/B,cAAM,WAAW,SAAS,YAAY;AACtC,YAAI,KAAK,OAAO,MAAM,YAAY,YAAY,GAAG;AAC/C,iBAAO,EAAE,QAAQ;AAAA,QACnB;AACA,eAAO;AAAA,MACT;AAEA,YAAM,iBAAiB,CAAC,SAAc;AAEpC,cAAM,UAAU,SAAS,WAAW,IAAmB;AACvD,YAAI,SAAS;AACX,kBAAQ,eAAe;AAAA,YACrB,WAAW;AAAA,YACX;AAAA,YACA,MAAM;AAAA,UACR,CAAC;AAAA,QACH;AAAA,MACF;AAGA,UAAI,kBAAkB,SAAS;AAC7B,eAAO,KAAK,CAAC,SAAS;AACpB,gBAAM,YAAY,aAAa,IAAI;AACnC,yBAAe,SAAS;AAAA,QAC1B,CAAC,EAAE,MAAM,CAAC,QAAQ;AAChB,kBAAQ,KAAK,qCAAqC,GAAG;AAAA,QACvD,CAAC;AAAA,MACH,OAAO;AAEL,cAAM,YAAY,aAAa,MAAM;AACrC,uBAAe,SAAS;AAAA,MAC1B;AAEA,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EACT;AACF;AAUO,SAAS,qBAAqB,8BAAoC,sBAAsE,YAAsC;AAEnL,MAAI,gCAAgC,OAAO,iCAAiC,YACxE,yBAAyB,OAAO,yBAAyB,YAAY,OAAO,yBAAyB,aACrG,YAAY;AACd,UAAM,SAAS;AACf,WAAO,2BAA2B,EAAE,QAAQ,sBAAsB,UAAU;AAAA,EAC9E;AAGA,MAAI;AACJ,MAAI;AAEJ,MAAI,OAAO,iCAAiC,UAAU;AAEpD,kBAAc;AACd,QAAI,OAAO,yBAAyB,YAAY,yBAAyB,MAAM;AAC7E,gBAAU;AAAA,IACZ;AAAA,EACF,WAAW,OAAO,iCAAiC,YAAY,iCAAiC,MAAM;AAEpG,cAAU;AACV,kBAAc,QAAQ;AAAA,EACxB;AAEA,SAAO,2BAA2B,aAAa,OAAO;AACxD;AAGO,MAAM,UAAU;AAGhB,MAAM,kCAAkC,CAAC,WAA4D;AAC1G,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,eAAe,sCAAsC,WAAW;AACtF;",
6
- "names": []
4
+ "sourcesContent": ["import {ReflectUtils} from '@dooboostore/core';\nimport {SwcUtils} from '../utils/Utils';\n\nexport const PUBLISH_SWC_APP_MESSAGE_METADATA_KEY = Symbol.for('simple-web-component:publish-swc-app-message');\n\nexport interface PublishSwcAppMessageMetadata {\n propertyKey: string | symbol;\n messageType?: string;\n}\n\nexport interface PublishSwcAppMessageOptions {\n messageType?: string;\n /**\n * Custom key to extract value from return object.\n * If not provided, uses PUBLISH_SWC_APP_MESSAGE_METADATA_KEY by default.\n * Useful when multiple @publishSwcAppMessage decorators are on the same method.\n * \n * Example:\n * @publishSwcAppMessage('event1', { valueKey: 'detail1' })\n * @publishSwcAppMessage('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\nfunction createPublishSwcAppMessage(messageType?: string, options?: PublishSwcAppMessageOptions): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor) as PublishSwcAppMessageMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, messageType });\n \n if (!descriptor) {\n return descriptor;\n }\n\n // \uBA54\uC11C\uB4DC \uB798\uD551 - \uC6D0\uBCF8 \uBA54\uC11C\uB4DC\uC758 \uBC18\uD658\uAC12\uC744 \uCEA1\uCC98\uD558\uC5EC \uBA54\uC2DC\uC9C0 \uBC1C\uD589\n const originalMethod = descriptor.value;\n descriptor.value = function (...args: any[]) {\n // \uC6D0\uBCF8 \uBA54\uC11C\uB4DC \uC2E4\uD589\n const result = originalMethod.apply(this, args);\n\n /**\n * Extract value for this decorator from method return value\n * \n * If return value is an object with this decorator's key,\n * use that value. Otherwise use the entire return value.\n * \n * Uses valueKey from options if provided, otherwise uses PUBLISH_SWC_APP_MESSAGE_METADATA_KEY.\n */\n const extractValue = (v: any) => {\n const keyToUse = options?.valueKey ?? PUBLISH_SWC_APP_MESSAGE_METADATA_KEY;\n if (v && typeof v === 'object' && keyToUse in v) {\n return v[keyToUse];\n }\n return v;\n };\n\n const publishMessage = (data: any) => {\n // appHost \uCC3E\uC544\uC11C \uBA54\uC2DC\uC9C0 \uBC1C\uD589\n const appHost = SwcUtils.getAppHost(this as HTMLElement);\n if (appHost) {\n appHost.publishMessage({\n publisher: this,\n data,\n type: messageType\n });\n }\n };\n \n // Promise \uCCB4\uD06C\n if (result instanceof Promise) {\n result.then((data) => {\n const extracted = extractValue(data);\n publishMessage(extracted);\n }).catch((err) => {\n console.warn('publishSwcAppMessage async error:', err);\n });\n } else {\n // \uB3D9\uAE30 \uD638\uCD9C - \uBC14\uB85C \uBA54\uC2DC\uC9C0 \uBC1C\uD589\n const extracted = extractValue(result);\n publishMessage(extracted);\n }\n \n return result;\n };\n\n return descriptor;\n };\n}\n\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uC9C1\uC811 \uC0AC\uC6A9 (\uAD04\uD638 \uC5C6\uC74C)\nexport function publishSwcAppMessage(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C)\nexport function publishSwcAppMessage(): MethodDecorator;\nexport function publishSwcAppMessage(messageType: string): MethodDecorator;\nexport function publishSwcAppMessage(messageType: string, options: PublishSwcAppMessageOptions): MethodDecorator;\nexport function publishSwcAppMessage(options: PublishSwcAppMessageOptions): MethodDecorator;\n\nexport function publishSwcAppMessage(targetOrMessageTypeOrOptions?: any, propertyKeyOrOptions?: string | symbol | PublishSwcAppMessageOptions, descriptor?: PropertyDescriptor): any {\n // \uC9C1\uC811 \uB370\uCF54\uB808\uC774\uD130\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC5C6\uC74C): @publishSwcAppMessage\n if (targetOrMessageTypeOrOptions && typeof targetOrMessageTypeOrOptions === 'object' && \n propertyKeyOrOptions && (typeof propertyKeyOrOptions === 'string' || typeof propertyKeyOrOptions === 'symbol') &&\n descriptor) {\n const target = targetOrMessageTypeOrOptions;\n return createPublishSwcAppMessage()(target, propertyKeyOrOptions, descriptor);\n }\n\n // \uD568\uC218\uB85C \uD638\uCD9C\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC788\uC74C): @publishSwcAppMessage() / @publishSwcAppMessage('messageType') / @publishSwcAppMessage({...})\n let messageType: string | undefined;\n let options: PublishSwcAppMessageOptions | undefined;\n\n if (typeof targetOrMessageTypeOrOptions === 'string') {\n // \uBA54\uC2DC\uC9C0 \uD0C0\uC785 \uC804\uB2EC: @publishSwcAppMessage('messageType')\n messageType = targetOrMessageTypeOrOptions;\n if (typeof propertyKeyOrOptions === 'object' && propertyKeyOrOptions !== null) {\n options = propertyKeyOrOptions as PublishSwcAppMessageOptions;\n }\n } else if (typeof targetOrMessageTypeOrOptions === 'object' && targetOrMessageTypeOrOptions !== null) {\n // \uC635\uC158 \uAC1D\uCCB4 \uC804\uB2EC: @publishSwcAppMessage({...})\n options = targetOrMessageTypeOrOptions as PublishSwcAppMessageOptions;\n messageType = options.messageType;\n }\n\n return createPublishSwcAppMessage(messageType, options);\n}\n\n// --- Aliases: publish... ---\nexport const publishMessage = publishSwcAppMessage;\n\n// Helper function to retrieve publish message metadata\nexport const getPublishSwcAppMessageMetadata = (target: any): PublishSwcAppMessageMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor);\n};\n"],
5
+ "mappings": "AAAA,SAAQ,oBAAmB;AAC3B,SAAQ,gBAAe;AAEhB,MAAM,uCAAuC,OAAO,IAAI,8CAA8C;AA2B7G,SAAS,2BAA2B,aAAsB,SAAwD;AAChH,SAAO,CAAC,QAAgB,aAA8B,eAAoC;AACxF,UAAM,cAAc,OAAO;AAC3B,QAAI,OAAO,aAAa,eAAe,sCAAsC,WAAW;AACxF,QAAI,CAAC,MAAM;AACT,aAAO,CAAC;AACR,mBAAa,eAAe,sCAAsC,MAAM,WAAW;AAAA,IACrF;AACA,SAAK,KAAK,EAAE,aAAa,YAAY,CAAC;AAEtC,QAAI,CAAC,YAAY;AACf,aAAO;AAAA,IACT;AAGA,UAAM,iBAAiB,WAAW;AAClC,eAAW,QAAQ,YAAa,MAAa;AA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