@markless/serializer 0.4.0 → 0.6.0

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.
@@ -0,0 +1,668 @@
1
+ //#region src/async-boundary-arm.d.ts
2
+ declare const ASYNC_BOUNDARY_ARM: {
3
+ readonly try: 0;
4
+ readonly pending: 1;
5
+ readonly catch: 2;
6
+ };
7
+ //#endregion
8
+ //#region src/protocol-event-names.d.ts
9
+ declare const PROTOCOL_VISIBLE_EVENT_NAME = "visible";
10
+ declare const PROTOCOL_IDLE_EVENT_NAME = "idle";
11
+ //#endregion
12
+ //#region src/protocol-locator-paths.d.ts
13
+ /**
14
+ * The container attribute that lets resume find each located element by its
15
+ * position under its parent, so a node a third-party script adds or swaps
16
+ * elsewhere cannot shift it. Format: protocol-locator-paths-format.ts.
17
+ */
18
+ declare const PROTOCOL_LOCATOR_PATHS_ATTRIBUTE = "data-markless-paths";
19
+ //#endregion
20
+ //#region src/protocol-page-markers.d.ts
21
+ declare const PROTOCOL_CONTAINER_START_COMMENT = "markless:page-start";
22
+ declare const PROTOCOL_CONTAINER_END_COMMENT = "markless:page-end";
23
+ declare const PROTOCOL_CONTAINER_HOST_NODE_ID = "container";
24
+ //#endregion
25
+ //#region src/protocol-sync-policy-host.d.ts
26
+ /**
27
+ * The attribute the server writes on each element whose event record carries a
28
+ * sync policy (preventDefault, stopPropagation), valued with that record's
29
+ * hostNodeId. The inline boot finds the policy from the event's own target up
30
+ * to the nearest marked element, so it never needs the element's position.
31
+ */
32
+ declare const PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE = "data-markless-sync";
33
+ //#endregion
34
+ //#region src/protocol-prop-prefix.d.ts
35
+ declare const PROTOCOL_PROP_GRAPH_NODE_PREFIX = "prop:";
36
+ //#endregion
37
+ //#region src/protocol-constants.d.ts
38
+ declare const ASYNC_PROTOCOL_VERSION = 1;
39
+ declare const STORAGE_PROTOCOL_VERSION = 2;
40
+ declare function protocolStateVersion(storage: readonly unknown[] | undefined): typeof ASYNC_PROTOCOL_VERSION | typeof STORAGE_PROTOCOL_VERSION;
41
+ declare const PROTOCOL_EVENT_ACTION_KIND: {
42
+ readonly event: "event";
43
+ readonly externalDelegate: "external-delegate";
44
+ };
45
+ declare function protocolInstanceSegment(edgeIndex: number): string;
46
+ declare function protocolProjectionSegment(edgeIndex: number): string;
47
+ /** One keyed `@for` row's identity segment. The key is identity, never the index. */
48
+ declare function protocolRowSegment(key: unknown): string;
49
+ /** The leading instance path of a composed id, or '' when the id is page-local. */
50
+ declare function protocolInstancePath(id: string): string;
51
+ declare const PROTOCOL_PROPS_GRAPH_NODE_ID = "prop:props";
52
+ declare const PROTOCOL_PAGE_SPACE_ID_PREFIXES: string[];
53
+ declare function protocolInstanceQualifies(graphNodeId: string): boolean | undefined;
54
+ //#endregion
55
+ //#region src/protocol.d.ts
56
+ type ProtocolAsyncBoundaryArm = (typeof ASYNC_BOUNDARY_ARM)[keyof typeof ASYNC_BOUNDARY_ARM];
57
+ type ProtocolSyncPolicyCondition = {
58
+ readonly type: 'and';
59
+ readonly conditions: ReadonlyArray<ProtocolSyncPolicyCondition>;
60
+ } | {
61
+ readonly type: 'or';
62
+ readonly conditions: ReadonlyArray<ProtocolSyncPolicyCondition>;
63
+ } | {
64
+ readonly type: 'not';
65
+ readonly condition: ProtocolSyncPolicyCondition;
66
+ } | {
67
+ readonly type: 'graph-truthy';
68
+ readonly graphNodeId: string;
69
+ readonly path?: ReadonlyArray<string>;
70
+ } | {
71
+ readonly type: 'constant-truthy';
72
+ readonly value: unknown;
73
+ } | {
74
+ readonly type: 'event-equals';
75
+ readonly field: string;
76
+ readonly value: unknown;
77
+ };
78
+ type ProtocolSyncPolicyBranch = {
79
+ readonly when: ProtocolSyncPolicyCondition;
80
+ readonly actions: ReadonlyArray<'preventDefault' | 'stopPropagation'>;
81
+ };
82
+ type ProtocolSyncPolicy = ProtocolSyncPolicyBranch | {
83
+ readonly branches: ReadonlyArray<ProtocolSyncPolicyBranch>;
84
+ };
85
+ type ProtocolEventActionKind = (typeof PROTOCOL_EVENT_ACTION_KIND)[keyof typeof PROTOCOL_EVENT_ACTION_KIND];
86
+ type ProtocolEventAction = {
87
+ readonly kind: typeof PROTOCOL_EVENT_ACTION_KIND.externalDelegate;
88
+ readonly owner: string;
89
+ };
90
+ type ProtocolEventRecord = {
91
+ readonly hostNodeId: string;
92
+ readonly eventName: string;
93
+ readonly syncPolicy?: ProtocolSyncPolicy;
94
+ readonly symbolIds: ReadonlyArray<string>;
95
+ readonly action?: ProtocolEventAction;
96
+ };
97
+ declare function protocolEventActionKind(record: Pick<ProtocolEventRecord, 'action'>): ProtocolEventActionKind;
98
+ declare function protocolEventDispatchesMarkless(record: Pick<ProtocolEventRecord, 'action'>): boolean;
99
+ type ProtocolStatePayload = {
100
+ readonly version: typeof ASYNC_PROTOCOL_VERSION | typeof STORAGE_PROTOCOL_VERSION;
101
+ readonly cells: ReadonlyArray<{
102
+ readonly graphNodeId: string;
103
+ readonly name: string;
104
+ readonly valueKind: 'scalar' | 'object' | 'array' | 'unknown';
105
+ readonly value?: unknown;
106
+ readonly directValue?: unknown;
107
+ }>;
108
+ readonly computed: ReadonlyArray<{
109
+ readonly graphNodeId: string;
110
+ readonly name: string;
111
+ readonly async: boolean;
112
+ readonly deriveSymbolId?: string;
113
+ readonly value?: unknown;
114
+ readonly directValue?: unknown;
115
+ readonly dependencies?: ReadonlyArray<{
116
+ readonly graphNodeId: string;
117
+ readonly path: ReadonlyArray<string>;
118
+ }>;
119
+ readonly snapshot?: {
120
+ readonly status: 'idle';
121
+ readonly version: 0;
122
+ } | {
123
+ readonly status: 'pending';
124
+ readonly version: number;
125
+ readonly key: unknown;
126
+ } | {
127
+ readonly status: 'fulfilled';
128
+ readonly version: number;
129
+ readonly key: unknown;
130
+ readonly value: unknown;
131
+ } | {
132
+ readonly status: 'rejected';
133
+ readonly version: number;
134
+ readonly key: unknown;
135
+ readonly error: unknown;
136
+ };
137
+ }>;
138
+ readonly sharedSeeds?: ReadonlyArray<{
139
+ readonly graphNodeId: string;
140
+ readonly deriveSymbolId: string;
141
+ readonly dependencies: ReadonlyArray<{
142
+ readonly graphNodeId: string;
143
+ readonly path: ReadonlyArray<string>;
144
+ readonly reads: {
145
+ readonly graphNodeId: string;
146
+ readonly path: ReadonlyArray<string>;
147
+ };
148
+ }>;
149
+ }>;
150
+ readonly sharedDefinitions?: ReadonlyArray<{
151
+ readonly id: string;
152
+ readonly name: string;
153
+ readonly exportedName: string;
154
+ readonly scope?: 'request' | 'container' | 'page' | 'widget';
155
+ readonly version: number;
156
+ readonly graphNodeIds: ReadonlyArray<string>;
157
+ readonly projectionIds?: ReadonlyArray<string>;
158
+ readonly dependencies?: ReadonlyArray<{
159
+ readonly definitionId: string;
160
+ readonly definitionName: string;
161
+ }>;
162
+ readonly returnProperties?: ReadonlyArray<{
163
+ readonly kind: 'graph';
164
+ readonly name: string;
165
+ readonly graphNodeId: string;
166
+ readonly path: ReadonlyArray<string>;
167
+ } | {
168
+ readonly kind: 'method';
169
+ readonly name: string;
170
+ }>;
171
+ }>;
172
+ readonly storage?: ReadonlyArray<{
173
+ readonly graphNodeId: string;
174
+ readonly key: string;
175
+ }>;
176
+ };
177
+ type ProtocolBranchContentRead = {
178
+ readonly graphNodeId: string;
179
+ readonly path: ReadonlyArray<string>;
180
+ readonly source: string;
181
+ };
182
+ /**
183
+ * One prop a composed part's own arm-update symbol can read: the name the part
184
+ * spells and the graph node the caller passed it. Only props with a live route
185
+ * are listed; a name missing from the table was passed statically, so the value
186
+ * the part mounted with is already its final one.
187
+ */
188
+ type ProtocolComposedGraphProp = {
189
+ readonly name: string;
190
+ readonly graphNodeId: string;
191
+ readonly path?: ReadonlyArray<string>;
192
+ };
193
+ /**
194
+ * The graph read id an arm-update symbol asks under for a minted element() id.
195
+ *
196
+ * A minted id is `idPrefix + handle` where the prefix is the rendered widget's
197
+ * instance token, a seed-map value no flip can reach. The render that served the
198
+ * arm resolves the id and files it on the branch record under this key; the
199
+ * symbol asks for it through the read channel it already has, so the mint keeps
200
+ * exactly one spelling. Resume matches the key as a SUFFIX of the id it is
201
+ * handed, because a composed symbol's reads arrive with the instance path
202
+ * prepended — that is why the key carries the namespace and not the bare handle.
203
+ */
204
+ declare function protocolElementHandleReadId(handleGraphNodeId: string): string;
205
+ /**
206
+ * One IDREF position naming a handle some branch arm binds. `armIndex` is the
207
+ * arm that binds it: the attribute is earned exactly while that arm is the
208
+ * painted one, which is the only test that also answers for an arm the render
209
+ * already served and no flip ever re-materializes. `handleReadId` is the same
210
+ * key the branch record's `elementHandleIds` uses.
211
+ */
212
+ type ProtocolBranchIdrefSite = {
213
+ readonly hostNodeId: string;
214
+ readonly attributeName: string;
215
+ readonly handleReadId: string;
216
+ readonly armIndex: number;
217
+ };
218
+ type ProtocolArmBranchRecord = {
219
+ readonly id: string;
220
+ readonly testReads: ReadonlyArray<{
221
+ readonly source: string;
222
+ readonly graphNodeId: string;
223
+ readonly path: ReadonlyArray<string>;
224
+ }>;
225
+ readonly contentReads?: ReadonlyArray<ProtocolBranchContentRead>;
226
+ readonly symbolId?: string;
227
+ readonly armTests?: ReadonlyArray<unknown>;
228
+ readonly declaredEmptyArms?: ReadonlyArray<number>;
229
+ readonly startAnchor?: {
230
+ readonly strategy: 'arm-branch-comment' | 'dom-order-comment';
231
+ readonly index: number;
232
+ };
233
+ readonly endAnchor?: {
234
+ readonly strategy: 'arm-branch-comment' | 'dom-order-comment';
235
+ readonly index: number;
236
+ };
237
+ readonly armRecords?: NonNullable<ProtocolViewPayload['branches']>[number]['armRecords'];
238
+ readonly composedInstancePath?: string;
239
+ readonly composedGraphProps?: ReadonlyArray<ProtocolComposedGraphProp>;
240
+ };
241
+ type ProtocolArmRecordSet = {
242
+ readonly locators: ReadonlyArray<{
243
+ readonly hostNodeId: string;
244
+ readonly index: number;
245
+ readonly tagName: string;
246
+ }>;
247
+ readonly events: ProtocolViewPayload['events'];
248
+ readonly domUpdates?: ProtocolViewPayload['domUpdates'];
249
+ readonly behaviors: ProtocolViewPayload['behaviors'];
250
+ readonly elementHandles: ProtocolViewPayload['elementHandles'];
251
+ readonly keyedRepeats?: ProtocolViewPayload['keyedRepeats'];
252
+ readonly branches?: ReadonlyArray<ProtocolArmBranchRecord>;
253
+ };
254
+ type ProtocolStreamedArmPatch = readonly [arm: ProtocolAsyncBoundaryArm, records: ProtocolArmRecordSet];
255
+ /**
256
+ * Where one row-template slot's value comes from: the repeated item, a graph
257
+ * node the page already holds, or an authored expression.
258
+ *
259
+ * Exactly one of the three. `itemPath` is a property path off the item the mint
260
+ * was handed. The `graphNodeId`/`graphPath` pair is a read of the page's own
261
+ * state - a row spelling `name={list.name}`. `source` is an authored expression
262
+ * - `\`Edit ${row.name}\``, `format(row.at)` - that the owning component's
263
+ * render-data reader answers for the row, under the same key the server render
264
+ * used; `reads` names the graph nodes outside the row it reads, omitted when none.
265
+ *
266
+ * A row rebuilds when any slot value moves: its item changed under its key, or a
267
+ * graph node a slot reads was written.
268
+ */
269
+ type ProtocolRowTemplateSlotValue = {
270
+ readonly itemPath: ReadonlyArray<string>;
271
+ } | {
272
+ readonly graphNodeId: string;
273
+ readonly graphPath: ReadonlyArray<string>;
274
+ } | {
275
+ readonly source: string;
276
+ readonly reads?: ReadonlyArray<{
277
+ readonly graphNodeId: string;
278
+ readonly path: ReadonlyArray<string>;
279
+ }>;
280
+ };
281
+ type ProtocolViewPayload = {
282
+ readonly version: typeof ASYNC_PROTOCOL_VERSION;
283
+ readonly asyncRunners?: Readonly<Record<string, string>>;
284
+ readonly locators: ReadonlyArray<{
285
+ readonly hostNodeId: string;
286
+ readonly strategy: 'dom-order';
287
+ readonly index: number;
288
+ readonly tagName: string;
289
+ }>;
290
+ readonly events: ReadonlyArray<ProtocolEventRecord>;
291
+ readonly domUpdates: ReadonlyArray<{
292
+ readonly hostNodeId: string;
293
+ readonly source: string;
294
+ readonly graphNodeId: string;
295
+ readonly path: ReadonlyArray<string>;
296
+ readonly target?: {
297
+ readonly kind: 'text';
298
+ readonly prefix?: string;
299
+ readonly suffix?: string;
300
+ readonly trueValue?: string;
301
+ readonly falseValue?: string;
302
+ /**
303
+ * The host's child-node position of the one text node this write owns,
304
+ * present only when the text shares its element with other children.
305
+ * Negative counts back from the end: -1 is the last child node.
306
+ */
307
+ readonly textNode?: number;
308
+ } | {
309
+ readonly kind: 'attribute';
310
+ readonly name: string;
311
+ } | {
312
+ readonly kind: 'property';
313
+ readonly name: string;
314
+ } | {
315
+ readonly kind: 'class';
316
+ readonly trueValue?: string;
317
+ readonly falseValue?: string;
318
+ /** Class names every write must keep — the module's style scope, which the runtime would otherwise overwrite. */
319
+ readonly constantClass?: string;
320
+ /** Class names every write keeps in front of the value — a part's own style scope, which its markup writes before the class its consumer handed it. */
321
+ readonly leadingClass?: string;
322
+ } | {
323
+ readonly kind: 'style';
324
+ };
325
+ readonly symbolId?: string;
326
+ }>;
327
+ readonly behaviors: ReadonlyArray<{
328
+ readonly hostNodeId: string;
329
+ readonly source: string;
330
+ readonly functionSource: string;
331
+ readonly inputSources: ReadonlyArray<string>;
332
+ readonly inputValues?: ReadonlyArray<unknown>;
333
+ readonly inputGraphReads?: ReadonlyArray<{
334
+ readonly inputIndex: number;
335
+ readonly source: string;
336
+ readonly graphNodeId: string;
337
+ readonly path: ReadonlyArray<string>;
338
+ }>;
339
+ readonly symbolId?: string;
340
+ /** The behavior reads or writes page state, so it runs against the page's graph. */
341
+ readonly usesGraph?: true;
342
+ }>;
343
+ readonly elementHandles: ReadonlyArray<{
344
+ readonly hostNodeId: string;
345
+ readonly handleId: string;
346
+ readonly name: string;
347
+ /** Declared `element<T[]>()`: this handle names an ordered set, and a read answers an array. */
348
+ readonly plural?: boolean;
349
+ }>;
350
+ readonly keyedRepeats?: ReadonlyArray<{
351
+ readonly id: string;
352
+ readonly parentHostNodeId: string;
353
+ /**
354
+ * Where the OWNER's own markup put the rows, when `parentHostNodeId` names
355
+ * an element the owner never wrote: a `@for` inside a child's `{children}`
356
+ * renders into the element that child wraps its hole in, so the parent above
357
+ * is the child's, and this is the host the projecting markup sat in. Only a
358
+ * reader that needs the owner's own id space reads it.
359
+ */
360
+ readonly ownerHostNodeId?: string;
361
+ /**
362
+ * The graph instance path of the component that AUTHORED this `@for`, as
363
+ * composition spells it (`c<n>:`/`p<n>:` segments, outermost first).
364
+ *
365
+ * A row key is only unique within one rendered repeat, and the repeat's own
366
+ * path is the only thing that tells two renderings of one `@for` apart: two
367
+ * family roots over ONE page-level collection read a collection node in page
368
+ * space, so a row keyed off the collection is spelled the same by both. The
369
+ * mint keys a minted row's segment on this plus the row key.
370
+ *
371
+ * Pay-per-use: a repeat the root module authored itself stands at no
372
+ * instance and omits the field, so its record is byte-identical to what it
373
+ * was before this existed. Only composition writes it.
374
+ */
375
+ readonly instancePath?: string;
376
+ /**
377
+ * Present on a `@for` written inside another `@for`'s row. Its rows render
378
+ * once per enclosing row, so the browser wires one instance of this record in
379
+ * each enclosing row. Its own parent has no single host, so `parentHostNodeId`
380
+ * names the outermost enclosing repeat's parent: whatever keeps or moves that
381
+ * repeat's record by host keeps or moves this one with it.
382
+ *
383
+ * `parentHostPath` walks from an enclosing row's root to this repeat's parent,
384
+ * ROW-ROOT-relative like `rowEvents[].hostPath`. `itemPath` is present when
385
+ * the collection is a path on the enclosing row's item (`group.items`); the
386
+ * collection then reads the outermost enclosing collection with a `'*'`
387
+ * segment for each enclosing row (`['*', 'items']`), which reads nothing on
388
+ * its own and which each instance replaces with its enclosing row's index.
389
+ * `repeatId` is spelled as the authoring module spells it: composition
390
+ * prefixes a record's `id` but not this, so it resolves under the record's
391
+ * own prefix.
392
+ *
393
+ * Pay-per-use: a repeat inside no other repeat omits the field.
394
+ */
395
+ readonly enclosingRow?: {
396
+ readonly repeatId: string;
397
+ readonly parentHostPath: ReadonlyArray<number>;
398
+ readonly itemPath?: ReadonlyArray<string>;
399
+ };
400
+ readonly collectionGraphNodeId?: string;
401
+ readonly collectionPath: ReadonlyArray<string>;
402
+ readonly keyPath: ReadonlyArray<string>;
403
+ /**
404
+ * `key i`: a row's key is its position, not a value read off the item.
405
+ * Pay-per-use: a repeat keyed by item data omits the field.
406
+ */
407
+ readonly indexKey?: true;
408
+ /**
409
+ * Rows written straight into an `@if`/`@switch` arm or an `@try`/`@pending`/
410
+ * `@catch` arm, with no element of the arm around them: they stand between
411
+ * that range's anchors, and only while `arm` is the one shown. `branchId` is
412
+ * the branch site or async boundary id as the authoring module spells it;
413
+ * composition prefixes it the way it prefixes this record's `id`.
414
+ */
415
+ readonly branchArm?: {
416
+ readonly branchId: string;
417
+ readonly arm: number;
418
+ };
419
+ readonly itemName: string;
420
+ readonly rowElementCount: number;
421
+ /**
422
+ * Element children of the parent that stand before the rows. Rows occupy
423
+ * `[rowStartOffset, rowStartOffset + items.length)` among the parent's child
424
+ * elements; a repeat whose rows begin at 0 omits the field. A repeat whose
425
+ * prefix has no compile-time element count says `rowEndOffset` instead, or
426
+ * ships no record at all when its suffix has none either.
427
+ */
428
+ readonly rowStartOffset?: number;
429
+ /**
430
+ * Element children of the parent that stand after the rows, set only when
431
+ * the prefix has no compile-time element count. Rows then occupy the
432
+ * `items.length` element children ending `rowEndOffset` before the last.
433
+ */
434
+ readonly rowEndOffset?: number;
435
+ /**
436
+ * The browser can never change these rows: the collection and every value a
437
+ * row shows are fixed once the page is served, so the record carries no row
438
+ * markup and resume neither follows the collection nor loads row-building
439
+ * code. Pay-per-use: a repeat whose rows can change omits the field.
440
+ */
441
+ readonly fixed?: true;
442
+ /**
443
+ * The `@empty` arm's finished markup, for the mint that raises it when the
444
+ * collection empties after resume and takes it back out when a row returns.
445
+ * Carried only for a repeat that HAS an `@empty` arm whose markup is fully
446
+ * static and whose elements no record names: everything else would need
447
+ * wiring the mint cannot do, so it ships nothing and the served behaviour
448
+ * stands. A repeat with no `@empty` arm omits the field entirely.
449
+ */
450
+ readonly emptyArm?: {
451
+ readonly html: string;
452
+ };
453
+ /**
454
+ * One row's compiled markup, for the mint that builds a row the server never
455
+ * rendered - an item appended to the collection after resume.
456
+ *
457
+ * `html` is the row chunk's statics joined, slot markers KEPT: the marker
458
+ * comments are where the row's own text lives, so the mint finds each text
459
+ * position by walking to it rather than by re-parsing. `textSlots` names
460
+ * those positions - `path` is FRAGMENT-relative (`[0]` is the row root),
461
+ * the value channel is `ProtocolRowTemplateSlotValue` - and is omitted
462
+ * when the row has none, which is the fully static row.
463
+ *
464
+ * `attributeSlots` names the row's dynamic attributes the same way, with the
465
+ * attribute `name` to write and a `path` addressing the ELEMENT that carries
466
+ * it. The attribute's value is not in the html at all: the statics join
467
+ * around it, and the mint writes it under the presence rule every other
468
+ * render path uses (absent for null, undefined and false).
469
+ *
470
+ * Carried only for a row the client can finish alone: static markup, or
471
+ * markup whose every slot - text or attribute - reads off the repeated item,
472
+ * off the items of the rows enclosing it, off a graph node the page already
473
+ * holds, or off an authored expression over those and the owning
474
+ * component's props (a `source` slot, `class` and `style` included; the
475
+ * html keeps a slot attribute's static part, such as the scope class). A row
476
+ * holding anything else - an element handle's id, a value only the render
477
+ * produces, a nested construct - needs wiring the mint cannot do, so it
478
+ * ships nothing and the served behaviour stands. One child component is the exception: a
479
+ * row element wrapping one is markup here plus identity in `rowComponent`,
480
+ * whose `slotPath` names the marker in this html the child's rendered nodes
481
+ * replace.
482
+ *
483
+ * Pay-per-use: a repeat whose row is not mintable emits no field at all, so
484
+ * its record is byte-identical to what it was before this existed, and a row
485
+ * with no dynamic attributes omits `attributeSlots` for the same reason.
486
+ */
487
+ readonly rowTemplate?: {
488
+ readonly html: string;
489
+ /** The component whose render-data reader answers `source` slots; present exactly when one is. */
490
+ readonly componentName?: string;
491
+ readonly textSlots?: ReadonlyArray<{
492
+ readonly path: ReadonlyArray<number>;
493
+ } & ProtocolRowTemplateSlotValue>;
494
+ readonly attributeSlots?: ReadonlyArray<{
495
+ readonly path: ReadonlyArray<number>;
496
+ readonly name: string;
497
+ } & ProtocolRowTemplateSlotValue>;
498
+ };
499
+ /**
500
+ * The parent graph node each prop a `rowTemplate` source slot reads follows,
501
+ * by prop name. The owning component's reader reads a prop under the
502
+ * child's own id, which holds the served value; the row reads the node the
503
+ * parent passed instead. Only composition writes it, and only for a prop
504
+ * passed as a live graph reference.
505
+ *
506
+ * Pay-per-use: a row reading no routed prop omits the field.
507
+ */
508
+ readonly propRoutes?: ReadonlyArray<{
509
+ readonly name: string;
510
+ readonly graphNodeId: string;
511
+ readonly path: ReadonlyArray<string>;
512
+ }>;
513
+ /**
514
+ * The component a row of this repeat roots, named by identity alone.
515
+ *
516
+ * A child component cannot ship markup the way `rowTemplate` does: it has a
517
+ * graph, not a template, and one instance per rendered row. So this carries
518
+ * identifiers and nothing else - the client builds the row by running the
519
+ * same one-edge render the server ran, under ids qualified by the row's key.
520
+ *
521
+ * `componentName` is the component that OWNS the edge (the one whose markup
522
+ * holds the `@for`), not the child: the child's name already rides on the
523
+ * edge. `itemPropName` is the prop the row's item crosses under, carried
524
+ * only when exactly one prop is the bare `@for` binding.
525
+ *
526
+ * `slotPath` appears when a row ELEMENT wraps the component rather than the
527
+ * row being the component. The wrapper's markup then rides in `rowTemplate`,
528
+ * and this FRAGMENT-relative path (`[0]` is the row root) names the marker
529
+ * comment inside it that the child's rendered nodes replace. Its absence is
530
+ * the row that IS the component, which has no wrapper and ships no
531
+ * `rowTemplate` - the shape this field had before wrappers were minted, so
532
+ * such a record stays byte-identical.
533
+ *
534
+ * Carried only for a key-identified repeat whose row start is known and
535
+ * whose child is declared in the same module; anything else is refused, so
536
+ * the served behaviour stands and the record is byte-identical.
537
+ *
538
+ * `rowChunkId` replaces `componentEdgeId` for a row whose markup an @if or
539
+ * @switch over the row item picks: the client renders that owner chunk
540
+ * whole, the way the server did, instead of one edge.
541
+ */
542
+ readonly rowComponent?: {
543
+ readonly componentEdgeId?: string;
544
+ readonly componentName: string;
545
+ readonly itemPropName?: string;
546
+ readonly slotPath?: ReadonlyArray<number>;
547
+ readonly rowChunkId?: string;
548
+ };
549
+ readonly rowElementHandles?: ReadonlyArray<{
550
+ readonly hostPath: ReadonlyArray<number>;
551
+ readonly handleId: string;
552
+ readonly name: string;
553
+ readonly plural?: boolean;
554
+ }>;
555
+ readonly rowEvents: ReadonlyArray<{
556
+ readonly hostPath: ReadonlyArray<number>;
557
+ readonly eventName: string;
558
+ readonly symbolIds: ReadonlyArray<string>;
559
+ readonly syncPolicy?: ProtocolSyncPolicy;
560
+ }>;
561
+ }>;
562
+ readonly branches?: ReadonlyArray<{
563
+ readonly id: string;
564
+ readonly startAnchor: {
565
+ readonly strategy: 'dom-order-comment';
566
+ readonly index: number;
567
+ };
568
+ readonly endAnchor: {
569
+ readonly strategy: 'dom-order-comment';
570
+ readonly index: number;
571
+ };
572
+ readonly symbolId?: string;
573
+ readonly armTests?: ReadonlyArray<unknown>;
574
+ readonly armRecords?: ReadonlyArray<{
575
+ readonly events: ReadonlyArray<{
576
+ readonly hostPath: ReadonlyArray<number>;
577
+ readonly eventName: string;
578
+ readonly symbolIds: ReadonlyArray<string>;
579
+ readonly syncPolicy?: ProtocolSyncPolicy;
580
+ readonly action?: ProtocolEventAction;
581
+ }>;
582
+ readonly domUpdates: ReadonlyArray<Record<string, unknown>>;
583
+ readonly behaviors: ReadonlyArray<Record<string, unknown>>;
584
+ readonly elementHandles: ReadonlyArray<Record<string, unknown>>;
585
+ }>;
586
+ readonly testReads?: ReadonlyArray<{
587
+ readonly source: string;
588
+ readonly graphNodeId: string;
589
+ readonly path: ReadonlyArray<string>;
590
+ }>;
591
+ /**
592
+ * Reads an arm renders with no element of its own to bind to. Writing one
593
+ * through an element update would erase both arms' markers, so these
594
+ * refresh the arm's own marker range through the branch's update symbol.
595
+ */
596
+ readonly contentReads?: ReadonlyArray<ProtocolBranchContentRead>;
597
+ /**
598
+ * Marks a branch whose arms hold a component that has to run, so a flip
599
+ * re-renders the page through the prerender evaluator instead of rebuilding
600
+ * markup from `armRecords`. Absent on every branch the compiler could build
601
+ * arm parts for, which keeps those payloads byte-identical.
602
+ */
603
+ readonly escalates?: true;
604
+ /**
605
+ * Arm-relative records for the arm THIS render served, moved out of the
606
+ * page-absolute streams. Only an escalating branch carries one; `armRecords`
607
+ * above stays the compiler's per-arm plan for every other branch.
608
+ */
609
+ readonly servedArmRecords?: ProtocolArmRecordSet;
610
+ /**
611
+ * The instance path of the part that authored this branch, present on
612
+ * every branch that travelled through composition and absent on every
613
+ * branch that did not. An arm's own update symbol reads the part-local
614
+ * prop ids its module spells, and only the two fields here say which
615
+ * instance it is running as and where its props now live: the record's
616
+ * `testReads`/`contentReads` were rewritten to the caller's nodes, but
617
+ * the symbol's own read has no other route.
618
+ */
619
+ readonly composedInstancePath?: string;
620
+ readonly composedGraphProps?: ReadonlyArray<ProtocolComposedGraphProp>;
621
+ /**
622
+ * Minted element() ids for the handles this branch's arms bind, resolved by
623
+ * the render that served the branch. The token they were minted from is a
624
+ * seed-map value, so a flip has no second way to spell them. Keyed by
625
+ * `protocolElementHandleReadId`, the whole read id the arm symbol asks
626
+ * under, so the resume side answers by matching a key it was handed rather
627
+ * than re-deriving the namespace. Absent on every branch whose arms bind no
628
+ * handle an IDREF names, which keeps those payloads byte-identical.
629
+ */
630
+ readonly elementHandleIds?: Readonly<Record<string, string>>;
631
+ /**
632
+ * IDREF positions OUTSIDE the arms that name a handle an arm binds. The
633
+ * element they sit on outlives the flip, so the attribute is written when
634
+ * the arm files its handle and removed when the arm takes it away, rather
635
+ * than served naming an element that is not there.
636
+ */
637
+ readonly idrefSites?: ReadonlyArray<ProtocolBranchIdrefSite>;
638
+ }>;
639
+ readonly asyncBoundaries: ReadonlyArray<{
640
+ readonly id: string;
641
+ readonly runnerGraphNodeId: string | null;
642
+ readonly initiallyServedArm: ProtocolAsyncBoundaryArm;
643
+ readonly updateSymbolId?: string;
644
+ readonly armRecords?: ProtocolArmRecordSet | ReadonlyArray<ProtocolArmRecordSet>;
645
+ readonly startAnchor: {
646
+ readonly strategy: 'dom-order-comment';
647
+ readonly index: number;
648
+ };
649
+ readonly endAnchor: {
650
+ readonly strategy: 'dom-order-comment';
651
+ readonly index: number;
652
+ };
653
+ readonly asyncReads: ReadonlyArray<{
654
+ readonly source: string;
655
+ readonly graphNodeId: string;
656
+ readonly path: ReadonlyArray<string>;
657
+ readonly runnerSymbolId?: string;
658
+ }>;
659
+ }>;
660
+ };
661
+ type ProtocolPayloadScripts = {
662
+ readonly state: ProtocolStatePayload;
663
+ readonly view: ProtocolViewPayload;
664
+ readonly stateScript: string;
665
+ readonly viewScript: string;
666
+ };
667
+ //#endregion
668
+ export { protocolRowSegment as A, ASYNC_BOUNDARY_ARM as B, PROTOCOL_PAGE_SPACE_ID_PREFIXES as C, protocolInstanceQualifies as D, protocolInstancePath as E, PROTOCOL_CONTAINER_HOST_NODE_ID as F, PROTOCOL_CONTAINER_START_COMMENT as I, PROTOCOL_LOCATOR_PATHS_ATTRIBUTE as L, PROTOCOL_PROP_GRAPH_NODE_PREFIX as M, PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE as N, protocolInstanceSegment as O, PROTOCOL_CONTAINER_END_COMMENT as P, PROTOCOL_IDLE_EVENT_NAME as R, PROTOCOL_EVENT_ACTION_KIND as S, STORAGE_PROTOCOL_VERSION as T, ProtocolViewPayload as _, ProtocolBranchIdrefSite as a, protocolEventDispatchesMarkless as b, ProtocolEventActionKind as c, ProtocolRowTemplateSlotValue as d, ProtocolStatePayload as f, ProtocolSyncPolicyCondition as g, ProtocolSyncPolicyBranch as h, ProtocolBranchContentRead as i, protocolStateVersion as j, protocolProjectionSegment as k, ProtocolEventRecord as l, ProtocolSyncPolicy as m, ProtocolArmRecordSet as n, ProtocolComposedGraphProp as o, ProtocolStreamedArmPatch as p, ProtocolAsyncBoundaryArm as r, ProtocolEventAction as s, ProtocolArmBranchRecord as t, ProtocolPayloadScripts as u, protocolElementHandleReadId as v, PROTOCOL_PROPS_GRAPH_NODE_ID as w, ASYNC_PROTOCOL_VERSION as x, protocolEventActionKind as y, PROTOCOL_VISIBLE_EVENT_NAME as z };
@@ -1,5 +1,4 @@
1
- import { c as ProtocolStatePayload, p as ProtocolViewPayload } from "./protocol-CGsMO85z.js";
2
-
1
+ import { _ as ProtocolViewPayload, f as ProtocolStatePayload } from "./protocol-BNO5JLsK.js";
3
2
  //#region src/protocol-validation.d.ts
4
3
  type EncodedPayloadScripts = {
5
4
  readonly stateScript: string;