@vizhub/runtime 1.0.0 → 2.0.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/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +165 -225
- package/dist/index.js.map +1 -1
- package/dist/slugCache-DqUp8B5A.js +350 -0
- package/dist/slugCache-DqUp8B5A.js.map +1 -0
- package/dist/slugCache-mB6V-shn.cjs +4 -0
- package/dist/slugCache-mB6V-shn.cjs.map +1 -0
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/package.json +1 -1
- package/dist/slugCache-C1nrdh7e.js +0 -151
- package/dist/slugCache-C1nrdh7e.js.map +0 -1
- package/dist/slugCache-Dz-ZY2WW.cjs +0 -2
- package/dist/slugCache-Dz-ZY2WW.cjs.map +0 -1
package/dist/index.js
CHANGED
@@ -1,34 +1,33 @@
|
|
1
|
-
import { g as
|
2
|
-
import {
|
3
|
-
import { isVizId as
|
4
|
-
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
o.data.type === "invalidateVizCacheResponse" && o.data.requestId === n && (e.removeEventListener(
|
1
|
+
import { g as j, p as I, a as O, b as F, s as z, t as D, d as T, c as V, e as $ } from "./slugCache-DqUp8B5A.js";
|
2
|
+
import { f as oe, j as ie, i as ce, h as ae, k as le } from "./slugCache-DqUp8B5A.js";
|
3
|
+
import { isVizId as W, getFileText as L, generateVizId as A, fileCollectionToVizFiles as P } from "@vizhub/viz-utils";
|
4
|
+
const U = (e) => async (t) => {
|
5
|
+
const s = j();
|
6
|
+
return new Promise((i) => {
|
7
|
+
const r = (o) => {
|
8
|
+
o.data.type === "invalidateVizCacheResponse" && o.data.requestId === s && (e.removeEventListener(
|
10
9
|
"message",
|
11
|
-
|
12
|
-
),
|
10
|
+
r
|
11
|
+
), i());
|
13
12
|
};
|
14
13
|
e.addEventListener(
|
15
14
|
"message",
|
16
|
-
|
15
|
+
r
|
17
16
|
), e.postMessage({
|
18
17
|
type: "invalidateVizCacheRequest",
|
19
18
|
changedVizIds: t,
|
20
|
-
requestId:
|
19
|
+
requestId: s
|
21
20
|
});
|
22
21
|
});
|
23
|
-
},
|
22
|
+
}, q = ({
|
24
23
|
worker: e,
|
25
24
|
setBuildErrorMessage: t
|
26
25
|
}) => ({
|
27
|
-
files:
|
28
|
-
enableSourcemap:
|
29
|
-
vizId:
|
26
|
+
files: s,
|
27
|
+
enableSourcemap: i,
|
28
|
+
vizId: r
|
30
29
|
}) => {
|
31
|
-
const o =
|
30
|
+
const o = j();
|
32
31
|
return new Promise(
|
33
32
|
(c) => {
|
34
33
|
const a = (m) => {
|
@@ -38,49 +37,49 @@ const W = (e) => async (t) => {
|
|
38
37
|
"message",
|
39
38
|
a
|
40
39
|
);
|
41
|
-
const
|
42
|
-
v ? t == null || t(v) : t == null || t(null), c(
|
40
|
+
const w = p.buildResult, v = p.error;
|
41
|
+
v ? t == null || t(v) : t == null || t(null), c(w);
|
43
42
|
}
|
44
43
|
};
|
45
44
|
e.addEventListener("message", a);
|
46
45
|
const u = {
|
47
46
|
type: "buildRequest",
|
48
|
-
files:
|
49
|
-
enableSourcemap:
|
47
|
+
files: s,
|
48
|
+
enableSourcemap: i,
|
50
49
|
requestId: o,
|
51
|
-
vizId:
|
50
|
+
vizId: r
|
52
51
|
};
|
53
52
|
e.postMessage(u);
|
54
53
|
}
|
55
54
|
);
|
56
|
-
}, S = "IDLE",
|
55
|
+
}, S = "IDLE", x = "ENQUEUED", b = "PENDING_CLEAN", C = "PENDING_DIRTY", B = ({
|
57
56
|
iframe: e,
|
58
57
|
worker: t,
|
59
|
-
setBuildErrorMessage:
|
60
|
-
getLatestContent:
|
61
|
-
resolveSlugKey:
|
58
|
+
setBuildErrorMessage: s,
|
59
|
+
getLatestContent: i,
|
60
|
+
resolveSlugKey: r,
|
62
61
|
writeFile: o
|
63
62
|
}) => {
|
64
63
|
let c = S, a = null;
|
65
|
-
const u =
|
64
|
+
const u = q({
|
66
65
|
worker: t,
|
67
|
-
setBuildErrorMessage:
|
66
|
+
setBuildErrorMessage: s
|
68
67
|
}), m = ({
|
69
68
|
data: l
|
70
69
|
}) => {
|
71
|
-
if (l.type === "contentRequest" &&
|
72
|
-
const { vizId:
|
73
|
-
|
70
|
+
if (l.type === "contentRequest" && i) {
|
71
|
+
const { vizId: n } = l;
|
72
|
+
i(n).then((d) => {
|
74
73
|
t.postMessage({
|
75
74
|
type: "contentResponse",
|
76
|
-
vizId:
|
75
|
+
vizId: n,
|
77
76
|
content: d
|
78
77
|
});
|
79
78
|
});
|
80
79
|
} else if (l.type === "resolveSlugRequest") {
|
81
|
-
const { slugKey:
|
82
|
-
if (
|
83
|
-
|
80
|
+
const { slugKey: n, requestId: d } = l;
|
81
|
+
if (r)
|
82
|
+
r(n).then(
|
84
83
|
(f) => {
|
85
84
|
const h = {
|
86
85
|
type: "resolveSlugResponse",
|
@@ -102,43 +101,43 @@ const W = (e) => async (t) => {
|
|
102
101
|
};
|
103
102
|
t.addEventListener("message", m);
|
104
103
|
const p = (l) => {
|
105
|
-
const
|
106
|
-
(
|
104
|
+
const n = l.data;
|
105
|
+
(n.type === "runDone" || n.type === "runError") && n.type === "runError" && s && s(n.error.message), n.type === "writeFile" && o && n.fileName && n.content && o(n.fileName, n.content);
|
107
106
|
};
|
108
107
|
window.addEventListener("message", p);
|
109
|
-
const
|
108
|
+
const w = () => {
|
110
109
|
t.removeEventListener("message", m), window.removeEventListener("message", p);
|
111
110
|
}, v = async ({
|
112
111
|
files: l,
|
113
|
-
enableHotReloading:
|
112
|
+
enableHotReloading: n = !1,
|
114
113
|
enableSourcemap: d = !1,
|
115
114
|
vizId: f
|
116
115
|
}) => {
|
117
|
-
c =
|
116
|
+
c = b;
|
118
117
|
const h = await u({
|
119
118
|
files: l,
|
120
119
|
enableSourcemap: d,
|
121
120
|
vizId: f
|
122
121
|
});
|
123
122
|
if (h) {
|
124
|
-
const { html:
|
125
|
-
if (console.clear(),
|
126
|
-
if (
|
127
|
-
const
|
123
|
+
const { html: E, js: y, css: R } = h;
|
124
|
+
if (console.clear(), n) {
|
125
|
+
if (R) {
|
126
|
+
const N = {
|
128
127
|
type: "runCSS",
|
129
|
-
css:
|
128
|
+
css: R
|
130
129
|
};
|
131
130
|
if (!e.contentWindow)
|
132
131
|
throw new Error(
|
133
132
|
"iframe.contentWindow is null - this should never happen"
|
134
133
|
);
|
135
134
|
e.contentWindow.postMessage(
|
136
|
-
|
135
|
+
N,
|
137
136
|
window.location.origin
|
138
137
|
);
|
139
138
|
}
|
140
139
|
if (y) {
|
141
|
-
const
|
140
|
+
const N = {
|
142
141
|
type: "runJS",
|
143
142
|
js: y
|
144
143
|
};
|
@@ -147,112 +146,53 @@ const W = (e) => async (t) => {
|
|
147
146
|
"iframe.contentWindow is null - this should never happen"
|
148
147
|
);
|
149
148
|
e.contentWindow.postMessage(
|
150
|
-
|
149
|
+
N,
|
151
150
|
window.location.origin
|
152
151
|
);
|
153
152
|
}
|
154
153
|
} else
|
155
|
-
e.srcdoc =
|
154
|
+
e.srcdoc = E || "";
|
156
155
|
}
|
157
|
-
c ===
|
156
|
+
c === C ? (requestAnimationFrame(() => {
|
158
157
|
if (!a)
|
159
158
|
throw new Error(
|
160
159
|
"latestFiles is not defined and state is PENDING_DIRTY - this should never happen"
|
161
160
|
);
|
162
161
|
v({
|
163
162
|
files: a,
|
164
|
-
enableHotReloading:
|
163
|
+
enableHotReloading: n,
|
165
164
|
enableSourcemap: d,
|
166
165
|
vizId: f
|
167
166
|
});
|
168
|
-
}), c =
|
169
|
-
},
|
167
|
+
}), c = x) : c = S;
|
168
|
+
}, g = ({
|
170
169
|
files: l,
|
171
|
-
enableHotReloading:
|
170
|
+
enableHotReloading: n = !1,
|
172
171
|
enableSourcemap: d = !1,
|
173
172
|
vizId: f = void 0
|
174
173
|
}) => {
|
175
174
|
if (a = null, c === S)
|
176
|
-
c =
|
175
|
+
c = x, v({
|
177
176
|
files: l,
|
178
|
-
enableHotReloading:
|
177
|
+
enableHotReloading: n,
|
179
178
|
enableSourcemap: d,
|
180
179
|
vizId: f
|
181
180
|
});
|
182
|
-
else if (c === R)
|
183
|
-
a = l, c = x;
|
184
|
-
else if (c === x)
|
185
|
-
a = l;
|
186
181
|
else if (c === b)
|
182
|
+
a = l, c = C;
|
183
|
+
else if (c === C)
|
184
|
+
a = l;
|
185
|
+
else if (c === x)
|
187
186
|
a = l;
|
188
187
|
else
|
189
188
|
throw new Error(`Unexpected state: ${c}`);
|
190
189
|
};
|
191
190
|
return {
|
192
|
-
invalidateVizCache:
|
193
|
-
run:
|
194
|
-
cleanup:
|
195
|
-
};
|
196
|
-
};
|
197
|
-
function A(e = {}) {
|
198
|
-
return {
|
199
|
-
name: "sucrase",
|
200
|
-
transform(t, n) {
|
201
|
-
if (!n.match(/\.(?:js|[jt]sx)$/))
|
202
|
-
return null;
|
203
|
-
const r = V(t, {
|
204
|
-
transforms: ["jsx", "typescript"],
|
205
|
-
// For source maps
|
206
|
-
filePath: n,
|
207
|
-
sourceMapOptions: {
|
208
|
-
compiledFilename: "bundle.js"
|
209
|
-
},
|
210
|
-
production: !0,
|
211
|
-
...e
|
212
|
-
});
|
213
|
-
return {
|
214
|
-
code: r.code,
|
215
|
-
map: r.sourceMap
|
216
|
-
};
|
217
|
-
}
|
218
|
-
};
|
219
|
-
}
|
220
|
-
const O = {
|
221
|
-
dependencies: {},
|
222
|
-
vizhub: {},
|
223
|
-
license: "MIT"
|
224
|
-
}, U = !1, C = (e) => {
|
225
|
-
const t = e["package.json"];
|
226
|
-
try {
|
227
|
-
const n = t ? JSON.parse(t) : O;
|
228
|
-
return U && console.log(
|
229
|
-
"[packageJSON] pkg:",
|
230
|
-
JSON.stringify(n, null, 2)
|
231
|
-
), n;
|
232
|
-
} catch {
|
233
|
-
return O;
|
234
|
-
}
|
235
|
-
}, J = (e) => C(e).dependencies || {}, q = (e) => (C(e).vizhub || {}).libraries || {}, G = ({ name: e, version: t }, n, r = "jsdelivr") => {
|
236
|
-
const s = n[e] && n[e].path || "";
|
237
|
-
return r === "jsdelivr" ? `https://cdn.jsdelivr.net/npm/${e}@${t}${s}` : `https://unpkg.com/${e}@${t}${s}`;
|
238
|
-
}, k = (e) => {
|
239
|
-
var n;
|
240
|
-
const t = (n = e == null ? void 0 : e.vizhub) == null ? void 0 : n.libraries;
|
241
|
-
return t ? Object.entries(t).reduce(
|
242
|
-
(r, [s, o]) => (o.global && (r[s] = o.global), r),
|
243
|
-
{}
|
244
|
-
) : {};
|
245
|
-
}, _ = {
|
246
|
-
d3: "d3",
|
247
|
-
react: "React",
|
248
|
-
"react-dom": "ReactDOM"
|
249
|
-
}, M = (e) => {
|
250
|
-
const t = k(e);
|
251
|
-
return {
|
252
|
-
..._,
|
253
|
-
...t
|
191
|
+
invalidateVizCache: U(t),
|
192
|
+
run: g,
|
193
|
+
cleanup: w
|
254
194
|
};
|
255
|
-
},
|
195
|
+
}, J = `var EOL = {},
|
256
196
|
EOF = {},
|
257
197
|
QUOTE = 34,
|
258
198
|
NEWLINE = 10,
|
@@ -372,84 +312,84 @@ var tsv = dsv(' ');
|
|
372
312
|
|
373
313
|
var tsvParse = tsv.parse;
|
374
314
|
|
375
|
-
export { csvParse, tsvParse };`,
|
315
|
+
export { csvParse, tsvParse };`, k = (e) => (
|
376
316
|
// str.replace(/`/g, '\\`');
|
377
317
|
e.replace(/\\/g, "\\\\").replace(/`/g, "\\`")
|
378
|
-
),
|
318
|
+
), _ = () => ({
|
379
319
|
name: "transformDSV",
|
380
320
|
// `id` here is of the form
|
381
321
|
// `{vizId}/{fileName}`
|
382
322
|
transform: async (e, t) => {
|
383
|
-
const { fileName:
|
384
|
-
if (
|
323
|
+
const { fileName: s } = I(t), i = s.endsWith(".csv"), r = s.endsWith(".tsv");
|
324
|
+
if (i || r)
|
385
325
|
return {
|
386
326
|
code: `
|
387
|
-
${
|
388
|
-
const data = ${
|
327
|
+
${J}
|
328
|
+
const data = ${i ? "csvParse" : "tsvParse"}(\`${k(e)}\`);
|
389
329
|
export default data;
|
390
330
|
`,
|
391
331
|
map: { mappings: "" }
|
392
332
|
};
|
393
333
|
}
|
394
|
-
}),
|
395
|
-
const t = /^@([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_-]+)$/,
|
396
|
-
return
|
397
|
-
userName:
|
398
|
-
idOrSlug:
|
334
|
+
}), G = (e) => {
|
335
|
+
const t = /^@([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_-]+)$/, s = e.match(t);
|
336
|
+
return s ? {
|
337
|
+
userName: s[1],
|
338
|
+
idOrSlug: s[2]
|
399
339
|
} : null;
|
400
|
-
},
|
340
|
+
}, Q = ({
|
401
341
|
vizId: e,
|
402
342
|
slugCache: t
|
403
343
|
}) => ({
|
404
344
|
name: "vizResolve",
|
405
|
-
resolveId: async (
|
406
|
-
if (
|
407
|
-
let o =
|
408
|
-
if (!o.endsWith(".js") && !o.endsWith(".css") && !o.endsWith(".csv") && !o.endsWith(".svelte") && (o += ".js"),
|
345
|
+
resolveId: async (s, i) => {
|
346
|
+
if (s.startsWith("./") && !(i != null && i.startsWith("https://"))) {
|
347
|
+
let o = s.substring(2);
|
348
|
+
if (!o.endsWith(".js") && !o.endsWith(".css") && !o.endsWith(".csv") && !o.endsWith(".svelte") && (o += ".js"), i) {
|
409
349
|
const {
|
410
350
|
vizId: c,
|
411
351
|
fileName: a
|
412
|
-
} =
|
352
|
+
} = I(i), u = a.split("/").slice(0, -1).join("/"), m = u ? `${u}/${o}` : o;
|
413
353
|
return `${c}/${m}`;
|
414
354
|
}
|
415
355
|
return e + "/" + o;
|
416
356
|
}
|
417
|
-
const
|
418
|
-
if (
|
357
|
+
const r = G(s);
|
358
|
+
if (r) {
|
419
359
|
let o;
|
420
|
-
if (
|
421
|
-
o =
|
360
|
+
if (W(r.idOrSlug))
|
361
|
+
o = r.idOrSlug;
|
422
362
|
else {
|
423
363
|
if (!t)
|
424
364
|
throw new Error(
|
425
365
|
"slugCache is required to import by slug in v3 runtime"
|
426
366
|
);
|
427
367
|
o = await t.get(
|
428
|
-
`${
|
368
|
+
`${r.userName}/${r.idOrSlug}`
|
429
369
|
);
|
430
370
|
}
|
431
371
|
return o + "/index.js";
|
432
372
|
}
|
433
373
|
}
|
434
|
-
}),
|
374
|
+
}), M = ({
|
435
375
|
vizCache: e,
|
436
376
|
trackCSSImport: t,
|
437
|
-
vizId:
|
438
|
-
files:
|
377
|
+
vizId: s,
|
378
|
+
files: i
|
439
379
|
}) => ({
|
440
380
|
name: "vizLoad",
|
441
381
|
// `id` here is of the form
|
442
382
|
// `{vizId}/{fileName}`
|
443
|
-
load: async (
|
444
|
-
const o =
|
383
|
+
load: async (r) => {
|
384
|
+
const o = I(r), c = o.vizId, a = o.fileName;
|
445
385
|
if (a.endsWith(".css"))
|
446
|
-
return t(
|
386
|
+
return t(r), "";
|
447
387
|
let u = null;
|
448
|
-
if (c ===
|
449
|
-
u =
|
388
|
+
if (c === s && i)
|
389
|
+
u = i[a] || null;
|
450
390
|
else {
|
451
391
|
const m = await e.get(c);
|
452
|
-
u =
|
392
|
+
u = L(m, a);
|
453
393
|
}
|
454
394
|
if (u === null)
|
455
395
|
throw new Error(
|
@@ -457,86 +397,86 @@ export { csvParse, tsvParse };`, Y = (e) => (
|
|
457
397
|
);
|
458
398
|
return u;
|
459
399
|
}
|
460
|
-
}),
|
400
|
+
}), Y = async ({
|
461
401
|
files: e,
|
462
402
|
rollup: t,
|
463
|
-
enableSourcemap:
|
464
|
-
vizCache:
|
465
|
-
vizId:
|
403
|
+
enableSourcemap: s = !0,
|
404
|
+
vizCache: i,
|
405
|
+
vizId: r,
|
466
406
|
slugCache: o,
|
467
407
|
getSvelteCompiler: c
|
468
408
|
}) => {
|
469
|
-
const a = /* @__PURE__ */ new Set(), u = (
|
470
|
-
a.add(
|
409
|
+
const a = /* @__PURE__ */ new Set(), u = (n) => {
|
410
|
+
a.add(n);
|
471
411
|
};
|
472
412
|
if (!e["index.js"])
|
473
413
|
throw new Error("Missing index.js");
|
474
414
|
const p = {
|
475
415
|
input: "./index.js",
|
476
416
|
plugins: [
|
477
|
-
...
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
...
|
482
|
-
|
483
|
-
vizCache:
|
417
|
+
...r ? [Q({ vizId: r, slugCache: o })] : [],
|
418
|
+
_(),
|
419
|
+
z(),
|
420
|
+
D({ getSvelteCompiler: c }),
|
421
|
+
...i ? [
|
422
|
+
M({
|
423
|
+
vizCache: i,
|
484
424
|
trackCSSImport: u,
|
485
|
-
vizId:
|
425
|
+
vizId: r,
|
486
426
|
files: e
|
487
427
|
})
|
488
428
|
] : []
|
489
429
|
],
|
490
|
-
onwarn(
|
491
|
-
|
430
|
+
onwarn(n, d) {
|
431
|
+
n.code !== "UNRESOLVED_IMPORT" && d(n);
|
492
432
|
}
|
493
|
-
},
|
433
|
+
}, w = {
|
494
434
|
format: "umd",
|
495
435
|
name: "Viz",
|
496
|
-
sourcemap: !!
|
436
|
+
sourcemap: !!s,
|
497
437
|
compact: !0
|
498
|
-
}, v =
|
438
|
+
}, v = O(e);
|
499
439
|
if (v) {
|
500
|
-
const
|
501
|
-
|
440
|
+
const n = F(v);
|
441
|
+
n && (p.external = Object.keys(n), w.globals = n);
|
502
442
|
}
|
503
|
-
const
|
443
|
+
const g = await t(p), { output: l } = await g.generate(w);
|
504
444
|
return {
|
505
445
|
src: l[0].code,
|
506
446
|
cssFiles: Array.from(a)
|
507
447
|
};
|
508
448
|
};
|
509
|
-
function
|
449
|
+
function Z() {
|
510
450
|
return Math.random().toString().slice(2, 7);
|
511
451
|
}
|
512
|
-
const
|
452
|
+
const K = ({
|
513
453
|
cdn: e,
|
514
454
|
src: t,
|
515
|
-
styles:
|
455
|
+
styles: s
|
516
456
|
}) => {
|
517
|
-
const
|
457
|
+
const r = `viz-container-${Z()}`;
|
518
458
|
return `<!DOCTYPE html>
|
519
459
|
<html>
|
520
460
|
<head>
|
521
|
-
<meta charset="utf-8">${e}${
|
461
|
+
<meta charset="utf-8">${e}${s}
|
522
462
|
<style>
|
523
463
|
body {
|
524
464
|
margin: 0;
|
525
465
|
overflow: hidden;
|
526
466
|
}
|
527
|
-
#${
|
467
|
+
#${r} {
|
528
468
|
height: 100vh;
|
529
469
|
}
|
530
470
|
</style>
|
531
471
|
</head>
|
532
472
|
<body>
|
533
|
-
<div id="${
|
473
|
+
<div id="${r}"></div>
|
534
474
|
<script id="injected-script">${t}<\/script>
|
535
475
|
<script>
|
536
476
|
(() => {
|
537
477
|
let cleanup;
|
538
478
|
const render = () => {
|
539
|
-
const container = document.getElementById('${
|
479
|
+
const container = document.getElementById('${r}');
|
540
480
|
typeof cleanup === 'function' && cleanup();
|
541
481
|
cleanup = Viz.main(container, { state: window.state, setState, writeFile });
|
542
482
|
};
|
@@ -594,49 +534,49 @@ const te = ({
|
|
594
534
|
<\/script>
|
595
535
|
</body>
|
596
536
|
</html>`;
|
597
|
-
},
|
537
|
+
}, ee = async ({
|
598
538
|
files: e,
|
599
539
|
rollup: t,
|
600
|
-
enableSourcemap:
|
601
|
-
vizCache:
|
602
|
-
vizId:
|
540
|
+
enableSourcemap: s = !0,
|
541
|
+
vizCache: i,
|
542
|
+
vizId: r,
|
603
543
|
slugCache: o,
|
604
544
|
getSvelteCompiler: c
|
605
545
|
}) => {
|
606
|
-
const { src: a, cssFiles: u } = await
|
546
|
+
const { src: a, cssFiles: u } = await Y({
|
607
547
|
files: e,
|
608
548
|
rollup: t,
|
609
|
-
enableSourcemap:
|
610
|
-
vizCache:
|
611
|
-
vizId:
|
549
|
+
enableSourcemap: s,
|
550
|
+
vizCache: i,
|
551
|
+
vizId: r,
|
612
552
|
slugCache: o,
|
613
553
|
getSvelteCompiler: c
|
614
554
|
});
|
615
555
|
let m = [];
|
616
556
|
if (u.length > 0)
|
617
557
|
for (let l = 0; l < u.length; l++) {
|
618
|
-
const
|
619
|
-
let
|
620
|
-
if (f ===
|
621
|
-
|
558
|
+
const n = u[l], d = I(n), f = d.vizId, h = d.fileName;
|
559
|
+
let E = null;
|
560
|
+
if (f === r && e)
|
561
|
+
E = e[h] || null;
|
622
562
|
else {
|
623
|
-
const y = await
|
624
|
-
|
563
|
+
const y = await i.get(f);
|
564
|
+
E = L(y, h);
|
625
565
|
}
|
626
|
-
|
566
|
+
E && m.push(E);
|
627
567
|
}
|
628
568
|
const p = m.join(`
|
629
|
-
`),
|
569
|
+
`), w = `
|
630
570
|
<style id="injected-style">${p}</style>`;
|
631
571
|
let v = "";
|
632
|
-
const
|
633
|
-
|
572
|
+
const g = Object.entries(
|
573
|
+
T(e)
|
634
574
|
);
|
635
|
-
if (
|
636
|
-
const l =
|
637
|
-
v =
|
638
|
-
const h =
|
639
|
-
{ name:
|
575
|
+
if (g.length > 0) {
|
576
|
+
const l = V(e);
|
577
|
+
v = g.map(([n, d], f) => {
|
578
|
+
const h = $(
|
579
|
+
{ name: n, version: d },
|
640
580
|
l
|
641
581
|
);
|
642
582
|
return `${f > 0 ? " " : `
|
@@ -644,31 +584,31 @@ const te = ({
|
|
644
584
|
}).join("");
|
645
585
|
}
|
646
586
|
return {
|
647
|
-
html:
|
587
|
+
html: K({ cdn: v, src: a, styles: w }),
|
648
588
|
css: p,
|
649
589
|
js: a
|
650
590
|
};
|
651
|
-
},
|
591
|
+
}, te = ({
|
652
592
|
rawMessage: e,
|
653
593
|
vizId: t
|
654
594
|
}) => {
|
655
|
-
const
|
656
|
-
return e == null ? void 0 : e.replace(
|
657
|
-
},
|
658
|
-
id:
|
659
|
-
files:
|
595
|
+
const s = new RegExp(t, "g");
|
596
|
+
return e == null ? void 0 : e.replace(s, ".");
|
597
|
+
}, ne = (e, t = "Sample Content for Exporting", s = A()) => ({
|
598
|
+
id: s,
|
599
|
+
files: P(e),
|
660
600
|
title: t
|
661
601
|
});
|
662
602
|
export {
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
603
|
+
oe as build,
|
604
|
+
te as cleanRollupErrorMessage,
|
605
|
+
Y as computeBundleJSV3,
|
606
|
+
B as createRuntime,
|
607
|
+
ie as createSlugCache,
|
608
|
+
ce as createVizCache,
|
609
|
+
ne as createVizContent,
|
610
|
+
ae as determineRuntimeVersion,
|
611
|
+
le as svelteCompilerUrl,
|
612
|
+
ee as v3Build
|
673
613
|
};
|
674
614
|
//# sourceMappingURL=index.js.map
|