@dooboostore/simple-web-component 1.0.28 → 1.0.30

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 (94) hide show
  1. package/README.md +437 -25
  2. package/dist/cjs/decorators/attribute.js +2 -1
  3. package/dist/cjs/decorators/attribute.js.map +2 -2
  4. package/dist/cjs/decorators/elementDefine.js +8 -2
  5. package/dist/cjs/decorators/elementDefine.js.map +2 -2
  6. package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
  7. package/dist/cjs/decorators/index.js +1 -0
  8. package/dist/cjs/decorators/index.js.map +2 -2
  9. package/dist/cjs/decorators/lifecycles.js +4 -0
  10. package/dist/cjs/decorators/lifecycles.js.map +2 -2
  11. package/dist/cjs/decorators/setProperty.js +97 -0
  12. package/dist/cjs/decorators/setProperty.js.map +7 -0
  13. package/dist/cjs/elements/SwcAppEngine.js +3 -3
  14. package/dist/cjs/elements/SwcAppEngine.js.map +2 -2
  15. package/dist/cjs/elements/SwcAppMixin.js +44 -6
  16. package/dist/cjs/elements/SwcAppMixin.js.map +3 -3
  17. package/dist/cjs/elements/SwcAsync.js +4 -1
  18. package/dist/cjs/elements/SwcAsync.js.map +2 -2
  19. package/dist/cjs/elements/SwcChoose.js +54 -38
  20. package/dist/cjs/elements/SwcChoose.js.map +2 -2
  21. package/dist/cjs/elements/register.js +131 -39
  22. package/dist/cjs/elements/register.js.map +2 -2
  23. package/dist/cjs/index.js +2 -1
  24. package/dist/cjs/index.js.map +2 -2
  25. package/dist/cjs/types.js.map +1 -1
  26. package/dist/cjs/utils/Utils.js +30 -1
  27. package/dist/cjs/utils/Utils.js.map +2 -2
  28. package/dist/esm/decorators/attribute.js +2 -1
  29. package/dist/esm/decorators/attribute.js.map +2 -2
  30. package/dist/esm/decorators/elementDefine.js +8 -2
  31. package/dist/esm/decorators/elementDefine.js.map +2 -2
  32. package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
  33. package/dist/esm/decorators/index.js +1 -0
  34. package/dist/esm/decorators/index.js.map +2 -2
  35. package/dist/esm/decorators/lifecycles.js +4 -0
  36. package/dist/esm/decorators/lifecycles.js.map +2 -2
  37. package/dist/esm/decorators/setProperty.js +78 -0
  38. package/dist/esm/decorators/setProperty.js.map +7 -0
  39. package/dist/esm/elements/SwcAppEngine.js +3 -3
  40. package/dist/esm/elements/SwcAppEngine.js.map +2 -2
  41. package/dist/esm/elements/SwcAppMixin.js +44 -6
  42. package/dist/esm/elements/SwcAppMixin.js.map +3 -3
  43. package/dist/esm/elements/SwcAsync.js +4 -1
  44. package/dist/esm/elements/SwcAsync.js.map +2 -2
  45. package/dist/esm/elements/SwcChoose.js +54 -38
  46. package/dist/esm/elements/SwcChoose.js.map +2 -2
  47. package/dist/esm/elements/register.js +131 -39
  48. package/dist/esm/elements/register.js.map +2 -2
  49. package/dist/esm/index.js +2 -1
  50. package/dist/esm/index.js.map +2 -2
  51. package/dist/esm/types.js.map +1 -1
  52. package/dist/esm/utils/Utils.js +30 -1
  53. package/dist/esm/utils/Utils.js.map +2 -2
  54. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +118 -4
  55. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
  56. package/dist/types/decorators/attribute.d.ts.map +1 -1
  57. package/dist/types/decorators/elementDefine.d.ts.map +1 -1
  58. package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
  59. package/dist/types/decorators/index.d.ts +1 -0
  60. package/dist/types/decorators/index.d.ts.map +1 -1
  61. package/dist/types/decorators/lifecycles.d.ts +2 -0
  62. package/dist/types/decorators/lifecycles.d.ts.map +1 -1
  63. package/dist/types/decorators/setProperty.d.ts +13 -0
  64. package/dist/types/decorators/setProperty.d.ts.map +1 -0
  65. package/dist/types/elements/SwcAppMixin.d.ts +7 -2
  66. package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
  67. package/dist/types/elements/SwcAsync.d.ts.map +1 -1
  68. package/dist/types/elements/SwcChoose.d.ts +1 -1
  69. package/dist/types/elements/SwcChoose.d.ts.map +1 -1
  70. package/dist/types/elements/register.d.ts +3 -1
  71. package/dist/types/elements/register.d.ts.map +1 -1
  72. package/dist/types/index.d.ts +1 -1
  73. package/dist/types/index.d.ts.map +1 -1
  74. package/dist/types/types.d.ts +3 -0
  75. package/dist/types/types.d.ts.map +1 -1
  76. package/dist/types/utils/Utils.d.ts +13 -0
  77. package/dist/types/utils/Utils.d.ts.map +1 -1
  78. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +118 -4
  79. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
  80. package/package.json +4 -4
  81. package/src/decorators/attribute.ts +6 -1
  82. package/src/decorators/elementDefine.ts +12 -4
  83. package/src/decorators/emitCustomEvent.ts +1 -0
  84. package/src/decorators/index.ts +1 -0
  85. package/src/decorators/lifecycles.ts +3 -0
  86. package/src/decorators/setProperty.ts +97 -0
  87. package/src/elements/SwcAppEngine.ts +3 -3
  88. package/src/elements/SwcAppMixin.ts +77 -14
  89. package/src/elements/SwcAsync.ts +5 -1
  90. package/src/elements/SwcChoose.ts +76 -37
  91. package/src/elements/register.ts +158 -39
  92. package/src/index.ts +3 -1
  93. package/src/types.ts +3 -0
  94. package/src/utils/Utils.ts +55 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/elementDefine.ts"],
