@craft-ts/component 0.7.0-beta.13 → 0.7.0-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/package.json +7 -2
  2. package/src/index.d.ts +40 -40
  3. package/src/index.js +35 -35
  4. package/src/lib/a11y-control.d.ts +0 -1
  5. package/src/lib/a11y-control.js +0 -1
  6. package/src/lib/a11y.d.ts +4 -5
  7. package/src/lib/a11y.js +3 -4
  8. package/src/lib/ai/ai-context-menu.d.ts +24 -25
  9. package/src/lib/ai/ai-context-menu.js +2 -3
  10. package/src/lib/ai/ai-send-dialog.d.ts +277 -278
  11. package/src/lib/ai/ai-send-dialog.js +4 -5
  12. package/src/lib/ai/send-context-to-ai.d.ts +1 -2
  13. package/src/lib/ai/send-context-to-ai.js +4 -5
  14. package/src/lib/assert-defined-input.d.ts +1 -2
  15. package/src/lib/assert-defined-input.js +0 -1
  16. package/src/lib/bootstrap.d.ts +4 -3
  17. package/src/lib/bootstrap.js +6 -8
  18. package/src/lib/bridge.d.ts +9 -10
  19. package/src/lib/bridge.js +3 -4
  20. package/src/lib/catch-node.d.ts +35 -0
  21. package/src/lib/{block.js → catch-node.js} +9 -10
  22. package/src/lib/component.d.ts +23 -10
  23. package/src/lib/component.js +5 -6
  24. package/src/lib/composition.d.ts +1 -2
  25. package/src/lib/composition.js +2 -3
  26. package/src/lib/craft-defaults.d.ts +0 -1
  27. package/src/lib/craft-defaults.js +4 -5
  28. package/src/lib/craft-host-tokens.d.ts +0 -1
  29. package/src/lib/craft-host-tokens.js +0 -1
  30. package/src/lib/craft-router-outlet.d.ts +1 -2
  31. package/src/lib/craft-router-outlet.js +1 -2
  32. package/src/lib/css-vars.d.ts +0 -1
  33. package/src/lib/css-vars.js +0 -1
  34. package/src/lib/css-vars.type.d.ts +1 -2
  35. package/src/lib/css-vars.type.js +0 -1
  36. package/src/lib/{defer.d.ts → defer-node.d.ts} +4 -5
  37. package/src/lib/{defer.js → defer-node.js} +1 -2
  38. package/src/lib/directive.d.ts +1 -2
  39. package/src/lib/directive.js +1 -2
  40. package/src/lib/factory-runtime.d.ts +1 -2
  41. package/src/lib/factory-runtime.js +0 -1
  42. package/src/lib/{field-exception-block.d.ts → field-error-node.d.ts} +22 -23
  43. package/src/lib/{field-exception-block.js → field-error-node.js} +8 -9
  44. package/src/lib/for-node.d.ts +28 -0
  45. package/src/lib/{each.js → for-node.js} +4 -5
  46. package/src/lib/for-scheduling.d.ts +58 -0
  47. package/src/lib/{each-scheduling.js → for-scheduling.js} +14 -15
  48. package/src/lib/host-runtime.d.ts +0 -1
  49. package/src/lib/host-runtime.js +0 -1
  50. package/src/lib/hydrate.d.ts +2 -3
  51. package/src/lib/hydrate.js +57 -18
  52. package/src/lib/hyperscript.d.ts +1 -2
  53. package/src/lib/hyperscript.js +1 -2
  54. package/src/lib/if-node.d.ts +7 -0
  55. package/src/lib/{if-block.js → if-node.js} +2 -3
  56. package/src/lib/locator.d.ts +5 -6
  57. package/src/lib/locator.js +1 -2
  58. package/src/lib/{match-block.d.ts → match-node.d.ts} +8 -9
  59. package/src/lib/{match-block.js → match-node.js} +3 -4
  60. package/src/lib/{pending-block.d.ts → pending-node.d.ts} +28 -29
  61. package/src/lib/{pending-block.js → pending-node.js} +12 -13
  62. package/src/lib/project.d.ts +2 -3
  63. package/src/lib/project.js +2 -3
  64. package/src/lib/render/hydration-metadata.d.ts +0 -1
  65. package/src/lib/render/hydration-metadata.js +0 -1
  66. package/src/lib/render/hydration.d.ts +0 -1
  67. package/src/lib/render/hydration.js +0 -1
  68. package/src/lib/render/interpreter.d.ts +9 -8
  69. package/src/lib/render/interpreter.js +156 -81
  70. package/src/lib/render/server-style-collector.d.ts +0 -1
  71. package/src/lib/render/server-style-collector.js +0 -1
  72. package/src/lib/render/ssr-coordinator.d.ts +4 -2
  73. package/src/lib/render/ssr-coordinator.js +14 -3
  74. package/src/lib/render/string-dom.d.ts +0 -1
  75. package/src/lib/render/string-dom.js +48 -7
  76. package/src/lib/render/style-registry.d.ts +3 -2
  77. package/src/lib/render/style-registry.js +3 -2
  78. package/src/lib/render/style-scope.d.ts +0 -1
  79. package/src/lib/render/style-scope.js +0 -1
  80. package/src/lib/render/vnode.d.ts +117 -54
  81. package/src/lib/render/vnode.js +26 -27
  82. package/src/lib/security.d.ts +54 -0
  83. package/src/lib/security.js +502 -0
  84. package/src/lib/server-render.d.ts +12 -3
  85. package/src/lib/server-render.js +76 -17
  86. package/src/lib/start.d.ts +2 -3
  87. package/src/lib/start.js +3 -3
  88. package/src/lib/template-contract.d.ts +22 -23
  89. package/src/lib/template-contract.js +0 -1
  90. package/src/lib/template.d.ts +2 -3
  91. package/src/lib/template.js +2 -3
  92. package/src/lib/testing.d.ts +3 -4
  93. package/src/lib/testing.js +5 -6
  94. package/src/lib/types.d.ts +40 -28
  95. package/src/lib/types.js +3 -4
  96. package/testing/public-api.d.ts +0 -1
  97. package/testing/public-api.js +0 -1
  98. package/src/index.d.ts.map +0 -1
  99. package/src/index.js.map +0 -1
  100. package/src/lib/a11y-control.d.ts.map +0 -1
  101. package/src/lib/a11y-control.js.map +0 -1
  102. package/src/lib/a11y.d.ts.map +0 -1
  103. package/src/lib/a11y.js.map +0 -1
  104. package/src/lib/ai/ai-context-menu.d.ts.map +0 -1
  105. package/src/lib/ai/ai-context-menu.js.map +0 -1
  106. package/src/lib/ai/ai-send-dialog.d.ts.map +0 -1
  107. package/src/lib/ai/ai-send-dialog.js.map +0 -1
  108. package/src/lib/ai/send-context-to-ai.d.ts.map +0 -1
  109. package/src/lib/ai/send-context-to-ai.js.map +0 -1
  110. package/src/lib/assert-defined-input.d.ts.map +0 -1
  111. package/src/lib/assert-defined-input.js.map +0 -1
  112. package/src/lib/block.d.ts +0 -36
  113. package/src/lib/block.d.ts.map +0 -1
  114. package/src/lib/block.js.map +0 -1
  115. package/src/lib/bootstrap.d.ts.map +0 -1
  116. package/src/lib/bootstrap.js.map +0 -1
  117. package/src/lib/bridge.d.ts.map +0 -1
  118. package/src/lib/bridge.js.map +0 -1
  119. package/src/lib/component.d.ts.map +0 -1
  120. package/src/lib/component.js.map +0 -1
  121. package/src/lib/composition.d.ts.map +0 -1
  122. package/src/lib/composition.js.map +0 -1
  123. package/src/lib/craft-defaults.d.ts.map +0 -1
  124. package/src/lib/craft-defaults.js.map +0 -1
  125. package/src/lib/craft-host-tokens.d.ts.map +0 -1
  126. package/src/lib/craft-host-tokens.js.map +0 -1
  127. package/src/lib/craft-router-outlet.d.ts.map +0 -1
  128. package/src/lib/craft-router-outlet.js.map +0 -1
  129. package/src/lib/css-vars.d.ts.map +0 -1
  130. package/src/lib/css-vars.js.map +0 -1
  131. package/src/lib/css-vars.type.d.ts.map +0 -1
  132. package/src/lib/css-vars.type.js.map +0 -1
  133. package/src/lib/defer.d.ts.map +0 -1
  134. package/src/lib/defer.js.map +0 -1
  135. package/src/lib/directive.d.ts.map +0 -1
  136. package/src/lib/directive.js.map +0 -1
  137. package/src/lib/each-scheduling.d.ts +0 -59
  138. package/src/lib/each-scheduling.d.ts.map +0 -1
  139. package/src/lib/each-scheduling.js.map +0 -1
  140. package/src/lib/each.d.ts +0 -29
  141. package/src/lib/each.d.ts.map +0 -1
  142. package/src/lib/each.js.map +0 -1
  143. package/src/lib/factory-runtime.d.ts.map +0 -1
  144. package/src/lib/factory-runtime.js.map +0 -1
  145. package/src/lib/field-exception-block.d.ts.map +0 -1
  146. package/src/lib/field-exception-block.js.map +0 -1
  147. package/src/lib/host-runtime.d.ts.map +0 -1
  148. package/src/lib/host-runtime.js.map +0 -1
  149. package/src/lib/hydrate.d.ts.map +0 -1
  150. package/src/lib/hydrate.js.map +0 -1
  151. package/src/lib/hyperscript.d.ts.map +0 -1
  152. package/src/lib/hyperscript.js.map +0 -1
  153. package/src/lib/if-block.d.ts +0 -8
  154. package/src/lib/if-block.d.ts.map +0 -1
  155. package/src/lib/if-block.js.map +0 -1
  156. package/src/lib/locator.d.ts.map +0 -1
  157. package/src/lib/locator.js.map +0 -1
  158. package/src/lib/match-block.d.ts.map +0 -1
  159. package/src/lib/match-block.js.map +0 -1
  160. package/src/lib/pending-block.d.ts.map +0 -1
  161. package/src/lib/pending-block.js.map +0 -1
  162. package/src/lib/project.d.ts.map +0 -1
  163. package/src/lib/project.js.map +0 -1
  164. package/src/lib/render/hydration-metadata.d.ts.map +0 -1
  165. package/src/lib/render/hydration-metadata.js.map +0 -1
  166. package/src/lib/render/hydration.d.ts.map +0 -1
  167. package/src/lib/render/hydration.js.map +0 -1
  168. package/src/lib/render/interpreter.d.ts.map +0 -1
  169. package/src/lib/render/interpreter.js.map +0 -1
  170. package/src/lib/render/server-style-collector.d.ts.map +0 -1
  171. package/src/lib/render/server-style-collector.js.map +0 -1
  172. package/src/lib/render/ssr-coordinator.d.ts.map +0 -1
  173. package/src/lib/render/ssr-coordinator.js.map +0 -1
  174. package/src/lib/render/string-dom.d.ts.map +0 -1
  175. package/src/lib/render/string-dom.js.map +0 -1
  176. package/src/lib/render/style-registry.d.ts.map +0 -1
  177. package/src/lib/render/style-registry.js.map +0 -1
  178. package/src/lib/render/style-scope.d.ts.map +0 -1
  179. package/src/lib/render/style-scope.js.map +0 -1
  180. package/src/lib/render/vnode.d.ts.map +0 -1
  181. package/src/lib/render/vnode.js.map +0 -1
  182. package/src/lib/server-render.d.ts.map +0 -1
  183. package/src/lib/server-render.js.map +0 -1
  184. package/src/lib/start.d.ts.map +0 -1
  185. package/src/lib/start.js.map +0 -1
  186. package/src/lib/template-contract.d.ts.map +0 -1
  187. package/src/lib/template-contract.js.map +0 -1
  188. package/src/lib/template.d.ts.map +0 -1
  189. package/src/lib/template.js.map +0 -1
  190. package/src/lib/testing.d.ts.map +0 -1
  191. package/src/lib/testing.js.map +0 -1
  192. package/src/lib/types.d.ts.map +0 -1
  193. package/src/lib/types.js.map +0 -1
  194. package/testing/public-api.d.ts.map +0 -1
  195. package/testing/public-api.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import { type CraftDirective } from './types';
