@pithyjs/core 0.1.0-beta.1 → 0.1.0-beta.11

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 (201) hide show
  1. package/README.md +12 -6
  2. package/dist/a11y/focus-trap.d.ts.map +1 -1
  3. package/dist/a11y/focus-trap.js +2 -0
  4. package/dist/a11y/focus-trap.js.map +1 -1
  5. package/dist/a11y/index.d.ts +4 -4
  6. package/dist/a11y/index.js +4 -4
  7. package/dist/a11y/index.js.map +1 -1
  8. package/dist/a11y/keyboard-utils.js.map +1 -1
  9. package/dist/a11y/roving-tabindex.js.map +1 -1
  10. package/dist/a11y/skip-link.js.map +1 -1
  11. package/dist/compile/bindSwitchCases.d.ts +8 -3
  12. package/dist/compile/bindSwitchCases.d.ts.map +1 -1
  13. package/dist/compile/bindSwitchCases.js +114 -181
  14. package/dist/compile/bindSwitchCases.js.map +1 -1
  15. package/dist/compile/binds/bindBoundAttributes.d.ts +1 -0
  16. package/dist/compile/binds/bindBoundAttributes.d.ts.map +1 -1
  17. package/dist/compile/binds/bindBoundAttributes.js +47 -2
  18. package/dist/compile/binds/bindBoundAttributes.js.map +1 -1
  19. package/dist/compile/binds/bindClassDirectives.d.ts +3 -2
  20. package/dist/compile/binds/bindClassDirectives.d.ts.map +1 -1
  21. package/dist/compile/binds/bindClassDirectives.js +53 -18
  22. package/dist/compile/binds/bindClassDirectives.js.map +1 -1
  23. package/dist/compile/binds/bindComponentsTags.d.ts +2 -0
  24. package/dist/compile/binds/bindComponentsTags.d.ts.map +1 -1
  25. package/dist/compile/binds/bindComponentsTags.js +86 -46
  26. package/dist/compile/binds/bindComponentsTags.js.map +1 -1
  27. package/dist/compile/binds/bindConditionals.d.ts +2 -2
  28. package/dist/compile/binds/bindConditionals.d.ts.map +1 -1
  29. package/dist/compile/binds/bindConditionals.js +22 -5
  30. package/dist/compile/binds/bindConditionals.js.map +1 -1
  31. package/dist/compile/binds/bindDefaultTwoWay.d.ts.map +1 -1
  32. package/dist/compile/binds/bindDefaultTwoWay.js +2 -1
  33. package/dist/compile/binds/bindDefaultTwoWay.js.map +1 -1
  34. package/dist/compile/binds/bindDeferDirectives.js +4 -4
  35. package/dist/compile/binds/bindDeferDirectives.js.map +1 -1
  36. package/dist/compile/binds/bindErrorBoundary.d.ts.map +1 -1
  37. package/dist/compile/binds/bindErrorBoundary.js +8 -3
  38. package/dist/compile/binds/bindErrorBoundary.js.map +1 -1
  39. package/dist/compile/binds/bindEventHandlers.js +2 -2
  40. package/dist/compile/binds/bindEventHandlers.js.map +1 -1
  41. package/dist/compile/binds/bindRefDirectives.js.map +1 -1
  42. package/dist/compile/binds/bindStyleDirectives.d.ts +17 -0
  43. package/dist/compile/binds/bindStyleDirectives.d.ts.map +1 -0
  44. package/dist/compile/binds/bindStyleDirectives.js +47 -0
  45. package/dist/compile/binds/bindStyleDirectives.js.map +1 -0
  46. package/dist/compile/binds/bindTextInterpolations.d.ts +2 -1
  47. package/dist/compile/binds/bindTextInterpolations.d.ts.map +1 -1
  48. package/dist/compile/binds/bindTextInterpolations.js +55 -17
  49. package/dist/compile/binds/bindTextInterpolations.js.map +1 -1
  50. package/dist/compile/binds/directiveRegistry.js.map +1 -1
  51. package/dist/compile/binds/forwardedAttrs.js.map +1 -1
  52. package/dist/compile/binds/propNames.d.ts +14 -0
  53. package/dist/compile/binds/propNames.d.ts.map +1 -0
  54. package/dist/compile/binds/propNames.js +116 -0
  55. package/dist/compile/binds/propNames.js.map +1 -0
  56. package/dist/compile/compileExpression.js.map +1 -1
  57. package/dist/compile/compileNodes.d.ts.map +1 -1
  58. package/dist/compile/compileNodes.js +6 -3
  59. package/dist/compile/compileNodes.js.map +1 -1
  60. package/dist/compile/compileTemplate.d.ts +3 -4
  61. package/dist/compile/compileTemplate.d.ts.map +1 -1
  62. package/dist/compile/compileTemplate.js +28 -31
  63. package/dist/compile/compileTemplate.js.map +1 -1
  64. package/dist/compile/componentResult.js.map +1 -1
  65. package/dist/compile/contentProjection.d.ts +1 -1
  66. package/dist/compile/contentProjection.d.ts.map +1 -1
  67. package/dist/compile/contentProjection.js +32 -15
  68. package/dist/compile/contentProjection.js.map +1 -1
  69. package/dist/compile/forLoops/bindForLoops.d.ts +2 -2
  70. package/dist/compile/forLoops/bindForLoops.d.ts.map +1 -1
  71. package/dist/compile/forLoops/bindForLoops.js +9 -22
  72. package/dist/compile/forLoops/bindForLoops.js.map +1 -1
  73. package/dist/compile/forLoops/createLoopManager.d.ts +3 -3
  74. package/dist/compile/forLoops/createLoopManager.d.ts.map +1 -1
  75. package/dist/compile/forLoops/createLoopManager.js +40 -38
  76. package/dist/compile/forLoops/createLoopManager.js.map +1 -1
  77. package/dist/compile/forLoops/index.d.ts +5 -5
  78. package/dist/compile/forLoops/index.js +5 -5
  79. package/dist/compile/forLoops/index.js.map +1 -1
  80. package/dist/compile/forLoops/loopHelpers.d.ts +6 -0
  81. package/dist/compile/forLoops/loopHelpers.d.ts.map +1 -1
  82. package/dist/compile/forLoops/loopHelpers.js +17 -0
  83. package/dist/compile/forLoops/loopHelpers.js.map +1 -1
  84. package/dist/compile/forLoops/loopSignals.js +2 -2
  85. package/dist/compile/forLoops/loopSignals.js.map +1 -1
  86. package/dist/compile/forLoops/loopTraversal.js +2 -2
  87. package/dist/compile/forLoops/loopTraversal.js.map +1 -1
  88. package/dist/compile/handleConditionalChain.d.ts +2 -2
  89. package/dist/compile/handleConditionalChain.d.ts.map +1 -1
  90. package/dist/compile/handleConditionalChain.js +22 -87
  91. package/dist/compile/handleConditionalChain.js.map +1 -1
  92. package/dist/compile/index.d.ts +17 -17
  93. package/dist/compile/index.js +14 -14
  94. package/dist/compile/index.js.map +1 -1
  95. package/dist/compile/injectScopedStyle.js.map +1 -1
  96. package/dist/compile/nodeExpando.d.ts +6 -0
  97. package/dist/compile/nodeExpando.d.ts.map +1 -1
  98. package/dist/compile/nodeExpando.js.map +1 -1
  99. package/dist/compile/parseHtml.d.ts.map +1 -1
  100. package/dist/compile/parseHtml.js +2 -2
  101. package/dist/compile/parseHtml.js.map +1 -1
  102. package/dist/compile/pithyTreeToDom.js +1 -1
  103. package/dist/compile/pithyTreeToDom.js.map +1 -1
  104. package/dist/compile/renderBranch.d.ts +13 -0
  105. package/dist/compile/renderBranch.d.ts.map +1 -0
  106. package/dist/compile/renderBranch.js +65 -0
  107. package/dist/compile/renderBranch.js.map +1 -0
  108. package/dist/compile/renderChildren.d.ts +2 -2
  109. package/dist/compile/renderChildren.js +2 -2
  110. package/dist/compile/renderChildren.js.map +1 -1
  111. package/dist/compile/ssrCrashes.d.ts +1 -1
  112. package/dist/compile/ssrCrashes.js +3 -3
  113. package/dist/compile/ssrCrashes.js.map +1 -1
  114. package/dist/compile/ssrMode.js +1 -1
  115. package/dist/compile/ssrMode.js.map +1 -1
  116. package/dist/compile/textValue.js.map +1 -1
  117. package/dist/compile/trimBlankEdges.d.ts +2 -0
  118. package/dist/compile/trimBlankEdges.d.ts.map +1 -0
  119. package/dist/compile/trimBlankEdges.js +15 -0
  120. package/dist/compile/trimBlankEdges.js.map +1 -0
  121. package/dist/config/index.js.map +1 -1
  122. package/dist/index.d.ts +6 -6
  123. package/dist/index.js +6 -6
  124. package/dist/index.js.map +1 -1
  125. package/dist/interfaces/index.d.ts +2 -2
  126. package/dist/interfaces/index.js +2 -2
  127. package/dist/interfaces/index.js.map +1 -1
  128. package/dist/interfaces/ref-signal.interface.js.map +1 -1
  129. package/dist/interfaces/ref.interface.js.map +1 -1
  130. package/dist/runtime/applyBindings.d.ts +3 -3
  131. package/dist/runtime/applyBindings.d.ts.map +1 -1
  132. package/dist/runtime/applyBindings.js +74 -22
  133. package/dist/runtime/applyBindings.js.map +1 -1
  134. package/dist/runtime/bindings/applyComponent.d.ts +2 -2
  135. package/dist/runtime/bindings/applyComponent.d.ts.map +1 -1
  136. package/dist/runtime/bindings/applyComponent.js +41 -32
  137. package/dist/runtime/bindings/applyComponent.js.map +1 -1
  138. package/dist/runtime/bindings/applyDefer.d.ts +1 -1
  139. package/dist/runtime/bindings/applyDefer.js +6 -6
  140. package/dist/runtime/bindings/applyDefer.js.map +1 -1
  141. package/dist/runtime/bindings/applySimple.d.ts +1 -1
  142. package/dist/runtime/bindings/applySimple.d.ts.map +1 -1
  143. package/dist/runtime/bindings/applySimple.js +45 -13
  144. package/dist/runtime/bindings/applySimple.js.map +1 -1
  145. package/dist/runtime/bindings/applyStructural.d.ts +1 -1
  146. package/dist/runtime/bindings/applyStructural.d.ts.map +1 -1
  147. package/dist/runtime/bindings/applyStructural.js +58 -68
  148. package/dist/runtime/bindings/applyStructural.js.map +1 -1
  149. package/dist/runtime/bindings/helpers.d.ts +1 -1
  150. package/dist/runtime/bindings/helpers.js +1 -1
  151. package/dist/runtime/bindings/helpers.js.map +1 -1
  152. package/dist/runtime/bindings/index.d.ts +6 -6
  153. package/dist/runtime/bindings/index.d.ts.map +1 -1
  154. package/dist/runtime/bindings/index.js +5 -5
  155. package/dist/runtime/bindings/index.js.map +1 -1
  156. package/dist/runtime/bindings/types.js.map +1 -1
  157. package/dist/runtime/bootstrap.d.ts +1 -1
  158. package/dist/runtime/bootstrap.js +1 -1
  159. package/dist/runtime/bootstrap.js.map +1 -1
  160. package/dist/runtime/createContextProxy.js.map +1 -1
  161. package/dist/runtime/deferHelpers.d.ts +1 -1
  162. package/dist/runtime/deferHelpers.js.map +1 -1
  163. package/dist/runtime/html.d.ts.map +1 -1
  164. package/dist/runtime/html.js +6 -5
  165. package/dist/runtime/html.js.map +1 -1
  166. package/dist/runtime/index.d.ts +6 -6
  167. package/dist/runtime/index.js +6 -6
  168. package/dist/runtime/index.js.map +1 -1
  169. package/dist/runtime/lazy.js +1 -1
  170. package/dist/runtime/lazy.js.map +1 -1
  171. package/dist/runtime/module-cache.js.map +1 -1
  172. package/dist/runtime/onDestroy.d.ts +7 -0
  173. package/dist/runtime/onDestroy.d.ts.map +1 -1
  174. package/dist/runtime/onDestroy.js +16 -1
  175. package/dist/runtime/onDestroy.js.map +1 -1
  176. package/dist/runtime/parseIdentifiersFromTemplate.js +1 -1
  177. package/dist/runtime/parseIdentifiersFromTemplate.js.map +1 -1
  178. package/dist/runtime/resource/createAction.d.ts +1 -1
  179. package/dist/runtime/resource/createAction.js +1 -1
  180. package/dist/runtime/resource/createAction.js.map +1 -1
  181. package/dist/runtime/resource/createResource.d.ts +1 -1
  182. package/dist/runtime/resource/createResource.d.ts.map +1 -1
  183. package/dist/runtime/resource/createResource.js +3 -4
  184. package/dist/runtime/resource/createResource.js.map +1 -1
  185. package/dist/runtime/resource/engine.d.ts +1 -1
  186. package/dist/runtime/resource/engine.js.map +1 -1
  187. package/dist/runtime/resource/index.d.ts +3 -3
  188. package/dist/runtime/resource/index.js +2 -2
  189. package/dist/runtime/resource/index.js.map +1 -1
  190. package/dist/runtime/resource/types.js.map +1 -1
  191. package/dist/types/globals.d.ts +2 -2
  192. package/dist/types/globals.js.map +1 -1
  193. package/dist/types/index.js.map +1 -1
  194. package/dist/utilities/index.d.ts +2 -2
  195. package/dist/utilities/index.js +2 -2
  196. package/dist/utilities/index.js.map +1 -1
  197. package/dist/utilities/ref-signal.utility.d.ts +1 -1
  198. package/dist/utilities/ref-signal.utility.js.map +1 -1
  199. package/dist/utilities/ref.untility.d.ts +1 -1
  200. package/dist/utilities/ref.untility.js.map +1 -1
  201. package/package.json +11 -6
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/compile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,GAEjB,MAAM,kBAAkB,CAAC;AAC1B,uEAAuE;AACvE,0EAA0E;AAC1E,sEAAsE;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,wDAAwD;AACxD,OAAO,EAAE,sBAAsB,EAA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gC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EACL,YAAY,EACZ,iBAAiB,GAGlB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAK3D,gFAAgF;AAChF,mFAAmF;AACnF,kFAAkF;AAClF,iFAAiF;AACjF,iFAAiF;AACjF,2DAA2D;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,0FAA0F;AAC1F,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,6BAA6B,GAE9B,MAAM,2BAA2B,CAAC;AAEnC,mDAAmD;AACnD,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAGnC,2EAA2E;AAC3E,sEAAsE;AACtE,EAAE;AACF,0EAA0E;AAC1E,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAC9E,8DAA8D;AAC9D,OAAO,EACL,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,cAAc,CAAC","sourcesContent":["export { compileTemplate } from './compileTemplate';\nexport { compileNodes } from './compileNodes';\nexport {\n renderChildren,\n captureChildren,\n readChildPayload,\n type ChildPayload,\n} from './renderChildren';\n// parseHtml is NOT re-exported from this barrel to prevent parse5 from\n// being pulled into production bundles. Use the dedicated subpath export:\n// import { loadJITCompiler } from '@pithyjs/core/compile/parseHtml'\nexport { injectScopedStyle } from './injectScopedStyle';\n\n// Only export these if useful for advanced users / SSR:\nexport { bindTextInterpolations } from './binds/bindTextInterpolations';\nexport { bindEventHandlers } from './binds/bindEventHandlers';\nexport { bindClassDirectives } from './binds/bindClassDirectives';\nexport { bindComponentTags } from './binds/bindComponentsTags';\nexport {\n bindForLoops,\n createLoopManager,\n type ChildFactory,\n type LoopManager,\n} from './forLoops';\nexport { bindTemplateDirectives } from './compileTemplate';\n\n// Content projection types (stable — part of the component authoring API)\nexport type { SlotMap } from './contentProjection';\n\n// The explicit static-render signal. `@pithyjs/ssr`'s setupEnvironment() copies\n// a happy-dom window onto globalThis — IntersectionObserver, requestAnimationFrame\n// and matchMedia included — so no `typeof` feature check can distinguish a server\n// render from a browser. Packages that must branch on it (e.g. @pithyjs/ui-kit's\n// section entrance animations, BUG-010) read this rather than hand-rolling their\n// own derivation of the underlying `__PITHY_SSR__` global.\nexport { isSSRMode } from './ssrMode';\n\n// Custom directive registry - allows external packages (router, etc.) to register binders\nexport {\n registerDirectiveBinder,\n unregisterDirectiveBinder,\n executeCustomDirectiveBinders,\n type DirectiveBinder,\n} from './binds/directiveRegistry';\n\n// Error boundary functions for router integration:\nexport {\n boundaryForElement,\n setBoundaryError,\n clearBoundaryError,\n registerBoundary,\n} from './binds/bindErrorBoundary';\nexport type { BoundaryInfo } from './binds/bindErrorBoundary';\n\n// Unhandled component crashes recorded during a server render. Consumed by\n// @pithyjs/ssr's renderToString so a crash fails its route (BUG-018).\n//\n// Only the two read/lifecycle APIs are public. `recordSSRRenderCrash` and\n// `clearSSRRenderCrash` mutate the registry and are called exclusively by the\n// binders inside this package, so they are annotated `internal` rather than\n// exported here — advertising them as stable in the generated API table while\n// leaving them unimportable is worse than either alternative.\nexport {\n collectUnhandledSSRRenderCrashes,\n resetSSRRenderCrashes,\n} from './ssrCrashes';\nexport type { SSRRenderCrash } from './ssrCrashes';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"injectScopedStyle.js","sourceRoot":"","sources":["../../src/compile/injectScopedStyle.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF;;GAEG;AACH,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;AAEzC;;;;;GAKG;AACH,+JAA+J;AAC/J,MAAM,UAAU,iBAAiB,CAAC,G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E,OAAO,CAAC,+BAA+B;IAC1E,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAE9B,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC;IAC9B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,wJAAwJ;AACxJ,SAAS,QAAQ,CAAC,GAAW,EAAE,OAAe;IAC5C,OAAO,GAAG,CAAC,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE;QACjE,MAAM,MAAM,GAAG,QAAQ;aACpB,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,gBAAgB,OAAO,IAAI,CAAC;aAC1D,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,OAAO,GAAG,GAAG,IAAI,MAAM,IAAI,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.compiler.scoped-styles\",\n \"title\": \"Scoped CSS Style Injector\",\n \"category\": \"compiler\"\n}\n*/\n\n/**\n * A Set to track injected styles and avoid duplicate <style> tags.\n */\nconst injectedStyles = new Set<string>();\n\n/**\n * Rewrites CSS selectors to scope them with a unique attribute (e.g., `[data-scope-xxxx]`) and injects them into the DOM.\n *\n * @param css - Raw CSS string from the component\n * @param scopeId - Unique scope ID used to prefix selectors (e.g., `pithy-abc123`)\n */\n/** @codexApi {\"parent\":\"pithy.compiler.scoped-styles\",\"name\":\"injectScopedStyle\",\"stability\":\"stable\",\"signature\":\"(css: string, scopeId: string) => void\"} */\nexport function injectScopedStyle(css: string, scopeId: string): void {\n const scopedCss = scopeCss(css, scopeId);\n\n if (injectedStyles.has(scopedCss)) return; // Avoid reinjecting same style\n injectedStyles.add(scopedCss);\n\n const style = document.createElement('style');\n style.textContent = scopedCss;\n document.head.appendChild(style);\n}\n\n/**\n * Prefixes all top-level CSS selectors with a scoped attribute selector.\n * This ensures styles apply only to elements within the component.\n *\n * Example:\n * Input: \"p { color: red; }\", scopeId = \"abc123\"\n * Output: \"p[data-scope=\"abc123\"] { color: red; }\"\n *\n * @param css - Raw CSS string\n * @param scopeId - Unique ID used as a data-scope attribute value\n * @returns Scoped CSS string\n */\n/** @codexApi {\"parent\":\"pithy.compiler.scoped-styles\",\"name\":\"scopeCss\",\"stability\":\"stable\",\"signature\":\"(css: string, scopeId: string) => string\"} */\nfunction scopeCss(css: string, scopeId: string): string {\n return css.replace(/(^|\\})\\s*([^{}]+)\\s*\\{/g, (_, sep, selector) => {\n const scoped = selector\n .split(',')\n .map((s: string) => `${s.trim()}[data-scope=\"${scopeId}\"]`)\n .join(', ');\n return `${sep} ${scoped} {`;\n });\n}\n"]}
@@ -7,6 +7,12 @@ export interface NodeExpando {
7
7
  __fallbackFactory?: () => DocumentFragment;
8
8
  __nested?: boolean;
9
9
  __pithySkipText?: boolean;
10
+ __pithyComponentDom?: boolean;
11
+ /** A build's component placeholder: renders it through the AOT binder. */
12
+ /** Renders a build's placeholder; returns the nodes that replaced it. */
13
+ __pithyAotMount?: (disposers: (() => void)[]) => Node[];
14
+ __styleProps?: string[];
15
+ __classToggles?: string[];
10
16
  }
