@vmz/core 0.2.5 → 0.2.6

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 (77) hide show
  1. package/dist/browser/client-nav.d.ts +5 -55
  2. package/dist/browser/client-nav.js +5 -769
  3. package/dist/browser/diagnostics/precision-trace.d.ts +47 -0
  4. package/dist/browser/diagnostics/precision-trace.js +86 -0
  5. package/dist/browser/dom/attributes.d.ts +5 -0
  6. package/dist/browser/dom/attributes.js +102 -0
  7. package/dist/browser/dom/component.d.ts +11 -0
  8. package/dist/browser/dom/component.js +255 -0
  9. package/dist/browser/dom/direct-api.d.ts +66 -0
  10. package/dist/browser/dom/direct-api.js +446 -0
  11. package/dist/browser/dom/lifecycle.d.ts +9 -0
  12. package/dist/browser/dom/lifecycle.js +161 -0
  13. package/dist/browser/dom/registry.d.ts +5 -0
  14. package/dist/browser/dom/registry.js +16 -0
  15. package/dist/browser/dom-core.d.ts +51 -249
  16. package/dist/browser/dom-core.js +51 -2521
  17. package/dist/browser/navigation/client-navigation.d.ts +44 -0
  18. package/dist/browser/navigation/client-navigation.js +277 -0
  19. package/dist/browser/navigation/extract-html.d.ts +1 -0
  20. package/dist/browser/navigation/extract-html.js +5 -0
  21. package/dist/browser/navigation/layout-retain.d.ts +3 -0
  22. package/dist/browser/navigation/layout-retain.js +34 -0
  23. package/dist/browser/navigation/locale-transition.d.ts +24 -0
  24. package/dist/browser/navigation/locale-transition.js +323 -0
  25. package/dist/browser/navigation/scroll-focus.d.ts +14 -0
  26. package/dist/browser/navigation/scroll-focus.js +87 -0
  27. package/dist/browser/reactivity/patch-scheduler.d.ts +12 -0
  28. package/dist/browser/reactivity/patch-scheduler.js +720 -0
  29. package/dist/browser/reactivity/write-barrier.d.ts +16 -0
  30. package/dist/browser/reactivity/write-barrier.js +546 -0
  31. package/dist/browser/resume/adopt.d.ts +1 -0
  32. package/dist/browser/resume/adopt.js +168 -0
  33. package/dist/browser/resume/hydrate.d.ts +4 -0
  34. package/dist/browser/resume/hydrate.js +107 -0
  35. package/dist/browser/resume/resume.d.ts +3 -0
  36. package/dist/browser/resume/resume.js +102 -0
  37. package/dist/faces/dom.browser.d.ts +2 -1
  38. package/dist/faces/dom.browser.js +2 -1
  39. package/dist/host/{deployment-registry.d.ts → deployment/deployment-registry.d.ts} +1 -1
  40. package/dist/host/{deployment-registry.js → deployment/deployment-registry.js} +1 -1
  41. package/dist/host/list-client-components.d.ts +2 -2
  42. package/dist/host/list-client-components.js +4 -4
  43. package/dist/host/{render-host.d.ts → render/render-host.d.ts} +2 -2
  44. package/dist/host/{render-host.js → render/render-host.js} +1 -1
  45. package/dist/host/{route-layout-chain.js → render/route-layout-chain.js} +1 -1
  46. package/dist/host/serve/bootstrap.d.ts +1 -0
  47. package/dist/host/serve/bootstrap.js +25 -0
  48. package/dist/host/serve/constants.d.ts +6 -0
  49. package/dist/host/serve/constants.js +6 -0
  50. package/dist/host/serve/hmr-dev.d.ts +34 -0
  51. package/dist/host/serve/hmr-dev.js +294 -0
  52. package/dist/host/serve/http.d.ts +1 -0
  53. package/dist/host/serve/http.js +124 -0
  54. package/dist/host/serve/locale-theme.d.ts +19 -0
  55. package/dist/host/serve/locale-theme.js +169 -0
  56. package/dist/host/serve/page-catalog.d.ts +14 -0
  57. package/dist/host/serve/page-catalog.js +105 -0
  58. package/dist/host/serve/page-render.d.ts +17 -0
  59. package/dist/host/serve/page-render.js +419 -0
  60. package/dist/host/serve/paths.d.ts +3 -0
  61. package/dist/host/serve/paths.js +74 -0
  62. package/dist/host/serve/route-catalog.d.ts +6 -0
  63. package/dist/host/serve/route-catalog.js +108 -0
  64. package/dist/host/serve/state.d.ts +30 -0
  65. package/dist/host/serve/state.js +36 -0
  66. package/dist/host/serve-host.d.ts +0 -17
  67. package/dist/host/serve-host.mjs +4 -1420
  68. package/dist/ssr/document.d.ts +2 -0
  69. package/dist/ssr/document.js +71 -0
  70. package/dist/ssr/dom-ssr.d.ts +10 -47
  71. package/dist/ssr/dom-ssr.js +10 -1284
  72. package/dist/ssr/render.d.ts +2 -0
  73. package/dist/ssr/render.js +78 -0
  74. package/dist/ssr/serialize.d.ts +3 -0
  75. package/dist/ssr/serialize.js +678 -0
  76. package/package.json +11 -11
  77. /package/dist/host/{route-layout-chain.d.ts → render/route-layout-chain.d.ts} +0 -0