2
- import type { CraftNodeChildren } from './render/vnode';
1
+ import { type CraftDirective } from './types.js';
2
+ import type { CraftNodeChildren } from './render/vnode.js';
3
3
  import type { SsrMode } from '@craft-ts/core';
4
- export declare const PENDING_BLOCK_DIRECTIVE: unique symbol;
4
+ export declare const PENDING_NODE_DIRECTIVE: unique symbol;
5
5
  /**
6
6
  * Where the fallback is inserted relative to the suspended subtree. The subtree
7
7
  * itself is kept mounted but **detached from the document** while it is
@@ -9,28 +9,28 @@ export declare const PENDING_BLOCK_DIRECTIVE: unique symbol;
9
9
  * CSS), so its state survives the wait. Assistive tech is told via
10
10
  * `aria-busy` / `aria-live` on the fallback, not via the detached source.
11
11
  */
12
- export type PendingBlockPosition = 'before' | 'after';
12
+ export type PendingPosition = 'before' | 'after';
13
13
  export type PendingFallback = () => CraftNodeChildren;
14
14
  /**
15
15
  * What to render for one source. A bare function covers the suspended case; the
16
16
  * object form adds `reloading`, rendered **next to the still-visible subtree**
17
17
  * when the source already has a value and is refetching.
18
18
  */
