@drawnagency/primitives 0.1.99 → 0.1.101
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/{chunk-FAZFADJK.js → chunk-3TO4RRHY.js} +3 -1
- package/dist/{chunk-HKHEAH5F.js → chunk-6SLGKRLW.js} +8 -60
- package/dist/chunk-BS5AQHZG.js +45 -0
- package/dist/{chunk-GYCBWGVW.js → chunk-LBHQWIVL.js} +79 -24
- package/dist/{chunk-KP4DWTPR.js → chunk-P3NNI3QI.js} +328 -4
- package/dist/components/chat/ChatPanel.d.ts.map +1 -1
- package/dist/components/docfile/DocFileOverlay.d.ts +12 -0
- package/dist/components/docfile/DocFileOverlay.d.ts.map +1 -0
- package/dist/components/docfile/DocFilePane.d.ts +17 -0
- package/dist/components/docfile/DocFilePane.d.ts.map +1 -0
- package/dist/components/docfile/doc-file-state.d.ts +38 -0
- package/dist/components/docfile/doc-file-state.d.ts.map +1 -0
- package/dist/components/editor/SettingsForm.d.ts.map +1 -1
- package/dist/components/editor/index.js +1 -1
- package/dist/components/primitives/DocumentDropZone.d.ts +18 -0
- package/dist/components/primitives/DocumentDropZone.d.ts.map +1 -0
- package/dist/components/sections/Document/index.d.ts +24 -0
- package/dist/components/sections/Document/index.d.ts.map +1 -0
- package/dist/components/sections/all-sections.d.ts +10 -0
- package/dist/components/sections/all-sections.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.d.ts +10 -0
- package/dist/components/sections/brand-guide.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.js +3 -1
- package/dist/components/sections/register-schemas.js +5 -3
- package/dist/components/sections/register.js +5 -3
- package/dist/components/shared/DocumentSourceField.d.ts +13 -0
- package/dist/components/shared/DocumentSourceField.d.ts.map +1 -0
- package/dist/components/shared/Navigation.d.ts.map +1 -1
- package/dist/components/shell/EditorModal.d.ts.map +1 -1
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/components/shell/MediaBreadcrumb.d.ts.map +1 -1
- package/dist/components/shell/MediaFolderTile.d.ts +3 -1
- package/dist/components/shell/MediaFolderTile.d.ts.map +1 -1
- package/dist/components/shell/MediaFolderTree.d.ts +3 -0
- package/dist/components/shell/MediaFolderTree.d.ts.map +1 -1
- package/dist/components/shell/MediaLibraryContext.d.ts +24 -1
- package/dist/components/shell/MediaLibraryContext.d.ts.map +1 -1
- package/dist/components/shell/MediaLibraryModal.d.ts +21 -1
- package/dist/components/shell/MediaLibraryModal.d.ts.map +1 -1
- package/dist/hooks/useDocumentUploads.d.ts +32 -0
- package/dist/hooks/useDocumentUploads.d.ts.map +1 -0
- package/dist/hooks/useEditorPublish.d.ts +18 -1
- package/dist/hooks/useEditorPublish.d.ts.map +1 -1
- package/dist/hooks/useMediaPipeline.d.ts +14 -1
- package/dist/hooks/useMediaPipeline.d.ts.map +1 -1
- package/dist/hooks/useResolvedDocument.d.ts +12 -0
- package/dist/hooks/useResolvedDocument.d.ts.map +1 -0
- package/dist/index.js +56 -32
- package/dist/lib/dexie.d.ts +13 -0
- package/dist/lib/dexie.d.ts.map +1 -1
- package/dist/lib/dexie.js +39 -2
- package/dist/lib/document-refs.d.ts +22 -0
- package/dist/lib/document-refs.d.ts.map +1 -0
- package/dist/lib/document-uploads.d.ts +38 -0
- package/dist/lib/document-uploads.d.ts.map +1 -0
- package/dist/lib/documents.d.ts +65 -0
- package/dist/lib/documents.d.ts.map +1 -0
- package/dist/lib/index.js +4 -4
- package/dist/lib/media-folders.d.ts +8 -0
- package/dist/lib/media-folders.d.ts.map +1 -1
- package/dist/lib/media-folders.js +2 -0
- package/dist/lib/nav.d.ts +29 -1
- package/dist/lib/nav.d.ts.map +1 -1
- package/dist/lib/platform-broker.d.ts +12 -0
- package/dist/lib/platform-broker.d.ts.map +1 -1
- package/dist/lib/platform-broker.js +12 -3
- package/dist/lib/registry.d.ts +10 -0
- package/dist/lib/registry.d.ts.map +1 -1
- package/dist/lib/save-chunks.d.ts +15 -0
- package/dist/lib/save-chunks.d.ts.map +1 -1
- package/dist/lib/scroll-lock.d.ts +2 -0
- package/dist/lib/scroll-lock.d.ts.map +1 -0
- package/dist/schemas/documents.d.ts +80 -0
- package/dist/schemas/documents.d.ts.map +1 -0
- package/dist/schemas/documents.js +25 -0
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +23 -1
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +3 -1
- package/dist/storage/types.d.ts +59 -3
- package/dist/storage/types.d.ts.map +1 -1
- package/package.json +5 -1
- package/src/components/chat/ChatPanel.tsx +5 -4
- package/src/components/docfile/DocFileOverlay.tsx +54 -0
- package/src/components/docfile/DocFilePane.tsx +133 -0
- package/src/components/docfile/doc-file-state.ts +208 -0
- package/src/components/editor/SettingsForm.tsx +10 -0
- package/src/components/primitives/DocumentDropZone.tsx +79 -0
- package/src/components/sections/Document/index.tsx +194 -0
- package/src/components/sections/brand-guide.ts +2 -1
- package/src/components/shared/DocumentSourceField.tsx +51 -0
- package/src/components/shared/Navigation.tsx +53 -10
- package/src/components/shell/EditorModal.tsx +2 -5
- package/src/components/shell/EditorShell.tsx +132 -8
- package/src/components/shell/MediaBreadcrumb.tsx +14 -1
- package/src/components/shell/MediaFolderTile.tsx +4 -2
- package/src/components/shell/MediaFolderTree.tsx +20 -3
- package/src/components/shell/MediaLibraryContext.tsx +24 -1
- package/src/components/shell/MediaLibraryModal.tsx +223 -45
- package/src/hooks/useDocumentUploads.ts +336 -0
- package/src/hooks/useEditorPublish.ts +180 -8
- package/src/hooks/useMediaPipeline.ts +141 -5
- package/src/hooks/useResolvedDocument.ts +25 -0
- package/src/lib/dexie.ts +66 -1
- package/src/lib/document-refs.ts +83 -0
- package/src/lib/document-uploads.ts +66 -0
- package/src/lib/documents.ts +138 -0
- package/src/lib/media-folders.ts +9 -0
- package/src/lib/nav.ts +46 -2
- package/src/lib/platform-broker.ts +18 -3
- package/src/lib/registry.ts +9 -0
- package/src/lib/save-chunks.ts +42 -0
- package/src/lib/scroll-lock.ts +27 -0
- package/src/schemas/documents.ts +82 -0
- package/src/schemas/index.ts +1 -0
- package/src/storage/index.ts +2 -2
- package/src/storage/types.ts +58 -4
- /package/dist/{chunk-FOY5TF7D.js → chunk-ZDQ3TT47.js} +0 -0
|
@@ -14,16 +14,23 @@ import {
|
|
|
14
14
|
AddIcon,
|
|
15
15
|
DeleteIcon,
|
|
16
16
|
DragHandle,
|
|
17
|
-
IconButton
|
|
17
|
+
IconButton,
|
|
18
|
+
useMediaLibrary
|
|
18
19
|
} from "./chunk-26ALJO4K.js";
|
|
19
20
|
import {
|
|
20
21
|
DEFAULT_LINK,
|
|
21
22
|
LinkValueSchema
|
|
22
23
|
} from "./chunk-PZJL2S3Z.js";
|
|
24
|
+
import {
|
|
25
|
+
DOCUMENT_MIME_TO_EXT
|
|
26
|
+
} from "./chunk-BS5AQHZG.js";
|
|
23
27
|
import {
|
|
24
28
|
curatedIcons,
|
|
25
29
|
getIcon
|
|
26
30
|
} from "./chunk-WDSVHKAH.js";
|
|
31
|
+
import {
|
|
32
|
+
createEvent
|
|
33
|
+
} from "./chunk-PTOLUMGV.js";
|
|
27
34
|
import {
|
|
28
35
|
cn
|
|
29
36
|
} from "./chunk-7EOSDFS3.js";
|
|
@@ -65,9 +72,9 @@ function getContrastClass(hex) {
|
|
|
65
72
|
const h = hex.replace("#", "");
|
|
66
73
|
if (h.length < 6) return "text-white";
|
|
67
74
|
const r = parseInt(h.substring(0, 2), 16);
|
|
68
|
-
const
|
|
75
|
+
const g2 = parseInt(h.substring(2, 4), 16);
|
|
69
76
|
const b = parseInt(h.substring(4, 6), 16);
|
|
70
|
-
const yiq = (r * 299 +
|
|
77
|
+
const yiq = (r * 299 + g2 * 587 + b * 114) / 1e3;
|
|
71
78
|
return yiq >= 128 ? "text-black" : "text-white";
|
|
72
79
|
}
|
|
73
80
|
var createColorItem = () => ({
|
|
@@ -1295,13 +1302,330 @@ var DoDontMedia_default = defineSection({
|
|
|
1295
1302
|
]
|
|
1296
1303
|
});
|
|
1297
1304
|
|
|
1305
|
+
// src/components/sections/Document/index.tsx
|
|
1306
|
+
import { useEffect as useEffect5, useState as useState7 } from "react";
|
|
1307
|
+
import { z as z5 } from "zod";
|
|
1308
|
+
import { ExternalLink, FileText } from "lucide-react";
|
|
1309
|
+
|
|
1310
|
+
// src/components/primitives/DocumentDropZone.tsx
|
|
1311
|
+
import { useState as useState6 } from "react";
|
|
1312
|
+
import { FileUp } from "lucide-react";
|
|
1313
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1314
|
+
var isDocumentFile = (file) => file.type in DOCUMENT_MIME_TO_EXT;
|
|
1315
|
+
function DocumentDropZone({ onDocumentSelected, className }) {
|
|
1316
|
+
const mediaLibrary = useMediaLibrary();
|
|
1317
|
+
const [dragging, setDragging] = useState6(false);
|
|
1318
|
+
const hasFiles = (e) => e.dataTransfer.types.includes("Files");
|
|
1319
|
+
const handleDragOver = (e) => {
|
|
1320
|
+
if (!hasFiles(e)) return;
|
|
1321
|
+
e.preventDefault();
|
|
1322
|
+
e.dataTransfer.dropEffect = "copy";
|
|
1323
|
+
setDragging(true);
|
|
1324
|
+
};
|
|
1325
|
+
const handleDragLeave = (e) => {
|
|
1326
|
+
if (!hasFiles(e)) return;
|
|
1327
|
+
const related = e.relatedTarget;
|
|
1328
|
+
if (related && e.currentTarget.contains(related)) return;
|
|
1329
|
+
setDragging(false);
|
|
1330
|
+
};
|
|
1331
|
+
const handleDrop = (e) => {
|
|
1332
|
+
if (!hasFiles(e)) return;
|
|
1333
|
+
e.preventDefault();
|
|
1334
|
+
e.stopPropagation();
|
|
1335
|
+
setDragging(false);
|
|
1336
|
+
const files = Array.from(e.dataTransfer.files);
|
|
1337
|
+
if (files.length === 0) return;
|
|
1338
|
+
void mediaLibrary?.uploadDocument?.(files.find(isDocumentFile) ?? files[0], onDocumentSelected);
|
|
1339
|
+
};
|
|
1340
|
+
return /* @__PURE__ */ jsxs9(
|
|
1341
|
+
"button",
|
|
1342
|
+
{
|
|
1343
|
+
type: "button",
|
|
1344
|
+
onClick: () => mediaLibrary?.openSelectModal(onDocumentSelected, { kinds: ["document"] }),
|
|
1345
|
+
onDragOver: handleDragOver,
|
|
1346
|
+
onDragLeave: handleDragLeave,
|
|
1347
|
+
onDrop: handleDrop,
|
|
1348
|
+
className: cn(
|
|
1349
|
+
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-outer border-2 border-dashed border-base-200 bg-base px-4 py-6 text-sm text-base-contrast-light transition-colors hover:border-base-300 hover:bg-base-accent hover:text-base-contrast",
|
|
1350
|
+
dragging && "border-primary bg-primary/5 text-base-contrast",
|
|
1351
|
+
className
|
|
1352
|
+
),
|
|
1353
|
+
children: [
|
|
1354
|
+
/* @__PURE__ */ jsx13(FileUp, { size: 18, "aria-hidden": "true", className: "shrink-0" }),
|
|
1355
|
+
/* @__PURE__ */ jsx13("span", { children: "Drop a PDF or HTML file, or choose from the library" })
|
|
1356
|
+
]
|
|
1357
|
+
}
|
|
1358
|
+
);
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
// src/lib/container-ops.ts
|
|
1362
|
+
function getContainerChildren(block) {
|
|
1363
|
+
const content = block.content;
|
|
1364
|
+
return Array.isArray(content?.children) ? content.children : [];
|
|
1365
|
+
}
|
|
1366
|
+
function withChildren(container, children) {
|
|
1367
|
+
return { ...container, content: { ...container.content, children } };
|
|
1368
|
+
}
|
|
1369
|
+
function containerColumns(container) {
|
|
1370
|
+
const n = container.content?.columns;
|
|
1371
|
+
return typeof n === "number" && n >= 1 ? n : 1;
|
|
1372
|
+
}
|
|
1373
|
+
function removeChildAt(container, index) {
|
|
1374
|
+
const children = getContainerChildren(container);
|
|
1375
|
+
if (index < 0 || index >= children.length) return { container, removed: null };
|
|
1376
|
+
const next = [...children];
|
|
1377
|
+
const [removed] = next.splice(index, 1);
|
|
1378
|
+
return { container: withChildren(container, next), removed };
|
|
1379
|
+
}
|
|
1380
|
+
function duplicateChildAt(container, index, newId) {
|
|
1381
|
+
const children = getContainerChildren(container);
|
|
1382
|
+
if (index < 0 || index >= children.length) return container;
|
|
1383
|
+
const clone = { ...JSON.parse(JSON.stringify(children[index])), id: newId() };
|
|
1384
|
+
const next = [...children];
|
|
1385
|
+
next.splice(index + 1, 0, clone);
|
|
1386
|
+
return withChildren(container, next);
|
|
1387
|
+
}
|
|
1388
|
+
function setChildColSpan(container, index, span) {
|
|
1389
|
+
const children = getContainerChildren(container);
|
|
1390
|
+
if (index < 0 || index >= children.length) return container;
|
|
1391
|
+
const clamped = Math.max(1, Math.min(span, containerColumns(container)));
|
|
1392
|
+
const next = children.map((child, i) => {
|
|
1393
|
+
if (i !== index) return child;
|
|
1394
|
+
if (clamped <= 1) {
|
|
1395
|
+
const { layout: _drop, ...rest } = child;
|
|
1396
|
+
return rest;
|
|
1397
|
+
}
|
|
1398
|
+
return { ...child, layout: { ...child.layout, colSpan: clamped } };
|
|
1399
|
+
});
|
|
1400
|
+
return withChildren(container, next);
|
|
1401
|
+
}
|
|
1402
|
+
function effectiveSpan(child, columns) {
|
|
1403
|
+
return isSpacer(child) ? 1 : Math.min(child.layout?.colSpan ?? 1, columns);
|
|
1404
|
+
}
|
|
1405
|
+
function isSpacer(child) {
|
|
1406
|
+
return child.type === "spacer";
|
|
1407
|
+
}
|
|
1408
|
+
function occupiedColumns(children, columns) {
|
|
1409
|
+
return children.reduce((sum, c) => sum + effectiveSpan(c, columns), 0);
|
|
1410
|
+
}
|
|
1411
|
+
function trimTrailingSpacers(container) {
|
|
1412
|
+
const children = getContainerChildren(container);
|
|
1413
|
+
let end = children.length;
|
|
1414
|
+
while (end > 0 && isSpacer(children[end - 1])) end--;
|
|
1415
|
+
if (end === children.length) return container;
|
|
1416
|
+
return withChildren(container, children.slice(0, end));
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
// src/lib/documents.ts
|
|
1420
|
+
function formatDocSize(bytes) {
|
|
1421
|
+
if (!Number.isFinite(bytes) || bytes < 0) return "";
|
|
1422
|
+
if (bytes < 1024) return `${Math.round(bytes)} B`;
|
|
1423
|
+
const units = ["KB", "MB", "GB"];
|
|
1424
|
+
let value = bytes / 1024;
|
|
1425
|
+
let unit = 0;
|
|
1426
|
+
while (value >= 1024 && unit < units.length - 1) {
|
|
1427
|
+
value /= 1024;
|
|
1428
|
+
unit++;
|
|
1429
|
+
}
|
|
1430
|
+
return `${value >= 100 ? Math.round(value) : Number(value.toFixed(1))} ${units[unit]}`;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
// src/components/docfile/doc-file-state.ts
|
|
1434
|
+
var DOC_OPEN_CLASS = "bp-doc-open";
|
|
1435
|
+
var DOC_CLOSING_CLASS = "bp-doc-closing";
|
|
1436
|
+
var DOC_CLOSING_MS = 350;
|
|
1437
|
+
var DOC_DESKTOP_QUERY = "(min-width: 1024px)";
|
|
1438
|
+
var docFileOpenEvent = createEvent("bp-doc-file-open");
|
|
1439
|
+
var STORE_KEY = /* @__PURE__ */ Symbol.for("@drawnagency/primitives/doc-file-state");
|
|
1440
|
+
var g = globalThis;
|
|
1441
|
+
function store() {
|
|
1442
|
+
let s = g[STORE_KEY];
|
|
1443
|
+
if (!s) {
|
|
1444
|
+
s = { open: null, docs: null, openListeners: /* @__PURE__ */ new Set(), docsListeners: /* @__PURE__ */ new Set(), teardown: null, closingTimer: null };
|
|
1445
|
+
g[STORE_KEY] = s;
|
|
1446
|
+
}
|
|
1447
|
+
return s;
|
|
1448
|
+
}
|
|
1449
|
+
function isDocDesktop() {
|
|
1450
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return true;
|
|
1451
|
+
return window.matchMedia(DOC_DESKTOP_QUERY).matches;
|
|
1452
|
+
}
|
|
1453
|
+
function apply(sectionId) {
|
|
1454
|
+
const s = store();
|
|
1455
|
+
if (s.open === sectionId) return;
|
|
1456
|
+
const wasOpen = s.open !== null;
|
|
1457
|
+
s.open = sectionId;
|
|
1458
|
+
if (typeof document !== "undefined") {
|
|
1459
|
+
const root = document.documentElement;
|
|
1460
|
+
root.classList.toggle(DOC_OPEN_CLASS, sectionId !== null);
|
|
1461
|
+
if (s.closingTimer !== null) {
|
|
1462
|
+
clearTimeout(s.closingTimer);
|
|
1463
|
+
s.closingTimer = null;
|
|
1464
|
+
root.classList.remove(DOC_CLOSING_CLASS);
|
|
1465
|
+
}
|
|
1466
|
+
if (sectionId === null && wasOpen) {
|
|
1467
|
+
root.classList.add(DOC_CLOSING_CLASS);
|
|
1468
|
+
s.closingTimer = setTimeout(() => {
|
|
1469
|
+
root.classList.remove(DOC_CLOSING_CLASS);
|
|
1470
|
+
s.closingTimer = null;
|
|
1471
|
+
}, DOC_CLOSING_MS);
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
for (const listener of [...s.openListeners]) listener(sectionId);
|
|
1475
|
+
}
|
|
1476
|
+
function openDocFile(sectionId) {
|
|
1477
|
+
if (typeof window !== "undefined") {
|
|
1478
|
+
const hash = `#doc=${encodeURIComponent(sectionId)}`;
|
|
1479
|
+
if (window.location.hash !== hash) {
|
|
1480
|
+
window.history.pushState(null, "", hash);
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
apply(sectionId);
|
|
1484
|
+
docFileOpenEvent.dispatch({ sectionId });
|
|
1485
|
+
}
|
|
1486
|
+
function getSiteDocuments() {
|
|
1487
|
+
return store().docs;
|
|
1488
|
+
}
|
|
1489
|
+
function subscribeSiteDocuments(cb) {
|
|
1490
|
+
const s = store();
|
|
1491
|
+
s.docsListeners.add(cb);
|
|
1492
|
+
return () => {
|
|
1493
|
+
s.docsListeners.delete(cb);
|
|
1494
|
+
};
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
// src/components/sections/Document/index.tsx
|
|
1498
|
+
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1499
|
+
var schema4 = z5.object({
|
|
1500
|
+
type: z5.literal("document"),
|
|
1501
|
+
content: z5.object({
|
|
1502
|
+
title: z5.string().describe("Row title. Leave it blank to show the file name without its extension; type a title to override that."),
|
|
1503
|
+
doc: z5.object({
|
|
1504
|
+
documentId: z5.string().default("").describe(
|
|
1505
|
+
"Hash key into the document manifest (src/content/document-manifest.json). Deliberately NOT `imageId`: documents are not resolved by the media ref-baker."
|
|
1506
|
+
)
|
|
1507
|
+
}),
|
|
1508
|
+
showInDocumentsNav: z5.boolean().default(true).describe(
|
|
1509
|
+
"When true, this document also appears in the auto-derived Documents group at the bottom of the left navigation, openable from any page."
|
|
1510
|
+
)
|
|
1511
|
+
}),
|
|
1512
|
+
options: z5.object({}).default({})
|
|
1513
|
+
});
|
|
1514
|
+
function useSiteDocument(sectionId) {
|
|
1515
|
+
const [docs, setDocs] = useState7(null);
|
|
1516
|
+
useEffect5(() => {
|
|
1517
|
+
setDocs(getSiteDocuments());
|
|
1518
|
+
return subscribeSiteDocuments(setDocs);
|
|
1519
|
+
}, []);
|
|
1520
|
+
return {
|
|
1521
|
+
doc: docs ? docs.find((d) => d.sectionId === sectionId) ?? null : null,
|
|
1522
|
+
resolved: docs !== null
|
|
1523
|
+
};
|
|
1524
|
+
}
|
|
1525
|
+
function DocumentRow({
|
|
1526
|
+
sectionId,
|
|
1527
|
+
title,
|
|
1528
|
+
documentId = "",
|
|
1529
|
+
isEditMode,
|
|
1530
|
+
onDocumentSelected
|
|
1531
|
+
}) {
|
|
1532
|
+
const { doc, resolved } = useSiteDocument(sectionId);
|
|
1533
|
+
if (resolved && !doc && !isEditMode) return null;
|
|
1534
|
+
if (isEditMode && !documentId && onDocumentSelected) {
|
|
1535
|
+
return /* @__PURE__ */ jsx14(DocumentDropZone, { onDocumentSelected });
|
|
1536
|
+
}
|
|
1537
|
+
const label = doc?.title ?? title;
|
|
1538
|
+
function handleClick() {
|
|
1539
|
+
if (!doc) return;
|
|
1540
|
+
if (doc.kind === "pdf" && !isDocDesktop()) {
|
|
1541
|
+
window.open(doc.url, "_blank", "noopener,noreferrer");
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1544
|
+
openDocFile(sectionId);
|
|
1545
|
+
}
|
|
1546
|
+
return /* @__PURE__ */ jsxs10(
|
|
1547
|
+
"button",
|
|
1548
|
+
{
|
|
1549
|
+
type: "button",
|
|
1550
|
+
onClick: handleClick,
|
|
1551
|
+
disabled: !doc,
|
|
1552
|
+
"aria-label": doc ? `Open ${label}` : void 0,
|
|
1553
|
+
className: cn(
|
|
1554
|
+
"flex w-full min-w-0 items-center gap-3 rounded-outer border border-base-200 bg-base px-4 py-3 text-left transition-colors",
|
|
1555
|
+
doc ? "cursor-pointer hover:bg-base-accent" : "cursor-default opacity-60"
|
|
1556
|
+
),
|
|
1557
|
+
children: [
|
|
1558
|
+
/* @__PURE__ */ jsx14(FileText, { size: 18, "aria-hidden": "true", className: "shrink-0 text-base-contrast/60" }),
|
|
1559
|
+
/* @__PURE__ */ jsxs10("div", { className: "min-w-0 flex-1", children: [
|
|
1560
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
|
|
1561
|
+
/* @__PURE__ */ jsx14("span", { className: "truncate text-sm font-medium text-base-contrast", children: label }),
|
|
1562
|
+
doc && /* @__PURE__ */ jsx14("span", { className: "shrink-0 rounded bg-base-100 px-1.5 py-0.5 text-xs font-medium text-base-contrast", children: doc.kind === "pdf" ? "PDF" : "HTML" })
|
|
1563
|
+
] }),
|
|
1564
|
+
/* @__PURE__ */ jsx14("div", { className: "truncate text-xs text-base-contrast/70", children: doc ? `${doc.filename} \xB7 ${formatDocSize(doc.size)}` : resolved ? "File missing" : "\xA0" })
|
|
1565
|
+
] }),
|
|
1566
|
+
doc && /* @__PURE__ */ jsx14(ExternalLink, { size: 16, "aria-hidden": "true", className: "shrink-0 text-base-contrast/50" })
|
|
1567
|
+
]
|
|
1568
|
+
}
|
|
1569
|
+
);
|
|
1570
|
+
}
|
|
1571
|
+
var Document_default = defineSection({
|
|
1572
|
+
type: "document",
|
|
1573
|
+
category: "brand-guide",
|
|
1574
|
+
label: "Document",
|
|
1575
|
+
icon: /* @__PURE__ */ jsx14(FileText, { size: 18 }),
|
|
1576
|
+
schema: schema4,
|
|
1577
|
+
// The row reads the client-side document registry and opens the overlay, so
|
|
1578
|
+
// the viewer hydrates it as an island rather than emitting static HTML.
|
|
1579
|
+
interactive: true,
|
|
1580
|
+
authoringNote: "One downloadable/viewable file \u2014 a PDF or a single self-contained HTML file \u2014 presented as a clickable row. Clicking opens it in a full-viewport preview overlay without leaving the page; on phones a PDF opens in the OS viewer instead. Pick the file from the media library (documents tab); leave the title blank to show the file name without its extension, or type one to override it. Leave 'Show in Documents menu' on for anything a viewer should be able to reach from any page \u2014 those entries collect into a derived Documents group at the bottom of the left nav. Use one section per file; for a set of downloads, place several document sections in a container.",
|
|
1581
|
+
component: ({ content, isEditMode, onChange }) => /* @__PURE__ */ jsx14(
|
|
1582
|
+
DocumentRow,
|
|
1583
|
+
{
|
|
1584
|
+
sectionId: content.id ?? "",
|
|
1585
|
+
title: content.content.title,
|
|
1586
|
+
documentId: content.content.doc?.documentId ?? "",
|
|
1587
|
+
isEditMode,
|
|
1588
|
+
onDocumentSelected: onChange ? (documentId) => onChange({
|
|
1589
|
+
...content,
|
|
1590
|
+
content: { ...content.content, doc: { ...content.content.doc, documentId } }
|
|
1591
|
+
}) : void 0
|
|
1592
|
+
}
|
|
1593
|
+
),
|
|
1594
|
+
defaults: () => ({
|
|
1595
|
+
type: "document",
|
|
1596
|
+
content: { title: "", doc: { documentId: "" }, showInDocumentsNav: true },
|
|
1597
|
+
options: {}
|
|
1598
|
+
}),
|
|
1599
|
+
getLabel: (content) => content.content.title || "Document",
|
|
1600
|
+
settings: {
|
|
1601
|
+
doc: { type: "document-source", label: "File", target: "content", default: { documentId: "" } },
|
|
1602
|
+
title: { type: "text", label: "Title", target: "content", default: "", placeholder: "Document title" },
|
|
1603
|
+
showInDocumentsNav: {
|
|
1604
|
+
type: "checkbox",
|
|
1605
|
+
label: "Show in Documents menu",
|
|
1606
|
+
target: "content",
|
|
1607
|
+
default: true
|
|
1608
|
+
}
|
|
1609
|
+
},
|
|
1610
|
+
settingsTabs: [
|
|
1611
|
+
{ label: "File", fields: ["doc", "title"] },
|
|
1612
|
+
{ label: "Display", fields: ["showInDocumentsNav"] }
|
|
1613
|
+
]
|
|
1614
|
+
});
|
|
1615
|
+
|
|
1298
1616
|
// src/components/sections/brand-guide.ts
|
|
1299
|
-
var brandGuideSectionDefs = [Colors_default, IconList_default, DoDontMedia_default];
|
|
1617
|
+
var brandGuideSectionDefs = [Colors_default, IconList_default, DoDontMedia_default, Document_default];
|
|
1300
1618
|
|
|
1301
1619
|
export {
|
|
1302
1620
|
stripHtmlToPlainText,
|
|
1303
1621
|
truncate,
|
|
1304
1622
|
pluralize,
|
|
1623
|
+
removeChildAt,
|
|
1624
|
+
duplicateChildAt,
|
|
1625
|
+
setChildColSpan,
|
|
1626
|
+
isSpacer,
|
|
1627
|
+
occupiedColumns,
|
|
1628
|
+
trimTrailingSpacers,
|
|
1305
1629
|
ColorSpaceSchema,
|
|
1306
1630
|
ColorItemSchema,
|
|
1307
1631
|
brandGuideSectionDefs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatPanel.d.ts","sourceRoot":"","sources":["../../../src/components/chat/ChatPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatPanel.d.ts","sourceRoot":"","sources":["../../../src/components/chat/ChatPanel.tsx"],"names":[],"mappings":"AAYA,MAAM,WAAW,WAAW;IAAG,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE;AAE5E;;;0DAG0D;AAC1D,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AA+C5D;;kEAEkE;AAClE,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEhD;AAcD,8EAA8E;AAC9E,wBAAsB,UAAU,CAC9B,IAAI,EAAE;IAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,EACxH,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAC9B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA6CjG;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,OAAkB,EAAE,IAAiB,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE;IAC/N,IAAI,EAAE,OAAO,CAAC;IACd;uDACmD;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;4CAEwC;IACxC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;6EAEyE;IACzE,OAAO,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC9B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;kFAC8E;IAC9E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;+DAC2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,kDAqfA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SiteDocument } from "../../lib/documents";
|
|
2
|
+
/**
|
|
3
|
+
* One mount per page, rendered into the Layout `chrome` slot (OUTSIDE <main>:
|
|
4
|
+
* the chat dock's band-shift transform would re-anchor a position:fixed
|
|
5
|
+
* descendant). `documents` is the requester-filtered SSR list — on /edit it is
|
|
6
|
+
* initial state only; EditorShell republishes the live draft list.
|
|
7
|
+
*/
|
|
8
|
+
export default function DocFileOverlay({ documents, editor, }: {
|
|
9
|
+
documents: SiteDocument[];
|
|
10
|
+
editor?: boolean;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
//# sourceMappingURL=DocFileOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocFileOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/docfile/DocFileOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAYxD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,SAAS,EACT,MAAc,GACf,EAAE;IAAE,SAAS,EAAE,YAAY,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,kDA+BjD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SiteDocument } from "../../lib/documents";
|
|
2
|
+
/**
|
|
3
|
+
* The solid stage: an opaque, flat, bordered pane between the nav edge and the
|
|
4
|
+
* chat edge. Geometry lives in base.css (.doc-file-pane) because it is calc()
|
|
5
|
+
* against doc mode's own 120rem stage band — the band the nav and chat are
|
|
6
|
+
* pinned to under html.bp-doc-open (NOT the page's 80rem --layout-max-width
|
|
7
|
+
* band, which doc mode never touches). z-30 — above unpositioned page content,
|
|
8
|
+
* BELOW the nav and docked chat (z-40) and the mobile nav header / chat sheet
|
|
9
|
+
* (z-50), so all chrome stays reachable. `editor` adds top clearance for the
|
|
10
|
+
* edit route's always-fixed h-16 toolbar.
|
|
11
|
+
*/
|
|
12
|
+
export default function DocFilePane({ doc, onClose, editor, }: {
|
|
13
|
+
doc: SiteDocument;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
editor?: boolean;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=DocFilePane.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocFilePane.d.ts","sourceRoot":"","sources":["../../../src/components/docfile/DocFilePane.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOxD;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,GAAG,EACH,OAAO,EACP,MAAc,GACf,EAAE;IAAE,GAAG,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,2CA6G9D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { SiteDocument } from "../../lib/documents";
|
|
2
|
+
/** Toggled on <html> while a document is open (the chat's class mechanism). */
|
|
3
|
+
export declare const DOC_OPEN_CLASS = "bp-doc-open";
|
|
4
|
+
/** Held on <html> for a beat after close. bp-doc-open's `transition: left`
|
|
5
|
+
* rule leaves WITH the class, so without this the nav sidebar snaps home
|
|
6
|
+
* instead of gliding back the way it glided out — this class carries the
|
|
7
|
+
* same transition while the sidebar makes the return trip. */
|
|
8
|
+
export declare const DOC_CLOSING_CLASS = "bp-doc-closing";
|
|
9
|
+
/** The one breakpoint the doc feature keys off: at or above it the overlay
|
|
10
|
+
* gets the desktop stage; below it a PDF goes to the OS viewer instead (iOS
|
|
11
|
+
* Safari cannot scroll an iframed PDF, Android Chrome forces a download).
|
|
12
|
+
* 1024px — the SAME breakpoint as U5's desktop CSS block and the width where
|
|
13
|
+
* the nav sidebar exists at all. Deliberately NOT the chat's 768px dock query:
|
|
14
|
+
* keying JS at 768 while the pane's desktop rules start at 1024 would give
|
|
15
|
+
* 768–1023px viewers framed PDFs inside the mobile pane geometry, under a
|
|
16
|
+
* docked chat. */
|
|
17
|
+
export declare const DOC_DESKTOP_QUERY = "(min-width: 1024px)";
|
|
18
|
+
/** Cross-island open request. Islands that would rather not import this module
|
|
19
|
+
* can dispatch it instead; applying an already-current value is a no-op, so
|
|
20
|
+
* the dispatch-listen pair cannot loop. */
|
|
21
|
+
export declare const docFileOpenEvent: import("../..").TypedEvent<{
|
|
22
|
+
sectionId: string | null;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function isDocDesktop(): boolean;
|
|
25
|
+
export declare function openDocFile(sectionId: string): void;
|
|
26
|
+
export declare function closeDocFile(): void;
|
|
27
|
+
export declare function getOpenDocFile(): string | null;
|
|
28
|
+
export declare function subscribeDocFile(cb: (sectionId: string | null) => void): () => void;
|
|
29
|
+
/** Authoritative publish — the editor's live draft list. */
|
|
30
|
+
export declare function setSiteDocuments(docs: SiteDocument[]): void;
|
|
31
|
+
/** First-writer-wins publish for the SSR-derived list, so an island that mounts
|
|
32
|
+
* after the editor has already published cannot clobber the live list. */
|
|
33
|
+
export declare function seedSiteDocuments(docs: SiteDocument[]): void;
|
|
34
|
+
export declare function getSiteDocuments(): SiteDocument[] | null;
|
|
35
|
+
export declare function subscribeSiteDocuments(cb: (docs: SiteDocument[] | null) => void): () => void;
|
|
36
|
+
/** Test-only: drop the store and any window wiring (mirrors clearRegistry). */
|
|
37
|
+
export declare function resetDocFileState(): void;
|
|
38
|
+
//# sourceMappingURL=doc-file-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-file-state.d.ts","sourceRoot":"","sources":["../../../src/components/docfile/doc-file-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD,+EAA+E;AAC/E,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAE5C;;;+DAG+D;AAC/D,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAKlD;;;;;;;mBAOmB;AACnB,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AAEvD;;4CAE4C;AAC5C,eAAO,MAAM,gBAAgB;eAA4B,MAAM,GAAG,IAAI;EAAuB,CAAC;AA4B9F,wBAAgB,YAAY,IAAI,OAAO,CAGtC;AAkDD,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAWnD;AAED,wBAAgB,YAAY,IAAI,IAAI,CAUnC;AAED,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAE9C;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,MAAM,IAAI,CAkCnF;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI,CAI3D;AAED;2EAC2E;AAC3E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI,CAG5D;AAED,wBAAgB,gBAAgB,IAAI,YAAY,EAAE,GAAG,IAAI,CAExD;AAED,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI,KAAK,IAAI,GAAG,MAAM,IAAI,CAI5F;AAED,+EAA+E;AAC/E,wBAAgB,iBAAiB,IAAI,IAAI,CAQxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsForm.d.ts","sourceRoot":"","sources":["../../../src/components/editor/SettingsForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAoB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SettingsForm.d.ts","sourceRoot":"","sources":["../../../src/components/editor/SettingsForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAoB,MAAM,oBAAoB,CAAC;AAa3E,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,UAAU,iBAAiB;IACzB,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;CAC9C;AAuKD,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,iBAAiB,2CA8BjF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface DocumentDropZoneProps {
|
|
2
|
+
/** Fired with the staged/committed document id once the upload resolves. */
|
|
3
|
+
onDocumentSelected: (documentId: string) => void;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The empty state of a `document` section in edit mode: drop a PDF/HTML file to
|
|
8
|
+
* upload it, or click to pick one from the library. Editor-only — the viewer
|
|
9
|
+
* never renders an unconfigured document section at all.
|
|
10
|
+
*
|
|
11
|
+
* Deliberately thin on validation: every rejection (wrong type, too large, no
|
|
12
|
+
* documents store) belongs to `uploadDocument`, which already routes typed copy
|
|
13
|
+
* through the pipeline's `onUploadError` → `UploadRejectionAlert` channel. The
|
|
14
|
+
* one judgement made here is WHICH file of a multi-file drop to hand over.
|
|
15
|
+
*/
|
|
16
|
+
export declare function DocumentDropZone({ onDocumentSelected, className }: DocumentDropZoneProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=DocumentDropZone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentDropZone.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/DocumentDropZone.tsx"],"names":[],"mappings":"AAMA,UAAU,qBAAqB;IAC7B,4EAA4E;IAC5E,kBAAkB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,kBAAkB,EAAE,SAAS,EAAE,EAAE,qBAAqB,2CAsDxF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare function DocumentRow({ sectionId, title, documentId, isEditMode, onDocumentSelected, }: {
|
|
2
|
+
sectionId: string;
|
|
3
|
+
title: string;
|
|
4
|
+
/** Raw `content.doc.documentId`. Empty means UNCONFIGURED, which is a
|
|
5
|
+
* different state from an id that no longer resolves (see below). */
|
|
6
|
+
documentId?: string;
|
|
7
|
+
isEditMode: boolean;
|
|
8
|
+
/** Present only when the section is editable — wires a picked/uploaded id
|
|
9
|
+
* back into content. Absent for viewers and for a locked/read-only render. */
|
|
10
|
+
onDocumentSelected?: (documentId: string) => void;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
declare const _default: import("../../..").SectionDefinition<{
|
|
13
|
+
type: "document";
|
|
14
|
+
content: {
|
|
15
|
+
title: string;
|
|
16
|
+
doc: {
|
|
17
|
+
documentId: string;
|
|
18
|
+
};
|
|
19
|
+
showInDocumentsNav: boolean;
|
|
20
|
+
};
|
|
21
|
+
options: Record<string, never>;
|
|
22
|
+
}>;
|
|
23
|
+
export default _default;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Document/index.tsx"],"names":[],"mappings":"AAsDA,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,KAAK,EACL,UAAe,EACf,UAAU,EACV,kBAAkB,GACnB,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd;0EACsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB;mFAC+E;IAC/E,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD,kDA8DA;;;;;;;;;;;;AAED,wBA2DG"}
|
|
@@ -203,5 +203,15 @@ export declare const allSectionDefs: (import("../..").SectionDefinition<{
|
|
|
203
203
|
border?: boolean | undefined;
|
|
204
204
|
objectFit?: "cover" | "contain" | undefined;
|
|
205
205
|
};
|
|
206
|
+
}> | import("../..").SectionDefinition<{
|
|
207
|
+
type: "document";
|
|
208
|
+
content: {
|
|
209
|
+
title: string;
|
|
210
|
+
doc: {
|
|
211
|
+
documentId: string;
|
|
212
|
+
};
|
|
213
|
+
showInDocumentsNav: boolean;
|
|
214
|
+
};
|
|
215
|
+
options: Record<string, never>;
|
|
206
216
|
}>)[];
|
|
207
217
|
//# sourceMappingURL=all-sections.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-sections.d.ts","sourceRoot":"","sources":["../../../src/components/sections/all-sections.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"all-sections.d.ts","sourceRoot":"","sources":["../../../src/components/sections/all-sections.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAiD,CAAC"}
|
|
@@ -79,6 +79,16 @@ export declare const brandGuideSectionDefs: (import("../..").SectionDefinition<{
|
|
|
79
79
|
border?: boolean | undefined;
|
|
80
80
|
objectFit?: "cover" | "contain" | undefined;
|
|
81
81
|
};
|
|
82
|
+
}> | import("../..").SectionDefinition<{
|
|
83
|
+
type: "document";
|
|
84
|
+
content: {
|
|
85
|
+
title: string;
|
|
86
|
+
doc: {
|
|
87
|
+
documentId: string;
|
|
88
|
+
};
|
|
89
|
+
showInDocumentsNav: boolean;
|
|
90
|
+
};
|
|
91
|
+
options: Record<string, never>;
|
|
82
92
|
}>)[];
|
|
83
93
|
export { ColorSpaceSchema, ColorItemSchema } from "./Colors/schema";
|
|
84
94
|
export type { ColorSpace, ColorItem } from "./Colors/schema";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand-guide.d.ts","sourceRoot":"","sources":["../../../src/components/sections/brand-guide.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"brand-guide.d.ts","sourceRoot":"","sources":["../../../src/components/sections/brand-guide.ts"],"names":[],"mappings":"AAKA;;;iEAGiE;AAEjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAmD,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACpE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -2,13 +2,15 @@ import {
|
|
|
2
2
|
ColorItemSchema,
|
|
3
3
|
ColorSpaceSchema,
|
|
4
4
|
brandGuideSectionDefs
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-P3NNI3QI.js";
|
|
6
6
|
import "../../chunk-5THS4K5D.js";
|
|
7
7
|
import "../../chunk-MUTHF2GT.js";
|
|
8
8
|
import "../../chunk-26ALJO4K.js";
|
|
9
9
|
import "../../chunk-3COSXTOY.js";
|
|
10
10
|
import "../../chunk-PZJL2S3Z.js";
|
|
11
|
+
import "../../chunk-BS5AQHZG.js";
|
|
11
12
|
import "../../chunk-WDSVHKAH.js";
|
|
13
|
+
import "../../chunk-PTOLUMGV.js";
|
|
12
14
|
import "../../chunk-7EOSDFS3.js";
|
|
13
15
|
import "../../chunk-TGNS7D4F.js";
|
|
14
16
|
import "../../chunk-VKAGMEKE.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
allSectionDefs
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-6SLGKRLW.js";
|
|
4
|
+
import "../../chunk-P3NNI3QI.js";
|
|
5
|
+
import "../../chunk-LBHQWIVL.js";
|
|
6
6
|
import "../../chunk-5THS4K5D.js";
|
|
7
7
|
import "../../chunk-EWNDBKYK.js";
|
|
8
8
|
import "../../chunk-MUTHF2GT.js";
|
|
@@ -11,7 +11,9 @@ import "../../chunk-26ALJO4K.js";
|
|
|
11
11
|
import "../../chunk-Y4JQGO6G.js";
|
|
12
12
|
import "../../chunk-3COSXTOY.js";
|
|
13
13
|
import "../../chunk-PZJL2S3Z.js";
|
|
14
|
+
import "../../chunk-BS5AQHZG.js";
|
|
14
15
|
import "../../chunk-WDSVHKAH.js";
|
|
16
|
+
import "../../chunk-PTOLUMGV.js";
|
|
15
17
|
import "../../chunk-72CG6AA2.js";
|
|
16
18
|
import "../../chunk-7EOSDFS3.js";
|
|
17
19
|
import "../../chunk-TGNS7D4F.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
allSectionDefs
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-6SLGKRLW.js";
|
|
4
|
+
import "../../chunk-P3NNI3QI.js";
|
|
5
|
+
import "../../chunk-LBHQWIVL.js";
|
|
6
6
|
import "../../chunk-5THS4K5D.js";
|
|
7
7
|
import "../../chunk-EWNDBKYK.js";
|
|
8
8
|
import "../../chunk-MUTHF2GT.js";
|
|
@@ -11,7 +11,9 @@ import "../../chunk-26ALJO4K.js";
|
|
|
11
11
|
import "../../chunk-Y4JQGO6G.js";
|
|
12
12
|
import "../../chunk-3COSXTOY.js";
|
|
13
13
|
import "../../chunk-PZJL2S3Z.js";
|
|
14
|
+
import "../../chunk-BS5AQHZG.js";
|
|
14
15
|
import "../../chunk-WDSVHKAH.js";
|
|
16
|
+
import "../../chunk-PTOLUMGV.js";
|
|
15
17
|
import "../../chunk-72CG6AA2.js";
|
|
16
18
|
import "../../chunk-7EOSDFS3.js";
|
|
17
19
|
import "../../chunk-TGNS7D4F.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface DocumentRef {
|
|
2
|
+
documentId: string;
|
|
3
|
+
}
|
|
4
|
+
interface Props {
|
|
5
|
+
value: DocumentRef | undefined;
|
|
6
|
+
onChange: (value: DocumentRef) => void;
|
|
7
|
+
}
|
|
8
|
+
/** Picker for the `document` section type. Writes only { documentId } — the
|
|
9
|
+
* filename/size shown here are read back out of the sidecar manifest, never
|
|
10
|
+
* copied into section content. */
|
|
11
|
+
export declare function DocumentSourceField({ value, onChange }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=DocumentSourceField.d.ts.map
|