4
- "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { FunctionUtils } from '@dooboostore/core';\nimport { getAddEventListenerMetadata } from './addEventListener';\nimport { ON_INITIALIZE_METADATA_KEY, ON_BEFORE_CONNECTED_METADATA_KEY, ON_AFTER_CONNECTED_METADATA_KEY, ON_BEFORE_DISCONNECTED_METADATA_KEY, ON_AFTER_DISCONNECTED_METADATA_KEY, ON_BEFORE_ADOPTED_METADATA_KEY, ON_AFTER_ADOPTED_METADATA_KEY, findAllLifecycleMetadata, getOnConnectedInnerHtmlMetadata } from './lifecycles';\nimport { getEmitCustomEventMetadataList } from './emitCustomEvent';\nimport { findAllAttributeChangedMetadata } from './changedAttributeHost';\nimport { findAllAttributeApplyMetadata } from './applyAttribute';\nimport { findAllAttributeMetadata } from './attribute';\nimport { getQueryMetadata } from './query';\nimport { getQueryAllMetadata } from './queryAll';\nimport { SwcUtils } from '../utils/Utils';\nimport { HTML_TAG_ENTRIES, DOM_EVENT_NAMES } from '../config/config';\nimport { SituationTypeContainer, SituationTypeContainers } from '@dooboostore/simple-boot/decorators/inject/Inject';\nimport { InjectSituationType, HostSet } from '../types';\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}\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) => {\n if (!inst.__swc_initialized) {\n inst._swcId = Math.random().toString(36).substring(2, 11);\n inst._emitHandlers = new Map();\n inst._boundListeners = [];\n inst.__swc_initialized = true;\n\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: \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 @attributeHost('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 \n // @attribute \uD544\uB4DC\uC758 own property \uC0AD\uC81C \u2192 getter/setter \uC791\uB3D9\n const attributeList = findAllAttributeMetadata(target);\n attributeList.forEach(meta => {\n delete (inst as any)[meta.propertyKey];\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\n // Call constructor script if present\n const hostSet = SwcUtils.getHostSet(inst);\n inst._executeSwcScript?.('swc-on-constructor', hostSet);\n\n // Call @onInitialize lifecycle methods\n const cMethods = findAllLifecycleMetadata(inst, ON_INITIALIZE_METADATA_KEY);\n if (cMethods) {\n for (const m of cMethods) (inst)._invokeLifecycleMethod(m, hostSet);\n }\n }\n};\n\n// --- Global Event Handling ---\nconst globalDelegatedRoots = new WeakSet<Node>();\n\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.findNearestSwcHost(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 || ((typeof window !== 'undefined' ? window : undefined) as any);\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) => {\n if (proto.__swc_proto_setup) return;\n proto.__swc_proto_setup = true;\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.findAllSwcHosts(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 (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 app = hostSet.$appHost?.simpleApplication;\n\n if (app) {\n const otherStorage = new Map<any, any>();\n const situations = new SituationTypeContainers([new SituationTypeContainer({ situationType: InjectSituationType.HOST_SET, data: hostSet }), new SituationTypeContainer({ situationType: InjectSituationType.APP_HOST, data: hostSet.$appHost }), new SituationTypeContainer({ situationType: InjectSituationType.APP_HOSTS, data: hostSet.$appHosts }), new SituationTypeContainer({ situationType: InjectSituationType.HOST, data: hostSet.$host }), new SituationTypeContainer({ situationType: InjectSituationType.HOSTS, data: hostSet.$hosts }), new SituationTypeContainer({ situationType: InjectSituationType.FIRST_HOST, data: hostSet.$firstHost }), new SituationTypeContainer({ situationType: InjectSituationType.LAST_HOST, data: hostSet.$lastHost }), new SituationTypeContainer({ situationType: InjectSituationType.FIRST_APP_HOST, data: hostSet.$firstAppHost }), new SituationTypeContainer({ situationType: InjectSituationType.LAST_APP_HOST, data: hostSet.$lastAppHost })]);\n otherStorage.set(SituationTypeContainers, situations);\n\n return app.simstanceManager.executeBindParameterSimPromise(\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 parent = SwcUtils.findNearestSwcHost(el);\n const hostSet = SwcUtils.getHostSet(parent || 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 parent = SwcUtils.findNearestSwcHost(el);\n const hostSet = SwcUtils.getHostSet(parent || 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 === ':host' || 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 // Collect all observed attributes from all decorators\n const attributeApplyNames = Array.from(applyAttributeMap.values()).map(it => it.options.name).filter(Boolean) as string[];\n // const attributeListNames = attributeList.map(it => it.options.name || String(it.propertyKey));\n const hostAttributes = attributeList.filter(it => it.selector === ':host').map(it=>it.options.name || String(it.propertyKey));\n\n const mergedObservedAttributes = [...new Set([\n ...(metadata.observedAttributes ?? []),\n ...attrChangeMap.keys(),\n ...attributeApplyNames,\n ...hostAttributes,\n ...emitHostCustomEventList.map(it => (it.options as any).attributeName).filter(Boolean),\n ...swcLifecycleAttributes,\n ...swcOnEvents\n ])];\n\n const connectedInnerHtmlList = getOnConnectedInnerHtmlMetadata(constructor) || [];\n\n const proto = constructor.prototype;\n setupPrototype(proto);\n\n const originalConnected = proto.connectedCallback;\n proto.connectedCallback = function () {\n ensureInit(this);\n\n const hostSet = SwcUtils.getHostSet(this as any);\n const appHost = hostSet.$appHost;\n const conf = getElementConfig(this);\n const currentWin = (this as any)._resolveWindow(conf);\n\n if (connectedInnerHtmlList.some(it => it.options.useShadow === true) && !this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n\n (this as any)._executeSwcScript('swc-on-before-connected', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_CONNECTED_METADATA_KEY);\n if (bMethods) {\n for (const m of bMethods) (this as any)._invokeLifecycleMethod(m, hostSet);\n }\n\n if (connectedInnerHtmlList.length > 0) {\n let sContent = '',\n lContent = '';\n for (const meta of connectedInnerHtmlList) {\n const res = (this as any)[meta.propertyKey]();\n if (res !== undefined) {\n if (meta.options.useShadow) sContent += res;\n else lContent += res;\n }\n }\n if (this.shadowRoot) this.shadowRoot.innerHTML = sContent;\n if (lContent) this.innerHTML = lContent;\n }\n\n const root = this.getRootNode();\n if (!globalDelegatedRoots.has(root)) {\n DOM_EVENT_NAMES.forEach(type => {\n root.addEventListener(type, handleGlobalSwcEvent);\n });\n globalDelegatedRoots.add(root);\n }\n\n // Separate delegate and non-delegate listeners\n const delegateListeners: typeof addEventListenerList = [];\n const nonDelegateListeners: typeof addEventListenerList = [];\n \n addEventListenerList.forEach(meta => {\n if (meta.options.delegate && meta.selector !== ':window' && meta.selector !== ':document' && meta.selector !== ':parentHost' && meta.selector !== ':appHost' && meta.selector !== ':firstHost' && meta.selector !== ':lastHost' && meta.selector !== ':firstAppHost' && meta.selector !== ':lastAppHost' && meta.selector !== ':hosts' && meta.selector !== ':appHosts' && meta.selector !== ':host' && 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, 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 === ':parentHost') applyRootOption(hostSet.$parentHost);\n else if (selector === ':appHost') applyRootOption(hostSet.$appHost);\n else if (selector === ':firstHost') applyRootOption(hostSet.$firstHost);\n else if (selector === ':lastHost') applyRootOption(hostSet.$lastHost);\n else if (selector === ':firstAppHost') applyRootOption(hostSet.$firstAppHost);\n else if (selector === ':lastAppHost') applyRootOption(hostSet.$lastAppHost);\n else if (selector === ':hosts') hostSet.$hosts.forEach(applyRootOption);\n else if (selector === ':appHosts') hostSet.$appHosts.forEach(applyRootOption);\n else if (selector === ':host' || !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, 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, args);\n };\n t.addEventListener(type, handler, opts);\n if (options.removeOnDisconnected === true || t === currentWin || t === currentWin.document) {\n (this as any)._boundListeners.push({ target: t, type, handler, options: opts });\n }\n });\n });\n\n if (originalConnected) originalConnected.apply(this);\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_CONNECTED_METADATA_KEY);\n if (aMethods) {\n for (const m of aMethods) (this as any)._invokeLifecycleMethod(m, hostSet);\n }\n (this as any)._executeSwcScript('swc-on-connected', hostSet);\n (this as any)._executeSwcScript('swc-on-after-connected', hostSet);\n (this as any).__swc_connected = true;\n\n // Register to appHost LAST when all lifecycle completed\n if (appHost && typeof (appHost as any)._connected === 'function') {\n (appHost as any)._connected(this);\n }\n };\n\n const originalDisconnected = proto.disconnectedCallback;\n proto.disconnectedCallback = function () {\n const hostSet = SwcUtils.getHostSet(this as any);\n (this as any)._executeSwcScript('swc-on-before-disconnected', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_DISCONNECTED_METADATA_KEY);\n if (bMethods) {\n for (const m of bMethods) (this as any)._invokeLifecycleMethod(m, hostSet);\n }\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 if (originalDisconnected) originalDisconnected.apply(this);\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_DISCONNECTED_METADATA_KEY);\n if (aMethods) {\n for (const m of aMethods) (this as any)._invokeLifecycleMethod(m, hostSet);\n }\n (this as any)._executeSwcScript('swc-on-disconnected', hostSet);\n (this as any)._executeSwcScript('swc-on-after-disconnected', hostSet);\n (this as any).__swc_connected = false;\n \n // Remove from appHost LAST when disconnected\n const appHost = hostSet.$appHost;\n if (appHost && typeof (appHost as any)._disconnected === 'function') {\n (appHost as any)._disconnected(this);\n }\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 if (bMethods) {\n for (const m of bMethods) (this as any)._invokeLifecycleMethod(m, hostSet);\n }\n\n if (originalAdopted) originalAdopted.apply(this);\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_ADOPTED_METADATA_KEY);\n if (aMethods) {\n for (const m of aMethods) (this as any)._invokeLifecycleMethod(m, hostSet);\n }\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 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 mKeys = attrChangeMap.get(name);\n if (mKeys && Array.isArray(mKeys)) {\n for (const key of mKeys) (this as any)[key](newVal, old, name, hSet);\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,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,mCAAmC;AAC5C,SAAS,4BAA4B,kCAAkC,iCAAiC,qCAAqC,oCAAoC,gCAAgC,+BAA+B,0BAA0B,uCAAuC;AACjT,SAAS,sCAAsC;AAC/C,SAAS,uCAAuC;AAChD,SAAS,qCAAqC;AAC9C,SAAS,gCAAgC;AACzC,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAAS,gBAAgB;AACzB,SAAS,kBAAkB,uBAAuB;AAClD,SAAS,wBAAwB,+BAA+B;AAChE,SAAS,2BAAoC;AAItC,MAAM,qBAAqB,OAAO,IAAI,qCAAqC;AAc3E,MAAM,mBAAmB,CAAC,WAA6C;AAC5E,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,oBAAoB,WAAW;AACjE;AAEO,MAAM,aAAa,CAAC,SAAc;AACvC,MAAI,CAAC,KAAK,mBAAmB;AAC3B,SAAK,SAAS,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,GAAG,EAAE;AACxD,SAAK,gBAAgB,oBAAI,IAAI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AC1C,MAAC,KAAa,oBAAoB,MAAaA,OAAM,QAAQ,oBAAoB,IAAI;AAAA,IACvF;AAEA,UAAM,QAAQ,cAAc,IAAIA,KAAI;AACpC,QAAI,SAAS,MAAM,QAAQ,KAAK,GAAG;AACjC,iBAAW,OAAO,MAAO,CAAC,KAAa,GAAG,EAAE,QAAQ,KAAKA,OAAM,IAAI;AAAA,IACrE;AAAA,EACF;AAEA,SAAO,eAAe,aAAa,sBAAsB;AAAA,IACvD,KAAK,MAAM;AAAA,IACX,cAAc;AAAA,EAChB,CAAC;AAED,eAAa,eAAe,oBAAoB,UAAU,WAAW;AACrE,QAAM,WAAW,SAAS,yBAA0B,KAAa;AACjE,MAAI,YAAY,CAAC,SAAS,IAAI,SAAS,IAAI,GAAG;AAC5C,aAAS,OAAO,SAAS,MAAM,aAAoB,SAAS,UAAU,EAAE,SAAS,SAAS,QAAQ,IAAI,MAAS;AAAA,EACjH;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { FunctionUtils } from '@dooboostore/core';\nimport { getAddEventListenerMetadata } from './addEventListener';\nimport { ON_INITIALIZE_METADATA_KEY, ON_BEFORE_CONNECTED_METADATA_KEY, ON_AFTER_CONNECTED_METADATA_KEY, ON_BEFORE_DISCONNECTED_METADATA_KEY, ON_AFTER_DISCONNECTED_METADATA_KEY, ON_BEFORE_ADOPTED_METADATA_KEY, ON_AFTER_ADOPTED_METADATA_KEY, findAllLifecycleMetadata, getOnConnectedInnerHtmlMetadata } from './lifecycles';\nimport { getEmitCustomEventMetadataList } from './emitCustomEvent';\nimport { findAllAttributeChangedMetadata } from './changedAttributeHost';\nimport { findAllAttributeApplyMetadata } from './applyAttribute';\nimport { findAllAttributeMetadata } from './attribute';\nimport { getQueryMetadata } from './query';\nimport { getQueryAllMetadata } from './queryAll';\nimport { SwcUtils } from '../utils/Utils';\nimport { HTML_TAG_ENTRIES, DOM_EVENT_NAMES } from '../config/config';\nimport { SituationTypeContainer, SituationTypeContainers } from '@dooboostore/simple-boot/decorators/inject/Inject';\nimport { InjectSituationType, HostSet } from '../types';\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}\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) => {\n if (!inst.__swc_initialized) {\n inst._swcId = Math.random().toString(36).substring(2, 11);\n inst._emitHandlers = new Map();\n inst._boundListeners = [];\n inst.__swc_initialized = true;\n\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: \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 @attributeHost('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 \n // @attribute \uD544\uB4DC\uC758 own property \uC0AD\uC81C \u2192 getter/setter \uC791\uB3D9\n const attributeList = findAllAttributeMetadata(target);\n attributeList.forEach(meta => {\n delete (inst as any)[meta.propertyKey];\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\n // Call constructor script if present\n const hostSet = SwcUtils.getHostSet(inst);\n const appHosts = SwcUtils.findAllParentAppHostsDirect(inst);\n inst._executeSwcScript?.('swc-on-constructor', hostSet);\n\n // Call @onInitialize lifecycle methods\n const cMethods = findAllLifecycleMetadata(inst, ON_INITIALIZE_METADATA_KEY);\n if (cMethods) {\n for (const m of cMethods) (inst)._invokeLifecycleMethod(m, hostSet);\n }\n }\n};\n\n// --- Global Event Handling ---\nconst globalDelegatedRoots = new WeakSet<Node>();\n\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.findNearestSwcHost(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 || ((typeof window !== 'undefined' ? window : undefined) as any);\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) => {\n if (proto.__swc_proto_setup) return;\n proto.__swc_proto_setup = true;\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.findAllSwcHosts(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 (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.getHostSet(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({ situationType: InjectSituationType.HOST, data: useHostSet.$host }), 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({ situationType: InjectSituationType.FIRST_APP_HOST, data: useHostSet.$firstAppHost }), new SituationTypeContainer({ situationType: InjectSituationType.LAST_APP_HOST, data: useHostSet.$lastAppHost })]);\n otherStorage.set(SituationTypeContainers, situations);\n\n return app.simstanceManager.executeBindParameterSimPromise(\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 parent = SwcUtils.findNearestSwcHost(el);\n const hostSet = SwcUtils.getHostSet(parent || 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 parent = SwcUtils.findNearestSwcHost(el);\n const hostSet = SwcUtils.getHostSet(parent || 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 === ':host' || 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 // Collect all observed attributes from all decorators\n const attributeApplyNames = Array.from(applyAttributeMap.values()).map(it => it.options.name).filter(Boolean) as string[];\n // const attributeListNames = attributeList.map(it => it.options.name || String(it.propertyKey));\n const hostAttributes = attributeList.filter(it => it.selector === ':host').map(it=>it.options.name || String(it.propertyKey));\n\n const mergedObservedAttributes = [...new Set([\n ...(metadata.observedAttributes ?? []),\n ...attrChangeMap.keys(),\n ...attributeApplyNames,\n ...hostAttributes,\n ...emitHostCustomEventList.map(it => (it.options as any).attributeName).filter(Boolean),\n ...swcLifecycleAttributes,\n ...swcOnEvents\n ])];\n\n const connectedInnerHtmlList = getOnConnectedInnerHtmlMetadata(constructor) || [];\n\n const proto = constructor.prototype;\n setupPrototype(proto);\n\n const originalConnected = proto.connectedCallback;\n proto.connectedCallback = function () {\n ensureInit(this);\n\n const hostSet = SwcUtils.getHostSet(this as any);\n const appHost = hostSet.$appHost;\n const conf = getElementConfig(this);\n const currentWin = (this as any)._resolveWindow(conf);\n\n if (connectedInnerHtmlList.some(it => it.options.useShadow === true) && !this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n\n (this as any)._executeSwcScript('swc-on-before-connected', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_CONNECTED_METADATA_KEY);\n if (bMethods) {\n for (const m of bMethods) (this as any)._invokeLifecycleMethod(m, hostSet);\n }\n\n if (connectedInnerHtmlList.length > 0) {\n let sContent = '',\n lContent = '';\n for (const meta of connectedInnerHtmlList) {\n const res = (this as any)[meta.propertyKey]();\n if (res !== undefined) {\n if (meta.options.useShadow) sContent += res;\n else lContent += res;\n }\n }\n if (this.shadowRoot) this.shadowRoot.innerHTML = sContent;\n if (lContent) this.innerHTML = lContent;\n }\n\n const root = this.getRootNode();\n if (!globalDelegatedRoots.has(root)) {\n DOM_EVENT_NAMES.forEach(type => {\n root.addEventListener(type, handleGlobalSwcEvent);\n });\n globalDelegatedRoots.add(root);\n }\n\n // Separate delegate and non-delegate listeners\n const delegateListeners: typeof addEventListenerList = [];\n const nonDelegateListeners: typeof addEventListenerList = [];\n \n addEventListenerList.forEach(meta => {\n if (meta.options.delegate && meta.selector !== ':window' && meta.selector !== ':document' && meta.selector !== ':parentHost' && meta.selector !== ':appHost' && meta.selector !== ':firstHost' && meta.selector !== ':lastHost' && meta.selector !== ':firstAppHost' && meta.selector !== ':lastAppHost' && meta.selector !== ':hosts' && meta.selector !== ':appHosts' && meta.selector !== ':host' && 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, 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 === ':parentHost') applyRootOption(hostSet.$parentHost);\n else if (selector === ':appHost') applyRootOption(hostSet.$appHost);\n else if (selector === ':firstHost') applyRootOption(hostSet.$firstHost);\n else if (selector === ':lastHost') applyRootOption(hostSet.$lastHost);\n else if (selector === ':firstAppHost') applyRootOption(hostSet.$firstAppHost);\n else if (selector === ':lastAppHost') applyRootOption(hostSet.$lastAppHost);\n else if (selector === ':hosts') hostSet.$hosts.forEach(applyRootOption);\n else if (selector === ':appHosts') hostSet.$appHosts.forEach(applyRootOption);\n else if (selector === ':host' || !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, 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, args);\n };\n t.addEventListener(type, handler, opts);\n if (options.removeOnDisconnected === true || t === currentWin || t === currentWin.document) {\n (this as any)._boundListeners.push({ target: t, type, handler, options: opts });\n }\n });\n });\n\n if (originalConnected) originalConnected.apply(this);\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_CONNECTED_METADATA_KEY);\n if (aMethods) {\n for (const m of aMethods) (this as any)._invokeLifecycleMethod(m, hostSet);\n }\n (this as any)._executeSwcScript('swc-on-connected', hostSet);\n (this as any)._executeSwcScript('swc-on-after-connected', hostSet);\n (this as any).__swc_connected = true;\n\n // Register to appHost LAST when all lifecycle completed\n // console.log('!!!!!!!!!!!!!!', this, appHost)\n const appHostss = SwcUtils.findAllParentAppHostsDirect(this)\n // const nAppHostSet = SwcUtils.getHostSet(this as any);\n if (appHost && typeof (appHost as any)._connected === 'function') {\n (appHost as any)._connected(this);\n } else if (appHost && typeof (appHost as any)) {\n (appHost as any)._connected_safari ??= [];\n (appHost as any)._connected_safari.push(this);\n }\n };\n\n const originalDisconnected = proto.disconnectedCallback;\n proto.disconnectedCallback = function () {\n const hostSet = SwcUtils.getHostSet(this as any);\n (this as any)._executeSwcScript('swc-on-before-disconnected', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_DISCONNECTED_METADATA_KEY);\n if (bMethods) {\n for (const m of bMethods) (this as any)._invokeLifecycleMethod(m, hostSet);\n }\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 if (originalDisconnected) originalDisconnected.apply(this);\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_DISCONNECTED_METADATA_KEY);\n if (aMethods) {\n for (const m of aMethods) (this as any)._invokeLifecycleMethod(m, hostSet);\n }\n (this as any)._executeSwcScript('swc-on-disconnected', hostSet);\n (this as any)._executeSwcScript('swc-on-after-disconnected', hostSet);\n (this as any).__swc_connected = false;\n \n // Remove from appHost LAST when disconnected\n const appHost = hostSet.$appHost;\n if (appHost && typeof (appHost as any)._disconnected === 'function') {\n (appHost as any)._disconnected(this);\n }\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 if (bMethods) {\n for (const m of bMethods) (this as any)._invokeLifecycleMethod(m, hostSet);\n }\n\n if (originalAdopted) originalAdopted.apply(this);\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_ADOPTED_METADATA_KEY);\n if (aMethods) {\n for (const m of aMethods) (this as any)._invokeLifecycleMethod(m, hostSet);\n }\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 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 mKeys = attrChangeMap.get(name);\n if (mKeys && Array.isArray(mKeys)) {\n for (const key of mKeys) (this as any)[key](newVal, old, name, hSet);\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,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,mCAAmC;AAC5C,SAAS,4BAA4B,kCAAkC,iCAAiC,qCAAqC,oCAAoC,gCAAgC,+BAA+B,0BAA0B,uCAAuC;AACjT,SAAS,sCAAsC;AAC/C,SAAS,uCAAuC;AAChD,SAAS,qCAAqC;AAC9C,SAAS,gCAAgC;AACzC,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAAS,gBAAgB;AACzB,SAAS,kBAAkB,uBAAuB;AAClD,SAAS,wBAAwB,+BAA+B;AAChE,SAAS,2BAAoC;AAItC,MAAM,qBAAqB,OAAO,IAAI,qCAAqC;AAc3E,MAAM,mBAAmB,CAAC,WAA6C;AAC5E,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,oBAAoB,WAAW;AACjE;AAEO,MAAM,aAAa,CAAC,SAAc;AACvC,MAAI,CAAC,KAAK,mBAAmB;AAC3B,SAAK,SAAS,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,GAAG,EAAE;AACxD,SAAK,g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SAASA,KAAI,GAAG;AACxE,UAAI,WAAW,MAAM;AACnB,cAAM,YAAYA,MAAK,UAAU,CAAC;AAClC,QAAC,KAAa,oBAAoB,MAAaA,OAAM,QAAQ,SAAS;AAAA,MACxE;AAAA,IACF;AAEA,UAAM,sBAAsB,wBAAwB,KAAK,QAAO,GAAG,QAAgB,kBAAkBA,KAAI;AACzG,QAAI,uBAAuB,WAAW,MAAM;AAC1C,MAAC,KAAa,oBAAoB,MAAaA,OAAM,QAAQ,oBAAoB,IAAI;AAAA,IACvF;AAEA,UAAM,QAAQ,cAAc,IAAIA,KAAI;AACpC,QAAI,SAAS,MAAM,QAAQ,KAAK,GAAG;AACjC,iBAAW,OAAO,MAAO,CAAC,KAAa,GAAG,EAAE,QAAQ,KAAKA,OAAM,IAAI;AAAA,IACrE;AAAA,EACF;AAEA,SAAO,eAAe,aAAa,sBAAsB;AAAA,IACvD,KAAK,MAAM;AAAA,IACX,cAAc;AAAA,EAChB,CAAC;AAED,eAAa,eAAe,oBAAoB,UAAU,WAAW;AACrE,QAAM,WAAW,SAAS,yBAA0B,KAAa;AACjE,MAAI,YAAY,CAAC,SAAS,IAAI,SAAS,IAAI,GAAG;AAC5C,aAAS,OAAO,SAAS,MAAM,aAAoB,SAAS,UAAU,EAAE,SAAS,SAAS,QAAQ,IAAI,MAAS;AAAA,EACjH;AACA,SAAO;AACT;",
6
6
  "names": ["proto", "name"]