19
- export type PendingBlockHandler = PendingFallback | {
19
+ export type PendingHandler = PendingFallback | {
20
20
  readonly pending: PendingFallback;
21
21
  readonly reloading?: PendingFallback;
22
22
  };
23
23
  /** One handler per async source name, for the `.exhaustive` form. */
24
- export type PendingBlockHandlers = Readonly<Record<string, PendingBlockHandler>>;
24
+ export type PendingHandlers = Readonly<Record<string, PendingHandler>>;
25
25
  type HandlerChildrenOf<Handler> = Handler extends () => infer Children ? Children : Handler extends {
26
26
  readonly pending: () => infer Pending;
27
27
  readonly reloading?: () => infer Reloading;
28
28
  } ? Pending | Reloading : never;
29
- export type PendingBlockHandlerChildren<Handler> = HandlerChildrenOf<Handler>;
29
+ export type PendingHandlerChildren<Handler> = HandlerChildrenOf<Handler>;
30
30
  /** Resolves the children a handler renders for one of its two states. */
31
- export declare function resolvePendingBlockHandler(handler: PendingBlockHandler, state: 'pending' | 'reloading'): CraftNodeChildren;
31
+ export declare function resolvePendingHandler(handler: PendingHandler, state: 'pending' | 'reloading'): CraftNodeChildren;
32
32
  /**
33
- * Thrown when a `CraftNotSettled` escapes every `pendingBlock` boundary — the
33
+ * Thrown when a `CraftNotSettled` escapes every `pendingNode` boundary — the
34
34
  * runtime counterpart of the compile-time check, for the cases the types cannot
35
35
  * see (a settled read hidden inside a lambda, a dynamically built subtree).
36
36
  */
@@ -38,30 +38,30 @@ export declare class CraftUnhandledPendingError extends Error {
38
38
  readonly source: string;
39
39
  constructor(source: string);
40
40
  }
41
- export type PendingBlockDirective<Handlers extends PendingBlockHandlers | undefined = undefined, FallbackChildren extends CraftNodeChildren = CraftNodeChildren> = CraftDirective & {
42
- readonly [PENDING_BLOCK_DIRECTIVE]: {
41
+ export type PendingDirective<Handlers extends PendingHandlers | undefined = undefined, FallbackChildren extends CraftNodeChildren = CraftNodeChildren> = CraftDirective & {
42
+ readonly [PENDING_NODE_DIRECTIVE]: {
43
43
  /** `undefined` for the catch-all form: every source below is covered. */
44
44
  readonly handlers: Handlers;
45
45
  readonly fallback: PendingFallback | undefined;
46
46
  readonly reloading: PendingFallback | undefined;
47
- readonly position: PendingBlockPosition;
47
+ readonly position: PendingPosition;
48
48
  readonly ssr: SsrMode | undefined;
49
49
  /** Phantom carrier — the fallback's own nodes, never read at runtime. */
50
50
  readonly fallbackChildren?: FallbackChildren;
51
51
  };
52
52
  };
53
53
  /**
54
- * The sources a `pendingBlock` leaves uncovered. The catch-all form covers
54
+ * The sources a `pendingNode` leaves uncovered. The catch-all form covers
55
55
  * everything below it; the `.exhaustive` form covers only the sources it names.
56
56
  */
57
- export type PendingBlockResidualSources<Sources extends string, Handlers extends PendingBlockHandlers | undefined> = Handlers extends PendingBlockHandlers ? Exclude<Sources, Extract<keyof Handlers, string>> : never;
58
- /** Exhaustiveness check for `pendingBlock.exhaustive({...})`. */
59
- export type PendingBlockExhaustiveCheck<Sources extends string, Handlers extends PendingBlockHandlers> = [Exclude<Sources, Extract<keyof Handlers, string>>] extends [never] ? [Exclude<Extract<keyof Handlers, string>, Sources>] extends [never] ? unknown : {
60
- 'pendingBlock.exhaustive has fallbacks for sources that never suspend here': Exclude<Extract<keyof Handlers, string>, Sources>;
57
+ export type PendingResidualSources<Sources extends string, Handlers extends PendingHandlers | undefined> = Handlers extends PendingHandlers ? Exclude<Sources, Extract<keyof Handlers, string>> : never;
58
+ /** Exhaustiveness check for `pendingNode.exhaustive({...})`. */
59
+ export type PendingExhaustiveCheck<Sources extends string, Handlers extends PendingHandlers> = [Exclude<Sources, Extract<keyof Handlers, string>>] extends [never] ? [Exclude<Extract<keyof Handlers, string>, Sources>] extends [never] ? unknown : {
60
+ 'pendingNode.exhaustive has fallbacks for sources that never suspend here': Exclude<Extract<keyof Handlers, string>, Sources>;
61
61
  } : {
62
- 'pendingBlock.exhaustive is missing a fallback for async sources': Exclude<Sources, Extract<keyof Handlers, string>>;
62
+ 'pendingNode.exhaustive is missing a fallback for async sources': Exclude<Sources, Extract<keyof Handlers, string>>;
63
63
  };
64
- type PendingBlockBaseOptions<Fallback extends PendingFallback = PendingFallback> = Readonly<{
64
+ type PendingBaseOptions<Fallback extends PendingFallback = PendingFallback> = Readonly<{
65
65
  /**
66
66
  * Rendered next to the still-visible subtree while a source that already has
67
67
  * a value is refetching. A refetch does not suspend — the stale value stays
@@ -69,14 +69,14 @@ type PendingBlockBaseOptions<Fallback extends PendingFallback = PendingFallback>
69
69
  */
70
70
  readonly reloading?: Fallback;
71
71
  /** Where the fallback goes relative to the (hidden) subtree. Defaults to `'before'`. */
72
- readonly position?: PendingBlockPosition;
72
+ readonly position?: PendingPosition;
73
73
  }>;
74
74
  /**
75
75
  * A client-only SSR boundary must name the shell that replaces the skipped
76
76
  * subtree. Other modes may omit it when an exhaustive handler or an outer
77
77
  * boundary owns the pending UI.
78
78
  */
79
- export type PendingBlockOptions<Fallback extends PendingFallback = PendingFallback> = PendingBlockBaseOptions<Fallback> & (Readonly<{
79
+ export type PendingOptions<Fallback extends PendingFallback = PendingFallback> = PendingBaseOptions<Fallback> & (Readonly<{
80
80
  readonly ssr: 'client';
81
81
  readonly fallback: Fallback;
82
82
  }> | Readonly<{
@@ -84,14 +84,14 @@ export type PendingBlockOptions<Fallback extends PendingFallback = PendingFallba
84
84
  /** Rendered while the subtree has an async source with no value yet. */
85
85
  readonly fallback?: Fallback;
86
86
  }>);
87
- interface PendingBlockFactory {
87
+ interface PendingFactory {
88
88
  /**
89
89
  * A boundary that renders `fallback` while **any** async source read below it
90
90
  * has no value yet — the template equivalent of Solid's `Suspense`.
91
91
  *
92
92
  * ```ts
93
93
  * div([span(users.settledValue)]).pipe(
94
- * pendingBlock({ fallback: () => span('Chargement…') }),
94
+ * pendingNode({ fallback: () => span('Chargement…') }),
95
95
  * )
96
96
  * ```
97
97
  *
@@ -99,7 +99,7 @@ interface PendingBlockFactory {
99
99
  * CSS-hidden) so nothing below it is torn down and rebuilt when the data
100
100
  * arrives. The fallback is announced with `aria-live="polite"`.
101
101
  */
102
- <Fallback extends PendingFallback>(options?: PendingBlockOptions<Fallback>): PendingBlockDirective<undefined, ReturnType<Fallback> extends CraftNodeChildren ? ReturnType<Fallback> : CraftNodeChildren>;
102
+ <Fallback extends PendingFallback>(options?: PendingOptions<Fallback>): PendingDirective<undefined, ReturnType<Fallback> extends CraftNodeChildren ? ReturnType<Fallback> : CraftNodeChildren>;
103
103
  /**
104
104
  * A boundary with one fallback per async source, checked exhaustively against
105
105
  * the sources actually read below it — an unlisted source is a compile error,
@@ -107,7 +107,7 @@ interface PendingBlockFactory {
107
107
  *
108
108
  * ```ts
109
109
  * div([...]).pipe(
110
- * pendingBlock.exhaustive({
110
+ * pendingNode.exhaustive({
111
111
  * users: () => SkeletonList(),
112
112
  * orders: () => SkeletonRows(),
113
113
  * }),
@@ -117,9 +117,8 @@ interface PendingBlockFactory {
117
117
  * When several listed sources are pending at once, the fallback of the first
118
118
  * one to suspend is rendered.
119
119
  */
120
- exhaustive<const Handlers extends PendingBlockHandlers>(handlers: Handlers, options?: Omit<PendingBlockOptions, 'fallback' | 'reloading'>): PendingBlockDirective<Handlers, PendingBlockHandlerChildren<Handlers[keyof Handlers]> extends CraftNodeChildren ? PendingBlockHandlerChildren<Handlers[keyof Handlers]> : CraftNodeChildren>;
120
+ exhaustive<const Handlers extends PendingHandlers>(handlers: Handlers, options?: Omit<PendingOptions, 'fallback' | 'reloading'>): PendingDirective<Handlers, PendingHandlerChildren<Handlers[keyof Handlers]> extends CraftNodeChildren ? PendingHandlerChildren<Handlers[keyof Handlers]> : CraftNodeChildren>;
121
121
  }
122
- export declare const pendingBlock: PendingBlockFactory;
123
- export declare function isPendingBlockDirective(value: unknown): value is PendingBlockDirective<PendingBlockHandlers | undefined>;
122
+ export declare const pendingNode: PendingFactory;
123
+ export declare function isPendingDirective(value: unknown): value is PendingDirective<PendingHandlers | undefined>;
124
124
  export {};
125
- //# sourceMappingURL=pending-block.d.ts.map
@@ -1,7 +1,7 @@
1
- import { CRAFT_DIRECTIVE } from './types';
2
- export const PENDING_BLOCK_DIRECTIVE = Symbol('craft-pending-block-directive');
1
+ import { CRAFT_DIRECTIVE } from './types.js';
2
+ export const PENDING_NODE_DIRECTIVE = Symbol('craft-pending-node-directive');
3
3
  /** Resolves the children a handler renders for one of its two states. */
4
- export function resolvePendingBlockHandler(handler, state) {
4
+ export function resolvePendingHandler(handler, state) {
5
5
  if (typeof handler === 'function') {
6
6
  return state === 'pending' ? handler() : [];
7
7
  }
@@ -10,39 +10,38 @@ export function resolvePendingBlockHandler(handler, state) {
10
10
  : (handler.reloading?.() ?? []);
11
11
  }
12
12
  /**
13
- * Thrown when a `CraftNotSettled` escapes every `pendingBlock` boundary — the
13
+ * Thrown when a `CraftNotSettled` escapes every `pendingNode` boundary — the
14
14
  * runtime counterpart of the compile-time check, for the cases the types cannot
15
15
  * see (a settled read hidden inside a lambda, a dynamically built subtree).
16
16
  */
17
17
  export class CraftUnhandledPendingError extends Error {
18
18
  source;
19
19
  constructor(source) {
20
- super(`Craft async source "${source}" suspended outside of any pendingBlock(...) boundary.`);
20
+ super(`Craft async source "${source}" suspended outside of any pendingNode(...) boundary.`);
21
21
  this.name = 'CraftUnhandledPendingError';
22
22
  this.source = source;
23
23
  }
24
24
  }
25
- function createPendingBlockDirective(handlers, fallback, reloading, position, ssr) {
25
+ function createPendingDirective(handlers, fallback, reloading, position, ssr) {
26
26
  const directive = (() => undefined);
27
27
  Object.defineProperty(directive, CRAFT_DIRECTIVE, {
28
28
  value: {
29
- name: handlers ? 'pendingBlock.exhaustive' : 'pendingBlock',
29
+ name: handlers ? 'pendingNode.exhaustive' : 'pendingNode',
30
30
  meta: {},
31
31
  logic: (baseLogic) => baseLogic,
32
32
  template: (baseTemplate) => baseTemplate,
33
33
  },
34
34
  enumerable: false,
35
35
  });
36
- Object.defineProperty(directive, PENDING_BLOCK_DIRECTIVE, {
36
+ Object.defineProperty(directive, PENDING_NODE_DIRECTIVE, {
37
37
  value: { handlers, fallback, reloading, position, ssr },
38
38
  enumerable: false,
39
39
  });
40
40
  return directive;
41
41
  }
42
- export const pendingBlock = Object.assign((options = {}) => createPendingBlockDirective(undefined, options.fallback, options.reloading, options.position ?? 'before', options.ssr), {
43
- exhaustive: (handlers, options = {}) => createPendingBlockDirective(handlers, undefined, undefined, options.position ?? 'before', options.ssr),
42
+ export const pendingNode = Object.assign((options = {}) => createPendingDirective(undefined, options.fallback, options.reloading, options.position ?? 'before', options.ssr), {
43
+ exhaustive: (handlers, options = {}) => createPendingDirective(handlers, undefined, undefined, options.position ?? 'before', options.ssr),
44
44
  });
45
- export function isPendingBlockDirective(value) {
46
- return (typeof value === 'function' && PENDING_BLOCK_DIRECTIVE in value);
45
+ export function isPendingDirective(value) {
46
+ return (typeof value === 'function' && PENDING_NODE_DIRECTIVE in value);
47
47
  }
48
- //# sourceMappingURL=pending-block.js.map
@@ -1,5 +1,5 @@
1
- import type { CraftNodeChildren, CraftNodeChildrenDependencies, ProjectionNode } from './render/vnode';
2
- import { CONTENT_DECLARATION_CONTEXT, CONTENT_OUTPUT, CONTENT_RENDERABLE, CONTENT_STYLE_POLICY, type ContentOptions, type InputValue, type ProjectionUnit, type RenderableContent } from './types';
1
+ import type { CraftNodeChildren, CraftNodeChildrenDependencies, ProjectionNode } from './render/vnode.js';
2
+ import { CONTENT_DECLARATION_CONTEXT, CONTENT_OUTPUT, CONTENT_RENDERABLE, CONTENT_STYLE_POLICY, type ContentOptions, type InputValue, type ProjectionUnit, type RenderableContent } from './types.js';
3
3
  type ContentOutput<Value> = Value extends (...args: any[]) => infer Output ? Output : never;
4
4
  type RenderableContentOutput<Value> = ContentOutput<Value> extends CraftNodeChildren ? ContentOutput<Value> : CraftNodeChildren;
5
5
  /** Brands deferred DOM content and records the caller's style opt-in. */
@@ -16,4 +16,3 @@ export declare function renderContent<Value extends RenderableContent>(value: Va
16
16
  export declare function renderContent<Value extends ProjectionUnit<any>>(value: Value | InputValue<Value>): ProjectionNode<CraftNodeChildrenDependencies<Value>, Value>;
17
17
  export declare function renderContent<SlotName extends string, Value extends RenderableContent>(slotName: SlotName, value: Value | InputValue<Value>): ProjectionNode<CraftNodeChildrenDependencies<RenderableContentOutput<Value>>, RenderableContentOutput<Value>>;
18
18
  export {};
19
- //# sourceMappingURL=project.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { isGeneratorFunction, isYieldableValue } from '@craft-ts/core';
2
- import { currentCraftRenderContext } from './render/vnode';
3
- import { CONTENT_DECLARATION_CONTEXT, CONTENT_OUTPUT, CONTENT_RENDERABLE, CONTENT_STYLE_POLICY, } from './types';
2
+ import { currentCraftRenderContext } from './render/vnode.js';
3
+ import { CONTENT_DECLARATION_CONTEXT, CONTENT_OUTPUT, CONTENT_RENDERABLE, CONTENT_STYLE_POLICY, } from './types.js';
4
4
  function contentStylePolicy(value) {
5
5
  return value[CONTENT_STYLE_POLICY] === 'allow-container-styles'
6
6
  ? 'allow-container-styles'
@@ -53,4 +53,3 @@ export function renderContent(slotNameOrValue, maybeValue) {
53
53
  declarationContext,
54
54
  };
55
55
  }
56
- //# sourceMappingURL=project.js.map
@@ -1,3 +1,2 @@
1
1
  export declare function setNodeHydrationKey(node: object, key: string): void;
2
2
  export declare function hydrationKeyOf(node: object): string | undefined;
3
- //# sourceMappingURL=hydration-metadata.d.ts.map
@@ -5,4 +5,3 @@ export function setNodeHydrationKey(node, key) {
5
5
  export function hydrationKeyOf(node) {
6
6
  return hydrationKeys.get(node);
7
7
  }
8
- //# sourceMappingURL=hydration-metadata.js.map
@@ -21,4 +21,3 @@ export type HydrationCursor = Readonly<{
21
21
  finish(): void;
22
22
  }>;
23
23
  export declare function createHydrationCursor(host: Element, onMismatch?: (error: HydrationMismatchError) => void): HydrationCursor;
24
- //# sourceMappingURL=hydration.d.ts.map
@@ -178,4 +178,3 @@ function isDevelopment() {
178
178
  const processRef = globalThis.process;
179
179
  return (processRef === undefined || processRef.env?.['NODE_ENV'] !== 'production');
180
180
  }
181
- //# sourceMappingURL=hydration.js.map
@@ -1,11 +1,13 @@
1
1
  import { type CraftServiceProvider, type CraftDomAdapter, type CraftRenderIdentity } from '@craft-ts/core';
2
- import { Injector } from '../host-runtime';
3
- import { type CraftComponent } from '../types';
4
- import { CraftStyleRegistry } from './style-registry';
5
- import { type RuntimeLocatorCriteria } from '../locator';
6
- import { type HydrationCursor } from './hydration';
7
- import type { CraftSsrCoordinator } from './ssr-coordinator';
8
- import type { CraftServerStyleCollector } from './server-style-collector';
2
+ import { Injector } from '../host-runtime.js';
3
+ import { type CraftComponent } from '../types.js';
4
+ import { CraftStyleRegistry } from './style-registry.js';
5
+ import { type RuntimeLocatorCriteria } from '../locator.js';
6
+ import { type HydrationCursor } from './hydration.js';
7
+ import type { CraftSsrCoordinator } from './ssr-coordinator.js';
8
+ import type { CraftServerStyleCollector } from './server-style-collector.js';
9
+ /** Exporté pour la suite de non-régression sécurité. */
10
+ export declare function ɵassertSafeStyleValue(value: unknown, resourceOrigins?: readonly string[]): void;
9
11
  export interface MountedCraftComponent<Props extends object> {
10
12
  updateProps(props: Props): void;
11
13
  destroy(): void;
@@ -29,4 +31,3 @@ export type InterpretedRenderOptions = Readonly<{
29
31
  export declare function mountInterpretedComponent<Props extends object>(component: CraftComponent<Props>, host: Element, injector: Injector | object, props: Props): MountedCraftComponent<Props>;
30
32
  export declare function mountInterpretedComponentWithOptions<Props extends object>(component: CraftComponent<Props>, host: Element, injector: Injector | object, props: Props, options: InterpretedRenderOptions): MountedCraftComponent<Props>;
31
33
  export declare function mountInterpretedComponentTemplate<Context>(component: CraftComponent<any>, host: Element, injector: Injector | object, context: Context, additionalProviders?: readonly CraftServiceProvider[]): MountedCraftTemplate<Context>;
32
- //# sourceMappingURL=interpreter.d.ts.map