@@ -1,252 +1,54 @@
1
- /**
2
- * VMZ DOM client runtime ??precise patches, no VDOM diff (SSR lives in dom-ssr).
3
- *
4
- *
5
- * Direct components expose `__vmzCreate` / `__vmzSerialize` / `__vmzPlan`.
6
- * Mount and client patches run that same schedule (SSR/hydrate/resume in dom-ssr).
7
- * Field writes only run registered dep patches ??never re-create structure.
8
- */
9
- import type { BindingId, DirectInstance, PatchFn } from './direct-api.types.js';
10
- import type { ComponentCtor, EachCtx, ResumeAdoptCtx } from './dom-core.types.js';
1
+ /** Browser DOM runtime barrel. */
11
2
  export { mergeClassParts, mergeStyleParts } from '../shared/dom-attr-normalize.js';
12
3
  export { applyDirectHostBox, INLINE_HOST_CONTENTS, resolveDirectHostBox } from './direct-host-box.js';
13
4
  export { createUnknownComponentElement, markUnknownComponentHost, serializeUnknownComponentNode, UNKNOWN_COMPONENT_ERROR, } from './unknown-component.js';
14
- export declare function __vmzPrecisionEnable(on?: boolean): void;
15
- export declare function __vmzTraceEnable(on?: boolean): void;
16
- export declare function __vmzPrecisionReset(): void;
17
- export declare function __vmzTraceReset(): void;
18
- /**
19
- * StableId event snapshot (`vmz.dx.trace.v0` shape without schema stamp ?? * host may wrap via ingestRuntimeTrace).
20
- */
21
- export declare function __vmzTraceSnapshot(): {
22
- schema: string;
23
- events: {
24
- stableId: {
25
- kind: string;
26
- id: string;
27
- };
28
- kind: string;
29
- dep?: string;
30
- t?: number;
31
- chunkId?: string | null;
32
- }[];
33
- status: string;
34
- };
35
- export declare function __vmzPrecisionSnapshot(): {
36
- enabled: boolean;
37
- writes: number;
38
- bindingEvals: number;
39
- patchExecs: number;
40
- domCreates: number;
41
- domMoves: number;
42
- domRemoves: number;
43
- componentExecs: number;
44
- writesByRoot: {
45
- [x: string]: number;
46
- };
47
- bindingEvalsByDep: {
48
- [x: string]: number;
49
- };
50
- patchesByDep: {
51
- [x: string]: number;
52
- };
53
- bindingEvalsByBinding: {
54
- [x: string]: number;
55
- };
56
- patchesByBinding: {
57
- [x: string]: number;
58
- };
59
- };
60
- export declare function noteDomCreate(): void;
61
- export declare function registerComponents(map: any): void;
62
- export declare function getRegisteredComponent(name: any): ComponentCtor;
63
- /**
64
- * Lazy component loader for EventEntry mixed packs (set by entry-client / entry-event).
65
- */
66
- export declare function resolveComponent(name: any): Promise<ComponentCtor>;
67
- /**
68
- * Mount once; later updates are dep patches only (never re-run structure).
69
- * Requires compiler `__vmzCreate` (production Direct emit ??no blueprint fallback).
70
- */
71
- export declare function mount(Component: any, container: any, props?: any): Promise<any>;
72
- /**
73
- * Nested Direct `component` schedules child onMount asynchronously; drain before return
74
- * so SSR/hydrate callers see post-mount DOM (e.g. UserCard Ada, not Loading??.
75
- */
76
- export declare function settlePendingChildMounts(inst: any): Promise<void>;
77
- export declare function runDirectCreate(Component: any, inst: any): any;
78
- /**
79
- * First default `<slot>` owned by this component tree ??skip nested `[data-vmz]`
80
- * hosts (Button/Link/Empty label slots). `querySelector('slot')` steals those and
81
- * projects parent siblings into the wrong host (commercial Drawer into Create btn).
82
- */
83
- export declare function findOwnedDefaultSlot(root: any): any;
84
- /** Button/Link shell when `<slot>` is absent (SSR-flattened or resume adopt). */
85
- export declare function findOwnedDefaultSlotTarget(root: any): any;
86
- export declare const directApi: {
87
- _inst: DirectInstance | null;
88
- _branchBinds: Array<{
89
- deps: string[];
90
- fn: PatchFn;
91
- bindingId?: BindingId;
92
- }> | null;
93
- _itemPatches: PatchFn[] | null;
94
- _eachCtx: EachCtx | null;
95
- _resumeAdopt: ResumeAdoptCtx | null;
96
- el(tag: any): any;
97
- elNS(ns: any, tag: any): Element;
98
- text(value: any): Text;
99
- adoptEnter(node: any): boolean;
100
- adoptLeave(): void;
101
- frag(): DocumentFragment;
102
- comment(value: any): Comment;
103
- insertBefore(parent: any, node: any, ref: any): void;
104
- removeNode(node: any): void;
105
- /**
106
- * Register a generated per-binding patch (0.2.0). No generic get/cf interpreter.
107
- */
108
- trackPatch(inst: any, deps: any, patch: any, bindingId?: any): void;
109
- untrackPatch(inst: any, deps: any, patch: any, bindingId?: any): void;
110
- disposeTree(root: any): void;
111
- attr(el: any, name: any, value: any): void;
112
- mergeClass(...parts: any[]): string;
113
- mergeStyle(...parts: any[]): string;
114
- on(el: any, type: any, handler: any): void;
115
- /**
116
- * Bind a named instance method (no arrow / Function#toString).
117
- * Learns `skipFlush` after a sync invocation that schedules no dirty work
118
- * (stride / transpose self-apply DOM).
119
- */
120
- onMethod(el: any, type: any, methodName: any, opts: any): void;
121
- /**
122
- * Specialized single-field attr bind (0.1.29): compile-time field name, no generic get closure in artifact.
123
- */
124
- specFieldAttr(inst: any, bindingId: any, fieldName: any, el: any, name: any): void;
125
- /**
126
- * Specialized single-field text bind (0.1.29): compile-time field name in generated artifact.
127
- */
128
- specFieldText(inst: any, bindingId: any, fieldName: any, textNode: any): void;
129
- setHtml(el: any, value: any): void;
130
- bindHtml(inst: any, bindingId: any, deps: any, get: any, el: any): void;
131
- /**
132
- * Nested component (sync Direct child or island schedule).
133
- */
134
- component(hostInst: any, nameOrCtor: any, props: any, client: any): any;
135
- /**
136
- * Subscribe to a child component event (`@submit` ??event name `submit`).
137
- * Orthogonal to function props (`:on-submit` ??prop `onSubmit`).
138
- */
139
- onComponentEvent(hostEl: any, eventName: any, handler: any): void;
140
- /**
141
- * Keep nested Direct child props live with parent field writes.
142
- */
143
- bindComponentProp(hostInst: any, hostEl: any, propName: any, deps: any, get: any): void;
144
- /**
145
- * Project parent children into nested Direct component default `<slot>`.
146
- * Uses {@link findOwnedDefaultSlot} so nested Button/Link slots are not stolen.
147
- */
148
- projectDefaultSlot(hostEl: any, node: any): void;
149
- };
150
- /**
151
- * Function prop wire: only `onXxx` camelCase is a handler prop.
152
- * Component `@event` must never normalize here ??that channel is `onComponentEvent`.
153
- */
154
- export declare function eventPropHandlerName(name: any): string;
155
- /**
156
- * Dispatch a component event to parent subscribers registered via `onComponentEvent`.
157
- * Installed on every Direct instance as `inst.emit`.
158
- */
159
- export declare function emitComponentEvent(inst: any, eventName: any, ...payload: any[]): void;
160
- export declare function isEventPropName(name: any): boolean;
161
- export declare const BOOLEAN_HTML_ATTRS: Set<string>;
162
- export declare function applyDomAttr(el: any, name: any, value: any): void;
163
- export declare function stripFns(obj: any): {};
164
- /**
165
- * Snapshot plain state/prop field values for Island HMR (session).
166
- */
167
- export declare function snapshotInstanceState(inst: any): {};
168
- export declare function applyPreservedState(inst: any, state: any): void;
169
- /**
170
- * Tear down binders and stop patches. Safe to call more than once.
171
- * Field writes after destroy no longer update DOM (values may still change).
172
- *: also dispose owned DOM trees (child __vmzInst / region __vmzDispose).
173
- */
174
- export declare function destroy(inst: any): void;
175
- /**
176
- *: walk a DOM subtree and run lifetime dispose hooks + nested instance destroy.
177
- * Does not mark the *calling* parent destroyed; safe from destroy(inst).
178
- */
179
- export declare function disposeDomTree(root: any): void;
180
- export declare function scheduleClient(strategy: any, fn: any): void;
181
- export declare function isEventEntryStrategy(strategy: any): boolean;
182
- export declare function scheduleClientOn(el: any, strategy: any, fn: any): void;
183
- /**
184
- * AsyncTask cancel protocol (first slice): keyed generation + AbortSignal.
185
- * Superseded runs and `destroy(inst)` abort prior work; stale results must not apply.
186
- */
187
- export declare function __vmzRunTask(inst: any, key: any, fn: any): Promise<any>;
188
- export declare function __vmzCancelTasks(inst: any): void;
189
- export declare function __vmzTaskStatus(inst: any, key: any): any;
190
- export declare function createInstance(Component: any, props?: any): any;
191
- /**
192
- * Mark a plain object as intentionally shared across ownership boundaries.
193
- */
194
- export declare function __vmzAllowShared(value: any): any;
195
- /**
196
- * Take exclusive ownership intent: clear multi-owner registry for this object.
197
- * Subsequent field assigns re-register from the assigning instance only.
198
- */
199
- export declare function __vmzTakeShared(value: any): any;
200
- export declare function __vmzSharedCrossComponentDiagnostics(): any[];
201
- export declare function __vmzSharedCrossComponentDiagnosticsReset(): void;
202
- /**
203
- * Read a nested path under a field root (for compound / update expansion).
204
- */
205
- export declare function __vmzReadPath(inst: any, root: any, segs: any): any;
206
- /**
207
- * Short-circuit logical path assign (`||=` / `&&=` / `??=`).
208
- */
209
- export declare function __vmzWritePathLogical(inst: any, root: any, segs: any, kind: any, rhs: any): any;
210
- export declare function __vmzWritePath(inst: any, root: any, segs: any, value: any): any;
211
- /**
212
- * Array-item leaf write without segs array alloc (`rows[i].label = v`).
213
- */
214
- export declare function __vmzWritePathItem(inst: any, root: any, idx: any, leaf: any, value: any): any;
215
- /**
216
- * In-place two-index swap on an owned list field (WriteBarrier Slice 5).
217
- * Prefers eachBlock O(1) DOM transpose hook; otherwise schedules a list replace.
218
- */
219
- export declare function __vmzListTranspose(inst: any, root: any, ia: any, ib: any): void;
220
- /**
221
- * Compound leaf write (`rows[i].label += x`) ??one item touch, no separate ReadPath.
222
- */
223
- export declare function __vmzWritePathCompound(inst: any, root: any, segs: any, op: any, rhs: any): any;
224
- /**
225
- * Array-item compound without segs array alloc (`rows[i].label += x`).
226
- */
227
- export declare function __vmzWritePathCompoundItem(inst: any, root: any, idx: any, leaf: any, op: any, rhs: any): any;
228
- /**
229
- * Stride compound over an owned array (`for (i=start; i<n; i+=step) arr[i].leaf op= rhs`).
230
- * Mutates + applies DOM in one pass when eachBlock leaf hook is installed (update-every-Nth).
231
- */
232
- export declare function __vmzArrayItemCompoundStride(inst: any, root: any, leaf: any, op: any, rhs: any, start: any, step: any): void;
233
- /**
234
- * Compiler-inserted array mutator barrier (push/pop/splice/??.
235
- * Applies the mutator on the plain array and schedules a structural notice
236
- * at `root` + `baseSegs` (empty baseSegs ??field replace).
237
- *
238
- */
239
- export declare function __vmzArrayMutate(inst: any, root: any, baseSegs: any, method: any, args: any): any;
240
- /**
241
- * WriteBarrier: true when value is an owned plain object with path barriers (no Proxy).
242
- */
243
- export declare function __vmzIsWriteBarrierOwned(value: any): boolean;
244
- /**
245
- * True when value is the Proxy wrapper from array (or residual) reactive wrap.
246
- */
247
- export declare function __vmzIsReactiveProxy(value: any): boolean;
248
- export declare function flushPending(inst: any): any;
249
- /**
250
- * True when the container already has meaningful DOM (SSR / resume shell).
251
- */
252
- export declare function hasMeaningfulChild(el: any): boolean;
5
+ export { __vmzPrecisionEnable } from './diagnostics/precision-trace.js';
6
+ export { __vmzTraceEnable } from './diagnostics/precision-trace.js';
7
+ export { __vmzPrecisionReset } from './diagnostics/precision-trace.js';
8
+ export { __vmzTraceReset } from './diagnostics/precision-trace.js';
9
+ export { __vmzTraceSnapshot } from './diagnostics/precision-trace.js';
10
+ export { __vmzPrecisionSnapshot } from './diagnostics/precision-trace.js';
11
+ export { registerComponents } from './dom/registry.js';
12
+ export { getRegisteredComponent } from './dom/registry.js';
13
+ export { resolveComponent } from './dom/registry.js';
14
+ export { mount } from './dom/component.js';
15
+ export { settlePendingChildMounts } from './dom/component.js';
16
+ export { runDirectCreate } from './dom/component.js';
17
+ export { findOwnedDefaultSlot } from './dom/component.js';
18
+ export { findOwnedDefaultSlotTarget } from './dom/component.js';
19
+ export { createInstance } from './dom/component.js';
20
+ export { destroy } from './dom/component.js';
21
+ export { disposeDomTree } from './dom/component.js';
22
+ export { snapshotInstanceState } from './dom/component.js';
23
+ export { applyPreservedState } from './dom/component.js';
24
+ export { stripFns } from './dom/component.js';
25
+ export { BOOLEAN_HTML_ATTRS } from './dom/attributes.js';
26
+ export { applyDomAttr } from './dom/attributes.js';
27
+ export { eventPropHandlerName } from './dom/attributes.js';
28
+ export { emitComponentEvent } from './dom/attributes.js';
29
+ export { isEventPropName } from './dom/attributes.js';
30
+ export { noteDomCreate } from './dom/lifecycle.js';
31
+ export { scheduleClient } from './dom/lifecycle.js';
32
+ export { isEventEntryStrategy } from './dom/lifecycle.js';
33
+ export { scheduleClientOn } from './dom/lifecycle.js';
34
+ export { __vmzRunTask } from './dom/lifecycle.js';
35
+ export { __vmzCancelTasks } from './dom/lifecycle.js';
36
+ export { __vmzTaskStatus } from './dom/lifecycle.js';
37
+ export { directApi } from './dom/direct-api.js';
38
+ export { __vmzAllowShared } from './reactivity/write-barrier.js';
39
+ export { __vmzTakeShared } from './reactivity/write-barrier.js';
40
+ export { __vmzSharedCrossComponentDiagnostics } from './reactivity/write-barrier.js';
41
+ export { __vmzSharedCrossComponentDiagnosticsReset } from './reactivity/write-barrier.js';
42
+ export { __vmzReadPath } from './reactivity/write-barrier.js';
43
+ export { __vmzWritePathLogical } from './reactivity/write-barrier.js';
44
+ export { __vmzWritePath } from './reactivity/write-barrier.js';
45
+ export { __vmzWritePathItem } from './reactivity/write-barrier.js';
46
+ export { __vmzListTranspose } from './reactivity/write-barrier.js';
47
+ export { __vmzWritePathCompound } from './reactivity/write-barrier.js';
48
+ export { __vmzWritePathCompoundItem } from './reactivity/write-barrier.js';
49
+ export { __vmzArrayItemCompoundStride } from './reactivity/write-barrier.js';
50
+ export { __vmzArrayMutate } from './reactivity/write-barrier.js';
51
+ export { __vmzIsWriteBarrierOwned } from './reactivity/write-barrier.js';
52
+ export { __vmzIsReactiveProxy } from './reactivity/write-barrier.js';
53
+ export { flushPending } from './reactivity/patch-scheduler.js';
54
+ export { hasMeaningfulChild } from './reactivity/patch-scheduler.js';