@pithyjs/core 0.1.0-beta.2 → 0.1.0-beta.21
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 +46 -8
- package/dist/a11y/focus-trap.d.ts +11 -3
- package/dist/a11y/focus-trap.d.ts.map +1 -1
- package/dist/a11y/focus-trap.js +55 -10
- 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 +137 -183
- package/dist/compile/bindSwitchCases.js.map +1 -1
- package/dist/compile/binds/bindAfterComponents.d.ts +4 -0
- package/dist/compile/binds/bindAfterComponents.d.ts.map +1 -0
- package/dist/compile/binds/bindAfterComponents.js +26 -0
- package/dist/compile/binds/bindAfterComponents.js.map +1 -0
- package/dist/compile/binds/bindAfterProjection.d.ts +7 -0
- package/dist/compile/binds/bindAfterProjection.d.ts.map +1 -0
- package/dist/compile/binds/bindAfterProjection.js +15 -0
- package/dist/compile/binds/bindAfterProjection.js.map +1 -0
- package/dist/compile/binds/bindBoundAttributes.d.ts +8 -0
- package/dist/compile/binds/bindBoundAttributes.d.ts.map +1 -1
- package/dist/compile/binds/bindBoundAttributes.js +227 -21
- 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 +58 -21
- 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 +186 -74
- 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.d.ts.map +1 -1
- package/dist/compile/binds/bindDeferDirectives.js +21 -19
- package/dist/compile/binds/bindDeferDirectives.js.map +1 -1
- package/dist/compile/binds/bindErrorBoundary.d.ts +61 -0
- package/dist/compile/binds/bindErrorBoundary.d.ts.map +1 -1
- package/dist/compile/binds/bindErrorBoundary.js +272 -16
- package/dist/compile/binds/bindErrorBoundary.js.map +1 -1
- package/dist/compile/binds/bindEventHandlers.d.ts.map +1 -1
- package/dist/compile/binds/bindEventHandlers.js +15 -5
- package/dist/compile/binds/bindEventHandlers.js.map +1 -1
- package/dist/compile/binds/bindRefDirectives.d.ts.map +1 -1
- package/dist/compile/binds/bindRefDirectives.js +2 -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 +48 -0
- package/dist/compile/binds/bindStyleDirectives.js.map +1 -0
- package/dist/compile/binds/bindTextInterpolations.d.ts +4 -2
- package/dist/compile/binds/bindTextInterpolations.d.ts.map +1 -1
- package/dist/compile/binds/bindTextInterpolations.js +87 -35
- package/dist/compile/binds/bindTextInterpolations.js.map +1 -1
- package/dist/compile/binds/declaredDirective.d.ts +12 -0
- package/dist/compile/binds/declaredDirective.d.ts.map +1 -0
- package/dist/compile/binds/declaredDirective.js +42 -0
- package/dist/compile/binds/declaredDirective.js.map +1 -0
- package/dist/compile/binds/directiveRegistry.js.map +1 -1
- package/dist/compile/binds/forwardedAttrs.d.ts +4 -2
- package/dist/compile/binds/forwardedAttrs.d.ts.map +1 -1
- package/dist/compile/binds/forwardedAttrs.js +10 -2
- 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/binds/staleRowProps.d.ts +9 -0
- package/dist/compile/binds/staleRowProps.d.ts.map +1 -0
- package/dist/compile/binds/staleRowProps.js +86 -0
- package/dist/compile/binds/staleRowProps.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 +16 -7
- 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 +36 -54
- package/dist/compile/compileTemplate.js.map +1 -1
- package/dist/compile/componentResult.js.map +1 -1
- package/dist/compile/contentProjection.d.ts +15 -3
- package/dist/compile/contentProjection.d.ts.map +1 -1
- package/dist/compile/contentProjection.js +90 -9
- package/dist/compile/contentProjection.js.map +1 -1
- package/dist/compile/disposeOrder.d.ts +35 -0
- package/dist/compile/disposeOrder.d.ts.map +1 -0
- package/dist/compile/disposeOrder.js +81 -0
- package/dist/compile/disposeOrder.js.map +1 -0
- package/dist/compile/evalDiagnostics.d.ts +7 -0
- package/dist/compile/evalDiagnostics.d.ts.map +1 -0
- package/dist/compile/evalDiagnostics.js +8 -0
- package/dist/compile/evalDiagnostics.js.map +1 -0
- package/dist/compile/forLoops/bindForLoops.d.ts +3 -3
- package/dist/compile/forLoops/bindForLoops.d.ts.map +1 -1
- package/dist/compile/forLoops/bindForLoops.js +18 -13
- 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 +44 -26
- 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.js.map +1 -1
- package/dist/compile/forLoops/loopSignals.d.ts.map +1 -1
- package/dist/compile/forLoops/loopSignals.js +15 -1
- 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 +23 -89
- 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 +28 -0
- package/dist/compile/nodeExpando.d.ts.map +1 -1
- package/dist/compile/nodeExpando.js +12 -0
- package/dist/compile/nodeExpando.js.map +1 -1
- package/dist/compile/parseHtml.js +12 -6
- package/dist/compile/parseHtml.js.map +1 -1
- package/dist/compile/pithyTreeToDom.d.ts.map +1 -1
- package/dist/compile/pithyTreeToDom.js +17 -12
- 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 +72 -0
- package/dist/compile/renderBranch.js.map +1 -0
- package/dist/compile/renderChildren.d.ts +12 -2
- package/dist/compile/renderChildren.d.ts.map +1 -1
- package/dist/compile/renderChildren.js +33 -4
- package/dist/compile/renderChildren.js.map +1 -1
- package/dist/compile/ssrCrashes.d.ts +65 -37
- package/dist/compile/ssrCrashes.d.ts.map +1 -1
- package/dist/compile/ssrCrashes.js +344 -39
- 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 +9 -5
- package/dist/runtime/applyBindings.d.ts.map +1 -1
- package/dist/runtime/applyBindings.js +130 -43
- 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 +143 -87
- package/dist/runtime/bindings/applyComponent.js.map +1 -1
- package/dist/runtime/bindings/applyDefer.d.ts +1 -1
- package/dist/runtime/bindings/applyDefer.d.ts.map +1 -1
- package/dist/runtime/bindings/applyDefer.js +16 -15
- package/dist/runtime/bindings/applyDefer.js.map +1 -1
- package/dist/runtime/bindings/applySimple.d.ts +10 -1
- package/dist/runtime/bindings/applySimple.d.ts.map +1 -1
- package/dist/runtime/bindings/applySimple.js +117 -46
- 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 +140 -124
- package/dist/runtime/bindings/applyStructural.js.map +1 -1
- package/dist/runtime/bindings/helpers.d.ts +8 -1
- package/dist/runtime/bindings/helpers.d.ts.map +1 -1
- package/dist/runtime/bindings/helpers.js +36 -2
- 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.d.ts +2 -0
- package/dist/runtime/bindings/types.d.ts.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.js +7 -7
- 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 +10 -2
- package/dist/types/globals.d.ts.map +1 -1
- 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
|
@@ -6,20 +6,21 @@
|
|
|
6
6
|
}
|
|
7
7
|
*/
|
|
8
8
|
import { collectIfChain } from '@pithyjs/compiler';
|
|
9
|
-
import { handleConditionalChain } from '../handleConditionalChain';
|
|
10
|
-
import { findAllNestedLoopNodes } from '../forLoops/loopTraversal';
|
|
9
|
+
import { handleConditionalChain } from '../handleConditionalChain.js';
|
|
10
|
+
import { findAllNestedLoopNodes } from '../forLoops/loopTraversal.js';
|
|
11
|
+
const warnedOrphans = new WeakSet();
|
|
11
12
|
/**
|
|
12
13
|
* Processes conditional directives (@if, @else-if, @else) in the template.
|
|
13
14
|
* Identifies conditional chains and delegates their handling to handleConditionalChain.
|
|
14
15
|
*/
|
|
15
|
-
/** @codexApi {"parent":"pithy.directive.if","name":"bindConditionals","stability":"stable","signature":"(nodes: PithyNode[], rootEl:
|
|
16
|
+
/** @codexApi {"parent":"pithy.directive.if","name":"bindConditionals","stability":"stable","signature":"(nodes: PithyNode[], rootEl: Element | DocumentFragment, ctx: Record<string, unknown>, processedNodeIds?: Set<string>, disposers?: (() => void)[]) => Set<string>"} */
|
|
16
17
|
export function bindConditionals(nodes, rootEl, ctx, processedNodeIds = new Set(), // Track already processed nodes
|
|
17
18
|
disposers = [] // Collect disposers for cleanup
|
|
18
19
|
) {
|
|
19
20
|
// Performance optimization: Create a Map of all elements by data-pid
|
|
20
21
|
// This makes element lookups O(1) instead of O(n) with querySelector
|
|
21
22
|
const elMap = new Map();
|
|
22
|
-
if (rootEl instanceof
|
|
23
|
+
if (rootEl instanceof Element || rootEl instanceof DocumentFragment) {
|
|
23
24
|
const elements = rootEl.querySelectorAll('[data-pid]');
|
|
24
25
|
elements.forEach(el => {
|
|
25
26
|
const pid = el.getAttribute('data-pid');
|
|
@@ -37,6 +38,18 @@ disposers = [] // Collect disposers for cleanup
|
|
|
37
38
|
chains.push({ chain, startIndex: i });
|
|
38
39
|
i += chain.length - 1; // Skip consumed siblings
|
|
39
40
|
}
|
|
41
|
+
else if (node.type === 'element' &&
|
|
42
|
+
(node.directives?.elseIf !== undefined ||
|
|
43
|
+
node.directives?.else !== undefined) &&
|
|
44
|
+
node.nodeId &&
|
|
45
|
+
!processedNodeIds.has(node.nodeId)) {
|
|
46
|
+
processedNodeIds.add(node.nodeId);
|
|
47
|
+
elMap.get(node.nodeId)?.remove();
|
|
48
|
+
if (import.meta.env?.DEV && !warnedOrphans.has(node)) {
|
|
49
|
+
warnedOrphans.add(node);
|
|
50
|
+
console.warn(`[bindConditionals] ${node.directives.elseIf !== undefined ? '@else-if' : '@else'} has no @if directly before it; <${node.originalTagName ?? node.tagName}> is dropped, as in a build`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
40
53
|
}
|
|
41
54
|
// Process each chain and track processed nodes
|
|
42
55
|
chains.forEach(({ chain }) => {
|
|
@@ -88,10 +101,14 @@ disposers = [] // Collect disposers for cleanup
|
|
|
88
101
|
if (node.directives?.for !== undefined) {
|
|
89
102
|
continue;
|
|
90
103
|
}
|
|
104
|
+
// A component's children are bound where the component renders them
|
|
105
|
+
// (slot projection, renderChildren); the tag's own DOM is discarded.
|
|
106
|
+
if (node.isComponent)
|
|
107
|
+
continue;
|
|
91
108
|
if (node.type === 'element' && node.children?.length) {
|
|
92
109
|
// Use the Map for O(1) lookup
|
|
93
110
|
const element = node.nodeId ? elMap.get(node.nodeId) : null;
|
|
94
|
-
if (element instanceof
|
|
111
|
+
if (element instanceof Element) {
|
|
95
112
|
// Pass the processedNodeIds Set and disposers to avoid duplicate processing
|
|
96
113
|
bindConditionals(node.children, element, ctx, processedNodeIds, disposers);
|
|
97
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindConditionals.js","sourceRoot":"","sources":["../../../src/compile/binds/bindConditionals.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,cAAc,EAAkB,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE;;;GAGG;AACH
|
|
1
|
+
{"version":3,"file":"bindConditionals.js","sourceRoot":"","sources":["../../../src/compile/binds/bindConditionals.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,cAAc,EAAkB,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,aAAa,GAAG,IAAI,OAAO,EAAa,CAAC;AAE/C;;;GAGG;AACH,+QAA+Q;AAC/Q,MAAM,UAAU,gBAAgB,CAC9B,KAAkB,EAClB,MAAkC,EAClC,GAA4B,EAC5B,mBAAgC,IAAI,GAAG,EAAE,EAAE,gCAAgC;AAC3E,YAA4B,EAAE,CAAC,gCAAgC;;IAE/D,qEAAqE;IACrE,qEAAqE;IACrE,MAAM,KAAK,GAAG,IAAI,GAAG,EAAmB,CAAC;IACzC,IAAI,MAAM,YAAY,OAAO,IAAI,MAAM,YAAY,gBAAgB,EAAE,CAAC;QACpE,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QACvD,QAAQ,CAAC,OAA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AAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.directive.if\",\n \"title\": \"@if conditional directive\",\n \"category\": \"directive\"\n}\n*/\n\nimport { collectIfChain, type PithyNode } from '@pithyjs/compiler';\nimport { handleConditionalChain } from '../handleConditionalChain';\nimport { findAllNestedLoopNodes } from '../forLoops/loopTraversal';\n\nconst warnedOrphans = new WeakSet<PithyNode>();\n\n/**\n * Processes conditional directives (@if, @else-if, @else) in the template.\n * Identifies conditional chains and delegates their handling to handleConditionalChain.\n */\n/** @codexApi {\"parent\":\"pithy.directive.if\",\"name\":\"bindConditionals\",\"stability\":\"stable\",\"signature\":\"(nodes: PithyNode[], rootEl: Element | DocumentFragment, ctx: Record<string, unknown>, processedNodeIds?: Set<string>, disposers?: (() => void)[]) => Set<string>\"} */\nexport function bindConditionals(\n nodes: PithyNode[],\n rootEl: Element | DocumentFragment,\n ctx: Record<string, unknown>,\n processedNodeIds: Set<string> = new Set(), // Track already processed nodes\n disposers: (() => void)[] = [] // Collect disposers for cleanup\n): Set<string> {\n // Performance optimization: Create a Map of all elements by data-pid\n // This makes element lookups O(1) instead of O(n) with querySelector\n const elMap = new Map<string, Element>();\n if (rootEl instanceof Element || rootEl instanceof DocumentFragment) {\n const elements = rootEl.querySelectorAll('[data-pid]');\n elements.forEach(el => {\n const pid = el.getAttribute('data-pid');\n if (pid) {\n elMap.set(pid, el as Element);\n }\n });\n }\n\n // Identify all conditional chains using shared utility from @pithyjs/compiler\n const chains: { chain: PithyNode[]; startIndex: number }[] = [];\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (node.type === 'element' && node.directives?.if !== undefined) {\n const chain = collectIfChain(nodes, i);\n chains.push({ chain, startIndex: i });\n i += chain.length - 1; // Skip consumed siblings\n } else if (\n node.type === 'element' &&\n (node.directives?.elseIf !== undefined ||\n node.directives?.else !== undefined) &&\n node.nodeId &&\n !processedNodeIds.has(node.nodeId)\n ) {\n processedNodeIds.add(node.nodeId);\n elMap.get(node.nodeId)?.remove();\n if (import.meta.env?.DEV && !warnedOrphans.has(node)) {\n warnedOrphans.add(node);\n console.warn(\n `[bindConditionals] ${node.directives.elseIf !== undefined ? '@else-if' : '@else'} has no @if directly before it; <${node.originalTagName ?? node.tagName}> is dropped, as in a build`\n );\n }\n }\n }\n\n // Process each chain and track processed nodes\n chains.forEach(({ chain }) => {\n chain.forEach(node => {\n // Mark this node as processed\n if (node.nodeId) {\n processedNodeIds.add(node.nodeId);\n }\n\n // Also mark all loops inside this conditional as processed\n // They will be bound by handleConditionalChain when the condition is true\n const nestedLoops = findAllNestedLoopNodes(node);\n for (const loopNode of nestedLoops) {\n if (loopNode.nodeId) {\n processedNodeIds.add(loopNode.nodeId);\n }\n }\n });\n\n // Find the DOM elements for this chain using our optimized Map\n const domElements = chain\n .map(node => {\n if (!node.nodeId) {\n return null;\n }\n\n // Use the Map for O(1) lookup instead of querySelector\n const element = elMap.get(node.nodeId);\n\n if (!element) {\n return null;\n }\n return element;\n })\n .filter((el): el is Element => el !== null);\n\n // Verify we found all DOM elements\n if (domElements.length !== chain.length) {\n return;\n }\n\n // Handle the chain and collect all processed node IDs\n // Pass disposers array so effects can be properly cleaned up\n handleConditionalChain(\n domElements,\n chain,\n ctx,\n processedNodeIds,\n disposers\n );\n });\n\n // Recursively process children of all nodes, skipping those already processed in chains\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n\n // Skip nodes that were already processed as part of a conditional chain\n if (node.nodeId && processedNodeIds.has(node.nodeId)) {\n continue;\n }\n\n // Skip @for nodes - their children (including conditionals) will be processed\n // by the loop manager's createLoopItem with the proper loop context (item, index, etc.)\n if (node.directives?.for !== undefined) {\n continue;\n }\n\n // A component's children are bound where the component renders them\n // (slot projection, renderChildren); the tag's own DOM is discarded.\n if (node.isComponent) continue;\n\n if (node.type === 'element' && node.children?.length) {\n // Use the Map for O(1) lookup\n const element = node.nodeId ? elMap.get(node.nodeId) : null;\n\n if (element instanceof Element) {\n // Pass the processedNodeIds Set and disposers to avoid duplicate processing\n bindConditionals(\n node.children,\n element,\n ctx,\n processedNodeIds,\n disposers\n );\n }\n }\n }\n\n return processedNodeIds;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindDefaultTwoWay.d.ts","sourceRoot":"","sources":["../../../src/compile/binds/bindDefaultTwoWay.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;
|
|
1
|
+
{"version":3,"file":"bindDefaultTwoWay.d.ts","sourceRoot":"","sources":["../../../src/compile/binds/bindDefaultTwoWay.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAsBF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,qOAAqO;AACrO,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,GAAG,gBAAgB,EACpC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,GACxB,IAAI,CAwDN"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"category": "runtime"
|
|
6
6
|
}
|
|
7
7
|
*/
|
|
8
|
+
import { isDeclaredDirective } from './declaredDirective.js';
|
|
8
9
|
import { effect, isSignal } from '@pithyjs/signals';
|
|
9
10
|
// Type guard to check if an element is an HTMLElement
|
|
10
11
|
function isHTMLElement(element) {
|
|
@@ -49,7 +50,7 @@ export function bindDefaultTwoWay(fragment, context, disposers) {
|
|
|
49
50
|
}
|
|
50
51
|
const el = element; // Now TypeScript knows this is HTMLElement
|
|
51
52
|
Array.from(el.attributes).forEach(attr => {
|
|
52
|
-
if (attr.name !== 'data-bind')
|
|
53
|
+
if (attr.name !== 'data-bind' || !isDeclaredDirective(attr))
|
|
53
54
|
return;
|
|
54
55
|
const signal = context[attr.value];
|
|
55
56
|
if (!isWritableSignal(signal)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindDefaultTwoWay.js","sourceRoot":"","sources":["../../../src/compile/binds/bindDefaultTwoWay.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAQpD,sDAAsD;AACtD,SAAS,aAAa,CAAC,OAAgB;IACrC,OAAO,OAAO,YAAY,WAAW,CAAC;AACxC,CAAC;AAED,8CAA8C;AAC9C,SAAS,gBAAgB,CAAC,MAAe;IACvC,OAAO,CACL,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAQ,MAAyB,CAAC,GAAG,KAAK,UAAU,CACzE,CAAC;AACJ,CAAC;AACD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,qOAAqO;AACrO,MAAM,UAAU,iBAAiB,CAC/B,QAAoC,EACpC,OAAgC,EAChC,SAAyB;IAEzB,QAAQ,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACzD,8CAA8C;QAC9C,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,OAAO,CAAC,IAAI,CACV,yDAAyD,EACzD,OAAO,CACR,CAAC;YACF,OAAO;QACT,CAAC;QAED,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,2CAA2C;QAE/D,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACvC,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW;gBAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"bindDefaultTwoWay.js","sourceRoot":"","sources":["../../../src/compile/binds/bindDefaultTwoWay.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AA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/\n\nimport { isDeclaredDirective } from './declaredDirective';\nimport { effect, isSignal } from '@pithyjs/signals';\n\n// Define a type for writable signals\ninterface WritableSignal<T = unknown> {\n (): T;\n set(value: T): void;\n}\n\n// Type guard to check if an element is an HTMLElement\nfunction isHTMLElement(element: Element): element is HTMLElement {\n return element instanceof HTMLElement;\n}\n\n// Type guard to check if a signal is writable\nfunction isWritableSignal(signal: unknown): signal is WritableSignal {\n return (\n isSignal(signal) && typeof (signal as WritableSignal).set === 'function'\n );\n}\n/**\n * Establishes two-way data binding between HTML elements with `data-bind` attributes and writable signals.\n *\n * This function scans the provided fragment for elements with `data-bind` attributes and creates\n * bidirectional synchronization between the DOM elements and their corresponding signals in the context.\n *\n * **How it works:**\n * 1. Finds all elements with `data-bind` attributes within the fragment\n * 2. For each element, retrieves the corresponding signal from the context using the attribute value\n * 3. Sets up reactive updates: when the signal changes, the DOM element is updated\n * 4. Sets up event listeners: when the user interacts with the element, the signal is updated\n * 5. Automatically infers the appropriate property and event based on the element type\n *\n * **Supported elements:**\n * - `<input>` elements: binds to `value` property (or `checked` for checkboxes/radio buttons)\n * - `<textarea>` elements: binds to `value` property\n * - `<select>` elements: binds to `value` property\n * - Other elements: falls back to `value` property\n *\n * @param fragment - The DOM fragment or element to search for bindable elements\n * @param context - Object containing the signals referenced by `data-bind` attributes\n * @param disposers - Array to collect cleanup functions for proper resource disposal\n *\n * @throws Will log warnings for elements that are not HTMLElements or signals that are not writable\n */\n\n/** @codexApi {\"parent\":\"pithy.runtime.two-way-binding\",\"name\":\"bindDefaultTwoWay\",\"stability\":\"stable\",\"signature\":\"(fragment: Element | DocumentFragment, context: Record<string, unknown>, disposers: (() => void)[]) => void\"} */\nexport function bindDefaultTwoWay(\n fragment: Element | DocumentFragment,\n context: Record<string, unknown>,\n disposers: (() => void)[]\n): void {\n fragment.querySelectorAll('[data-bind]').forEach(element => {\n // Type guard to ensure we have an HTMLElement\n if (!isHTMLElement(element)) {\n console.warn(\n `[PithyJS] Element with data-bind is not an HTMLElement:`,\n element\n );\n return;\n }\n\n const el = element; // Now TypeScript knows this is HTMLElement\n\n Array.from(el.attributes).forEach(attr => {\n if (attr.name !== 'data-bind' || !isDeclaredDirective(attr)) return;\n\n const signal = context[attr.value];\n\n if (!isWritableSignal(signal)) {\n console.warn(\n `[PithyJS] @bind=\"${attr.value}\" must refer to a writable signal`\n );\n return;\n }\n\n const prop = inferBindableProperty(el);\n const target = el as HTMLElement & Record<string, unknown>;\n\n // Reactive update: signal → DOM\n const effectDisposer = effect(() => {\n const value = signal();\n const currentValue = target[prop];\n if (currentValue !== value) {\n target[prop] = value;\n }\n });\n\n // Event listener: DOM → signal\n const event = inferBindableEvent(el, prop);\n const eventHandler = () => {\n const newVal = extractBindableValue(el, prop);\n signal.set(newVal);\n };\n\n el.addEventListener(event, eventHandler);\n el.removeAttribute('data-bind');\n\n // Add proper cleanup\n disposers.push(() => {\n el.removeEventListener(event, eventHandler);\n if (typeof effectDisposer === 'function') {\n effectDisposer();\n }\n });\n });\n });\n}\n\nfunction inferBindableProperty(el: HTMLElement): string {\n const tag = el.tagName.toLowerCase();\n\n if (tag === 'input') {\n const inputEl = el as HTMLInputElement;\n const type = inputEl.type;\n if (type === 'checkbox' || type === 'radio') return 'checked';\n return 'value';\n }\n\n if (tag === 'textarea') return 'value';\n if (tag === 'select') return 'value';\n\n return 'value'; // fallback\n}\n\nfunction inferBindableEvent(el: HTMLElement, prop: string): string {\n if (prop === 'checked') return 'change';\n return 'input';\n}\n\nfunction extractBindableValue(el: HTMLElement, prop: string): unknown {\n if (prop === 'checked') {\n return (el as HTMLInputElement).checked;\n }\n\n const tag = el.tagName.toLowerCase();\n if (tag === 'input') {\n const inputEl = el as HTMLInputElement;\n const type = inputEl.type;\n if (type === 'number') {\n const numValue = Number(inputEl.value);\n return isNaN(numValue) ? inputEl.value : numValue;\n }\n return inputEl.value;\n }\n\n if (tag === 'textarea') {\n return (el as HTMLTextAreaElement).value;\n }\n\n if (tag === 'select') {\n return (el as HTMLSelectElement).value;\n }\n\n return (el as HTMLElement & Record<string, unknown>)[prop];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindDeferDirectives.d.ts","sourceRoot":"","sources":["../../../src/compile/binds/bindDeferDirectives.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;
|
|
1
|
+
{"version":3,"file":"bindDeferDirectives.d.ts","sourceRoot":"","sources":["../../../src/compile/binds/bindDeferDirectives.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAqCF;;;;;;;;;;GAUG;AACH,mOAAmO;AACnO,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,SAAS,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,GAC3B,IAAI,CAoiBN"}
|
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { createRoot, effect } from '@pithyjs/signals';
|
|
17
17
|
import { DEFAULT_LAZY_TIMEOUT, } from '@pithyjs/compiler';
|
|
18
|
-
import { compileExpression } from '../compileExpression';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
18
|
+
import { compileExpression } from '../compileExpression.js';
|
|
19
|
+
import { declaredValue } from './declaredDirective.js';
|
|
20
|
+
import { DEFAULT_VISIBILITY_MARGIN, isLazyHandle, observeVisibilityOnce, } from '../../runtime/index.js';
|
|
21
|
+
import { boundaryForElement, setBoundaryError } from './bindErrorBoundary.js';
|
|
22
|
+
import { loadWithTimeout, scheduleByPriority, } from '../../runtime/deferHelpers.js';
|
|
23
|
+
import { setStyleProp } from './bindBoundAttributes.js';
|
|
22
24
|
/** Unique ID counter for defer anchors */
|
|
23
25
|
let deferIdCounter = 0;
|
|
24
26
|
/**
|
|
@@ -43,12 +45,12 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
43
45
|
if (element.hasAttribute('data-defer-state'))
|
|
44
46
|
continue;
|
|
45
47
|
// Read directive values from data attributes
|
|
46
|
-
const trigger = element
|
|
47
|
-
const loadExpr = element
|
|
48
|
-
const placeholderExpr = element
|
|
49
|
-
const whenExpr = element
|
|
50
|
-
const priority = element
|
|
51
|
-
const timeoutStr = element
|
|
48
|
+
const trigger = declaredValue(element, 'data-defer');
|
|
49
|
+
const loadExpr = declaredValue(element, 'data-load');
|
|
50
|
+
const placeholderExpr = declaredValue(element, 'data-placeholder');
|
|
51
|
+
const whenExpr = declaredValue(element, 'data-when');
|
|
52
|
+
const priority = declaredValue(element, 'data-defer-priority');
|
|
53
|
+
const timeoutStr = declaredValue(element, 'data-defer-timeout');
|
|
52
54
|
const timeout = timeoutStr ? parseInt(timeoutStr, 10) : undefined;
|
|
53
55
|
// Validate required attributes
|
|
54
56
|
if (!trigger) {
|
|
@@ -131,7 +133,7 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
131
133
|
// Add data attribute for test accessibility
|
|
132
134
|
errorEl.setAttribute('data-defer-error', deferId);
|
|
133
135
|
// Keep error slot hidden until needed
|
|
134
|
-
errorEl
|
|
136
|
+
setStyleProp(errorEl, 'display', 'none');
|
|
135
137
|
}
|
|
136
138
|
// Insert anchor and placeholder
|
|
137
139
|
const parent = element.parentNode;
|
|
@@ -142,7 +144,7 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
142
144
|
// For @defer="when", placeholder starts hidden (only shows during loading)
|
|
143
145
|
// For @defer="visible", placeholder shows immediately (triggers on visibility)
|
|
144
146
|
if (trigger === 'when' && placeholderEl instanceof HTMLElement) {
|
|
145
|
-
placeholderEl
|
|
147
|
+
setStyleProp(placeholderEl, 'display', 'none');
|
|
146
148
|
}
|
|
147
149
|
parent.insertBefore(placeholderEl, element);
|
|
148
150
|
}
|
|
@@ -151,7 +153,7 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
151
153
|
parent.insertBefore(errorEl, element);
|
|
152
154
|
}
|
|
153
155
|
// Hide the original element (it becomes the container after load)
|
|
154
|
-
element
|
|
156
|
+
setStyleProp(element, 'display', 'none');
|
|
155
157
|
// Track mounted component for cleanup
|
|
156
158
|
let mountedDestroy = null;
|
|
157
159
|
let disposeMountedSetup = null;
|
|
@@ -208,7 +210,7 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
208
210
|
isMounted = false;
|
|
209
211
|
// Hide placeholder if it was shown during a cancelled in-flight mount
|
|
210
212
|
if (placeholderEl && placeholderEl instanceof HTMLElement) {
|
|
211
|
-
placeholderEl
|
|
213
|
+
setStyleProp(placeholderEl, 'display', 'none');
|
|
212
214
|
}
|
|
213
215
|
// Reset state to pending (ready for re-mount on next trigger)
|
|
214
216
|
element.setAttribute('data-defer-state', 'pending');
|
|
@@ -226,7 +228,7 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
226
228
|
element.setAttribute('data-defer-state', 'loading');
|
|
227
229
|
// Show placeholder during loading (for @defer="when" it starts hidden)
|
|
228
230
|
if (placeholderEl && placeholderEl instanceof HTMLElement) {
|
|
229
|
-
placeholderEl
|
|
231
|
+
setStyleProp(placeholderEl, 'display', null);
|
|
230
232
|
}
|
|
231
233
|
try {
|
|
232
234
|
// Load the module with timeout (chunk is cached after first load)
|
|
@@ -321,7 +323,7 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
321
323
|
}
|
|
322
324
|
else if (errorEl) {
|
|
323
325
|
// No error boundary - fall back to local error slot
|
|
324
|
-
errorEl
|
|
326
|
+
setStyleProp(errorEl, 'display', null);
|
|
325
327
|
}
|
|
326
328
|
// Dispatch error event (for programmatic handling)
|
|
327
329
|
element.dispatchEvent(new CustomEvent('error', {
|
|
@@ -330,7 +332,7 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
330
332
|
retry: () => {
|
|
331
333
|
// Hide error, re-show placeholder if we had one
|
|
332
334
|
if (errorEl) {
|
|
333
|
-
errorEl
|
|
335
|
+
setStyleProp(errorEl, 'display', 'none');
|
|
334
336
|
}
|
|
335
337
|
lazyHandle.retry().then(mountComponent);
|
|
336
338
|
},
|
|
@@ -417,7 +419,7 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
417
419
|
elementState === 'error') {
|
|
418
420
|
// Hide error slot
|
|
419
421
|
if (errorEl) {
|
|
420
|
-
errorEl
|
|
422
|
+
setStyleProp(errorEl, 'display', 'none');
|
|
421
423
|
}
|
|
422
424
|
// Mount the component - it will handle state transitions
|
|
423
425
|
mountComponent();
|
|
@@ -476,7 +478,7 @@ export function bindDeferDirectives(fragment, context, disposers) {
|
|
|
476
478
|
}
|
|
477
479
|
// Hide error slot when condition becomes false (after a failed load)
|
|
478
480
|
if (errorEl) {
|
|
479
|
-
errorEl
|
|
481
|
+
setStyleProp(errorEl, 'display', 'none');
|
|
480
482
|
}
|
|
481
483
|
}
|
|
482
484
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindDeferDirectives.js","sourceRoot":"","sources":["../../../src/compile/binds/bindDeferDirectives.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EACL,oBAAoB,GAGrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EACL,yBAAyB,EACzB,YAAY,EACZ,qBAAqB,GAEtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACL,eAAe,EACf,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAEpC,0CAA0C;AAC1C,IAAI,cAAc,GAAG,CAAC,CAAC;AAEvB;;;;;;;;;;GAUG;AACH,mOAAmO;AACnO,MAAM,UAAU,mBAAmB,CACjC,QAA0B,EAC1B,OAAgC,EAChC,SAA4B;IAE5B,0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IAAI,UAAU,EAAE,CAAC;wBAC5B,gBAAgB,EAAE,CAAC;oBACrB,CAAC;oBACD,qEAAqE;oBACrE,IAAI,OAAO,EAAE,CAAC;wBACZ,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;oBACjC,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE;gBAClB,UAAU,EAAE,CAAC;gBACb,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;gBACzB,OAAO,CAAC,IAAI,CAAC,gDAAgD,EAAE,OAAO,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"bindDeferDirectives.js","sourceRoot":"","sources":["../../../src/compile/binds/bindDeferDirectives.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EACL,oBAAoB,GAGrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EACL,yBAAyB,EACzB,YAAY,EACZ,qBAAqB,GAEtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACL,eAAe,EACf,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,0CAA0C;AAC1C,IAAI,cAAc,GAAG,CAAC,CAAC;AAEvB;;;;;;;;;;GAUG;AACH,mOAAm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c,EAAE,CAAC;wBACjD,YAAY,EAAE,CAAC;oBACjB,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,0EAA0E;oBAC1E,kBAAkB,EAAE,CAAC;oBAErB,iDAAiD;oBACjD,uEAAuE;oBACvE,IAAI,SAAS,IAAI,UAAU,EAAE,CAAC;wBAC5B,gBAAgB,EAAE,CAAC;oBACrB,CAAC;oBACD,qEAAqE;oBACrE,IAAI,OAAO,EAAE,CAAC;wBACZ,YAAY,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;oBAC3C,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE;gBAClB,UAAU,EAAE,CAAC;gBACb,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;gBACzB,OAAO,CAAC,IAAI,CAAC,gDAAgD,EAAE,OAAO,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.core.bind-defer-directives\",\n \"title\": \"Defer Directive Binder for Lazy Loading\",\n \"category\": \"directive\"\n}\n*/\n\n/**\n * Lazy Loading Directive Binder\n *\n * Handles @defer directives to lazily load components based on\n * visibility (IntersectionObserver) or boolean conditions.\n *\n * @module compile/binds/bindDeferDirectives\n */\n\nimport { createRoot, effect } from '@pithyjs/signals';\nimport {\n DEFAULT_LAZY_TIMEOUT,\n type DeferTrigger,\n type LoadingPriority,\n} from '@pithyjs/compiler';\nimport { compileExpression } from '../compileExpression';\nimport { declaredValue } from './declaredDirective';\n\nimport {\n DEFAULT_VISIBILITY_MARGIN,\n isLazyHandle,\n observeVisibilityOnce,\n type LazyHandle,\n} from '../../runtime';\n\nimport { boundaryForElement, setBoundaryError } from './bindErrorBoundary';\nimport {\n loadWithTimeout,\n scheduleByPriority,\n} from '../../runtime/deferHelpers';\nimport { setStyleProp } from './bindBoundAttributes';\n\n/** Unique ID counter for defer anchors */\nlet deferIdCounter = 0;\n\n/**\n * Bind @defer directives to enable lazy loading of components.\n *\n * Supports two trigger modes:\n * - `visible`: Load when element scrolls into viewport (IntersectionObserver)\n * - `when`: Load when a boolean expression becomes truthy\n *\n * @param fragment - The root document fragment\n * @param context - Template context with signals and lazy handles\n * @param disposers - Array to collect cleanup functions\n */\n/** @codexApi {\"parent\":\"pithy.core.bind-defer-directives\",\"name\":\"bindDeferDirectives\",\"stability\":\"stable\",\"signature\":\"(fragment: DocumentFragment, context: Record<string, unknown>, disposers: Array<() => void>) => void\"} */\nexport function bindDeferDirectives(\n fragment: DocumentFragment,\n context: Record<string, unknown>,\n disposers: Array<() => void>\n): void {\n // Find all elements with @defer directive\n const deferElements = fragment.querySelectorAll('[data-defer]');\n\n for (const el of deferElements) {\n const element = el as HTMLElement;\n\n // Skip elements already processed (e.g., inside component subtrees that\n // ran their own bindDeferDirectives before being inserted into the outer DOM)\n if (element.hasAttribute('data-defer-state')) continue;\n\n // Read directive values from data attributes\n const trigger = declaredValue(element, 'data-defer') as\n | DeferTrigger\n | undefined;\n const loadExpr = declaredValue(element, 'data-load');\n const placeholderExpr = declaredValue(element, 'data-placeholder');\n const whenExpr = declaredValue(element, 'data-when');\n const priority = declaredValue(element, 'data-defer-priority') as\n | LoadingPriority\n | undefined;\n const timeoutStr = declaredValue(element, 'data-defer-timeout');\n const timeout = timeoutStr ? parseInt(timeoutStr, 10) : undefined;\n\n // Validate required attributes\n if (!trigger) {\n if (import.meta.env?.DEV) {\n console.warn('[pithy] @defer element missing trigger type', element);\n }\n continue;\n }\n\n if (!loadExpr) {\n if (import.meta.env?.DEV) {\n console.warn('[pithy] @defer element missing @load directive', element);\n }\n continue;\n }\n\n // Get the lazy handle from context\n const lazyHandleGetter = compileExpression<LazyHandle<unknown>>(\n loadExpr,\n context,\n undefined\n );\n const lazyHandle = lazyHandleGetter();\n\n if (!isLazyHandle(lazyHandle)) {\n if (import.meta.env?.DEV) {\n console.warn(\n `[pithy] @load=\"${loadExpr}\" did not resolve to a LazyHandle`,\n element\n );\n }\n continue;\n }\n\n // Use existing data-defer-id or generate a unique one\n const existingId = element.getAttribute('data-defer-id');\n const deferId = existingId || `defer-${++deferIdCounter}`;\n\n // Set data attributes for SSR markers (preserve existing ID if present)\n if (!existingId) {\n element.setAttribute('data-defer-id', deferId);\n }\n element.setAttribute('data-defer-state', 'pending');\n\n // Create anchor comment\n const anchor = document.createComment(`defer:${deferId}`);\n\n // Setup placeholder - check both data-placeholder attribute and slot=\"placeholder\" children\n let placeholderEl: HTMLElement | Text | null = null;\n\n // First, try to extract slot=\"placeholder\" from element children\n const slotPlaceholder = element.querySelector('[slot=\"placeholder\"]');\n if (slotPlaceholder) {\n // Remove from original parent and use as placeholder\n placeholderEl = slotPlaceholder as HTMLElement;\n placeholderEl.removeAttribute('slot');\n // Add data attribute for test accessibility\n placeholderEl.setAttribute('data-defer-placeholder', deferId);\n } else if (placeholderExpr) {\n // Fallback to data-placeholder attribute\n // Check if it's a string literal\n if (\n (placeholderExpr.startsWith(\"'\") && placeholderExpr.endsWith(\"'\")) ||\n (placeholderExpr.startsWith('\"') && placeholderExpr.endsWith('\"'))\n ) {\n // String placeholder\n const text = placeholderExpr.slice(1, -1);\n placeholderEl = document.createTextNode(text) as unknown as HTMLElement;\n } else {\n // Component placeholder - get from context\n const placeholderGetter = compileExpression<unknown>(\n placeholderExpr,\n context,\n null\n );\n const placeholder = placeholderGetter();\n\n if (typeof placeholder === 'function') {\n // It's a component function\n try {\n const result = (placeholder as () => unknown)();\n if (result && typeof result === 'object' && 'el' in result) {\n placeholderEl = (result as { el: HTMLElement }).el as HTMLElement;\n }\n } catch (err) {\n if (import.meta.env?.DEV) {\n console.warn(\n `[pithy] Error rendering placeholder component:`,\n err\n );\n }\n }\n }\n }\n }\n\n // Also extract slot=\"error\" for error handling\n const slotError = element.querySelector('[slot=\"error\"]');\n let errorEl: HTMLElement | null = null;\n if (slotError) {\n errorEl = slotError as HTMLElement;\n errorEl.removeAttribute('slot');\n // Add data attribute for test accessibility\n errorEl.setAttribute('data-defer-error', deferId);\n // Keep error slot hidden until needed\n setStyleProp(errorEl, 'display', 'none');\n }\n\n // Insert anchor and placeholder\n const parent = element.parentNode;\n if (!parent) continue;\n\n parent.insertBefore(anchor, element);\n\n if (placeholderEl) {\n // For @defer=\"when\", placeholder starts hidden (only shows during loading)\n // For @defer=\"visible\", placeholder shows immediately (triggers on visibility)\n if (trigger === 'when' && placeholderEl instanceof HTMLElement) {\n setStyleProp(placeholderEl, 'display', 'none');\n }\n parent.insertBefore(placeholderEl, element);\n }\n\n // Insert error element (hidden) after placeholder\n if (errorEl) {\n parent.insertBefore(errorEl, element);\n }\n\n // Hide the original element (it becomes the container after load)\n setStyleProp(element, 'display', 'none');\n\n // Track mounted component for cleanup\n let mountedDestroy: (() => void) | null = null;\n let disposeMountedSetup: (() => void) | null = null;\n let isMounted = false;\n let isMounting = false; // true while an async mount is in-flight\n\n // Mount generation counter — incremented on every unmount/cleanup to\n // invalidate in-flight async mounts that started before the unmount.\n let mountGeneration = 0;\n\n // Track inserted nodes directly (no wrapper div)\n let insertedNodes: Node[] = [];\n\n /**\n * Run and clear the mounted instance's teardown. Claimed before DOM\n * insertion, so a throw between the two still reaches it.\n */\n function releaseMountedComponent(): void {\n const destroyMounted = mountedDestroy;\n const disposeSetup = disposeMountedSetup;\n mountedDestroy = null;\n disposeMountedSetup = null;\n try {\n destroyMounted?.();\n } catch (err) {\n if (import.meta.env?.DEV) {\n console.warn('[pithy] @defer error in component destroy():', err);\n }\n } finally {\n try {\n disposeSetup?.();\n } catch (err) {\n if (import.meta.env?.DEV) {\n console.warn('[pithy] @defer error in setup cleanup:', err);\n }\n }\n }\n }\n\n /**\n * Remove mounted component nodes from DOM\n */\n function unmountComponent(): void {\n // Invalidate any in-flight async mount\n mountGeneration++;\n isMounting = false;\n\n releaseMountedComponent();\n\n // Remove all inserted nodes\n for (const node of insertedNodes) {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n }\n insertedNodes = [];\n isMounted = false;\n\n // Hide placeholder if it was shown during a cancelled in-flight mount\n if (placeholderEl && placeholderEl instanceof HTMLElement) {\n setStyleProp(placeholderEl, 'display', 'none');\n }\n\n // Reset state to pending (ready for re-mount on next trigger)\n element.setAttribute('data-defer-state', 'pending');\n }\n\n /**\n * Mount the lazy component with timeout support\n */\n async function mountComponent(): Promise<void> {\n // If already mounted or a mount is in-flight, skip\n if (isMounted || isMounting) return;\n\n isMounting = true;\n\n // Capture generation so we can detect if an unmount happened while awaiting\n const thisGeneration = mountGeneration;\n\n element.setAttribute('data-defer-state', 'loading');\n\n // Show placeholder during loading (for @defer=\"when\" it starts hidden)\n if (placeholderEl && placeholderEl instanceof HTMLElement) {\n setStyleProp(placeholderEl, 'display', null);\n }\n\n try {\n // Load the module with timeout (chunk is cached after first load)\n const effectiveTimeout = timeout ?? DEFAULT_LAZY_TIMEOUT;\n const module = await loadWithTimeout(lazyHandle, effectiveTimeout);\n\n // Check if an unmount/cleanup happened during async load (generation changed)\n if (thisGeneration !== mountGeneration) {\n isMounting = false;\n return;\n }\n\n // Use fresh parentNode — the element may have been moved into the real DOM\n // by bindComponentTags.replaceWith() during the async gap\n const freshParent = element.parentNode;\n if (!freshParent) {\n isMounting = false;\n return;\n }\n\n element.setAttribute('data-defer-state', 'loaded');\n\n // Remove placeholder\n if (placeholderEl && placeholderEl.parentNode) {\n placeholderEl.parentNode.removeChild(placeholderEl);\n placeholderEl = null;\n }\n\n // Remove error element (no longer needed on success)\n if (errorEl && errorEl.parentNode) {\n errorEl.parentNode.removeChild(errorEl);\n errorEl = null;\n }\n\n // Get the component from the module\n const Component = (module as { default?: unknown }).default || module;\n\n if (typeof Component === 'function') {\n // Render the component\n let disposeSetup: (() => void) | undefined;\n const result = createRoot(disposeRoot => {\n disposeSetup = disposeRoot;\n return (Component as () => unknown)();\n });\n\n if (result && typeof result === 'object' && 'el' in result) {\n const { el, destroy } = result as {\n el: HTMLElement | DocumentFragment;\n destroy?: () => void;\n };\n\n mountedDestroy = destroy ?? null;\n disposeMountedSetup = disposeSetup ?? null;\n\n // Insert component content directly (no wrapper div)\n if (el instanceof DocumentFragment) {\n // Track all children before moving them\n const nodes = Array.from(el.childNodes);\n insertedNodes = nodes;\n // Insert fragment directly - this moves all children to the DOM\n freshParent.insertBefore(el, element);\n } else {\n insertedNodes = [el];\n freshParent.insertBefore(el, element);\n }\n\n isMounted = true;\n isMounting = false;\n\n // Dispatch loaded event\n element.dispatchEvent(\n new CustomEvent('loaded', {\n detail: {\n ttiMs: Date.now(), // Could track actual load time\n chunkId: lazyHandle.key,\n },\n bubbles: true,\n })\n );\n } else {\n disposeSetup?.();\n isMounting = false;\n }\n } else {\n isMounting = false;\n }\n } catch (err) {\n isMounting = false;\n if (!isMounted) releaseMountedComponent();\n\n // Check if an unmount/cleanup happened during async load\n if (thisGeneration !== mountGeneration) return;\n\n element.setAttribute('data-defer-state', 'error');\n\n const error = err instanceof Error ? err : new Error(String(err));\n\n // Remove placeholder and show error slot if available\n if (placeholderEl && placeholderEl.parentNode) {\n placeholderEl.parentNode.removeChild(placeholderEl);\n placeholderEl = null;\n }\n\n // Propagate error to nearest error boundary (if one exists)\n const boundary = boundaryForElement(element);\n if (boundary) {\n setBoundaryError(boundary, error);\n } else if (errorEl) {\n // No error boundary - fall back to local error slot\n setStyleProp(errorEl, 'display', null);\n }\n\n // Dispatch error event (for programmatic handling)\n element.dispatchEvent(\n new CustomEvent('error', {\n detail: {\n error,\n retry: () => {\n // Hide error, re-show placeholder if we had one\n if (errorEl) {\n setStyleProp(errorEl, 'display', 'none');\n }\n lazyHandle.retry().then(mountComponent);\n },\n },\n bubbles: true,\n })\n );\n\n if (import.meta.env?.DEV) {\n console.error(`[pithy] Failed to load lazy component:`, err);\n }\n }\n }\n\n // Track idle callback for cancellation\n let idleCallbackId: number | undefined;\n\n /**\n * Cleanup function\n */\n function cleanup(): void {\n // Cancel any scheduled-but-not-started mount\n cancelPendingMount();\n\n // Invalidate any in-flight async mount (unmountComponent also does this,\n // but we bump it here too in case unmountComponent is skipped)\n mountGeneration++;\n\n // Cancel pending idle callback (cancelPendingMount handles the scheduled\n // case, but cover the already-in-flight case too)\n if (\n idleCallbackId !== undefined &&\n typeof cancelIdleCallback !== 'undefined'\n ) {\n cancelIdleCallback(idleCallbackId);\n idleCallbackId = undefined;\n }\n\n // Unmount component (calls destroy and removes nodes)\n unmountComponent();\n\n // Cancel any in-flight load\n lazyHandle.cancel();\n }\n\n // Track whether a mount has been scheduled but not yet started.\n // This is needed so that unmount/cancel can invalidate pending\n // scheduled mounts (e.g., rapid toggle: true → false → true).\n let mountScheduled = false;\n\n /**\n * Trigger mount with priority scheduling\n */\n function triggerMount(): void {\n mountScheduled = true;\n // Capture current generation so the microtask can detect cancellation.\n // cancelPendingMount bumps mountGeneration, so if it fires between\n // scheduling and execution, the microtask will see the mismatch.\n const expectedGen = mountGeneration;\n const result = scheduleByPriority(() => {\n mountScheduled = false;\n if (expectedGen !== mountGeneration) return; // cancelled\n mountComponent();\n }, priority);\n\n // Track idle callback ID for cleanup\n if (typeof result === 'number') {\n idleCallbackId = result;\n }\n }\n\n /**\n * Cancel any pending scheduled mount that hasn't started yet.\n * Bumps mountGeneration to also invalidate any in-flight async mounts.\n */\n function cancelPendingMount(): void {\n if (mountScheduled) {\n mountScheduled = false;\n mountGeneration++;\n // Cancel pending idle callback if one is tracked\n if (\n idleCallbackId !== undefined &&\n typeof cancelIdleCallback !== 'undefined'\n ) {\n cancelIdleCallback(idleCallbackId);\n idleCallbackId = undefined;\n }\n }\n }\n\n // Subscribe to lazy handle state for external retry support\n // This allows calling lazyHandle.retry() from error slot buttons\n const stopStateEffect = effect(() => {\n const handleState = lazyHandle.state();\n const elementState = element.getAttribute('data-defer-state');\n\n // If handle loaded externally (via retry) and we're in error state, try to mount\n if (\n handleState === 'loaded' &&\n !isMounted &&\n !isMounting &&\n elementState === 'error'\n ) {\n // Hide error slot\n if (errorEl) {\n setStyleProp(errorEl, 'display', 'none');\n }\n // Mount the component - it will handle state transitions\n mountComponent();\n }\n });\n\n disposers.push(stopStateEffect);\n\n // Setup trigger based on mode\n if (trigger === 'visible') {\n // Visibility trigger using IntersectionObserver\n // IMPORTANT: Observe the placeholder (which is visible), not the hidden element\n // If no placeholder exists, create a sentinel element to observe\n let observeTarget: Element;\n let sentinelEl: HTMLElement | null = null;\n\n if (placeholderEl && placeholderEl instanceof HTMLElement) {\n observeTarget = placeholderEl;\n } else {\n // Create a minimal sentinel element to observe\n sentinelEl = document.createElement('span');\n sentinelEl.style.display = 'inline-block';\n sentinelEl.style.width = '1px';\n sentinelEl.style.height = '1px';\n parent.insertBefore(sentinelEl, element);\n observeTarget = sentinelEl;\n }\n\n const stopObserving = observeVisibilityOnce(observeTarget, triggerMount, {\n rootMargin: DEFAULT_VISIBILITY_MARGIN,\n });\n\n disposers.push(() => {\n stopObserving();\n // Remove sentinel if we created one\n if (sentinelEl && sentinelEl.parentNode) {\n sentinelEl.parentNode.removeChild(sentinelEl);\n }\n cleanup();\n });\n } else if (trigger === 'when' && whenExpr) {\n // Boolean trigger using effect\n const conditionGetter = compileExpression<boolean>(\n whenExpr,\n context,\n false\n );\n\n const stopEffect = effect(() => {\n const shouldShow = conditionGetter();\n\n if (shouldShow) {\n // Mount component (chunk is cached after first load, so remounting is fast)\n if (!isMounted && !isMounting && !mountScheduled) {\n triggerMount();\n }\n } else {\n // Cancel any scheduled-but-not-started mount first (handles rapid toggle)\n cancelPendingMount();\n\n // Destroy component when condition becomes false\n // This is consistent with React, Vue, Angular - no automatic show/hide\n if (isMounted || isMounting) {\n unmountComponent();\n }\n // Hide error slot when condition becomes false (after a failed load)\n if (errorEl) {\n setStyleProp(errorEl, 'display', 'none');\n }\n }\n });\n\n disposers.push(() => {\n stopEffect();\n cleanup();\n });\n } else {\n if (import.meta.env?.DEV) {\n console.warn(`[pithy] @defer=\"when\" requires @when attribute`, element);\n }\n }\n }\n}\n"]}
|
|
@@ -15,6 +15,8 @@ export interface BoundaryInfo {
|
|
|
15
15
|
fallbackElement: Element | null;
|
|
16
16
|
contentPlaceholders: Map<Node, Comment>;
|
|
17
17
|
isActive: boolean;
|
|
18
|
+
/** The receiving boundary of the slot this one was rendered in, detached. */
|
|
19
|
+
slotParent?: BoundaryInfo | null;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* Finds the BoundaryInfo for a given DOM element by traversing up the tree
|
|
@@ -23,6 +25,62 @@ export interface BoundaryInfo {
|
|
|
23
25
|
*/
|
|
24
26
|
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"boundaryForElement","stability":"stable","signature":"(el: Element | null) => BoundaryInfo | null"} */
|
|
25
27
|
export declare function boundaryForElement(el: Element | null): BoundaryInfo | null;
|
|
28
|
+
/**
|
|
29
|
+
* Renders a slot whose receiving `<slot>` sits at `anchor`, mounted by the
|
|
30
|
+
* component placeholder `host`. Its content is detached while it renders, so
|
|
31
|
+
* boundaries are resolved through the anchor, then the host's render. Without an
|
|
32
|
+
* anchor (`renderChildren()`), the host is the frame's anchor.
|
|
33
|
+
*/
|
|
34
|
+
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"withSlotBoundary","stability":"experimental","signature":"<T>(anchor: Node | undefined, host: Element | undefined, fn: () => T) => T"} */
|
|
35
|
+
export declare function withSlotBoundary<T>(anchor: Node | undefined, host: Element | undefined, fn: () => T): T;
|
|
36
|
+
/** The boundary element of the slot that rendered `node`, if a slot did. */
|
|
37
|
+
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"slotOwnerOf","stability":"internal","signature":"(node: Node) => Element | null"} */
|
|
38
|
+
export declare function slotOwnerOf(node: Node): Element | null;
|
|
39
|
+
/**
|
|
40
|
+
* The boundary element that what is being rendered will sit under. A branch,
|
|
41
|
+
* slot or component built detached cannot `closest()` it, so each sets this
|
|
42
|
+
* while it runs; a crash takes the innermost one (`deferCrash`).
|
|
43
|
+
*/
|
|
44
|
+
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"boundaryContext","stability":"internal","signature":"() => Element | null"} */
|
|
45
|
+
export declare function boundaryContext(): Element | null;
|
|
46
|
+
/**
|
|
47
|
+
* Builds an `@if`/`@case` branch or `@for` item that will be inserted beside
|
|
48
|
+
* `anchor`, or inside it when `inside`. A detached landing place (a component's
|
|
49
|
+
* own template) keeps the enclosing context; an attached one with no boundary
|
|
50
|
+
* has none.
|
|
51
|
+
*/
|
|
52
|
+
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"withBranchBoundary","stability":"internal","signature":"<T>(anchor: Node, fn: () => T, inside?: boolean) => T"} */
|
|
53
|
+
export declare function withBranchBoundary<T>(anchor: Node, fn: () => T, inside?: boolean): T;
|
|
54
|
+
/** Whether a boundary has hidden the detached subtree `node` belongs to. */
|
|
55
|
+
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"isInHiddenContent","stability":"internal","signature":"(node: Node) => boolean"} */
|
|
56
|
+
export declare function isInHiddenContent(node: Node): boolean;
|
|
57
|
+
/** The registered boundary of `el`'s nearest `[data-error]`, ignoring slot frames. */
|
|
58
|
+
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"registeredClosest","stability":"internal","signature":"(el: Element | null | undefined) => BoundaryInfo | null"} */
|
|
59
|
+
export declare function registeredClosest(el: Element | null | undefined): BoundaryInfo | null;
|
|
60
|
+
/** Whether `el`, in the slot being rendered, is normal content an active fallback has replaced. */
|
|
61
|
+
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"slotContentHidden","stability":"experimental","signature":"(el: Element) => boolean"} */
|
|
62
|
+
export declare function slotContentHidden(el: Element): boolean;
|
|
63
|
+
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"isHiddenByBoundary","stability":"experimental","signature":"(node: Node) => boolean"} */
|
|
64
|
+
export declare function isHiddenByBoundary(node: Node): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Inserts `content` after `anchor` when an active boundary has hidden the
|
|
67
|
+
* anchor, which a crash during a slot's render can do, and hides it too.
|
|
68
|
+
*/
|
|
69
|
+
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"insertBesideHidden","stability":"experimental","signature":"(anchor: Node, content: Node) => boolean"} */
|
|
70
|
+
export declare function insertBesideHidden(anchor: Node, content: Node): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Puts `content` in the place of `node` when an active boundary has hidden it,
|
|
73
|
+
* which a crash during `node`'s own render can do, and hides it there instead.
|
|
74
|
+
*/
|
|
75
|
+
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"replaceHidden","stability":"experimental","signature":"(node: Node, content: Node[]) => boolean"} */
|
|
76
|
+
export declare function replaceHidden(node: Node, content: Node[]): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Finds the parent boundary for a given boundary (for error escalation)
|
|
79
|
+
* @param childBoundary - The child boundary to find parent for
|
|
80
|
+
* @returns Parent BoundaryInfo if found, null otherwise
|
|
81
|
+
*/
|
|
82
|
+
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"findParentBoundary","stability":"internal","signature":"(childBoundary: BoundaryInfo) => BoundaryInfo | null"} */
|
|
83
|
+
export declare function findParentBoundary(childBoundary: BoundaryInfo): BoundaryInfo | null;
|
|
26
84
|
/**
|
|
27
85
|
* Clears the error state of a boundary, restoring normal content
|
|
28
86
|
* @param boundary - The boundary to clear
|
|
@@ -49,6 +107,9 @@ export declare function clearBoundaryError(boundary: BoundaryInfo): void;
|
|
|
49
107
|
*/
|
|
50
108
|
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"setBoundaryError","stability":"stable","signature":"(boundary: BoundaryInfo, error: Error) => boolean"} */
|
|
51
109
|
export declare function setBoundaryError(boundary: BoundaryInfo, error: Error): boolean;
|
|
110
|
+
/** The boundary the component being rendered sits under. */
|
|
111
|
+
/** @codexApi {"parent":"pithy.feature.error-boundary","name":"currentBoundary","stability":"experimental","signature":"() => BoundaryInfo | null"} */
|
|
112
|
+
export declare function currentBoundary(): BoundaryInfo | null;
|
|
52
113
|
/**
|
|
53
114
|
* Runs a function within the context of a specific boundary
|
|
54
115
|
* Used for scoping async operations to the correct boundary
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/compile/binds/bindErrorBoundary.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;
|
|
1
|
+
{"version":3,"file":"bindErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/compile/binds/bindErrorBoundary.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAIF,OAAO,EAAU,MAAM,EAAW,MAAM,kBAAkB,CAAC;AAM3D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IAClC,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,mBAAmB,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,EAAE,OAAO,CAAC;IAClB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CAClC;AAuCD;;;;GAIG;AACH,qKAAqK;AACrK,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,GAAG,YAAY,GAAG,IAAI,CAW1E;AAaD;;;;;GAKG;AACH,wMAAwM;AACxM,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,MAAM,EAAE,IAAI,GAAG,SAAS,EACxB,IAAI,EAAE,OAAO,GAAG,SAAS,EACzB,EAAE,EAAE,MAAM,CAAC,GACV,CAAC,CA4CH;AAYD,4EAA4E;AAC5E,mJAAmJ;AACnJ,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,GAAG,IAAI,CAMtD;AAED;;;;GAIG;AAGH,6IA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