@dooboostore/simple-web-component 1.0.41 → 1.0.43

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 (95) hide show
  1. package/README.md +423 -68
  2. package/dist/cjs/decorators/addEventListener.js +10 -0
  3. package/dist/cjs/decorators/addEventListener.js.map +2 -2
  4. package/dist/cjs/decorators/applyAttribute.js +11 -2
  5. package/dist/cjs/decorators/applyAttribute.js.map +2 -2
  6. package/dist/cjs/decorators/applyClass.js +9 -2
  7. package/dist/cjs/decorators/applyClass.js.map +2 -2
  8. package/dist/cjs/decorators/applyNode.js +11 -2
  9. package/dist/cjs/decorators/applyNode.js.map +2 -2
  10. package/dist/cjs/decorators/applyProperty.js +10 -2
  11. package/dist/cjs/decorators/applyProperty.js.map +2 -2
  12. package/dist/cjs/decorators/applySlot.js +11 -2
  13. package/dist/cjs/decorators/applySlot.js.map +2 -2
  14. package/dist/cjs/decorators/applyStyle.js +9 -2
  15. package/dist/cjs/decorators/applyStyle.js.map +2 -2
  16. package/dist/cjs/decorators/elementDefine.js +9 -23
  17. package/dist/cjs/decorators/elementDefine.js.map +2 -2
  18. package/dist/cjs/decorators/emitCustomEvent.js +2 -0
  19. package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
  20. package/dist/cjs/decorators/lifecycles.js +78 -21
  21. package/dist/cjs/decorators/lifecycles.js.map +2 -2
  22. package/dist/cjs/decorators/publishSwcAppMessage.js +37 -23
  23. package/dist/cjs/decorators/publishSwcAppMessage.js.map +2 -2
  24. package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js +3 -1
  25. package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
  26. package/dist/cjs/elements/SwcAppMixin.js +4 -9
  27. package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
  28. package/dist/esm/decorators/addEventListener.js +10 -0
  29. package/dist/esm/decorators/addEventListener.js.map +2 -2
  30. package/dist/esm/decorators/applyAttribute.js +11 -2
  31. package/dist/esm/decorators/applyAttribute.js.map +2 -2
  32. package/dist/esm/decorators/applyClass.js +9 -2
  33. package/dist/esm/decorators/applyClass.js.map +2 -2
  34. package/dist/esm/decorators/applyNode.js +11 -2
  35. package/dist/esm/decorators/applyNode.js.map +2 -2
  36. package/dist/esm/decorators/applyProperty.js +10 -2
  37. package/dist/esm/decorators/applyProperty.js.map +2 -2
  38. package/dist/esm/decorators/applySlot.js +11 -2
  39. package/dist/esm/decorators/applySlot.js.map +2 -2
  40. package/dist/esm/decorators/applyStyle.js +9 -2
  41. package/dist/esm/decorators/applyStyle.js.map +2 -2
  42. package/dist/esm/decorators/elementDefine.js +9 -23
  43. package/dist/esm/decorators/elementDefine.js.map +2 -2
  44. package/dist/esm/decorators/emitCustomEvent.js +2 -0
  45. package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
  46. package/dist/esm/decorators/lifecycles.js +78 -21
  47. package/dist/esm/decorators/lifecycles.js.map +2 -2
  48. package/dist/esm/decorators/publishSwcAppMessage.js +37 -23
  49. package/dist/esm/decorators/publishSwcAppMessage.js.map +2 -2
  50. package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js +3 -1
  51. package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
  52. package/dist/esm/elements/SwcAppMixin.js +4 -9
  53. package/dist/esm/elements/SwcAppMixin.js.map +2 -2
  54. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +216 -126
  55. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +3 -3
  56. package/dist/types/decorators/addEventListener.d.ts +5 -0
  57. package/dist/types/decorators/addEventListener.d.ts.map +1 -1
  58. package/dist/types/decorators/applyAttribute.d.ts +26 -0
  59. package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
  60. package/dist/types/decorators/applyClass.d.ts +6 -0
  61. package/dist/types/decorators/applyClass.d.ts.map +1 -1
  62. package/dist/types/decorators/applyNode.d.ts +6 -0
  63. package/dist/types/decorators/applyNode.d.ts.map +1 -1
  64. package/dist/types/decorators/applyProperty.d.ts +26 -0
  65. package/dist/types/decorators/applyProperty.d.ts.map +1 -1
  66. package/dist/types/decorators/applySlot.d.ts +6 -0
  67. package/dist/types/decorators/applySlot.d.ts.map +1 -1
  68. package/dist/types/decorators/applyStyle.d.ts +6 -0
  69. package/dist/types/decorators/applyStyle.d.ts.map +1 -1
  70. package/dist/types/decorators/elementDefine.d.ts.map +1 -1
  71. package/dist/types/decorators/emitCustomEvent.d.ts +17 -0
  72. package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
  73. package/dist/types/decorators/lifecycles.d.ts +25 -11
  74. package/dist/types/decorators/lifecycles.d.ts.map +1 -1
  75. package/dist/types/decorators/publishSwcAppMessage.d.ts +19 -0
  76. package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -1
  77. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +1 -1
  78. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -1
  79. package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
  80. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +216 -126
  81. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +3 -3
  82. package/package.json +1 -3
  83. package/src/decorators/addEventListener.ts +7 -0
  84. package/src/decorators/applyAttribute.ts +58 -2
  85. package/src/decorators/applyClass.ts +24 -2
  86. package/src/decorators/applyNode.ts +26 -2
  87. package/src/decorators/applyProperty.ts +57 -2
  88. package/src/decorators/applySlot.ts +24 -10
  89. package/src/decorators/applyStyle.ts +24 -2
  90. package/src/decorators/elementDefine.ts +9 -23
  91. package/src/decorators/emitCustomEvent.ts +19 -0
  92. package/src/decorators/lifecycles.ts +120 -26
  93. package/src/decorators/publishSwcAppMessage.ts +71 -27
  94. package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +6 -2
  95. package/src/elements/SwcAppMixin.ts +5 -11
