@repobit/dex-store-elements 1.7.3 → 2.0.1

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 (227) hide show
  1. package/CHANGELOG.md +6 -906
  2. package/README.md +308 -283
  3. package/dist/src/actions/action.adapter.d.ts +36 -0
  4. package/dist/src/actions/action.adapter.js +183 -0
  5. package/dist/src/actions/action.adapter.js.map +1 -0
  6. package/dist/src/actions/action.attributes.d.ts +15 -0
  7. package/dist/src/actions/action.attributes.js +137 -0
  8. package/dist/src/actions/action.attributes.js.map +1 -0
  9. package/dist/src/actions/action.registry.d.ts +4 -0
  10. package/dist/src/actions/action.registry.js +119 -0
  11. package/dist/src/actions/action.registry.js.map +1 -0
  12. package/dist/src/actions/index.d.ts +3 -2
  13. package/dist/src/actions/index.js +3 -80
  14. package/dist/src/actions/index.js.map +1 -1
  15. package/dist/src/compute/compute.expand.d.ts +70 -0
  16. package/dist/src/compute/compute.expand.js +319 -0
  17. package/dist/src/compute/compute.expand.js.map +1 -0
  18. package/dist/src/compute/compute.scan.d.ts +54 -0
  19. package/dist/src/compute/compute.scan.js +160 -0
  20. package/dist/src/compute/compute.scan.js.map +1 -0
  21. package/dist/src/compute/option-resolver.d.ts +31 -0
  22. package/dist/src/compute/option-resolver.js +147 -0
  23. package/dist/src/compute/option-resolver.js.map +1 -0
  24. package/dist/src/contexts/context.compute.d.ts +12 -0
  25. package/dist/src/contexts/context.compute.js +4 -0
  26. package/dist/src/contexts/context.compute.js.map +1 -0
  27. package/dist/src/contexts/context.scope.d.ts +139 -0
  28. package/dist/src/contexts/context.scope.js +48 -0
  29. package/dist/src/contexts/context.scope.js.map +1 -0
  30. package/dist/src/controllers/controller.action-resolve.d.ts +110 -0
  31. package/dist/src/controllers/controller.action-resolve.js +203 -0
  32. package/dist/src/controllers/controller.action-resolve.js.map +1 -0
  33. package/dist/src/controllers/controller.action-topology.d.ts +59 -0
  34. package/dist/src/controllers/controller.action-topology.js +130 -0
  35. package/dist/src/controllers/controller.action-topology.js.map +1 -0
  36. package/dist/src/controllers/controller.compute.d.ts +72 -0
  37. package/dist/src/controllers/controller.compute.js +110 -0
  38. package/dist/src/controllers/controller.compute.js.map +1 -0
  39. package/dist/src/controllers/controller.resolve.d.ts +78 -0
  40. package/dist/src/controllers/controller.resolve.js +205 -0
  41. package/dist/src/controllers/controller.resolve.js.map +1 -0
  42. package/dist/src/core/action-topology.d.ts +62 -0
  43. package/dist/src/core/action-topology.js +67 -0
  44. package/dist/src/core/action-topology.js.map +1 -0
  45. package/dist/src/core/actions.d.ts +64 -0
  46. package/dist/src/core/actions.js +47 -0
  47. package/dist/src/core/actions.js.map +1 -0
  48. package/dist/src/core/node.element.d.ts +179 -0
  49. package/dist/src/core/node.element.js +573 -0
  50. package/dist/src/core/node.element.js.map +1 -0
  51. package/dist/src/core/node.scope.d.ts +374 -0
  52. package/dist/src/core/node.scope.js +558 -0
  53. package/dist/src/core/node.scope.js.map +1 -0
  54. package/dist/src/core/option-update.d.ts +11 -0
  55. package/dist/src/core/option-update.js +59 -0
  56. package/dist/src/core/option-update.js.map +1 -0
  57. package/dist/src/dsl/compilers/array/compiler.js +13 -14
  58. package/dist/src/dsl/compilers/array/compiler.js.map +1 -1
  59. package/dist/src/dsl/compilers/boolean/compiler.d.ts +1 -1
  60. package/dist/src/dsl/compilers/boolean/compiler.js +14 -27
  61. package/dist/src/dsl/compilers/boolean/compiler.js.map +1 -1
  62. package/dist/src/dsl/compilers/enum/compiler.js +7 -10
  63. package/dist/src/dsl/compilers/enum/compiler.js.map +1 -1
  64. package/dist/src/dsl/compilers/index.d.ts +1 -1
  65. package/dist/src/dsl/compilers/index.js +5 -5
  66. package/dist/src/dsl/compilers/index.js.map +1 -1
  67. package/dist/src/dsl/utilty.d.ts +0 -4
  68. package/dist/src/dsl/utilty.js +3 -30
  69. package/dist/src/dsl/utilty.js.map +1 -1
  70. package/dist/src/eta/batch.d.ts +123 -0
  71. package/dist/src/eta/batch.js +162 -0
  72. package/dist/src/eta/batch.js.map +1 -0
  73. package/dist/src/eta/batcher.d.ts +184 -0
  74. package/dist/src/eta/batcher.js +335 -0
  75. package/dist/src/eta/batcher.js.map +1 -0
  76. package/dist/src/eta/cache.d.ts +36 -0
  77. package/dist/src/eta/cache.js +56 -0
  78. package/dist/src/eta/cache.js.map +1 -0
  79. package/dist/src/eta/controller.d.ts +608 -0
  80. package/dist/src/eta/controller.js +1036 -0
  81. package/dist/src/eta/controller.js.map +1 -0
  82. package/dist/src/eta/factory.d.ts +74 -0
  83. package/dist/src/eta/factory.js +121 -0
  84. package/dist/src/eta/factory.js.map +1 -0
  85. package/dist/src/eta/idle.d.ts +39 -0
  86. package/dist/src/eta/idle.js +52 -0
  87. package/dist/src/eta/idle.js.map +1 -0
  88. package/dist/src/eta/index.d.ts +52 -0
  89. package/dist/src/eta/index.js +13 -0
  90. package/dist/src/eta/index.js.map +1 -0
  91. package/dist/src/eta/observer.d.ts +263 -0
  92. package/dist/src/eta/observer.js +263 -0
  93. package/dist/src/eta/observer.js.map +1 -0
  94. package/dist/src/eta/operations.d.ts +41 -0
  95. package/dist/src/eta/operations.js +59 -0
  96. package/dist/src/eta/operations.js.map +1 -0
  97. package/dist/src/eta/source-registry.d.ts +198 -0
  98. package/dist/src/eta/source-registry.js +267 -0
  99. package/dist/src/eta/source-registry.js.map +1 -0
  100. package/dist/src/eta/template-index.d.ts +285 -0
  101. package/dist/src/eta/template-index.js +642 -0
  102. package/dist/src/eta/template-index.js.map +1 -0
  103. package/dist/src/eta/types.d.ts +529 -0
  104. package/dist/src/eta/types.js +2 -0
  105. package/dist/src/eta/types.js.map +1 -0
  106. package/dist/src/index.d.ts +21 -9
  107. package/dist/src/index.js +22 -11
  108. package/dist/src/index.js.map +1 -1
  109. package/dist/src/nodes/node.context.d.ts +5 -3
  110. package/dist/src/nodes/node.context.js +48 -3
  111. package/dist/src/nodes/node.context.js.map +1 -1
  112. package/dist/src/nodes/node.option.d.ts +11 -31
  113. package/dist/src/nodes/node.option.js +158 -222
  114. package/dist/src/nodes/node.option.js.map +1 -1
  115. package/dist/src/nodes/node.product.d.ts +7 -11
  116. package/dist/src/nodes/node.product.js +85 -64
  117. package/dist/src/nodes/node.product.js.map +1 -1
  118. package/dist/src/renders/attributes/buyLink.d.ts +2 -2
  119. package/dist/src/renders/attributes/buyLink.js +14 -11
  120. package/dist/src/renders/attributes/buyLink.js.map +1 -1
  121. package/dist/src/renders/attributes/devices.d.ts +2 -2
  122. package/dist/src/renders/attributes/devices.js +9 -19
  123. package/dist/src/renders/attributes/devices.js.map +1 -1
  124. package/dist/src/renders/attributes/discount.d.ts +2 -2
  125. package/dist/src/renders/attributes/discount.js +56 -44
  126. package/dist/src/renders/attributes/discount.js.map +1 -1
  127. package/dist/src/renders/attributes/hide.d.ts +2 -2
  128. package/dist/src/renders/attributes/hide.js +49 -14
  129. package/dist/src/renders/attributes/hide.js.map +1 -1
  130. package/dist/src/renders/attributes/index.d.ts +3 -3
  131. package/dist/src/renders/attributes/index.js +2 -4
  132. package/dist/src/renders/attributes/index.js.map +1 -1
  133. package/dist/src/renders/attributes/price.d.ts +2 -2
  134. package/dist/src/renders/attributes/price.js +30 -44
  135. package/dist/src/renders/attributes/price.js.map +1 -1
  136. package/dist/src/renders/attributes/subscription.d.ts +2 -2
  137. package/dist/src/renders/attributes/subscription.js +14 -20
  138. package/dist/src/renders/attributes/subscription.js.map +1 -1
  139. package/dist/src/renders/attributes/utilty.d.ts +2 -0
  140. package/dist/src/renders/attributes/utilty.js +17 -4
  141. package/dist/src/renders/attributes/utilty.js.map +1 -1
  142. package/dist/src/renders/context.d.ts +122 -10
  143. package/dist/src/renders/context.js +140 -80
  144. package/dist/src/renders/context.js.map +1 -1
  145. package/dist/src/renders/format.js +2 -2
  146. package/dist/src/renders/format.js.map +1 -1
  147. package/dist/src/renders/index.d.ts +6 -2
  148. package/dist/src/renders/index.js +67 -29
  149. package/dist/src/renders/index.js.map +1 -1
  150. package/dist/src/renders/observe.d.ts +1 -4
  151. package/dist/src/renders/observe.js +10 -24
  152. package/dist/src/renders/observe.js.map +1 -1
  153. package/dist/src/renders/render.wrapper.d.ts +37 -0
  154. package/dist/src/renders/render.wrapper.js +147 -0
  155. package/dist/src/renders/render.wrapper.js.map +1 -0
  156. package/dist/src/templating/eta.js +1 -4
  157. package/dist/src/templating/eta.js.map +1 -1
  158. package/package.json +4 -5
  159. package/dist/src/actions/action.button.d.ts +0 -2
  160. package/dist/src/actions/action.button.js +0 -8
  161. package/dist/src/actions/action.button.js.map +0 -1
  162. package/dist/src/actions/action.input.d.ts +0 -2
  163. package/dist/src/actions/action.input.js +0 -43
  164. package/dist/src/actions/action.input.js.map +0 -1
  165. package/dist/src/actions/action.select.d.ts +0 -2
  166. package/dist/src/actions/action.select.js +0 -14
  167. package/dist/src/actions/action.select.js.map +0 -1
  168. package/dist/src/actions/utilty.d.ts +0 -16
  169. package/dist/src/actions/utilty.js +0 -149
  170. package/dist/src/actions/utilty.js.map +0 -1
  171. package/dist/src/contexts/context.datalayer.d.ts +0 -9
  172. package/dist/src/contexts/context.datalayer.js +0 -3
  173. package/dist/src/contexts/context.datalayer.js.map +0 -1
  174. package/dist/src/contexts/context.derived.d.ts +0 -12
  175. package/dist/src/contexts/context.derived.js +0 -3
  176. package/dist/src/contexts/context.derived.js.map +0 -1
  177. package/dist/src/contexts/context.option.d.ts +0 -5
  178. package/dist/src/contexts/context.option.js +0 -3
  179. package/dist/src/contexts/context.option.js.map +0 -1
  180. package/dist/src/contexts/context.product.d.ts +0 -5
  181. package/dist/src/contexts/context.product.js +0 -3
  182. package/dist/src/contexts/context.product.js.map +0 -1
  183. package/dist/src/contexts/context.state.d.ts +0 -28
  184. package/dist/src/contexts/context.state.js +0 -3
  185. package/dist/src/contexts/context.state.js.map +0 -1
  186. package/dist/src/contexts/context.store.d.ts +0 -5
  187. package/dist/src/contexts/context.store.js +0 -3
  188. package/dist/src/contexts/context.store.js.map +0 -1
  189. package/dist/src/controllers/collect-controller.d.ts +0 -39
  190. package/dist/src/controllers/collect-controller.js +0 -161
  191. package/dist/src/controllers/collect-controller.js.map +0 -1
  192. package/dist/src/controllers/compute-controller.d.ts +0 -55
  193. package/dist/src/controllers/compute-controller.js +0 -350
  194. package/dist/src/controllers/compute-controller.js.map +0 -1
  195. package/dist/src/controllers/eta-renderer/eta-dom-renderer.d.ts +0 -25
  196. package/dist/src/controllers/eta-renderer/eta-dom-renderer.js +0 -192
  197. package/dist/src/controllers/eta-renderer/eta-dom-renderer.js.map +0 -1
  198. package/dist/src/controllers/eta-renderer/eta-mutation-observer.d.ts +0 -28
  199. package/dist/src/controllers/eta-renderer/eta-mutation-observer.js +0 -206
  200. package/dist/src/controllers/eta-renderer/eta-mutation-observer.js.map +0 -1
  201. package/dist/src/controllers/eta-renderer/eta-renderer.d.ts +0 -21
  202. package/dist/src/controllers/eta-renderer/eta-renderer.js +0 -77
  203. package/dist/src/controllers/eta-renderer/eta-renderer.js.map +0 -1
  204. package/dist/src/controllers/eta-renderer/eta-template-cache.d.ts +0 -24
  205. package/dist/src/controllers/eta-renderer/eta-template-cache.js +0 -61
  206. package/dist/src/controllers/eta-renderer/eta-template-cache.js.map +0 -1
  207. package/dist/src/controllers/eta-renderer/eta-types.d.ts +0 -11
  208. package/dist/src/controllers/eta-renderer/eta-types.js +0 -1
  209. package/dist/src/controllers/eta-renderer/eta-types.js.map +0 -1
  210. package/dist/src/controllers/eta-renderer/index.d.ts +0 -2
  211. package/dist/src/controllers/eta-renderer/index.js +0 -2
  212. package/dist/src/controllers/eta-renderer/index.js.map +0 -1
  213. package/dist/src/controllers/event-pipeline-controller.d.ts +0 -28
  214. package/dist/src/controllers/event-pipeline-controller.js +0 -72
  215. package/dist/src/controllers/event-pipeline-controller.js.map +0 -1
  216. package/dist/src/events/events.d.ts +0 -75
  217. package/dist/src/events/events.js +0 -78
  218. package/dist/src/events/events.js.map +0 -1
  219. package/dist/src/nodes/node.root.d.ts +0 -16
  220. package/dist/src/nodes/node.root.js +0 -49
  221. package/dist/src/nodes/node.root.js.map +0 -1
  222. package/dist/src/nodes/node.state.d.ts +0 -88
  223. package/dist/src/nodes/node.state.js +0 -330
  224. package/dist/src/nodes/node.state.js.map +0 -1
  225. package/dist/src/renders/utility.d.ts +0 -32
  226. package/dist/src/renders/utility.js +0 -191
  227. package/dist/src/renders/utility.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"utility.js","sourceRoot":"","sources":["../../../src/renders/utility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,+EAA+E;AAC/E,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAW,YAAY,EAAe,MAAM,cAAc,CAAC;AAelE,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AACtD,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAElD,6DAA6D;AAC7D,MAAM,YAAY,GAAG,IAAI,OAAO,EAAc,CAAC;AAC/C,MAAM,cAAc,GAAG,IAAI,OAAO,EAA0B,CAAC;AAC7D,MAAM,cAAc,GAAG,IAAI,OAAO,EAA0B,CAAC;AAC7D,MAAM,sBAAsB,GAAG,IAAI,OAAO,EAA0B,CAAC;AAErE,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,EAAe,EACf,OAAU,EACV,OAAwC,EACxC,EAAE,SAAS,GAAG,IAAI,KAA8B,EAAE,EAClD,EAAE;IACF,IAAI,OAAiC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AC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAc,EAAE,EAAE;IAClD,kBAAkB,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC,CAAC","sourcesContent":["import { derivedContext } from '@/contexts/context.derived';\nimport { optionContext } from '@/contexts/context.option';\nimport { productContext } from '@/contexts/context.product';\nimport { stateContext } from '@/contexts/context.state';\n// Legacy per-context renders remain available until full migration is complete\nimport { CollectChildEvent, CollectChildRemovedEvent } from '@/events/events';\nimport { renderAttributes } from '@/renders/attributes';\nimport { OBS_ATTRS_OPTION_PLUS_STATE } from '@/renders/observe';\nimport { Context, ContextEvent, ContextType } from '@lit/context';\nimport type { ProductOption } from '@repobit/dex-store';\n\ntype AnyContext = Context<unknown, unknown>;\ntype CtxVal<C extends AnyContext> = ContextType<C>;\ntype ContextMap = Record<string, AnyContext>;\ntype ContextValues<M extends ContextMap> = { [K in keyof M]: CtxVal<M[K]> };\ntype BindContext<M extends ContextMap> = {\n el : HTMLElement,\n contexts : M,\n logic : (values: ContextValues<M>) => void | Promise<void>,\n observedAttrs: string[],\n requireAll? : boolean\n}\nexport type RenderNode = HTMLElement & { updateComplete?: Promise<void> };\nexport const DATA_RENDER_NODE = \"[data-store-render]\";\nexport const DATA_HIDE_NODE = \"[data-store-hide]\";\n\n// Track initialized render nodes to avoid duplicate bindings\nconst RENDER_BOUND = new WeakSet<RenderNode>();\nconst RENDER_DISPOSE = new WeakMap<RenderNode, () => void>();\nconst RENDER_RESOLVE = new WeakMap<RenderNode, () => void>();\nconst RENDER_ORIGINAL_REMOVE = new WeakMap<RenderNode, () => void>();\n\nexport const attachContext = <C extends AnyContext>(\n el: HTMLElement,\n context: C,\n onValue: (value: ContextType<C>) => void,\n { subscribe = true }: { subscribe?: boolean } = {}\n) => {\n let dispose: (() => void) | undefined;\n\n el.dispatchEvent(\n new ContextEvent(\n context,\n el,\n (value: ContextType<C>, d?: () => void) => {\n onValue(value);\n dispose = d; // may be provided when subscribe === true\n },\n subscribe\n )\n );\n\n // call this later to unsubscribe (if provider gave you a disposer)\n return () => dispose?.();\n}\n\nexport const observeAttributes = (\n el: HTMLElement,\n onChange: () => void,\n filter?: string[]\n) => {\n const mo = new MutationObserver((mutations) => {\n if (mutations.length === 0) return;\n onChange();\n });\n\n mo.observe(el, {\n attributes : true,\n attributeFilter: filter // e.g. ['user-id','subscribe']\n });\n\n // return disposer\n return () => mo.disconnect();\n}\n\n/**\n * Subscribes to all contexts in `contexts`, coalesces updates in a microtask,\n * and calls `logic` with the latest values once ALL are present.\n * Returns a single disposer.\n */\nexport function bindContext<M extends ContextMap>({\n el,\n contexts,\n logic,\n observedAttrs = [],\n requireAll = true\n}: BindContext<M>) {\n const keys = Object.keys(contexts) as (keyof M)[];\n const latest: Partial<ContextValues<M>> = {};\n const seen = new Set<keyof M>();\n\n let scheduled = false; // a microtask has been queued\n let running = false; // logic is currently executing\n let needsRun = false; // something changed; run again after current finishes\n let disposed = false;\n\n const haveAll = () => seen.size === keys.length;\n const haveAny = () => seen.size > 0;\n\n const pump = async () => {\n scheduled = false;\n\n if (disposed) return;\n\n // If we're already running, just mark that we need another pass.\n if (running) {\n needsRun = true;\n return;\n }\n\n // Run when required contexts are present at least once.\n if (requireAll ? !haveAll() : !haveAny()) return;\n\n running = true;\n try {\n do {\n needsRun = false;\n\n // Snapshot so each run sees a stable view even if `latest` changes while awaiting.\n const snapshot = {} as ContextValues<M>;\n for (const k of keys) (snapshot[k] as unknown) = latest[k];\n\n await Promise.resolve(logic(snapshot));\n } while (needsRun && !disposed); // drain one more time if updates queued while running\n } catch (err) {\n // Keep the queue alive even if user logic throws.\n console.error(err);\n } finally {\n running = false;\n if (needsRun && !disposed) {\n scheduled = true;\n queueMicrotask(pump);\n }\n }\n };\n\n const scheduleRun = () => {\n if (disposed) return;\n needsRun = true;\n if (!scheduled) {\n scheduled = true;\n queueMicrotask(pump);\n }\n };\n\n // subscribe to each requested context\n const disposers = keys.map((k) =>\n attachContext(el, contexts[k], (value) => {\n latest[k] = value;\n seen.add(k);\n scheduleRun();\n })\n );\n\n // optional: observe attributes once for the whole group\n const stopAttrs =\n observedAttrs.length > 0\n ? observeAttributes(el, scheduleRun, observedAttrs)\n : () => {};\n\n // single disposer\n return () => {\n disposed = true;\n stopAttrs();\n seen.clear();\n for (const d of disposers) d();\n };\n}\n\nconst addLogic = (el: RenderNode, rendered: (value: void | PromiseLike<void>) => void) => {\n // Single binder aggregates both contexts and renders when either changes\n return bindContext({\n el,\n contexts: { optionContext, stateContext, productContext, derivedContext },\n logic : async ({ optionContext, stateContext, productContext, derivedContext }) => {\n const opt = await optionContext as ProductOption | null | undefined;\n await renderAttributes(\n el,\n {\n option : opt,\n state : stateContext,\n product: productContext,\n derived: derivedContext\n }\n );\n rendered();\n },\n observedAttrs: [...OBS_ATTRS_OPTION_PLUS_STATE]\n });\n};\n\nconst teardownRenderNode = (el: RenderNode) => {\n const hadState =\n RENDER_BOUND.has(el)\n || RENDER_DISPOSE.has(el)\n || RENDER_RESOLVE.has(el)\n || RENDER_ORIGINAL_REMOVE.has(el);\n if (!hadState) return;\n\n const dispose = RENDER_DISPOSE.get(el);\n try { dispose?.(); } catch { /* ignore */ }\n\n // Resolve any outstanding updateComplete so parents don't hang\n const resolve = RENDER_RESOLVE.get(el);\n try { resolve?.(); } catch { /* ignore */ }\n\n const originalRemove = RENDER_ORIGINAL_REMOVE.get(el);\n if (originalRemove) {\n el.remove = originalRemove;\n }\n\n try { el.dispatchEvent(new CollectChildRemovedEvent({ child: el })); } catch { /* ignore */ }\n RENDER_DISPOSE.delete(el);\n RENDER_BOUND.delete(el);\n RENDER_RESOLVE.delete(el);\n RENDER_ORIGINAL_REMOVE.delete(el);\n};\n\nexport const handleRenderNode = (el: RenderNode) => {\n // Idempotent: don't re-bind the same node\n if (RENDER_BOUND.has(el)) return;\n RENDER_BOUND.add(el);\n\n const { promise, resolve } = Promise.withResolvers<void>();\n el.updateComplete = promise;\n const dispose = addLogic(el, resolve);\n RENDER_DISPOSE.set(el, dispose);\n RENDER_RESOLVE.set(el, resolve);\n\n // Register as contextual child so nearest StateNode parents can await it\n try { el.dispatchEvent(new CollectChildEvent({ child: el })); } catch { /* ignore */ }\n\n const originalRemove = el.remove;\n RENDER_ORIGINAL_REMOVE.set(el, originalRemove);\n\n el.remove = () => {\n teardownRenderNode(el);\n originalRemove.call(el);\n }\n};\n\nexport const cleanupRenderNode = (el: RenderNode) => {\n teardownRenderNode(el);\n};\n"]}