@drawnagency/primitives 0.1.91 → 0.1.93
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-MK7YB2A4.js → chunk-3HJDMFTB.js} +1 -1
- package/dist/{chunk-NV4R6VHN.js → chunk-CI624HRS.js} +1 -1
- package/dist/{chunk-XUIJHYKI.js → chunk-HLKAQLTV.js} +3 -3
- package/dist/{chunk-XKRQMTE4.js → chunk-LQQY2RW6.js} +2 -2
- package/dist/{chunk-ZLG7S54V.js → chunk-RBKBNQGB.js} +6 -6
- package/dist/{chunk-KMQZYORS.js → chunk-RHWWQV3J.js} +35 -6
- package/dist/{chunk-CZ3YXGK5.js → chunk-SOILPZ7U.js} +27 -3
- package/dist/{chunk-AGWE2LJG.js → chunk-UFOWXOG6.js} +49 -1
- package/dist/{chunk-SIYQ37QY.js → chunk-XYFZ57AS.js} +2 -2
- package/dist/{chunk-KBQNJZUX.js → chunk-YI2HUFE3.js} +1 -1
- package/dist/components/editor/index.js +4 -4
- package/dist/components/primitives/index.js +5 -5
- package/dist/components/sections/brand-guide.js +5 -5
- package/dist/components/sections/register-schemas.js +8 -8
- package/dist/components/sections/register.js +8 -8
- package/dist/components/shared/SubTabs.d.ts +22 -0
- package/dist/components/shared/SubTabs.d.ts.map +1 -0
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsChatbot.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsDisplay.d.ts.map +1 -1
- package/dist/components/shell/ViewerLoginForm.d.ts +1 -0
- package/dist/components/shell/ViewerLoginForm.d.ts.map +1 -1
- package/dist/index.js +18 -6
- package/dist/lib/contrast.d.ts +19 -0
- package/dist/lib/contrast.d.ts.map +1 -1
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +16 -4
- package/dist/lib/theme-vars.d.ts +16 -0
- package/dist/lib/theme-vars.d.ts.map +1 -0
- package/dist/media/compose-preview.d.ts +9 -0
- package/dist/media/compose-preview.d.ts.map +1 -1
- package/dist/media/index.js +2 -2
- package/dist/media/preview-inputs.d.ts.map +1 -1
- package/dist/schemas/index.js +2 -2
- package/dist/schemas/site-config.d.ts +3 -0
- package/dist/schemas/site-config.d.ts.map +1 -1
- package/dist/types/database.d.ts +12 -0
- package/dist/types/database.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/shared/SubTabs.tsx +70 -0
- package/src/components/shared/Tabs.tsx +1 -1
- package/src/components/shell/EditorShell.tsx +24 -10
- package/src/components/shell/SiteSettingsChatbot.tsx +38 -18
- package/src/components/shell/SiteSettingsDisplay.tsx +202 -31
- package/src/components/shell/ViewerLoginForm.tsx +31 -27
- package/src/lib/contrast.ts +52 -0
- package/src/lib/index.ts +10 -1
- package/src/lib/theme-vars.ts +31 -0
- package/src/media/compose-preview.ts +56 -4
- package/src/media/preview-inputs.ts +3 -1
- package/src/schemas/site-config.ts +41 -5
- package/src/types/database.ts +10 -0
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
MediaBlock,
|
|
10
10
|
containerGridClass,
|
|
11
11
|
useEditableCollection
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LQQY2RW6.js";
|
|
13
13
|
import {
|
|
14
14
|
AddIcon,
|
|
15
15
|
DeleteIcon,
|
|
16
16
|
DragHandle,
|
|
17
17
|
IconButton
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CI624HRS.js";
|
|
19
19
|
import {
|
|
20
20
|
DEFAULT_LINK,
|
|
21
21
|
LinkValueSchema
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
HexColorSchema,
|
|
32
32
|
SingleMediaReferenceSchema
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-RHWWQV3J.js";
|
|
34
34
|
import {
|
|
35
35
|
defineSection
|
|
36
36
|
} from "./chunk-VKAGMEKE.js";
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
SettingsIcon,
|
|
7
7
|
useMediaLibrary,
|
|
8
8
|
useResolvedMedia
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CI624HRS.js";
|
|
10
10
|
import {
|
|
11
11
|
rebindImageRef
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SOILPZ7U.js";
|
|
13
13
|
import {
|
|
14
14
|
cn
|
|
15
15
|
} from "./chunk-7EOSDFS3.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
pluralize,
|
|
4
4
|
stripHtmlToPlainText,
|
|
5
5
|
truncate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HLKAQLTV.js";
|
|
7
7
|
import {
|
|
8
8
|
DeleteButton,
|
|
9
9
|
DragHandle,
|
|
@@ -17,11 +17,11 @@ import {
|
|
|
17
17
|
buildBlockDropData,
|
|
18
18
|
canDropBlock,
|
|
19
19
|
isBlockDragData
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-XYFZ57AS.js";
|
|
21
21
|
import {
|
|
22
22
|
EditableRichText,
|
|
23
23
|
defineHeadingSection
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-YI2HUFE3.js";
|
|
25
25
|
import {
|
|
26
26
|
EditablePlainText,
|
|
27
27
|
ImageDropZone,
|
|
@@ -31,11 +31,11 @@ import {
|
|
|
31
31
|
containerGridClass,
|
|
32
32
|
masonryColumnsClass,
|
|
33
33
|
spacerHiddenClass
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-LQQY2RW6.js";
|
|
35
35
|
import {
|
|
36
36
|
useMediaLibrary,
|
|
37
37
|
useResolvedMedia
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-CI624HRS.js";
|
|
39
39
|
import {
|
|
40
40
|
embedUrl
|
|
41
41
|
} from "./chunk-Y4JQGO6G.js";
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
} from "./chunk-TZQPOR5A.js";
|
|
55
55
|
import {
|
|
56
56
|
SingleMediaReferenceSchema
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-RHWWQV3J.js";
|
|
58
58
|
import {
|
|
59
59
|
defineSection,
|
|
60
60
|
getSection
|
|
@@ -214,15 +214,34 @@ var CanonicalIndexSchema = z3.object({
|
|
|
214
214
|
}
|
|
215
215
|
seenSlugs.add(p.slug);
|
|
216
216
|
}
|
|
217
|
+
const fmtIds = (ids) => ids.map((id) => `"${id}"`).sort().join(", ");
|
|
217
218
|
const fromPages = [];
|
|
218
219
|
for (const p of data.pages) fromPages.push(...p.order);
|
|
219
220
|
const fromPagesSet = new Set(fromPages);
|
|
220
|
-
if (fromPages.length !== fromPagesSet.size) {
|
|
221
|
-
ctx.addIssue({ code: z3.ZodIssueCode.custom, message: "A section id appears in more than one page" });
|
|
222
|
-
}
|
|
223
221
|
const sectionKeys = Object.keys(data.sections);
|
|
224
|
-
|
|
225
|
-
|
|
222
|
+
const sectionSet = new Set(sectionKeys);
|
|
223
|
+
const counts = /* @__PURE__ */ new Map();
|
|
224
|
+
for (const id of fromPages) counts.set(id, (counts.get(id) ?? 0) + 1);
|
|
225
|
+
const duplicated = [...counts].filter(([, n]) => n > 1).map(([id]) => id);
|
|
226
|
+
if (duplicated.length > 0) {
|
|
227
|
+
ctx.addIssue({
|
|
228
|
+
code: z3.ZodIssueCode.custom,
|
|
229
|
+
message: `Section id(s) appear in more than one page order: ${fmtIds(duplicated)}`
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
const orderedNotInSections = [...fromPagesSet].filter((id) => !sectionSet.has(id));
|
|
233
|
+
if (orderedNotInSections.length > 0) {
|
|
234
|
+
ctx.addIssue({
|
|
235
|
+
code: z3.ZodIssueCode.custom,
|
|
236
|
+
message: `Section id(s) in a page order but missing from sections{}: ${fmtIds(orderedNotInSections)}`
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
const sectionsNotOrdered = sectionKeys.filter((id) => !fromPagesSet.has(id));
|
|
240
|
+
if (sectionsNotOrdered.length > 0) {
|
|
241
|
+
ctx.addIssue({
|
|
242
|
+
code: z3.ZodIssueCode.custom,
|
|
243
|
+
message: `Section id(s) in sections{} but not in any page order: ${fmtIds(sectionsNotOrdered)}`
|
|
244
|
+
});
|
|
226
245
|
}
|
|
227
246
|
});
|
|
228
247
|
var IndexSchema = RawIndexSchema.transform(normalizeRawIndex).pipe(CanonicalIndexSchema);
|
|
@@ -276,6 +295,12 @@ var SiteConfigSchema = z3.object({
|
|
|
276
295
|
siteName: z3.string().default("Brand Portal"),
|
|
277
296
|
primaryColor: HexColorSchema.default("#009ca6"),
|
|
278
297
|
primaryContrast: HexColorSchema.default("#f0f0f0"),
|
|
298
|
+
// Dark-mode overrides for the brand primary / accent. Only applied when
|
|
299
|
+
// darkMode is "optional" (both modes are reachable, so a single value can't
|
|
300
|
+
// satisfy both). null = reuse the light value in dark mode. Rendered via the
|
|
301
|
+
// CSS light-dark() function (see lib/theme-vars.ts).
|
|
302
|
+
primaryColorDark: HexColorSchema.nullable().default(null),
|
|
303
|
+
primaryContrastDark: HexColorSchema.nullable().default(null),
|
|
279
304
|
darkMode: z3.enum(["light", "dark", "optional"]).default("light"),
|
|
280
305
|
// Maps to the --radius-outer design token (see lib/corner-radius.ts);
|
|
281
306
|
// defaults so pre-existing site-config.json files keep parsing.
|
|
@@ -309,7 +334,11 @@ var SiteConfigSchema = z3.object({
|
|
|
309
334
|
previewImage: z3.object({
|
|
310
335
|
imageId: z3.string(),
|
|
311
336
|
width: z3.number().int().positive(),
|
|
312
|
-
height: z3.number().int().positive()
|
|
337
|
+
height: z3.number().int().positive(),
|
|
338
|
+
// Compose-logic version that produced this raster. Pre-existing rasters
|
|
339
|
+
// (and manifests written before this field) default to 0, which is below
|
|
340
|
+
// any current PREVIEW_COMPOSE_VERSION, so the editor regenerates them.
|
|
341
|
+
version: z3.number().int().nonnegative().default(0)
|
|
313
342
|
}).nullable().default(null),
|
|
314
343
|
// Optional site description → og:description + <meta name="description">.
|
|
315
344
|
description: z3.string().max(300).nullable().default(null),
|
|
@@ -311,6 +311,31 @@ function generateVideoPoster(blob, quality) {
|
|
|
311
311
|
// src/media/compose-preview.ts
|
|
312
312
|
var WIDTH = 1200;
|
|
313
313
|
var HEIGHT = 630;
|
|
314
|
+
var HEADING_WEIGHT = 700;
|
|
315
|
+
async function loadHeadingFont(family, googleFontsUrl) {
|
|
316
|
+
if (!family || family === "system-ui" || !googleFontsUrl || typeof FontFace === "undefined") return;
|
|
317
|
+
const spec = `${HEADING_WEIGHT} 84px "${family}"`;
|
|
318
|
+
try {
|
|
319
|
+
const loaded = await document.fonts.load(spec);
|
|
320
|
+
if (loaded.length > 0) return;
|
|
321
|
+
} catch {
|
|
322
|
+
}
|
|
323
|
+
try {
|
|
324
|
+
const css = await (await fetch(googleFontsUrl)).text();
|
|
325
|
+
const blocks = css.match(/@font-face\s*\{[^}]*\}/g) ?? [];
|
|
326
|
+
const wanted = blocks.filter((b) => new RegExp(`font-weight:\\s*${HEADING_WEIGHT}\\b`).test(b));
|
|
327
|
+
await Promise.all(
|
|
328
|
+
(wanted.length ? wanted : blocks).map(async (block) => {
|
|
329
|
+
const url = block.match(/url\(([^)]+)\)/)?.[1];
|
|
330
|
+
if (!url) return;
|
|
331
|
+
const face = new FontFace(family, `url(${url})`, { weight: String(HEADING_WEIGHT) });
|
|
332
|
+
await face.load();
|
|
333
|
+
document.fonts.add(face);
|
|
334
|
+
})
|
|
335
|
+
);
|
|
336
|
+
} catch {
|
|
337
|
+
}
|
|
338
|
+
}
|
|
314
339
|
async function composePreviewImage(inputs) {
|
|
315
340
|
const canvas = document.createElement("canvas");
|
|
316
341
|
canvas.width = WIDTH;
|
|
@@ -340,12 +365,11 @@ async function composePreviewImage(inputs) {
|
|
|
340
365
|
}
|
|
341
366
|
if (!drewLogo) {
|
|
342
367
|
if (document.fonts?.ready) await document.fonts.ready;
|
|
343
|
-
await
|
|
344
|
-
});
|
|
368
|
+
await loadHeadingFont(inputs.headingFont, inputs.googleFontsUrl);
|
|
345
369
|
ctx.fillStyle = inputs.textColor;
|
|
346
370
|
ctx.textAlign = "center";
|
|
347
371
|
ctx.textBaseline = "middle";
|
|
348
|
-
ctx.font =
|
|
372
|
+
ctx.font = `${HEADING_WEIGHT} 84px "${inputs.headingFont}", system-ui, sans-serif`;
|
|
349
373
|
ctx.fillText(inputs.siteName, WIDTH / 2, HEIGHT / 2, WIDTH * 0.86);
|
|
350
374
|
}
|
|
351
375
|
return await new Promise((resolve, reject) => {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-TZQPOR5A.js";
|
|
10
10
|
import {
|
|
11
11
|
IndexSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RHWWQV3J.js";
|
|
13
13
|
import {
|
|
14
14
|
getAllSchemas
|
|
15
15
|
} from "./chunk-VKAGMEKE.js";
|
|
@@ -48,6 +48,48 @@ function contrastColor(hex) {
|
|
|
48
48
|
const b = parseInt(h.slice(4, 6), 16);
|
|
49
49
|
return (r * 299 + g * 587 + b * 114) / 1e3 > 150 ? "#1a1a1a" : "#ffffff";
|
|
50
50
|
}
|
|
51
|
+
function toRgb(hex) {
|
|
52
|
+
const h = hex.replace("#", "");
|
|
53
|
+
const x = h.length === 3 ? h[0] + h[0] + h[1] + h[1] + h[2] + h[2] : h;
|
|
54
|
+
return [
|
|
55
|
+
parseInt(x.slice(0, 2), 16),
|
|
56
|
+
parseInt(x.slice(2, 4), 16),
|
|
57
|
+
parseInt(x.slice(4, 6), 16)
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
function relativeLuminance(hex) {
|
|
61
|
+
const [r, g, b] = toRgb(hex).map((c) => {
|
|
62
|
+
const s = c / 255;
|
|
63
|
+
return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
|
|
64
|
+
});
|
|
65
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
66
|
+
}
|
|
67
|
+
function contrastRatio(a, b) {
|
|
68
|
+
const la = relativeLuminance(a);
|
|
69
|
+
const lb = relativeLuminance(b);
|
|
70
|
+
const hi = Math.max(la, lb);
|
|
71
|
+
const lo = Math.min(la, lb);
|
|
72
|
+
return (hi + 0.05) / (lo + 0.05);
|
|
73
|
+
}
|
|
74
|
+
function wcagLevel(ratio) {
|
|
75
|
+
return { aa: ratio >= 4.5, aaLarge: ratio >= 3, aaa: ratio >= 7 };
|
|
76
|
+
}
|
|
77
|
+
function suggestAccessibleOn(bg) {
|
|
78
|
+
return contrastRatio("#000000", bg) >= contrastRatio("#ffffff", bg) ? "#000000" : "#ffffff";
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// src/lib/theme-vars.ts
|
|
82
|
+
var DEFAULT_PRIMARY = "#009ca6";
|
|
83
|
+
var DEFAULT_CONTRAST = "#f0f0f0";
|
|
84
|
+
function lightDark(light, dark, optional) {
|
|
85
|
+
return optional && dark ? `light-dark(${light}, ${dark})` : light;
|
|
86
|
+
}
|
|
87
|
+
function primaryVarValue(c) {
|
|
88
|
+
return lightDark(c?.primaryColor ?? DEFAULT_PRIMARY, c?.primaryColorDark, c?.darkMode === "optional");
|
|
89
|
+
}
|
|
90
|
+
function accentVarValue(c) {
|
|
91
|
+
return lightDark(c?.primaryContrast ?? DEFAULT_CONTRAST, c?.primaryContrastDark, c?.darkMode === "optional");
|
|
92
|
+
}
|
|
51
93
|
|
|
52
94
|
// src/lib/grid.ts
|
|
53
95
|
var gridColsClass = {
|
|
@@ -164,6 +206,12 @@ export {
|
|
|
164
206
|
resolveThinkingPhrases,
|
|
165
207
|
deriveContrast,
|
|
166
208
|
contrastColor,
|
|
209
|
+
relativeLuminance,
|
|
210
|
+
contrastRatio,
|
|
211
|
+
wcagLevel,
|
|
212
|
+
suggestAccessibleOn,
|
|
213
|
+
primaryVarValue,
|
|
214
|
+
accentVarValue,
|
|
167
215
|
gridColsClass,
|
|
168
216
|
buildGoogleFontsUrl,
|
|
169
217
|
formatTimestamp,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
SettingsIcon,
|
|
15
15
|
useMediaLibrary,
|
|
16
16
|
useResolvedMedia
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-CI624HRS.js";
|
|
18
18
|
import {
|
|
19
19
|
cn
|
|
20
20
|
} from "./chunk-7EOSDFS3.js";
|
|
@@ -378,7 +378,7 @@ function Tabs({ tabs, defaultTabId, activeTabId, onTabChange, fullBleedTabBar })
|
|
|
378
378
|
onClick: () => handleSelect(tab.id),
|
|
379
379
|
className: cn(
|
|
380
380
|
"cursor-pointer px-4 py-2 text-sm font-medium border-b-2 -mb-px",
|
|
381
|
-
activeTab?.id === tab.id ? "border-
|
|
381
|
+
activeTab?.id === tab.id ? "border-primary text-primary" : "border-transparent text-base-contrast-light hover:text-base-contrast"
|
|
382
382
|
),
|
|
383
383
|
children: tab.label
|
|
384
384
|
},
|
|
@@ -11,20 +11,20 @@ import {
|
|
|
11
11
|
buildBlockDropData,
|
|
12
12
|
canDropBlock,
|
|
13
13
|
isBlockDragData
|
|
14
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-XYFZ57AS.js";
|
|
15
15
|
import "../../chunk-5THS4K5D.js";
|
|
16
16
|
import "../../chunk-ZSPCE6MZ.js";
|
|
17
17
|
import {
|
|
18
18
|
AddIcon,
|
|
19
19
|
IconButton
|
|
20
|
-
} from "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
20
|
+
} from "../../chunk-CI624HRS.js";
|
|
21
|
+
import "../../chunk-SOILPZ7U.js";
|
|
22
22
|
import "../../chunk-677NTHAZ.js";
|
|
23
23
|
import {
|
|
24
24
|
cn
|
|
25
25
|
} from "../../chunk-7EOSDFS3.js";
|
|
26
26
|
import "../../chunk-YBVK254P.js";
|
|
27
|
-
import "../../chunk-
|
|
27
|
+
import "../../chunk-RHWWQV3J.js";
|
|
28
28
|
import "../../chunk-FM4M4Q2W.js";
|
|
29
29
|
import "../../chunk-JSBRDJBE.js";
|
|
30
30
|
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
EditableRichText,
|
|
3
3
|
LinkPopover,
|
|
4
4
|
defineHeadingSection
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-YI2HUFE3.js";
|
|
6
6
|
import {
|
|
7
7
|
EditableGrid,
|
|
8
8
|
EditablePlainText,
|
|
@@ -10,20 +10,20 @@ import {
|
|
|
10
10
|
MediaBlock,
|
|
11
11
|
ResolvedMedia,
|
|
12
12
|
useEditableCollection
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-LQQY2RW6.js";
|
|
14
14
|
import "../../chunk-ZSPCE6MZ.js";
|
|
15
15
|
import {
|
|
16
16
|
DeleteIcon,
|
|
17
17
|
DragHandle,
|
|
18
18
|
IconButton
|
|
19
|
-
} from "../../chunk-
|
|
20
|
-
import "../../chunk-
|
|
19
|
+
} from "../../chunk-CI624HRS.js";
|
|
20
|
+
import "../../chunk-SOILPZ7U.js";
|
|
21
21
|
import "../../chunk-53DKVAB6.js";
|
|
22
22
|
import {
|
|
23
23
|
cn
|
|
24
24
|
} from "../../chunk-7EOSDFS3.js";
|
|
25
25
|
import "../../chunk-YBVK254P.js";
|
|
26
|
-
import "../../chunk-
|
|
26
|
+
import "../../chunk-RHWWQV3J.js";
|
|
27
27
|
import "../../chunk-VKAGMEKE.js";
|
|
28
28
|
import "../../chunk-FM4M4Q2W.js";
|
|
29
29
|
import "../../chunk-JSBRDJBE.js";
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
ColorItemSchema,
|
|
3
3
|
ColorSpaceSchema,
|
|
4
4
|
brandGuideSectionDefs
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-HLKAQLTV.js";
|
|
6
6
|
import "../../chunk-5THS4K5D.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-LQQY2RW6.js";
|
|
8
|
+
import "../../chunk-CI624HRS.js";
|
|
9
|
+
import "../../chunk-SOILPZ7U.js";
|
|
10
10
|
import "../../chunk-PZJL2S3Z.js";
|
|
11
11
|
import "../../chunk-WDSVHKAH.js";
|
|
12
12
|
import "../../chunk-7EOSDFS3.js";
|
|
13
13
|
import "../../chunk-YBVK254P.js";
|
|
14
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-RHWWQV3J.js";
|
|
15
15
|
import "../../chunk-VKAGMEKE.js";
|
|
16
16
|
import "../../chunk-FM4M4Q2W.js";
|
|
17
17
|
import "../../chunk-JSBRDJBE.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
allSectionDefs
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-RBKBNQGB.js";
|
|
4
|
+
import "../../chunk-HLKAQLTV.js";
|
|
5
|
+
import "../../chunk-XYFZ57AS.js";
|
|
6
6
|
import "../../chunk-5THS4K5D.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-YI2HUFE3.js";
|
|
8
|
+
import "../../chunk-LQQY2RW6.js";
|
|
9
9
|
import "../../chunk-ZSPCE6MZ.js";
|
|
10
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-CI624HRS.js";
|
|
11
11
|
import "../../chunk-Y4JQGO6G.js";
|
|
12
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-SOILPZ7U.js";
|
|
13
13
|
import "../../chunk-PZJL2S3Z.js";
|
|
14
14
|
import "../../chunk-WDSVHKAH.js";
|
|
15
15
|
import "../../chunk-53DKVAB6.js";
|
|
16
16
|
import "../../chunk-7EOSDFS3.js";
|
|
17
17
|
import "../../chunk-YBVK254P.js";
|
|
18
18
|
import "../../chunk-TZQPOR5A.js";
|
|
19
|
-
import "../../chunk-
|
|
19
|
+
import "../../chunk-RHWWQV3J.js";
|
|
20
20
|
import {
|
|
21
21
|
registerRichText,
|
|
22
22
|
registerSchema
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
allSectionDefs
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-RBKBNQGB.js";
|
|
4
|
+
import "../../chunk-HLKAQLTV.js";
|
|
5
|
+
import "../../chunk-XYFZ57AS.js";
|
|
6
6
|
import "../../chunk-5THS4K5D.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-YI2HUFE3.js";
|
|
8
|
+
import "../../chunk-LQQY2RW6.js";
|
|
9
9
|
import "../../chunk-ZSPCE6MZ.js";
|
|
10
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-CI624HRS.js";
|
|
11
11
|
import "../../chunk-Y4JQGO6G.js";
|
|
12
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-SOILPZ7U.js";
|
|
13
13
|
import "../../chunk-PZJL2S3Z.js";
|
|
14
14
|
import "../../chunk-WDSVHKAH.js";
|
|
15
15
|
import "../../chunk-53DKVAB6.js";
|
|
16
16
|
import "../../chunk-7EOSDFS3.js";
|
|
17
17
|
import "../../chunk-YBVK254P.js";
|
|
18
18
|
import "../../chunk-TZQPOR5A.js";
|
|
19
|
-
import "../../chunk-
|
|
19
|
+
import "../../chunk-RHWWQV3J.js";
|
|
20
20
|
import {
|
|
21
21
|
registerSection
|
|
22
22
|
} from "../../chunk-VKAGMEKE.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface SubTabItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
content: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
interface SubTabsProps {
|
|
8
|
+
tabs: SubTabItem[];
|
|
9
|
+
defaultTabId?: string;
|
|
10
|
+
activeTabId?: string;
|
|
11
|
+
onTabChange?: (id: string) => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* SubTabs — a second-level tab bar for use *inside* a top-level `Tabs` panel
|
|
16
|
+
* (e.g. Site Settings → Display → Details | Styles | Typography). Uses a soft
|
|
17
|
+
* pill language — active pill gets a tinted primary wash, inactive is quiet
|
|
18
|
+
* text — so it never reads as another underline tab row like `Tabs`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function SubTabs({ tabs, defaultTabId, activeTabId, onTabChange, className, }: SubTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=SubTabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubTabs.d.ts","sourceRoot":"","sources":["../../../src/components/shared/SubTabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGjD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,UAAU,YAAY;IACpB,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,SAAS,GACV,EAAE,YAAY,2CAwCd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorShell.d.ts","sourceRoot":"","sources":["../../../src/components/shell/EditorShell.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAcjD,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"EditorShell.d.ts","sourceRoot":"","sources":["../../../src/components/shell/EditorShell.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAcjD,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAwDtF,OAAO,KAAK,EAAE,eAAe,EAA2D,MAAM,oBAAoB,CAAC;AAwCnH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAoBxD,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAC;IAIhB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,YAAY,EAAE;QACZ,KAAK,EAAE,OAAO,CAAC;QACf,aAAa,EAAE,OAAO,CAAC;QACvB,YAAY,EAAE,OAAO,CAAC;QACtB,cAAc,EAAE,OAAO,CAAC;QACxB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,cAAc,EAAE,OAAO,CAAC;KACzB,CAAC;IACF,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAA;KAAE,GAAG,IAAI,CAAC;IAIhE,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAKjC,eAAe,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CAC1C;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,OAAO,EACP,YAAY,EACZ,MAAM,EACN,SAAS,EAAE,gBAAgB,EAC3B,YAAY,EACZ,WAAW,EACX,sBAA8B,EAC9B,eAAe,GAChB,EAAE,KAAK,2CAynDP;AAuED;6EAC6E;AAC7E,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,WAAW,CAAC,YAAY,CAAC,EACvC,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,eAAe,EAAE,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteSettingsChatbot.d.ts","sourceRoot":"","sources":["../../../src/components/shell/SiteSettingsChatbot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SiteSettingsChatbot.d.ts","sourceRoot":"","sources":["../../../src/components/shell/SiteSettingsChatbot.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAA8B,MAAM,2BAA2B,CAAC;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAcjD,UAAU,KAAK;IACb,UAAU,EAAE,UAAU,CAAC;IACvB,kBAAkB,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACjD,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAsBD,wBAAgB,mBAAmB,CAAC,EAAE,UAAU,EAAE,kBAAkB,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,KAAK,2CA+MxG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteSettingsDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/shell/SiteSettingsDisplay.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SiteSettingsDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/shell/SiteSettingsDisplay.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG5D,UAAU,KAAK;IACb,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AA6DD,wBAAgB,mBAAmB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,KAAK,2CAmZlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewerLoginForm.d.ts","sourceRoot":"","sources":["../../../src/components/shell/ViewerLoginForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ViewerLoginForm.d.ts","sourceRoot":"","sources":["../../../src/components/shell/ViewerLoginForm.tsx"],"names":[],"mappings":"AAMA,UAAU,KAAK;IACb,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC/E,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,KAAK,2CAuFzD"}
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
resolveMedia,
|
|
33
33
|
sanitizeMediaName,
|
|
34
34
|
setMediaProvider
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-SOILPZ7U.js";
|
|
36
36
|
import {
|
|
37
37
|
CollabPeerSchema,
|
|
38
38
|
HEARTBEAT_INTERVAL_MS,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
AudienceNameSchema,
|
|
52
52
|
MediaGridOptionsSchema,
|
|
53
53
|
slugifyAudienceName
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-3HJDMFTB.js";
|
|
55
55
|
import {
|
|
56
56
|
AudienceSchema,
|
|
57
57
|
RoleSchema,
|
|
@@ -66,18 +66,24 @@ import {
|
|
|
66
66
|
} from "./chunk-PZJL2S3Z.js";
|
|
67
67
|
import {
|
|
68
68
|
DEFAULT_CHATBOT_NAME,
|
|
69
|
+
accentVarValue,
|
|
69
70
|
buildGoogleFontsUrl,
|
|
70
71
|
contrastColor,
|
|
72
|
+
contrastRatio,
|
|
71
73
|
deriveContrast,
|
|
72
74
|
formatTimestamp,
|
|
73
75
|
gridColsClass,
|
|
74
76
|
loadSiteContent,
|
|
75
77
|
loadStaticSiteContent,
|
|
76
78
|
mergeSiteContent,
|
|
79
|
+
primaryVarValue,
|
|
80
|
+
relativeLuminance,
|
|
77
81
|
resolveChatbotName,
|
|
78
82
|
resolveThinkingPhrases,
|
|
79
|
-
safeRedirect
|
|
80
|
-
|
|
83
|
+
safeRedirect,
|
|
84
|
+
suggestAccessibleOn,
|
|
85
|
+
wcagLevel
|
|
86
|
+
} from "./chunk-UFOWXOG6.js";
|
|
81
87
|
import {
|
|
82
88
|
curatedIcons,
|
|
83
89
|
getIcon
|
|
@@ -131,7 +137,7 @@ import {
|
|
|
131
137
|
TextLineSchema,
|
|
132
138
|
VariantSchema,
|
|
133
139
|
normalizeSiteIndex
|
|
134
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-RHWWQV3J.js";
|
|
135
141
|
import {
|
|
136
142
|
clearRegistry,
|
|
137
143
|
createRegistry,
|
|
@@ -208,12 +214,14 @@ export {
|
|
|
208
214
|
TakeoverMessageSchema,
|
|
209
215
|
TextLineSchema,
|
|
210
216
|
VariantSchema,
|
|
217
|
+
accentVarValue,
|
|
211
218
|
audiencePasses,
|
|
212
219
|
buildGoogleFontsUrl,
|
|
213
220
|
clearRegistry,
|
|
214
221
|
cn,
|
|
215
222
|
composePreviewImage,
|
|
216
223
|
contrastColor,
|
|
224
|
+
contrastRatio,
|
|
217
225
|
createEvent,
|
|
218
226
|
createRegistry,
|
|
219
227
|
curatedIcons,
|
|
@@ -250,9 +258,11 @@ export {
|
|
|
250
258
|
mimeToExt,
|
|
251
259
|
navChangeEvent,
|
|
252
260
|
normalizeSiteIndex,
|
|
261
|
+
primaryVarValue,
|
|
253
262
|
rebindImageRef,
|
|
254
263
|
registerSchema,
|
|
255
264
|
registerSection,
|
|
265
|
+
relativeLuminance,
|
|
256
266
|
requireSessionSecret,
|
|
257
267
|
resolveChatbotName,
|
|
258
268
|
resolveLogo,
|
|
@@ -269,7 +279,9 @@ export {
|
|
|
269
279
|
signAudienceToken,
|
|
270
280
|
signSessionToken,
|
|
271
281
|
slugifyAudienceName,
|
|
282
|
+
suggestAccessibleOn,
|
|
272
283
|
toSectionId,
|
|
273
284
|
verifyAudienceToken,
|
|
274
|
-
verifySessionToken
|
|
285
|
+
verifySessionToken,
|
|
286
|
+
wcagLevel
|
|
275
287
|
};
|
package/dist/lib/contrast.d.ts
CHANGED
|
@@ -4,4 +4,23 @@ export declare function deriveContrast(hex: string): string;
|
|
|
4
4
|
* uses). Returns near-black for light backgrounds, white for dark ones.
|
|
5
5
|
*/
|
|
6
6
|
export declare function contrastColor(hex: string): "#1a1a1a" | "#ffffff";
|
|
7
|
+
/** WCAG relative luminance of an sRGB hex color (0 = black, 1 = white). */
|
|
8
|
+
export declare function relativeLuminance(hex: string): number;
|
|
9
|
+
/** WCAG contrast ratio between two hex colors, 1 (identical) → 21 (#000/#fff). */
|
|
10
|
+
export declare function contrastRatio(a: string, b: string): number;
|
|
11
|
+
export interface WcagLevel {
|
|
12
|
+
/** ≥ 4.5:1 — AA for normal-size text. */
|
|
13
|
+
aa: boolean;
|
|
14
|
+
/** ≥ 3:1 — AA for large text and UI components. */
|
|
15
|
+
aaLarge: boolean;
|
|
16
|
+
/** ≥ 7:1 — AAA for normal-size text. */
|
|
17
|
+
aaa: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function wcagLevel(ratio: number): WcagLevel;
|
|
20
|
+
/**
|
|
21
|
+
* Pick the pure black/white that maximizes contrast against `bg` — used to
|
|
22
|
+
* suggest an accessible accent (text on a primary-colored button). Pure b/w
|
|
23
|
+
* gives the highest achievable ratio for a foreground on a fixed background.
|
|
24
|
+
*/
|
|
25
|
+
export declare function suggestAccessibleOn(bg: string): "#000000" | "#ffffff";
|
|
7
26
|
//# sourceMappingURL=contrast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contrast.d.ts","sourceRoot":"","sources":["../../src/lib/contrast.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAUlD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAMhE"}
|
|
1
|
+
{"version":3,"file":"contrast.d.ts","sourceRoot":"","sources":["../../src/lib/contrast.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAUlD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAMhE;AAcD,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMrD;AAED,kFAAkF;AAClF,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1D;AAED,MAAM,WAAW,SAAS;IACxB,yCAAyC;IACzC,EAAE,EAAE,OAAO,CAAC;IACZ,mDAAmD;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,GAAG,EAAE,OAAO,CAAC;CACd;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAElD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAErE"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export { cn } from "./cn";
|
|
|
3
3
|
export { audiencePasses } from "./pages";
|
|
4
4
|
export { resolveChatbotName, resolveThinkingPhrases, DEFAULT_CHATBOT_NAME } from "./chatbot";
|
|
5
5
|
export { generateNavLinks, toSectionId, type NavItem } from "./nav";
|
|
6
|
-
export { deriveContrast, contrastColor } from "./contrast";
|
|
6
|
+
export { deriveContrast, contrastColor, relativeLuminance, contrastRatio, wcagLevel, suggestAccessibleOn, type WcagLevel, } from "./contrast";
|
|
7
|
+
export { primaryVarValue, accentVarValue } from "./theme-vars";
|
|
7
8
|
export { sanitizeHtml, ensureSanitizer } from "./sanitize";
|
|
8
9
|
export { gridColsClass } from "./grid";
|
|
9
10
|
export { getIcon, curatedIcons, type IconEntry } from "./icons";
|