11
17
  export declare function nodeExpando<T extends Node>(node: T): T & NodeExpando;
12
18
  //# sourceMappingURL=nodeExpando.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodeExpando.d.ts","sourceRoot":"","sources":["../../src/compile/nodeExpando.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,gBAAgB,CAAC;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,WAAW,CAEpE"}
1
+ {"version":3,"file":"nodeExpando.d.ts","sourceRoot":"","sources":["../../src/compile/nodeExpando.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,gBAAgB,CAAC;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,0EAA0E;IAC1E,yEAAyE;IACzE,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC;IACxD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,WAAW,CAEpE"}
@@ -1 +1 @@
1
- {"version":3,"file":"nodeExpando.js","sourceRoot":"","sources":["../../src/compile/nodeExpando.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,WAAW,CAAiB,IAAO;IACjD,OAAO,IAAuB,CAAC;AACjC,CAAC"}
1
+ {"version":3,"file":"nodeExpando.js","sourceRoot":"","sources":["../../src/compile/nodeExpando.ts"],"names":[],"mappings":"AAkBA,MAAM,UAAU,WAAW,CAAiB,IAAO;IACjD,OAAO,IAAuB,CAAC;AACjC,CAAC","sourcesContent":["import type { PithyNode } from '@pithyjs/compiler';\n\nexport interface NodeExpando {\n __pithyCtx?: Record<string, unknown>;\n __pithyNode?: PithyNode;\n __nodeId?: string;\n __slotName?: string;\n __fallbackFactory?: () => DocumentFragment;\n __nested?: boolean;\n __pithySkipText?: boolean;\n __pithyComponentDom?: boolean;\n /** A build's component placeholder: renders it through the AOT binder. */\n /** Renders a build's placeholder; returns the nodes that replaced it. */\n __pithyAotMount?: (disposers: (() => void)[]) => Node[];\n __styleProps?: string[];\n __classToggles?: string[];\n}\n\nexport function nodeExpando<T extends Node>(node: T): T & NodeExpando {\n return node as T & NodeExpando;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"parseHtml.d.ts","sourceRoot":"","sources":["../../src/compile/parseHtml.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,mBAAmB,CAAC;AAS3B,yFAAyF;AACzF,KAAK,eAAe,GAAG,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IAAE,sBAAsB,CAAC,EAAE,OAAO,CAAA;CAAE,KAC3C,OAAO,CAAC;AAKb;;;;;;;;GAQG;AACH,wIAAwI;AACxI,wBAAgB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAsB/C;AAED;;;;GAIG;AACH,gIAAgI;AAChI,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAgBD;;;GAGG;AACH,+HAA+H;AAC/H,wBAAgB,aAAa,IAAI,IAAI,CAGpC;AAED;;;;;GAKG;AACH,qJAAqJ;AACrJ,wBAAgB,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EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,mBAAmB,GAAE,GAAG,CAAC,MAAM,CAAa,GAC3C;IACD,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB,CAuDA"}
@@ -6,7 +6,7 @@
6
6
  }
7
7
  */
8
8
  import { parse5ToPithyTree, escapeComponentTags, extractOriginalTagNames, extractOriginalAttributeNames, } from '@pithyjs/compiler';
9
- import { pithyTreeToDom } from './pithyTreeToDom';
9
+ import { pithyTreeToDom } from './pithyTreeToDom.js';
10
10
  let _parseFragment = null;
11
11
  let _loadPromise = null;
12
12
  /**
@@ -122,7 +122,7 @@ export function parseHtml(html, scopeId, context, importedIdentifiers = new Set(
122
122
  const tagNameCasingMap = extractOriginalTagNames(escapedHtml);
123
123
  const attributeNameCasingMap = extractOriginalAttributeNames(escapedHtml);
124
124
  const pithyNodes = parsed.childNodes
125
- .map((n) => parse5ToPithyTree(n, importedIdentifiers, tagNameCasingMap, undefined, attributeNameCasingMap))
125
+ .map((n) => parse5ToPithyTree(n, importedIdentifiers, tagNameCasingMap, undefined, attributeNameCasingMap, undefined, escapedHtml))
126
126
  .filter((n) => n != null);
127
127
  // 3. Compile DOM tree from PithyNodes
128
128
  const fragment = pithyTreeToDom(pithyNodes, context);
@@ -1 +1 @@
1
- {"version":3,"file":"parseHtml.js","sourceRoot":"","sources":["../../src/compile/parseHtml.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,6BAA6B,GAE9B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAclD,IAAI,cAAc,GAA2B,IAAI,CAAC;AAClD,IAAI,YAAY,GAAyB,IAAI,CAAC;AAE9C;;;;;;;;GAQG;AACH,wIAAwI;AACxI,MAAM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K,MAAM,aAAa,IAAI,mBAAmB,EAAE,CAAC;QAChD,oDAAoD;QACpD,iDAAiD;QACjD,gFAAgF;QAChF,wEAAwE;QACxE,MAAM,gBAAgB,GAAG,IAAI,MAAM,CACjC,IAAI,aAAa,yBAAyB,EAC1C,GAAG,CACJ,CAAC;QAEF,gDAAgD;QAChD,aAAa,GAAG,aAAa,CAAC,OAAO,CACnC,gBAAgB,EAChB,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;YACpB,MAAM,KAAK,GAAG,UAAU,IAAI,EAAE,CAAC;YAC/B,OAAO,IAAI,aAAa,GAAG,KAAK,MAAM,aAAa,GAAG,CAAC;QACzD,CAAC,CACF,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.compiler.html-parser\",\n \"title\": \"HTML Template Parser\",\n \"category\": \"compiler\"\n}\n*/\n\nimport {\n parse5ToPithyTree,\n escapeComponentTags,\n extractOriginalTagNames,\n extractOriginalAttributeNames,\n type PithyNode,\n} from '@pithyjs/compiler';\nimport { pithyTreeToDom } from './pithyTreeToDom';\n\n// ─── Dynamic parse5 loading ──────────────────────────────────────────────────\n// parse5 is no longer statically imported. It is loaded on demand via\n// loadJITCompiler() and cached in this module-level variable.\n// This ensures parse5 (45.6 KB gzip) is tree-shaken from production bundles\n// when all templates are AOT-compiled.\n\n/** Structural type matching parse5's parseFragment — avoids leaking parse5 into .d.ts */\ntype ParseFragmentFn = (\n html: string,\n options?: { sourceCodeLocationInfo?: boolean }\n) => unknown;\n\nlet _parseFragment: ParseFragmentFn | null = null;\nlet _loadPromise: Promise<void> | null = null;\n\n/**\n * Dynamically import parse5 and cache the parseFragment function.\n * Must be called before using html() for runtime template compilation.\n *\n * If all templates are AOT-compiled, this function never needs to be called\n * and parse5 will be completely absent from the production bundle.\n *\n * @returns Promise that resolves when parse5 is ready\n */\n/** @codexApi {\"parent\":\"pithy.compiler.html-parser\",\"name\":\"loadJITCompiler\",\"stability\":\"stable\",\"signature\":\"() => Promise<void>\"} */\nexport function loadJITCompiler(): Promise<void> {\n if (_parseFragment) return Promise.resolve(); // Already loaded\n if (_loadPromise) return _loadPromise; // Loading in progress — reuse same promise\n\n _loadPromise = import('parse5')\n .then(mod => {\n _parseFragment = mod.parseFragment;\n _loadPromise = null;\n })\n .catch(err => {\n // Reset so a retry can be attempted (e.g., after installing parse5)\n _loadPromise = null;\n // Manual `.cause` assignment instead of `new Error(msg, { cause })`\n // because the project targets ES2020 which doesn't support Error cause.\n const loadErr = new Error(\n 'Failed to load parse5. Install it (`pnpm add parse5`) or enable AOT compilation to avoid the runtime compiler.'\n );\n (loadErr as Error & { cause?: unknown }).cause = err;\n throw loadErr;\n });\n\n return _loadPromise;\n}\n\n/**\n * Check if the JIT compiler (parse5) has been loaded.\n * Used internally by parseHtml to provide a clear error message.\n * @returns `true` if parse5 parseFragment is cached\n */\n/** @codexApi {\"parent\":\"pithy.compiler.html-parser\",\"name\":\"isJITLoaded\",\"stability\":\"internal\",\"signature\":\"() => boolean\"} */\nexport function isJITLoaded(): boolean {\n return _parseFragment !== null;\n}\n\n/**\n * Get the cached parseFragment function, throwing if not loaded.\n * @internal\n */\nfunction getParseFragment(): ParseFragmentFn {\n if (!_parseFragment) {\n throw new Error(\n 'Runtime template compiler not loaded. Enable AOT compilation (recommended) ' +\n 'or call loadJITCompiler() at startup.'\n );\n }\n return _parseFragment;\n}\n\n/**\n * Reset JIT compiler state. For testing only.\n * @internal\n */\n/** @codexApi {\"parent\":\"pithy.compiler.html-parser\",\"name\":\"resetJITState\",\"stability\":\"internal\",\"signature\":\"() => void\"} */\nexport function resetJITState(): void {\n _parseFragment = null;\n _loadPromise = null;\n}\n\n/**\n * Pre-load parse5 synchronously for environments where it's already available\n * (e.g., Node.js test environments, SSR). This is a convenience for the\n * transition period — production code should use loadJITCompiler().\n * @internal\n */\n/** @codexApi {\"parent\":\"pithy.compiler.html-parser\",\"name\":\"setParseFragment\",\"stability\":\"internal\",\"signature\":\"(fn: ParseFragmentFn) => void\"} */\nexport function setParseFragment(fn: ParseFragmentFn): void {\n _parseFragment = fn;\n}\n\n/**\n * Return the cached parseFragment function (or null if not loaded).\n * Used by parseIdentifiersFromTemplate to reuse the same parse5 instance\n * loaded via loadJITCompiler(), avoiding a separate dynamic import.\n * @internal\n */\n/** @codexApi {\"parent\":\"pithy.compiler.html-parser\",\"name\":\"getParseFragmentFn\",\"stability\":\"internal\",\"signature\":\"() => ParseFragmentFn | null\"} */\nexport function getParseFragmentFn(): ParseFragmentFn | null {\n return _parseFragment;\n}\n\n// ─── Main API ────────────────────────────────────────────────────────────────\n\n/**\n * Parse an HTML template string into a DOM fragment with PithyNode metadata.\n * Requires parse5 to be loaded first via `loadJITCompiler()` or `setParseFragment()`.\n * Throws if the runtime compiler has not been loaded.\n *\n * @param html - Raw HTML template string\n * @param scopeId - Unique scope identifier for style scoping\n * @param context - Reactive context for expression evaluation\n * @param importedIdentifiers - Set of imported component names for self-closing tag handling\n * @returns Object with `fragment` (live DOM) and `pithyNodes` (AST metadata)\n */\n/** @codexApi {\"parent\":\"pithy.compiler.html-parser\",\"name\":\"parseHtml\",\"stability\":\"stable\",\"signature\":\"(html: string, scopeId: string, context: Record<string, unknown>, importedIdentifiers?: Set<string>) => { fragment: DocumentFragment; pithyNodes: PithyNode[] }\"} */\nexport function parseHtml(\n html: string,\n scopeId: string,\n context: Record<string, unknown>,\n importedIdentifiers: Set<string> = new Set()\n): {\n fragment: DocumentFragment;\n pithyNodes: PithyNode[];\n} {\n const parseFragment = getParseFragment();\n\n // 1. Pre-process HTML to convert self-closing component tags to regular tags\n const processedHtml = preprocessSelfClosingComponents(\n html,\n importedIdentifiers\n );\n\n // 2. Escape PascalCase component tags so parse5 doesn't enter special\n // insertion modes (e.g., \"in select\", \"in table\") that corrupt the tree.\n const escapedHtml = escapeComponentTags(processedHtml);\n\n // 3. Parse HTML into parse5 tree\n const parsed = parseFragment(escapedHtml, {\n sourceCodeLocationInfo: true,\n }) as {\n childNodes: unknown[];\n };\n\n // 4. Restore casing and tag type via your parser\n // IMPORTANT: Use escapedHtml (not raw html) because parse5 reports\n // sourceCodeLocation offsets based on escapedHtml. If we used raw html,\n // self-closing tag expansion (e.g. <Foo/> → <Foo></Foo>) and escape\n // prefixing would shift all subsequent offsets, causing casing map\n // lookups to miss for components that appear after other components.\n const tagNameCasingMap = extractOriginalTagNames(escapedHtml);\n const attributeNameCasingMap = extractOriginalAttributeNames(escapedHtml);\n\n const pithyNodes = parsed.childNodes\n .map((n: unknown) =>\n parse5ToPithyTree(\n n as Parameters<typeof parse5ToPithyTree>[0],\n importedIdentifiers,\n tagNameCasingMap,\n undefined,\n attributeNameCasingMap,\n undefined,\n escapedHtml\n )\n )\n .filter((n): n is PithyNode => n != null);\n\n // 3. Compile DOM tree from PithyNodes\n const fragment = pithyTreeToDom(pithyNodes, context);\n\n // 4. Add data-scope attribute to all elements\n fragment.querySelectorAll?.('*').forEach(el => {\n el.setAttribute(`data-scope-${scopeId}`, '');\n });\n\n return {\n fragment,\n pithyNodes,\n };\n}\n\n/**\n * Pre-processes HTML to convert self-closing component tags to regular tags.\n * This works around parse5's limitation with self-closing custom elements.\n *\n * @param html - The HTML template string\n * @param importedIdentifiers - Set of imported component names\n * @returns Processed HTML with self-closing components converted to regular tags\n */\n/** @codexApi {\"parent\":\"pithy.compiler.html-parser\",\"name\":\"preprocessSelfClosingComponents\",\"stability\":\"stable\",\"signature\":\"(html: string, importedIdentifiers: Set<string>) => string\"} */\nfunction preprocessSelfClosingComponents(\n html: string,\n importedIdentifiers: Set<string>\n): string {\n let processedHtml = html;\n\n // Convert each imported component from self-closing to regular tag\n for (const componentName of importedIdentifiers) {\n // Create regex to match self-closing component tags\n // Matches: <ComponentName /> or <ComponentName/>\n // IMPORTANT: Use 'g' flag only (NOT 'gi') - case-sensitive matching is required\n // to avoid converting native elements like <input /> to <Input></Input>\n const selfClosingRegex = new RegExp(\n `<${componentName}(\\\\s[^>]*)?\\\\s*\\\\/\\\\s*>`,\n 'g'\n );\n\n // Replace with regular opening and closing tags\n processedHtml = processedHtml.replace(\n selfClosingRegex,\n (match, attributes) => {\n const attrs = attributes || '';\n return `<${componentName}${attrs}></${componentName}>`;\n }\n );\n }\n\n return processedHtml;\n}\n"]}
@@ -6,7 +6,7 @@
6
6
  }
7
7
  */
8
8
  import { SVG_TAGS, SVG_NS, forEachDirectiveAttr, } from '@pithyjs/compiler';
9
- import { nodeExpando } from './nodeExpando';
9
+ import { nodeExpando } from './nodeExpando.js';
10
10
  /**
11
11
  * Converts a list of PithyNodes into a DocumentFragment of real DOM nodes.
12
12
  * Component tags (isComponent: true) are rendered as placeholder elements.
@@ -1 +1 @@
1
- {"version":3,"file":"pithyTreeToDom.js","sourceRoot":"","sources":["../../src/compile/pithyTreeToDom.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EACL,QAAQ,EACR,MAAM,EACN,oBAAoB,GAErB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;GAIG;AACH,uLAAuL;AACvL,MAAM,UAAU,cAAc,CAC5B,KAAkB,EAClB,OAAgC;IAEhC,MAAM,QAAQ,GAAG,QAAQ,CAAC,sBAAsB,EAAE,CAAC;IAEnD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtD,IAAI,OAAO,EAAE,CAAC;YACZ,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,uLAAuL;AACvL,SAAS,sBAAsB,CAC7B,IAAe,EACf,OAAgC;IAEhC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,C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C;YAChD,CAAC;QACH,CAAC;QAED,kCAAkC;QAClC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3C,CAAC;aAAM,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;YACpC,oDAAoD;YACpD,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;QACtD,CAAC;QAED,+BAA+B;QAC/B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;YACxC,MAAM,QAAQ,GAAG,sBAAsB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YACxD,IAAI,QAAQ;gBAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.compiler.dom-tree\",\n \"title\": \"PithyNode to DOM Tree Converter\",\n \"category\": \"compiler\"\n}\n*/\n\nimport {\n SVG_TAGS,\n SVG_NS,\n forEachDirectiveAttr,\n type PithyNode,\n} from '@pithyjs/compiler';\nimport { nodeExpando } from './nodeExpando';\n\n/**\n * Converts a list of PithyNodes into a DocumentFragment of real DOM nodes.\n * Component tags (isComponent: true) are rendered as placeholder elements.\n * No bindings or reactivity are applied here — those are handled in bind*() functions.\n */\n/** @codexApi {\"parent\":\"pithy.compiler.dom-tree\",\"name\":\"pithyTreeToDom\",\"stability\":\"stable\",\"signature\":\"(nodes: PithyNode[], context: Record<string, any>) => DocumentFragment\"} */\nexport function pithyTreeToDom(\n nodes: PithyNode[],\n context: Record<string, unknown>\n): DocumentFragment {\n const fragment = document.createDocumentFragment();\n\n for (const node of nodes) {\n const domNode = createDomNodeFromPithy(node, context);\n if (domNode) {\n fragment.appendChild(domNode);\n }\n }\n\n return fragment;\n}\n\n/** @codexApi {\"parent\":\"pithy.compiler.dom-tree\",\"name\":\"createDomNodeFromPithy\",\"stability\":\"stable\",\"signature\":\"(node: PithyNode, context: Record<string, any>) => Node | null\"} */\nfunction createDomNodeFromPithy(\n node: PithyNode,\n context: Record<string, unknown>\n): Node | null {\n if (node.type === 'text') {\n const textNode = document.createTextNode(node.textContent ?? '');\n nodeExpando(textNode).__pithyCtx = context;\n return textNode;\n }\n\n if (node.type === 'slot') {\n // Create comment anchor for slot\n const slotName = node.slotName || '';\n const anchor = document.createComment(\n `slot:${slotName} pid=\"${node.nodeId}\"`\n );\n\n // Store slot metadata for runtime stitching\n nodeExpando(anchor).__pithyCtx = context;\n nodeExpando(anchor).__nodeId = node.nodeId;\n nodeExpando(anchor).__slotName = slotName;\n nodeExpando(anchor).__pithyNode = node;\n\n // Create fallback fragment factory if fallback content exists\n if (node.fallbackChildren && node.fallbackChildren.length > 0) {\n nodeExpando(anchor).__fallbackFactory = () => {\n return pithyTreeToDom(node.fallbackChildren!, context);\n };\n }\n\n return anchor;\n }\n\n if (node.type === 'element') {\n // For components, create placeholder element (to be upgraded later)\n const tag = node.originalTagName ?? node.tagName ?? 'div';\n\n // SVG elements need to be created in the SVG namespace\n const el = SVG_TAGS.has(tag.toLowerCase())\n ? document.createElementNS(SVG_NS, tag)\n : document.createElement(tag);\n\n nodeExpando(el).__pithyCtx = context;\n\n // Store the PithyNode data for component binding to access:\n // - isComponent flag (to distinguish native elements from components)\n // - original attribute names (for prop name normalization)\n nodeExpando(el).__pithyNode = node;\n\n // Set static attributes\n for (const [name, value] of Object.entries(node.attrs ?? {})) {\n if (name.startsWith('@') || name.startsWith('[')) {\n continue; // Skip PithyJS directive attributes — handled in bind* functions\n }\n // Use original attribute name casing (important for SVG attributes like viewBox)\n const originalName = node.originalAttrs?.[name] || name;\n el.setAttribute(originalName, value);\n }\n\n // @for loop - REPLACE element with anchor\n if (node.directives?.for) {\n // Create a comment node as placeholder\n const placeholder = document.createComment(\n `Placeholder for loop items pid=\"${node.nodeId}\"`\n );\n nodeExpando(placeholder).__pithyCtx = context;\n\n // Store the nodeId on the comment for bindForLoops to find it\n if (node.nodeId) {\n nodeExpando(placeholder).__nodeId = node.nodeId;\n // Loop placeholders are comment nodes — discovered via __nodeId walk, not querySelectorAll (data-pid is for element nodes only)\n }\n\n // Store the original PithyNode structure for nested processing\n nodeExpando(placeholder).__pithyNode = node;\n\n return placeholder;\n }\n\n // Apply directive data-* attributes for runtime binders.\n // Uses the shared mapping from @pithyjs/compiler to stay in sync with AOT codegen.\n if (node.directives) {\n forEachDirectiveAttr(node.directives, (attr, value) => {\n el.setAttribute(attr, value);\n });\n\n // Preserve `slot` as a standard HTML attribute.\n // forEachDirectiveAttr intentionally skips slot (it's consumed by content\n // projection via directives.slot), but downstream binders like\n // bindDeferDirectives need it as a DOM attribute for querySelector lookups\n // (e.g., '[slot=\"placeholder\"]', '[slot=\"error\"]').\n if (node.directives.slot && !el.hasAttribute('slot')) {\n el.setAttribute('slot', node.directives.slot);\n }\n }\n\n // Optional: add dev/debug node ID\n if (node.nodeId) {\n el.setAttribute('data-pid', node.nodeId);\n } else if (node.attrs?.['data-pid']) {\n // Preserve existing data-pid from the original HTML\n el.setAttribute('data-pid', node.attrs['data-pid']);\n }\n\n // Recursively process children\n for (const child of node.children ?? []) {\n const childDom = createDomNodeFromPithy(child, context);\n if (childDom) el.appendChild(childDom);\n }\n\n return el;\n }\n\n return null;\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import type { PithyNode } from '@pithyjs/compiler';
2
+ export interface Branch {
3
+ nodes: Node[];
4
+ disposers: (() => void)[];
5
+ }
6
+ /**
7
+ * Builds the DOM for one `@if` or `@case` branch from its AST, binds it, and
8
+ * inserts it after `anchor`.
9
+ */
10
+ export declare function renderBranch(ast: PithyNode, ctx: Record<string, unknown>, anchor: Node): Branch;
11
+ /** Disposes a branch's effects, then removes its nodes. */
12
+ export declare function clearBranch(branch: Branch): void;
13
+ //# sourceMappingURL=renderBranch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderBranch.d.ts","sourceRoot":"","sources":["../../src/compile/renderBranch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAUnD,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,SAAS,EACd,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,MAAM,EAAE,IAAI,GACX,MAAM,CAoCR;AAED,2DAA2D;AAC3D,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAahD"}
@@ -0,0 +1,65 @@
1
+ import { createRoot } from '@pithyjs/signals';
2
+ import { bindConditionals } from './binds/bindConditionals.js';
3
+ import { flashUpdate } from './binds/bindTextInterpolations.js';
4
+ import { bindSwitchBlock, bindSwitchCases } from './bindSwitchCases.js';
5
+ import { bindTemplateDirectives } from './compileTemplate.js';
6
+ import { bindForLoops } from './forLoops/bindForLoops.js';
7
+ import { pithyTreeToDom } from './pithyTreeToDom.js';
8
+ import { isSSRMode } from './ssrMode.js';
9
+ /**
10
+ * Builds the DOM for one `@if` or `@case` branch from its AST, binds it, and
11
+ * inserts it after `anchor`.
12
+ */
13
+ export function renderBranch(ast, ctx, anchor) {
14
+ const branch = { nodes: [], disposers: [] };
15
+ const rebuilt = pithyTreeToDom([ast], ctx).firstChild;
16
+ if (!rebuilt || !anchor.parentNode)
17
+ return branch;
18
+ // A component tag is replaced by what it renders while binding, so the
19
+ // fragment, not `rebuilt`, holds the nodes to insert and later remove.
20
+ const fragment = document.createDocumentFragment();
21
+ fragment.appendChild(rebuilt);
22
+ const children = ast.isComponent ? [] : ast.children || [];
23
+ const { disposers } = branch;
24
+ createRoot(disposeRoot => {
25
+ disposers.push(disposeRoot);
26
+ const processed = new Set();
27
+ if (ast.directives?.switch !== undefined && !ast.isComponent) {
28
+ bindSwitchBlock(ast, rebuilt, ctx, processed, disposers);
29
+ }
30
+ else {
31
+ bindSwitchCases(children, rebuilt, ctx, processed, disposers);
32
+ }
33
+ bindConditionals(children, rebuilt, ctx, processed, disposers);
34
+ bindForLoops(children, rebuilt, ctx, disposers, processed);
35
+ bindTemplateDirectives(fragment, ctx, disposers);
36
+ });
37
+ branch.nodes = Array.from(fragment.childNodes);
38
+ anchor.parentNode.insertBefore(fragment, anchor.nextSibling);
39
+ if (!isSSRMode()) {
40
+ queueMicrotask(() => {
41
+ for (const node of branch.nodes) {
42
+ if (node.nodeType === Node.ELEMENT_NODE)
43
+ flashUpdate(node);
44
+ }
45
+ });
46
+ }
47
+ return branch;
48
+ }
49
+ /** Disposes a branch's effects, then removes its nodes. */
50
+ export function clearBranch(branch) {
51
+ for (const dispose of branch.disposers) {
52
+ try {
53
+ dispose();
54
+ }
55
+ catch {
56
+ /* ignore */
57
+ }
58
+ }
59
+ branch.disposers = [];
60
+ for (const node of branch.nodes) {
61
+ node.parentNode?.removeChild(node);
62
+ }
63
+ branch.nodes = [];
64
+ }
65
+ //# sourceMappingURL=renderBranch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderBranch.js","sourceRoot":"","sources":["../../src/compile/renderBranch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,YAAY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als } from './binds/bindConditionals';\nimport { flashUpdate } from './binds/bindTextInterpolations';\nimport { bindSwitchBlock, bindSwitchCases } from './bindSwitchCases';\nimport { bindTemplateDirectives } from './compileTemplate';\nimport { bindForLoops } from './forLoops/bindForLoops';\nimport { pithyTreeToDom } from './pithyTreeToDom';\nimport { isSSRMode } from './ssrMode';\n\nexport interface Branch {\n nodes: Node[];\n disposers: (() => void)[];\n}\n\n/**\n * Builds the DOM for one `@if` or `@case` branch from its AST, binds it, and\n * inserts it after `anchor`.\n */\nexport function renderBranch(\n ast: PithyNode,\n ctx: Record<string, unknown>,\n anchor: Node\n): Branch {\n const branch: Branch = { nodes: [], disposers: [] };\n const rebuilt = pithyTreeToDom([ast], ctx).firstChild as Element | null;\n if (!rebuilt || !anchor.parentNode) return branch;\n\n // A component tag is replaced by what it renders while binding, so the\n // fragment, not `rebuilt`, holds the nodes to insert and later remove.\n const fragment = document.createDocumentFragment();\n fragment.appendChild(rebuilt);\n const children = ast.isComponent ? [] : ast.children || [];\n const { disposers } = branch;\n\n createRoot(disposeRoot => {\n disposers.push(disposeRoot);\n const processed = new Set<string>();\n if (ast.directives?.switch !== undefined && !ast.isComponent) {\n bindSwitchBlock(ast, rebuilt, ctx, processed, disposers);\n } else {\n bindSwitchCases(children, rebuilt, ctx, processed, disposers);\n }\n bindConditionals(children, rebuilt, ctx, processed, disposers);\n bindForLoops(children, rebuilt, ctx, disposers, processed);\n bindTemplateDirectives(fragment, ctx, disposers);\n });\n\n branch.nodes = Array.from(fragment.childNodes);\n anchor.parentNode.insertBefore(fragment, anchor.nextSibling);\n\n if (!isSSRMode()) {\n queueMicrotask(() => {\n for (const node of branch.nodes) {\n if (node.nodeType === Node.ELEMENT_NODE) flashUpdate(node as Element);\n }\n });\n }\n return branch;\n}\n\n/** Disposes a branch's effects, then removes its nodes. */\nexport function clearBranch(branch: Branch): void {\n for (const dispose of branch.disposers) {\n try {\n dispose();\n } catch {\n /* ignore */\n }\n }\n branch.disposers = [];\n for (const node of branch.nodes) {\n node.parentNode?.removeChild(node);\n }\n branch.nodes = [];\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { PithyNode } from '@pithyjs/compiler';
2
- import { type PithyComponentContext } from '../types/globals';
3
- import type { ChildFactory } from '../runtime/bindings/types';
2
+ import { type PithyComponentContext } from '../types/globals.js';
3
+ import type { ChildFactory } from '../runtime/bindings/types.js';
4
4
  /**
5
5
  * If the registry renderer has set `globalThis.__pithyProjectedChildren` (a
6
6
  * `DocumentFragment` of already-rendered slot children), returns and clears it —
@@ -1,5 +1,5 @@
1
- import { compileNodes } from './compileNodes';
2
- import { pithyGlobals } from '../types/globals';
1
+ import { compileNodes } from './compileNodes.js';
2
+ import { pithyGlobals } from '../types/globals.js';
3
3
  /**
4
4
  * If the registry renderer has set `globalThis.__pithyProjectedChildren` (a
5
5
  * `DocumentFragment` of already-rendered slot children), returns and clears it —
@@ -1 +1 @@
1
- {"version":3,"file":"renderChildren.js","sourceRoot":"","sources":["../../src/compile/renderChildren.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAA8B,MAAM,kBAAkB,CAAC;AAG5E;;;;;;;;;;;;;;GAcG;AACH,wKAAwK;AACxK,MAAM,UAAU,cAAc;IAI5B,MAAM,WAAW,GAAG,YAAY,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAG,WAAW,CAAC,wBAAwB,CAAC;IACtD,IAAI,QAAQ,EAAE,CAAC;QACb,WAAW,CAAC,wBAAwB,GAAG,SAAS,CAAC;QACjD,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC;IAC7C,CAAC;IAED,MAAM,YAAY,GAAG,YAAY,EAAE,CAAC,uBAAuB,CAAC;IAE5D,8EAA8E;IAC9E,gFAAgF;IAChF,qEAAqE;IACrE,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC,y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AC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAClE;QACH,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,YAAY,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,yKAAyK;AACzK,MAAM,UAAU,eAAe;IAI7B,MAAM,CAAC,GAAG,YAAY,EAAE,CAAC;IACzB,MAAM,OAAO,GAAG,CAAC,CAAC,uBAAuB,CAAC;IAC1C,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;IAChC,sDAAsD;IACtD,qEAAqE;IACrE,iEAAiE;IACjE,CAAC,CAAC,uBAAuB,GAAG,OAAO,EAAE,wBAAwB,IAAI,SAAS,CAAC;IAC3E,OAAO,MAAM,CAAC;AAChB,CAAC;AASD;;;;;GAKG;AACH,+IAA+I;AAC/I,MAAM,UAAU,gBAAgB;IAC9B,MAAM,CAAC,GAAG,YAAY,EAAE,CAAC;IACzB,MAAM,OAAO,GAAG,CAAC,CAAC,uBAAuB,CAAC;IAC1C,MAAM,OAAO,GAAG,OAAO,EAAE,cAAc,CAAC;IACxC,MAAM,GAAG,GAAG,OAAO,EAAE,eAAe,CAAC;IACrC,OAAO;QACL,OAAO;QACP,OAAO;QACP,QAAQ,EAAE,CAAC,OAAO,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;QAC7D,SAAS,EAAE,CAAC,CAAC,wBAAwB;KACtC,CAAC;AACJ,CAAC","sourcesContent":["import { compileNodes } from './compileNodes';\nimport type { PithyNode } from '@pithyjs/compiler';\nimport { pithyGlobals, type PithyComponentContext } from '../types/globals';\nimport type { ChildFactory } from '../runtime/bindings/types';\n\n/**\n * If the registry renderer has set `globalThis.__pithyProjectedChildren` (a\n * `DocumentFragment` of already-rendered slot children), returns and clears it —\n * single-consume, so the first caller wins. This delivers construction-time\n * children on the registry path. The registry path has no AST fallback, so a\n * second `renderChildren()`/`captureChildren()` call returns an empty fragment.\n *\n * Otherwise compiles child AST nodes from the current component context through\n * the full pipeline (structural + non-structural directives). This enables\n * nested components inside projected content — unlike `<slot>`, which inserts\n * DOM after `bindComponentTags` has already run.\n *\n * Use inside component functions (Stack, Grid, etc.) that need to compile\n * their children without named slots or fallback content.\n */\n/** @codexApi {\"parent\":\"pithy.runtime.compile-nodes\",\"name\":\"renderChildren\",\"stability\":\"stable\",\"signature\":\"() => { el: DocumentFragment; destroy: () => void }\"} */\nexport function renderChildren(): {\n el: DocumentFragment;\n destroy: () => void;\n} {\n const globalScope = pithyGlobals();\n const injected = globalScope.__pithyProjectedChildren;\n if (injected) {\n globalScope.__pithyProjectedChildren = undefined;\n return { el: injected, destroy: () => {} };\n }\n\n const componentCtx = pithyGlobals().__pithyComponentContext;\n\n // A parent composing atoms by direct call after captureChildren() cleared its\n // context is still mid-render (`rendering` truthy) — not the misuse this guards\n // against, so a consumed context alone must not trigger the warning.\n const rendering = pithyGlobals().__pithyRenderingComponent;\n if (import.meta.env?.DEV && !componentCtx && !rendering) {\n console.warn('[renderChildren] Called outside component render context');\n }\n\n const childAstNodes: PithyNode[] = componentCtx?.__childAstNodes ?? [];\n\n // Strip internal __ properties, keep parent scope (includes components, signals, etc.)\n const parentCtx: Record<string, unknown> = componentCtx\n ? Object.fromEntries(\n Object.entries(componentCtx).filter(([k]) => !k.startsWith('__'))\n )\n : {};\n\n return compileNodes(childAstNodes, parentCtx);\n}\n\n/**\n * Captures projected children and clears the component context so\n * inner component calls (e.g. `Heading()`, `Text()`) don't consume\n * the outer component's children.\n *\n * After capture, the current component's context on `globalThis` is\n * reset to the value of `__parentComponentContext` if present, or\n * otherwise to `undefined`. In the current core implementation,\n * `__parentComponentContext` is not set by the runtime, so this\n * effectively clears the active component context to prevent child\n * leakage into inner component calls.\n *\n * **Important invariant:** This function must be called exactly once per\n * component, before any inner component function calls. It consumes the\n * current context's children — a second call would return an empty fragment.\n * After this call, the caller must not rely on reading its own context\n * properties from `globalThis.__pithyComponentContext`.\n *\n * For 3+ levels of nesting (e.g., section A → section B → atoms), each\n * level should call `captureChildren()` independently. Any multi-level\n * parent restoration depends on `__parentComponentContext` being managed\n * by external tooling; the core library only performs a best-effort reset\n * from that property when present.\n */\n/** @codexApi {\"parent\":\"pithy.runtime.compile-nodes\",\"name\":\"captureChildren\",\"stability\":\"stable\",\"signature\":\"() => { el: DocumentFragment; destroy: () => void }\"} */\nexport function captureChildren(): {\n el: DocumentFragment;\n destroy: () => void;\n} {\n const g = pithyGlobals();\n const prevCtx = g.__pithyComponentContext;\n const result = renderChildren();\n // Clear context so inner component calls start fresh.\n // If there was a parent context, it will be restored by the parent's\n // own render cycle — we only need to prevent child leakage here.\n g.__pithyComponentContext = prevCtx?.__parentComponentContext ?? undefined;\n return result;\n}\n\nexport interface ChildPayload {\n context: PithyComponentContext | undefined;\n factory?: ChildFactory;\n astNodes?: PithyNode[];\n projected?: DocumentFragment;\n}\n\n/**\n * Reads the children addressed to the component being rendered, without\n * consuming them. `factory` and `astNodes` are mutually exclusive: an AOT child\n * factory wins, because a JIT parent's AST can reach an AOT component's context\n * through `mergeContexts`, never the reverse.\n */\n/** @codexApi {\"parent\":\"pithy.runtime.compile-nodes\",\"name\":\"readChildPayload\",\"stability\":\"experimental\",\"signature\":\"() => ChildPayload\"} */\nexport function readChildPayload(): ChildPayload {\n const g = pithyGlobals();\n const context = g.__pithyComponentContext;\n const factory = context?.__childFactory;\n const ast = context?.__childAstNodes;\n return {\n context,\n factory,\n astNodes: !factory && ast && ast.length > 0 ? ast : undefined,\n projected: g.__pithyProjectedChildren,\n };\n}\n"]}
@@ -6,7 +6,7 @@
6
6
  "risk": "high"
7
7
  }
8
8
  */
9
- import { type BoundaryInfo } from './binds/bindErrorBoundary';
9
+ import { type BoundaryInfo } from './binds/bindErrorBoundary.js';
10
10
  /**
11
11
  * A component render crash recorded during a static/server render.
12
12
  */
@@ -6,9 +6,9 @@
6
6
  "risk": "high"
7
7
  }
8
8
  */
9
- import { pithyGlobals } from '../types/globals';
10
- import { isSSRMode } from './ssrMode';
11
- import { setBoundaryError } from './binds/bindErrorBoundary';
9
+ import { pithyGlobals } from '../types/globals.js';
10
+ import { isSSRMode } from './ssrMode.js';
11
+ import { setBoundaryError } from './binds/bindErrorBoundary.js';
12
12
  /**
13
13
  * Crashes recorded during the current server render, keyed by the placeholder
14
14
  * element so a later binding pass over the same element can retract its own
@@ -1 +1 @@
1
- {"version":3,"file":"ssrCrashes.js","sourceRoot":"","sources":["../../src/compile/ssrCrashes.ts"],"names":[],"mappings":"AAAA;;;;;;;EAOE;AAEF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAqB,MAAM,2BAA2B,CAAC;AAchF;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,aAAa;IACpB,MAAM,CAAC,GAAG,YAAY,EAAE,CAAC;IACzB,OAAO,CAAC,CAAC,CAAC,iBAAiB,KAAnB,CAAC,CAAC,iBAAiB,GAAK,IAAI,GAAG,EAAE,EAAiC,CAAC;AAC7E,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,+IAA+I;AAC/I,MAAM,UAAU,mBAAmB,CAAC,EAAW;IAC7C,aAAa,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAS,oBAAoB,CAAC,EAAW,EAAE,GAAW,EAAE,KAAc;IACpE,aAAa,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE;QACtB,EAAE;QACF,GAAG;QACH,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK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gB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAEtE,IAAI,SAAS,EAAE,EAAE,CAAC;QAChB,IAAI,QAAQ;YAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC;;YACjC,oBAAoB,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.runtime.ssr-crashes\",\n \"title\": \"SSR Unhandled Component Crash Collector\",\n \"category\": \"runtime\",\n \"risk\": \"high\"\n}\n*/\n\nimport { pithyGlobals } from '../types/globals';\nimport { isSSRMode } from './ssrMode';\nimport { setBoundaryError, type BoundaryInfo } from './binds/bindErrorBoundary';\n\n/**\n * A component render crash recorded during a static/server render.\n */\nexport interface SSRRenderCrash {\n /** The custom-element placeholder the crashed component was to replace. */\n el: Element;\n /** Authored tag name, for the failure message. */\n tag: string;\n /** The error the component threw. */\n error: Error;\n}\n\n/**\n * Crashes recorded during the current server render, keyed by the placeholder\n * element so a later binding pass over the same element can retract its own\n * earlier record (see `clearSSRRenderCrash`).\n *\n * Held on `globalThis`, not in this module. `@pithyjs/ssr` depends on\n * `@pithyjs/core` as a regular dependency, so an app and the SSR package can\n * resolve two physical copies: `html()` would record into the app's copy while\n * `renderToString()` collected and reset the SSR package's, reintroducing\n * BUG-018 *and* leaking the app copy's DOM records for the life of the process.\n * The same reasoning already puts `__PITHY_SSR__` and `__getComponentContext`\n * on this bridge.\n *\n * A `Map` (not a `WeakMap`) because the collector must be enumerable at flush\n * time. `resetSSRRenderCrashes()` is what keeps it from retaining DOM across\n * renders — the SSR renderer calls it in a `finally`.\n */\nfunction crashRegistry(): Map<Element, SSRRenderCrash> {\n const g = pithyGlobals();\n return (g.__pithySSRCrashes ??= new Map()) as Map<Element, SSRRenderCrash>;\n}\n\n/**\n * Forget any crash previously recorded for `el`.\n *\n * Called only at points where the record is provably no longer the outcome, and\n * NEVER before invoking a component. Retracting eagerly at the top of an attempt\n * hides a failed retry: a component that throws detached and then returns\n * something unusable would have its only record erased, shipping a page with a\n * missing subtree and a green build. The three call sites are:\n *\n * 1. A boundary ACCEPTING the error (`setBoundaryError()` returning `true`).\n * A boundary merely being in scope is not enough — an already-active one\n * with no free ancestor rejects the error, and that is as unhandled as\n * having no boundary at all.\n * 2. A component returning a usable node that then successfully reaches the\n * document, i.e. after `replaceWith` has not thrown.\n * 3. An element that has left the tree being bound (`scope.contains(el)` in\n * `bindComponentTags`, `fragment.contains(el)` in `applyBindings`). It can\n * no longer contribute to the output, so any record for it is stale.\n *\n * Retraction matters because the JIT `@if` path really does attempt the same tag\n * twice, measured by counting component invocations:\n *\n * 1. `bindStructuralDirectives` runs first and `handleConditionalChain` binds\n * the chosen branch while it is still DETACHED, so `el.closest('[data-error]')`\n * finds nothing and the crash is recorded.\n * 2. The branch is inserted, and `bindTemplateDirectives` then reaches the\n * still-raw tag on the assembled tree, where the boundary is visible and\n * accepts — retracting via case 1 above.\n *\n * Case 3 exists because accepting is synchronous: it immediately hides the\n * boundary's content, so a SECOND crashing component in that branch is detached\n * before it can be retried, and its detached-pass record would otherwise stand\n * and fail a route whose fallback rendered correctly.\n *\n * Every one of these is mutation-tested; removing any of them turns a correct\n * render into a failed route, or a broken one into a silent success.\n *\n * AOT invokes `applyComponent` once per `pid` and never retries, which is why\n * the equivalent AOT boundary case behaves differently — see BUG-023.\n */\n/** @codexApi {\"parent\":\"pithy.runtime.ssr-crashes\",\"name\":\"clearSSRRenderCrash\",\"stability\":\"internal\",\"signature\":\"(el: Element) => void\"} */\nexport function clearSSRRenderCrash(el: Element): void {\n crashRegistry().delete(el);\n}\n\n/**\n * Record a component failure that no error boundary took ownership of.\n *\n * The precondition is **not** \"no boundary was in scope\". It is that no boundary\n * ACCEPTED the error, which is a strictly weaker thing: `setBoundaryError()`\n * rejects an error when the nearest boundary is already showing one and no\n * ancestor is free, and both binders call this on that path with a boundary\n * very much present. Getting the two confused is what this whole module exists\n * to prevent.\n *\n * Nor is \"crash\" limited to a thrown error. The binders also record a component\n * that returned an unusable result, and one whose rendered node failed to reach\n * the document — both leave the raw tag exactly where a throw would, which is\n * the same content loss from the page's point of view.\n *\n * Callers must have established `isSSRMode()` themselves; this does not\n * re-check.\n */\nfunction recordSSRRenderCrash(el: Element, tag: string, error: unknown): void {\n crashRegistry().set(el, {\n el,\n tag,\n error: error instanceof Error ? error : new Error(String(error)),\n });\n}\n\n/**\n * Drop every recorded crash. Called by the SSR renderer before a render starts\n * and again in its `finally`, so one route's crash can never fail the next.\n */\n/** @codexApi {\"parent\":\"pithy.runtime.ssr-crashes\",\"name\":\"resetSSRRenderCrashes\",\"stability\":\"stable\",\"signature\":\"() => void\"} */\nexport function resetSSRRenderCrashes(): void {\n crashRegistry().clear();\n}\n\n/**\n * Return the crashes still recorded once the render has finished, and empty\n * the collector.\n *\n * Every surviving record is a failure. A record is only ever retracted by\n * `clearSSRRenderCrash`, i.e. by a genuine re-attempt at the same element that\n * then went better — never by inspecting the finished tree.\n *\n * An earlier draft re-resolved each record's boundary here, dropping any crash\n * whose element had ended up inside an `@error-boundary`. That is unsound,\n * because a boundary *existing* above an element is not the same as that\n * boundary having *handled* the crash:\n *\n * - JIT never needed it. It does record a crash from the detached first\n * attempt, but the retry after insertion is caught by the boundary and\n * retracts that record itself (see `clearSSRRenderCrash`). By collect time\n * there is nothing left to re-resolve.\n * - AOT was actively broken by it. A branch factory binds its subtree while\n * detached, so `applyComponent`'s `el.closest('[data-error]')` finds\n * nothing and the boundary never receives the error — but the nodes are\n * then inserted *under* that boundary, so re-resolution saw one and\n * dropped the record. The boundary signal stayed null, its fallback never\n * activated, the raw component tag shipped, and the build went green: the\n * exact BUG-018 symptom, reintroduced by its own fix.\n *\n * That AOT boundary gap is real but predates this collector and is tracked\n * separately as BUG-023. Until it is fixed, such a crash fails its route, which\n * is the safe direction: a loud failure rather than silently truncated HTML.\n */\n/** @codexApi {\"parent\":\"pithy.runtime.ssr-crashes\",\"name\":\"collectUnhandledSSRRenderCrashes\",\"stability\":\"stable\",\"signature\":\"() => SSRRenderCrash[]\"} */\nexport function collectUnhandledSSRRenderCrashes(): SSRRenderCrash[] {\n const registry = crashRegistry();\n const unhandled = [...registry.values()];\n registry.clear();\n return unhandled;\n}\n\n/**\n * Hand a component failure to its `@error-boundary`, or record it if none takes\n * it. Returns whether a boundary accepted ownership.\n *\n * The single funnel for every way a component can fail to produce content: a\n * thrown error, an unusable return value, and a rendered node that never reached\n * the document. They were handled in five separate places and drifted — the\n * throw paths consulted the boundary while the malformed paths recorded\n * directly, so a component under `@error-boundary` that returned garbage left\n * the boundary signal null, rendered no fallback, and failed the route, even\n * though the code called it \"the same content loss as a crash\".\n *\n * Callers still do their own logging, since the wording differs per failure.\n */\n/** @codexApi {\"parent\":\"pithy.runtime.ssr-crashes\",\"name\":\"reportComponentFailure\",\"stability\":\"internal\",\"signature\":\"(el: Element, tag: string, error: Error, boundary: BoundaryInfo | null) => boolean\"} */\nexport function reportComponentFailure(\n el: Element,\n tag: string,\n error: Error,\n boundary: BoundaryInfo | null\n): boolean {\n // A boundary in scope is not a boundary that accepted: an already-active one\n // with no free ancestor rejects, and that is as unhandled as having none.\n const accepted = boundary ? setBoundaryError(boundary, error) : false;\n\n if (isSSRMode()) {\n if (accepted) clearSSRRenderCrash(el);\n else recordSSRRenderCrash(el, tag, error);\n }\n\n return accepted;\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "category": "runtime"
6
6
  }
7
7
  */
8
- import { pithyGlobals } from '../types/globals';
8
+ import { pithyGlobals } from '../types/globals.js';
9
9
  /**
10
10
  * Checks if the current execution is in SSR (Server-Side Rendering) mode.
11
11
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ssrMode.js","sourceRoot":"","sources":["../../src/compile/ssrMode.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;;;GAMG;AACH,wHAAwH;AACxH,MAAM,UAAU,SAAS;IACvB,OAAO,CAAC,CAAC,YAAY,EAAE,CAAC,aAAa,CAAC;AACxC,CAAC"}
1
+ {"version":3,"file":"ssrMode.js","sourceRoot":"","sources":["../../src/compile/ssrMode.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;;;GAMG;AACH,wHAAwH;AACxH,MAAM,UAAU,SAAS;IACvB,OAAO,CAAC,CAAC,YAAY,EAAE,CAAC,aAAa,CAAC;AACxC,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.runtime.ssr-mode\",\n \"title\": \"SSR Mode Detection\",\n \"category\": \"runtime\"\n}\n*/\n\nimport { pithyGlobals } from '../types/globals';\n\n/**\n * Checks if the current execution is in SSR (Server-Side Rendering) mode.\n *\n * The SSR package sets `globalThis.__PITHY_SSR__` when the environment is active.\n * Core binding functions check this flag to skip reactive effects and evaluate\n * directives synchronously during SSR.\n */\n/** @codexApi {\"parent\":\"pithy.runtime.ssr-mode\",\"name\":\"isSSRMode\",\"stability\":\"stable\",\"signature\":\"() => boolean\"} */\nexport function isSSRMode(): boolean {\n return !!pithyGlobals().__PITHY_SSR__;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"textValue.js","sourceRoot":"","sources":["../../src/compile/textValue.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,2IAA2I;AAC3I,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"}
1
+ {"version":3,"file":"textValue.js","sourceRoot":"","sources":["../../src/compile/textValue.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,2IAA2I;AAC3I,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.runtime.dom-safety\",\n \"title\": \"DOM Text Safety\",\n \"category\": \"runtime\"\n}\n*/\n\n/**\n * Coerce an interpolated value to display text for a DOM **text node**\n * (`.nodeValue` / `.textContent`).\n *\n * Text nodes are inherently XSS-safe: the browser stores the string as literal\n * character data and never parses it as markup. So `{{ expr }}` interpolations\n * must NOT be HTML-escaped — escaping turns `>` into `&gt;`, which then renders\n * as the *visible* text `&gt;` (e.g. a TS signature `() => Promise<void>` shows\n * as `() =&gt; Promise&lt;void&gt;`). Assigning the raw string is both correct\n * and safe: `textNode.nodeValue = '<img onerror=…>'` creates a text node, not\n * an element.\n *\n * Internal helper — not part of the public package API (intentionally absent\n * from the barrel / package exports).\n *\n * @param input - Any value being interpolated into a text node\n * @returns The value as a plain string (no HTML escaping)\n */\n/** @codexApi {\"parent\":\"pithy.runtime.dom-safety\",\"name\":\"toTextValue\",\"stability\":\"internal\",\"signature\":\"(input: unknown) => string\"} */\nexport function toTextValue(input: unknown): string {\n return String(input);\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare function trimBlankEdges<T>(nodes: T[], textOf: (node: T) => string | null): T[];
2
+ //# sourceMappingURL=trimBlankEdges.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trimBlankEdges.d.ts","sourceRoot":"","sources":["../../src/compile/trimBlankEdges.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,CAAC,EAC9B,KAAK,EAAE,CAAC,EAAE,EACV,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI,GACjC,CAAC,EAAE,CAUL"}
@@ -0,0 +1,15 @@
1
+ const ASCII_WHITESPACE = /^[ \t\n\f\r]*$/;
2
+ export function trimBlankEdges(nodes, textOf) {
3
+ const blank = (node) => {
4
+ const text = textOf(node);
5
+ return text !== null && ASCII_WHITESPACE.test(text);
6
+ };
7
+ let start = 0;
8
+ let end = nodes.length;
9
+ while (start < end && blank(nodes[start]))
10
+ start++;
11
+ while (end > start && blank(nodes[end - 1]))
12
+ end--;
13
+ return nodes.slice(start, end);
14
+ }
15
+ //# sourceMappingURL=trimBlankEdges.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trimBlankEdges.js","sourceRoot":"","sources":["../../src/compile/trimBlankEdges.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAE1C,MAAM,UAAU,cAAc,CAC5B,KAAU,EACV,MAAkC;IAElC,MAAM,KAAK,GAAG,CAAC,IAAO,EAAE,EAAE;QACxB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC1B,OAAO,IAAI,KAAK,IAAI,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC;IACF,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;IACvB,OAAO,KAAK,GAAG,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAAE,KAAK,EAAE,CAAC;IACnD,OAAO,GAAG,GAAG,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QAAE,GAAG,EAAE,CAAC;IACnD,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACjC,CAAC","sourcesContent":["const ASCII_WHITESPACE = /^[ \\t\\n\\f\\r]*$/;\n\nexport function trimBlankEdges<T>(\n nodes: T[],\n textOf: (node: T) => string | null\n): T[] {\n const blank = (node: T) => {\n const text = textOf(node);\n return text !== null && ASCII_WHITESPACE.test(text);\n };\n let start = 0;\n let end = nodes.length;\n while (start < end && blank(nodes[start])) start++;\n while (end > start && blank(nodes[end - 1])) end--;\n return nodes.slice(start, end);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAkCF,uHAAuH;AACvH,MAAM,CAAC,MAAM,aAAa,GAAgB;IACxC,sBAAsB,EAAE,IAAI;IAC5B,cAAc,EAAE,yBAAyB;IACzC,iBAAiB,EAAE,GAAG;IACtB,eAAe,EAAE,KAAK,EAAE,uDAAuD;IAC/E,qBAAqB,EAAE,WAAW,EAAE,+EAA+E;CACpH,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAkCF,uHAAuH;AACvH,MAAM,CAAC,MAAM,aAAa,GAAgB;IACxC,sBAAsB,EAAE,IAAI;IAC5B,cAAc,EAAE,yBAAyB;IACzC,iBAAiB,EAAE,GAAG;IACtB,eAAe,EAAE,KAAK,EAAE,uDAAuD;IAC/E,qBAAqB,EAAE,WAAW,EAAE,+EAA+E;CACpH,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.config.system\",\n \"title\": \"Framework Configuration System\", \n \"category\": \"runtime\"\n}\n*/\n\nexport interface PithyConfig {\n /**\n * Enable visual highlighting of DOM updates in development mode.\n * NOTE: Only works with span-wrapped interpolations (textInterpolationMode: 'span' or 'auto').\n * Text nodes cannot be styled, so no visual feedback in 'text-node' mode.\n * @default true\n */\n devHighlightDomUpdates?: boolean;\n\n /** Color for update highlights @default 'rgba(11, 205, 118, 0.8)' */\n highlightColor?: string;\n\n /** Duration of highlight animation in seconds @default 0.3 */\n highlightDuration?: number;\n\n /**\n * Automatically wrap signal expressions in <span> for visual feedback.\n * Only applies when textInterpolationMode is 'auto'.\n * @default false\n */\n autoWrapSignals?: boolean;\n\n /**\n * How to render text interpolations:\n * - 'text-node': Maximum performance, bare text nodes (no visual feedback)\n * - 'span': Wrapped in spans, visual feedback enabled (extra DOM nodes)\n * - 'auto': Smart mode - respects autoWrapSignals setting\n * @default 'text-node'\n */\n textInterpolationMode?: 'text-node' | 'span' | 'auto';\n}\n\n/** @codexApi {\"parent\":\"pithy.config.system\",\"name\":\"defaultConfig\",\"stability\":\"stable\",\"signature\":\"PithyConfig\"} */\nexport const defaultConfig: PithyConfig = {\n devHighlightDomUpdates: true,\n highlightColor: 'rgba(11, 205, 118, 0.8)',\n highlightDuration: 0.3,\n autoWrapSignals: false, // Keep false for maximum performance (text nodes only)\n textInterpolationMode: 'text-node', // Use text nodes with comment anchors (Solid.js approach) for best performance\n};\n"]}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export * from './types';
2
- export * from './compile';
3
- export * from './runtime';
4
- export * from './utilities';
5
- export * from './interfaces';
6
- export * from './a11y';
1
+ export * from './types/index.js';
2
+ export * from './compile/index.js';
3
+ export * from './runtime/index.js';
4
+ export * from './utilities/index.js';
5
+ export * from './interfaces/index.js';
6
+ export * from './a11y/index.js';
7
7
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- export * from './types';
2
- export * from './compile';
3
- export * from './runtime';
4
- export * from './utilities';
5
- export * from './interfaces';
6
- export * from './a11y';
1
+ export * from './types/index.js';
2
+ export * from './compile/index.js';
3
+ export * from './runtime/index.js';
4
+ export * from './utilities/index.js';
5
+ export * from './interfaces/index.js';
6
+ export * from './a11y/index.js';
7
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC","sourcesContent":["export * from './types';\nexport * from './compile';\nexport * from './runtime';\nexport * from './utilities';\nexport * from './interfaces';\nexport * from './a11y';\n"]}
@@ -1,3 +1,3 @@
1
- export * from './ref.interface';
2
- export * from './ref-signal.interface';
1
+ export * from './ref.interface.js';
2
+ export * from './ref-signal.interface.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,3 @@
1
- export * from './ref.interface';
2
- export * from './ref-signal.interface';
1
+ export * from './ref.interface.js';
2
+ export * from './ref-signal.interface.js';
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC","sourcesContent":["export * from './ref.interface';\nexport * from './ref-signal.interface';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ref-signal.interface.js","sourceRoot":"","sources":["../../src/interfaces/ref-signal.interface.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"ref-signal.interface.js","sourceRoot":"","sources":["../../src/interfaces/ref-signal.interface.ts"],"names":[],"mappings":"","sourcesContent":["export interface RefSignal<T extends HTMLElement = HTMLElement> {\n (): T | null;\n set: (el: T | null) => void;\n current: T | null;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ref.interface.js","sourceRoot":"","sources":["../../src/interfaces/ref.interface.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"ref.interface.js","sourceRoot":"","sources":["../../src/interfaces/ref.interface.ts"],"names":[],"mappings":"","sourcesContent":["export interface Ref<T> {\n readonly current: T | null;\n set: (el: T | null) => void;\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "category": "runtime"
6
6
  }
7
7
  */
8
- import { type Desc, type EventDesc, type InterpDesc, type ClassDesc, type ClassesDesc, type StyleDesc, type BoundDesc, type RefDesc, type BindDesc, type CompDesc, type DeferDesc, type ErrorDesc, type ProjDesc, type IfDesc, type ForDesc, type SwitchDesc } from './bindings';
8
+ import { type Desc, type EventDesc, type InterpDesc, type ClassDesc, type ClassesDesc, type StyleDesc, type BoundDesc, type RefDesc, type BindDesc, type CompDesc, type DeferDesc, type ErrorDesc, type ProjDesc, type IfDesc, type ForDesc, type SwitchDesc } from './bindings/index.js';
9
9
  export type { Desc, EventDesc, InterpDesc, ClassDesc, ClassesDesc, StyleDesc, BoundDesc, RefDesc, BindDesc, CompDesc, DeferDesc, ErrorDesc, ProjDesc, IfDesc, ForDesc, SwitchDesc, };
10
10
  /**
11
11
  * Applies pre-extracted binding descriptors to an AOT-generated DOM fragment.
@@ -28,8 +28,8 @@ export type { Desc, EventDesc, InterpDesc, ClassDesc, ClassesDesc, StyleDesc, Bo
28
28
  * @param bindings - Array of binding descriptors from codegen
29
29
  * @param context - Reactive context object with signals, methods, components
30
30
  */
31
- /** @codexApi {"parent":"pithy.runtime.apply-bindings","name":"__applyBindings","stability":"experimental","signature":"(fragment: DocumentFragment, bindings: Desc[], context: Record<string, unknown>) => { el: DocumentFragment; destroy: () => void }"} */
32
- export declare function __applyBindings(fragment: DocumentFragment, bindings: Desc[], context: Record<string, unknown>): {
31
+ /** @codexApi {"parent":"pithy.runtime.apply-bindings","name":"__applyBindings","stability":"experimental","signature":"(fragment: DocumentFragment, bindings: Desc[], context: Record<string, unknown>, ownsDestroyCallbacks?: boolean) => { el: DocumentFragment; destroy: () => void }"} */
32
+ export declare function __applyBindings(fragment: DocumentFragment, bindings: Desc[], context: Record<string, unknown>, ownsDestroyCallbacks?: boolean): {
33
33
  el: DocumentFragment;
34
34
  destroy: () => void;
35
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"applyBindings.d.ts","sourceRoot":"","sources":["../../src/runtime/applyBindings.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAIF,OAAO,EAmBL,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,OAAO,EACZ,KAAK,UAAU,EAChB,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,IAAI,EACJ,SAAS,EACT,UAAU,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,EACP,UAAU,GACX,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,8PAA8P;AAC9P,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,IAAI,EAAE,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B;IAAE,EAAE,EAAE,gBAAgB,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CA8J/C"}
1
+ {"version":3,"file":"applyBindings.d.ts","sourceRoot":"","sources":["../../src/runtime/applyBindings.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAKF,OAAO,EAoBL,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,QAAQ,E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