@affectively/aeon-pages 1.3.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.
- package/CHANGELOG.md +112 -0
- package/README.md +625 -0
- package/examples/basic/aeon.config.ts +39 -0
- package/examples/basic/components/Cursor.tsx +86 -0
- package/examples/basic/components/OfflineIndicator.tsx +103 -0
- package/examples/basic/components/PresenceBar.tsx +77 -0
- package/examples/basic/package.json +20 -0
- package/examples/basic/pages/index.tsx +80 -0
- package/package.json +101 -0
- package/packages/analytics/README.md +309 -0
- package/packages/analytics/build.ts +35 -0
- package/packages/analytics/package.json +50 -0
- package/packages/analytics/src/click-tracker.ts +368 -0
- package/packages/analytics/src/context-bridge.ts +319 -0
- package/packages/analytics/src/data-layer.ts +302 -0
- package/packages/analytics/src/gtm-loader.ts +239 -0
- package/packages/analytics/src/index.ts +230 -0
- package/packages/analytics/src/merkle-tree.ts +489 -0
- package/packages/analytics/src/provider.tsx +300 -0
- package/packages/analytics/src/types.ts +320 -0
- package/packages/analytics/src/use-analytics.ts +296 -0
- package/packages/analytics/tsconfig.json +19 -0
- package/packages/benchmarks/src/benchmark.test.ts +691 -0
- package/packages/cli/dist/index.js +61899 -0
- package/packages/cli/package.json +43 -0
- package/packages/cli/src/commands/build.test.ts +682 -0
- package/packages/cli/src/commands/build.ts +890 -0
- package/packages/cli/src/commands/dev.ts +473 -0
- package/packages/cli/src/commands/init.ts +409 -0
- package/packages/cli/src/commands/start.ts +297 -0
- package/packages/cli/src/index.ts +105 -0
- package/packages/directives/src/use-aeon.ts +272 -0
- package/packages/mcp-server/package.json +51 -0
- package/packages/mcp-server/src/index.ts +178 -0
- package/packages/mcp-server/src/resources.ts +346 -0
- package/packages/mcp-server/src/tools/index.ts +36 -0
- package/packages/mcp-server/src/tools/navigation.ts +545 -0
- package/packages/mcp-server/tsconfig.json +21 -0
- package/packages/react/package.json +40 -0
- package/packages/react/src/Link.tsx +388 -0
- package/packages/react/src/components/InstallPrompt.tsx +286 -0
- package/packages/react/src/components/OfflineDiagnostics.tsx +677 -0
- package/packages/react/src/components/PushNotifications.tsx +453 -0
- package/packages/react/src/hooks/useAeonNavigation.ts +219 -0
- package/packages/react/src/hooks/useConflicts.ts +277 -0
- package/packages/react/src/hooks/useNetworkState.ts +209 -0
- package/packages/react/src/hooks/usePilotNavigation.ts +254 -0
- package/packages/react/src/hooks/useServiceWorker.ts +278 -0
- package/packages/react/src/hooks.ts +195 -0
- package/packages/react/src/index.ts +151 -0
- package/packages/react/src/provider.tsx +467 -0
- package/packages/react/tsconfig.json +19 -0
- package/packages/runtime/README.md +399 -0
- package/packages/runtime/build.ts +48 -0
- package/packages/runtime/package.json +71 -0
- package/packages/runtime/schema.sql +40 -0
- package/packages/runtime/src/api-routes.ts +465 -0
- package/packages/runtime/src/benchmark.ts +171 -0
- package/packages/runtime/src/cache.ts +479 -0
- package/packages/runtime/src/durable-object.ts +1341 -0
- package/packages/runtime/src/index.ts +360 -0
- package/packages/runtime/src/navigation.test.ts +421 -0
- package/packages/runtime/src/navigation.ts +422 -0
- package/packages/runtime/src/nextjs-adapter.ts +272 -0
- package/packages/runtime/src/offline/encrypted-queue.test.ts +607 -0
- package/packages/runtime/src/offline/encrypted-queue.ts +478 -0
- package/packages/runtime/src/offline/encryption.test.ts +412 -0
- package/packages/runtime/src/offline/encryption.ts +397 -0
- package/packages/runtime/src/offline/types.ts +465 -0
- package/packages/runtime/src/predictor.ts +371 -0
- package/packages/runtime/src/registry.ts +351 -0
- package/packages/runtime/src/router/context-extractor.ts +661 -0
- package/packages/runtime/src/router/esi-control-react.tsx +2053 -0
- package/packages/runtime/src/router/esi-control.ts +541 -0
- package/packages/runtime/src/router/esi-cyrano.ts +779 -0
- package/packages/runtime/src/router/esi-format-react.tsx +1744 -0
- package/packages/runtime/src/router/esi-react.tsx +1065 -0
- package/packages/runtime/src/router/esi-translate-observer.ts +476 -0
- package/packages/runtime/src/router/esi-translate-react.tsx +556 -0
- package/packages/runtime/src/router/esi-translate.ts +503 -0
- package/packages/runtime/src/router/esi.ts +666 -0
- package/packages/runtime/src/router/heuristic-adapter.test.ts +295 -0
- package/packages/runtime/src/router/heuristic-adapter.ts +557 -0
- package/packages/runtime/src/router/index.ts +298 -0
- package/packages/runtime/src/router/merkle-capability.ts +473 -0
- package/packages/runtime/src/router/speculation.ts +451 -0
- package/packages/runtime/src/router/types.ts +630 -0
- package/packages/runtime/src/router.test.ts +470 -0
- package/packages/runtime/src/router.ts +302 -0
- package/packages/runtime/src/server.ts +481 -0
- package/packages/runtime/src/service-worker-push.ts +319 -0
- package/packages/runtime/src/service-worker.ts +553 -0
- package/packages/runtime/src/skeleton-hydrate.ts +237 -0
- package/packages/runtime/src/speculation.test.ts +389 -0
- package/packages/runtime/src/speculation.ts +486 -0
- package/packages/runtime/src/storage.test.ts +1297 -0
- package/packages/runtime/src/storage.ts +1048 -0
- package/packages/runtime/src/sync/conflict-resolver.test.ts +528 -0
- package/packages/runtime/src/sync/conflict-resolver.ts +565 -0
- package/packages/runtime/src/sync/coordinator.test.ts +608 -0
- package/packages/runtime/src/sync/coordinator.ts +596 -0
- package/packages/runtime/src/tree-compiler.ts +295 -0
- package/packages/runtime/src/types.ts +728 -0
- package/packages/runtime/src/worker.ts +327 -0
- package/packages/runtime/tsconfig.json +20 -0
- package/packages/runtime/wasm/aeon_pages_runtime.d.ts +504 -0
- package/packages/runtime/wasm/aeon_pages_runtime.js +1657 -0
- package/packages/runtime/wasm/aeon_pages_runtime_bg.wasm +0 -0
- package/packages/runtime/wasm/aeon_pages_runtime_bg.wasm.d.ts +196 -0
- package/packages/runtime/wasm/package.json +21 -0
- package/packages/runtime/wrangler.toml +41 -0
- package/packages/runtime-wasm/Cargo.lock +436 -0
- package/packages/runtime-wasm/Cargo.toml +29 -0
- package/packages/runtime-wasm/pkg/aeon_pages_runtime.d.ts +480 -0
- package/packages/runtime-wasm/pkg/aeon_pages_runtime.js +1568 -0
- package/packages/runtime-wasm/pkg/aeon_pages_runtime_bg.wasm +0 -0
- package/packages/runtime-wasm/pkg/aeon_pages_runtime_bg.wasm.d.ts +192 -0
- package/packages/runtime-wasm/pkg/package.json +21 -0
- package/packages/runtime-wasm/src/hydrate.rs +352 -0
- package/packages/runtime-wasm/src/lib.rs +191 -0
- package/packages/runtime-wasm/src/render.rs +629 -0
- package/packages/runtime-wasm/src/router.rs +298 -0
- package/packages/runtime-wasm/src/skeleton.rs +430 -0
- package/rfcs/RFC-001-ZERO-DEPENDENCY-RENDERING.md +1446 -0
|
@@ -0,0 +1,1657 @@
|
|
|
1
|
+
/* @ts-self-types="./aeon_pages_runtime.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The Aeon Router - matches URLs to routes
|
|
5
|
+
*/
|
|
6
|
+
export class AeonRouter {
|
|
7
|
+
__destroy_into_raw() {
|
|
8
|
+
const ptr = this.__wbg_ptr;
|
|
9
|
+
this.__wbg_ptr = 0;
|
|
10
|
+
AeonRouterFinalization.unregister(this);
|
|
11
|
+
return ptr;
|
|
12
|
+
}
|
|
13
|
+
free() {
|
|
14
|
+
const ptr = this.__destroy_into_raw();
|
|
15
|
+
wasm.__wbg_aeonrouter_free(ptr, 0);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Add a route to the router
|
|
19
|
+
* @param {RouteDefinition} definition
|
|
20
|
+
*/
|
|
21
|
+
add_route(definition) {
|
|
22
|
+
_assertClass(definition, RouteDefinition);
|
|
23
|
+
var ptr0 = definition.__destroy_into_raw();
|
|
24
|
+
wasm.aeonrouter_add_route(this.__wbg_ptr, ptr0);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get all registered routes (for debugging)
|
|
28
|
+
* @returns {string}
|
|
29
|
+
*/
|
|
30
|
+
get_routes_json() {
|
|
31
|
+
let deferred1_0;
|
|
32
|
+
let deferred1_1;
|
|
33
|
+
try {
|
|
34
|
+
const ret = wasm.aeonrouter_get_routes_json(this.__wbg_ptr);
|
|
35
|
+
deferred1_0 = ret[0];
|
|
36
|
+
deferred1_1 = ret[1];
|
|
37
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
38
|
+
} finally {
|
|
39
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Check if a route exists for the given path
|
|
44
|
+
* @param {string} path
|
|
45
|
+
* @returns {boolean}
|
|
46
|
+
*/
|
|
47
|
+
has_route(path) {
|
|
48
|
+
const ptr0 = passStringToWasm0(
|
|
49
|
+
path,
|
|
50
|
+
wasm.__wbindgen_malloc,
|
|
51
|
+
wasm.__wbindgen_realloc,
|
|
52
|
+
);
|
|
53
|
+
const len0 = WASM_VECTOR_LEN;
|
|
54
|
+
const ret = wasm.aeonrouter_has_route(this.__wbg_ptr, ptr0, len0);
|
|
55
|
+
return ret !== 0;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Match a URL path to a route
|
|
59
|
+
* @param {string} path
|
|
60
|
+
* @returns {RouteMatch | undefined}
|
|
61
|
+
*/
|
|
62
|
+
match_route(path) {
|
|
63
|
+
const ptr0 = passStringToWasm0(
|
|
64
|
+
path,
|
|
65
|
+
wasm.__wbindgen_malloc,
|
|
66
|
+
wasm.__wbindgen_realloc,
|
|
67
|
+
);
|
|
68
|
+
const len0 = WASM_VECTOR_LEN;
|
|
69
|
+
const ret = wasm.aeonrouter_match_route(this.__wbg_ptr, ptr0, len0);
|
|
70
|
+
return ret === 0 ? undefined : RouteMatch.__wrap(ret);
|
|
71
|
+
}
|
|
72
|
+
constructor() {
|
|
73
|
+
const ret = wasm.aeonrouter_new();
|
|
74
|
+
this.__wbg_ptr = ret >>> 0;
|
|
75
|
+
AeonRouterFinalization.register(this, this.__wbg_ptr, this);
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (Symbol.dispose)
|
|
80
|
+
AeonRouter.prototype[Symbol.dispose] = AeonRouter.prototype.free;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Asset Manifest for inlining images/SVGs
|
|
84
|
+
*/
|
|
85
|
+
export class AssetManifest {
|
|
86
|
+
static __wrap(ptr) {
|
|
87
|
+
ptr = ptr >>> 0;
|
|
88
|
+
const obj = Object.create(AssetManifest.prototype);
|
|
89
|
+
obj.__wbg_ptr = ptr;
|
|
90
|
+
AssetManifestFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
91
|
+
return obj;
|
|
92
|
+
}
|
|
93
|
+
__destroy_into_raw() {
|
|
94
|
+
const ptr = this.__wbg_ptr;
|
|
95
|
+
this.__wbg_ptr = 0;
|
|
96
|
+
AssetManifestFinalization.unregister(this);
|
|
97
|
+
return ptr;
|
|
98
|
+
}
|
|
99
|
+
free() {
|
|
100
|
+
const ptr = this.__destroy_into_raw();
|
|
101
|
+
wasm.__wbg_assetmanifest_free(ptr, 0);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Load manifest from JSON
|
|
105
|
+
* @param {string} json
|
|
106
|
+
* @returns {AssetManifest}
|
|
107
|
+
*/
|
|
108
|
+
static from_json(json) {
|
|
109
|
+
const ptr0 = passStringToWasm0(
|
|
110
|
+
json,
|
|
111
|
+
wasm.__wbindgen_malloc,
|
|
112
|
+
wasm.__wbindgen_realloc,
|
|
113
|
+
);
|
|
114
|
+
const len0 = WASM_VECTOR_LEN;
|
|
115
|
+
const ret = wasm.assetmanifest_from_json(ptr0, len0);
|
|
116
|
+
if (ret[2]) {
|
|
117
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
118
|
+
}
|
|
119
|
+
return AssetManifest.__wrap(ret[0]);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get data URI for an asset path
|
|
123
|
+
* @param {string} path
|
|
124
|
+
* @returns {string | undefined}
|
|
125
|
+
*/
|
|
126
|
+
get_data_uri(path) {
|
|
127
|
+
const ptr0 = passStringToWasm0(
|
|
128
|
+
path,
|
|
129
|
+
wasm.__wbindgen_malloc,
|
|
130
|
+
wasm.__wbindgen_realloc,
|
|
131
|
+
);
|
|
132
|
+
const len0 = WASM_VECTOR_LEN;
|
|
133
|
+
const ret = wasm.assetmanifest_get_data_uri(this.__wbg_ptr, ptr0, len0);
|
|
134
|
+
let v2;
|
|
135
|
+
if (ret[0] !== 0) {
|
|
136
|
+
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
137
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
138
|
+
}
|
|
139
|
+
return v2;
|
|
140
|
+
}
|
|
141
|
+
constructor() {
|
|
142
|
+
const ret = wasm.assetmanifest_new();
|
|
143
|
+
this.__wbg_ptr = ret >>> 0;
|
|
144
|
+
AssetManifestFinalization.register(this, this.__wbg_ptr, this);
|
|
145
|
+
return this;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (Symbol.dispose)
|
|
149
|
+
AssetManifest.prototype[Symbol.dispose] = AssetManifest.prototype.free;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* CSS Manifest for on-demand CSS generation
|
|
153
|
+
*/
|
|
154
|
+
export class CSSManifest {
|
|
155
|
+
static __wrap(ptr) {
|
|
156
|
+
ptr = ptr >>> 0;
|
|
157
|
+
const obj = Object.create(CSSManifest.prototype);
|
|
158
|
+
obj.__wbg_ptr = ptr;
|
|
159
|
+
CSSManifestFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
160
|
+
return obj;
|
|
161
|
+
}
|
|
162
|
+
__destroy_into_raw() {
|
|
163
|
+
const ptr = this.__wbg_ptr;
|
|
164
|
+
this.__wbg_ptr = 0;
|
|
165
|
+
CSSManifestFinalization.unregister(this);
|
|
166
|
+
return ptr;
|
|
167
|
+
}
|
|
168
|
+
free() {
|
|
169
|
+
const ptr = this.__destroy_into_raw();
|
|
170
|
+
wasm.__wbg_cssmanifest_free(ptr, 0);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Get critical CSS
|
|
174
|
+
* @returns {string}
|
|
175
|
+
*/
|
|
176
|
+
get critical() {
|
|
177
|
+
let deferred1_0;
|
|
178
|
+
let deferred1_1;
|
|
179
|
+
try {
|
|
180
|
+
const ret = wasm.cssmanifest_critical(this.__wbg_ptr);
|
|
181
|
+
deferred1_0 = ret[0];
|
|
182
|
+
deferred1_1 = ret[1];
|
|
183
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
184
|
+
} finally {
|
|
185
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Load manifest from JSON
|
|
190
|
+
* @param {string} json
|
|
191
|
+
* @returns {CSSManifest}
|
|
192
|
+
*/
|
|
193
|
+
static from_json(json) {
|
|
194
|
+
const ptr0 = passStringToWasm0(
|
|
195
|
+
json,
|
|
196
|
+
wasm.__wbindgen_malloc,
|
|
197
|
+
wasm.__wbindgen_realloc,
|
|
198
|
+
);
|
|
199
|
+
const len0 = WASM_VECTOR_LEN;
|
|
200
|
+
const ret = wasm.cssmanifest_from_json(ptr0, len0);
|
|
201
|
+
if (ret[2]) {
|
|
202
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
203
|
+
}
|
|
204
|
+
return CSSManifest.__wrap(ret[0]);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* @param {string} critical
|
|
208
|
+
*/
|
|
209
|
+
constructor(critical) {
|
|
210
|
+
const ptr0 = passStringToWasm0(
|
|
211
|
+
critical,
|
|
212
|
+
wasm.__wbindgen_malloc,
|
|
213
|
+
wasm.__wbindgen_realloc,
|
|
214
|
+
);
|
|
215
|
+
const len0 = WASM_VECTOR_LEN;
|
|
216
|
+
const ret = wasm.cssmanifest_new(ptr0, len0);
|
|
217
|
+
this.__wbg_ptr = ret >>> 0;
|
|
218
|
+
CSSManifestFinalization.register(this, this.__wbg_ptr, this);
|
|
219
|
+
return this;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (Symbol.dispose)
|
|
223
|
+
CSSManifest.prototype[Symbol.dispose] = CSSManifest.prototype.free;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Component registry - maps component names to their render functions
|
|
227
|
+
*/
|
|
228
|
+
export class ComponentRegistry {
|
|
229
|
+
__destroy_into_raw() {
|
|
230
|
+
const ptr = this.__wbg_ptr;
|
|
231
|
+
this.__wbg_ptr = 0;
|
|
232
|
+
ComponentRegistryFinalization.unregister(this);
|
|
233
|
+
return ptr;
|
|
234
|
+
}
|
|
235
|
+
free() {
|
|
236
|
+
const ptr = this.__destroy_into_raw();
|
|
237
|
+
wasm.__wbg_componentregistry_free(ptr, 0);
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Check if a component is registered
|
|
241
|
+
* @param {string} name
|
|
242
|
+
* @returns {boolean}
|
|
243
|
+
*/
|
|
244
|
+
has(name) {
|
|
245
|
+
const ptr0 = passStringToWasm0(
|
|
246
|
+
name,
|
|
247
|
+
wasm.__wbindgen_malloc,
|
|
248
|
+
wasm.__wbindgen_realloc,
|
|
249
|
+
);
|
|
250
|
+
const len0 = WASM_VECTOR_LEN;
|
|
251
|
+
const ret = wasm.componentregistry_has(this.__wbg_ptr, ptr0, len0);
|
|
252
|
+
return ret !== 0;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Get all registered component names
|
|
256
|
+
* @returns {string}
|
|
257
|
+
*/
|
|
258
|
+
list() {
|
|
259
|
+
let deferred1_0;
|
|
260
|
+
let deferred1_1;
|
|
261
|
+
try {
|
|
262
|
+
const ret = wasm.componentregistry_list(this.__wbg_ptr);
|
|
263
|
+
deferred1_0 = ret[0];
|
|
264
|
+
deferred1_1 = ret[1];
|
|
265
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
266
|
+
} finally {
|
|
267
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
constructor() {
|
|
271
|
+
const ret = wasm.componentregistry_new();
|
|
272
|
+
this.__wbg_ptr = ret >>> 0;
|
|
273
|
+
ComponentRegistryFinalization.register(this, this.__wbg_ptr, this);
|
|
274
|
+
return this;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Register a component as available for rendering
|
|
278
|
+
* @param {string} name
|
|
279
|
+
*/
|
|
280
|
+
register(name) {
|
|
281
|
+
const ptr0 = passStringToWasm0(
|
|
282
|
+
name,
|
|
283
|
+
wasm.__wbindgen_malloc,
|
|
284
|
+
wasm.__wbindgen_realloc,
|
|
285
|
+
);
|
|
286
|
+
const len0 = WASM_VECTOR_LEN;
|
|
287
|
+
wasm.componentregistry_register(this.__wbg_ptr, ptr0, len0);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Register multiple components at once (from JSON array)
|
|
291
|
+
* @param {string} names_json
|
|
292
|
+
*/
|
|
293
|
+
register_many(names_json) {
|
|
294
|
+
const ptr0 = passStringToWasm0(
|
|
295
|
+
names_json,
|
|
296
|
+
wasm.__wbindgen_malloc,
|
|
297
|
+
wasm.__wbindgen_realloc,
|
|
298
|
+
);
|
|
299
|
+
const len0 = WASM_VECTOR_LEN;
|
|
300
|
+
wasm.componentregistry_register_many(this.__wbg_ptr, ptr0, len0);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if (Symbol.dispose)
|
|
304
|
+
ComponentRegistry.prototype[Symbol.dispose] =
|
|
305
|
+
ComponentRegistry.prototype.free;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Font Manifest for embedding fonts
|
|
309
|
+
*/
|
|
310
|
+
export class FontManifest {
|
|
311
|
+
static __wrap(ptr) {
|
|
312
|
+
ptr = ptr >>> 0;
|
|
313
|
+
const obj = Object.create(FontManifest.prototype);
|
|
314
|
+
obj.__wbg_ptr = ptr;
|
|
315
|
+
FontManifestFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
316
|
+
return obj;
|
|
317
|
+
}
|
|
318
|
+
__destroy_into_raw() {
|
|
319
|
+
const ptr = this.__wbg_ptr;
|
|
320
|
+
this.__wbg_ptr = 0;
|
|
321
|
+
FontManifestFinalization.unregister(this);
|
|
322
|
+
return ptr;
|
|
323
|
+
}
|
|
324
|
+
free() {
|
|
325
|
+
const ptr = this.__destroy_into_raw();
|
|
326
|
+
wasm.__wbg_fontmanifest_free(ptr, 0);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Get @font-face CSS
|
|
330
|
+
* @returns {string}
|
|
331
|
+
*/
|
|
332
|
+
get font_face_css() {
|
|
333
|
+
let deferred1_0;
|
|
334
|
+
let deferred1_1;
|
|
335
|
+
try {
|
|
336
|
+
const ret = wasm.fontmanifest_font_face_css(this.__wbg_ptr);
|
|
337
|
+
deferred1_0 = ret[0];
|
|
338
|
+
deferred1_1 = ret[1];
|
|
339
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
340
|
+
} finally {
|
|
341
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Load manifest from JSON
|
|
346
|
+
* @param {string} json
|
|
347
|
+
* @returns {FontManifest}
|
|
348
|
+
*/
|
|
349
|
+
static from_json(json) {
|
|
350
|
+
const ptr0 = passStringToWasm0(
|
|
351
|
+
json,
|
|
352
|
+
wasm.__wbindgen_malloc,
|
|
353
|
+
wasm.__wbindgen_realloc,
|
|
354
|
+
);
|
|
355
|
+
const len0 = WASM_VECTOR_LEN;
|
|
356
|
+
const ret = wasm.fontmanifest_from_json(ptr0, len0);
|
|
357
|
+
if (ret[2]) {
|
|
358
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
359
|
+
}
|
|
360
|
+
return FontManifest.__wrap(ret[0]);
|
|
361
|
+
}
|
|
362
|
+
constructor() {
|
|
363
|
+
const ret = wasm.fontmanifest_new();
|
|
364
|
+
this.__wbg_ptr = ret >>> 0;
|
|
365
|
+
FontManifestFinalization.register(this, this.__wbg_ptr, this);
|
|
366
|
+
return this;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
if (Symbol.dispose)
|
|
370
|
+
FontManifest.prototype[Symbol.dispose] = FontManifest.prototype.free;
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Render context containing manifests and collected data
|
|
374
|
+
*/
|
|
375
|
+
export class RenderContext {
|
|
376
|
+
__destroy_into_raw() {
|
|
377
|
+
const ptr = this.__wbg_ptr;
|
|
378
|
+
this.__wbg_ptr = 0;
|
|
379
|
+
RenderContextFinalization.unregister(this);
|
|
380
|
+
return ptr;
|
|
381
|
+
}
|
|
382
|
+
free() {
|
|
383
|
+
const ptr = this.__destroy_into_raw();
|
|
384
|
+
wasm.__wbg_rendercontext_free(ptr, 0);
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Get collected CSS classes as JSON array
|
|
388
|
+
* @returns {string}
|
|
389
|
+
*/
|
|
390
|
+
get_collected_classes() {
|
|
391
|
+
let deferred1_0;
|
|
392
|
+
let deferred1_1;
|
|
393
|
+
try {
|
|
394
|
+
const ret = wasm.rendercontext_get_collected_classes(this.__wbg_ptr);
|
|
395
|
+
deferred1_0 = ret[0];
|
|
396
|
+
deferred1_1 = ret[1];
|
|
397
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
398
|
+
} finally {
|
|
399
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Get interactive nodes as JSON array
|
|
404
|
+
* @returns {string}
|
|
405
|
+
*/
|
|
406
|
+
get_interactive_nodes() {
|
|
407
|
+
let deferred1_0;
|
|
408
|
+
let deferred1_1;
|
|
409
|
+
try {
|
|
410
|
+
const ret = wasm.rendercontext_get_interactive_nodes(this.__wbg_ptr);
|
|
411
|
+
deferred1_0 = ret[0];
|
|
412
|
+
deferred1_1 = ret[1];
|
|
413
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
414
|
+
} finally {
|
|
415
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* @param {string} css_manifest_json
|
|
420
|
+
* @param {string} asset_manifest_json
|
|
421
|
+
* @param {string} font_manifest_json
|
|
422
|
+
*/
|
|
423
|
+
constructor(css_manifest_json, asset_manifest_json, font_manifest_json) {
|
|
424
|
+
const ptr0 = passStringToWasm0(
|
|
425
|
+
css_manifest_json,
|
|
426
|
+
wasm.__wbindgen_malloc,
|
|
427
|
+
wasm.__wbindgen_realloc,
|
|
428
|
+
);
|
|
429
|
+
const len0 = WASM_VECTOR_LEN;
|
|
430
|
+
const ptr1 = passStringToWasm0(
|
|
431
|
+
asset_manifest_json,
|
|
432
|
+
wasm.__wbindgen_malloc,
|
|
433
|
+
wasm.__wbindgen_realloc,
|
|
434
|
+
);
|
|
435
|
+
const len1 = WASM_VECTOR_LEN;
|
|
436
|
+
const ptr2 = passStringToWasm0(
|
|
437
|
+
font_manifest_json,
|
|
438
|
+
wasm.__wbindgen_malloc,
|
|
439
|
+
wasm.__wbindgen_realloc,
|
|
440
|
+
);
|
|
441
|
+
const len2 = WASM_VECTOR_LEN;
|
|
442
|
+
const ret = wasm.rendercontext_new(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
443
|
+
if (ret[2]) {
|
|
444
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
445
|
+
}
|
|
446
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
447
|
+
RenderContextFinalization.register(this, this.__wbg_ptr, this);
|
|
448
|
+
return this;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
if (Symbol.dispose)
|
|
452
|
+
RenderContext.prototype[Symbol.dispose] = RenderContext.prototype.free;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Route definition from the build manifest
|
|
456
|
+
*/
|
|
457
|
+
export class RouteDefinition {
|
|
458
|
+
static __wrap(ptr) {
|
|
459
|
+
ptr = ptr >>> 0;
|
|
460
|
+
const obj = Object.create(RouteDefinition.prototype);
|
|
461
|
+
obj.__wbg_ptr = ptr;
|
|
462
|
+
RouteDefinitionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
463
|
+
return obj;
|
|
464
|
+
}
|
|
465
|
+
__destroy_into_raw() {
|
|
466
|
+
const ptr = this.__wbg_ptr;
|
|
467
|
+
this.__wbg_ptr = 0;
|
|
468
|
+
RouteDefinitionFinalization.unregister(this);
|
|
469
|
+
return ptr;
|
|
470
|
+
}
|
|
471
|
+
free() {
|
|
472
|
+
const ptr = this.__destroy_into_raw();
|
|
473
|
+
wasm.__wbg_routedefinition_free(ptr, 0);
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* @returns {string}
|
|
477
|
+
*/
|
|
478
|
+
get component_id() {
|
|
479
|
+
let deferred1_0;
|
|
480
|
+
let deferred1_1;
|
|
481
|
+
try {
|
|
482
|
+
const ret = wasm.routedefinition_component_id(this.__wbg_ptr);
|
|
483
|
+
deferred1_0 = ret[0];
|
|
484
|
+
deferred1_1 = ret[1];
|
|
485
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
486
|
+
} finally {
|
|
487
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* @returns {boolean}
|
|
492
|
+
*/
|
|
493
|
+
get is_aeon() {
|
|
494
|
+
const ret = wasm.routedefinition_is_aeon(this.__wbg_ptr);
|
|
495
|
+
return ret !== 0;
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* @returns {string | undefined}
|
|
499
|
+
*/
|
|
500
|
+
get layout() {
|
|
501
|
+
const ret = wasm.routedefinition_layout(this.__wbg_ptr);
|
|
502
|
+
let v1;
|
|
503
|
+
if (ret[0] !== 0) {
|
|
504
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
505
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
506
|
+
}
|
|
507
|
+
return v1;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* @param {string} pattern
|
|
511
|
+
* @param {string} session_id
|
|
512
|
+
* @param {string} component_id
|
|
513
|
+
* @param {string | null | undefined} layout
|
|
514
|
+
* @param {boolean} is_aeon
|
|
515
|
+
*/
|
|
516
|
+
constructor(pattern, session_id, component_id, layout, is_aeon) {
|
|
517
|
+
const ptr0 = passStringToWasm0(
|
|
518
|
+
pattern,
|
|
519
|
+
wasm.__wbindgen_malloc,
|
|
520
|
+
wasm.__wbindgen_realloc,
|
|
521
|
+
);
|
|
522
|
+
const len0 = WASM_VECTOR_LEN;
|
|
523
|
+
const ptr1 = passStringToWasm0(
|
|
524
|
+
session_id,
|
|
525
|
+
wasm.__wbindgen_malloc,
|
|
526
|
+
wasm.__wbindgen_realloc,
|
|
527
|
+
);
|
|
528
|
+
const len1 = WASM_VECTOR_LEN;
|
|
529
|
+
const ptr2 = passStringToWasm0(
|
|
530
|
+
component_id,
|
|
531
|
+
wasm.__wbindgen_malloc,
|
|
532
|
+
wasm.__wbindgen_realloc,
|
|
533
|
+
);
|
|
534
|
+
const len2 = WASM_VECTOR_LEN;
|
|
535
|
+
var ptr3 = isLikeNone(layout)
|
|
536
|
+
? 0
|
|
537
|
+
: passStringToWasm0(
|
|
538
|
+
layout,
|
|
539
|
+
wasm.__wbindgen_malloc,
|
|
540
|
+
wasm.__wbindgen_realloc,
|
|
541
|
+
);
|
|
542
|
+
var len3 = WASM_VECTOR_LEN;
|
|
543
|
+
const ret = wasm.routedefinition_new(
|
|
544
|
+
ptr0,
|
|
545
|
+
len0,
|
|
546
|
+
ptr1,
|
|
547
|
+
len1,
|
|
548
|
+
ptr2,
|
|
549
|
+
len2,
|
|
550
|
+
ptr3,
|
|
551
|
+
len3,
|
|
552
|
+
is_aeon,
|
|
553
|
+
);
|
|
554
|
+
this.__wbg_ptr = ret >>> 0;
|
|
555
|
+
RouteDefinitionFinalization.register(this, this.__wbg_ptr, this);
|
|
556
|
+
return this;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* @returns {string}
|
|
560
|
+
*/
|
|
561
|
+
get pattern() {
|
|
562
|
+
let deferred1_0;
|
|
563
|
+
let deferred1_1;
|
|
564
|
+
try {
|
|
565
|
+
const ret = wasm.routedefinition_pattern(this.__wbg_ptr);
|
|
566
|
+
deferred1_0 = ret[0];
|
|
567
|
+
deferred1_1 = ret[1];
|
|
568
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
569
|
+
} finally {
|
|
570
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* @returns {string}
|
|
575
|
+
*/
|
|
576
|
+
get session_id() {
|
|
577
|
+
let deferred1_0;
|
|
578
|
+
let deferred1_1;
|
|
579
|
+
try {
|
|
580
|
+
const ret = wasm.routedefinition_session_id(this.__wbg_ptr);
|
|
581
|
+
deferred1_0 = ret[0];
|
|
582
|
+
deferred1_1 = ret[1];
|
|
583
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
584
|
+
} finally {
|
|
585
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
if (Symbol.dispose)
|
|
590
|
+
RouteDefinition.prototype[Symbol.dispose] = RouteDefinition.prototype.free;
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Match result with extracted parameters
|
|
594
|
+
*/
|
|
595
|
+
export class RouteMatch {
|
|
596
|
+
static __wrap(ptr) {
|
|
597
|
+
ptr = ptr >>> 0;
|
|
598
|
+
const obj = Object.create(RouteMatch.prototype);
|
|
599
|
+
obj.__wbg_ptr = ptr;
|
|
600
|
+
RouteMatchFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
601
|
+
return obj;
|
|
602
|
+
}
|
|
603
|
+
__destroy_into_raw() {
|
|
604
|
+
const ptr = this.__wbg_ptr;
|
|
605
|
+
this.__wbg_ptr = 0;
|
|
606
|
+
RouteMatchFinalization.unregister(this);
|
|
607
|
+
return ptr;
|
|
608
|
+
}
|
|
609
|
+
free() {
|
|
610
|
+
const ptr = this.__destroy_into_raw();
|
|
611
|
+
wasm.__wbg_routematch_free(ptr, 0);
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* @param {string} key
|
|
615
|
+
* @returns {string | undefined}
|
|
616
|
+
*/
|
|
617
|
+
get_param(key) {
|
|
618
|
+
const ptr0 = passStringToWasm0(
|
|
619
|
+
key,
|
|
620
|
+
wasm.__wbindgen_malloc,
|
|
621
|
+
wasm.__wbindgen_realloc,
|
|
622
|
+
);
|
|
623
|
+
const len0 = WASM_VECTOR_LEN;
|
|
624
|
+
const ret = wasm.routematch_get_param(this.__wbg_ptr, ptr0, len0);
|
|
625
|
+
let v2;
|
|
626
|
+
if (ret[0] !== 0) {
|
|
627
|
+
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
628
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
629
|
+
}
|
|
630
|
+
return v2;
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* @returns {string}
|
|
634
|
+
*/
|
|
635
|
+
get params_json() {
|
|
636
|
+
let deferred1_0;
|
|
637
|
+
let deferred1_1;
|
|
638
|
+
try {
|
|
639
|
+
const ret = wasm.routematch_params_json(this.__wbg_ptr);
|
|
640
|
+
deferred1_0 = ret[0];
|
|
641
|
+
deferred1_1 = ret[1];
|
|
642
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
643
|
+
} finally {
|
|
644
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* @returns {string}
|
|
649
|
+
*/
|
|
650
|
+
get resolved_session_id() {
|
|
651
|
+
let deferred1_0;
|
|
652
|
+
let deferred1_1;
|
|
653
|
+
try {
|
|
654
|
+
const ret = wasm.routematch_resolved_session_id(this.__wbg_ptr);
|
|
655
|
+
deferred1_0 = ret[0];
|
|
656
|
+
deferred1_1 = ret[1];
|
|
657
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
658
|
+
} finally {
|
|
659
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* @returns {RouteDefinition}
|
|
664
|
+
*/
|
|
665
|
+
get route() {
|
|
666
|
+
const ret = wasm.routematch_route(this.__wbg_ptr);
|
|
667
|
+
return RouteDefinition.__wrap(ret);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
if (Symbol.dispose)
|
|
671
|
+
RouteMatch.prototype[Symbol.dispose] = RouteMatch.prototype.free;
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Serialized component tree (stored in Aeon sessions)
|
|
675
|
+
*/
|
|
676
|
+
export class SerializedComponent {
|
|
677
|
+
static __wrap(ptr) {
|
|
678
|
+
ptr = ptr >>> 0;
|
|
679
|
+
const obj = Object.create(SerializedComponent.prototype);
|
|
680
|
+
obj.__wbg_ptr = ptr;
|
|
681
|
+
SerializedComponentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
682
|
+
return obj;
|
|
683
|
+
}
|
|
684
|
+
__destroy_into_raw() {
|
|
685
|
+
const ptr = this.__wbg_ptr;
|
|
686
|
+
this.__wbg_ptr = 0;
|
|
687
|
+
SerializedComponentFinalization.unregister(this);
|
|
688
|
+
return ptr;
|
|
689
|
+
}
|
|
690
|
+
free() {
|
|
691
|
+
const ptr = this.__destroy_into_raw();
|
|
692
|
+
wasm.__wbg_serializedcomponent_free(ptr, 0);
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* @param {SerializedComponent} component
|
|
696
|
+
*/
|
|
697
|
+
add_component_child(component) {
|
|
698
|
+
_assertClass(component, SerializedComponent);
|
|
699
|
+
var ptr0 = component.__destroy_into_raw();
|
|
700
|
+
wasm.serializedcomponent_add_component_child(this.__wbg_ptr, ptr0);
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* @param {string} text
|
|
704
|
+
*/
|
|
705
|
+
add_text_child(text) {
|
|
706
|
+
const ptr0 = passStringToWasm0(
|
|
707
|
+
text,
|
|
708
|
+
wasm.__wbindgen_malloc,
|
|
709
|
+
wasm.__wbindgen_realloc,
|
|
710
|
+
);
|
|
711
|
+
const len0 = WASM_VECTOR_LEN;
|
|
712
|
+
wasm.serializedcomponent_add_text_child(this.__wbg_ptr, ptr0, len0);
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* @returns {string}
|
|
716
|
+
*/
|
|
717
|
+
get component_type() {
|
|
718
|
+
let deferred1_0;
|
|
719
|
+
let deferred1_1;
|
|
720
|
+
try {
|
|
721
|
+
const ret = wasm.serializedcomponent_component_type(this.__wbg_ptr);
|
|
722
|
+
deferred1_0 = ret[0];
|
|
723
|
+
deferred1_1 = ret[1];
|
|
724
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
725
|
+
} finally {
|
|
726
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* @param {string} json
|
|
731
|
+
* @returns {SerializedComponent}
|
|
732
|
+
*/
|
|
733
|
+
static from_json(json) {
|
|
734
|
+
const ptr0 = passStringToWasm0(
|
|
735
|
+
json,
|
|
736
|
+
wasm.__wbindgen_malloc,
|
|
737
|
+
wasm.__wbindgen_realloc,
|
|
738
|
+
);
|
|
739
|
+
const len0 = WASM_VECTOR_LEN;
|
|
740
|
+
const ret = wasm.serializedcomponent_from_json(ptr0, len0);
|
|
741
|
+
if (ret[2]) {
|
|
742
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
743
|
+
}
|
|
744
|
+
return SerializedComponent.__wrap(ret[0]);
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* @param {string} component_type
|
|
748
|
+
* @param {string | null} [props]
|
|
749
|
+
*/
|
|
750
|
+
constructor(component_type, props) {
|
|
751
|
+
const ptr0 = passStringToWasm0(
|
|
752
|
+
component_type,
|
|
753
|
+
wasm.__wbindgen_malloc,
|
|
754
|
+
wasm.__wbindgen_realloc,
|
|
755
|
+
);
|
|
756
|
+
const len0 = WASM_VECTOR_LEN;
|
|
757
|
+
var ptr1 = isLikeNone(props)
|
|
758
|
+
? 0
|
|
759
|
+
: passStringToWasm0(
|
|
760
|
+
props,
|
|
761
|
+
wasm.__wbindgen_malloc,
|
|
762
|
+
wasm.__wbindgen_realloc,
|
|
763
|
+
);
|
|
764
|
+
var len1 = WASM_VECTOR_LEN;
|
|
765
|
+
const ret = wasm.serializedcomponent_new(ptr0, len0, ptr1, len1);
|
|
766
|
+
this.__wbg_ptr = ret >>> 0;
|
|
767
|
+
SerializedComponentFinalization.register(this, this.__wbg_ptr, this);
|
|
768
|
+
return this;
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* @returns {string | undefined}
|
|
772
|
+
*/
|
|
773
|
+
get props() {
|
|
774
|
+
const ret = wasm.serializedcomponent_props(this.__wbg_ptr);
|
|
775
|
+
let v1;
|
|
776
|
+
if (ret[0] !== 0) {
|
|
777
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
778
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
779
|
+
}
|
|
780
|
+
return v1;
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* @returns {string}
|
|
784
|
+
*/
|
|
785
|
+
to_json() {
|
|
786
|
+
let deferred1_0;
|
|
787
|
+
let deferred1_1;
|
|
788
|
+
try {
|
|
789
|
+
const ret = wasm.serializedcomponent_to_json(this.__wbg_ptr);
|
|
790
|
+
deferred1_0 = ret[0];
|
|
791
|
+
deferred1_1 = ret[1];
|
|
792
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
793
|
+
} finally {
|
|
794
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
if (Symbol.dispose)
|
|
799
|
+
SerializedComponent.prototype[Symbol.dispose] =
|
|
800
|
+
SerializedComponent.prototype.free;
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* Diff result for component tree changes
|
|
804
|
+
*/
|
|
805
|
+
export class TreeDiff {
|
|
806
|
+
__destroy_into_raw() {
|
|
807
|
+
const ptr = this.__wbg_ptr;
|
|
808
|
+
this.__wbg_ptr = 0;
|
|
809
|
+
TreeDiffFinalization.unregister(this);
|
|
810
|
+
return ptr;
|
|
811
|
+
}
|
|
812
|
+
free() {
|
|
813
|
+
const ptr = this.__destroy_into_raw();
|
|
814
|
+
wasm.__wbg_treediff_free(ptr, 0);
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* Get the change type
|
|
818
|
+
* @returns {string}
|
|
819
|
+
*/
|
|
820
|
+
get change_type() {
|
|
821
|
+
let deferred1_0;
|
|
822
|
+
let deferred1_1;
|
|
823
|
+
try {
|
|
824
|
+
const ret = wasm.treediff_change_type(this.__wbg_ptr);
|
|
825
|
+
deferred1_0 = ret[0];
|
|
826
|
+
deferred1_1 = ret[1];
|
|
827
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
828
|
+
} finally {
|
|
829
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* @param {string} path
|
|
834
|
+
* @param {string} change_type
|
|
835
|
+
* @param {string | null} [old_value]
|
|
836
|
+
* @param {string | null} [new_value]
|
|
837
|
+
*/
|
|
838
|
+
constructor(path, change_type, old_value, new_value) {
|
|
839
|
+
const ptr0 = passStringToWasm0(
|
|
840
|
+
path,
|
|
841
|
+
wasm.__wbindgen_malloc,
|
|
842
|
+
wasm.__wbindgen_realloc,
|
|
843
|
+
);
|
|
844
|
+
const len0 = WASM_VECTOR_LEN;
|
|
845
|
+
const ptr1 = passStringToWasm0(
|
|
846
|
+
change_type,
|
|
847
|
+
wasm.__wbindgen_malloc,
|
|
848
|
+
wasm.__wbindgen_realloc,
|
|
849
|
+
);
|
|
850
|
+
const len1 = WASM_VECTOR_LEN;
|
|
851
|
+
var ptr2 = isLikeNone(old_value)
|
|
852
|
+
? 0
|
|
853
|
+
: passStringToWasm0(
|
|
854
|
+
old_value,
|
|
855
|
+
wasm.__wbindgen_malloc,
|
|
856
|
+
wasm.__wbindgen_realloc,
|
|
857
|
+
);
|
|
858
|
+
var len2 = WASM_VECTOR_LEN;
|
|
859
|
+
var ptr3 = isLikeNone(new_value)
|
|
860
|
+
? 0
|
|
861
|
+
: passStringToWasm0(
|
|
862
|
+
new_value,
|
|
863
|
+
wasm.__wbindgen_malloc,
|
|
864
|
+
wasm.__wbindgen_realloc,
|
|
865
|
+
);
|
|
866
|
+
var len3 = WASM_VECTOR_LEN;
|
|
867
|
+
const ret = wasm.treediff_new(
|
|
868
|
+
ptr0,
|
|
869
|
+
len0,
|
|
870
|
+
ptr1,
|
|
871
|
+
len1,
|
|
872
|
+
ptr2,
|
|
873
|
+
len2,
|
|
874
|
+
ptr3,
|
|
875
|
+
len3,
|
|
876
|
+
);
|
|
877
|
+
this.__wbg_ptr = ret >>> 0;
|
|
878
|
+
TreeDiffFinalization.register(this, this.__wbg_ptr, this);
|
|
879
|
+
return this;
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Get the new value
|
|
883
|
+
* @returns {string | undefined}
|
|
884
|
+
*/
|
|
885
|
+
get new_value() {
|
|
886
|
+
const ret = wasm.treediff_new_value(this.__wbg_ptr);
|
|
887
|
+
let v1;
|
|
888
|
+
if (ret[0] !== 0) {
|
|
889
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
890
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
891
|
+
}
|
|
892
|
+
return v1;
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Get the old value
|
|
896
|
+
* @returns {string | undefined}
|
|
897
|
+
*/
|
|
898
|
+
get old_value() {
|
|
899
|
+
const ret = wasm.treediff_old_value(this.__wbg_ptr);
|
|
900
|
+
let v1;
|
|
901
|
+
if (ret[0] !== 0) {
|
|
902
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
903
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
904
|
+
}
|
|
905
|
+
return v1;
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* Get the path
|
|
909
|
+
* @returns {string}
|
|
910
|
+
*/
|
|
911
|
+
get path() {
|
|
912
|
+
let deferred1_0;
|
|
913
|
+
let deferred1_1;
|
|
914
|
+
try {
|
|
915
|
+
const ret = wasm.treediff_path(this.__wbg_ptr);
|
|
916
|
+
deferred1_0 = ret[0];
|
|
917
|
+
deferred1_1 = ret[1];
|
|
918
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
919
|
+
} finally {
|
|
920
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* @returns {string}
|
|
925
|
+
*/
|
|
926
|
+
to_json() {
|
|
927
|
+
let deferred1_0;
|
|
928
|
+
let deferred1_1;
|
|
929
|
+
try {
|
|
930
|
+
const ret = wasm.treediff_to_json(this.__wbg_ptr);
|
|
931
|
+
deferred1_0 = ret[0];
|
|
932
|
+
deferred1_1 = ret[1];
|
|
933
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
934
|
+
} finally {
|
|
935
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
if (Symbol.dispose)
|
|
940
|
+
TreeDiff.prototype[Symbol.dispose] = TreeDiff.prototype.free;
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* Apply a patch to a component tree
|
|
944
|
+
* @param {string} tree_json
|
|
945
|
+
* @param {string} patch_json
|
|
946
|
+
* @returns {string}
|
|
947
|
+
*/
|
|
948
|
+
export function apply_patch(tree_json, patch_json) {
|
|
949
|
+
let deferred3_0;
|
|
950
|
+
let deferred3_1;
|
|
951
|
+
try {
|
|
952
|
+
const ptr0 = passStringToWasm0(
|
|
953
|
+
tree_json,
|
|
954
|
+
wasm.__wbindgen_malloc,
|
|
955
|
+
wasm.__wbindgen_realloc,
|
|
956
|
+
);
|
|
957
|
+
const len0 = WASM_VECTOR_LEN;
|
|
958
|
+
const ptr1 = passStringToWasm0(
|
|
959
|
+
patch_json,
|
|
960
|
+
wasm.__wbindgen_malloc,
|
|
961
|
+
wasm.__wbindgen_realloc,
|
|
962
|
+
);
|
|
963
|
+
const len1 = WASM_VECTOR_LEN;
|
|
964
|
+
const ret = wasm.apply_patch(ptr0, len0, ptr1, len1);
|
|
965
|
+
deferred3_0 = ret[0];
|
|
966
|
+
deferred3_1 = ret[1];
|
|
967
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
968
|
+
} finally {
|
|
969
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* Compute diff between two component trees
|
|
975
|
+
* @param {string} old_json
|
|
976
|
+
* @param {string} new_json
|
|
977
|
+
* @returns {string}
|
|
978
|
+
*/
|
|
979
|
+
export function diff_trees(old_json, new_json) {
|
|
980
|
+
let deferred3_0;
|
|
981
|
+
let deferred3_1;
|
|
982
|
+
try {
|
|
983
|
+
const ptr0 = passStringToWasm0(
|
|
984
|
+
old_json,
|
|
985
|
+
wasm.__wbindgen_malloc,
|
|
986
|
+
wasm.__wbindgen_realloc,
|
|
987
|
+
);
|
|
988
|
+
const len0 = WASM_VECTOR_LEN;
|
|
989
|
+
const ptr1 = passStringToWasm0(
|
|
990
|
+
new_json,
|
|
991
|
+
wasm.__wbindgen_malloc,
|
|
992
|
+
wasm.__wbindgen_realloc,
|
|
993
|
+
);
|
|
994
|
+
const len1 = WASM_VECTOR_LEN;
|
|
995
|
+
const ret = wasm.diff_trees(ptr0, len0, ptr1, len1);
|
|
996
|
+
deferred3_0 = ret[0];
|
|
997
|
+
deferred3_1 = ret[1];
|
|
998
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
999
|
+
} finally {
|
|
1000
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* Walk the component tree and collect CSS classes
|
|
1006
|
+
* @param {string} tree_json
|
|
1007
|
+
* @returns {string}
|
|
1008
|
+
*/
|
|
1009
|
+
export function extract_css_classes(tree_json) {
|
|
1010
|
+
let deferred2_0;
|
|
1011
|
+
let deferred2_1;
|
|
1012
|
+
try {
|
|
1013
|
+
const ptr0 = passStringToWasm0(
|
|
1014
|
+
tree_json,
|
|
1015
|
+
wasm.__wbindgen_malloc,
|
|
1016
|
+
wasm.__wbindgen_realloc,
|
|
1017
|
+
);
|
|
1018
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1019
|
+
const ret = wasm.extract_css_classes(ptr0, len0);
|
|
1020
|
+
deferred2_0 = ret[0];
|
|
1021
|
+
deferred2_1 = ret[1];
|
|
1022
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1023
|
+
} finally {
|
|
1024
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
/**
|
|
1029
|
+
* Generate CSS for collected classes
|
|
1030
|
+
* @param {string} classes_json
|
|
1031
|
+
* @param {string} manifest_json
|
|
1032
|
+
* @returns {string}
|
|
1033
|
+
*/
|
|
1034
|
+
export function generate_css_for_classes(classes_json, manifest_json) {
|
|
1035
|
+
let deferred3_0;
|
|
1036
|
+
let deferred3_1;
|
|
1037
|
+
try {
|
|
1038
|
+
const ptr0 = passStringToWasm0(
|
|
1039
|
+
classes_json,
|
|
1040
|
+
wasm.__wbindgen_malloc,
|
|
1041
|
+
wasm.__wbindgen_realloc,
|
|
1042
|
+
);
|
|
1043
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1044
|
+
const ptr1 = passStringToWasm0(
|
|
1045
|
+
manifest_json,
|
|
1046
|
+
wasm.__wbindgen_malloc,
|
|
1047
|
+
wasm.__wbindgen_realloc,
|
|
1048
|
+
);
|
|
1049
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1050
|
+
const ret = wasm.generate_css_for_classes(ptr0, len0, ptr1, len1);
|
|
1051
|
+
deferred3_0 = ret[0];
|
|
1052
|
+
deferred3_1 = ret[1];
|
|
1053
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1054
|
+
} finally {
|
|
1055
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* Generate minimal hydration script for interactive components
|
|
1061
|
+
* @param {string} interactive_nodes_json
|
|
1062
|
+
* @param {string} env_json
|
|
1063
|
+
* @returns {string}
|
|
1064
|
+
*/
|
|
1065
|
+
export function generate_hydration_script(interactive_nodes_json, env_json) {
|
|
1066
|
+
let deferred3_0;
|
|
1067
|
+
let deferred3_1;
|
|
1068
|
+
try {
|
|
1069
|
+
const ptr0 = passStringToWasm0(
|
|
1070
|
+
interactive_nodes_json,
|
|
1071
|
+
wasm.__wbindgen_malloc,
|
|
1072
|
+
wasm.__wbindgen_realloc,
|
|
1073
|
+
);
|
|
1074
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1075
|
+
const ptr1 = passStringToWasm0(
|
|
1076
|
+
env_json,
|
|
1077
|
+
wasm.__wbindgen_malloc,
|
|
1078
|
+
wasm.__wbindgen_realloc,
|
|
1079
|
+
);
|
|
1080
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1081
|
+
const ret = wasm.generate_hydration_script(ptr0, len0, ptr1, len1);
|
|
1082
|
+
deferred3_0 = ret[0];
|
|
1083
|
+
deferred3_1 = ret[1];
|
|
1084
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1085
|
+
} finally {
|
|
1086
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* Generate skeleton CSS with pulse animation
|
|
1092
|
+
* @returns {string}
|
|
1093
|
+
*/
|
|
1094
|
+
export function generate_skeleton_css() {
|
|
1095
|
+
let deferred1_0;
|
|
1096
|
+
let deferred1_1;
|
|
1097
|
+
try {
|
|
1098
|
+
const ret = wasm.generate_skeleton_css();
|
|
1099
|
+
deferred1_0 = ret[0];
|
|
1100
|
+
deferred1_1 = ret[1];
|
|
1101
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1102
|
+
} finally {
|
|
1103
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* Get skeleton stats from a tree
|
|
1109
|
+
* @param {string} tree_json
|
|
1110
|
+
* @returns {string}
|
|
1111
|
+
*/
|
|
1112
|
+
export function get_skeleton_stats(tree_json) {
|
|
1113
|
+
let deferred2_0;
|
|
1114
|
+
let deferred2_1;
|
|
1115
|
+
try {
|
|
1116
|
+
const ptr0 = passStringToWasm0(
|
|
1117
|
+
tree_json,
|
|
1118
|
+
wasm.__wbindgen_malloc,
|
|
1119
|
+
wasm.__wbindgen_realloc,
|
|
1120
|
+
);
|
|
1121
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1122
|
+
const ret = wasm.get_skeleton_stats(ptr0, len0);
|
|
1123
|
+
deferred2_0 = ret[0];
|
|
1124
|
+
deferred2_1 = ret[1];
|
|
1125
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1126
|
+
} finally {
|
|
1127
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
export function init() {
|
|
1132
|
+
wasm.init();
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
/**
|
|
1136
|
+
* Full page render: combines tree rendering with CSS, assets, and fonts
|
|
1137
|
+
* @param {string} tree_json
|
|
1138
|
+
* @param {string} css_manifest_json
|
|
1139
|
+
* @param {string} asset_manifest_json
|
|
1140
|
+
* @param {string} font_manifest_json
|
|
1141
|
+
* @param {string} title
|
|
1142
|
+
* @param {string} description
|
|
1143
|
+
* @returns {string}
|
|
1144
|
+
*/
|
|
1145
|
+
export function render_page(
|
|
1146
|
+
tree_json,
|
|
1147
|
+
css_manifest_json,
|
|
1148
|
+
asset_manifest_json,
|
|
1149
|
+
font_manifest_json,
|
|
1150
|
+
title,
|
|
1151
|
+
description,
|
|
1152
|
+
) {
|
|
1153
|
+
let deferred7_0;
|
|
1154
|
+
let deferred7_1;
|
|
1155
|
+
try {
|
|
1156
|
+
const ptr0 = passStringToWasm0(
|
|
1157
|
+
tree_json,
|
|
1158
|
+
wasm.__wbindgen_malloc,
|
|
1159
|
+
wasm.__wbindgen_realloc,
|
|
1160
|
+
);
|
|
1161
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1162
|
+
const ptr1 = passStringToWasm0(
|
|
1163
|
+
css_manifest_json,
|
|
1164
|
+
wasm.__wbindgen_malloc,
|
|
1165
|
+
wasm.__wbindgen_realloc,
|
|
1166
|
+
);
|
|
1167
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1168
|
+
const ptr2 = passStringToWasm0(
|
|
1169
|
+
asset_manifest_json,
|
|
1170
|
+
wasm.__wbindgen_malloc,
|
|
1171
|
+
wasm.__wbindgen_realloc,
|
|
1172
|
+
);
|
|
1173
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1174
|
+
const ptr3 = passStringToWasm0(
|
|
1175
|
+
font_manifest_json,
|
|
1176
|
+
wasm.__wbindgen_malloc,
|
|
1177
|
+
wasm.__wbindgen_realloc,
|
|
1178
|
+
);
|
|
1179
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1180
|
+
const ptr4 = passStringToWasm0(
|
|
1181
|
+
title,
|
|
1182
|
+
wasm.__wbindgen_malloc,
|
|
1183
|
+
wasm.__wbindgen_realloc,
|
|
1184
|
+
);
|
|
1185
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1186
|
+
const ptr5 = passStringToWasm0(
|
|
1187
|
+
description,
|
|
1188
|
+
wasm.__wbindgen_malloc,
|
|
1189
|
+
wasm.__wbindgen_realloc,
|
|
1190
|
+
);
|
|
1191
|
+
const len5 = WASM_VECTOR_LEN;
|
|
1192
|
+
const ret = wasm.render_page(
|
|
1193
|
+
ptr0,
|
|
1194
|
+
len0,
|
|
1195
|
+
ptr1,
|
|
1196
|
+
len1,
|
|
1197
|
+
ptr2,
|
|
1198
|
+
len2,
|
|
1199
|
+
ptr3,
|
|
1200
|
+
len3,
|
|
1201
|
+
ptr4,
|
|
1202
|
+
len4,
|
|
1203
|
+
ptr5,
|
|
1204
|
+
len5,
|
|
1205
|
+
);
|
|
1206
|
+
deferred7_0 = ret[0];
|
|
1207
|
+
deferred7_1 = ret[1];
|
|
1208
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1209
|
+
} finally {
|
|
1210
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
/**
|
|
1215
|
+
* Render a skeleton tree to HTML
|
|
1216
|
+
* @param {string} tree_json
|
|
1217
|
+
* @returns {string}
|
|
1218
|
+
*/
|
|
1219
|
+
export function render_skeleton(tree_json) {
|
|
1220
|
+
let deferred2_0;
|
|
1221
|
+
let deferred2_1;
|
|
1222
|
+
try {
|
|
1223
|
+
const ptr0 = passStringToWasm0(
|
|
1224
|
+
tree_json,
|
|
1225
|
+
wasm.__wbindgen_malloc,
|
|
1226
|
+
wasm.__wbindgen_realloc,
|
|
1227
|
+
);
|
|
1228
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1229
|
+
const ret = wasm.render_skeleton(ptr0, len0);
|
|
1230
|
+
deferred2_0 = ret[0];
|
|
1231
|
+
deferred2_1 = ret[1];
|
|
1232
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1233
|
+
} finally {
|
|
1234
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* Render a complete skeleton page (skeleton HTML + CSS)
|
|
1240
|
+
* @param {string} tree_json
|
|
1241
|
+
* @returns {string}
|
|
1242
|
+
*/
|
|
1243
|
+
export function render_skeleton_page(tree_json) {
|
|
1244
|
+
let deferred2_0;
|
|
1245
|
+
let deferred2_1;
|
|
1246
|
+
try {
|
|
1247
|
+
const ptr0 = passStringToWasm0(
|
|
1248
|
+
tree_json,
|
|
1249
|
+
wasm.__wbindgen_malloc,
|
|
1250
|
+
wasm.__wbindgen_realloc,
|
|
1251
|
+
);
|
|
1252
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1253
|
+
const ret = wasm.render_skeleton_page(ptr0, len0);
|
|
1254
|
+
deferred2_0 = ret[0];
|
|
1255
|
+
deferred2_1 = ret[1];
|
|
1256
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1257
|
+
} finally {
|
|
1258
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
/**
|
|
1263
|
+
* Render a component tree to HTML string
|
|
1264
|
+
* @param {string} tree_json
|
|
1265
|
+
* @returns {string}
|
|
1266
|
+
*/
|
|
1267
|
+
export function render_tree_to_html(tree_json) {
|
|
1268
|
+
let deferred2_0;
|
|
1269
|
+
let deferred2_1;
|
|
1270
|
+
try {
|
|
1271
|
+
const ptr0 = passStringToWasm0(
|
|
1272
|
+
tree_json,
|
|
1273
|
+
wasm.__wbindgen_malloc,
|
|
1274
|
+
wasm.__wbindgen_realloc,
|
|
1275
|
+
);
|
|
1276
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1277
|
+
const ret = wasm.render_tree_to_html(ptr0, len0);
|
|
1278
|
+
deferred2_0 = ret[0];
|
|
1279
|
+
deferred2_1 = ret[1];
|
|
1280
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1281
|
+
} finally {
|
|
1282
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
/**
|
|
1287
|
+
* Resolve asset references in the tree (replace paths with data URIs)
|
|
1288
|
+
* @param {string} tree_json
|
|
1289
|
+
* @param {string} manifest_json
|
|
1290
|
+
* @returns {string}
|
|
1291
|
+
*/
|
|
1292
|
+
export function resolve_assets(tree_json, manifest_json) {
|
|
1293
|
+
let deferred3_0;
|
|
1294
|
+
let deferred3_1;
|
|
1295
|
+
try {
|
|
1296
|
+
const ptr0 = passStringToWasm0(
|
|
1297
|
+
tree_json,
|
|
1298
|
+
wasm.__wbindgen_malloc,
|
|
1299
|
+
wasm.__wbindgen_realloc,
|
|
1300
|
+
);
|
|
1301
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1302
|
+
const ptr1 = passStringToWasm0(
|
|
1303
|
+
manifest_json,
|
|
1304
|
+
wasm.__wbindgen_malloc,
|
|
1305
|
+
wasm.__wbindgen_realloc,
|
|
1306
|
+
);
|
|
1307
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1308
|
+
const ret = wasm.resolve_assets(ptr0, len0, ptr1, len1);
|
|
1309
|
+
deferred3_0 = ret[0];
|
|
1310
|
+
deferred3_1 = ret[1];
|
|
1311
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1312
|
+
} finally {
|
|
1313
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
function __wbg_get_imports() {
|
|
1318
|
+
const import0 = {
|
|
1319
|
+
__proto__: null,
|
|
1320
|
+
__wbg___wbindgen_throw_be289d5034ed271b: function (arg0, arg1) {
|
|
1321
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1322
|
+
},
|
|
1323
|
+
__wbg_error_7534b8e9a36f1ab4: function (arg0, arg1) {
|
|
1324
|
+
let deferred0_0;
|
|
1325
|
+
let deferred0_1;
|
|
1326
|
+
try {
|
|
1327
|
+
deferred0_0 = arg0;
|
|
1328
|
+
deferred0_1 = arg1;
|
|
1329
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
1330
|
+
} finally {
|
|
1331
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1332
|
+
}
|
|
1333
|
+
},
|
|
1334
|
+
__wbg_new_8a6f238a6ece86ea: function () {
|
|
1335
|
+
const ret = new Error();
|
|
1336
|
+
return ret;
|
|
1337
|
+
},
|
|
1338
|
+
__wbg_stack_0ed75d68575b0f3c: function (arg0, arg1) {
|
|
1339
|
+
const ret = arg1.stack;
|
|
1340
|
+
const ptr1 = passStringToWasm0(
|
|
1341
|
+
ret,
|
|
1342
|
+
wasm.__wbindgen_malloc,
|
|
1343
|
+
wasm.__wbindgen_realloc,
|
|
1344
|
+
);
|
|
1345
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1346
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1347
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1348
|
+
},
|
|
1349
|
+
__wbindgen_cast_0000000000000001: function (arg0, arg1) {
|
|
1350
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1351
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1352
|
+
return ret;
|
|
1353
|
+
},
|
|
1354
|
+
__wbindgen_init_externref_table: function () {
|
|
1355
|
+
const table = wasm.__wbindgen_externrefs;
|
|
1356
|
+
const offset = table.grow(4);
|
|
1357
|
+
table.set(0, undefined);
|
|
1358
|
+
table.set(offset + 0, undefined);
|
|
1359
|
+
table.set(offset + 1, null);
|
|
1360
|
+
table.set(offset + 2, true);
|
|
1361
|
+
table.set(offset + 3, false);
|
|
1362
|
+
},
|
|
1363
|
+
};
|
|
1364
|
+
return {
|
|
1365
|
+
__proto__: null,
|
|
1366
|
+
'./aeon_pages_runtime_bg.js': import0,
|
|
1367
|
+
};
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
const AeonRouterFinalization =
|
|
1371
|
+
typeof FinalizationRegistry === 'undefined'
|
|
1372
|
+
? { register: () => {}, unregister: () => {} }
|
|
1373
|
+
: new FinalizationRegistry((ptr) =>
|
|
1374
|
+
wasm.__wbg_aeonrouter_free(ptr >>> 0, 1),
|
|
1375
|
+
);
|
|
1376
|
+
const AssetManifestFinalization =
|
|
1377
|
+
typeof FinalizationRegistry === 'undefined'
|
|
1378
|
+
? { register: () => {}, unregister: () => {} }
|
|
1379
|
+
: new FinalizationRegistry((ptr) =>
|
|
1380
|
+
wasm.__wbg_assetmanifest_free(ptr >>> 0, 1),
|
|
1381
|
+
);
|
|
1382
|
+
const CSSManifestFinalization =
|
|
1383
|
+
typeof FinalizationRegistry === 'undefined'
|
|
1384
|
+
? { register: () => {}, unregister: () => {} }
|
|
1385
|
+
: new FinalizationRegistry((ptr) =>
|
|
1386
|
+
wasm.__wbg_cssmanifest_free(ptr >>> 0, 1),
|
|
1387
|
+
);
|
|
1388
|
+
const ComponentRegistryFinalization =
|
|
1389
|
+
typeof FinalizationRegistry === 'undefined'
|
|
1390
|
+
? { register: () => {}, unregister: () => {} }
|
|
1391
|
+
: new FinalizationRegistry((ptr) =>
|
|
1392
|
+
wasm.__wbg_componentregistry_free(ptr >>> 0, 1),
|
|
1393
|
+
);
|
|
1394
|
+
const FontManifestFinalization =
|
|
1395
|
+
typeof FinalizationRegistry === 'undefined'
|
|
1396
|
+
? { register: () => {}, unregister: () => {} }
|
|
1397
|
+
: new FinalizationRegistry((ptr) =>
|
|
1398
|
+
wasm.__wbg_fontmanifest_free(ptr >>> 0, 1),
|
|
1399
|
+
);
|
|
1400
|
+
const RenderContextFinalization =
|
|
1401
|
+
typeof FinalizationRegistry === 'undefined'
|
|
1402
|
+
? { register: () => {}, unregister: () => {} }
|
|
1403
|
+
: new FinalizationRegistry((ptr) =>
|
|
1404
|
+
wasm.__wbg_rendercontext_free(ptr >>> 0, 1),
|
|
1405
|
+
);
|
|
1406
|
+
const RouteDefinitionFinalization =
|
|
1407
|
+
typeof FinalizationRegistry === 'undefined'
|
|
1408
|
+
? { register: () => {}, unregister: () => {} }
|
|
1409
|
+
: new FinalizationRegistry((ptr) =>
|
|
1410
|
+
wasm.__wbg_routedefinition_free(ptr >>> 0, 1),
|
|
1411
|
+
);
|
|
1412
|
+
const RouteMatchFinalization =
|
|
1413
|
+
typeof FinalizationRegistry === 'undefined'
|
|
1414
|
+
? { register: () => {}, unregister: () => {} }
|
|
1415
|
+
: new FinalizationRegistry((ptr) =>
|
|
1416
|
+
wasm.__wbg_routematch_free(ptr >>> 0, 1),
|
|
1417
|
+
);
|
|
1418
|
+
const SerializedComponentFinalization =
|
|
1419
|
+
typeof FinalizationRegistry === 'undefined'
|
|
1420
|
+
? { register: () => {}, unregister: () => {} }
|
|
1421
|
+
: new FinalizationRegistry((ptr) =>
|
|
1422
|
+
wasm.__wbg_serializedcomponent_free(ptr >>> 0, 1),
|
|
1423
|
+
);
|
|
1424
|
+
const TreeDiffFinalization =
|
|
1425
|
+
typeof FinalizationRegistry === 'undefined'
|
|
1426
|
+
? { register: () => {}, unregister: () => {} }
|
|
1427
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_treediff_free(ptr >>> 0, 1));
|
|
1428
|
+
|
|
1429
|
+
function _assertClass(instance, klass) {
|
|
1430
|
+
if (!(instance instanceof klass)) {
|
|
1431
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
let cachedDataViewMemory0 = null;
|
|
1436
|
+
function getDataViewMemory0() {
|
|
1437
|
+
if (
|
|
1438
|
+
cachedDataViewMemory0 === null ||
|
|
1439
|
+
cachedDataViewMemory0.buffer.detached === true ||
|
|
1440
|
+
(cachedDataViewMemory0.buffer.detached === undefined &&
|
|
1441
|
+
cachedDataViewMemory0.buffer !== wasm.memory.buffer)
|
|
1442
|
+
) {
|
|
1443
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1444
|
+
}
|
|
1445
|
+
return cachedDataViewMemory0;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
function getStringFromWasm0(ptr, len) {
|
|
1449
|
+
ptr = ptr >>> 0;
|
|
1450
|
+
return decodeText(ptr, len);
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
let cachedUint8ArrayMemory0 = null;
|
|
1454
|
+
function getUint8ArrayMemory0() {
|
|
1455
|
+
if (
|
|
1456
|
+
cachedUint8ArrayMemory0 === null ||
|
|
1457
|
+
cachedUint8ArrayMemory0.byteLength === 0
|
|
1458
|
+
) {
|
|
1459
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1460
|
+
}
|
|
1461
|
+
return cachedUint8ArrayMemory0;
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
function isLikeNone(x) {
|
|
1465
|
+
return x === undefined || x === null;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1469
|
+
if (realloc === undefined) {
|
|
1470
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1471
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1472
|
+
getUint8ArrayMemory0()
|
|
1473
|
+
.subarray(ptr, ptr + buf.length)
|
|
1474
|
+
.set(buf);
|
|
1475
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1476
|
+
return ptr;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
let len = arg.length;
|
|
1480
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1481
|
+
|
|
1482
|
+
const mem = getUint8ArrayMemory0();
|
|
1483
|
+
|
|
1484
|
+
let offset = 0;
|
|
1485
|
+
|
|
1486
|
+
for (; offset < len; offset++) {
|
|
1487
|
+
const code = arg.charCodeAt(offset);
|
|
1488
|
+
if (code > 0x7f) break;
|
|
1489
|
+
mem[ptr + offset] = code;
|
|
1490
|
+
}
|
|
1491
|
+
if (offset !== len) {
|
|
1492
|
+
if (offset !== 0) {
|
|
1493
|
+
arg = arg.slice(offset);
|
|
1494
|
+
}
|
|
1495
|
+
ptr = realloc(ptr, len, (len = offset + arg.length * 3), 1) >>> 0;
|
|
1496
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1497
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1498
|
+
|
|
1499
|
+
offset += ret.written;
|
|
1500
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
WASM_VECTOR_LEN = offset;
|
|
1504
|
+
return ptr;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
function takeFromExternrefTable0(idx) {
|
|
1508
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1509
|
+
wasm.__externref_table_dealloc(idx);
|
|
1510
|
+
return value;
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
let cachedTextDecoder = new TextDecoder('utf-8', {
|
|
1514
|
+
ignoreBOM: true,
|
|
1515
|
+
fatal: true,
|
|
1516
|
+
});
|
|
1517
|
+
cachedTextDecoder.decode();
|
|
1518
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1519
|
+
let numBytesDecoded = 0;
|
|
1520
|
+
function decodeText(ptr, len) {
|
|
1521
|
+
numBytesDecoded += len;
|
|
1522
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1523
|
+
cachedTextDecoder = new TextDecoder('utf-8', {
|
|
1524
|
+
ignoreBOM: true,
|
|
1525
|
+
fatal: true,
|
|
1526
|
+
});
|
|
1527
|
+
cachedTextDecoder.decode();
|
|
1528
|
+
numBytesDecoded = len;
|
|
1529
|
+
}
|
|
1530
|
+
return cachedTextDecoder.decode(
|
|
1531
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + len),
|
|
1532
|
+
);
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1536
|
+
|
|
1537
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1538
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1539
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1540
|
+
view.set(buf);
|
|
1541
|
+
return {
|
|
1542
|
+
read: arg.length,
|
|
1543
|
+
written: buf.length,
|
|
1544
|
+
};
|
|
1545
|
+
};
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
let WASM_VECTOR_LEN = 0;
|
|
1549
|
+
|
|
1550
|
+
let wasmModule, wasm;
|
|
1551
|
+
function __wbg_finalize_init(instance, module) {
|
|
1552
|
+
wasm = instance.exports;
|
|
1553
|
+
wasmModule = module;
|
|
1554
|
+
cachedDataViewMemory0 = null;
|
|
1555
|
+
cachedUint8ArrayMemory0 = null;
|
|
1556
|
+
wasm.__wbindgen_start();
|
|
1557
|
+
return wasm;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
async function __wbg_load(module, imports) {
|
|
1561
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1562
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1563
|
+
try {
|
|
1564
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1565
|
+
} catch (e) {
|
|
1566
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
1567
|
+
|
|
1568
|
+
if (
|
|
1569
|
+
validResponse &&
|
|
1570
|
+
module.headers.get('Content-Type') !== 'application/wasm'
|
|
1571
|
+
) {
|
|
1572
|
+
console.warn(
|
|
1573
|
+
'`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n',
|
|
1574
|
+
e,
|
|
1575
|
+
);
|
|
1576
|
+
} else {
|
|
1577
|
+
throw e;
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
const bytes = await module.arrayBuffer();
|
|
1583
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1584
|
+
} else {
|
|
1585
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1586
|
+
|
|
1587
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1588
|
+
return { instance, module };
|
|
1589
|
+
} else {
|
|
1590
|
+
return instance;
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
function expectedResponseType(type) {
|
|
1595
|
+
switch (type) {
|
|
1596
|
+
case 'basic':
|
|
1597
|
+
case 'cors':
|
|
1598
|
+
case 'default':
|
|
1599
|
+
return true;
|
|
1600
|
+
}
|
|
1601
|
+
return false;
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
function initSync(module) {
|
|
1606
|
+
if (wasm !== undefined) return wasm;
|
|
1607
|
+
|
|
1608
|
+
if (module !== undefined) {
|
|
1609
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1610
|
+
({ module } = module);
|
|
1611
|
+
} else {
|
|
1612
|
+
console.warn(
|
|
1613
|
+
'using deprecated parameters for `initSync()`; pass a single object instead',
|
|
1614
|
+
);
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
const imports = __wbg_get_imports();
|
|
1619
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1620
|
+
module = new WebAssembly.Module(module);
|
|
1621
|
+
}
|
|
1622
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1623
|
+
return __wbg_finalize_init(instance, module);
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
async function __wbg_init(module_or_path) {
|
|
1627
|
+
if (wasm !== undefined) return wasm;
|
|
1628
|
+
|
|
1629
|
+
if (module_or_path !== undefined) {
|
|
1630
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1631
|
+
({ module_or_path } = module_or_path);
|
|
1632
|
+
} else {
|
|
1633
|
+
console.warn(
|
|
1634
|
+
'using deprecated parameters for the initialization function; pass a single object instead',
|
|
1635
|
+
);
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
if (module_or_path === undefined) {
|
|
1640
|
+
module_or_path = new URL('aeon_pages_runtime_bg.wasm', import.meta.url);
|
|
1641
|
+
}
|
|
1642
|
+
const imports = __wbg_get_imports();
|
|
1643
|
+
|
|
1644
|
+
if (
|
|
1645
|
+
typeof module_or_path === 'string' ||
|
|
1646
|
+
(typeof Request === 'function' && module_or_path instanceof Request) ||
|
|
1647
|
+
(typeof URL === 'function' && module_or_path instanceof URL)
|
|
1648
|
+
) {
|
|
1649
|
+
module_or_path = fetch(module_or_path);
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1653
|
+
|
|
1654
|
+
return __wbg_finalize_init(instance, module);
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
export { initSync, __wbg_init as default };
|