@pebble-software/bonsai 0.2.1 → 0.4.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/README.md +47 -5
- package/dist/ast.js +1 -1
- package/dist/chunks/{builder.meta-B7Y9M7Ab.js → builder.meta-DKq-ggkn.js} +3 -3
- package/dist/chunks/{builder.meta-B7Y9M7Ab.js.map → builder.meta-DKq-ggkn.js.map} +1 -1
- package/dist/chunks/class-names-CoKRVvWM.js +66 -0
- package/dist/chunks/class-names-CoKRVvWM.js.map +1 -0
- package/dist/chunks/{create-renderer-C4nV9RV6.js → create-renderer-CSFyNcqr.js} +55 -55
- package/dist/chunks/create-renderer-CSFyNcqr.js.map +1 -0
- package/dist/chunks/{index-CD5pykpk.js → index-df-PhUtD.js} +2 -2
- package/dist/chunks/{index-CD5pykpk.js.map → index-df-PhUtD.js.map} +1 -1
- package/dist/chunks/{render-shared-Cwb527d4.js → render-shared-DSYQFhTh.js} +3 -3
- package/dist/chunks/render-shared-DSYQFhTh.js.map +1 -0
- package/dist/classes.d.ts +51 -0
- package/dist/classes.js +27 -0
- package/dist/classes.js.map +1 -0
- package/dist/classes.json +1 -0
- package/dist/components/ui/signature-pad.d.ts +2 -2
- package/dist/constants.js +7 -2
- package/dist/constants.js.map +1 -1
- package/dist/core.js +3 -3
- package/dist/css.d.ts +42 -0
- package/dist/css.js +7483 -0
- package/dist/css.js.map +1 -0
- package/dist/index.js +120 -110
- package/dist/index.js.map +1 -1
- package/dist/lib/ast/class-names.d.ts +28 -0
- package/dist/library/constants/src/components.d.ts +1 -0
- package/dist/presets/signature.js +2 -2
- package/dist/presets/signature.js.map +1 -1
- package/dist/schemas.js +1 -1
- package/dist/styles/presets.json +2 -1
- package/package.json +13 -1
- package/dist/chunks/create-renderer-C4nV9RV6.js.map +0 -1
- package/dist/chunks/render-shared-Cwb527d4.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { u as
|
|
3
|
-
import
|
|
4
|
-
import { createErrorMap as
|
|
5
|
-
import { a as u, P as
|
|
6
|
-
import { c as $, a as
|
|
7
|
-
import { u as
|
|
8
|
-
import { calendarPreset as
|
|
9
|
-
import { signaturePreset as
|
|
10
|
-
import {
|
|
1
|
+
import { c as R } from "./chunks/create-renderer-CSFyNcqr.js";
|
|
2
|
+
import { u as ke } from "./chunks/create-renderer-CSFyNcqr.js";
|
|
3
|
+
import T, { z as e } from "zod";
|
|
4
|
+
import { createErrorMap as z } from "zod-validation-error";
|
|
5
|
+
import { a as u, P as D } from "./chunks/builder.meta-DKq-ggkn.js";
|
|
6
|
+
import { c as $, a as C, d as P, e as j, f as B, b as U } from "./chunks/render-shared-DSYQFhTh.js";
|
|
7
|
+
import { u as je } from "./chunks/render-shared-DSYQFhTh.js";
|
|
8
|
+
import { calendarPreset as A } from "./presets/calendar.js";
|
|
9
|
+
import { signaturePreset as I } from "./presets/signature.js";
|
|
10
|
+
import { STRUCTURAL_COMPONENTS as q } from "./constants.js";
|
|
11
|
+
import { i as N, a as M } from "./chunks/class-names-CoKRVvWM.js";
|
|
11
12
|
const c = e.string().length(24).meta({
|
|
12
13
|
description: "MongoDB ObjectId (24-character hex string)",
|
|
13
14
|
example: "67e091ab2c4d3f22001a2b3c"
|
|
@@ -157,7 +158,7 @@ e.object({
|
|
|
157
158
|
name: e.string().meta({ description: "Template name", example: "Neural_NDA_v3" }),
|
|
158
159
|
contentHash: e.string().optional().meta({ description: "SHA-256 hash of the config, useful for deduplication" })
|
|
159
160
|
}).strict().meta({ description: "Created template summary" });
|
|
160
|
-
const
|
|
161
|
+
const F = e.enum([
|
|
161
162
|
"pending",
|
|
162
163
|
"captured",
|
|
163
164
|
"completed",
|
|
@@ -181,7 +182,7 @@ e.object({
|
|
|
181
182
|
header: e.any().meta({ description: "Snapshot of the (small) Bonsai component tree config used for the output PDF page header rendering", readOnly: !0 }),
|
|
182
183
|
footer: e.any().meta({ description: "Snapshot of the (small) Bonsai component tree config used for the output PDF page footer rendering", readOnly: !0 }),
|
|
183
184
|
css: e.string().meta({ description: "Tailwind CSS generated from the template at the time of form creation", readOnly: !0 }),
|
|
184
|
-
status:
|
|
185
|
+
status: F.meta({ description: "Current lifecycle status of the form request", example: "pending" }),
|
|
185
186
|
organization: c.meta({ description: "Organization that owns this form request", readOnly: !0 }),
|
|
186
187
|
createdAt: d.meta({ description: "When the form request was created", readOnly: !0 }),
|
|
187
188
|
updatedAt: d.meta({ description: "When the form request was last updated", readOnly: !0 })
|
|
@@ -285,7 +286,7 @@ e.object({
|
|
|
285
286
|
e.object({
|
|
286
287
|
token: e.string().meta({ description: "New JWT access token (1 hour expiry)", example: "eyJhbGciOiJIUzI1NiIs...c012" })
|
|
287
288
|
}).strict().meta({ description: "New JWT access token" });
|
|
288
|
-
const
|
|
289
|
+
const W = e.enum([
|
|
289
290
|
"application/pdf",
|
|
290
291
|
"image/png",
|
|
291
292
|
"image/jpeg",
|
|
@@ -299,10 +300,10 @@ e.object({
|
|
|
299
300
|
e.object({
|
|
300
301
|
downloadUrl: e.string().url().meta({ description: "Pre-signed GCS download URL", example: "https://storage.googleapis.com/bonsai-secure/f1e2d3...X-Goog-Signature=def456" }),
|
|
301
302
|
filename: e.string().meta({ description: "Original filename (for Content-Disposition)", example: "signed_nda_razorjack.pdf" }),
|
|
302
|
-
mimeType:
|
|
303
|
+
mimeType: W.meta({ description: "MIME type (for Content-Type)", example: "application/pdf" }),
|
|
303
304
|
size: e.number().int().meta({ description: "File size in bytes", example: 245760 })
|
|
304
305
|
}).strict().meta({ description: "Signed download URL for secure file access" });
|
|
305
|
-
const
|
|
306
|
+
const _ = e.enum([
|
|
306
307
|
"pending",
|
|
307
308
|
"generating",
|
|
308
309
|
"completed",
|
|
@@ -321,7 +322,7 @@ e.object({
|
|
|
321
322
|
header: e.any().meta({ description: "Snapshot of the (small) Bonsai component tree config used for the output PDF page header rendering" }),
|
|
322
323
|
footer: e.any().meta({ description: "Snapshot of the (small) Bonsai component tree config used for the output PDF page footer rendering" }),
|
|
323
324
|
css: e.string().meta({ description: "Tailwind CSS generated from the template at the time of PDF generation request", readOnly: !0 }),
|
|
324
|
-
status:
|
|
325
|
+
status: _.meta({ description: "Current lifecycle status of the PDF request", example: "pending" }),
|
|
325
326
|
organization: c.meta({ description: "Organization that owns this PDF request", readOnly: !0 }),
|
|
326
327
|
createdAt: d.meta({ description: "When the PDF request was created", readOnly: !0 }),
|
|
327
328
|
updatedAt: d.meta({ description: "When the PDF request was last updated", readOnly: !0 })
|
|
@@ -341,30 +342,30 @@ e.object({
|
|
|
341
342
|
e.object({
|
|
342
343
|
pdfId: e.string().meta({ description: "MongoDB ObjectId of the newly created PDF request (this is NOT the rendered pdf file - a file ID is returned after async pdf generation via webhook)", example: "67e091ab2c4d3f22001a2b3c", readOnly: !0 })
|
|
343
344
|
}).strict().meta({ description: "Created form request identifier" });
|
|
344
|
-
|
|
345
|
-
customError:
|
|
345
|
+
T.config({
|
|
346
|
+
customError: z()
|
|
346
347
|
});
|
|
347
348
|
const E = {
|
|
348
349
|
...$,
|
|
349
|
-
...
|
|
350
|
-
...
|
|
351
|
-
},
|
|
352
|
-
...
|
|
353
|
-
...
|
|
354
|
-
...
|
|
355
|
-
},
|
|
350
|
+
...A.components,
|
|
351
|
+
...I.components
|
|
352
|
+
}, H = {
|
|
353
|
+
...C,
|
|
354
|
+
...A.controlledInputs,
|
|
355
|
+
...I.controlledInputs
|
|
356
|
+
}, v = B(U, {
|
|
356
357
|
components: E,
|
|
357
|
-
controlledInputs:
|
|
358
|
-
}),
|
|
359
|
-
...
|
|
358
|
+
controlledInputs: H
|
|
359
|
+
}), L = P({
|
|
360
|
+
...v,
|
|
360
361
|
components: Object.fromEntries(
|
|
361
|
-
Object.entries(
|
|
362
|
+
Object.entries(v.components).map(([t, i]) => [
|
|
362
363
|
t,
|
|
363
|
-
|
|
364
|
+
j({ ...i, propsSchema: D[t]?.argsSchema })
|
|
364
365
|
])
|
|
365
366
|
)
|
|
366
367
|
});
|
|
367
|
-
function
|
|
368
|
+
function J(t, i) {
|
|
368
369
|
if (!t)
|
|
369
370
|
return { action: "render", reason: "no-pin" };
|
|
370
371
|
if (t.id !== i.id)
|
|
@@ -380,8 +381,7 @@ function H(t, i) {
|
|
|
380
381
|
warning: n ? `Template is pinned to registry "${t.id}"@"${t.version}" (manifest ${t.manifestHash}), but the resolved manifest is now ${i.manifestHash}. Re-pin on next save.` : `Template is pinned to registry "${t.id}"@"${t.version}", but rendering registry is "${t.id}"@"${i.version}". Re-pin on next save.`
|
|
381
382
|
};
|
|
382
383
|
}
|
|
383
|
-
|
|
384
|
-
function J(t, i) {
|
|
384
|
+
function V(t, i) {
|
|
385
385
|
return t.capabilities ? i === "pdf" ? t.capabilities.includes("pdf") : t.capabilities.includes("ssr") : !0;
|
|
386
386
|
}
|
|
387
387
|
function b(t, i, n, o, a) {
|
|
@@ -391,9 +391,9 @@ function b(t, i, n, o, a) {
|
|
|
391
391
|
a.push({ path: i, message: "Node is missing a required `type` field" });
|
|
392
392
|
return;
|
|
393
393
|
}
|
|
394
|
-
if (
|
|
394
|
+
if (q.has(r)) {
|
|
395
395
|
(t.children ?? []).forEach(
|
|
396
|
-
(
|
|
396
|
+
(l, p) => b(l, `${i}.children[${p}]`, n, o, a)
|
|
397
397
|
);
|
|
398
398
|
return;
|
|
399
399
|
}
|
|
@@ -406,14 +406,14 @@ function b(t, i, n, o, a) {
|
|
|
406
406
|
});
|
|
407
407
|
return;
|
|
408
408
|
}
|
|
409
|
-
if (
|
|
409
|
+
if (V(s, o) || a.push({
|
|
410
410
|
path: i,
|
|
411
411
|
componentType: r,
|
|
412
412
|
message: `Component "${r}" in registry "${n.id}"@"${n.version}" does not support "${o}" rendering`
|
|
413
413
|
}), s.propsSchema) {
|
|
414
|
-
const
|
|
415
|
-
if (!
|
|
416
|
-
for (const p of
|
|
414
|
+
const l = s.propsSchema.safeParse(t.args);
|
|
415
|
+
if (!l.success)
|
|
416
|
+
for (const p of l.error.issues) {
|
|
417
417
|
const f = p.path.length ? `${i}.args.${p.path.join(".")}` : `${i}.args`;
|
|
418
418
|
a.push({ path: f, componentType: r, message: p.message });
|
|
419
419
|
}
|
|
@@ -422,29 +422,39 @@ function b(t, i, n, o, a) {
|
|
|
422
422
|
path: `${i}.args.onClick`,
|
|
423
423
|
componentType: r,
|
|
424
424
|
message: `Component "${r}" in registry "${n.id}"@"${n.version}" does not accept onClick`
|
|
425
|
-
})
|
|
425
|
+
});
|
|
426
|
+
for (const [l, p] of Object.entries(t.args ?? {})) {
|
|
427
|
+
if (!N(l)) continue;
|
|
428
|
+
const { issue: f } = M(p);
|
|
429
|
+
f && a.push({
|
|
430
|
+
path: `${i}.args.${l}`,
|
|
431
|
+
componentType: r,
|
|
432
|
+
message: `${l} ${f}`
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
(t.children?.length ?? 0) > 0 && (s.capabilities && !s.capabilities.includes("children") && a.push({
|
|
426
436
|
path: i,
|
|
427
437
|
componentType: r,
|
|
428
438
|
message: `Component "${r}" in registry "${n.id}"@"${n.version}" does not accept children`
|
|
429
439
|
}), (t.children ?? []).forEach(
|
|
430
|
-
(
|
|
440
|
+
(l, p) => b(l, `${i}.children[${p}]`, n, o, a)
|
|
431
441
|
));
|
|
432
442
|
}
|
|
433
|
-
function
|
|
443
|
+
function ge(t, i, n = {}) {
|
|
434
444
|
const o = [], a = [];
|
|
435
445
|
if (n.pin) {
|
|
436
|
-
const r =
|
|
446
|
+
const r = J(n.pin, i);
|
|
437
447
|
if (r.action === "fail")
|
|
438
448
|
return o.push({ path: "root", message: r.error }), { valid: !1, errors: o, warnings: a };
|
|
439
449
|
r.reason === "version-skew" && a.push(r.warning);
|
|
440
450
|
}
|
|
441
451
|
return b(t, "root", i, n.mode ?? "web", o), { valid: o.length === 0, errors: o, warnings: a };
|
|
442
452
|
}
|
|
443
|
-
const
|
|
453
|
+
const G = e.string().refine((t) => t.startsWith("{{") && t.endsWith("}}"), {
|
|
444
454
|
message: 'Expected a value of the declared type, or a "{{binding}}" expression'
|
|
445
455
|
});
|
|
446
456
|
function y(t, i = {}) {
|
|
447
|
-
const n = (a) => i.allowBindings ? e.union([
|
|
457
|
+
const n = (a) => i.allowBindings ? e.union([G, a]) : a;
|
|
448
458
|
if ("const" in t)
|
|
449
459
|
return n(e.literal(t.const));
|
|
450
460
|
if (Array.isArray(t.enum)) {
|
|
@@ -452,7 +462,7 @@ function y(t, i = {}) {
|
|
|
452
462
|
if (a.length === 0)
|
|
453
463
|
throw new Error("jsonSchemaToZod: enum must have at least one value");
|
|
454
464
|
const [r, ...s] = a;
|
|
455
|
-
return n(s.reduce((
|
|
465
|
+
return n(s.reduce((m, l) => e.union([m, e.literal(l)]), e.literal(r)));
|
|
456
466
|
}
|
|
457
467
|
const o = t.type;
|
|
458
468
|
switch (o) {
|
|
@@ -473,31 +483,31 @@ function y(t, i = {}) {
|
|
|
473
483
|
}
|
|
474
484
|
case "object": {
|
|
475
485
|
const a = t.properties ?? {}, r = new Set(t.required ?? []), s = {};
|
|
476
|
-
for (const [
|
|
486
|
+
for (const [l, p] of Object.entries(a)) {
|
|
477
487
|
const f = y(p, i);
|
|
478
|
-
s[
|
|
488
|
+
s[l] = r.has(l) ? f : f.optional();
|
|
479
489
|
}
|
|
480
|
-
let
|
|
481
|
-
return t.additionalProperties === !1 && (
|
|
490
|
+
let m = e.object(s);
|
|
491
|
+
return t.additionalProperties === !1 && (m = m.strict()), m;
|
|
482
492
|
}
|
|
483
493
|
default:
|
|
484
494
|
return e.unknown();
|
|
485
495
|
}
|
|
486
496
|
}
|
|
487
|
-
const
|
|
497
|
+
const Z = e.object({
|
|
488
498
|
valueProp: e.string().min(1),
|
|
489
499
|
changeProp: e.string().min(1),
|
|
490
500
|
extract: e.string().min(1)
|
|
491
|
-
}).strict(),
|
|
501
|
+
}).strict(), K = e.object({
|
|
492
502
|
name: e.string().min(1),
|
|
493
503
|
canonicalName: e.string().min(1).optional(),
|
|
494
504
|
// Case A: a key resolved against `base`'s exports, never a module path to import.
|
|
495
505
|
entry: e.string().min(1),
|
|
496
506
|
propsSchema: e.record(e.string(), e.unknown()).optional(),
|
|
497
507
|
capabilities: e.array(e.enum(["children", "bindings", "events", "formField", "ssr", "pdf"])).optional(),
|
|
498
|
-
controlled:
|
|
508
|
+
controlled: Z.optional(),
|
|
499
509
|
css: e.array(e.string()).optional()
|
|
500
|
-
}).strict(),
|
|
510
|
+
}).strict(), S = e.object({
|
|
501
511
|
$schema: e.string().optional(),
|
|
502
512
|
id: e.string().min(1),
|
|
503
513
|
namespace: e.string().min(1).optional(),
|
|
@@ -506,12 +516,12 @@ const G = e.object({
|
|
|
506
516
|
name: e.literal("bonsai"),
|
|
507
517
|
api: e.string().min(1)
|
|
508
518
|
}).strict(),
|
|
509
|
-
components: e.array(
|
|
519
|
+
components: e.array(K).min(1),
|
|
510
520
|
integrity: e.object({
|
|
511
521
|
algorithm: e.literal("sha256"),
|
|
512
522
|
manifestHash: e.string().min(1)
|
|
513
523
|
}).strict().optional()
|
|
514
|
-
}).strict(),
|
|
524
|
+
}).strict(), X = "1", O = {
|
|
515
525
|
identity: (t) => t,
|
|
516
526
|
targetValue: (t) => t?.target?.value,
|
|
517
527
|
targetChecked: (t) => t?.target?.checked,
|
|
@@ -522,7 +532,7 @@ class g extends Error {
|
|
|
522
532
|
super(i), this.name = "ManifestLoadError";
|
|
523
533
|
}
|
|
524
534
|
}
|
|
525
|
-
function
|
|
535
|
+
function Q(t, i) {
|
|
526
536
|
return t ? i ? e.any().superRefine((n, o) => {
|
|
527
537
|
const a = t.safeParse(n);
|
|
528
538
|
if (!a.success)
|
|
@@ -534,19 +544,19 @@ function X(t, i) {
|
|
|
534
544
|
o.addIssue({ code: "custom", message: s.message, path: s.path });
|
|
535
545
|
}) : t : i;
|
|
536
546
|
}
|
|
537
|
-
async function
|
|
547
|
+
async function Y(t) {
|
|
538
548
|
const i = new TextEncoder().encode(t), n = await crypto.subtle.digest("SHA-256", i);
|
|
539
549
|
return `sha256:${Array.from(new Uint8Array(n)).map((a) => a.toString(16).padStart(2, "0")).join("")}`;
|
|
540
550
|
}
|
|
541
|
-
function
|
|
542
|
-
const i =
|
|
551
|
+
function ee(t) {
|
|
552
|
+
const i = O[t];
|
|
543
553
|
if (!i)
|
|
544
554
|
throw new g(
|
|
545
|
-
`Registry manifest: unknown extractor "${t}" — must be one of: ${Object.keys(
|
|
555
|
+
`Registry manifest: unknown extractor "${t}" — must be one of: ${Object.keys(O).join(", ")}`
|
|
546
556
|
);
|
|
547
557
|
return i;
|
|
548
558
|
}
|
|
549
|
-
function
|
|
559
|
+
function te(t, i, n) {
|
|
550
560
|
const o = i.components[t.entry];
|
|
551
561
|
if (!o)
|
|
552
562
|
throw new g(
|
|
@@ -555,21 +565,21 @@ function ee(t, i, n) {
|
|
|
555
565
|
const a = t.propsSchema ? y(t.propsSchema) : void 0, r = t.controlled ? {
|
|
556
566
|
valueProp: t.controlled.valueProp,
|
|
557
567
|
changeProp: t.controlled.changeProp,
|
|
558
|
-
extract:
|
|
568
|
+
extract: ee(t.controlled.extract)
|
|
559
569
|
} : o.controlled;
|
|
560
570
|
return [
|
|
561
571
|
t.canonicalName ?? t.name,
|
|
562
|
-
|
|
572
|
+
j({
|
|
563
573
|
component: o.component,
|
|
564
|
-
propsSchema:
|
|
574
|
+
propsSchema: Q(o.propsSchema, a),
|
|
565
575
|
capabilities: t.capabilities ?? o.capabilities,
|
|
566
576
|
controlled: r,
|
|
567
577
|
assets: t.css ? { css: t.css } : o.assets
|
|
568
578
|
})
|
|
569
579
|
];
|
|
570
580
|
}
|
|
571
|
-
function
|
|
572
|
-
const n =
|
|
581
|
+
function ie(t, i) {
|
|
582
|
+
const n = S.parse(t), o = i.engineApi ?? X;
|
|
573
583
|
if (n.engine.api !== o)
|
|
574
584
|
throw new g(
|
|
575
585
|
`Registry manifest "${n.id}" targets engine.api "${n.engine.api}", but this build supports "${o}"`
|
|
@@ -585,9 +595,9 @@ function te(t, i) {
|
|
|
585
595
|
`Registry manifest "${n.id}" is ${i.rawManifestSize} bytes, exceeding the limit of ${r}`
|
|
586
596
|
);
|
|
587
597
|
const s = Object.fromEntries(
|
|
588
|
-
n.components.map((
|
|
598
|
+
n.components.map((m) => te(m, i.base, n.id))
|
|
589
599
|
);
|
|
590
|
-
return
|
|
600
|
+
return P({
|
|
591
601
|
id: n.id,
|
|
592
602
|
version: n.version,
|
|
593
603
|
namespace: n.namespace,
|
|
@@ -597,10 +607,10 @@ function te(t, i) {
|
|
|
597
607
|
});
|
|
598
608
|
}
|
|
599
609
|
const w = /* @__PURE__ */ new Map();
|
|
600
|
-
function
|
|
610
|
+
function fe() {
|
|
601
611
|
w.clear();
|
|
602
612
|
}
|
|
603
|
-
function
|
|
613
|
+
function ne(t, i) {
|
|
604
614
|
if (!t.integrity)
|
|
605
615
|
throw new g(
|
|
606
616
|
`Registry manifest "${t.id}" has no integrity block — a manifest hash is required before use`
|
|
@@ -610,7 +620,7 @@ function ie(t, i) {
|
|
|
610
620
|
`Registry manifest "${t.id}" failed its integrity check: expected "${t.integrity.manifestHash}", computed "${i}"`
|
|
611
621
|
);
|
|
612
622
|
}
|
|
613
|
-
async function
|
|
623
|
+
async function he(t, i) {
|
|
614
624
|
let n;
|
|
615
625
|
if (typeof t == "string") {
|
|
616
626
|
const p = new URL(t);
|
|
@@ -626,39 +636,39 @@ async function ge(t, i) {
|
|
|
626
636
|
n = await h.text();
|
|
627
637
|
} else
|
|
628
638
|
n = JSON.stringify(t);
|
|
629
|
-
const o =
|
|
630
|
-
|
|
631
|
-
const
|
|
632
|
-
if (
|
|
633
|
-
const
|
|
634
|
-
return w.set(s,
|
|
639
|
+
const o = S.parse(JSON.parse(n)), { integrity: a, ...r } = o, s = await Y(JSON.stringify(r));
|
|
640
|
+
ne(o, s);
|
|
641
|
+
const m = w.get(s);
|
|
642
|
+
if (m) return m;
|
|
643
|
+
const l = ie(o, { ...i, rawManifestSize: n.length, manifestHash: s });
|
|
644
|
+
return w.set(s, l), l;
|
|
635
645
|
}
|
|
636
|
-
function
|
|
646
|
+
function be(t, i) {
|
|
637
647
|
const n = { ...t?.properties ?? {}, ...i?.properties ?? {} }, o = [.../* @__PURE__ */ new Set([...t?.required ?? [], ...i?.required ?? []])];
|
|
638
648
|
return { type: "object", properties: n, required: o };
|
|
639
649
|
}
|
|
640
|
-
function
|
|
650
|
+
function ae(t, i) {
|
|
641
651
|
const n = new Map(t.map((r) => [r.url, r.registryHash])), o = new Map(i.map((r) => [r.url, r.registryHash])), a = [];
|
|
642
652
|
for (const [r, s] of o) {
|
|
643
|
-
const
|
|
644
|
-
|
|
653
|
+
const m = n.get(r);
|
|
654
|
+
m === void 0 ? a.push(`${r} is configured but missing from the artifact`) : m !== s && a.push(`${r}: artifact has ${m}, pebble-kit.json records ${s}`);
|
|
645
655
|
}
|
|
646
656
|
for (const r of n.keys())
|
|
647
657
|
o.has(r) || a.push(`${r} is in the artifact but no longer configured`);
|
|
648
658
|
return a.length > 0 ? a.join("; ") : void 0;
|
|
649
659
|
}
|
|
650
|
-
function
|
|
660
|
+
function k(t) {
|
|
651
661
|
const i = /(\d+)\.\d+\.\d+/.exec(t);
|
|
652
662
|
return i ? Number(i[1]) : void 0;
|
|
653
663
|
}
|
|
654
|
-
function
|
|
655
|
-
const i = [], n =
|
|
664
|
+
function ye(t) {
|
|
665
|
+
const i = [], n = ae(t.artifactRegistries, t.configRegistries);
|
|
656
666
|
if (n && i.push({
|
|
657
667
|
check: "stale-artifact",
|
|
658
668
|
level: "fail",
|
|
659
669
|
message: `bonsai.generated.json is out of date with pebble-kit.json (${n}) — run "pebble-kit generate"`
|
|
660
670
|
}), t.artifactBaseUiVersion !== t.installedBaseUiVersion) {
|
|
661
|
-
const o =
|
|
671
|
+
const o = k(t.artifactBaseUiVersion), a = k(t.installedBaseUiVersion), r = o !== void 0 && a !== void 0 && o !== a;
|
|
662
672
|
i.push({
|
|
663
673
|
check: "baseui-drift",
|
|
664
674
|
level: r ? "fail" : "warn",
|
|
@@ -667,37 +677,37 @@ function he(t) {
|
|
|
667
677
|
}
|
|
668
678
|
return i;
|
|
669
679
|
}
|
|
670
|
-
function
|
|
680
|
+
function we(t) {
|
|
671
681
|
const i = t.filter((n) => n.level === "fail");
|
|
672
682
|
if (i.length > 0)
|
|
673
683
|
throw new Error(i.map((n) => n.message).join("; "));
|
|
674
684
|
}
|
|
675
|
-
const { Bonsai:
|
|
685
|
+
const { Bonsai: xe } = R({ registry: L });
|
|
676
686
|
export {
|
|
677
|
-
|
|
678
|
-
|
|
687
|
+
xe as Bonsai,
|
|
688
|
+
O as EXTRACTOR_ALLOWLIST,
|
|
679
689
|
g as ManifestLoadError,
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
690
|
+
S as RegistryManifestSchema,
|
|
691
|
+
we as assertNoFailingDrift,
|
|
692
|
+
ye as checkArtifactDrift,
|
|
693
|
+
fe as clearManifestCache,
|
|
684
694
|
E as componentMap,
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
695
|
+
Q as composePropsSchema,
|
|
696
|
+
Y as computeManifestHash,
|
|
697
|
+
H as controlledInputMap,
|
|
698
|
+
U as coreRegistry,
|
|
699
|
+
R as createBonsaiRenderer,
|
|
700
|
+
P as defineBonsaiRegistry,
|
|
701
|
+
j as defineComponent,
|
|
702
|
+
B as extendRegistry,
|
|
693
703
|
y as jsonSchemaToZod,
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
704
|
+
he as loadRegistryManifest,
|
|
705
|
+
be as mergeGeneratedWithOverrides,
|
|
706
|
+
L as pebbleRegistry,
|
|
707
|
+
ie as resolveManifest,
|
|
708
|
+
J as resolveRegistryPin,
|
|
709
|
+
je as useBonsaiRenderMode,
|
|
710
|
+
ke as useUpdateData,
|
|
711
|
+
ge as validateTemplate
|
|
702
712
|
};
|
|
703
713
|
//# sourceMappingURL=index.js.map
|