@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.
- package/README.md +12 -6
- package/dist/a11y/focus-trap.d.ts.map +1 -1
- package/dist/a11y/focus-trap.js +2 -0
- package/dist/a11y/focus-trap.js.map +1 -1
- package/dist/a11y/index.d.ts +4 -4
- package/dist/a11y/index.js +4 -4
- package/dist/a11y/index.js.map +1 -1
- package/dist/a11y/keyboard-utils.js.map +1 -1
- package/dist/a11y/roving-tabindex.js.map +1 -1
- package/dist/a11y/skip-link.js.map +1 -1
- package/dist/compile/bindSwitchCases.d.ts +8 -3
- package/dist/compile/bindSwitchCases.d.ts.map +1 -1
- package/dist/compile/bindSwitchCases.js +114 -181
- package/dist/compile/bindSwitchCases.js.map +1 -1
- package/dist/compile/binds/bindBoundAttributes.d.ts +1 -0
- package/dist/compile/binds/bindBoundAttributes.d.ts.map +1 -1
- package/dist/compile/binds/bindBoundAttributes.js +47 -2
- package/dist/compile/binds/bindBoundAttributes.js.map +1 -1
- package/dist/compile/binds/bindClassDirectives.d.ts +3 -2
- package/dist/compile/binds/bindClassDirectives.d.ts.map +1 -1
- package/dist/compile/binds/bindClassDirectives.js +53 -18
- package/dist/compile/binds/bindClassDirectives.js.map +1 -1
- package/dist/compile/binds/bindComponentsTags.d.ts +2 -0
- package/dist/compile/binds/bindComponentsTags.d.ts.map +1 -1
- package/dist/compile/binds/bindComponentsTags.js +86 -46
- package/dist/compile/binds/bindComponentsTags.js.map +1 -1
- package/dist/compile/binds/bindConditionals.d.ts +2 -2
- package/dist/compile/binds/bindConditionals.d.ts.map +1 -1
- package/dist/compile/binds/bindConditionals.js +22 -5
- package/dist/compile/binds/bindConditionals.js.map +1 -1
- package/dist/compile/binds/bindDefaultTwoWay.d.ts.map +1 -1
- package/dist/compile/binds/bindDefaultTwoWay.js +2 -1
- package/dist/compile/binds/bindDefaultTwoWay.js.map +1 -1
- package/dist/compile/binds/bindDeferDirectives.js +4 -4
- package/dist/compile/binds/bindDeferDirectives.js.map +1 -1
- package/dist/compile/binds/bindErrorBoundary.d.ts.map +1 -1
- package/dist/compile/binds/bindErrorBoundary.js +8 -3
- package/dist/compile/binds/bindErrorBoundary.js.map +1 -1
- package/dist/compile/binds/bindEventHandlers.js +2 -2
- package/dist/compile/binds/bindEventHandlers.js.map +1 -1
- package/dist/compile/binds/bindRefDirectives.js.map +1 -1
- package/dist/compile/binds/bindStyleDirectives.d.ts +17 -0
- package/dist/compile/binds/bindStyleDirectives.d.ts.map +1 -0
- package/dist/compile/binds/bindStyleDirectives.js +47 -0
- package/dist/compile/binds/bindStyleDirectives.js.map +1 -0
- package/dist/compile/binds/bindTextInterpolations.d.ts +2 -1
- package/dist/compile/binds/bindTextInterpolations.d.ts.map +1 -1
- package/dist/compile/binds/bindTextInterpolations.js +55 -17
- package/dist/compile/binds/bindTextInterpolations.js.map +1 -1
- package/dist/compile/binds/directiveRegistry.js.map +1 -1
- package/dist/compile/binds/forwardedAttrs.js.map +1 -1
- package/dist/compile/binds/propNames.d.ts +14 -0
- package/dist/compile/binds/propNames.d.ts.map +1 -0
- package/dist/compile/binds/propNames.js +116 -0
- package/dist/compile/binds/propNames.js.map +1 -0
- package/dist/compile/compileExpression.js.map +1 -1
- package/dist/compile/compileNodes.d.ts.map +1 -1
- package/dist/compile/compileNodes.js +6 -3
- package/dist/compile/compileNodes.js.map +1 -1
- package/dist/compile/compileTemplate.d.ts +3 -4
- package/dist/compile/compileTemplate.d.ts.map +1 -1
- package/dist/compile/compileTemplate.js +28 -31
- package/dist/compile/compileTemplate.js.map +1 -1
- package/dist/compile/componentResult.js.map +1 -1
- package/dist/compile/contentProjection.d.ts +1 -1
- package/dist/compile/contentProjection.d.ts.map +1 -1
- package/dist/compile/contentProjection.js +32 -15
- package/dist/compile/contentProjection.js.map +1 -1
- package/dist/compile/forLoops/bindForLoops.d.ts +2 -2
- package/dist/compile/forLoops/bindForLoops.d.ts.map +1 -1
- package/dist/compile/forLoops/bindForLoops.js +9 -22
- package/dist/compile/forLoops/bindForLoops.js.map +1 -1
- package/dist/compile/forLoops/createLoopManager.d.ts +3 -3
- package/dist/compile/forLoops/createLoopManager.d.ts.map +1 -1
- package/dist/compile/forLoops/createLoopManager.js +40 -38
- package/dist/compile/forLoops/createLoopManager.js.map +1 -1
- package/dist/compile/forLoops/index.d.ts +5 -5
- package/dist/compile/forLoops/index.js +5 -5
- package/dist/compile/forLoops/index.js.map +1 -1
- package/dist/compile/forLoops/loopHelpers.d.ts +6 -0
- package/dist/compile/forLoops/loopHelpers.d.ts.map +1 -1
- package/dist/compile/forLoops/loopHelpers.js +17 -0
- package/dist/compile/forLoops/loopHelpers.js.map +1 -1
- package/dist/compile/forLoops/loopSignals.js +2 -2
- package/dist/compile/forLoops/loopSignals.js.map +1 -1
- package/dist/compile/forLoops/loopTraversal.js +2 -2
- package/dist/compile/forLoops/loopTraversal.js.map +1 -1
- package/dist/compile/handleConditionalChain.d.ts +2 -2
- package/dist/compile/handleConditionalChain.d.ts.map +1 -1
- package/dist/compile/handleConditionalChain.js +22 -87
- package/dist/compile/handleConditionalChain.js.map +1 -1
- package/dist/compile/index.d.ts +17 -17
- package/dist/compile/index.js +14 -14
- package/dist/compile/index.js.map +1 -1
- package/dist/compile/injectScopedStyle.js.map +1 -1
- package/dist/compile/nodeExpando.d.ts +6 -0
- package/dist/compile/nodeExpando.d.ts.map +1 -1
- package/dist/compile/nodeExpando.js.map +1 -1
- package/dist/compile/parseHtml.d.ts.map +1 -1
- package/dist/compile/parseHtml.js +2 -2
- package/dist/compile/parseHtml.js.map +1 -1
- package/dist/compile/pithyTreeToDom.js +1 -1
- package/dist/compile/pithyTreeToDom.js.map +1 -1
- package/dist/compile/renderBranch.d.ts +13 -0
- package/dist/compile/renderBranch.d.ts.map +1 -0
- package/dist/compile/renderBranch.js +65 -0
- package/dist/compile/renderBranch.js.map +1 -0
- package/dist/compile/renderChildren.d.ts +2 -2
- package/dist/compile/renderChildren.js +2 -2
- package/dist/compile/renderChildren.js.map +1 -1
- package/dist/compile/ssrCrashes.d.ts +1 -1
- package/dist/compile/ssrCrashes.js +3 -3
- package/dist/compile/ssrCrashes.js.map +1 -1
- package/dist/compile/ssrMode.js +1 -1
- package/dist/compile/ssrMode.js.map +1 -1
- package/dist/compile/textValue.js.map +1 -1
- package/dist/compile/trimBlankEdges.d.ts +2 -0
- package/dist/compile/trimBlankEdges.d.ts.map +1 -0
- package/dist/compile/trimBlankEdges.js +15 -0
- package/dist/compile/trimBlankEdges.js.map +1 -0
- package/dist/config/index.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/interfaces/index.d.ts +2 -2
- package/dist/interfaces/index.js +2 -2
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/ref-signal.interface.js.map +1 -1
- package/dist/interfaces/ref.interface.js.map +1 -1
- package/dist/runtime/applyBindings.d.ts +3 -3
- package/dist/runtime/applyBindings.d.ts.map +1 -1
- package/dist/runtime/applyBindings.js +74 -22
- package/dist/runtime/applyBindings.js.map +1 -1
- package/dist/runtime/bindings/applyComponent.d.ts +2 -2
- package/dist/runtime/bindings/applyComponent.d.ts.map +1 -1
- package/dist/runtime/bindings/applyComponent.js +41 -32
- package/dist/runtime/bindings/applyComponent.js.map +1 -1
- package/dist/runtime/bindings/applyDefer.d.ts +1 -1
- package/dist/runtime/bindings/applyDefer.js +6 -6
- package/dist/runtime/bindings/applyDefer.js.map +1 -1
- package/dist/runtime/bindings/applySimple.d.ts +1 -1
- package/dist/runtime/bindings/applySimple.d.ts.map +1 -1
- package/dist/runtime/bindings/applySimple.js +45 -13
- package/dist/runtime/bindings/applySimple.js.map +1 -1
- package/dist/runtime/bindings/applyStructural.d.ts +1 -1
- package/dist/runtime/bindings/applyStructural.d.ts.map +1 -1
- package/dist/runtime/bindings/applyStructural.js +58 -68
- package/dist/runtime/bindings/applyStructural.js.map +1 -1
- package/dist/runtime/bindings/helpers.d.ts +1 -1
- package/dist/runtime/bindings/helpers.js +1 -1
- package/dist/runtime/bindings/helpers.js.map +1 -1
- package/dist/runtime/bindings/index.d.ts +6 -6
- package/dist/runtime/bindings/index.d.ts.map +1 -1
- package/dist/runtime/bindings/index.js +5 -5
- package/dist/runtime/bindings/index.js.map +1 -1
- package/dist/runtime/bindings/types.js.map +1 -1
- package/dist/runtime/bootstrap.d.ts +1 -1
- package/dist/runtime/bootstrap.js +1 -1
- package/dist/runtime/bootstrap.js.map +1 -1
- package/dist/runtime/createContextProxy.js.map +1 -1
- package/dist/runtime/deferHelpers.d.ts +1 -1
- package/dist/runtime/deferHelpers.js.map +1 -1
- package/dist/runtime/html.d.ts.map +1 -1
- package/dist/runtime/html.js +6 -5
- package/dist/runtime/html.js.map +1 -1
- package/dist/runtime/index.d.ts +6 -6
- package/dist/runtime/index.js +6 -6
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/lazy.js +1 -1
- package/dist/runtime/lazy.js.map +1 -1
- package/dist/runtime/module-cache.js.map +1 -1
- package/dist/runtime/onDestroy.d.ts +7 -0
- package/dist/runtime/onDestroy.d.ts.map +1 -1
- package/dist/runtime/onDestroy.js +16 -1
- package/dist/runtime/onDestroy.js.map +1 -1
- package/dist/runtime/parseIdentifiersFromTemplate.js +1 -1
- package/dist/runtime/parseIdentifiersFromTemplate.js.map +1 -1
- package/dist/runtime/resource/createAction.d.ts +1 -1
- package/dist/runtime/resource/createAction.js +1 -1
- package/dist/runtime/resource/createAction.js.map +1 -1
- package/dist/runtime/resource/createResource.d.ts +1 -1
- package/dist/runtime/resource/createResource.d.ts.map +1 -1
- package/dist/runtime/resource/createResource.js +3 -4
- package/dist/runtime/resource/createResource.js.map +1 -1
- package/dist/runtime/resource/engine.d.ts +1 -1
- package/dist/runtime/resource/engine.js.map +1 -1
- package/dist/runtime/resource/index.d.ts +3 -3
- package/dist/runtime/resource/index.js +2 -2
- package/dist/runtime/resource/index.js.map +1 -1
- package/dist/runtime/resource/types.js.map +1 -1
- package/dist/types/globals.d.ts +2 -2
- package/dist/types/globals.js.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utilities/index.d.ts +2 -2
- package/dist/utilities/index.js +2 -2
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/ref-signal.utility.d.ts +1 -1
- package/dist/utilities/ref-signal.utility.js.map +1 -1
- package/dist/utilities/ref.untility.d.ts +1 -1
- package/dist/utilities/ref.untility.js.map +1 -1
- package/package.json +11 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createLoopManager.js","sourceRoot":"","sources":["../../../src/compile/forLoops/createLoopManager.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAkBF,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,IAAI,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAEL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,eAAe,EACf,WAAW,EACX,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAM7C,wEAAwE;AACxE,SAAS,cAAc,CAAC,KAAc,EAAE,GAAY;IAClD,IAAI,CAAC,GAAqB,KAAK,CAAC,WAA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MAAM,CAAC;QAClB,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC;YACf,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;YAC3B,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBAAE,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC;;gBAChC,EAAE,GAAG,GAAG,CAAC;QAChB,CAAC;QAED,6BAA6B;QAC7B,IAAI,EAAE,KAAK,GAAG,CAAC,MAAM;YAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;YAC9B,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QAEjB,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED,qCAAqC;IACrC,IAAI,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC5B,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACzC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACX,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.directive.loop-manager\",\n \"title\": \"Advanced Loop Manager\",\n \"category\": \"directive\"\n}\n*/\n\n/**\n * createLoopManager.ts\n *\n * A keyed, range-based list renderer optimized for deep nesting and high churn.\n *\n * Highlights:\n * - Uses [start..end] comment markers to represent each item range (stable DOM, easy move/remove).\n * - Minimal-move reordering using LIS (Longest Increasing Subsequence).\n * - Rebuild fast-path for heavy churn (bulk fragment insert for big updates).\n * - Caches nested loop nodes and tags their hosts to skip parent text-binding passes.\n * - Precise (configurable) visual flashing policy for inserts/moves/updates.\n * - Dev-time duplicate key detection.\n */\n\nimport type { PithyNode } from '@pithyjs/compiler';\nimport type { ChildFactory } from '../../runtime/bindings/types';\nimport { batch, createRoot, untrack } from '@pithyjs/signals';\nimport { pithyTreeToDom } from '../pithyTreeToDom';\nimport { bindForLoops } from './bindForLoops';\nimport { flashUpdate } from '../binds/bindTextInterpolations';\nimport { bindTemplateDirectives } from '..';\nimport { bindConditionals } from '../binds/bindConditionals';\nimport { bindSwitchCases } from '../bindSwitchCases';\nimport {\n LoopSignals,\n createLoopSignals,\n updateLoopSignals,\n createLoopContext,\n} from './loopSignals';\nimport {\n safeInsertBefore,\n markElementsAsLoopGenerated,\n createItemRange,\n wrapInRange,\n detachRange,\n} from './loopHelpers';\nimport { findAllNestedLoopNodes } from './loopTraversal';\nimport { nodeExpando } from '../nodeExpando';\n\n// ── Module-scope helpers (hoisted to avoid re-allocation per update() call) ──\n\ntype FlashUpdatePolicy = 'none' | 'identity' | 'shallow-nested-ignored';\n\n/** First real element between [start..end] to use as a flash target. */\nfunction firstElInRange(start: Comment, end: Comment): Element | null {\n let n: ChildNode | null = start.nextSibling;\n while (n && n !== end) {\n if (n.nodeType === Node.ELEMENT_NODE) return n as Element;\n n = n.nextSibling;\n }\n return null;\n}\n\n/** Extract inclusive [start..end] into a fragment (moving the range intact). */\nfunction collectRange(start: Comment, end: Comment): DocumentFragment {\n const frag = document.createDocumentFragment();\n let n: ChildNode | null = start;\n while (n) {\n const next: ChildNode | null = n.nextSibling;\n frag.appendChild(n);\n if (n === end) break;\n n = next;\n }\n return frag;\n}\n\n/** Compare only shallow, non-object fields to decide if update flash is meaningful. */\nfunction shallowChangedIgnoringObjects(a: unknown, b: unknown): boolean {\n if (a === b) return false;\n if (typeof a !== 'object' || a == null || typeof b !== 'object' || b == null)\n return true;\n\n const ar = a as Record<string, unknown>;\n const br = b as Record<string, unknown>;\n const keys = new Set([...Object.keys(ar), ...Object.keys(br)]);\n for (const k of keys) {\n const va = ar[k];\n const vb = br[k];\n const objA = va && typeof va === 'object';\n const objB = vb && typeof vb === 'object';\n if (objA || objB) continue; // ignore nested objects/arrays (child loops will flash)\n if (va !== vb) return true;\n }\n return false;\n}\n\nfunction shouldFlashUpdate(\n policy: FlashUpdatePolicy,\n prevItem: unknown,\n nextItem: unknown\n): boolean {\n switch (policy) {\n case 'none':\n return false;\n case 'identity':\n return prevItem !== nextItem;\n case 'shallow-nested-ignored':\n return shallowChangedIgnoringObjects(prevItem, nextItem);\n }\n}\n\n/** Clone a cached template fragment and restore JS metadata properties via parallel walk. */\nfunction cloneFragmentWithContext(\n template: DocumentFragment,\n ctx: Record<string, unknown>\n): DocumentFragment {\n const clone = template.cloneNode(true) as DocumentFragment;\n restoreNodeMetadata(template, clone, ctx);\n return clone;\n}\n\n/**\n * Walk source and target trees in parallel, copying metadata from source to target.\n * `__pithyCtx` is set to the new `ctx` (not copied from source).\n */\nfunction restoreNodeMetadata(\n source: Node,\n target: Node,\n ctx: Record<string, unknown>\n): void {\n const src = nodeExpando(source);\n const tgt = nodeExpando(target);\n\n if (src.__pithyCtx !== undefined) tgt.__pithyCtx = ctx;\n if (src.__pithyNode !== undefined) tgt.__pithyNode = src.__pithyNode;\n if (src.__nodeId !== undefined) tgt.__nodeId = src.__nodeId;\n if (src.__slotName !== undefined) tgt.__slotName = src.__slotName;\n\n // Slot fallback factory captures context — recreate with new ctx\n const srcNode = src.__pithyNode;\n if (\n src.__fallbackFactory !== undefined &&\n srcNode?.fallbackChildren?.length\n ) {\n tgt.__fallbackFactory = () =>\n pithyTreeToDom(srcNode.fallbackChildren!, ctx);\n }\n\n // Walk children in parallel (cloneNode preserves child count/order)\n const srcChildren = source.childNodes;\n const tgtChildren = target.childNodes;\n for (let i = 0; i < srcChildren.length; i++) {\n restoreNodeMetadata(srcChildren[i], tgtChildren[i], ctx);\n }\n}\n\n// ── Interfaces ──\n\nexport type { ChildFactory };\n\nexport interface LoopItem {\n key: string;\n fragment: DocumentFragment | Element; // contains [start, ...content..., end]\n signals: LoopSignals;\n start: Comment;\n end: Comment;\n node?: PithyNode; // original AST node (for caching, diagnostics); absent in templateNodes path\n destroy: () => void;\n}\n\nexport interface LoopManagerOptions<T> {\n anchor: Comment; // DOM anchor comment for the whole loop block\n trackByFn: (item: T, index: number) => string; // stable key selector\n parentCtx: Record<string, unknown>; // parent template context\n itemVar: string; // loop item var name (e.g., \"item\")\n indexVar?: string; // loop index var name (e.g., \"i\")\n countVar?: string; // count signal alias (default: \"count\")\n firstVar?: string; // first signal alias (default: \"first\")\n lastVar?: string; // last signal alias (default: \"last\")\n evenVar?: string; // even signal alias (default: \"even\")\n oddVar?: string; // odd signal alias (default: \"odd\")\n templateNodes?: PithyNode[]; // pre-parsed AST children for component-driven loops (e.g. <For>)\n itemFactory?: ChildFactory;\n}\n\nexport interface LoopManager<T = unknown> {\n update: (collection: T[], node?: PithyNode) => void;\n destroyAll: () => void;\n}\n\n/** @codexApi {\"parent\":\"pithy.directive.loop-manager\",\"name\":\"createLoopManager\",\"stability\":\"stable\",\"signature\":\"<T>(options: LoopManagerOptions<T>) => LoopManager<T>\"} */\nexport function createLoopManager<T>({\n anchor,\n trackByFn,\n parentCtx,\n itemVar,\n indexVar,\n countVar,\n firstVar,\n lastVar,\n evenVar,\n oddVar,\n templateNodes,\n itemFactory,\n}: LoopManagerOptions<T>): LoopManager<T> {\n // Map of key -> LoopItem (stable across updates as long as key is stable)\n const items = new Map<string, LoopItem>();\n let cachedNestedLoopNodes: PithyNode[] | null = null;\n let cachedTemplateFrag: DocumentFragment | null = null;\n\n /**\n * Update the loop to reflect the given collection:\n * - Diff keys (remove missing, add new).\n * - If churn is heavy: rebuild in a single batch (fast path).\n * - Else: compute minimal moves (LIS - Longest Increasing Subsequence), update signals, and reorder DOM ranges.\n */\n function update(collection: T[], node?: PithyNode): void {\n const liveParent = anchor.parentNode;\n\n // Flashing Policy\n const FLASH_ON_INSERT = true as const;\n const FLASH_ON_MOVE = false as const; // moves typically aren't \"re-renders\"\n const FLASH_ON_UPDATE: FlashUpdatePolicy = 'shallow-nested-ignored';\n\n // NOTE: We intentionally do NOT wrap the entire update() in batch().\n // createLoopItem builds DOM via pithyTreeToDom which creates reactive\n // effects. If those effects are deferred by an outer batch, the flush\n // can re-trigger the parent effect (in For.ts) causing infinite recursion.\n // Per-item batch() around signal updates is safe and sufficient.\n\n // Key Diff\n const newKeys = collection.map((it, idx) => trackByFn(it, idx));\n const newKeySet = new Set(newKeys);\n\n // Dev-time guard for duplicate keys (can corrupt the map & DOM)\n if (import.meta.env?.DEV) {\n const seen = new Set<string>();\n for (const k of newKeys) {\n if (seen.has(k)) {\n console.warn('[loop] duplicate key detected:', k, {\n node,\n collection,\n });\n }\n seen.add(k);\n }\n }\n\n if (!liveParent) {\n for (const [key, loopItem] of items) {\n if (!newKeySet.has(key)) {\n loopItem.destroy();\n items.delete(key);\n }\n }\n collection.forEach((item, idx) => {\n const existing = items.get(newKeys[idx]);\n if (existing) syncSignals(existing, item, idx, collection.length);\n });\n return;\n }\n\n // Remove items that no longer exist\n let removedCount = 0;\n items.forEach((loopItem, key) => {\n if (!newKeySet.has(key)) {\n loopItem.destroy(); // unsubscribes + removes its DOM range\n items.delete(key);\n removedCount++;\n }\n });\n\n // Count additions\n const addedCount = newKeys.reduce(\n (acc, k) => acc + (items.has(k) ? 0 : 1),\n 0\n );\n\n // Churn heuristic (how much of the list changed)\n const n = newKeys.length;\n const churn = (addedCount + removedCount) / Math.max(1, n);\n\n // Rebuild Fast-Path\n // For very heavy churn, a single rebuild is often faster than many moves.\n const REBUILD_THRESHOLD = 0.5;\n if (churn > REBUILD_THRESHOLD) {\n const batchFrag = document.createDocumentFragment();\n\n for (let idx = 0; idx < collection.length; idx++) {\n const key = newKeys[idx];\n const item = collection[idx];\n const existing = items.get(key);\n\n if (existing) {\n // Update item + positional signals in a single batch to avoid double effect firing\n const prev = syncSignals(existing, item, idx, collection.length);\n if (prev !== item && shouldFlashUpdate(FLASH_ON_UPDATE, prev, item)) {\n const el = firstElInRange(existing.start, existing.end);\n if (el) flashUpdate(el);\n }\n // Move entire range into the batchFrag fragment\n batchFrag.appendChild(collectRange(existing.start, existing.end));\n } else {\n // Create new item\n if (!node && !templateNodes && !itemFactory) continue;\n const created = createLoopItem(\n node,\n item,\n idx,\n collection.length,\n key\n );\n items.set(key, created);\n batchFrag.appendChild(created.fragment);\n if (FLASH_ON_INSERT) {\n const el = firstElInRange(created.start, created.end);\n if (el) flashUpdate(el);\n }\n }\n }\n\n // Insert everything at once before the anchor\n safeInsertBefore(liveParent, batchFrag, anchor);\n return;\n }\n\n // Minimal-Move Path (LIS)\n // Goal: only move items that are out of order (items in LIS keep their place).\n\n // Current DOM order of existing items (sort by document position)\n const existingItems = Array.from(items.values());\n existingItems.sort((a, b) => {\n const pos = a.start.compareDocumentPosition(b.start);\n // if a follows b, put b first (i.e., a after b => return 1)\n if (pos & Node.DOCUMENT_POSITION_FOLLOWING) return -1;\n return 1;\n });\n const oldOrder = existingItems.map(i => i.key);\n\n // Map key -> new position\n const newPos = new Map<string, number>();\n newKeys.forEach((k, i) => newPos.set(k, i));\n\n // Sequence of positions for old items that still exist\n const seq: number[] = [];\n const seqKeys: string[] = [];\n for (const k of oldOrder) {\n const p = newPos.get(k);\n if (p != null) {\n seq.push(p);\n seqKeys.push(k);\n }\n }\n\n // Compute LIS over positions and mark keys to keep (no move)\n const lisIdxs = lis(seq); // indices into seq[]\n const keep = new Set(lisIdxs.map(i => seqKeys[i]));\n\n // Reorder by iterating the new order backwards and inserting before a moving cursor\n let cursor: ChildNode = anchor;\n\n for (let idx = collection.length - 1; idx >= 0; idx--) {\n const item = collection[idx];\n const key = newKeys[idx];\n const existing = items.get(key);\n\n if (existing) {\n // Update item + positional signals in a single batch to avoid double effect firing\n const prev = syncSignals(existing, item, idx, collection.length);\n if (prev !== item && shouldFlashUpdate(FLASH_ON_UPDATE, prev, item)) {\n const el = firstElInRange(existing.start, existing.end);\n if (el) flashUpdate(el);\n }\n\n if (keep.has(key)) {\n // Already in good relative position, don't move; just advance cursor\n cursor = existing.start;\n } else {\n // Move the entire range right before the cursor\n const rangeFrag = collectRange(existing.start, existing.end);\n safeInsertBefore(liveParent, rangeFrag, cursor);\n if (FLASH_ON_MOVE) {\n const el = firstElInRange(existing.start, existing.end);\n if (el) flashUpdate(el);\n }\n cursor = existing.start;\n }\n } else {\n // New item: create and insert before cursor\n if (!node && !templateNodes && !itemFactory) continue;\n const created = createLoopItem(node, item, idx, collection.length, key);\n items.set(key, created);\n safeInsertBefore(liveParent, created.fragment, cursor);\n if (FLASH_ON_INSERT) {\n const el = firstElInRange(created.start, created.end);\n if (el) flashUpdate(el);\n }\n cursor = created.start;\n }\n }\n }\n\n function syncSignals(\n existing: LoopItem,\n item: T,\n idx: number,\n total: number\n ): T {\n const prev = untrack(existing.signals.itemSig) as T;\n batch(() => {\n if (prev !== item) existing.signals.itemSig.set(item);\n updateLoopSignals(existing.signals, idx, total);\n });\n return prev;\n }\n\n /**\n * Create a new LoopItem:\n * - Build the item's DOM from the AST node and local ctx.\n * - Tag top-level elements with __pithyCtx (so events resolve nearest context).\n * - Cache & tag nested loop hosts to skip parent text-binding.\n * - Bind template directives first; then bind nested loops inside this item.\n * - Wrap the item range with [start..end] markers (for move/remove).\n */\n function createLoopItem(\n node: PithyNode | undefined,\n item: T,\n idx: number,\n total: number,\n key: string\n ): LoopItem {\n return createRoot(disposeRoot => buildLoopItem(disposeRoot));\n\n function buildLoopItem(disposeRoot: () => void): LoopItem {\n const signals = createLoopSignals(item, idx, total);\n const ctx = createLoopContext(\n parentCtx,\n signals,\n itemVar,\n indexVar,\n countVar,\n firstVar,\n lastVar,\n evenVar,\n oddVar\n );\n\n if (itemFactory) {\n const built = itemFactory(ctx);\n for (const n of Array.from(built.el.childNodes)) {\n if (n.nodeType === Node.ELEMENT_NODE) nodeExpando(n).__pithyCtx = ctx;\n }\n const { start, end } = createItemRange(key);\n const destroy = () => {\n built.destroy();\n disposeRoot();\n detachRange(start, end);\n };\n return {\n key,\n fragment: wrapInRange(start, built.el, end),\n signals,\n start,\n end,\n destroy,\n };\n }\n\n // 1) Build static DOM for this item\n let fragmentFromNode: DocumentFragment;\n\n if (!cachedTemplateFrag) {\n // First item: build template from AST once and cache it.\n // Use parentCtx so the cached template does not retain per-item signals.\n // restoreNodeMetadata replaces __pithyCtx with the real per-item ctx on each clone.\n if (templateNodes) {\n cachedTemplateFrag = pithyTreeToDom(templateNodes, parentCtx);\n } else {\n const nodeForRender = {\n ...node!,\n directives: { ...node!.directives },\n };\n delete nodeForRender.directives.for;\n cachedTemplateFrag = pithyTreeToDom([nodeForRender], parentCtx);\n markElementsAsLoopGenerated(cachedTemplateFrag, node!);\n }\n // Clone for this item (cache stays pristine)\n fragmentFromNode = cloneFragmentWithContext(cachedTemplateFrag, ctx);\n } else {\n // Subsequent items: clone cached DOM + restore metadata\n fragmentFromNode = cloneFragmentWithContext(cachedTemplateFrag, ctx);\n }\n\n // 2) Tag local context on top-level elements for nearest-ctx event resolution\n for (const n of Array.from(fragmentFromNode.childNodes)) {\n if (n.nodeType === Node.ELEMENT_NODE) nodeExpando(n).__pithyCtx = ctx;\n }\n\n // 3) Find nested loop nodes ONCE per AST source (cache on the node or in closure)\n const astChildren =\n templateNodes ?? (node?.isComponent ? [] : node!.children || []);\n const allNestedLoopNodes: PithyNode[] = templateNodes\n ? (cachedNestedLoopNodes ??= templateNodes.flatMap(tn => {\n // Include root template nodes that themselves carry @for\n // (findAllNestedLoopNodes skips the root, which is correct for\n // the directive path but misses top-level loops in templateNodes)\n const nested = findAllNestedLoopNodes(tn);\n if (tn.directives?.for) nested.unshift(tn);\n return nested;\n }))\n : ((node as PithyNode & { __nested?: PithyNode[] }).__nested ??=\n findAllNestedLoopNodes(node!));\n\n // 4) Build a data-pid => element map for this fragment and tag hosts to skip text-binding\n const pidMap = new Map<string, Element>();\n (fragmentFromNode as Element | DocumentFragment)\n .querySelectorAll?.('[data-pid]')\n .forEach(el => pidMap.set(el.getAttribute('data-pid')!, el as Element));\n\n for (const n of allNestedLoopNodes) {\n if (!n.nodeId) continue;\n const host = pidMap.get(n.nodeId);\n if (host) nodeExpando(host).__pithySkipText = true; // parent text binder must skip this subtree\n }\n\n // 5) Bind structural directives in the same order as compileTemplate\n const disposers: (() => void)[] = [];\n\n // 5a) Switch/case, then conditionals outside switch cases\n const structuralProcessedIds = bindSwitchCases(\n astChildren,\n fragmentFromNode,\n ctx,\n new Set<string>(),\n disposers\n );\n bindConditionals(\n astChildren,\n fragmentFromNode,\n ctx,\n structuralProcessedIds,\n disposers\n );\n\n // 5c) Bind nested loops (pass processedNodeIds to skip loops inside conditionals)\n const nestedLoopDisposers: (() => void)[] = [];\n bindForLoops(\n allNestedLoopNodes,\n fragmentFromNode,\n ctx,\n nestedLoopDisposers,\n structuralProcessedIds\n );\n disposers.push(...nestedLoopDisposers);\n\n // 5d) Bind template directives (text interpolations, events, etc.)\n bindTemplateDirectives(fragmentFromNode, ctx, disposers);\n\n // 5e) Mark top-level elements to prevent parent from re-binding their text content\n for (const n of Array.from(fragmentFromNode.childNodes)) {\n if (n.nodeType === Node.ELEMENT_NODE) {\n nodeExpando(n).__pithySkipText = true;\n }\n }\n\n // 7) Wrap the whole item in [start..end] comments so we can move/remove it as a unit\n const { start, end } = createItemRange(key);\n const grouped = wrapInRange(start, fragmentFromNode, end);\n\n // 8) Cleanup function: unsubscribe effects/listeners and detach DOM range\n const destroy = () => {\n for (const d of disposers) d();\n disposeRoot();\n detachRange(start, end);\n };\n\n return { key, fragment: grouped, node, signals, start, end, destroy };\n }\n }\n\n function destroyAll(): void {\n items.forEach(item => item.destroy());\n items.clear();\n }\n\n return { update, destroyAll };\n}\n\n/**\n * O(n log n) Longest Increasing Subsequence.\n * Given an array of numbers `a`, returns the indices into `a` that form\n * a strictly increasing subsequence with maximal length.\n *\n * We use LIS on the sequence of \"new positions\" for existing items to minimize DOM moves:\n * - Items in the LIS are already in correct relative order and don't need to move.\n * - Only the remaining items are moved to their new positions.\n */\nfunction lis(a: number[]): number[] {\n const res: number[] = []; // res[k] is the index i of the smallest tail of an increasing subsequence of length k+1\n const m: number[] = []; // m[i] points to predecessor index for i in the LIS\n\n for (let i = 0; i < a.length; i++) {\n // binary search in res to find the length of the LIS that a[i] can extend\n let lo = 0,\n hi = res.length;\n while (lo < hi) {\n const mid = (lo + hi) >> 1;\n if (a[res[mid]] < a[i]) lo = mid + 1;\n else hi = mid;\n }\n\n // update res and predecessor\n if (lo === res.length) res.push(i);\n else res[lo] = i;\n\n m[i] = lo ? res[lo - 1] : -1;\n }\n\n // reconstruct LIS indices from res/m\n let k = res[res.length - 1];\n const out: number[] = [];\n for (let i = res.length - 1; i >= 0; i--) {\n out[i] = k;\n k = m[k];\n }\n return out;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './bindForLoops';
|
|
2
|
-
export * from './createLoopManager';
|
|
3
|
-
export * from './loopHelpers';
|
|
4
|
-
export * from './loopSignals';
|
|
5
|
-
export * from './loopTraversal';
|
|
1
|
+
export * from './bindForLoops.js';
|
|
2
|
+
export * from './createLoopManager.js';
|
|
3
|
+
export * from './loopHelpers.js';
|
|
4
|
+
export * from './loopSignals.js';
|
|
5
|
+
export * from './loopTraversal.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Main loop functionality
|
|
2
|
-
export * from './bindForLoops';
|
|
3
|
-
export * from './createLoopManager';
|
|
2
|
+
export * from './bindForLoops.js';
|
|
3
|
+
export * from './createLoopManager.js';
|
|
4
4
|
// Helper utilities
|
|
5
|
-
export * from './loopHelpers';
|
|
6
|
-
export * from './loopSignals';
|
|
7
|
-
export * from './loopTraversal';
|
|
5
|
+
export * from './loopHelpers.js';
|
|
6
|
+
export * from './loopSignals.js';
|
|
7
|
+
export * from './loopTraversal.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/compile/forLoops/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AAEpC,mBAAmB;AACnB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/compile/forLoops/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AAEpC,mBAAmB;AACnB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B,cAAc,iBAAiB,CAAC","sourcesContent":["// Main loop functionality\nexport * from './bindForLoops';\nexport * from './createLoopManager';\n\n// Helper utilities\nexport * from './loopHelpers';\nexport * from './loopSignals';\n\nexport * from './loopTraversal';\n"]}
|
|
@@ -30,4 +30,10 @@ export declare function createItemRange(key: string): {
|
|
|
30
30
|
export declare function wrapInRange(start: Comment, content: DocumentFragment | HTMLElement, end: Comment): DocumentFragment;
|
|
31
31
|
/** @codexApi {"parent":"pithy.directive.loop-helpers","name":"detachRange","stability":"stable","signature":"(start: Comment, end: Comment) => void"} */
|
|
32
32
|
export declare function detachRange(start: Comment, end: Comment): void;
|
|
33
|
+
/**
|
|
34
|
+
* Compiles a loop's `track` expression into a key function. Inside it the loop
|
|
35
|
+
* variable is the RAW item, not the accessor the loop body reads. Without an
|
|
36
|
+
* expression, items are keyed by index.
|
|
37
|
+
*/
|
|
38
|
+
export declare function compileTrackBy(trackExpr: string | undefined, itemVar: string, indexVar: string | undefined, ctx: Record<string, unknown>): (item: unknown, idx: number) => string;
|
|
33
39
|
//# sourceMappingURL=loopHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loopHelpers.d.ts","sourceRoot":"","sources":["../../../src/compile/forLoops/loopHelpers.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF;;GAEG;AAEH,yLAAyL;AACzL;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,IAAI,EACb,aAAa,EAAE,IAAI,GAAG,IAAI,GACzB,IAAI,CASN;AAED,kMAAkM;AAClM;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,gBAAgB,EAC1B,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACxB,IAAI,CAiBN;AAED,wKAAwK;AACxK,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM;;;EAI1C;AAED,8MAA8M;AAC9M,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,gBAAgB,GAAG,WAAW,EACvC,GAAG,EAAE,OAAO,GACX,gBAAgB,CAMlB;AAED,yJAAyJ;AACzJ,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,QASvD"}
|
|
1
|
+
{"version":3,"file":"loopHelpers.d.ts","sourceRoot":"","sources":["../../../src/compile/forLoops/loopHelpers.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF;;GAEG;AAEH,yLAAyL;AACzL;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,IAAI,EACb,aAAa,EAAE,IAAI,GAAG,IAAI,GACzB,IAAI,CASN;AAED,kMAAkM;AAClM;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,gBAAgB,EAC1B,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACxB,IAAI,CAiBN;AAED,wKAAwK;AACxK,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM;;;EAI1C;AAED,8MAA8M;AAC9M,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,gBAAgB,GAAG,WAAW,EACvC,GAAG,EAAE,OAAO,GACX,gBAAgB,CAMlB;AAED,yJAAyJ;AACzJ,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,QASvD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAexC"}
|
|
@@ -66,4 +66,21 @@ export function detachRange(start, end) {
|
|
|
66
66
|
start.parentNode?.removeChild(start);
|
|
67
67
|
end.parentNode?.removeChild(end);
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Compiles a loop's `track` expression into a key function. Inside it the loop
|
|
71
|
+
* variable is the RAW item, not the accessor the loop body reads. Without an
|
|
72
|
+
* expression, items are keyed by index.
|
|
73
|
+
*/
|
|
74
|
+
export function compileTrackBy(trackExpr, itemVar, indexVar, ctx) {
|
|
75
|
+
if (!trackExpr)
|
|
76
|
+
return (_item, idx) => String(idx);
|
|
77
|
+
// Internal param names (__it/__idx) avoid a TDZ clash with the loop's own names.
|
|
78
|
+
// eslint-disable-next-line no-new-func -- trackBy key compilation is a core framework feature
|
|
79
|
+
const fn = new Function('ctx', '__it', '__idx', `with (ctx) {
|
|
80
|
+
const ${itemVar} = __it;
|
|
81
|
+
${indexVar ? `const ${indexVar} = __idx;` : ''}
|
|
82
|
+
return (${trackExpr});
|
|
83
|
+
}`);
|
|
84
|
+
return (item, idx) => String(fn(ctx, item, idx));
|
|
85
|
+
}
|
|
69
86
|
//# sourceMapp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AAQ,WAAW,CAAC,CAAC,CAAC,EAAE;gBACpC,SAAS;MACnB,CACsE,CAAC;IAC3E,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AACnD,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.directive.loop-helpers\",\n \"title\": \"Loop Utility Functions\", \n \"category\": \"directive\"\n}\n*/\n\n/**\n * General utility functions for loop operations\n */\n\n/** @codexApi {\"parent\":\"pithy.directive.loop-helpers\",\"name\":\"safeInsertBefore\",\"stability\":\"stable\",\"signature\":\"(parent: Node, newNode: Node, referenceNode: Node | null) => void\"} */\n/**\n * Safely inserts a node before a reference node, with fallback to appendChild\n */\nexport function safeInsertBefore(\n parent: Node,\n newNode: Node,\n referenceNode: Node | null\n): void {\n if (referenceNode && referenceNode.parentNode === parent) {\n parent.insertBefore(newNode, referenceNode);\n } else {\n console.warn(\n '[safeInsertBefore] WARNING: referenceNode is NOT in parent; appending at end'\n );\n parent.appendChild(newNode);\n }\n}\n\n/** @codexApi {\"parent\":\"pithy.directive.loop-helpers\",\"name\":\"markElementsAsLoopGenerated\",\"stability\":\"stable\",\"signature\":\"(fragment: DocumentFragment, node: { nodeId?: string }) => void\"} */\n/**\n * Marks all elements in a fragment as loop-generated for safe cleanup\n * Optimized to use targeted selectors when possible\n */\nexport function markElementsAsLoopGenerated(\n fragment: DocumentFragment,\n node: { nodeId?: string }\n): void {\n // Optimize: Use more targeted selector if nodeId has hierarchical format\n const selector =\n node.nodeId && node.nodeId.includes('-')\n ? `[data-pid^=\"${node.nodeId}-\"], [data-pid=\"${node.nodeId}\"]`\n : '*';\n\n fragment.querySelectorAll(selector).forEach(el => {\n el.setAttribute('data-loop-generated', 'true');\n });\n\n // Also mark any remaining elements that don't have data-pid\n if (selector !== '*') {\n fragment.querySelectorAll('*:not([data-pid])').forEach(el => {\n el.setAttribute('data-loop-generated', 'true');\n });\n }\n}\n\n/** @codexApi {\"parent\":\"pithy.directive.loop-helpers\",\"name\":\"createItemRange\",\"stability\":\"stable\",\"signature\":\"(key: string) => { start: Comment; end: Comment }\"} */\nexport function createItemRange(key: string) {\n const start = document.createComment(`#for:item:start key=\"${key}\"`);\n const end = document.createComment(`#for:item:end key=\"${key}\"`);\n return { start, end };\n}\n\n/** @codexApi {\"parent\":\"pithy.directive.loop-helpers\",\"name\":\"wrapInRange\",\"stability\":\"stable\",\"signature\":\"(start: Comment, content: DocumentFragment | HTMLElement, end: Comment) => DocumentFragment\"} */\nexport function wrapInRange(\n start: Comment,\n content: DocumentFragment | HTMLElement,\n end: Comment\n): DocumentFragment {\n const group = document.createDocumentFragment();\n group.appendChild(start);\n group.appendChild(content); // appends all children if it's a fragment\n group.appendChild(end);\n return group;\n}\n\n/** @codexApi {\"parent\":\"pithy.directive.loop-helpers\",\"name\":\"detachRange\",\"stability\":\"stable\",\"signature\":\"(start: Comment, end: Comment) => void\"} */\nexport function detachRange(start: Comment, end: Comment) {\n let n: ChildNode | null = start.nextSibling;\n while (n && n !== end) {\n const toRemove = n;\n n = n.nextSibling;\n toRemove.parentNode?.removeChild(toRemove);\n }\n start.parentNode?.removeChild(start);\n end.parentNode?.removeChild(end);\n}\n\n/**\n * Compiles a loop's `track` expression into a key function. Inside it the loop\n * variable is the RAW item, not the accessor the loop body reads. Without an\n * expression, items are keyed by index.\n */\nexport function compileTrackBy(\n trackExpr: string | undefined,\n itemVar: string,\n indexVar: string | undefined,\n ctx: Record<string, unknown>\n): (item: unknown, idx: number) => string {\n if (!trackExpr) return (_item, idx) => String(idx);\n // Internal param names (__it/__idx) avoid a TDZ clash with the loop's own names.\n // eslint-disable-next-line no-new-func -- trackBy key compilation is a core framework feature\n const fn = new Function(\n 'ctx',\n '__it',\n '__idx',\n `with (ctx) {\n const ${itemVar} = __it;\n ${indexVar ? `const ${indexVar} = __idx;` : ''}\n return (${trackExpr});\n }`\n ) as (ctx: Record<string, unknown>, item: unknown, idx: number) => unknown;\n return (item, idx) => String(fn(ctx, item, idx));\n}\n"]}
|
|
@@ -52,13 +52,13 @@ export function updateLoopSignals(signals, idx, total) {
|
|
|
52
52
|
export function createLoopContext(parentCtx, signals, itemVar, indexVar, countVar = 'count', firstVar = 'first', lastVar = 'last', evenVar = 'even', oddVar = 'odd') {
|
|
53
53
|
return {
|
|
54
54
|
...parentCtx,
|
|
55
|
-
[itemVar]: signals.itemSig,
|
|
56
|
-
...(indexVar ? { [indexVar]: signals.idxSig } : {}),
|
|
57
55
|
[countVar]: signals.countSig,
|
|
58
56
|
[firstVar]: signals.firstSig,
|
|
59
57
|
[lastVar]: signals.lastSig,
|
|
60
58
|
[evenVar]: signals.evenSig,
|
|
61
59
|
[oddVar]: signals.oddSig,
|
|
60
|
+
[itemVar]: signals.itemSig,
|
|
61
|
+
...(indexVar ? { [indexVar]: signals.idxSig } : {}),
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
//# sourceMappingURL=loopSignals.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loopSignals.js","sourceRoot":"","sources":["../../../src/compile/forLoops/loopSignals.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAU,MAAM,kBAAkB,CAAC;AAYzD,gLAAgL;AAChL;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAO,EACP,GAAW,EACX,KAAa;IAEb,MAAM,OAAO,GAAG,MAAM,CAAU,IAAI,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC3B,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC;IA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AC;QACnC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,6UAA6U;AAC7U;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,SAAkC,EAClC,OAAoB,EACpB,OAAe,EACf,QAAiB,EACjB,QAAQ,GAAG,OAAO,EAClB,QAAQ,GAAG,OAAO,EAClB,OAAO,GAAG,MAAM,EAChB,OAAO,GAAG,MAAM,EAChB,MAAM,GAAG,KAAK;IAEd,OAAO;QACL,GAAG,SAAS;QACZ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ;QAC5B,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ;QAC5B,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO;QAC1B,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO;QAC1B,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM;QACxB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO;QAC1B,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpD,CAAC;AACJ,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.directive.loop-signals\",\n \"title\": \"Loop Reactive Signals\", \n \"category\": \"directive\"\n}\n*/\n\nimport { batch, signal, Signal } from '@pithyjs/signals';\n\nexport interface LoopSignals {\n itemSig: Signal<unknown>;\n countSig: Signal<number>;\n idxSig: Signal<number>;\n firstSig: Signal<boolean>;\n lastSig: Signal<boolean>;\n evenSig: Signal<boolean>;\n oddSig: Signal<boolean>;\n}\n\n/** @codexApi {\"parent\":\"pithy.directive.loop-signals\",\"name\":\"createLoopSignals\",\"stability\":\"stable\",\"signature\":\"<T>(item: T, idx: number, total: number) => LoopSignals\"} */\n/**\n * Creates all the reactive signals needed for a loop item\n */\nexport function createLoopSignals<T>(\n item: T,\n idx: number,\n total: number\n): LoopSignals {\n const itemSig = signal<unknown>(item);\n const countSig = signal(total);\n const idxSig = signal(idx);\n const firstSig = signal(idx === 0);\n const lastSig = signal(idx === total - 1);\n const evenSig = signal(idx % 2 === 0);\n const oddSig = signal(idx % 2 === 1);\n\n return {\n itemSig,\n countSig,\n idxSig,\n firstSig,\n lastSig,\n evenSig,\n oddSig,\n };\n}\n\n/** @codexApi {\"parent\":\"pithy.directive.loop-signals\",\"name\":\"updateLoopSignals\",\"stability\":\"stable\",\"signature\":\"(signals: LoopSignals, idx: number, total: number) => void\"} */\n/**\n * Updates all positional signals for a loop item (idx, first, last, even, odd, count)\n * Uses batch() for optimal performance\n */\nexport function updateLoopSignals(\n signals: LoopSignals,\n idx: number,\n total: number\n): void {\n batch(() => {\n signals.countSig.set(total);\n signals.idxSig.set(idx);\n signals.firstSig.set(idx === 0);\n signals.lastSig.set(idx === total - 1);\n signals.evenSig.set(idx % 2 === 0);\n signals.oddSig.set(idx % 2 === 1);\n });\n}\n\n/** @codexApi {\"parent\":\"pithy.directive.loop-signals\",\"name\":\"createLoopContext\",\"stability\":\"stable\",\"signature\":\"(parentCtx: Record<string, unknown>, signals: LoopSignals, itemVar: string, indexVar?: string, countVar?: string, firstVar?: string, lastVar?: string, evenVar?: string, oddVar?: string) => Record<string, unknown>\"} */\n/**\n * Creates the context object for a loop item with all necessary signals.\n * Helper signal names (count, first, last, even, odd) can be aliased to\n * avoid shadowing in nested loops.\n */\nexport function createLoopContext(\n parentCtx: Record<string, unknown>,\n signals: LoopSignals,\n itemVar: string,\n indexVar?: string,\n countVar = 'count',\n firstVar = 'first',\n lastVar = 'last',\n evenVar = 'even',\n oddVar = 'odd'\n): Record<string, unknown> {\n return {\n ...parentCtx,\n [countVar]: signals.countSig,\n [firstVar]: signals.firstSig,\n [lastVar]: signals.lastSig,\n [evenVar]: signals.evenSig,\n [oddVar]: signals.oddSig,\n [itemVar]: signals.itemSig,\n ...(indexVar ? { [indexVar]: signals.idxSig } : {}),\n };\n}\n"]}
|
|
@@ -21,14 +21,14 @@ export function findAllNestedLoopNodes(node) {
|
|
|
21
21
|
loopNodes.push(currentNode);
|
|
22
22
|
}
|
|
23
23
|
// Recursively traverse children
|
|
24
|
-
if (currentNode.children) {
|
|
24
|
+
if (currentNode.children && !currentNode.isComponent) {
|
|
25
25
|
for (const child of currentNode.children) {
|
|
26
26
|
traverse(child);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
// Start traversal from the node's children (not the node itself, as it's already being processed)
|
|
31
|
-
if (node.children) {
|
|
31
|
+
if (node.children && !node.isComponent) {
|
|
32
32
|
for (const child of node.children) {
|
|
33
33
|
traverse(child);
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loopTraversal.js","sourceRoot":"","sources":["../../../src/compile/forLoops/loopTraversal.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAIF;;GAEG;AAEH,gKAAgK;AAChK;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAe;IACpD,MAAM,SAAS,GAAgB,EAAE,CAAC;IAElC,SAAS,QAAQ,CAAC,WAAsB;QACtC,sDAAsD;QACtD,IAAI,WAAW,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC;YAChC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9B,CAAC;QAED,gCAAgC;QAChC,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"loopTraversal.js","sourceRoot":"","sources":["../../../src/compile/forLoops/loopTraversal.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAIF;;GAEG;AAEH,gKAAgK;AAChK;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAe;IACpD,MAAM,SAAS,GAAgB,EAAE,CAAC;IAElC,SAAS,QAAQ,CAAC,WAAsB;QACtC,sDAAsD;QACtD,IAAI,WAAW,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC;YAChC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9B,CAAC;QAED,gCAAgC;QAChC,IAAI,WAAW,CAAC,QAAQ,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;YACrD,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;gBACzC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IAED,kGAAkG;IAClG,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QACvC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.directive.loop-traversal\",\n \"title\": \"Loop Node Traversal\", \n \"category\": \"directive\"\n}\n*/\n\nimport type { PithyNode } from '@pithyjs/compiler';\n\n/**\n * Node traversal utilities for loop operations\n */\n\n/** @codexApi {\"parent\":\"pithy.directive.loop-traversal\",\"name\":\"findAllNestedLoopNodes\",\"stability\":\"stable\",\"signature\":\"(node: PithyNode) => PithyNode[]\"} */\n/**\n * Recursively finds all nested loop nodes within a given node\n * Used to process nested loops before binding to preserve data-pid references\n */\nexport function findAllNestedLoopNodes(node: PithyNode): PithyNode[] {\n const loopNodes: PithyNode[] = [];\n\n function traverse(currentNode: PithyNode) {\n // If this node has a @for directive, it's a loop node\n if (currentNode.directives?.for) {\n loopNodes.push(currentNode);\n }\n\n // Recursively traverse children\n if (currentNode.children && !currentNode.isComponent) {\n for (const child of currentNode.children) {\n traverse(child);\n }\n }\n }\n\n // Start traversal from the node's children (not the node itself, as it's already being processed)\n if (node.children && !node.isComponent) {\n for (const child of node.children) {\n traverse(child);\n }\n }\n\n return loopNodes;\n}\n"]}
|
|
@@ -10,6 +10,6 @@ import type { PithyNode } from '@pithyjs/compiler';
|
|
|
10
10
|
* Handles rendering and reactivity for an @if/@else-if/@else chain.
|
|
11
11
|
* Returns a Set of all node IDs that were processed (to avoid double-binding).
|
|
12
12
|
*/
|
|
13
|
-
/** @codexApi {"parent":"pithy.directive.conditional-chain","name":"handleConditionalChain","stability":"stable","signature":"(domChain:
|
|
14
|
-
export declare function handleConditionalChain(domChain:
|
|
13
|
+
/** @codexApi {"parent":"pithy.directive.conditional-chain","name":"handleConditionalChain","stability":"stable","signature":"(domChain: Element[], astChain: PithyNode[], ctx: Record<string, unknown>, processedNodeIds?: Set<string>, disposers?: (() => void)[]) => Set<string>"} */
|
|
14
|
+
export declare function handleConditionalChain(domChain: Element[], astChain: PithyNode[], ctx: Record<string, unknown>, processedNodeIds?: Set<string>, disposers?: (() => void)[]): Set<string>;
|
|
15
15
|
//# sourceMappingURL=handleConditionalChain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleConditionalChain.d.ts","sourceRoot":"","sources":["../../src/compile/handleConditionalChain.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;
|
|
1
|
+
{"version":3,"file":"handleConditionalChain.d.ts","sourceRoot":"","sources":["../../src/compile/handleConditionalChain.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAIF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD;;;GAGG;AACH,wRAAwR;AACxR,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,OAAO,EAAE,EACnB,QAAQ,EAAE,SAAS,EAAE,EACrB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,gBAAgB,GAAE,GAAG,CAAC,MAAM,CAAa,EACzC,SAAS,GAAE,CAAC,MAAM,IAAI,CAAC,EAAO,GAC7B,GAAG,CAAC,MAAM,CAAC,CAqHb"}
|
|
@@ -5,20 +5,15 @@
|
|
|
5
5
|
"category": "directive"
|
|
6
6
|
}
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { bindTemplateDirectives } from './compileTemplate';
|
|
13
|
-
import { bindForLoops } from './forLoops/bindForLoops';
|
|
14
|
-
import { bindSwitchCases } from './bindSwitchCases';
|
|
15
|
-
import { pithyTreeToDom } from './pithyTreeToDom';
|
|
16
|
-
import { isSSRMode } from './ssrMode';
|
|
8
|
+
import { effect } from '@pithyjs/signals';
|
|
9
|
+
import { compileExpression } from './compileExpression.js';
|
|
10
|
+
import { clearBranch, renderBranch } from './renderBranch.js';
|
|
11
|
+
import { isSSRMode } from './ssrMode.js';
|
|
17
12
|
/**
|
|
18
13
|
* Handles rendering and reactivity for an @if/@else-if/@else chain.
|
|
19
14
|
* Returns a Set of all node IDs that were processed (to avoid double-binding).
|
|
20
15
|
*/
|
|
21
|
-
/** @codexApi {"parent":"pithy.directive.conditional-chain","name":"handleConditionalChain","stability":"stable","signature":"(domChain:
|
|
16
|
+
/** @codexApi {"parent":"pithy.directive.conditional-chain","name":"handleConditionalChain","stability":"stable","signature":"(domChain: Element[], astChain: PithyNode[], ctx: Record<string, unknown>, processedNodeIds?: Set<string>, disposers?: (() => void)[]) => Set<string>"} */
|
|
22
17
|
export function handleConditionalChain(domChain, astChain, ctx, processedNodeIds = new Set(), disposers = []) {
|
|
23
18
|
// Generate a unique ID for this chain for debugging
|
|
24
19
|
const chainId = Math.random().toString(36).substring(2, 8);
|
|
@@ -41,27 +36,11 @@ export function handleConditionalChain(domChain, astChain, ctx, processedNodeIds
|
|
|
41
36
|
// Instead, we rebuild from the AST when needed using pithyTreeToDom.
|
|
42
37
|
// Note: We mark nodes as processed AFTER binding each matched branch,
|
|
43
38
|
// not upfront, so that they can be properly bound first.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// Dispose all effects from the previous render
|
|
50
|
-
for (const dispose of currentDisposers) {
|
|
51
|
-
try {
|
|
52
|
-
dispose();
|
|
53
|
-
}
|
|
54
|
-
catch {
|
|
55
|
-
// Ignore disposal errors
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
currentDisposers = [];
|
|
59
|
-
if (currentElement && currentElement.parentNode) {
|
|
60
|
-
currentElement.remove();
|
|
61
|
-
currentElement = null;
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
return false;
|
|
39
|
+
let current = null;
|
|
40
|
+
function clearCurrentBranch() {
|
|
41
|
+
if (current)
|
|
42
|
+
clearBranch(current);
|
|
43
|
+
current = null;
|
|
65
44
|
}
|
|
66
45
|
// Shared logic for evaluating conditions and rendering the matched branch
|
|
67
46
|
function evaluateAndRender() {
|
|
@@ -95,62 +74,18 @@ export function handleConditionalChain(domChain, astChain, ctx, processedNodeIds
|
|
|
95
74
|
return matchIndex;
|
|
96
75
|
}
|
|
97
76
|
function renderMatchedBranch(matchIndex) {
|
|
98
|
-
// If we found a match, insert the corresponding element
|
|
99
77
|
if (matchIndex < 0 || !placeholder.parentNode)
|
|
100
|
-
return;
|
|
101
|
-
|
|
102
|
-
const matchedAst = astChain[matchIndex];
|
|
103
|
-
// Rebuild the DOM from the AST instead of cloning
|
|
104
|
-
// This ensures structural transformations (e.g., @for -> Comment) are applied
|
|
105
|
-
const freshFragment = pithyTreeToDom([matchedAst], ctx);
|
|
106
|
-
// Extract the first (and should be only) element from the fragment
|
|
107
|
-
const rebuiltElement = freshFragment.firstChild;
|
|
108
|
-
if (!rebuiltElement)
|
|
109
|
-
return;
|
|
110
|
-
// Update our current element reference (set before binding so cleanup can find it)
|
|
111
|
-
currentElement = rebuiltElement;
|
|
112
|
-
// Bind structural directives FIRST (in the same order as compileTemplate)
|
|
113
|
-
// This creates the necessary contexts (e.g., loop item variables) before
|
|
114
|
-
// bindTemplateDirectives tries to use them in text interpolations
|
|
115
|
-
// Store disposers in the outer scope so they can be cleaned up on re-render
|
|
116
|
-
currentDisposers = [];
|
|
117
|
-
// Use a fresh set for this effect run to prevent double-binding within this render
|
|
118
|
-
// But also update the outer processedNodeIds for the caller
|
|
119
|
-
const effectLocalProcessedIds = new Set();
|
|
120
|
-
createRoot(disposeRoot => {
|
|
121
|
-
currentDisposers.push(disposeRoot);
|
|
122
|
-
// 1) Switch/case statements FIRST
|
|
123
|
-
// IMPORTANT: bindSwitchCases must run BEFORE bindConditionals!
|
|
124
|
-
// Switch cases clone their content from DOM - if bindConditionals runs first,
|
|
125
|
-
// it removes @if/@else elements and replaces them with placeholders, so the
|
|
126
|
-
// cloned switch case content would be missing the conditional elements.
|
|
127
|
-
bindSwitchCases(matchedAst.children || [], rebuiltElement, ctx, new Set(), currentDisposers);
|
|
128
|
-
// 2) Nested conditionals
|
|
129
|
-
// Pass currentDisposers so nested conditional effects are cleaned up on re-render
|
|
130
|
-
bindConditionals(matchedAst.children || [], rebuiltElement, ctx, effectLocalProcessedIds, currentDisposers);
|
|
131
|
-
// 3) For loops - creates loop contexts with item/index variables
|
|
132
|
-
// Pass local processed IDs to prevent double-binding within this render
|
|
133
|
-
bindForLoops(matchedAst.children || [], rebuiltElement, ctx, currentDisposers, effectLocalProcessedIds);
|
|
134
|
-
// 4) Now bind non-structural directives (text, events, classes, etc.)
|
|
135
|
-
// Use a temporary fragment for binding (bindTemplateDirectives expects a fragment)
|
|
136
|
-
const tempFragment = document.createDocumentFragment();
|
|
137
|
-
tempFragment.appendChild(rebuiltElement);
|
|
138
|
-
bindTemplateDirectives(tempFragment, ctx, currentDisposers);
|
|
139
|
-
});
|
|
140
|
-
// Insert the element into the DOM after binding
|
|
141
|
-
placeholder.parentNode.insertBefore(rebuiltElement, placeholder.nextSibling);
|
|
142
|
-
// Defer flashUpdate via queueMicrotask to prevent blocking
|
|
143
|
-
if (!isSSRMode()) {
|
|
144
|
-
queueMicrotask(() => flashUpdate(rebuiltElement));
|
|
145
|
-
}
|
|
78
|
+
return null;
|
|
79
|
+
return renderBranch(astChain[matchIndex], ctx, placeholder);
|
|
146
80
|
}
|
|
147
81
|
if (isSSRMode()) {
|
|
148
82
|
// SSR mode: evaluate once synchronously, no reactive effects
|
|
149
83
|
const matchIndex = evaluateAndRender();
|
|
150
|
-
renderMatchedBranch(matchIndex);
|
|
84
|
+
const branch = renderMatchedBranch(matchIndex);
|
|
151
85
|
// Ensure nested directive disposers created during SSR are added
|
|
152
86
|
// to the parent disposers array for proper cleanup on destroy()
|
|
153
|
-
|
|
87
|
+
if (branch)
|
|
88
|
+
disposers.push(...branch.disposers);
|
|
154
89
|
}
|
|
155
90
|
else {
|
|
156
91
|
// Client mode: reactive effect for dynamic updates
|
|
@@ -165,18 +100,18 @@ export function handleConditionalChain(domChain, astChain, ctx, processedNodeIds
|
|
|
165
100
|
}
|
|
166
101
|
// Update the previous match index
|
|
167
102
|
previousMatchIndex = matchIndex;
|
|
168
|
-
// Now clear the current
|
|
169
|
-
|
|
170
|
-
renderMatchedBranch(matchIndex);
|
|
103
|
+
// Now clear the current branch (only if we're about to rebuild)
|
|
104
|
+
clearCurrentBranch();
|
|
105
|
+
current = renderMatchedBranch(matchIndex);
|
|
171
106
|
// Don't return cleanup here - we handle cleanup explicitly:
|
|
172
|
-
// 1. When match changes:
|
|
173
|
-
// 2. When effect stops:
|
|
107
|
+
// 1. When match changes: clearCurrentBranch() is called above
|
|
108
|
+
// 2. When effect stops: clearCurrentBranch is in disposers array
|
|
174
109
|
// Returning cleanup would cause it to run on EVERY re-run, even when match is same
|
|
175
110
|
});
|
|
176
111
|
// Add cleanup and effect stop to disposers for proper cleanup
|
|
177
|
-
// Note: We add
|
|
112
|
+
// Note: We add clearCurrentBranch explicitly because the effect may have
|
|
178
113
|
// returned undefined on its last run (when match didn't change)
|
|
179
|
-
disposers.push(
|
|
114
|
+
disposers.push(clearCurrentBranch);
|
|
180
115
|
disposers.push(stopEffect);
|
|
181
116
|
}
|
|
182
117
|
return processedNodeIds;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleConditionalChain.js","sourceRoot":"","sources":["../../src/compile/handleConditionalChain.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handleConditionalChain.js","sourceRoot":"","sources":["../../src/compile/handleConditionalChain.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAe,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;;GAGG;AACH,wRAAwR;AACxR,MAAM,UAAU,sBAAsB,CACpC,QAAmB,EACnB,QAAqB,EACrB,GAA4B,EAC5B,mBAAgC,IAAI,GAAG,EAAE,EACzC,YAA4B,EAAE;IAE9B,oDAAoD;IACpD,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3D,+EAA+E;IAC/E,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,qBAAqB,OAAO,EAAE,CAAC,CAAC;IAE3E,+DAA+D;IAC/D,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,YAAY,CAAC,UAAU,CAAC;IAEvC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,CAAC,KAAK,CAAC,UAAU,OAAO,qCAAqC,CAAC,CAAC;QACtE,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IAE/C,wDAAwD;IACxD,KAAK,MAAM,EAA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AS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.directive.conditional-chain\",\n \"title\": \"Conditional Chain Handler\",\n \"category\": \"directive\"\n}\n*/\n\nimport { effect } from '@pithyjs/signals';\nimport { compileExpression } from './compileExpression';\nimport type { PithyNode } from '@pithyjs/compiler';\nimport { clearBranch, renderBranch, type Branch } from './renderBranch';\nimport { isSSRMode } from './ssrMode';\n\n/**\n * Handles rendering and reactivity for an @if/@else-if/@else chain.\n * Returns a Set of all node IDs that were processed (to avoid double-binding).\n */\n/** @codexApi {\"parent\":\"pithy.directive.conditional-chain\",\"name\":\"handleConditionalChain\",\"stability\":\"stable\",\"signature\":\"(domChain: Element[], astChain: PithyNode[], ctx: Record<string, unknown>, processedNodeIds?: Set<string>, disposers?: (() => void)[]) => Set<string>\"} */\nexport function handleConditionalChain(\n domChain: Element[],\n astChain: PithyNode[],\n ctx: Record<string, unknown>,\n processedNodeIds: Set<string> = new Set(),\n disposers: (() => void)[] = []\n): Set<string> {\n // Generate a unique ID for this chain for debugging\n const chainId = Math.random().toString(36).substring(2, 8);\n\n // Create a placeholder comment to mark where our conditional content should go\n const placeholder = document.createComment(`conditional-chain-${chainId}`);\n\n // Insert the placeholder before the first element in the chain\n const firstElement = domChain[0];\n const parent = firstElement.parentNode;\n\n if (!parent) {\n console.error(`[Chain-${chainId}] No parent found for first element`);\n return processedNodeIds;\n }\n\n parent.insertBefore(placeholder, firstElement);\n\n // Remove all original elements from the DOM immediately\n for (const el of domChain) {\n el.remove();\n }\n\n // Note: We don't clone the original DOM elements because cloning loses\n // the structural transformations (e.g., @for loops need Comment anchors).\n // Instead, we rebuild from the AST when needed using pithyTreeToDom.\n\n // Note: We mark nodes as processed AFTER binding each matched branch,\n // not upfront, so that they can be properly bound first.\n\n let current: Branch | null = null;\n\n function clearCurrentBranch() {\n if (current) clearBranch(current);\n current = null;\n }\n\n // Shared logic for evaluating conditions and rendering the matched branch\n function evaluateAndRender() {\n // Find the first matching condition\n let matchIndex = -1;\n\n for (let i = 0; i < astChain.length; i++) {\n const node = astChain[i];\n\n if (node.directives?.if !== undefined) {\n // This is an @if node\n const fn = compileExpression(node.directives.if, ctx, false);\n const result = fn();\n if (result) {\n matchIndex = i;\n break;\n }\n } else if (node.directives?.elseIf !== undefined) {\n // This is an @else-if node\n const fn = compileExpression(node.directives.elseIf, ctx, false);\n if (fn()) {\n matchIndex = i;\n break;\n }\n } else if (node.directives?.else !== undefined) {\n // This is an @else node, which always matches if we reach it\n matchIndex = i;\n break;\n }\n }\n\n return matchIndex;\n }\n\n function renderMatchedBranch(matchIndex: number): Branch | null {\n if (matchIndex < 0 || !placeholder.parentNode) return null;\n return renderBranch(astChain[matchIndex], ctx, placeholder);\n }\n\n if (isSSRMode()) {\n // SSR mode: evaluate once synchronously, no reactive effects\n const matchIndex = evaluateAndRender();\n const branch = renderMatchedBranch(matchIndex);\n // Ensure nested directive disposers created during SSR are added\n // to the parent disposers array for proper cleanup on destroy()\n if (branch) disposers.push(...branch.disposers);\n } else {\n // Client mode: reactive effect for dynamic updates\n // Track the previous match index to avoid unnecessary DOM operations\n let previousMatchIndex = -1;\n\n // Set up the reactive effect and capture the stop function for disposal\n const stopEffect = effect(() => {\n const matchIndex = evaluateAndRender();\n\n // Skip re-insertion if match hasn't changed\n if (matchIndex === previousMatchIndex) {\n return;\n }\n\n // Update the previous match index\n previousMatchIndex = matchIndex;\n\n // Now clear the current branch (only if we're about to rebuild)\n clearCurrentBranch();\n current = renderMatchedBranch(matchIndex);\n\n // Don't return cleanup here - we handle cleanup explicitly:\n // 1. When match changes: clearCurrentBranch() is called above\n // 2. When effect stops: clearCurrentBranch is in disposers array\n // Returning cleanup would cause it to run on EVERY re-run, even when match is same\n });\n\n // Add cleanup and effect stop to disposers for proper cleanup\n // Note: We add clearCurrentBranch explicitly because the effect may have\n // returned undefined on its last run (when match didn't change)\n disposers.push(clearCurrentBranch);\n disposers.push(stopEffect);\n }\n\n return processedNodeIds;\n}\n"]}
|
package/dist/compile/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export { compileTemplate } from './compileTemplate';
|
|
2
|
-
export { compileNodes } from './compileNodes';
|
|
3
|
-
export { renderChildren, captureChildren, readChildPayload, type ChildPayload, } from './renderChildren';
|
|
4
|
-
export { injectScopedStyle } from './injectScopedStyle';
|
|
5
|
-
export { bindTextInterpolations } from './binds/bindTextInterpolations';
|
|
6
|
-
export { bindEventHandlers } from './binds/bindEventHandlers';
|
|
7
|
-
export { bindClassDirectives } from './binds/bindClassDirectives';
|
|
8
|
-
export { bindComponentTags } from './binds/bindComponentsTags';
|
|
9
|
-
export { bindForLoops, createLoopManager, type ChildFactory, type LoopManager, } from './forLoops';
|
|
10
|
-
export { bindTemplateDirectives } from './compileTemplate';
|
|
11
|
-
export type { SlotMap } from './contentProjection';
|
|
12
|
-
export { isSSRMode } from './ssrMode';
|
|
13
|
-
export { registerDirectiveBinder, unregisterDirectiveBinder, executeCustomDirectiveBinders, type DirectiveBinder, } from './binds/directiveRegistry';
|
|
14
|
-
export { boundaryForElement, setBoundaryError, clearBoundaryError, registerBoundary, } from './binds/bindErrorBoundary';
|
|
15
|
-
export type { BoundaryInfo } from './binds/bindErrorBoundary';
|
|
16
|
-
export { collectUnhandledSSRRenderCrashes, resetSSRRenderCrashes, } from './ssrCrashes';
|
|
17
|
-
export type { SSRRenderCrash } from './ssrCrashes';
|
|
1
|
+
export { compileTemplate } from './compileTemplate.js';
|
|
2
|
+
export { compileNodes } from './compileNodes.js';
|
|
3
|
+
export { renderChildren, captureChildren, readChildPayload, type ChildPayload, } from './renderChildren.js';
|
|
4
|
+
export { injectScopedStyle } from './injectScopedStyle.js';
|
|
5
|
+
export { bindTextInterpolations } from './binds/bindTextInterpolations.js';
|
|
6
|
+
export { bindEventHandlers } from './binds/bindEventHandlers.js';
|
|
7
|
+
export { bindClassDirectives } from './binds/bindClassDirectives.js';
|
|
8
|
+
export { bindComponentTags } from './binds/bindComponentsTags.js';
|
|
9
|
+
export { bindForLoops, createLoopManager, type ChildFactory, type LoopManager, } from './forLoops/index.js';
|
|
10
|
+
export { bindTemplateDirectives } from './compileTemplate.js';
|
|
11
|
+
export type { SlotMap } from './contentProjection.js';
|
|
12
|
+
export { isSSRMode } from './ssrMode.js';
|
|
13
|
+
export { registerDirectiveBinder, unregisterDirectiveBinder, executeCustomDirectiveBinders, type DirectiveBinder, } from './binds/directiveRegistry.js';
|
|
14
|
+
export { boundaryForElement, setBoundaryError, clearBoundaryError, registerBoundary, } from './binds/bindErrorBoundary.js';
|
|
15
|
+
export type { BoundaryInfo } from './binds/bindErrorBoundary.js';
|
|
16
|
+
export { collectUnhandledSSRRenderCrashes, resetSSRRenderCrashes, } from './ssrCrashes.js';
|
|
17
|
+
export type { SSRRenderCrash } from './ssrCrashes.js';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/compile/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
export { compileTemplate } from './compileTemplate';
|
|
2
|
-
export { compileNodes } from './compileNodes';
|
|
3
|
-
export { renderChildren, captureChildren, readChildPayload, } from './renderChildren';
|
|
1
|
+
export { compileTemplate } from './compileTemplate.js';
|
|
2
|
+
export { compileNodes } from './compileNodes.js';
|
|
3
|
+
export { renderChildren, captureChildren, readChildPayload, } from './renderChildren.js';
|
|
4
4
|
// parseHtml is NOT re-exported from this barrel to prevent parse5 from
|
|
5
5
|
// being pulled into production bundles. Use the dedicated subpath export:
|
|
6
6
|
// import { loadJITCompiler } from '@pithyjs/core/compile/parseHtml'
|
|
7
|
-
export { injectScopedStyle } from './injectScopedStyle';
|
|
7
|
+
export { injectScopedStyle } from './injectScopedStyle.js';
|
|
8
8
|
// Only export these if useful for advanced users / SSR:
|
|
9
|
-
export { bindTextInterpolations } from './binds/bindTextInterpolations';
|
|
10
|
-
export { bindEventHandlers } from './binds/bindEventHandlers';
|
|
11
|
-
export { bindClassDirectives } from './binds/bindClassDirectives';
|
|
12
|
-
export { bindComponentTags } from './binds/bindComponentsTags';
|
|
13
|
-
export { bindForLoops, createLoopManager, } from './forLoops';
|
|
14
|
-
export { bindTemplateDirectives } from './compileTemplate';
|
|
9
|
+
export { bindTextInterpolations } from './binds/bindTextInterpolations.js';
|
|
10
|
+
export { bindEventHandlers } from './binds/bindEventHandlers.js';
|
|
11
|
+
export { bindClassDirectives } from './binds/bindClassDirectives.js';
|
|
12
|
+
export { bindComponentTags } from './binds/bindComponentsTags.js';
|
|
13
|
+
export { bindForLoops, createLoopManager, } from './forLoops/index.js';
|
|
14
|
+
export { bindTemplateDirectives } from './compileTemplate.js';
|
|
15
15
|
// The explicit static-render signal. `@pithyjs/ssr`'s setupEnvironment() copies
|
|
16
16
|
// a happy-dom window onto globalThis — IntersectionObserver, requestAnimationFrame
|
|
17
17
|
// and matchMedia included — so no `typeof` feature check can distinguish a server
|
|
18
18
|
// render from a browser. Packages that must branch on it (e.g. @pithyjs/ui-kit's
|
|
19
19
|
// section entrance animations, BUG-010) read this rather than hand-rolling their
|
|
20
20
|
// own derivation of the underlying `__PITHY_SSR__` global.
|
|
21
|
-
export { isSSRMode } from './ssrMode';
|
|
21
|
+
export { isSSRMode } from './ssrMode.js';
|
|
22
22
|
// Custom directive registry - allows external packages (router, etc.) to register binders
|
|
23
|
-
export { registerDirectiveBinder, unregisterDirectiveBinder, executeCustomDirectiveBinders, } from './binds/directiveRegistry';
|
|
23
|
+
export { registerDirectiveBinder, unregisterDirectiveBinder, executeCustomDirectiveBinders, } from './binds/directiveRegistry.js';
|
|
24
24
|
// Error boundary functions for router integration:
|
|
25
|
-
export { boundaryForElement, setBoundaryError, clearBoundaryError, registerBoundary, } from './binds/bindErrorBoundary';
|
|
25
|
+
export { boundaryForElement, setBoundaryError, clearBoundaryError, registerBoundary, } from './binds/bindErrorBoundary.js';
|
|
26
26
|
// Unhandled component crashes recorded during a server render. Consumed by
|
|
27
27
|
// @pithyjs/ssr's renderToString so a crash fails its route (BUG-018).
|
|
28
28
|
//
|
|
@@ -31,5 +31,5 @@ export { boundaryForElement, setBoundaryError, clearBoundaryError, registerBound
|
|
|
31
31
|
// binders inside this package, so they are annotated `internal` rather than
|
|
32
32
|
// exported here — advertising them as stable in the generated API table while
|
|
33
33
|
// leaving them unimportable is worse than either alternative.
|
|
34
|
-
export { collectUnhandledSSRRenderCrashes, resetSSRRenderCrashes, } from './ssrCrashes';
|
|
34
|
+
export { collectUnhandledSSRRenderCrashes, resetSSRRenderCrashes, } from './ssrCrashes.js';
|
|
35
35
|
//# sourceMappingURL=index.js.map
|