@@ -33,7 +33,6 @@ __export(lifecycles_exports, {
33
33
  findAllOnConnectedAfterMetadata: () => findAllOnConnectedAfterMetadata,
34
34
  findAllOnConnectedBeforeMetadata: () => findAllOnConnectedBeforeMetadata,
35
35
  findAllOnConnectedMetadata: () => findAllOnConnectedMetadata,
36
- onAddEventListener: () => onAddEventListener,
37
36
  onAdopted: () => onAdopted,
38
37
  onAdoptedAfter: () => onAdoptedAfter,
39
38
  onAdoptedBefore: () => onAdoptedBefore,
@@ -98,26 +97,76 @@ function onConnectedAfter(arg1, arg2, arg3) {
98
97
  };
99
98
  }
100
99
  function createLifecycleDecorator(metadataKey) {
101
- return (target, propertyKey) => {
102
- const constructor = target.constructor;
103
- let list = import_core.ReflectUtils.getOwnMetadata(metadataKey, constructor);
104
- if (!list) {
105
- list = [];
106
- import_core.ReflectUtils.defineMetadata(metadataKey, list, constructor);
100
+ const decorator2 = (options) => {
101
+ return (target, propertyKey) => {
102
+ const constructor = target.constructor;
103
+ let list = import_core.ReflectUtils.getOwnMetadata(metadataKey, constructor);
104
+ if (!list) {
105
+ list = [];
106
+ import_core.ReflectUtils.defineMetadata(metadataKey, list, constructor);
107
+ }
108
+ list.push({ propertyKey, order: options?.order ?? 0 });
109
+ };
110
+ };
111
+ return Object.assign(
112
+ (target, propertyKey) => {
113
+ const constructor = target.constructor;
114
+ let list = import_core.ReflectUtils.getOwnMetadata(metadataKey, constructor);
115
+ if (!list) {
116
+ list = [];
117
+ import_core.ReflectUtils.defineMetadata(metadataKey, list, constructor);
118
+ }
119
+ list.push({ propertyKey, order: 0 });
120
+ },
121
+ { __isDecorator: true, __decorator: decorator2 }
122
+ );
123
+ }
124
+ function createLifecycleDecoratorWithOptions(metadataKey) {
125
+ return function(optionOrTarget, propertyKey) {
126
+ if (propertyKey) {
127
+ const constructor = optionOrTarget.constructor;
128
+ let list = import_core.ReflectUtils.getOwnMetadata(metadataKey, constructor);
129
+ if (!list) {
130
+ list = [];
131
+ import_core.ReflectUtils.defineMetadata(metadataKey, list, constructor);
132
+ }
133
+ list.push({ propertyKey, order: 0 });
134
+ return;
107
135
  }
108
- list.push(propertyKey);
136
+ return (target, propertyKey2) => {
137
+ const constructor = target.constructor;
138
+ let list = import_core.ReflectUtils.getOwnMetadata(metadataKey, constructor);
139
+ if (!list) {
140
+ list = [];
141
+ import_core.ReflectUtils.defineMetadata(metadataKey, list, constructor);
142
+ }
143
+ list.push({ propertyKey: propertyKey2, order: optionOrTarget?.order ?? 0 });
144
+ };
109
145
  };
110
146
  }
111
- const onInitialize = createLifecycleDecorator(ON_INITIALIZE_METADATA_KEY);
112
- const onDisconnectedBefore = createLifecycleDecorator(ON_BEFORE_DISCONNECTED_METADATA_KEY);
113
- const onDisconnectedAfter = createLifecycleDecorator(ON_AFTER_DISCONNECTED_METADATA_KEY);
147
+ function onInitialize(optionOrTarget, propertyKey) {
148
+ return createLifecycleDecoratorWithOptions(ON_INITIALIZE_METADATA_KEY)(optionOrTarget, propertyKey);
149
+ }
150
+ function onDisconnectedBefore(optionOrTarget, propertyKey) {
151
+ return createLifecycleDecoratorWithOptions(ON_BEFORE_DISCONNECTED_METADATA_KEY)(optionOrTarget, propertyKey);
152
+ }
153
+ function onDisconnectedAfter(optionOrTarget, propertyKey) {
154
+ return createLifecycleDecoratorWithOptions(ON_AFTER_DISCONNECTED_METADATA_KEY)(optionOrTarget, propertyKey);
155
+ }
114
156
  const onDisconnected = onDisconnectedAfter;
115
- const onAdoptedBefore = createLifecycleDecorator(ON_BEFORE_ADOPTED_METADATA_KEY);
116
- const onAdoptedAfter = createLifecycleDecorator(ON_AFTER_ADOPTED_METADATA_KEY);
157
+ function onAdoptedBefore(optionOrTarget, propertyKey) {
158
+ return createLifecycleDecoratorWithOptions(ON_BEFORE_ADOPTED_METADATA_KEY)(optionOrTarget, propertyKey);
159
+ }
160
+ function onAdoptedAfter(optionOrTarget, propertyKey) {
161
+ return createLifecycleDecoratorWithOptions(ON_AFTER_ADOPTED_METADATA_KEY)(optionOrTarget, propertyKey);
162
+ }
117
163
  const onAdopted = onAdoptedAfter;
118
- const onAddEventListener = createLifecycleDecorator(ON_ADD_EVENT_LISTENER_METADATA_KEY);
119
- const onConnectedSwcApp = createLifecycleDecorator(ON_CONNECTED_SWC_APP_METADATA_KEY);
120
- const onConnectedCompleted = createLifecycleDecorator(ON_CONNECTED_COMPLETED_METADATA_KEY);
164
+ function onConnectedSwcApp(optionOrTarget, propertyKey) {
165
+ return createLifecycleDecoratorWithOptions(ON_CONNECTED_SWC_APP_METADATA_KEY)(optionOrTarget, propertyKey);
166
+ }
167
+ function onConnectedCompleted(optionOrTarget, propertyKey) {
168
+ return createLifecycleDecoratorWithOptions(ON_CONNECTED_COMPLETED_METADATA_KEY)(optionOrTarget, propertyKey);
169
+ }
121
170
  const decorator = (options, target, propertyKey) => {
122
171
  const constructor = target.constructor;
123
172
  let list = import_core.ReflectUtils.getMetadata(ON_CONNECTED_METADATA_KEY, constructor);
@@ -152,19 +201,27 @@ function onConnected(optionOrTarget, propertyKey, arg3) {
152
201
  };
153
202
  }
154
203
  const findAllLifecycleMetadata = (target, metadataKey) => {
155
- const results = import_core.ReflectUtils.findAllMetadataFlatten(metadataKey, target) ?? [];
156
- return results;
204
+ const constructor = target instanceof Function ? target : target.constructor;
205
+ const results = import_core.ReflectUtils.getOwnMetadata(metadataKey, constructor) ?? [];
206
+ return [...results].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
157
207
  };
158
208
  const findAllOnConnectedMetadata = (target) => {
159
209
  const constructor = target instanceof Function ? target : target.constructor;
160
- return import_core.ReflectUtils.getMetadata(ON_CONNECTED_METADATA_KEY, constructor) ?? [];
210
+ const results = import_core.ReflectUtils.getMetadata(ON_CONNECTED_METADATA_KEY, constructor) ?? [];
211
+ return [...results].sort((a, b) => {
212
+ const orderA = a.options?.order ?? 0;
213
+ const orderB = b.options?.order ?? 0;
214
+ return orderA - orderB;
215
+ });
161
216
  };
162
217
  const findAllOnConnectedBeforeMetadata = (target) => {
163
218
  const constructor = target instanceof Function ? target : target.constructor;
164
- return import_core.ReflectUtils.getMetadata(ON_BEFORE_CONNECTED_METADATA_KEY, constructor) ?? [];
219
+ const results = import_core.ReflectUtils.getMetadata(ON_BEFORE_CONNECTED_METADATA_KEY, constructor) ?? [];
220
+ return [...results].sort((a, b) => (a.options?.order ?? 0) - (b.options?.order ?? 0));
165
221
  };
166
222
  const findAllOnConnectedAfterMetadata = (target) => {
167
223
  const constructor = target instanceof Function ? target : target.constructor;
168
- return import_core.ReflectUtils.getMetadata(ON_AFTER_CONNECTED_METADATA_KEY, constructor) ?? [];
224
+ const results = import_core.ReflectUtils.getMetadata(ON_AFTER_CONNECTED_METADATA_KEY, constructor) ?? [];
225
+ return [...results].sort((a, b) => (a.options?.order ?? 0) - (b.options?.order ?? 0));
169
226
  };
170
227
  //# sourceMappingURL=lifecycles.js.map
@@ -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 ON_CONNECTED_METADATA_KEY = Symbol.for('simple-web-component');\nexport const ON_CONNECTED_SWC_APP_METADATA_KEY = Symbol.for('simple-web-component:on-connected-swc-app');\nexport const ON_CONNECTED_COMPLETED_METADATA_KEY = Symbol.for('simple-web-component:on-completed');\n\nexport const ATTRIBUTE_CHANGED_WILDCARD = '*';\n\nexport interface InnerHtmlOptions {\n ssrFirst?: boolean;\n // replaceWrap?:{ start: string, end:string},\n useShadow?: boolean;\n}\nexport interface InnerHtmlMetadata {\n propertyKey: string | symbol;\n options: InnerHtmlOptions;\n}\n\nexport interface OnConnectedOptions {\n ssrFirst?: boolean;\n}\nexport interface OnConnectedMetadata {\n propertyKey: string | symbol;\n options: OnConnectedOptions;\n}\n\n\nexport function onConnectedBefore(options: OnConnectedOptions): MethodDecorator;\nexport function onConnectedBefore(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onConnectedBefore(arg1?: OnConnectedOptions | Object, arg2?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n const decorator = (options: OnConnectedOptions, target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getMetadata<OnConnectedMetadata[]>(ON_BEFORE_CONNECTED_METADATA_KEY, constructor);\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(ON_BEFORE_CONNECTED_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 OnConnectedOptions) || {}, target, propertyKey);\n };\n}\n\nexport function onConnectedAfter(options: OnConnectedOptions): MethodDecorator;\nexport function onConnectedAfter(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onConnectedAfter(arg1?: OnConnectedOptions | Object, arg2?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n const decorator = (options: OnConnectedOptions, target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getMetadata<OnConnectedMetadata[]>(ON_AFTER_CONNECTED_METADATA_KEY, constructor);\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(ON_AFTER_CONNECTED_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 OnConnectedOptions) || {}, target, propertyKey);\n };\n}\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);\n// export const onConnectedBefore = createLifecycleDecorator(ON_BEFORE_CONNECTED_METADATA_KEY);\n// export const onConnectedAfter = createLifecycleDecorator(ON_AFTER_CONNECTED_METADATA_KEY);\n// export const onConnected = onConnectedAfter;\n\nexport const onDisconnectedBefore = createLifecycleDecorator(ON_BEFORE_DISCONNECTED_METADATA_KEY);\nexport const onDisconnectedAfter = createLifecycleDecorator(ON_AFTER_DISCONNECTED_METADATA_KEY);\nexport const onDisconnected = onDisconnectedAfter;\n\nexport const onAdoptedBefore = createLifecycleDecorator(ON_BEFORE_ADOPTED_METADATA_KEY);\nexport const onAdoptedAfter = createLifecycleDecorator(ON_AFTER_ADOPTED_METADATA_KEY);\nexport const onAdopted = onAdoptedAfter;\n\nexport const onAddEventListener = createLifecycleDecorator(ON_ADD_EVENT_LISTENER_METADATA_KEY);\n\nexport const onConnectedSwcApp = createLifecycleDecorator(ON_CONNECTED_SWC_APP_METADATA_KEY);\nexport const onConnectedCompleted = createLifecycleDecorator(ON_CONNECTED_COMPLETED_METADATA_KEY);\n\n\n\n\n\nconst decorator = (options: InnerHtmlOptions, target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getMetadata<InnerHtmlMetadata[]>(ON_CONNECTED_METADATA_KEY, constructor);\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(ON_CONNECTED_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, options });\n};\n\nexport function onConnectedShadow(options: Omit<InnerHtmlOptions, 'useShadow'>): MethodDecorator; // \uD30C\uB77C\uBBF8\uD130\uC788\uC74C\nexport function onConnectedShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; // \uD30C\uB77C\uBBF8\uD130\uC5C6\uC74C\nexport function onConnectedShadow(optionOrTarget: Omit<InnerHtmlOptions, 'useShadow'> | Object, propertyKey?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n if (propertyKey) { // no parameter option @decorator\n return decorator({useShadow: true}, optionOrTarget!, propertyKey);\n }\n // parameter option @decorator()\n return (target: Object, propertyKey: string | symbol) => {\n decorator({...optionOrTarget??{}, useShadow: true}, target, propertyKey);\n };\n}\n\nexport function onConnectedLight(options: Omit<InnerHtmlOptions, 'useShadow'>): MethodDecorator; // \uD30C\uB77C\uBBF8\uD130\uC788\uC74C\nexport function onConnectedLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; // \uD30C\uB77C\uBBF8\uD130\uC5C6\uC74C\nexport function onConnectedLight(optionOrTarget: Omit<InnerHtmlOptions, 'useShadow'> | Object, propertyKey?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n if (propertyKey) { // no parameter option @decorator\n return decorator({useShadow: false}, optionOrTarget!, propertyKey);\n }\n // parameter option @decorator()\n return (target: Object, propertyKey: string | symbol) => {\n decorator({...optionOrTarget??{}, useShadow: false}, target, propertyKey);\n };\n}\nexport function onConnected(options: InnerHtmlOptions): MethodDecorator;\nexport function onConnected(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onConnected(optionOrTarget: InnerHtmlOptions | Object, propertyKey?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n if (propertyKey) { // no parameter option @decorator\n return decorator({}, optionOrTarget!, propertyKey);\n }\n // parameter option @decorator()\n return (target: Object, propertyKey: string | symbol) => {\n decorator((optionOrTarget 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 */\n// export const findAllLifecycleMetadata = <T = (string | symbol)[]>(target: any, metadataKey: symbol): T | undefined => {\nexport const findAllLifecycleMetadata = (target: any, metadataKey: symbol): (string | symbol)[] => {\n const results = ReflectUtils.findAllMetadataFlatten(metadataKey, target)??[];\n return results;\n};\n\nexport const findAllOnConnectedMetadata = (target: any): InnerHtmlMetadata[] => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ON_CONNECTED_METADATA_KEY, constructor) ?? [];\n};\nexport const findAllOnConnectedBeforeMetadata = (target: any): OnConnectedMetadata[] => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ON_BEFORE_CONNECTED_METADATA_KEY, constructor) ?? [];\n};\nexport const findAllOnConnectedAfterMetadata = (target: any): OnConnectedMetadata[] => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ON_AFTER_CONNECTED_METADATA_KEY, constructor) ?? [];\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;AAEtB,MAAM,6BAA6B,OAAO,IAAI,qCAAqC;AACnF,MAAM,mCAAmC,OAA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AI,GAAG,QAAQA,YAAW;AAAA,EACzE;AACF;AAIO,SAAS,iBAAiB,gBAA8D,aAA+B,MAAmD;AAC/K,MAAI,aAAa;AACf,WAAO,UAAU,EAAC,WAAW,MAAK,GAAG,gBAAiB,WAAW;AAAA,EACnE;AAEA,SAAO,CAAC,QAAgBA,iBAAiC;AACvD,cAAU,EAAC,GAAG,kBAAgB,CAAC,GAAG,WAAW,MAAK,GAAG,QAAQA,YAAW;AAAA,EAC1E;AACF;AAGO,SAAS,YAAY,gBAA2C,aAA+B,MAAmD;AACvJ,MAAI,aAAa;AACf,WAAO,UAAU,CAAC,GAAG,gBAAiB,WAAW;AAAA,EACnD;AAEA,SAAO,CAAC,QAAgBA,iBAAiC;AACvD,cAAW,kBAAuC,CAAC,GAAG,QAAQA,YAAW;AAAA,EAC3E;AACF;AAMO,MAAM,2BAA2B,CAAC,QAAa,gBAA6C;AACjG,QAAM,UAAU,yBAAa,uBAAuB,aAAa,MAAM,KAAG,CAAC;AAC3E,SAAO;AACT;AAEO,MAAM,6BAA6B,CAAC,WAAqC;AAC9E,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,yBAAa,YAAY,2BAA2B,WAAW,KAAK,CAAC;AAC9E;AACO,MAAM,mCAAmC,CAAC,WAAuC;AACtF,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,yBAAa,YAAY,kCAAkC,WAAW,KAAK,CAAC;AACrF;AACO,MAAM,kCAAkC,CAAC,WAAuC;AACrF,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,yBAAa,YAAY,iCAAiC,WAAW,KAAK,CAAC;AACpF;",
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_METADATA_KEY = Symbol.for('simple-web-component');\nexport const ON_CONNECTED_SWC_APP_METADATA_KEY = Symbol.for('simple-web-component:on-connected-swc-app');\nexport const ON_CONNECTED_COMPLETED_METADATA_KEY = Symbol.for('simple-web-component:on-completed');\n\nexport const ATTRIBUTE_CHANGED_WILDCARD = '*';\n\nexport interface InnerHtmlOptions {\n ssrFirst?: boolean;\n // replaceWrap?:{ start: string, end:string},\n useShadow?: boolean;\n}\nexport interface InnerHtmlMetadata {\n propertyKey: string | symbol;\n options: InnerHtmlOptions;\n}\n\nexport interface OnConnectedOptions {\n ssrFirst?: boolean;\n order?: number;\n}\nexport interface OnConnectedMetadata {\n propertyKey: string | symbol;\n options: OnConnectedOptions;\n}\n\nexport interface LifecycleOptions {\n order?: number;\n}\nexport interface LifecycleMetadata {\n propertyKey: string | symbol;\n order?: number;\n}\n\n\nexport function onConnectedBefore(options: OnConnectedOptions): MethodDecorator;\nexport function onConnectedBefore(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onConnectedBefore(arg1?: OnConnectedOptions | Object, arg2?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n const decorator = (options: OnConnectedOptions, target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getMetadata<OnConnectedMetadata[]>(ON_BEFORE_CONNECTED_METADATA_KEY, constructor);\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(ON_BEFORE_CONNECTED_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 OnConnectedOptions) || {}, target, propertyKey);\n };\n}\n\nexport function onConnectedAfter(options: OnConnectedOptions): MethodDecorator;\nexport function onConnectedAfter(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onConnectedAfter(arg1?: OnConnectedOptions | Object, arg2?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n const decorator = (options: OnConnectedOptions, target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getMetadata<OnConnectedMetadata[]>(ON_AFTER_CONNECTED_METADATA_KEY, constructor);\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(ON_AFTER_CONNECTED_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 OnConnectedOptions) || {}, target, propertyKey);\n };\n}\n\n\nfunction createLifecycleDecorator(metadataKey: symbol): ((options?: LifecycleOptions) => MethodDecorator) & MethodDecorator {\n const decorator = (options?: LifecycleOptions): MethodDecorator => {\n return (target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(metadataKey, constructor) as LifecycleMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(metadataKey, list, constructor);\n }\n list.push({ propertyKey, order: options?.order ?? 0 });\n };\n };\n\n // Support both @decorator and @decorator() syntax\n return Object.assign(\n (target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(metadataKey, constructor) as LifecycleMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(metadataKey, list, constructor);\n }\n list.push({ propertyKey, order: 0 });\n },\n { __isDecorator: true, __decorator: decorator }\n ) as any;\n}\n\n// Helper to handle both @decorator and @decorator() syntax\nfunction createLifecycleDecoratorWithOptions(metadataKey: symbol) {\n return function(optionOrTarget?: LifecycleOptions | Object, propertyKey?: string | symbol): MethodDecorator | void {\n if (propertyKey) {\n // Direct decorator usage: @decorator\n const constructor = (optionOrTarget as Object).constructor;\n let list = ReflectUtils.getOwnMetadata(metadataKey, constructor) as LifecycleMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(metadataKey, list, constructor);\n }\n list.push({ propertyKey, order: 0 });\n return;\n }\n\n // Decorator with options: @decorator({ order: 1 })\n return (target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(metadataKey, constructor) as LifecycleMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(metadataKey, list, constructor);\n }\n list.push({ propertyKey, order: (optionOrTarget as LifecycleOptions)?.order ?? 0 });\n };\n };\n}\n\nexport function onInitialize(options?: LifecycleOptions): MethodDecorator;\nexport function onInitialize(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onInitialize(optionOrTarget?: LifecycleOptions | Object, propertyKey?: string | symbol): MethodDecorator | void {\n return createLifecycleDecoratorWithOptions(ON_INITIALIZE_METADATA_KEY)(optionOrTarget, propertyKey);\n}\n\nexport function onDisconnectedBefore(options?: LifecycleOptions): MethodDecorator;\nexport function onDisconnectedBefore(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onDisconnectedBefore(optionOrTarget?: LifecycleOptions | Object, propertyKey?: string | symbol): MethodDecorator | void {\n return createLifecycleDecoratorWithOptions(ON_BEFORE_DISCONNECTED_METADATA_KEY)(optionOrTarget, propertyKey);\n}\n\nexport function onDisconnectedAfter(options?: LifecycleOptions): MethodDecorator;\nexport function onDisconnectedAfter(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onDisconnectedAfter(optionOrTarget?: LifecycleOptions | Object, propertyKey?: string | symbol): MethodDecorator | void {\n return createLifecycleDecoratorWithOptions(ON_AFTER_DISCONNECTED_METADATA_KEY)(optionOrTarget, propertyKey);\n}\n\nexport const onDisconnected = onDisconnectedAfter;\n\nexport function onAdoptedBefore(options?: LifecycleOptions): MethodDecorator;\nexport function onAdoptedBefore(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onAdoptedBefore(optionOrTarget?: LifecycleOptions | Object, propertyKey?: string | symbol): MethodDecorator | void {\n return createLifecycleDecoratorWithOptions(ON_BEFORE_ADOPTED_METADATA_KEY)(optionOrTarget, propertyKey);\n}\n\nexport function onAdoptedAfter(options?: LifecycleOptions): MethodDecorator;\nexport function onAdoptedAfter(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onAdoptedAfter(optionOrTarget?: LifecycleOptions | Object, propertyKey?: string | symbol): MethodDecorator | void {\n return createLifecycleDecoratorWithOptions(ON_AFTER_ADOPTED_METADATA_KEY)(optionOrTarget, propertyKey);\n}\n\nexport const onAdopted = onAdoptedAfter;\n\nexport function onConnectedSwcApp(options?: LifecycleOptions): MethodDecorator;\nexport function onConnectedSwcApp(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onConnectedSwcApp(optionOrTarget?: LifecycleOptions | Object, propertyKey?: string | symbol): MethodDecorator | void {\n return createLifecycleDecoratorWithOptions(ON_CONNECTED_SWC_APP_METADATA_KEY)(optionOrTarget, propertyKey);\n}\n\nexport function onConnectedCompleted(options?: LifecycleOptions): MethodDecorator;\nexport function onConnectedCompleted(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onConnectedCompleted(optionOrTarget?: LifecycleOptions | Object, propertyKey?: string | symbol): MethodDecorator | void {\n return createLifecycleDecoratorWithOptions(ON_CONNECTED_COMPLETED_METADATA_KEY)(optionOrTarget, propertyKey);\n}\n\n\n\n\n\nconst decorator = (options: InnerHtmlOptions, target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getMetadata<InnerHtmlMetadata[]>(ON_CONNECTED_METADATA_KEY, constructor);\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(ON_CONNECTED_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, options });\n};\n\nexport function onConnectedShadow(options: Omit<InnerHtmlOptions, 'useShadow'>): MethodDecorator; // \uD30C\uB77C\uBBF8\uD130\uC788\uC74C\nexport function onConnectedShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; // \uD30C\uB77C\uBBF8\uD130\uC5C6\uC74C\nexport function onConnectedShadow(optionOrTarget: Omit<InnerHtmlOptions, 'useShadow'> | Object, propertyKey?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n if (propertyKey) { // no parameter option @decorator\n return decorator({useShadow: true}, optionOrTarget!, propertyKey);\n }\n // parameter option @decorator()\n return (target: Object, propertyKey: string | symbol) => {\n decorator({...optionOrTarget??{}, useShadow: true}, target, propertyKey);\n };\n}\n\nexport function onConnectedLight(options: Omit<InnerHtmlOptions, 'useShadow'>): MethodDecorator; // \uD30C\uB77C\uBBF8\uD130\uC788\uC74C\nexport function onConnectedLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void; // \uD30C\uB77C\uBBF8\uD130\uC5C6\uC74C\nexport function onConnectedLight(optionOrTarget: Omit<InnerHtmlOptions, 'useShadow'> | Object, propertyKey?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n if (propertyKey) { // no parameter option @decorator\n return decorator({useShadow: false}, optionOrTarget!, propertyKey);\n }\n // parameter option @decorator()\n return (target: Object, propertyKey: string | symbol) => {\n decorator({...optionOrTarget??{}, useShadow: false}, target, propertyKey);\n };\n}\nexport function onConnected(options: InnerHtmlOptions): MethodDecorator;\nexport function onConnected(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onConnected(optionOrTarget: InnerHtmlOptions | Object, propertyKey?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n if (propertyKey) { // no parameter option @decorator\n return decorator({}, optionOrTarget!, propertyKey);\n }\n // parameter option @decorator()\n return (target: Object, propertyKey: string | symbol) => {\n decorator((optionOrTarget 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 = (target: any, metadataKey: symbol): LifecycleMetadata[] => {\n const constructor = target instanceof Function ? target : target.constructor;\n const results = ReflectUtils.getOwnMetadata(metadataKey, constructor) as LifecycleMetadata[] ?? [];\n // Sort by order (default 0 if not specified)\n return [...results].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\n};\n\nexport const findAllOnConnectedMetadata = (target: any): InnerHtmlMetadata[] => {\n const constructor = target instanceof Function ? target : target.constructor;\n const results = ReflectUtils.getMetadata(ON_CONNECTED_METADATA_KEY, constructor) ?? [];\n // Sort by order (default 0 if not specified)\n return [...results].sort((a, b) => {\n const orderA = (a.options as any)?.order ?? 0;\n const orderB = (b.options as any)?.order ?? 0;\n return orderA - orderB;\n });\n};\n\nexport const findAllOnConnectedBeforeMetadata = (target: any): OnConnectedMetadata[] => {\n const constructor = target instanceof Function ? target : target.constructor;\n const results = ReflectUtils.getMetadata(ON_BEFORE_CONNECTED_METADATA_KEY, constructor) ?? [];\n // Sort by order\n return [...results].sort((a, b) => (a.options?.order ?? 0) - (b.options?.order ?? 0));\n};\n\nexport const findAllOnConnectedAfterMetadata = (target: any): OnConnectedMetadata[] => {\n const constructor = target instanceof Function ? target : target.constructor;\n const results = ReflectUtils.getMetadata(ON_AFTER_CONNECTED_METADATA_KEY, constructor) ?? [];\n // Sort by order\n return [...results].sort((a, b)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EO,MAAM,6BAA6B,CAAC,WAAqC;AAC9E,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,QAAM,UAAU,yBAAa,YAAY,2BAA2B,WAAW,KAAK,CAAC;AAErF,SAAO,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,GAAG,MAAM;AACjC,UAAM,SAAU,EAAE,SAAiB,SAAS;AAC5C,UAAM,SAAU,EAAE,SAAiB,SAAS;AAC5C,WAAO,SAAS;AAAA,EAClB,CAAC;AACH;AAEO,MAAM,mCAAmC,CAAC,WAAuC;AACtF,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,QAAM,UAAU,yBAAa,YAAY,kCAAkC,WAAW,KAAK,CAAC;AAE5F,SAAO,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,GAAG,OAAO,EAAE,SAAS,SAAS,MAAM,EAAE,SAAS,SAAS,EAAE;AACtF;AAEO,MAAM,kCAAkC,CAAC,WAAuC;AACrF,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,QAAM,UAAU,yBAAa,YAAY,iCAAiC,WAAW,KAAK,CAAC;AAE3F,SAAO,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,GAAG,OAAO,EAAE,SAAS,SAAS,MAAM,EAAE,SAAS,SAAS,EAAE;AACtF;",
6
6
  "names": ["decorator", "propertyKey"]
7
7
  }
@@ -19,13 +19,14 @@ var publishSwcAppMessage_exports = {};
19
19
  __export(publishSwcAppMessage_exports, {
20
20
  PUBLISH_SWC_APP_MESSAGE_METADATA_KEY: () => PUBLISH_SWC_APP_MESSAGE_METADATA_KEY,
21
21
  getPublishSwcAppMessageMetadata: () => getPublishSwcAppMessageMetadata,
22
+ publish: () => publish,
22
23
  publishSwcAppMessage: () => publishSwcAppMessage
23
24
  });
24
25
  module.exports = __toCommonJS(publishSwcAppMessage_exports);
25
26
  var import_core = require("@dooboostore/core");
26
27
  var import_Utils = require("../utils/Utils");
27
28
  const PUBLISH_SWC_APP_MESSAGE_METADATA_KEY = Symbol.for("simple-web-component:publish-swc-app-message");
28
- function createPublishSwcAppMessage(messageType) {
29
+ function createPublishSwcAppMessage(messageType, options) {
29
30
  return (target, propertyKey, descriptor) => {
30
31
  const constructor = target.constructor;
31
32
  let list = import_core.ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor);
@@ -40,45 +41,58 @@ function createPublishSwcAppMessage(messageType) {
40
41
  const originalMethod = descriptor.value;
41
42
  descriptor.value = function(...args) {
42
43
  const result = originalMethod.apply(this, args);
43
- if (result instanceof Promise) {
44
- result.then((data) => {
45
- const appHost = import_Utils.SwcUtils.getAppHost(this);
46
- if (appHost) {
47
- appHost.publishMessage({
48
- publisher: this,
49
- data,
50
- type: messageType
51
- });
52
- }
53
- }).catch((err) => {
54
- console.warn("publishSwcAppMessage async error:", err);
55
- });
56
- } else {
44
+ const extractValue = (v) => {
45
+ const keyToUse = options?.valueKey ?? PUBLISH_SWC_APP_MESSAGE_METADATA_KEY;
46
+ if (v && typeof v === "object" && keyToUse in v) {
47
+ return v[keyToUse];
48
+ }
49
+ return v;
50
+ };
51
+ const publishMessage = (data) => {
57
52
  const appHost = import_Utils.SwcUtils.getAppHost(this);
58
53
  if (appHost) {
59
54
  appHost.publishMessage({
60
55
  publisher: this,
61
- data: result,
56
+ data,
62
57
  type: messageType
63
58
  });
64
59
  }
60
+ };
61
+ if (result instanceof Promise) {
62
+ result.then((data) => {
63
+ const extracted = extractValue(data);
64
+ publishMessage(extracted);
65
+ }).catch((err) => {
66
+ console.warn("publishSwcAppMessage async error:", err);
67
+ });
68
+ } else {
69
+ const extracted = extractValue(result);
70
+ publishMessage(extracted);
65
71
  }
66
72
  return result;
67
73
  };
68
74
  return descriptor;
69
75
  };
70
76
  }
71
- function publishSwcAppMessage(targetOrMessageType, propertyKey, descriptor) {
72
- if (targetOrMessageType && typeof targetOrMessageType === "object" && propertyKey && (typeof propertyKey === "string" || typeof propertyKey === "symbol") && descriptor) {
73
- const target = targetOrMessageType;
74
- return createPublishSwcAppMessage()(target, propertyKey, descriptor);
77
+ function publishSwcAppMessage(targetOrMessageTypeOrOptions, propertyKeyOrOptions, descriptor) {
78
+ if (targetOrMessageTypeOrOptions && typeof targetOrMessageTypeOrOptions === "object" && propertyKeyOrOptions && (typeof propertyKeyOrOptions === "string" || typeof propertyKeyOrOptions === "symbol") && descriptor) {
79
+ const target = targetOrMessageTypeOrOptions;
80
+ return createPublishSwcAppMessage()(target, propertyKeyOrOptions, descriptor);
75
81
  }
76
82
  let messageType;
77
- if (typeof targetOrMessageType === "string") {
78
- messageType = targetOrMessageType;
83
+ let options;
84
+ if (typeof targetOrMessageTypeOrOptions === "string") {
85
+ messageType = targetOrMessageTypeOrOptions;
86
+ if (typeof propertyKeyOrOptions === "object" && propertyKeyOrOptions !== null) {
87
+ options = propertyKeyOrOptions;
88
+ }
89
+ } else if (typeof targetOrMessageTypeOrOptions === "object" && targetOrMessageTypeOrOptions !== null) {
90
+ options = targetOrMessageTypeOrOptions;
91
+ messageType = options.messageType;
79
92
  }
80
- return createPublishSwcAppMessage(messageType);
93
+ return createPublishSwcAppMessage(messageType, options);
81
94
  }
95
+ const publish = publishSwcAppMessage;
82
96
  const getPublishSwcAppMessageMetadata = (target) => {
83
97
  const constructor = target instanceof Function ? target : target.constructor;
84
98
  return import_core.ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/publishSwcAppMessage.ts"],
4
- "sourcesContent": ["import {ReflectUtils} from '@dooboostore/core';\nimport {SwcUtils} from '../utils/Utils';\n\nexport const PUBLISH_SWC_APP_MESSAGE_METADATA_KEY = Symbol.for('simple-web-component:publish-swc-app-message');\n\nexport interface PublishSwcAppMessageMetadata {\n propertyKey: string | symbol;\n messageType?: string;\n}\n\nexport interface PublishSwcAppMessageOptions {\n messageType?: string;\n}\n\nfunction createPublishSwcAppMessage(messageType?: string): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor) as PublishSwcAppMessageMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, messageType });\n \n if (!descriptor) {\n return descriptor;\n }\n\n // \uBA54\uC11C\uB4DC \uB798\uD551 - \uC6D0\uBCF8 \uBA54\uC11C\uB4DC\uC758 \uBC18\uD658\uAC12\uC744 \uCEA1\uCC98\uD558\uC5EC \uBA54\uC2DC\uC9C0 \uBC1C\uD589\n const originalMethod = descriptor.value;\n descriptor.value = function (...args: any[]) {\n // \uC6D0\uBCF8 \uBA54\uC11C\uB4DC \uC2E4\uD589\n const result = originalMethod.apply(this, args);\n \n // Promise \uCCB4\uD06C\n if (result instanceof Promise) {\n result.then((data) => {\n // appHost \uCC3E\uC544\uC11C \uBA54\uC2DC\uC9C0 \uBC1C\uD589\n const appHost = SwcUtils.getAppHost(this as HTMLElement);\n if (appHost) {\n appHost.publishMessage({\n publisher: this,\n data,\n type: messageType\n });\n }\n }).catch((err) => {\n console.warn('publishSwcAppMessage async error:', err);\n });\n } else {\n // \uB3D9\uAE30 \uD638\uCD9C - \uBC14\uB85C \uBA54\uC2DC\uC9C0 \uBC1C\uD589\n const appHost = SwcUtils.getAppHost(this as HTMLElement);\n if (appHost) {\n appHost.publishMessage({\n publisher: this,\n data: result,\n type: messageType\n });\n }\n }\n \n return result;\n };\n\n return descriptor;\n };\n}\n\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uC9C1\uC811 \uC0AC\uC6A9 (\uAD04\uD638 \uC5C6\uC74C)\nexport function publishSwcAppMessage(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C)\nexport function publishSwcAppMessage(): MethodDecorator;\nexport function publishSwcAppMessage(messageType: string): MethodDecorator;\n\nexport function publishSwcAppMessage(targetOrMessageType?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {\n // \uC9C1\uC811 \uB370\uCF54\uB808\uC774\uD130\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC5C6\uC74C): @publishSwcAppMessage\n if (targetOrMessageType && typeof targetOrMessageType === 'object' && \n propertyKey && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol') &&\n descriptor) {\n const target = targetOrMessageType;\n return createPublishSwcAppMessage()(target, propertyKey, descriptor);\n }\n\n // \uD568\uC218\uB85C \uD638\uCD9C\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC788\uC74C): @publishSwcAppMessage() / @publishSwcAppMessage('messageType')\n let messageType: string | undefined;\n\n if (typeof targetOrMessageType === 'string') {\n // \uBA54\uC2DC\uC9C0 \uD0C0\uC785 \uC804\uB2EC: @publishSwcAppMessage('messageType')\n messageType = targetOrMessageType;\n }\n\n return createPublishSwcAppMessage(messageType);\n}\n\n// Helper function to retrieve publish message metadata\nexport const getPublishSwcAppMessageMetadata = (target: any): PublishSwcAppMessageMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor);\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAC3B,mBAAuB;AAEhB,MAAM,uCAAuC,OAAO,IAAI,8CAA8C;AAW7G,SAAS,2BAA2B,aAAuC;AACzE,SAAO,CAAC,QAAgB,aAA8B,eAAoC;AACxF,UAAM,cAAc,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G,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,yBAAa,eAAe,sCAAsC,WAAW;AACtF;",
4
+ "sourcesContent": ["import {ReflectUtils} from '@dooboostore/core';\nimport {SwcUtils} from '../utils/Utils';\n\nexport const PUBLISH_SWC_APP_MESSAGE_METADATA_KEY = Symbol.for('simple-web-component:publish-swc-app-message');\n\nexport interface PublishSwcAppMessageMetadata {\n propertyKey: string | symbol;\n messageType?: string;\n}\n\nexport interface PublishSwcAppMessageOptions {\n messageType?: string;\n /**\n * Custom key to extract value from return object.\n * If not provided, uses PUBLISH_SWC_APP_MESSAGE_METADATA_KEY by default.\n * Useful when multiple @publishSwcAppMessage decorators are on the same method.\n * \n * Example:\n * @publishSwcAppMessage('event1', { valueKey: 'detail1' })\n * @publishSwcAppMessage('event2', { valueKey: 'detail2' })\n * myMethod() {\n * return {\n * detail1: { type: 'event1', data: 'value1' },\n * detail2: { type: 'event2', data: 'value2' }\n * };\n * }\n */\n valueKey?: symbol | string;\n}\n\nfunction createPublishSwcAppMessage(messageType?: string, options?: PublishSwcAppMessageOptions): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor) as PublishSwcAppMessageMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, messageType });\n \n if (!descriptor) {\n return descriptor;\n }\n\n // \uBA54\uC11C\uB4DC \uB798\uD551 - \uC6D0\uBCF8 \uBA54\uC11C\uB4DC\uC758 \uBC18\uD658\uAC12\uC744 \uCEA1\uCC98\uD558\uC5EC \uBA54\uC2DC\uC9C0 \uBC1C\uD589\n const originalMethod = descriptor.value;\n descriptor.value = function (...args: any[]) {\n // \uC6D0\uBCF8 \uBA54\uC11C\uB4DC \uC2E4\uD589\n const result = originalMethod.apply(this, args);\n\n /**\n * Extract value for this decorator from method return value\n * \n * If return value is an object with this decorator's key,\n * use that value. Otherwise use the entire return value.\n * \n * Uses valueKey from options if provided, otherwise uses PUBLISH_SWC_APP_MESSAGE_METADATA_KEY.\n */\n const extractValue = (v: any) => {\n const keyToUse = options?.valueKey ?? PUBLISH_SWC_APP_MESSAGE_METADATA_KEY;\n if (v && typeof v === 'object' && keyToUse in v) {\n return v[keyToUse];\n }\n return v;\n };\n\n const publishMessage = (data: any) => {\n // appHost \uCC3E\uC544\uC11C \uBA54\uC2DC\uC9C0 \uBC1C\uD589\n const appHost = SwcUtils.getAppHost(this as HTMLElement);\n if (appHost) {\n appHost.publishMessage({\n publisher: this,\n data,\n type: messageType\n });\n }\n };\n \n // Promise \uCCB4\uD06C\n if (result instanceof Promise) {\n result.then((data) => {\n const extracted = extractValue(data);\n publishMessage(extracted);\n }).catch((err) => {\n console.warn('publishSwcAppMessage async error:', err);\n });\n } else {\n // \uB3D9\uAE30 \uD638\uCD9C - \uBC14\uB85C \uBA54\uC2DC\uC9C0 \uBC1C\uD589\n const extracted = extractValue(result);\n publishMessage(extracted);\n }\n \n return result;\n };\n\n return descriptor;\n };\n}\n\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uC9C1\uC811 \uC0AC\uC6A9 (\uAD04\uD638 \uC5C6\uC74C)\nexport function publishSwcAppMessage(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C)\nexport function publishSwcAppMessage(): MethodDecorator;\nexport function publishSwcAppMessage(messageType: string): MethodDecorator;\nexport function publishSwcAppMessage(messageType: string, options: PublishSwcAppMessageOptions): MethodDecorator;\nexport function publishSwcAppMessage(options: PublishSwcAppMessageOptions): MethodDecorator;\n\nexport function publishSwcAppMessage(targetOrMessageTypeOrOptions?: any, propertyKeyOrOptions?: string | symbol | PublishSwcAppMessageOptions, descriptor?: PropertyDescriptor): any {\n // \uC9C1\uC811 \uB370\uCF54\uB808\uC774\uD130\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC5C6\uC74C): @publishSwcAppMessage\n if (targetOrMessageTypeOrOptions && typeof targetOrMessageTypeOrOptions === 'object' && \n propertyKeyOrOptions && (typeof propertyKeyOrOptions === 'string' || typeof propertyKeyOrOptions === 'symbol') &&\n descriptor) {\n const target = targetOrMessageTypeOrOptions;\n return createPublishSwcAppMessage()(target, propertyKeyOrOptions, descriptor);\n }\n\n // \uD568\uC218\uB85C \uD638\uCD9C\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC788\uC74C): @publishSwcAppMessage() / @publishSwcAppMessage('messageType') / @publishSwcAppMessage({...})\n let messageType: string | undefined;\n let options: PublishSwcAppMessageOptions | undefined;\n\n if (typeof targetOrMessageTypeOrOptions === 'string') {\n // \uBA54\uC2DC\uC9C0 \uD0C0\uC785 \uC804\uB2EC: @publishSwcAppMessage('messageType')\n messageType = targetOrMessageTypeOrOptions;\n if (typeof propertyKeyOrOptions === 'object' && propertyKeyOrOptions !== null) {\n options = propertyKeyOrOptions as PublishSwcAppMessageOptions;\n }\n } else if (typeof targetOrMessageTypeOrOptions === 'object' && targetOrMessageTypeOrOptions !== null) {\n // \uC635\uC158 \uAC1D\uCCB4 \uC804\uB2EC: @publishSwcAppMessage({...})\n options = targetOrMessageTypeOrOptions as PublishSwcAppMessageOptions;\n messageType = options.messageType;\n }\n\n return createPublishSwcAppMessage(messageType, options);\n}\n\n// --- Aliases: publish... ---\nexport const publish = publishSwcAppMessage;\n\n// Helper function to retrieve publish message metadata\nexport const getPublishSwcAppMessageMetadata = (target: any): PublishSwcAppMessageMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSA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C,uBAAe,SAAS;AAAA,MAC1B;AAEA,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EACT;AACF;AAUO,SAAS,qBAAqB,8BAAoC,sBAAsE,YAAsC;AAEnL,MAAI,gCAAgC,OAAO,iCAAiC,YACxE,yBAAyB,OAAO,yBAAyB,YAAY,OAAO,yBAAyB,aACrG,YAAY;AACd,UAAM,SAAS;AACf,WAAO,2BAA2B,EAAE,QAAQ,sBAAsB,UAAU;AAAA,EAC9E;AAGA,MAAI;AACJ,MAAI;AAEJ,MAAI,OAAO,iCAAiC,UAAU;AAEpD,kBAAc;AACd,QAAI,OAAO,yBAAyB,YAAY,yBAAyB,MAAM;AAC7E,gBAAU;AAAA,IACZ;AAAA,EACF,WAAW,OAAO,iCAAiC,YAAY,iCAAiC,MAAM;AAEpG,cAAU;AACV,kBAAc,QAAQ;AAAA,EACxB;AAEA,SAAO,2BAA2B,aAAa,OAAO;AACxD;AAGO,MAAM,UAAU;AAGhB,MAAM,kCAAkC,CAAC,WAA4D;AAC1G,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,yBAAa,eAAe,sCAAsC,WAAW;AACtF;",
6
6
  "names": []
7
7
  }
@@ -60,6 +60,8 @@ function subscribeSwcAppRouteChangeWhileConnected(targetOrOptions, propertyKeyOr
60
60
  }
61
61
  const getSubscribeSwcAppRouteChangeWhileConnectedMetadata = (target) => {
62
62
  const constructor = target instanceof Function ? target : target.constructor;
63
- return import_core.ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor);
63
+ const results = import_core.ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor);
64
+ if (!results) return [];
65
+ return [...results].sort((a, b) => (a.options?.order ?? 0) - (b.options?.order ?? 0));
64
66
  };
65
67
  //# sourceMappingURL=subscribeSwcAppRouteChangeWhileConnected.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts"],
4
- "sourcesContent": ["import {ReflectUtils} from '@dooboostore/core';\nimport {Router} from '@dooboostore/core-web';\nimport {HelperHostSet} from '../types';\n\nexport const SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY = Symbol.for('simple-web-component:subscribe-swc-app-route-change-while-connected');\n\nexport type RoutePathType = string | string[] | ((currentThis: any) => string | string[]);\n\nexport interface SwcAppRouteChangeSubscriberMetadata {\n propertyKey: string | symbol;\n options?: SwcAppRouteChangeOptions;\n}\n\nexport interface SwcAppRouteChangeOptions {\n path?: RoutePathType;\n filter?: (router: Router, meta: {currentThis: any, helper: HelperHostSet}) => boolean;\n order?: number;\n}\n\nfunction createSubscribeSwcAppRouteChangeWhileConnected(options?: SwcAppRouteChangeOptions): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const pathPattern = options?.path;\n const filter = options?.filter;\n\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor) as SwcAppRouteChangeSubscriberMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, options });\n\n return descriptor;\n };\n}\n\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uC9C1\uC811 \uC0AC\uC6A9 (\uAD04\uD638 \uC5C6\uC74C)\nexport function subscribeSwcAppRouteChangeWhileConnected(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C)\nexport function subscribeSwcAppRouteChangeWhileConnected(): MethodDecorator;\nexport function subscribeSwcAppRouteChangeWhileConnected(pathPattern: RoutePathType): MethodDecorator;\nexport function subscribeSwcAppRouteChangeWhileConnected(pathPattern: RoutePathType, config: Omit<SwcAppRouteChangeOptions, 'path'>): MethodDecorator;\nexport function subscribeSwcAppRouteChangeWhileConnected(options: SwcAppRouteChangeOptions): MethodDecorator;\n\n// \uC2E4\uC81C \uAD6C\uD604 (\uC774\uC911 \uBAA8\uB4DC)\nexport function subscribeSwcAppRouteChangeWhileConnected(targetOrOptions?: any, propertyKeyOrConfig?: any, descriptor?: PropertyDescriptor): any {\n // \uC9C1\uC811 \uB370\uCF54\uB808\uC774\uD130\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC5C6\uC74C): @subscribeSwcAppRouteChangeWhileConnected\n // propertyKey\uAC00 string | symbol\uC774\uACE0 descriptor\uAC00 \uC788\uC73C\uBA74 \uC9C1\uC811 \uC0AC\uC6A9\n if (propertyKeyOrConfig && (typeof propertyKeyOrConfig === 'string' || typeof propertyKeyOrConfig === 'symbol')) {\n return createSubscribeSwcAppRouteChangeWhileConnected({})(targetOrOptions, propertyKeyOrConfig, descriptor);\n }\n\n // \uD568\uC218\uB85C \uD638\uCD9C\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC788\uC74C): @subscribeSwcAppRouteChangeWhileConnected() / @subscribeSwcAppRouteChangeWhileConnected('/path')\n let options: SwcAppRouteChangeOptions = {};\n\n if (Array.isArray(targetOrOptions)) {\n // \uBC30\uC5F4: @subscribeSwcAppRouteChangeWhileConnected(['/path1', '/path2'])\n // \uB610\uB294: @subscribeSwcAppRouteChangeWhileConnected(['/path1', '/path2'], { order: 1 })\n options.path = targetOrOptions;\n if (propertyKeyOrConfig && typeof propertyKeyOrConfig === 'object') {\n options = { ...options, ...propertyKeyOrConfig };\n }\n } else if (typeof targetOrOptions === 'string' || typeof targetOrOptions === 'function') {\n // \uBB38\uC790\uC5F4 \uB610\uB294 \uD568\uC218: @subscribeSwcAppRouteChangeWhileConnected('/path')\n // \uB610\uB294: @subscribeSwcAppRouteChangeWhileConnected('/path', { order: 1 })\n options.path = targetOrOptions;\n if (propertyKeyOrConfig && typeof propertyKeyOrConfig === 'object') {\n options = { ...options, ...propertyKeyOrConfig };\n }\n } else if (targetOrOptions && typeof targetOrOptions === 'object') {\n // \uAC1D\uCCB4: @subscribeSwcAppRouteChangeWhileConnected({ path: '/path', filter: ..., order: 1 })\n options = targetOrOptions;\n }\n\n return createSubscribeSwcAppRouteChangeWhileConnected(options);\n}\n\n// Helper function to retrieve route change subscribers metadata\nexport const getSubscribeSwcAppRouteChangeWhileConnectedMetadata = (target: any): SwcAppRouteChangeSubscriberMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor);\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAIpB,MAAM,8DAA8D,OAAO,IAAI,qEAAqE;AAe3J,SAAS,+CAA+C,SAAqD;AAC3G,SAAO,CAAC,QAAgB,aAA8B,eAAoC;AACxF,UAAM,cAAc,SAAS;AAC7B,UAAM,SAAS,SAAS;AAExB,UAAM,cAAc,OAAO;AAC3B,QAAI,OAAO,yBAAa,eAAe,6DAA6D,WAAW;AAC/G,QAAI,CAAC,MAAM;AACT,aAAO,CAAC;AACR,+BAAa,eAAe,6DAA6D,MAAM,WAAW;AAAA,IAC5G;AACA,SAAK,KAAK,EAAE,aAAa,QAAQ,CAAC;AAElC,WAAO;AAAA,EACT;AACF;AAWO,SAAS,yCAAyC,iBAAuB,qBAA2B,YAAsC;AAG/I,MAAI,wBAAwB,OAAO,wBAAwB,YAAY,OAAO,wBAAwB,WAAW;AAC/G,WAAO,+CAA+C,CAAC,CAAC,EAAE,iBAAiB,qBAAqB,UAAU;AAAA,EAC5G;AAGA,MAAI,UAAoC,CAAC;AAEzC,MAAI,MAAM,QAAQ,eAAe,GAAG;AAGlC,YAAQ,OAAO;AACf,QAAI,uBAAuB,OAAO,wBAAwB,UAAU;AAClE,gBAAU,EAAE,GAAG,SAAS,GAAG,oBAAoB;AAAA,IACjD;AAAA,EACF,WAAW,OAAO,oBAAoB,YAAY,OAAO,oBAAoB,YAAY;AAGvF,YAAQ,OAAO;AACf,QAAI,uBAAuB,OAAO,wBAAwB,UAAU;AAClE,gBAAU,EAAE,GAAG,SAAS,GAAG,oBAAoB;AAAA,IACjD;AAAA,EACF,WAAW,mBAAmB,OAAO,oBAAoB,UAAU;AAEjE,cAAU;AAAA,EACZ;AAEA,SAAO,+CAA+C,OAAO;AAC/D;AAGO,MAAM,sDAAsD,CAAC,WAAmE;AACrI,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,yBAAa,eAAe,6DAA6D,WAAW;AAC7G;",
4
+ "sourcesContent": ["import {ReflectUtils} from '@dooboostore/core';\nimport {Router} from '@dooboostore/core-web';\nimport {HelperHostSet} from '../types';\n\nexport const SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY = Symbol.for('simple-web-component:subscribe-swc-app-route-change-while-connected');\n\nexport type RoutePathType = string | string[] | ((currentThis: any) => string | string[]);\n\nexport interface SwcAppRouteChangeSubscriberMetadata {\n propertyKey: string | symbol;\n options?: SwcAppRouteChangeOptions;\n}\n\nexport interface SwcAppRouteChangeOptions {\n path?: RoutePathType;\n filter?: (router: Router, meta: {currentThis: any, helper: HelperHostSet}) => boolean;\n order?: number;\n}\n\nfunction createSubscribeSwcAppRouteChangeWhileConnected(options?: SwcAppRouteChangeOptions): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const pathPattern = options?.path;\n const filter = options?.filter;\n\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor) as SwcAppRouteChangeSubscriberMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, options });\n\n return descriptor;\n };\n}\n\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uC9C1\uC811 \uC0AC\uC6A9 (\uAD04\uD638 \uC5C6\uC74C)\nexport function subscribeSwcAppRouteChangeWhileConnected(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C)\nexport function subscribeSwcAppRouteChangeWhileConnected(): MethodDecorator;\nexport function subscribeSwcAppRouteChangeWhileConnected(pathPattern: RoutePathType): MethodDecorator;\nexport function subscribeSwcAppRouteChangeWhileConnected(pathPattern: RoutePathType, config: Omit<SwcAppRouteChangeOptions, 'path'>): MethodDecorator;\nexport function subscribeSwcAppRouteChangeWhileConnected(options: SwcAppRouteChangeOptions): MethodDecorator;\n\n// \uC2E4\uC81C \uAD6C\uD604 (\uC774\uC911 \uBAA8\uB4DC)\nexport function subscribeSwcAppRouteChangeWhileConnected(targetOrOptions?: any, propertyKeyOrConfig?: any, descriptor?: PropertyDescriptor): any {\n // \uC9C1\uC811 \uB370\uCF54\uB808\uC774\uD130\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC5C6\uC74C): @subscribeSwcAppRouteChangeWhileConnected\n // propertyKey\uAC00 string | symbol\uC774\uACE0 descriptor\uAC00 \uC788\uC73C\uBA74 \uC9C1\uC811 \uC0AC\uC6A9\n if (propertyKeyOrConfig && (typeof propertyKeyOrConfig === 'string' || typeof propertyKeyOrConfig === 'symbol')) {\n return createSubscribeSwcAppRouteChangeWhileConnected({})(targetOrOptions, propertyKeyOrConfig, descriptor);\n }\n\n // \uD568\uC218\uB85C \uD638\uCD9C\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC788\uC74C): @subscribeSwcAppRouteChangeWhileConnected() / @subscribeSwcAppRouteChangeWhileConnected('/path')\n let options: SwcAppRouteChangeOptions = {};\n\n if (Array.isArray(targetOrOptions)) {\n // \uBC30\uC5F4: @subscribeSwcAppRouteChangeWhileConnected(['/path1', '/path2'])\n // \uB610\uB294: @subscribeSwcAppRouteChangeWhileConnected(['/path1', '/path2'], { order: 1 })\n options.path = targetOrOptions;\n if (propertyKeyOrConfig && typeof propertyKeyOrConfig === 'object') {\n options = { ...options, ...propertyKeyOrConfig };\n }\n } else if (typeof targetOrOptions === 'string' || typeof targetOrOptions === 'function') {\n // \uBB38\uC790\uC5F4 \uB610\uB294 \uD568\uC218: @subscribeSwcAppRouteChangeWhileConnected('/path')\n // \uB610\uB294: @subscribeSwcAppRouteChangeWhileConnected('/path', { order: 1 })\n options.path = targetOrOptions;\n if (propertyKeyOrConfig && typeof propertyKeyOrConfig === 'object') {\n options = { ...options, ...propertyKeyOrConfig };\n }\n } else if (targetOrOptions && typeof targetOrOptions === 'object') {\n // \uAC1D\uCCB4: @subscribeSwcAppRouteChangeWhileConnected({ path: '/path', filter: ..., order: 1 })\n options = targetOrOptions;\n }\n\n return createSubscribeSwcAppRouteChangeWhileConnected(options);\n}\n\n// Helper function to retrieve route change subscribers metadata\nexport const getSubscribeSwcAppRouteChangeWhileConnectedMetadata = (target: any): SwcAppRouteChangeSubscriberMetadata[] => {\n const constructor = target instanceof Function ? target : target.constructor;\n const results = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor);\n if (!results) return [];\n \n // Sort by order (default 0 if not specified)\n return [...results].sort((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AAkB,WAAW,SAAS,OAAO;AACjE,QAAM,UAAU,yBAAa,eAAe,6DAA6D,WAAW;AACpH,MAAI,CAAC,QAAS,QAAO,CAAC;AAGtB,SAAO,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,GAAG,OAAO,EAAE,SAAS,SAAS,MAAM,EAAE,SAAS,SAAS,EAAE;AACtF;",
6
6
  "names": []
7
7
  }
@@ -85,14 +85,9 @@ function SwcAppMixin(Base) {
85
85
  );
86
86
  try {
87
87
  const routeChangeSubscribers = (0, import_decorators.getSubscribeSwcAppRouteChangeWhileConnectedMetadata)(instance);
88
- if (routeChangeSubscribers && Array.isArray(routeChangeSubscribers)) {
88
+ if (routeChangeSubscribers.length > 0) {
89
89
  console.log("[SWC-MIXIN] Route change subscribers found");
90
- const sortedSubscribers = [...routeChangeSubscribers].sort((a, b) => {
91
- const orderA = a.options?.order ?? 0;
92
- const orderB = b.options?.order ?? 0;
93
- return orderA - orderB;
94
- });
95
- for (const metadata of sortedSubscribers) {
90
+ for (const metadata of routeChangeSubscribers) {
96
91
  const methodName = metadata.propertyKey;
97
92
  let pathPattern = metadata.options?.path;
98
93
  const filter = metadata.options?.filter;
@@ -147,9 +142,9 @@ function SwcAppMixin(Base) {
147
142
  this._connectedInvocations++;
148
143
  }
149
144
  this._swc_connected_instance.add(instance);
150
- const connectedSwcAppCallBacks = (0, import_decorators.findAllLifecycleMetadata)(instance, import_decorators.ON_CONNECTED_SWC_APP_METADATA_KEY) ?? [];
145
+ const connectedSwcAppCallBacks = (0, import_decorators.findAllLifecycleMetadata)(instance, import_decorators.ON_CONNECTED_SWC_APP_METADATA_KEY);
151
146
  for (let connectedSwcAppCallBack of connectedSwcAppCallBacks) {
152
- await instance?._invokeLifecycleMethod?.(connectedSwcAppCallBack);
147
+ await instance?._invokeLifecycleMethod?.(connectedSwcAppCallBack.propertyKey);
153
148
  }
154
149
  if (this._childrenConnectedDoneInterval) {
155
150
  this.config.window.clearInterval(this._childrenConnectedDoneInterval);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/elements/SwcAppMixin.ts"],
4
- "sourcesContent": ["import {SwcAppInterface, SwcAppMessage} from \"../types\";\nimport {findAllLifecycleMetadata, getSubscribeSwcAppMessageWhileConnectedMetadata, getSubscribeSwcAppRouteChangeWhileConnectedMetadata, ON_CONNECTED_SWC_APP_METADATA_KEY} from \"../decorators\";\nimport {SwcAppEngine, SwcAttributeConfigType, SwcConfigType} from \"../SwcAppEngine\";\nimport {debounceTimeIntervalLock, FunctionUtils, Subscription} from \"@dooboostore/core\";\nimport {RouterEventType} from \"@dooboostore/core-web\";\nimport {SwcUtils} from \"../utils/Utils\";\n\nexport const isSSR = (i: HTMLElement) => {\n return i.hasAttribute('swc-use-ssr');\n}\nexport const setSSRAttribute = (i: HTMLElement) => {\n i.setAttribute('swc-use-ssr', (i as any)._swcId ?? '');\n}\nexport const removeSSRAttribute = (i: HTMLElement) => {\n i.removeAttribute('swc-use-ssr');\n}\n\n/**\n * SwcAppMixin: SwcApp \uAE30\uB2A5\uC744 \uBAA8\uB4E0 HTMLElement\uC5D0 \uCD94\uAC00\uD560 \uC218 \uC788\uB294 Mixin\n * \n * \uC0AC\uC6A9 \uC608:\n * @elementDefine('custom-app', { window: w })\n * class CustomApp extends SwcAppMixin(w.HTMLElement) implements SwcAppInterface {\n * // \uCD94\uAC00 \uAE30\uB2A5 \uAD6C\uD604\n * }\n */\nexport function SwcAppMixin<T extends { new(...args: any[]): HTMLElement }>(Base: T) {\n return class SwcAppMixinClass extends Base implements SwcAppInterface {\n __swc_engine = new SwcAppEngine(this as any);\n _swc_connected_instance = new Set<any>();\n _routerSubscription?: Subscription;\n _lastRouterEvent?: RouterEventType;\n _routeChangeInvocations = 0;\n _connectedInvocations = 0;\n\n _childrenRouteChangedInterval: any;\n _childrenConnectedDoneInterval: any;\n\n /**\n * Safari is \uC18D\uC131 \uCC98\uB9AC\n * Safari polyfill\uC5D0\uC11C\uB294 \uC790\uC2DD\uBD80\uD130 \uB9CC\uB4E4\uC5B4\uC9C0\uACE0 \uBD80\uBAA8\uAC00 \uB9CC\uB4E4\uC5B4\uC9C0\uBBC0\uB85C\n * \uBD80\uBAA8\uAC00 \uC790\uC2DD\uB4E4\uC744 \uAC15\uC81C\uB85C \uB4F1\uB85D\uD574\uC8FC\uB294 \uD615\uD0DC\uB85C \uCC98\uB9AC\n */\n _connected_safari_and_standby = [];\n\n constructor(...args: any[]) {\n super(...args);\n console.log('[SWC-APP-MIXIN] constructor')\n }\n\n get simpleApplication() {\n return this.__swc_engine.simpleApplication;\n }\n\n get config() {\n return this.__swc_engine?.config;\n }\n\n get router() {\n return this.__swc_engine?.router;\n }\n\n async _invokeRouteChangeSubscribers(instance: HTMLElement, re: RouterEventType) {\n if (instance.isConnected === false) return;\n\n this._routeChangeInvocations++;\n\n if (this._childrenRouteChangedInterval) {\n this.config.window.clearInterval(this._childrenRouteChangedInterval);\n }\n const intervalConfig = {setInterval: this.config.window.setInterval.bind(this.config.window), clearInterval: this.config.window.clearInterval.bind(this.config.window)};\n this._childrenRouteChangedInterval = debounceTimeIntervalLock(\n () => this._routeChangeInvocations === 0,\n () => {\n this._childrenRouteChangedInterval = null;\n this.config.onChildrenRouteChanged?.(re, this)\n },\n this.config?.childrenConnectedDoneCheckIntervalTime ?? 30,\n intervalConfig\n );\n\n try {\n const routeChangeSubscribers = getSubscribeSwcAppRouteChangeWhileConnectedMetadata(instance);\n if (routeChangeSubscribers && Array.isArray(routeChangeSubscribers)) {\n console.log('[SWC-MIXIN] Route change subscribers found')\n \n // Sort by order (default 0 if not specified)\n const sortedSubscribers = [...routeChangeSubscribers].sort((a, b) => {\n const orderA = a.options?.order ?? 0;\n const orderB = b.options?.order ?? 0;\n return orderA - orderB;\n });\n \n // Execute subscribers in order, stop if one returns a value\n for (const metadata of sortedSubscribers) {\n const methodName = metadata.propertyKey;\n let pathPattern = metadata.options?.path as any;\n const filter = metadata.options?.filter;\n\n if (typeof pathPattern === 'function') {\n pathPattern = (pathPattern as Function)(instance);\n }\n\n let pathMatched = false;\n let pathData: any = null;\n\n if (!pathPattern) {\n pathMatched = true;\n pathData = {};\n } else if (Array.isArray(pathPattern)) {\n for (const pattern of pathPattern) {\n const data = SwcUtils.parsePathPattern(pattern, re.path || '/');\n if (data !== null) {\n pathMatched = true;\n pathData = data;\n break;\n }\n }\n } else {\n pathData = SwcUtils.parsePathPattern(pathPattern, re.path || '/');\n pathMatched = pathData !== null;\n }\n\n const hostSet = SwcUtils.getHelperAndHostSet(this.config.window, this);\n const filterPassed = !filter || filter(this.router!, {helper:hostSet, currentThis:instance});\n\n if (pathMatched && filterPassed && instance[methodName]) {\n const result = await instance[methodName]({...re, pathData: pathData});\n // If handler returns a value, stop propagation to next handlers\n if (result !== undefined && result !== null) {\n break;\n }\n }\n }\n }\n } finally {\n if (this.config?.ssr) {\n setSSRAttribute(instance);\n } else {\n removeSSRAttribute(instance);\n }\n this._routeChangeInvocations = Math.max(0, this._routeChangeInvocations - 1);\n }\n }\n\n async _connected(instance: HTMLElement, option?: { noIncrements: boolean }) {\n if (instance) {\n if (!this.simpleApplication && !this.config) {\n this._connected_safari_and_standby.push(instance);\n return;\n }\n\n this.config.onConnectedChildBefore?.(instance);\n if (!option?.noIncrements) {\n this._connectedInvocations++;\n }\n this._swc_connected_instance.add(instance);\n\n const connectedSwcAppCallBacks = findAllLifecycleMetadata(instance, ON_CONNECTED_SWC_APP_METADATA_KEY) ?? [];\n for (let connectedSwcAppCallBack of connectedSwcAppCallBacks) {\n await (instance as any)?._invokeLifecycleMethod?.(connectedSwcAppCallBack);\n }\n\n if (this._childrenConnectedDoneInterval) {\n this.config.window.clearInterval(this._childrenConnectedDoneInterval);\n }\n const intervalConfig = {setInterval: this.config.window.setInterval.bind(this.config.window), clearInterval: this.config.window.clearInterval.bind(this.config.window)};\n this._childrenConnectedDoneInterval = debounceTimeIntervalLock(\n () => this._connectedInvocations === 0,\n () => {\n this._childrenConnectedDoneInterval = null;\n this.config.onChildrenConnectedDone?.(this)\n },\n this.config?.childrenConnectedDoneCheckIntervalTime ?? 30,\n intervalConfig\n );\n\n if (this.simpleApplication) {\n try {\n if (this.router && this._lastRouterEvent) {\n await this._invokeRouteChangeSubscribers(instance, this._lastRouterEvent!);\n }\n } catch (e) {\n throw e;\n }\n }\n\n if (this.config?.ssr) {\n setSSRAttribute(instance);\n } else {\n removeSSRAttribute(instance);\n }\n }\n\n this.config.onConnectedChildAfter?.(instance);\n return this;\n }\n\n async _connectedDone(instance: any) {\n try {\n // \uB0B4\uBD80 \uC5F0\uACB0 \uCC98\uB9AC \uB85C\uC9C1\n } finally {\n this._connectedInvocations = Math.max(0, this._connectedInvocations - 1);\n }\n }\n\n _disconnected(instance: any) {\n if (instance) {\n this._swc_connected_instance.delete(instance);\n this.config?.onDisconnectedChildAfter?.(instance);\n }\n }\n\n async _handleRouteChange(route: RouterEventType) {\n this._lastRouterEvent = route;\n const swcConnectedInstance = Array.from(this._swc_connected_instance);\n const ps = swcConnectedInstance.map((instance: any) => this._invokeRouteChangeSubscribers(instance, route));\n await Promise.allSettled(ps);\n }\n\n async connect(config?: SwcAttributeConfigType) {\n console.log('[SWC-MIXIN] connect')\n const swcConfig = {\n routeType: 'element',\n window: config?.window,\n ...config\n } as SwcConfigType;\n\n await this.__swc_engine.connect(swcConfig);\n\n // Safari is \uC18D\uC131 \uCC98\uB9AC\n this._connected_safari_and_standby.forEach((instance: any) => {\n this._connected(instance, {noIncrements: true});\n });\n\n // \uB77C\uC6B0\uD130 \uBCC0\uACBD \uAD6C\uB3C5\n if (!this._routerSubscription && this.router) {\n const config = this.__swc_engine.config;\n\n this._routerSubscription = this.router.observable.subscribe(async (route: RouterEventType) => {\n console.log('[SWC-MIXIN] Router event received:', route.triggerPoint);\n if (route.triggerPoint === 'end') {\n await this._handleRouteChange(route);\n }\n });\n\n if (config?.path) {\n console.log('[DEBUG] Navigating to initial path:', config.path);\n }\n }\n }\n\n connectedCallback() {\n // \uBD80\uBAA8 \uD074\uB798\uC2A4\uC758 connectedCallback \uD638\uCD9C\n // @ts-ignore\n super.connectedCallback?.();\n\n const configStr = this.getAttribute('swc-get-application-config');\n const win = this.ownerDocument?.defaultView || window;\n if (configStr && win) {\n try {\n const userConfig = FunctionUtils.executeReturn({\n script: configStr,\n context: this,\n args: SwcUtils.getHelperAndHostSet(win, this)\n });\n this.connect(userConfig);\n } catch (e) {\n console.error('[SWC-MIXIN] Script execution failed:', e);\n }\n }\n\n this._connected(this);\n this.__swc_engine?.config?.onConnected?.(this);\n this._connectedDone(this);\n }\n\n disconnectedCallback() {\n // \uBD80\uBAA8 \uD074\uB798\uC2A4\uC758 disconnectedCallback \uD638\uCD9C\n // @ts-ignore\n super.disconnectedCallback?.();\n \n this._routerSubscription?.unsubscribe();\n this._routerSubscription = undefined;\n this._lastRouterEvent = undefined;\n this.__swc_engine.disconnect();\n this.__swc_engine?.config?.onDisconnected?.(this);\n this._disconnected(this);\n }\n\n async routing(path: string) {\n await this.router?.go(path);\n }\n\n back(): void {\n this.router?.back();\n }\n\n forward(): void {\n this.router?.forward();\n }\n\n reload(): void {\n this.router?.reload();\n }\n\n publishMessage(message: SwcAppMessage): void {\n this._swc_connected_instance.forEach((instance: any) => {\n this._invokeMessageSubscribers(instance, message);\n });\n }\n\n _invokeMessageSubscribers(instance: any, message: SwcAppMessage) {\n const messageSubscribers = getSubscribeSwcAppMessageWhileConnectedMetadata(instance);\n if (messageSubscribers && Array.isArray(messageSubscribers)) {\n messageSubscribers.forEach(metadata => {\n const methodName = metadata.propertyKey;\n const messageType = metadata.messageType;\n const filter = metadata.filter;\n\n let typeMatched = false;\n if (!messageType) {\n typeMatched = true;\n } else if (message.type === messageType) {\n typeMatched = true;\n }\n\n let filterMatched = true;\n if (filter && typeMatched) {\n filterMatched = filter(message, instance);\n }\n\n if (typeMatched && filterMatched && typeof instance[methodName] === 'function') {\n instance[methodName](message);\n }\n });\n }\n }\n };\n}\n"],
5
- "mappings": ";;;;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AAA,IACtB;AAAA,IAEA,eAAe,SAA8B;AAC3C,WAAK,wBAAwB,QAAQ,CAAC,aAAkB;AACtD,aAAK,0BAA0B,UAAU,OAAO;AAAA,MAClD,CAAC;AAAA,IACH;AAAA,IAEA,0BAA0B,UAAe,SAAwB;AAC/D,YAAM,yBAAqB,mEAAgD,QAAQ;AACnF,UAAI,sBAAsB,MAAM,QAAQ,kBAAkB,GAAG;AAC3D,2BAAmB,QAAQ,cAAY;AACrC,gBAAM,aAAa,SAAS;AAC5B,gBAAM,cAAc,SAAS;AAC7B,gBAAM,SAAS,SAAS;AAExB,cAAI,cAAc;AAClB,cAAI,CAAC,aAAa;AAChB,0BAAc;AAAA,UAChB,WAAW,QAAQ,SAAS,aAAa;AACvC,0BAAc;AAAA,UAChB;AAEA,cAAI,gBAAgB;AACpB,cAAI,UAAU,aAAa;AACzB,4BAAgB,OAAO,SAAS,QAAQ;AAAA,UAC1C;AAEA,cAAI,eAAe,iBAAiB,OAAO,SAAS,UAAU,MAAM,YAAY;AAC9E,qBAAS,UAAU,EAAE,OAAO;AAAA,UAC9B;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import {SwcAppInterface, SwcAppMessage} from \"../types\";\nimport {findAllLifecycleMetadata, getSubscribeSwcAppMessageWhileConnectedMetadata, getSubscribeSwcAppRouteChangeWhileConnectedMetadata, ON_CONNECTED_SWC_APP_METADATA_KEY} from \"../decorators\";\nimport {SwcAppEngine, SwcAttributeConfigType, SwcConfigType} from \"../SwcAppEngine\";\nimport {debounceTimeIntervalLock, FunctionUtils, Subscription} from \"@dooboostore/core\";\nimport {RouterEventType} from \"@dooboostore/core-web\";\nimport {SwcUtils} from \"../utils/Utils\";\n\nexport const isSSR = (i: HTMLElement) => {\n return i.hasAttribute('swc-use-ssr');\n}\nexport const setSSRAttribute = (i: HTMLElement) => {\n i.setAttribute('swc-use-ssr', (i as any)._swcId ?? '');\n}\nexport const removeSSRAttribute = (i: HTMLElement) => {\n i.removeAttribute('swc-use-ssr');\n}\n\n/**\n * SwcAppMixin: SwcApp \uAE30\uB2A5\uC744 \uBAA8\uB4E0 HTMLElement\uC5D0 \uCD94\uAC00\uD560 \uC218 \uC788\uB294 Mixin\n * \n * \uC0AC\uC6A9 \uC608:\n * @elementDefine('custom-app', { window: w })\n * class CustomApp extends SwcAppMixin(w.HTMLElement) implements SwcAppInterface {\n * // \uCD94\uAC00 \uAE30\uB2A5 \uAD6C\uD604\n * }\n */\nexport function SwcAppMixin<T extends { new(...args: any[]): HTMLElement }>(Base: T) {\n return class SwcAppMixinClass extends Base implements SwcAppInterface {\n __swc_engine = new SwcAppEngine(this as any);\n _swc_connected_instance = new Set<any>();\n _routerSubscription?: Subscription;\n _lastRouterEvent?: RouterEventType;\n _routeChangeInvocations = 0;\n _connectedInvocations = 0;\n\n _childrenRouteChangedInterval: any;\n _childrenConnectedDoneInterval: any;\n\n /**\n * Safari is \uC18D\uC131 \uCC98\uB9AC\n * Safari polyfill\uC5D0\uC11C\uB294 \uC790\uC2DD\uBD80\uD130 \uB9CC\uB4E4\uC5B4\uC9C0\uACE0 \uBD80\uBAA8\uAC00 \uB9CC\uB4E4\uC5B4\uC9C0\uBBC0\uB85C\n * \uBD80\uBAA8\uAC00 \uC790\uC2DD\uB4E4\uC744 \uAC15\uC81C\uB85C \uB4F1\uB85D\uD574\uC8FC\uB294 \uD615\uD0DC\uB85C \uCC98\uB9AC\n */\n _connected_safari_and_standby = [];\n\n constructor(...args: any[]) {\n super(...args);\n console.log('[SWC-APP-MIXIN] constructor')\n }\n\n get simpleApplication() {\n return this.__swc_engine.simpleApplication;\n }\n\n get config() {\n return this.__swc_engine?.config;\n }\n\n get router() {\n return this.__swc_engine?.router;\n }\n\n async _invokeRouteChangeSubscribers(instance: HTMLElement, re: RouterEventType) {\n if (instance.isConnected === false) return;\n\n this._routeChangeInvocations++;\n\n if (this._childrenRouteChangedInterval) {\n this.config.window.clearInterval(this._childrenRouteChangedInterval);\n }\n const intervalConfig = {setInterval: this.config.window.setInterval.bind(this.config.window), clearInterval: this.config.window.clearInterval.bind(this.config.window)};\n this._childrenRouteChangedInterval = debounceTimeIntervalLock(\n () => this._routeChangeInvocations === 0,\n () => {\n this._childrenRouteChangedInterval = null;\n this.config.onChildrenRouteChanged?.(re, this)\n },\n this.config?.childrenConnectedDoneCheckIntervalTime ?? 30,\n intervalConfig\n );\n\n try {\n const routeChangeSubscribers = getSubscribeSwcAppRouteChangeWhileConnectedMetadata(instance);\n if (routeChangeSubscribers.length > 0) {\n console.log('[SWC-MIXIN] Route change subscribers found')\n \n // Subscribers are already sorted by order from getSubscribeSwcAppRouteChangeWhileConnectedMetadata\n // Execute subscribers in order, stop if one returns a value\n for (const metadata of routeChangeSubscribers) {\n const methodName = metadata.propertyKey;\n let pathPattern = metadata.options?.path as any;\n const filter = metadata.options?.filter;\n\n if (typeof pathPattern === 'function') {\n pathPattern = (pathPattern as Function)(instance);\n }\n\n let pathMatched = false;\n let pathData: any = null;\n\n if (!pathPattern) {\n pathMatched = true;\n pathData = {};\n } else if (Array.isArray(pathPattern)) {\n for (const pattern of pathPattern) {\n const data = SwcUtils.parsePathPattern(pattern, re.path || '/');\n if (data !== null) {\n pathMatched = true;\n pathData = data;\n break;\n }\n }\n } else {\n pathData = SwcUtils.parsePathPattern(pathPattern, re.path || '/');\n pathMatched = pathData !== null;\n }\n\n const hostSet = SwcUtils.getHelperAndHostSet(this.config.window, this);\n const filterPassed = !filter || filter(this.router!, {helper:hostSet, currentThis:instance});\n\n if (pathMatched && filterPassed && instance[methodName]) {\n const result = await instance[methodName]({...re, pathData: pathData});\n // If handler returns a value, stop propagation to next handlers\n if (result !== undefined && result !== null) {\n break;\n }\n }\n }\n }\n } finally {\n if (this.config?.ssr) {\n setSSRAttribute(instance);\n } else {\n removeSSRAttribute(instance);\n }\n this._routeChangeInvocations = Math.max(0, this._routeChangeInvocations - 1);\n }\n }\n\n async _connected(instance: HTMLElement, option?: { noIncrements: boolean }) {\n if (instance) {\n if (!this.simpleApplication && !this.config) {\n this._connected_safari_and_standby.push(instance);\n return;\n }\n\n this.config.onConnectedChildBefore?.(instance);\n if (!option?.noIncrements) {\n this._connectedInvocations++;\n }\n this._swc_connected_instance.add(instance);\n\n const connectedSwcAppCallBacks = findAllLifecycleMetadata(instance, ON_CONNECTED_SWC_APP_METADATA_KEY);\n for (let connectedSwcAppCallBack of connectedSwcAppCallBacks) {\n await (instance as any)?._invokeLifecycleMethod?.(connectedSwcAppCallBack.propertyKey);\n }\n\n if (this._childrenConnectedDoneInterval) {\n this.config.window.clearInterval(this._childrenConnectedDoneInterval);\n }\n const intervalConfig = {setInterval: this.config.window.setInterval.bind(this.config.window), clearInterval: this.config.window.clearInterval.bind(this.config.window)};\n this._childrenConnectedDoneInterval = debounceTimeIntervalLock(\n () => this._connectedInvocations === 0,\n () => {\n this._childrenConnectedDoneInterval = null;\n this.config.onChildrenConnectedDone?.(this)\n },\n this.config?.childrenConnectedDoneCheckIntervalTime ?? 30,\n intervalConfig\n );\n\n if (this.simpleApplication) {\n try {\n if (this.router && this._lastRouterEvent) {\n await this._invokeRouteChangeSubscribers(instance, this._lastRouterEvent!);\n }\n } catch (e) {\n throw e;\n }\n }\n\n if (this.config?.ssr) {\n setSSRAttribute(instance);\n } else {\n removeSSRAttribute(instance);\n }\n }\n\n this.config.onConnectedChildAfter?.(instance);\n return this;\n }\n\n async _connectedDone(instance: any) {\n try {\n // \uB0B4\uBD80 \uC5F0\uACB0 \uCC98\uB9AC \uB85C\uC9C1\n } finally {\n this._connectedInvocations = Math.max(0, this._connectedInvocations - 1);\n }\n }\n\n _disconnected(instance: any) {\n if (instance) {\n this._swc_connected_instance.delete(instance);\n this.config?.onDisconnectedChildAfter?.(instance);\n }\n }\n\n async _handleRouteChange(route: RouterEventType) {\n this._lastRouterEvent = route;\n const swcConnectedInstance = Array.from(this._swc_connected_instance);\n const ps = swcConnectedInstance.map((instance: any) => this._invokeRouteChangeSubscribers(instance, route));\n await Promise.allSettled(ps);\n }\n\n async connect(config?: SwcAttributeConfigType) {\n console.log('[SWC-MIXIN] connect')\n const swcConfig = {\n routeType: 'element',\n window: config?.window,\n ...config\n } as SwcConfigType;\n\n await this.__swc_engine.connect(swcConfig);\n\n // Safari is \uC18D\uC131 \uCC98\uB9AC\n this._connected_safari_and_standby.forEach((instance: any) => {\n this._connected(instance, {noIncrements: true});\n });\n\n // \uB77C\uC6B0\uD130 \uBCC0\uACBD \uAD6C\uB3C5\n if (!this._routerSubscription && this.router) {\n const config = this.__swc_engine.config;\n\n this._routerSubscription = this.router.observable.subscribe(async (route: RouterEventType) => {\n console.log('[SWC-MIXIN] Router event received:', route.triggerPoint);\n if (route.triggerPoint === 'end') {\n await this._handleRouteChange(route);\n }\n });\n\n if (config?.path) {\n console.log('[DEBUG] Navigating to initial path:', config.path);\n }\n }\n }\n\n connectedCallback() {\n // \uBD80\uBAA8 \uD074\uB798\uC2A4\uC758 connectedCallback \uD638\uCD9C\n // @ts-ignore\n super.connectedCallback?.();\n\n const configStr = this.getAttribute('swc-get-application-config');\n const win = this.ownerDocument?.defaultView || window;\n if (configStr && win) {\n try {\n const userConfig = FunctionUtils.executeReturn({\n script: configStr,\n context: this,\n args: SwcUtils.getHelperAndHostSet(win, this)\n });\n this.connect(userConfig);\n } catch (e) {\n console.error('[SWC-MIXIN] Script execution failed:', e);\n }\n }\n\n this._connected(this);\n this.__swc_engine?.config?.onConnected?.(this);\n this._connectedDone(this);\n }\n\n disconnectedCallback() {\n // \uBD80\uBAA8 \uD074\uB798\uC2A4\uC758 disconnectedCallback \uD638\uCD9C\n // @ts-ignore\n super.disconnectedCallback?.();\n \n this._routerSubscription?.unsubscribe();\n this._routerSubscription = undefined;\n this._lastRouterEvent = undefined;\n this.__swc_engine.disconnect();\n this.__swc_engine?.config?.onDisconnected?.(this);\n this._disconnected(this);\n }\n\n async routing(path: string) {\n await this.router?.go(path);\n }\n\n back(): void {\n this.router?.back();\n }\n\n forward(): void {\n this.router?.forward();\n }\n\n reload(): void {\n this.router?.reload();\n }\n\n publishMessage(message: SwcAppMessage): void {\n this._swc_connected_instance.forEach((instance: any) => {\n this._invokeMessageSubscribers(instance, message);\n });\n }\n\n _invokeMessageSubscribers(instance: any, message: SwcAppMessage) {\n const messageSubscribers = getSubscribeSwcAppMessageWhileConnectedMetadata(instance);\n if (messageSubscribers && Array.isArray(messageSubscribers)) {\n messageSubscribers.forEach(metadata => {\n const methodName = metadata.propertyKey;\n const messageType = metadata.messageType;\n const filter = metadata.filter;\n\n let typeMatched = false;\n if (!messageType) {\n typeMatched = true;\n } else if (message.type === messageType) {\n typeMatched = true;\n }\n\n let filterMatched = true;\n if (filter && typeMatched) {\n filterMatched = filter(message, instance);\n }\n\n if (typeMatched && filterMatched && typeof instance[methodName] === 'function') {\n instance[methodName](message);\n }\n });\n }\n }\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAgL;AAChL,0BAAkE;AAClE,kBAAoE;AAEpE,mBAAuB;AAEhB,MAAM,QAAQ,CAAC,MAAmB;AACvC,SAAO,EAAE,aAAa,aAAa;AACrC;AACO,MAAM,kBAAkB,CAAC,MAAmB;AACjD,IAAE,aAAa,eAAgB,EAAU,UAAU,EAAE;AACvD;AACO,MAAM,qBAAqB,CAAC,MAAmB;AACpD,IAAE,gBAAgB,aAAa;AACjC;AAWO,SAAS,YAA4D,MAAS;AACnF,SAAO,MAAM,yBAAyB,KAAgC;AAAA,IAkBpE,eAAe,MAAa;AAC1B,YAAM,GAAG,IAAI;AAlBf,0CAAe,IAAI,iCAAa,IAAW;AAC3C,qDAA0B,oBAAI,IAAS;AACvC;AACA;AACA,qDAA0B;AAC1B,mDAAwB;AAExB;AACA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA,2DAAgC,CAAC;AAI/B,cAAQ,IAAI,6BAA6B;AAAA,IAC3C;AAAA,I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;AAC3B,WAAK,mBAAmB;AACxB,WAAK,aAAa,WAAW;AAC7B,WAAK,cAAc,QAAQ,iBAAiB,IAAI;AAChD,WAAK,cAAc,IAAI;AAAA,IACzB;AAAA,IAEA,MAAM,QAAQ,MAAc;AAC1B,YAAM,KAAK,QAAQ,GAAG,IAAI;AAAA,IAC5B;AAAA,IAEA,OAAa;AACX,WAAK,QAAQ,KAAK;AAAA,IACpB;AAAA,IAEA,UAAgB;AACd,WAAK,QAAQ,QAAQ;AAAA,IACvB;AAAA,IAEA,SAAe;AACb,WAAK,QAAQ,OAAO;AAAA,IACtB;AAAA,IAEA,eAAe,SAA8B;AAC3C,WAAK,wBAAwB,QAAQ,CAAC,aAAkB;AACtD,aAAK,0BAA0B,UAAU,OAAO;AAAA,MAClD,CAAC;AAAA,IACH;AAAA,IAEA,0BAA0B,UAAe,SAAwB;AAC/D,YAAM,yBAAqB,mEAAgD,QAAQ;AACnF,UAAI,sBAAsB,MAAM,QAAQ,kBAAkB,GAAG;AAC3D,2BAAmB,QAAQ,cAAY;AACrC,gBAAM,aAAa,SAAS;AAC5B,gBAAM,cAAc,SAAS;AAC7B,gBAAM,SAAS,SAAS;AAExB,cAAI,cAAc;AAClB,cAAI,CAAC,aAAa;AAChB,0BAAc;AAAA,UAChB,WAAW,QAAQ,SAAS,aAAa;AACvC,0BAAc;AAAA,UAChB;AAEA,cAAI,gBAAgB;AACpB,cAAI,UAAU,aAAa;AACzB,4BAAgB,OAAO,SAAS,QAAQ;AAAA,UAC1C;AAEA,cAAI,eAAe,iBAAiB,OAAO,SAAS,UAAU,MAAM,YAAY;AAC9E,qBAAS,UAAU,EAAE,OAAO;AAAA,UAC9B;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": ["config"]
7
7
  }
@@ -23,6 +23,11 @@ function addEventListenerDelegateAllDom(selector, type, options) {
23
23
  function addEventListenerDelegate(selector, type, options) {
24
24
  return addEventListener(selector, type, { ...options ?? {}, root: "auto", delegate: true });
25
25
  }
26
+ const event = addEventListener;
27
+ const eventDelegateLightDom = addEventListenerDelegateLightDom;
28
+ const eventDelegateShadowDom = addEventListenerDelegateShadowDom;
29
+ const eventDelegateAllDom = addEventListenerDelegateAllDom;
30
+ const eventDelegate = addEventListenerDelegate;
26
31
  function addEventListenerThis(type, options) {
27
32
  return addEventListener("$this", type, options);
28
33
  }
@@ -50,6 +55,11 @@ export {
50
55
  addEventListenerDocument,
51
56
  addEventListenerThis,
52
57
  addEventListenerWindow,
58
+ event,
59
+ eventDelegate,
60
+ eventDelegateAllDom,
61
+ eventDelegateLightDom,
62
+ eventDelegateShadowDom,
53
63
  getAddEventListenerMetadata
54
64
  };
55
65
  //# sourceMappingURL=addEventListener.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/addEventListener.ts"],
4
- "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { SpecialSelector, SwcQueryOptions, HelperHostSet } from '../types';\n\nexport interface AddEventListenerBaseOptions extends EventListenerOptions {\n capture?: boolean;\n once?: boolean;\n passive?: boolean;\n stopPropagation?: boolean;\n stopImmediatePropagation?: boolean;\n preventDefault?: boolean;\n // removeOnDisconnected?: boolean;\n delegate?: boolean;\n filter?: (target: Event | CustomEvent, meta:{currentThis: any, helper: HelperHostSet}) => boolean;\n}\n\nexport interface AddEventListenerMetadata {\n propertyKey: string | symbol;\n selector: string;\n type: string;\n options: AddEventListenerBaseOptions & SwcQueryOptions & { delegate?: boolean };\n}\n\nexport const ADD_EVENT_LISTENER_METADATA_KEY = Symbol.for('simple-web-component:add-event-listener');\n\nexport function addEventListener(target: SpecialSelector, type: string, options?: AddEventListenerBaseOptions): MethodDecorator;\nexport function addEventListener(selector: string, type: string, options?: AddEventListenerBaseOptions & SwcQueryOptions & { delegate?: boolean }): MethodDecorator;\n/**\n * @addEventListener decorator to bind events to elements.\n */\nexport function addEventListener(selectorOrTarget: string, type: string, options: any = {}): MethodDecorator {\n return (targetObj: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = targetObj.constructor;\n\n let listeners = ReflectUtils.getMetadata<AddEventListenerMetadata[]>(ADD_EVENT_LISTENER_METADATA_KEY, constructor);\n if (!listeners) {\n listeners = [];\n ReflectUtils.defineMetadata(ADD_EVENT_LISTENER_METADATA_KEY, listeners, constructor);\n }\n\n listeners.push({ propertyKey, selector: selectorOrTarget, type, options });\n };\n}\n\n\nexport function addEventListenerDelegateLightDom(selector: string, type: string, options?: Omit<AddEventListenerBaseOptions, 'delegate'>): MethodDecorator {\n return addEventListener(selector, type, {...options??{}, root:'light', delegate: true});\n}\n\nexport function addEventListenerDelegateShadowDom(selector: string, type: string, options?: Omit<AddEventListenerBaseOptions, 'delegate'>): MethodDecorator {\n return addEventListener(selector, type, {...options??{}, root:'shadow', delegate: true});\n}\nexport function addEventListenerDelegateAllDom(selector: string, type: string, options?: Omit<AddEventListenerBaseOptions, 'delegate'>): MethodDecorator {\n return addEventListener(selector, type, {...options??{}, root:'all', delegate: true});\n}\nexport function addEventListenerDelegate(selector: string, type: string, options?: Omit<AddEventListenerBaseOptions, 'delegate'>): MethodDecorator {\n return addEventListener(selector, type, {...options??{}, root:'auto', delegate: true});\n}\n\n/**\n * @addEventListenerThis decorator - simplified version of @addEventListener for $this selector\n */\nexport function addEventListenerThis(type: string, options?: AddEventListenerBaseOptions & SwcQueryOptions): MethodDecorator {\n return addEventListener('$this', type, options);\n}\n\n/**\n * @addEventListenerAppHost decorator - simplified version of @addEventListener for $appHost selector\n */\nexport function addEventListenerAppHost(type: string, options?: AddEventListenerBaseOptions & SwcQueryOptions): MethodDecorator {\n return addEventListener('$appHost', type, options);\n}\n\nexport function addEventListenerWindow(type: string, options?: AddEventListenerBaseOptions & SwcQueryOptions): MethodDecorator {\n return addEventListener('$window', type, options);\n}\nexport function addEventListenerDocument(type: string, options?: AddEventListenerBaseOptions & SwcQueryOptions): MethodDecorator {\n return addEventListener('$document', type, options);\n}\n\nexport const getAddEventListenerMetadata = (target: any): AddEventListenerMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);\n};\n"],
5
- "mappings": "AAAA,SAAS,oBAAoB;AAsBtB,MAAM,kCAAkC,OAAO,IAAI,yCAAyC;AAO5F,SAAS,iBAAiB,kBAA0B,MAAc,UAAe,CAAC,GAAoB;AAC3G,SAAO,CAAC,WAAmB,aAA8B,eAAmC;AAC1F,UAAM,cAAc,UAAU;AAE9B,QAAI,YAAY,aAAa,YAAwC,iCAAiC,WAAW;AACjH,QAAI,CAAC,WAAW;AACd,kBAAY,CAAC;AACb,mBAAa,eAAe,iCAAiC,WAAW,WAAW;AAAA,IACrF;AAEA,cAAU,KAAK,EAAE,aAAa,UAAU,kBAAkB,MAAM,QAAQ,CAAC;AAAA,EAC3E;AACF;AAGO,SAAS,iCAAiC,UAAkB,MAAc,SAA0E;AACzJ,SAAO,iBAAiB,UAAU,MAAM,EAAC,GAAG,WAAS,CAAC,GAAG,MAAK,SAAS,UAAU,KAAI,CAAC;AACxF;AAEO,SAAS,kCAAkC,UAAkB,MAAc,SAA0E;AAC1J,SAAO,iBAAiB,UAAU,MAAM,EAAC,GAAG,WAAS,CAAC,GAAG,MAAK,UAAU,UAAU,KAAI,CAAC;AACzF;AACO,SAAS,+BAA+B,UAAkB,MAAc,SAA0E;AACvJ,SAAO,iBAAiB,UAAU,MAAM,EAAC,GAAG,WAAS,CAAC,GAAG,MAAK,OAAO,UAAU,KAAI,CAAC;AACtF;AACO,SAAS,yBAAyB,UAAkB,MAAc,SAA0E;AACjJ,SAAO,iBAAiB,UAAU,MAAM,EAAC,GAAG,WAAS,CAAC,GAAG,MAAK,QAAQ,UAAU,KAAI,CAAC;AACvF;AAKO,SAAS,qBAAqB,MAAc,SAA0E;AAC3H,SAAO,iBAAiB,SAAS,MAAM,OAAO;AAChD;AAKO,SAAS,wBAAwB,MAAc,SAA0E;AAC9H,SAAO,iBAAiB,YAAY,MAAM,OAAO;AACnD;AAEO,SAAS,uBAAuB,MAAc,SAA0E;AAC7H,SAAO,iBAAiB,WAAW,MAAM,OAAO;AAClD;AACO,SAAS,yBAAyB,MAAc,SAA0E;AAC/H,SAAO,iBAAiB,aAAa,MAAM,OAAO;AACpD;AAEO,MAAM,8BAA8B,CAAC,WAAwD;AAClG,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,iCAAiC,WAAW;AAC9E;",
4
+ "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { SpecialSelector, SwcQueryOptions, HelperHostSet } from '../types';\n\nexport interface AddEventListenerBaseOptions extends EventListenerOptions {\n capture?: boolean;\n once?: boolean;\n passive?: boolean;\n stopPropagation?: boolean;\n stopImmediatePropagation?: boolean;\n preventDefault?: boolean;\n // removeOnDisconnected?: boolean;\n delegate?: boolean;\n filter?: (target: Event | CustomEvent, meta:{currentThis: any, helper: HelperHostSet}) => boolean;\n}\n\nexport interface AddEventListenerMetadata {\n propertyKey: string | symbol;\n selector: string;\n type: string;\n options: AddEventListenerBaseOptions & SwcQueryOptions & { delegate?: boolean };\n}\n\nexport const ADD_EVENT_LISTENER_METADATA_KEY = Symbol.for('simple-web-component:add-event-listener');\n\nexport function addEventListener(target: SpecialSelector, type: string, options?: AddEventListenerBaseOptions): MethodDecorator;\nexport function addEventListener(selector: string, type: string, options?: AddEventListenerBaseOptions & SwcQueryOptions & { delegate?: boolean }): MethodDecorator;\n/**\n * @addEventListener decorator to bind events to elements.\n */\nexport function addEventListener(selectorOrTarget: string, type: string, options: any = {}): MethodDecorator {\n return (targetObj: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = targetObj.constructor;\n\n let listeners = ReflectUtils.getMetadata<AddEventListenerMetadata[]>(ADD_EVENT_LISTENER_METADATA_KEY, constructor);\n if (!listeners) {\n listeners = [];\n ReflectUtils.defineMetadata(ADD_EVENT_LISTENER_METADATA_KEY, listeners, constructor);\n }\n\n listeners.push({ propertyKey, selector: selectorOrTarget, type, options });\n };\n}\n\n\nexport function addEventListenerDelegateLightDom(selector: string, type: string, options?: Omit<AddEventListenerBaseOptions, 'delegate'>): MethodDecorator {\n return addEventListener(selector, type, {...options??{}, root:'light', delegate: true});\n}\n\nexport function addEventListenerDelegateShadowDom(selector: string, type: string, options?: Omit<AddEventListenerBaseOptions, 'delegate'>): MethodDecorator {\n return addEventListener(selector, type, {...options??{}, root:'shadow', delegate: true});\n}\nexport function addEventListenerDelegateAllDom(selector: string, type: string, options?: Omit<AddEventListenerBaseOptions, 'delegate'>): MethodDecorator {\n return addEventListener(selector, type, {...options??{}, root:'all', delegate: true});\n}\nexport function addEventListenerDelegate(selector: string, type: string, options?: Omit<AddEventListenerBaseOptions, 'delegate'>): MethodDecorator {\n return addEventListener(selector, type, {...options??{}, root:'auto', delegate: true});\n}\n\n/**\n * @addEventListenerThis decorator - simplified version of @addEventListener for $this selector\n */\n\n// --- Aliases: event... ---\nexport const event = addEventListener;\nexport const eventDelegateLightDom = addEventListenerDelegateLightDom;\nexport const eventDelegateShadowDom = addEventListenerDelegateShadowDom;\nexport const eventDelegateAllDom = addEventListenerDelegateAllDom;\nexport const eventDelegate = addEventListenerDelegate;\nexport function addEventListenerThis(type: string, options?: AddEventListenerBaseOptions & SwcQueryOptions): MethodDecorator {\n return addEventListener('$this', type, options);\n}\n\n/**\n * @addEventListenerAppHost decorator - simplified version of @addEventListener for $appHost selector\n */\nexport function addEventListenerAppHost(type: string, options?: AddEventListenerBaseOptions & SwcQueryOptions): MethodDecorator {\n return addEventListener('$appHost', type, options);\n}\n\nexport function addEventListenerWindow(type: string, options?: AddEventListenerBaseOptions & SwcQueryOptions): MethodDecorator {\n return addEventListener('$window', type, options);\n}\nexport function addEventListenerDocument(type: string, options?: AddEventListenerBaseOptions & SwcQueryOptions): MethodDecorator {\n return addEventListener('$document', type, options);\n}\n\nexport const getAddEventListenerMetadata = (target: any): AddEventListenerMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);\n};\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAsBtB,MAAM,kCAAkC,OAAO,IAAI,yCAAyC;AAO5F,SAAS,iBAAiB,kBAA0B,MAAc,UAAe,CAAC,GAAoB;AAC3G,SAAO,CAAC,WAAmB,aAA8B,eAAmC;AAC1F,UAAM,cAAc,UAAU;AAE9B,QAAI,YAAY,aAAa,YAAwC,iCAAiC,WAAW;AACjH,QAAI,CAAC,WAAW;AACd,kBAAY,CAAC;AACb,mBAAa,eAAe,iCAAiC,WAAW,WAAW;AAAA,IACrF;AAEA,cAAU,KAAK,EAAE,aAAa,UAAU,kBAAkB,MAAM,QAAQ,CAAC;AAAA,EAC3E;AACF;AAGO,SAAS,iCAAiC,UAAkB,MAAc,SAA0E;AACzJ,SAAO,iBAAiB,UAAU,MAAM,EAAC,GAAG,WAAS,CAAC,GAAG,MAAK,SAAS,UAAU,KAAI,CAAC;AACxF;AAEO,SAAS,kCAAkC,UAAkB,MAAc,SAA0E;AAC1J,SAAO,iBAAiB,UAAU,MAAM,EAAC,GAAG,WAAS,CAAC,GAAG,MAAK,UAAU,UAAU,KAAI,CAAC;AACzF;AACO,SAAS,+BAA+B,UAAkB,MAAc,SAA0E;AACvJ,SAAO,iBAAiB,UAAU,MAAM,EAAC,GAAG,WAAS,CAAC,GAAG,MAAK,OAAO,UAAU,KAAI,CAAC;AACtF;AACO,SAAS,yBAAyB,UAAkB,MAAc,SAA0E;AACjJ,SAAO,iBAAiB,UAAU,MAAM,EAAC,GAAG,WAAS,CAAC,GAAG,MAAK,QAAQ,UAAU,KAAI,CAAC;AACvF;AAOO,MAAM,QAAQ;AACd,MAAM,wBAAwB;AAC9B,MAAM,yBAAyB;AAC/B,MAAM,sBAAsB;AAC5B,MAAM,gBAAgB;AACtB,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