7
7
  }
@@ -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 } 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}\n\nexport interface EmitCustomEventMetadata {\n propertyKey: string | symbol;\n selector: string;\n type: string;\n options: (EmitCustomEventBaseOptions & SwcQueryOptions) | (EmitCustomEventBaseOptions & SwcQueryOptions & { attributeName?: string });\n}\n\nexport const EMIT_CUSTOM_EVENT_METADATA_KEY = Symbol.for('simple-web-component:emit-custom-event');\nexport function emitCustomEvent(target: SpecialSelector, type: string, options?: EmitCustomEventBaseOptions): MethodDecorator;\nexport function emitCustomEvent(selector: string, type: string, options?: EmitCustomEventBaseOptions & SwcQueryOptions): 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 = async function (...args: any[]) {\n ensureInit(this);\n const detail = await original.apply(this, args);\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 === ':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 === ':host' || !selectorOrTarget) 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 => t.dispatchEvent(event));\n return detail;\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/**\n * @emitCustomEventHost decorator - simplified version of @emitCustomEvent for :host selector\n * Usage: @emitCustomEventHost('navigate') // default attributeName: 'on-emit-navigate'\n * Usage: @emitCustomEventHost('navigate', { attributeName: 'on-navigate' })\n * \n * The attributeName option is used to automatically observe attributes for this event.\n * For example, { attributeName: 'on-navigate' } will add 'on-navigate' to observedAttributes.\n */\nexport function emitCustomEventHost(type: string, options: EmitCustomEventBaseOptions & SwcQueryOptions & { attributeName?: string } = {}): MethodDecorator {\n if (!options.attributeName) {\n options.attributeName = `on-emit-${type}`;\n }\n return emitCustomEvent(':host', type, options);\n}\n"],
5
- "mappings": "AAAA,SAAS,oBAAoB;AAE7B,SAAS,YAAY,wBAAwB;AAC7C,SAAS,gBAAgB;AAelB,MAAM,iCAAiC,OAAO,IAAI,wCAAwC;AAM1F,SAAS,gBAAgB,kBAA0B,MAAc,UAAe,CAAC,GAAoB;AAC1G,SAAO,CAAC,WAAmB,aAA8B,eAAmC;AAC1F,UAAM,cAAc,UAAU;AAE9B,UAAM,cAAmB,EAAE,GAAG,SAAS,KAAK;AAE5C,QAAI,YAAY,YAAY,OAAW,aAAY,UAAU;AAC7D,QAAI,YAAY,aAAa,OAAW,aAAY,WAAW;AAE/D,QAAI,OAAO,aAAa,YAAuC,gCAAgC,WAAW;AAC1G,QAAI,CAAC,MAAM;AACT,aAAO,CAAC;AACR,mBAAa,eAAe,gCAAgC,MAAM,WAAW;AAAA,IAC/E;AACA,SAAK,KAAK,EAAE,aAAa,UAAU,kBAAkB,MAAM,SAAS,YAAY,CAAC;AAEjF,UAAM,WAAW,WAAW;AAC5B,eAAW,QAAQ,kBAAmB,MAAa;AACjD,iBAAW,IAAI;AACf,YAAM,SAAS,MAAM,SAAS,MAAM,MAAM,IAAI;AAC9C,YAAM,QAAQ,IAAI,YAAY,MAAM;AAAA,QAClC;AAAA,QACA,SAAS,YAAY;AAAA,QACrB,UAAU,YAAY;AAAA,QACtB,YAAY,YAAY;AAAA,MAC1B,CAAC;AAED,YAAM,UAAU,SAAS,WAAW,IAAW;AAC/C,YAAM,OAAO,iBAAiB,IAAI;AAClC,YAAM,aAAc,KAAa,iBAAiB,IAAI,MAAO,OAAO,WAAW,cAAc,SAAS;AAEtG,YAAM,eAA8B,CAAC;AACrC,UAAI,qBAAqB,UAAW,cAAa,KAAK,UAAU;AAAA,eACvD,qBAAqB,Y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,QAC3E,CAAC;AAAA,MACH;AAEA,mBAAa,QAAQ,OAAK,EAAE,cAAc,KAAK,CAAC;AAChD,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEO,MAAM,iCAAiC,CAAC,WAAuD;AACpG,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,gCAAgC,WAAW;AAC7E;AAUO,SAAS,oBAAoB,MAAc,UAAqF,CAAC,GAAoB;AAC1J,MAAI,CAAC,QAAQ,eAAe;AAC1B,YAAQ,gBAAgB,WAAW,IAAI;AAAA,EACzC;AACA,SAAO,gBAAgB,SAAS,MAAM,OAAO;AAC/C;",
4
+ "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { SpecialSelector, SwcQueryOptions } 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}\n\nexport interface EmitCustomEventMetadata {\n propertyKey: string | symbol;\n selector: string;\n type: string;\n options: (EmitCustomEventBaseOptions & SwcQueryOptions) | (EmitCustomEventBaseOptions & SwcQueryOptions & { attributeName?: string });\n}\n\nexport const EMIT_CUSTOM_EVENT_METADATA_KEY = Symbol.for('simple-web-component:emit-custom-event');\nexport function emitCustomEvent(target: SpecialSelector, type: string, options?: EmitCustomEventBaseOptions): MethodDecorator;\nexport function emitCustomEvent(selector: string, type: string, options?: EmitCustomEventBaseOptions & SwcQueryOptions): 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 = async function (...args: any[]) {\n ensureInit(this);\n const detail = await original.apply(this, args);\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 // console.log('emitEEEEEEEEEEE', hostSet);\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 === ':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 === ':host' || !selectorOrTarget) 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 => t.dispatchEvent(event));\n return detail;\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/**\n * @emitCustomEventHost decorator - simplified version of @emitCustomEvent for :host selector\n * Usage: @emitCustomEventHost('navigate') // default attributeName: 'on-emit-navigate'\n * Usage: @emitCustomEventHost('navigate', { attributeName: 'on-navigate' })\n * \n * The attributeName option is used to automatically observe attributes for this event.\n * For example, { attributeName: 'on-navigate' } will add 'on-navigate' to observedAttributes.\n */\nexport function emitCustomEventHost(type: string, options: EmitCustomEventBaseOptions & SwcQueryOptions & { attributeName?: string } = {}): MethodDecorator {\n if (!options.attributeName) {\n options.attributeName = `on-emit-${type}`;\n }\n return emitCustomEvent(':host', type, options);\n}\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAE7B,SAAS,YAAY,wBAAwB;AAC7C,SAAS,gBAAgB;AAelB,MAAM,iCAAiC,OAAO,IAAI,wCAAwC;AAM1F,SAAS,gBAAgB,kBAA0B,MAAc,UAAe,CAAC,GAAoB;AAC1G,SAAO,CAAC,WAAmB,aAA8B,eAAmC;AAC1F,UAAM,cAAc,UAAU;AAE9B,UAAM,cAAmB,EAAE,GAAG,SAAS,KAAK;AAE5C,QAAI,YAAY,YAAY,OAAW,aAAY,UAAU;AAC7D,QAAI,YAAY,aAAa,OAAW,aAAY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from "./applyAttribute.js";
13
+ export * from "./setProperty.js";
13
14
  export * from "./subscribeSwcAppRouteChange.js";
14
15
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/index.ts"],
4
- "sourcesContent": ["export * from './addEventListener';\nexport * from './attribute';\nexport * from './elementDefine';\nexport * from './changedAttributeHost';\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 './subscribeSwcAppRouteChange';\n"],
5
- "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
4
+ "sourcesContent": ["export * from './addEventListener';\nexport * from './attribute';\nexport * from './elementDefine';\nexport * from './changedAttributeHost';\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 './setProperty';\nexport * from './subscribeSwcAppRouteChange';\n"],
5
+ "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
6
  "names": []
7
7
  }
@@ -7,6 +7,7 @@ const ON_AFTER_DISCONNECTED_METADATA_KEY = Symbol.for("simple-web-component:on-a
7
7
  const ON_BEFORE_ADOPTED_METADATA_KEY = Symbol.for("simple-web-component:on-before-adopted");
8
8
  const ON_AFTER_ADOPTED_METADATA_KEY = Symbol.for("simple-web-component:on-after-adopted");
9
9
  const ON_ADD_EVENT_LISTENER_METADATA_KEY = Symbol.for("simple-web-component:on-add-event-listener");
10
+ const ON_CONNECTED_SWC_APP_METADATA_KEY = Symbol.for("simple-web-component:on-connected-swc-app");
10
11
  const INNER_HTML_METADATA_KEY = Symbol.for("simple-web-component:inner-html");
11
12
  const ATTRIBUTE_CHANGED_WILDCARD = "*";
12
13
  function createLifecycleDecorator(metadataKey) {
@@ -31,6 +32,7 @@ const onBeforeAdopted = createLifecycleDecorator(ON_BEFORE_ADOPTED_METADATA_KEY)
31
32
  const onAfterAdopted = createLifecycleDecorator(ON_AFTER_ADOPTED_METADATA_KEY);
32
33
  const onAdopted = onAfterAdopted;
33
34
  const onAddEventListener = createLifecycleDecorator(ON_ADD_EVENT_LISTENER_METADATA_KEY);
35
+ const onConnectedSwcApp = createLifecycleDecorator(ON_CONNECTED_SWC_APP_METADATA_KEY);
34
36
  function onConnectedInnerHtml(arg1, arg2, arg3) {
35
37
  const decorator = (options, target, propertyKey) => {
36
38
  const constructor = target.constructor;
@@ -66,6 +68,7 @@ export {
66
68
  ON_BEFORE_ADOPTED_METADATA_KEY,
67
69
  ON_BEFORE_CONNECTED_METADATA_KEY,
68
70
  ON_BEFORE_DISCONNECTED_METADATA_KEY,
71
+ ON_CONNECTED_SWC_APP_METADATA_KEY,
69
72
  ON_INITIALIZE_METADATA_KEY,
70
73
  findAllLifecycleMetadata,
71
74
  getOnConnectedInnerHtmlMetadata,
@@ -79,6 +82,7 @@ export {
79
82
  onBeforeDisconnected,
80
83
  onConnected,
81
84
  onConnectedInnerHtml,
85
+ onConnectedSwcApp,
82
86
  onDisconnected,
83
87
  onInitialize
84
88
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/lifecycles.ts"],
4
- "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\n\nexport const ON_INITIALIZE_METADATA_KEY = Symbol.for('simple-web-component:on-constructor');\nexport const ON_BEFORE_CONNECTED_METADATA_KEY = Symbol.for('simple-web-component:on-before-connected');\nexport const ON_AFTER_CONNECTED_METADATA_KEY = Symbol.for('simple-web-component:on-after-connected');\nexport const ON_BEFORE_DISCONNECTED_METADATA_KEY = Symbol.for('simple-web-component:on-before-disconnected');\nexport const ON_AFTER_DISCONNECTED_METADATA_KEY = Symbol.for('simple-web-component:on-after-disconnected');\nexport const ON_BEFORE_ADOPTED_METADATA_KEY = Symbol.for('simple-web-component:on-before-adopted');\nexport const ON_AFTER_ADOPTED_METADATA_KEY = Symbol.for('simple-web-component:on-after-adopted');\nexport const ON_ADD_EVENT_LISTENER_METADATA_KEY = Symbol.for('simple-web-component:on-add-event-listener');\nexport const INNER_HTML_METADATA_KEY = Symbol.for('simple-web-component:inner-html');\n\nexport const ATTRIBUTE_CHANGED_WILDCARD = '*';\n\nexport interface InnerHtmlOptions {\n useShadow?: boolean;\n}\n\nexport interface InnerHtmlMetadata {\n propertyKey: string | symbol;\n options: InnerHtmlOptions;\n}\n\nfunction createLifecycleDecorator(metadataKey: symbol): MethodDecorator {\n return (target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(metadataKey, constructor) as (string | symbol)[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(metadataKey, list, constructor);\n }\n list.push(propertyKey);\n };\n}\n\nexport const onInitialize = createLifecycleDecorator(ON_INITIALIZE_METADATA_KEY);\nexport const onBeforeConnected = createLifecycleDecorator(ON_BEFORE_CONNECTED_METADATA_KEY);\nexport const onAfterConnected = createLifecycleDecorator(ON_AFTER_CONNECTED_METADATA_KEY);\nexport const onConnected = onAfterConnected;\n\nexport const onBeforeDisconnected = createLifecycleDecorator(ON_BEFORE_DISCONNECTED_METADATA_KEY);\nexport const onAfterDisconnected = createLifecycleDecorator(ON_AFTER_DISCONNECTED_METADATA_KEY);\nexport const onDisconnected = onAfterDisconnected;\n\nexport const onBeforeAdopted = createLifecycleDecorator(ON_BEFORE_ADOPTED_METADATA_KEY);\nexport const onAfterAdopted = createLifecycleDecorator(ON_AFTER_ADOPTED_METADATA_KEY);\nexport const onAdopted = onAfterAdopted;\n\nexport const onAddEventListener = createLifecycleDecorator(ON_ADD_EVENT_LISTENER_METADATA_KEY);\n\n/**\n * @onConnectedInnerHtml decorator to define the initial HTML content when connected.\n */\nexport function onConnectedInnerHtml(options: InnerHtmlOptions): MethodDecorator;\nexport function onConnectedInnerHtml(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onConnectedInnerHtml(arg1?: InnerHtmlOptions | Object, arg2?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n const decorator = (options: InnerHtmlOptions, target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getMetadata<InnerHtmlMetadata[]>(INNER_HTML_METADATA_KEY, constructor);\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(INNER_HTML_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, options });\n };\n\n if (arg2) {\n return decorator({}, arg1!, arg2);\n }\n\n return (target: Object, propertyKey: string | symbol) => {\n decorator((arg1 as InnerHtmlOptions) || {}, target, propertyKey);\n };\n}\n\n/**\n * \uD504\uB85C\uD1A0\uD0C0\uC785 \uCCB4\uC778\uC744 \uC21C\uD68C\uD558\uBA70 \uBAA8\uB4E0 \uB77C\uC774\uD504\uC0AC\uC774\uD074 \uBA54\uC11C\uB4DC\uB97C \uC218\uC9D1\uD569\uB2C8\uB2E4.\n */\nexport const findAllLifecycleMetadata = <T = (string | symbol)[]>(target: any, metadataKey: symbol): T | undefined => {\n const results = ReflectUtils.findAllMetadataFlatten(metadataKey, target);\n return results.length > 0 ? (results as unknown as T) : undefined;\n};\n\nexport const getOnConnectedInnerHtmlMetadata = (target: any): InnerHtmlMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(INNER_HTML_METADATA_KEY, constructor);\n};\n"],
5
- "mappings": "AAAA,SAAS,oBAAoB;AAEtB,MAAM,6BAA6B,OAAO,IAA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IACxE;AACA,SAAK,KAAK,EAAE,aAAa,QAAQ,CAAC;AAAA,EACpC;AAEA,MAAI,MAAM;AACR,WAAO,UAAU,CAAC,GAAG,MAAO,IAAI;AAAA,EAClC;AAEA,SAAO,CAAC,QAAgB,gBAAiC;AACvD,cAAW,QAA6B,CAAC,GAAG,QAAQ,WAAW;AAAA,EACjE;AACF;AAKO,MAAM,2BAA2B,CAA0B,QAAa,gBAAuC;AACpH,QAAM,UAAU,aAAa,uBAAuB,aAAa,MAAM;AACvE,SAAO,QAAQ,SAAS,IAAK,UAA2B;AAC1D;AAEO,MAAM,kCAAkC,CAAC,WAAiD;AAC/F,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,yBAAyB,WAAW;AACtE;",
4
+ "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\n\nexport const ON_INITIALIZE_METADATA_KEY = Symbol.for('simple-web-component:on-constructor');\nexport const ON_BEFORE_CONNECTED_METADATA_KEY = Symbol.for('simple-web-component:on-before-connected');\nexport const ON_AFTER_CONNECTED_METADATA_KEY = Symbol.for('simple-web-component:on-after-connected');\nexport const ON_BEFORE_DISCONNECTED_METADATA_KEY = Symbol.for('simple-web-component:on-before-disconnected');\nexport const ON_AFTER_DISCONNECTED_METADATA_KEY = Symbol.for('simple-web-component:on-after-disconnected');\nexport const ON_BEFORE_ADOPTED_METADATA_KEY = Symbol.for('simple-web-component:on-before-adopted');\nexport const ON_AFTER_ADOPTED_METADATA_KEY = Symbol.for('simple-web-component:on-after-adopted');\nexport const ON_ADD_EVENT_LISTENER_METADATA_KEY = Symbol.for('simple-web-component:on-add-event-listener');\nexport const ON_CONNECTED_SWC_APP_METADATA_KEY = Symbol.for('simple-web-component:on-connected-swc-app');\nexport const INNER_HTML_METADATA_KEY = Symbol.for('simple-web-component:inner-html');\n\nexport const ATTRIBUTE_CHANGED_WILDCARD = '*';\n\nexport interface InnerHtmlOptions {\n useShadow?: boolean;\n}\n\nexport interface InnerHtmlMetadata {\n propertyKey: string | symbol;\n options: InnerHtmlOptions;\n}\n\nfunction createLifecycleDecorator(metadataKey: symbol): MethodDecorator {\n return (target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(metadataKey, constructor) as (string | symbol)[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(metadataKey, list, constructor);\n }\n list.push(propertyKey);\n };\n}\n\nexport const onInitialize = createLifecycleDecorator(ON_INITIALIZE_METADATA_KEY);\nexport const onBeforeConnected = createLifecycleDecorator(ON_BEFORE_CONNECTED_METADATA_KEY);\nexport const onAfterConnected = createLifecycleDecorator(ON_AFTER_CONNECTED_METADATA_KEY);\nexport const onConnected = onAfterConnected;\n\nexport const onBeforeDisconnected = createLifecycleDecorator(ON_BEFORE_DISCONNECTED_METADATA_KEY);\nexport const onAfterDisconnected = createLifecycleDecorator(ON_AFTER_DISCONNECTED_METADATA_KEY);\nexport const onDisconnected = onAfterDisconnected;\n\nexport const onBeforeAdopted = createLifecycleDecorator(ON_BEFORE_ADOPTED_METADATA_KEY);\nexport const onAfterAdopted = createLifecycleDecorator(ON_AFTER_ADOPTED_METADATA_KEY);\nexport const onAdopted = onAfterAdopted;\n\nexport const onAddEventListener = createLifecycleDecorator(ON_ADD_EVENT_LISTENER_METADATA_KEY);\n\nexport const onConnectedSwcApp = createLifecycleDecorator(ON_CONNECTED_SWC_APP_METADATA_KEY);\n\n/**\n * @onConnectedInnerHtml decorator to define the initial HTML content when connected.\n */\nexport function onConnectedInnerHtml(options: InnerHtmlOptions): MethodDecorator;\nexport function onConnectedInnerHtml(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onConnectedInnerHtml(arg1?: InnerHtmlOptions | Object, arg2?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n const decorator = (options: InnerHtmlOptions, target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getMetadata<InnerHtmlMetadata[]>(INNER_HTML_METADATA_KEY, constructor);\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(INNER_HTML_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, options });\n };\n\n if (arg2) {\n return decorator({}, arg1!, arg2);\n }\n\n return (target: Object, propertyKey: string | symbol) => {\n decorator((arg1 as InnerHtmlOptions) || {}, target, propertyKey);\n };\n}\n\n/**\n * \uD504\uB85C\uD1A0\uD0C0\uC785 \uCCB4\uC778\uC744 \uC21C\uD68C\uD558\uBA70 \uBAA8\uB4E0 \uB77C\uC774\uD504\uC0AC\uC774\uD074 \uBA54\uC11C\uB4DC\uB97C \uC218\uC9D1\uD569\uB2C8\uB2E4.\n */\nexport const findAllLifecycleMetadata = <T = (string | symbol)[]>(target: any, metadataKey: symbol): T | undefined => {\n const results = ReflectUtils.findAllMetadataFlatten(metadataKey, target);\n return results.length > 0 ? (results as unknown as T) : undefined;\n};\n\nexport const getOnConnectedInnerHtmlMetadata = (target: any): InnerHtmlMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(INNER_HTML_METADATA_KEY, constructor);\n};\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAEtB,MAAM,6BAA6B,OAAO,IAAI,qCAAqC;AACnF,MAAM,mCAAmC,OAAO,IAAI,0CAA0C;AAC9F,MAAM,kCAAkC,OAAO,IAAI,yCAAyC;AAC5F,MAAM,sCAAsC,OAAO,IAAI,6CAA6C;AACpG,MAAM,qCAAqC,OAAO,IAAI,4CAA4C;AAClG,MAAM,iCAAiC,OAAO,IAAI,wCAAwC;AAC1F,MAAM,gCAAgC,OAAO,IAAI,uCAAuC;AACxF,MAAM,qCAAqC,OAAO,IAAI,4CAA4C;AAClG,MAAM,oCAAoC,OAAO,IAAI,2CAA2C;AAChG,MAAM,0BAA0B,OAAO,IAAI,iCAAiC;AAE5E,MAAM,6BAA6B;AAW1C,SAAS,yBAAyB,aAAsC;AACtE,SAAO,CAAC,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CAAkC,CAAC,WAAiD;AAC/F,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,yBAAyB,WAAW;AACtE;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,78 @@
1
+ import { ReflectUtils } from "@dooboostore/core";
2
+ import { ensureInit } from "./elementDefine.js";
3
+ import { SwcUtils } from "../utils/Utils.js";
4
+ const PROPERTY_SET_METADATA_KEY = Symbol.for("simple-web-component:property-set");
5
+ const setProperty = (selector, propertyNameOrOptions, options = {}) => {
6
+ return (target, propertyKey, descriptor) => {
7
+ const constructor = target.constructor;
8
+ let metaList = ReflectUtils.getOwnMetadata(PROPERTY_SET_METADATA_KEY, constructor);
9
+ if (!metaList) {
10
+ metaList = /* @__PURE__ */ new Map();
11
+ ReflectUtils.defineMetadata(PROPERTY_SET_METADATA_KEY, metaList, constructor);
12
+ }
13
+ let propertyName = typeof propertyNameOrOptions === "string" ? propertyNameOrOptions : void 0;
14
+ let finalOptions = options;
15
+ if (typeof propertyNameOrOptions === "object" && propertyNameOrOptions !== null) {
16
+ finalOptions = propertyNameOrOptions;
17
+ }
18
+ metaList.set(propertyKey, {
19
+ propertyKey,
20
+ selector,
21
+ options: { ...finalOptions, name: propertyName }
22
+ });
23
+ const original = descriptor.value;
24
+ descriptor.value = async function(...args) {
25
+ ensureInit(this);
26
+ const res = await original.apply(this, args);
27
+ if (res !== void 0) {
28
+ const win = this.ownerDocument?.defaultView || window;
29
+ const host = this;
30
+ const hostSet = { ...SwcUtils.getHelperAndHostSet(win, host), $this: this };
31
+ const r = finalOptions.root || "auto";
32
+ const targetEls = [];
33
+ const applyRoot = (t) => {
34
+ if (!t || !(t instanceof win.HTMLElement)) return;
35
+ targetEls.push(t);
36
+ };
37
+ if (selector === ":parentHost") applyRoot(hostSet.$parentHost);
38
+ else if (selector === ":appHost") applyRoot(hostSet.$appHost);
39
+ else if (selector === ":firstHost") applyRoot(hostSet.$firstHost);
40
+ else if (selector === ":lastHost") applyRoot(hostSet.$lastHost);
41
+ else if (selector === ":firstAppHost") applyRoot(hostSet.$firstAppHost);
42
+ else if (selector === ":lastAppHost") applyRoot(hostSet.$lastAppHost);
43
+ else if (selector === ":hosts") hostSet.$hosts.forEach(applyRoot);
44
+ else if (selector === ":appHosts") hostSet.$appHosts.forEach(applyRoot);
45
+ else if (selector === ":host" || !selector) applyRoot(host);
46
+ else {
47
+ const targetRoot = r === "auto" ? host.shadowRoot || host : r === "shadow" ? host.shadowRoot : host;
48
+ if (targetRoot) {
49
+ const found = targetRoot.querySelectorAll(selector);
50
+ if (found) targetEls.push(...Array.from(found));
51
+ }
52
+ }
53
+ targetEls.forEach((targetEl) => {
54
+ const resolvedRes = typeof res === "function" ? res(targetEl, hostSet) : res;
55
+ if (propertyName) {
56
+ targetEl[propertyName] = resolvedRes;
57
+ } else if (typeof resolvedRes === "object" && resolvedRes !== null && !Array.isArray(resolvedRes)) {
58
+ Object.entries(resolvedRes).forEach(([prop, val]) => {
59
+ const finalVal = typeof val === "function" ? val(targetEl, hostSet) : val;
60
+ targetEl[prop] = finalVal;
61
+ });
62
+ } else {
63
+ targetEl.value = resolvedRes;
64
+ }
65
+ });
66
+ }
67
+ };
68
+ };
69
+ };
70
+ const setPropertyHost = (propertyNameOrOptions, options = {}) => {
71
+ return setProperty(":host", propertyNameOrOptions, options);
72
+ };
73
+ export {
74
+ PROPERTY_SET_METADATA_KEY,
75
+ setProperty,
76
+ setPropertyHost
77
+ };
78
+ //# sourceMappingURL=setProperty.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/decorators/setProperty.ts"],
4
+ "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { SwcQueryOptions } from '../types';\n\nexport interface PropertySetOptions extends SwcQueryOptions {\n name?: string;\n}\n\nexport interface PropertySetMetadata {\n propertyKey: string | symbol;\n selector: string;\n options: PropertySetOptions;\n}\n\nexport const PROPERTY_SET_METADATA_KEY = Symbol.for('simple-web-component:property-set');\n\nexport const setProperty = (selector: string, propertyNameOrOptions?: string | PropertySetOptions, options: PropertySetOptions = {}): MethodDecorator => {\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = target.constructor;\n let metaList = ReflectUtils.getOwnMetadata(PROPERTY_SET_METADATA_KEY, constructor) as Map<string | symbol, PropertySetMetadata>;\n if (!metaList) {\n metaList = new Map<string | symbol, PropertySetMetadata>();\n ReflectUtils.defineMetadata(PROPERTY_SET_METADATA_KEY, metaList, constructor);\n }\n\n let propertyName = typeof propertyNameOrOptions === 'string' ? propertyNameOrOptions : undefined;\n let finalOptions = options;\n \n if (typeof propertyNameOrOptions === 'object' && propertyNameOrOptions !== null) {\n finalOptions = propertyNameOrOptions as PropertySetOptions;\n }\n\n metaList.set(propertyKey, { \n propertyKey, \n selector, \n options: { ...finalOptions, name: propertyName } \n });\n\n const original = descriptor.value;\n descriptor.value = async function (...args: any[]) {\n ensureInit(this);\n const res = await (original as any).apply(this, args);\n if (res !== undefined) {\n const win = (this as any).ownerDocument?.defaultView || window;\n const host = this as unknown as HTMLElement;\n const hostSet = { ...SwcUtils.getHelperAndHostSet(win, host), $this: this };\n const r = finalOptions.root || 'auto';\n const targetEls: HTMLElement[] = [];\n\n const applyRoot = (t: any) => {\n if (!t || !(t instanceof win.HTMLElement)) return;\n targetEls.push(t);\n };\n\n if (selector === ':parentHost') applyRoot(hostSet.$parentHost);\n else if (selector === ':appHost') applyRoot(hostSet.$appHost);\n else if (selector === ':firstHost') applyRoot(hostSet.$firstHost);\n else if (selector === ':lastHost') applyRoot(hostSet.$lastHost);\n else if (selector === ':firstAppHost') applyRoot(hostSet.$firstAppHost);\n else if (selector === ':lastAppHost') applyRoot(hostSet.$lastAppHost);\n else if (selector === ':hosts') hostSet.$hosts.forEach(applyRoot);\n else if (selector === ':appHosts') hostSet.$appHosts.forEach(applyRoot);\n else if (selector === ':host' || !selector) applyRoot(host);\n else {\n const targetRoot = r === 'auto' ? (host.shadowRoot || host) : (r === 'shadow' ? host.shadowRoot : host);\n if (targetRoot) {\n const found = targetRoot.querySelectorAll(selector);\n if (found) targetEls.push(...(Array.from(found) as HTMLElement[]));\n }\n }\n\n targetEls.forEach(targetEl => {\n const resolvedRes = typeof res === 'function' ? (res as any)(targetEl, hostSet) : res;\n\n if (propertyName) {\n // Case: @setProperty(selector, 'propertyName')\n (targetEl as any)[propertyName] = resolvedRes;\n } else if (typeof resolvedRes === 'object' && resolvedRes !== null && !Array.isArray(resolvedRes)) {\n // Case: @setProperty(selector) with Object return - assign multiple properties\n Object.entries(resolvedRes as any).forEach(([prop, val]) => {\n const finalVal = typeof val === 'function' ? val(targetEl, hostSet) : val;\n (targetEl as any)[prop] = finalVal;\n });\n } else {\n // Simple value - assign to 'value' property by default\n (targetEl as any).value = resolvedRes;\n }\n });\n }\n };\n };\n};\n\nexport const setPropertyHost = (propertyNameOrOptions?: string | PropertySetOptions, options: PropertySetOptions = {}): MethodDecorator => {\n return setProperty(':host', propertyNameOrOptions, options);\n};\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AAalB,MAAM,4BAA4B,OAAO,IAAI,mCAAmC;AAEhF,MAAM,cAAc,CAAC,UAAkB,uBAAqD,UAA8B,CAAC,MAAuB;AACvJ,SAAO,CAAC,QAAgB,aAA8B,eAAmC;AACvF,UAAM,cAAc,OAAO;AAC3B,QAAI,WAAW,aAAa,eAAe,2BAA2B,WAAW;AACjF,QAAI,CAAC,UAAU;AACb,iBAAW,oBAAI,IAA0C;AACzD,mBAAa,eAAe,2BAA2B,UAAU,WAAW;AAAA,IAC9E;AAEA,QAAI,eAAe,OAAO,0BAA0B,WAAW,wBAAwB;AACvF,QAAI,eAAe;AAEnB,QAAI,OAAO,0BAA0B,YAAY,0BAA0B,MAAM;AAC/E,qBAAe;AAAA,IACjB;A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U,QAAQ,cAAY;AAC5B,gBAAM,cAAc,OAAO,QAAQ,aAAc,IAAY,UAAU,OAAO,IAAI;AAElF,cAAI,cAAc;AAEhB,YAAC,SAAiB,YAAY,IAAI;AAAA,UACpC,WAAW,OAAO,gBAAgB,YAAY,gBAAgB,QAAQ,CAAC,MAAM,QAAQ,WAAW,GAAG;AAEjG,mBAAO,QAAQ,WAAkB,EAAE,QAAQ,CAAC,CAAC,MAAM,GAAG,MAAM;AAC1D,oBAAM,WAAW,OAAO,QAAQ,aAAa,IAAI,UAAU,OAAO,IAAI;AACtE,cAAC,SAAiB,IAAI,IAAI;AAAA,YAC5B,CAAC;AAAA,UACH,OAAO;AAEL,YAAC,SAAiB,QAAQ;AAAA,UAC5B;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;AAEO,MAAM,kBAAkB,CAAC,uBAAqD,UAA8B,CAAC,MAAuB;AACzI,SAAO,YAAY,SAAS,uBAAuB,OAAO;AAC5D;",
6
+ "names": []
7
+ }
@@ -15,11 +15,11 @@ class SwcAppEngine {
15
15
  try {
16
16
  this._config = config;
17
17
  if (this._config.routeType === "path") {
18
- this.router = new PathRouter({ window: this._config.window, firstUrl: this._config.path });
18
+ this.router = new PathRouter({ window: this._config.window });
19
19
  } else if (this._config.routeType === "hash") {
20
- this.router = new HashRouter({ window: this._config.window, firstUrl: this._config.path });
20
+ this.router = new HashRouter({ window: this._config.window });
21
21
  } else if (this._config.routeType === "element") {
22
- this.router = new ElementRouter({ window: this._config.window, firstUrl: this._config.path });
22
+ this.router = new ElementRouter({ window: this._config.window });
23
23
  }
24
24
  const containerSymbol = this._config.container || this.host.getContainerSymbol?.();
25
25
  this.simpleApplication = new SimpleApplication(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/elements/SwcAppEngine.ts"],
4
- "sourcesContent": ["import { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { PathRouter } from '@dooboostore/core-web';\nimport { HashRouter } from '@dooboostore/core-web';\nimport { ElementRouter } from '../router/ElementRouter';\nimport { SimOption } from '@dooboostore/simple-boot/SimOption';\nimport { Router, RouterEventType } from '@dooboostore/core-web';\nimport { Subscription } from '@dooboostore/core';\nimport { ConstructorType, OptionalType } from '@dooboostore/core';\nimport { FunctionUtils } from '@dooboostore/core';\nimport { SwcUtils } from '../utils/Utils';\n\nimport { SwcAppInterface } from '../types';\nimport {Intent} from \"@dooboostore/simple-boot\";\n\nexport type SwcConfigType = {\n routeType: 'path' | 'hash' | 'element';\n connectMode?: 'direct' | 'swap';\n container?: symbol;\n path?: string;\n window: Window;\n onEngineStarted?: (sp: SimpleApplication, app: SwcAppInterface) => void;\n onConnected?: (app: SwcAppInterface) => void;\n onDisconnected?: (app: SwcAppInterface) => void;\n};\n\nexport type SwcAttributeConfigType = OptionalType<SwcConfigType, 'routeType' | 'window'>;\n\nexport class SwcAppEngine {\n public simpleApplication?: SimpleApplication;\n public router?: Router;\n private routerSubscription?: Subscription;\n private _config?: SwcConfigType;\n\n constructor(private host: HTMLElement) {}\n\n get config() {\n return this._config;\n }\n async connect(config: SwcConfigType) {\n try {\n this._config = config;\n\n // Router Selection\n if (this._config.routeType === 'path') {\n this.router = new PathRouter({ window: this._config.window, firstUrl: this._config.path });\n } else if (this._config.routeType === 'hash') {\n this.router = new HashRouter({ window: this._config.window, firstUrl: this._config.path });\n } else if (this._config.routeType === 'element') {\n this.router = new ElementRouter({ window: this._config.window, firstUrl: this._config.path });\n }\n\n // console.log('vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv', this.router)\n\n // App start\n const containerSymbol = this._config.container || (this.host as any).getContainerSymbol?.();\n this.simpleApplication = new SimpleApplication(\n new SimOption({\n excludeProxys: [Node],\n container: containerSymbol\n })\n );\n\n const otherInstanceSim = new Map<any, any>();\n if (this.router) otherInstanceSim.set(Router, this.router);\n this.simpleApplication.run(otherInstanceSim);\n\n if (this._config.onEngineStarted) {\n this._config.onEngineStarted(this.simpleApplication, this.host as unknown as SwcAppInterface);\n }\n } catch (e) {\n console.error('[SWC-APP-ENGINE] Init failed:', e);\n }\n }\n\n disconnect() {\n this.routerSubscription?.unsubscribe();\n }\n}\n"],
5
- "mappings": "AAAA,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAC1B,SAAS,cAA+B;AAsBjC,MAAM,aAAa;AAAA,EAMxB,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA,EAExC,IAAI,SAAS;AACX,WAAO,KAAK;AAAA,EACd;AAAA,EACA,MAAM,QAAQ,QAAuB;AACnC,QAAI;AACF,WAAK,UAAU;AAGf,UAAI,KAAK,QAAQ,cAAc,QAAQ;AACrC,aAAK,SAAS,IAAI,WAAW,EAAE,QAAQ,KAAK,QAAQ,QAAQ,UAAU,KAAK,QAAQ,KAAK,CAAC;AAAA,MAC3F,WAAW,KAAK,QAAQ,cAAc,QAAQ;AAC5C,aAAK,SAAS,IAAI,WAAW,EAAE,QAAQ,KAAK,QAAQ,QAAQ,UAAU,KAAK,QAAQ,KAAK,CAAC;AAAA,MAC3F,WAAW,KAAK,QAAQ,cAAc,WAAW;AAC/C,aAAK,SAAS,IAAI,cAAc,EAAE,QAAQ,KAAK,QAAQ,QAAQ,UAAU,KAAK,QAAQ,KAAK,CAAC;AAAA,MAC9F;AAKA,YAAM,kBAAkB,KAAK,QAAQ,aAAc,KAAK,KAAa,qBAAqB;AAC1F,WAAK,oBAAoB,IAAI;AAAA,QAC3B,IAAI,UAAU;AAAA,UACZ,eAAe,CAAC,IAAI;AAAA,UACpB,WAAW;AAAA,QACb,CAAC;AAAA,MACH;AAEA,YAAM,mBAAmB,oBAAI,IAAc;AAC3C,UAAI,KAAK,OAAQ,kBAAiB,IAAI,QAAQ,KAAK,MAAM;AACzD,WAAK,kBAAkB,IAAI,gBAAgB;AAE3C,UAAI,KAAK,QAAQ,iBAAiB;AAChC,aAAK,QAAQ,gBAAgB,KAAK,mBAAmB,KAAK,IAAkC;AAAA,MAC9F;AAAA,IACF,SAAS,GAAG;AACV,cAAQ,MAAM,iCAAiC,CAAC;AAAA,IAClD;AAAA,EACF;AAAA,EAEA,aAAa;AACX,SAAK,oBAAoB,YAAY;AAAA,EACvC;AACF;",
4
+ "sourcesContent": ["import { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { PathRouter } from '@dooboostore/core-web';\nimport { HashRouter } from '@dooboostore/core-web';\nimport { ElementRouter } from '../router/ElementRouter';\nimport { SimOption } from '@dooboostore/simple-boot/SimOption';\nimport { Router, RouterEventType } from '@dooboostore/core-web';\nimport { Subscription } from '@dooboostore/core';\nimport { ConstructorType, OptionalType } from '@dooboostore/core';\nimport { FunctionUtils } from '@dooboostore/core';\nimport { SwcUtils } from '../utils/Utils';\n\nimport { SwcAppInterface } from '../types';\nimport {Intent} from \"@dooboostore/simple-boot\";\n\nexport type SwcConfigType = {\n routeType: 'path' | 'hash' | 'element';\n connectMode?: 'direct' | 'swap';\n container?: symbol;\n path?: string;\n window: Window;\n onEngineStarted?: (sp: SimpleApplication, app: SwcAppInterface) => void;\n onConnected?: (app: SwcAppInterface) => void;\n onDisconnected?: (app: SwcAppInterface) => void;\n};\n\nexport type SwcAttributeConfigType = OptionalType<SwcConfigType, 'routeType' | 'window'>;\n\nexport class SwcAppEngine {\n public simpleApplication?: SimpleApplication;\n public router?: Router;\n private routerSubscription?: Subscription;\n private _config?: SwcConfigType;\n\n constructor(private host: HTMLElement) {}\n\n get config() {\n return this._config;\n }\n async connect(config: SwcConfigType) {\n try {\n this._config = config;\n\n // Router Selection\n if (this._config.routeType === 'path') {\n this.router = new PathRouter({ window: this._config.window });\n } else if (this._config.routeType === 'hash') {\n this.router = new HashRouter({ window: this._config.window });\n } else if (this._config.routeType === 'element') {\n this.router = new ElementRouter({ window: this._config.window });\n }\n\n // console.log('vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv', this.router)\n\n // App start\n const containerSymbol = this._config.container || (this.host as any).getContainerSymbol?.();\n this.simpleApplication = new SimpleApplication(\n new SimOption({\n excludeProxys: [Node],\n container: containerSymbol\n })\n );\n\n const otherInstanceSim = new Map<any, any>();\n if (this.router) otherInstanceSim.set(Router, this.router);\n this.simpleApplication.run(otherInstanceSim);\n\n if (this._config.onEngineStarted) {\n this._config.onEngineStarted(this.simpleApplication, this.host as unknown as SwcAppInterface);\n }\n } catch (e) {\n console.error('[SWC-APP-ENGINE] Init failed:', e);\n }\n }\n\n disconnect() {\n this.routerSubscription?.unsubscribe();\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAC1B,SAAS,cAA+B;AAsBjC,MAAM,aAAa;AAAA,EAMxB,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA,EAExC,IAAI,SAAS;AACX,WAAO,KAAK;AAAA,EACd;AAAA,EACA,MAAM,QAAQ,QAAuB;AACnC,QAAI;AACF,WAAK,UAAU;AAGf,UAAI,KAAK,QAAQ,cAAc,QAAQ;AACrC,aAAK,SAAS,IAAI,WAAW,EAAE,QAAQ,KAAK,QAAQ,OAAO,CAAC;AAAA,MAC9D,WAAW,KAAK,QAAQ,cAAc,QAAQ;AAC5C,aAAK,SAAS,IAAI,WAAW,EAAE,QAAQ,KAAK,QAAQ,OAAO,CAAC;AAAA,MAC9D,WAAW,KAAK,QAAQ,cAAc,WAAW;AAC/C,aAAK,SAAS,IAAI,cAAc,EAAE,QAAQ,KAAK,QAAQ,OAAO,CAAC;AAAA,MACjE;AAKA,YAAM,kBAAkB,KAAK,QAAQ,aAAc,KAAK,KAAa,qBAAqB;AAC1F,WAAK,oBAAoB,IAAI;AAAA,QAC3B,IAAI,UAAU;AAAA,UACZ,eAAe,CAAC,IAAI;AAAA,UACpB,WAAW;AAAA,QACb,CAAC;AAAA,MACH;AAEA,YAAM,mBAAmB,oBAAI,IAAc;AAC3C,UAAI,KAAK,OAAQ,kBAAiB,IAAI,QAAQ,KAAK,MAAM;AACzD,WAAK,kBAAkB,IAAI,gBAAgB;AAE3C,UAAI,KAAK,QAAQ,iBAAiB;AAChC,aAAK,QAAQ,gBAAgB,KAAK,mBAAmB,KAAK,IAAkC;AAAA,MAC9F;AAAA,IACF,SAAS,GAAG;AACV,cAAQ,MAAM,iCAAiC,CAAC;AAAA,IAClD;AAAA,EACF;AAAA,EAEA,aAAa;AACX,SAAK,oBAAoB,YAAY;AAAA,EACvC;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,7 @@
1
1
  import { SwcAppEngine } from "./SwcAppEngine.js";
2
2
  import { SwcUtils } from "../utils/Utils.js";
3
3
  import { FunctionUtils } from "@dooboostore/core";
4
+ import { ON_CONNECTED_SWC_APP_METADATA_KEY, findAllLifecycleMetadata } from "../decorators/lifecycles.js";
4
5
  import { getSubscribeSwcAppRouteChangeMetadata } from "../decorators/subscribeSwcAppRouteChange.js";
5
6
  function SwcAppMixin(Base) {
6
7
  return class extends Base {
@@ -8,6 +9,7 @@ function SwcAppMixin(Base) {
8
9
  super(...arguments);
9
10
  this.__swc_engine = new SwcAppEngine(this);
10
11
  this._swc_connected_instance = /* @__PURE__ */ new Set();
12
+ this._connected_safari = [];
11
13
  }
12
14
  get simpleApplication() {
13
15
  return this.__swc_engine.simpleApplication;
@@ -15,6 +17,10 @@ function SwcAppMixin(Base) {
15
17
  get router() {
16
18
  return this.__swc_engine.router;
17
19
  }
20
+ // constructor() {
21
+ // super();
22
+ // console.log('cccccccccccccccccccccc');
23
+ // }
18
24
  _invokeRouteChangeSubscribers(instance, re) {
19
25
  const routeChangeSubscribers = getSubscribeSwcAppRouteChangeMetadata(instance);
20
26
  if (routeChangeSubscribers && Array.isArray(routeChangeSubscribers)) {
@@ -42,7 +48,7 @@ function SwcAppMixin(Base) {
42
48
  }
43
49
  const filterPassed = !filter || filter(this.router);
44
50
  if (pathMatched && filterPassed) {
45
- instance[methodName]?.(re, pathData || {});
51
+ instance[methodName]?.({ ...re, pathData });
46
52
  }
47
53
  });
48
54
  }
@@ -50,8 +56,11 @@ function SwcAppMixin(Base) {
50
56
  _connected(instance) {
51
57
  if (instance) {
52
58
  this._swc_connected_instance.add(instance);
53
- if (this.router && this._lastRouterEvent) {
54
- this._invokeRouteChangeSubscribers(instance, this._lastRouterEvent);
59
+ if (this.simpleApplication) {
60
+ this._invokeOnConnectedSwcAppStarted(instance);
61
+ if (this.router && this._lastRouterEvent) {
62
+ this._invokeRouteChangeSubscribers(instance, this._lastRouterEvent);
63
+ }
55
64
  }
56
65
  }
57
66
  }
@@ -98,14 +107,33 @@ function SwcAppMixin(Base) {
98
107
  throw e;
99
108
  }
100
109
  }
110
+ this._connected_safari.forEach((instance) => {
111
+ this._swc_connected_instance.add(instance);
112
+ });
113
+ this._swc_connected_instance.forEach((instance) => {
114
+ this._invokeOnConnectedSwcAppStarted(instance);
115
+ });
101
116
  if (!this._routerSubscription && this.router) {
102
117
  this._routerSubscription = this.router.observable.subscribe((route) => {
103
118
  this._handleRouteChange(route);
104
119
  });
120
+ const config2 = this.__swc_engine.config;
121
+ if (config2?.path) {
122
+ this.router.go(config2.path);
123
+ }
124
+ }
125
+ }
126
+ _invokeOnConnectedSwcAppStarted(instance) {
127
+ const startedMethods = findAllLifecycleMetadata(instance, ON_CONNECTED_SWC_APP_METADATA_KEY);
128
+ if (startedMethods) {
129
+ for (const m of startedMethods) {
130
+ instance._invokeLifecycleMethod(m);
131
+ }
105
132
  }
106
133
  }
107
134
  connectedCallback() {
108
- if (super.connectedCallback) super.connectedCallback();
135
+ if (super.connectedCallback)
136
+ super.connectedCallback();
109
137
  const configStr = this.getAttribute("swc-get-application-config");
110
138
  const win = this.ownerDocument?.defaultView || window;
111
139
  if (configStr && win) {
@@ -123,7 +151,8 @@ function SwcAppMixin(Base) {
123
151
  this.__swc_engine?.config?.onConnected?.(this);
124
152
  }
125
153
  disconnectedCallback() {
126
- if (super.disconnectedCallback) super.disconnectedCallback();
154
+ if (super.disconnectedCallback)
155
+ super.disconnectedCallback();
127
156
  this._routerSubscription?.unsubscribe();
128
157
  this._routerSubscription = void 0;
129
158
  this._lastRouterEvent = void 0;
@@ -131,7 +160,16 @@ function SwcAppMixin(Base) {
131
160
  this.__swc_engine?.config?.onDisconnected?.(this);
132
161
  }
133
162
  async routing(path) {
134
- await this.__swc_engine.router?.go(path);
163
+ await this.router?.go(path);
164
+ }
165
+ back() {
166
+ this.router?.back();
167
+ }
168
+ forward() {
169
+ this.router?.forward();
170
+ }
171
+ reload() {
172
+ this.router?.reload();
135
173
  }
136
174
  };
137
175
  }