@drawnagency/primitives 0.1.88 → 0.1.90
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-75P6HWPN.js → chunk-5BM2Y3NJ.js} +5 -3
- package/dist/{chunk-OEL57NYV.js → chunk-AGWE2LJG.js} +26 -2
- package/dist/{chunk-DRCPDOW3.js → chunk-CZ3YXGK5.js} +59 -0
- package/dist/{chunk-PTVY3Q7P.js → chunk-KBQNJZUX.js} +1 -1
- package/dist/{chunk-XPUBUR64.js → chunk-KMQZYORS.js} +28 -2
- package/dist/{chunk-WA3HFN54.js → chunk-MK7YB2A4.js} +1 -1
- package/dist/{chunk-EO7K45GV.js → chunk-NV4R6VHN.js} +1 -1
- package/dist/{chunk-XDG2K6UT.js → chunk-SIYQ37QY.js} +13 -5
- package/dist/{chunk-NEDOJHHR.js → chunk-XKRQMTE4.js} +11 -2
- package/dist/{chunk-SK6GGTTO.js → chunk-XUIJHYKI.js} +3 -3
- package/dist/{chunk-H2FENAQH.js → chunk-ZLG7S54V.js} +242 -83
- package/dist/components/chat/ChatPanel.d.ts +20 -3
- package/dist/components/chat/ChatPanel.d.ts.map +1 -1
- package/dist/components/chat/ChatWidget.d.ts +7 -1
- package/dist/components/chat/ChatWidget.d.ts.map +1 -1
- package/dist/components/chat/chat-history.d.ts +24 -0
- package/dist/components/chat/chat-history.d.ts.map +1 -0
- package/dist/components/editor/AudienceIndicator.d.ts +6 -0
- package/dist/components/editor/AudienceIndicator.d.ts.map +1 -1
- package/dist/components/editor/ChildBlockWrapper.d.ts.map +1 -1
- package/dist/components/editor/ColSpanControl.d.ts.map +1 -1
- package/dist/components/editor/DragHandle.d.ts +3 -1
- package/dist/components/editor/DragHandle.d.ts.map +1 -1
- package/dist/components/editor/SectionWrapper.d.ts.map +1 -1
- package/dist/components/editor/StatusIndicator.d.ts +7 -0
- package/dist/components/editor/StatusIndicator.d.ts.map +1 -1
- package/dist/components/editor/index.js +100 -78
- package/dist/components/primitives/index.js +5 -5
- package/dist/components/sections/Container/Container.d.ts +3 -2
- package/dist/components/sections/Container/Container.d.ts.map +1 -1
- package/dist/components/sections/Container/ContainerSettingsForm.d.ts +4 -2
- package/dist/components/sections/Container/ContainerSettingsForm.d.ts.map +1 -1
- package/dist/components/sections/Container/index.d.ts +8 -2
- package/dist/components/sections/Container/index.d.ts.map +1 -1
- package/dist/components/sections/SectionLayout.d.ts +3 -1
- package/dist/components/sections/SectionLayout.d.ts.map +1 -1
- package/dist/components/sections/ViewRenderer.d.ts +3 -1
- package/dist/components/sections/ViewRenderer.d.ts.map +1 -1
- package/dist/components/sections/all-sections.d.ts +8 -2
- package/dist/components/sections/all-sections.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.js +5 -5
- package/dist/components/sections/core-sections.d.ts +8 -2
- package/dist/components/sections/core-sections.d.ts.map +1 -1
- package/dist/components/sections/register-schemas.js +8 -8
- package/dist/components/sections/register.js +8 -8
- package/dist/components/shared/Navigation.d.ts +6 -1
- package/dist/components/shared/Navigation.d.ts.map +1 -1
- package/dist/components/shared/Tooltip.d.ts +8 -1
- package/dist/components/shared/Tooltip.d.ts.map +1 -1
- package/dist/components/shell/AudiencePreviewMenu.d.ts +7 -0
- package/dist/components/shell/AudiencePreviewMenu.d.ts.map +1 -0
- package/dist/components/shell/AuthoringDefaultsMenu.d.ts +10 -0
- package/dist/components/shell/AuthoringDefaultsMenu.d.ts.map +1 -0
- package/dist/components/shell/EditorContext.d.ts +3 -0
- package/dist/components/shell/EditorContext.d.ts.map +1 -1
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/components/shell/MediaLibraryContext.d.ts +3 -1
- package/dist/components/shell/MediaLibraryContext.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsChatbot.d.ts.map +1 -1
- package/dist/hooks/useBuildStatus.d.ts.map +1 -1
- package/dist/hooks/useMediaPipeline.d.ts +5 -1
- package/dist/hooks/useMediaPipeline.d.ts.map +1 -1
- package/dist/index.js +17 -5
- package/dist/lib/authoring-defaults.d.ts +17 -0
- package/dist/lib/authoring-defaults.d.ts.map +1 -0
- package/dist/lib/chatbot.d.ts +10 -0
- package/dist/lib/chatbot.d.ts.map +1 -0
- package/dist/lib/container-grid.d.ts +6 -0
- package/dist/lib/container-grid.d.ts.map +1 -1
- package/dist/lib/contrast.d.ts +5 -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 +11 -3
- package/dist/lib/migrate-sections-transform.js +1 -1
- package/dist/media/compose-preview.d.ts +23 -0
- package/dist/media/compose-preview.d.ts.map +1 -0
- package/dist/media/index.d.ts +1 -0
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +4 -2
- package/dist/media/preview-inputs.d.ts +31 -0
- package/dist/media/preview-inputs.d.ts.map +1 -0
- package/dist/schemas/index.js +4 -2
- package/dist/schemas/media.d.ts +2 -0
- package/dist/schemas/media.d.ts.map +1 -1
- package/dist/schemas/site-config.d.ts +18 -0
- package/dist/schemas/site-config.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/chat/ChatPanel.tsx +437 -65
- package/src/components/chat/ChatWidget.tsx +90 -32
- package/src/components/chat/chat-history.ts +105 -0
- package/src/components/editor/AudienceIndicator.tsx +50 -37
- package/src/components/editor/ChildBlockWrapper.tsx +8 -7
- package/src/components/editor/ColSpanControl.tsx +14 -11
- package/src/components/editor/DragHandle.tsx +5 -2
- package/src/components/editor/PagesModal.tsx +10 -10
- package/src/components/editor/SectionWrapper.tsx +32 -21
- package/src/components/editor/StatusIndicator.tsx +37 -24
- package/src/components/sections/Container/Container.tsx +185 -43
- package/src/components/sections/Container/ContainerSettingsForm.tsx +64 -24
- package/src/components/sections/Container/index.tsx +45 -20
- package/src/components/sections/SectionLayout.tsx +13 -3
- package/src/components/sections/ViewRenderer.tsx +11 -2
- package/src/components/shared/Navigation.tsx +18 -5
- package/src/components/shared/Tooltip.tsx +18 -2
- package/src/components/shell/AudiencePreviewMenu.tsx +73 -0
- package/src/components/shell/AuthoringDefaultsMenu.tsx +54 -0
- package/src/components/shell/EditorContext.tsx +5 -1
- package/src/components/shell/EditorShell.tsx +130 -13
- package/src/components/shell/MediaLibraryContext.tsx +1 -1
- package/src/components/shell/SiteSettingsChatbot.tsx +49 -1
- package/src/hooks/useBuildStatus.ts +35 -4
- package/src/hooks/useMediaPipeline.ts +7 -3
- package/src/lib/authoring-defaults.ts +42 -0
- package/src/lib/chatbot.ts +30 -0
- package/src/lib/container-grid.ts +14 -0
- package/src/lib/contrast.ts +12 -0
- package/src/lib/index.ts +2 -1
- package/src/lib/migrate-sections-transform.ts +5 -3
- package/src/media/compose-preview.ts +90 -0
- package/src/media/index.ts +1 -0
- package/src/media/preview-inputs.ts +77 -0
- package/src/schemas/media.ts +3 -0
- package/src/schemas/site-config.ts +27 -2
|
@@ -76,7 +76,8 @@ function upgradeGrid(section) {
|
|
|
76
76
|
type: "container",
|
|
77
77
|
content: {
|
|
78
78
|
columns: content.columns,
|
|
79
|
-
|
|
79
|
+
layout: "grid",
|
|
80
|
+
equalizeRowHeight: false,
|
|
80
81
|
children: media.map((item, i) => mapRefItem(item, id, i))
|
|
81
82
|
}
|
|
82
83
|
};
|
|
@@ -100,7 +101,7 @@ function upgradeSplitContent(section) {
|
|
|
100
101
|
content: { body: content.body ?? "" }
|
|
101
102
|
};
|
|
102
103
|
const children = options.imagePosition === "right" ? [proseChild, mediaChild] : [mediaChild, proseChild];
|
|
103
|
-
const out = { id, type: "container", content: { columns: 2,
|
|
104
|
+
const out = { id, type: "container", content: { columns: 2, layout: "grid", equalizeRowHeight: false, children } };
|
|
104
105
|
if (section.layout !== void 0) out.layout = section.layout;
|
|
105
106
|
return out;
|
|
106
107
|
}
|
|
@@ -131,7 +132,8 @@ function upgradeDoDont(section) {
|
|
|
131
132
|
type: "container",
|
|
132
133
|
content: {
|
|
133
134
|
columns: 2,
|
|
134
|
-
|
|
135
|
+
layout: "grid",
|
|
136
|
+
equalizeRowHeight: false,
|
|
135
137
|
children: [
|
|
136
138
|
dodontChild(doItems, id, 0, "do", childOptions),
|
|
137
139
|
dodontChild(dontItems, id, 1, "dont", childOptions)
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-S2L3BPLS.js";
|
|
4
4
|
import {
|
|
5
5
|
upgradeLegacySection
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5BM2Y3NJ.js";
|
|
7
7
|
import {
|
|
8
8
|
getSectionSchema
|
|
9
9
|
} from "./chunk-TZQPOR5A.js";
|
|
10
10
|
import {
|
|
11
11
|
IndexSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KMQZYORS.js";
|
|
13
13
|
import {
|
|
14
14
|
getAllSchemas
|
|
15
15
|
} from "./chunk-VKAGMEKE.js";
|
|
@@ -18,6 +18,19 @@ import {
|
|
|
18
18
|
blockDepth
|
|
19
19
|
} from "./chunk-NSCT3AMV.js";
|
|
20
20
|
|
|
21
|
+
// src/lib/chatbot.ts
|
|
22
|
+
var DEFAULT_CHATBOT_NAME = "Portal Assistant";
|
|
23
|
+
function resolveChatbotName(chatbot, audience) {
|
|
24
|
+
const perAudience = audience !== null ? chatbot.audienceNames?.[audience] : void 0;
|
|
25
|
+
if (typeof perAudience === "string" && perAudience.trim()) return perAudience.trim();
|
|
26
|
+
if (typeof chatbot.name === "string" && chatbot.name.trim()) return chatbot.name.trim();
|
|
27
|
+
return DEFAULT_CHATBOT_NAME;
|
|
28
|
+
}
|
|
29
|
+
function resolveThinkingPhrases(phrases) {
|
|
30
|
+
const list = (phrases ?? []).filter((p) => typeof p === "string").map((p) => p.trim()).filter(Boolean).map((p) => `${p}\u2026`);
|
|
31
|
+
return list.length > 0 ? list : ["Thinking\u2026"];
|
|
32
|
+
}
|
|
33
|
+
|
|
21
34
|
// src/lib/contrast.ts
|
|
22
35
|
function deriveContrast(hex) {
|
|
23
36
|
const h = hex.replace("#", "");
|
|
@@ -28,6 +41,13 @@ function deriveContrast(hex) {
|
|
|
28
41
|
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
29
42
|
return luminance >= 0.5 ? "#1a1a1a" : "#f0f0f0";
|
|
30
43
|
}
|
|
44
|
+
function contrastColor(hex) {
|
|
45
|
+
const h = hex.replace("#", "");
|
|
46
|
+
const r = parseInt(h.slice(0, 2), 16);
|
|
47
|
+
const g = parseInt(h.slice(2, 4), 16);
|
|
48
|
+
const b = parseInt(h.slice(4, 6), 16);
|
|
49
|
+
return (r * 299 + g * 587 + b * 114) / 1e3 > 150 ? "#1a1a1a" : "#ffffff";
|
|
50
|
+
}
|
|
31
51
|
|
|
32
52
|
// src/lib/grid.ts
|
|
33
53
|
var gridColsClass = {
|
|
@@ -139,7 +159,11 @@ async function loadSiteContent(contentDir) {
|
|
|
139
159
|
}
|
|
140
160
|
|
|
141
161
|
export {
|
|
162
|
+
DEFAULT_CHATBOT_NAME,
|
|
163
|
+
resolveChatbotName,
|
|
164
|
+
resolveThinkingPhrases,
|
|
142
165
|
deriveContrast,
|
|
166
|
+
contrastColor,
|
|
143
167
|
gridColsClass,
|
|
144
168
|
buildGoogleFontsUrl,
|
|
145
169
|
formatTimestamp,
|
|
@@ -308,6 +308,64 @@ function generateVideoPoster(blob, quality) {
|
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
+
// src/media/compose-preview.ts
|
|
312
|
+
var WIDTH = 1200;
|
|
313
|
+
var HEIGHT = 630;
|
|
314
|
+
async function composePreviewImage(inputs) {
|
|
315
|
+
const canvas = document.createElement("canvas");
|
|
316
|
+
canvas.width = WIDTH;
|
|
317
|
+
canvas.height = HEIGHT;
|
|
318
|
+
const ctx = canvas.getContext("2d");
|
|
319
|
+
if (!ctx) throw new Error("2D canvas context unavailable");
|
|
320
|
+
ctx.fillStyle = inputs.background;
|
|
321
|
+
ctx.fillRect(0, 0, WIDTH, HEIGHT);
|
|
322
|
+
let drewLogo = false;
|
|
323
|
+
if (inputs.mode === "logo" && inputs.logoUrl) {
|
|
324
|
+
try {
|
|
325
|
+
const img = await loadImage(inputs.logoUrl);
|
|
326
|
+
if (!(img.width > 0 && img.height > 0)) {
|
|
327
|
+
throw new Error("Logo image has no intrinsic size");
|
|
328
|
+
}
|
|
329
|
+
const maxW = WIDTH * 0.6;
|
|
330
|
+
const maxH = HEIGHT * 0.5;
|
|
331
|
+
const scale = Math.min(maxW / img.width, maxH / img.height);
|
|
332
|
+
const w = img.width * scale;
|
|
333
|
+
const h = img.height * scale;
|
|
334
|
+
ctx.filter = inputs.invertLogo ? "invert(1)" : "none";
|
|
335
|
+
ctx.drawImage(img, (WIDTH - w) / 2, (HEIGHT - h) / 2, w, h);
|
|
336
|
+
ctx.filter = "none";
|
|
337
|
+
drewLogo = true;
|
|
338
|
+
} catch {
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (!drewLogo) {
|
|
342
|
+
if (document.fonts?.ready) await document.fonts.ready;
|
|
343
|
+
await document.fonts.load(`600 84px ${inputs.headingFont}`).catch(() => {
|
|
344
|
+
});
|
|
345
|
+
ctx.fillStyle = inputs.textColor;
|
|
346
|
+
ctx.textAlign = "center";
|
|
347
|
+
ctx.textBaseline = "middle";
|
|
348
|
+
ctx.font = `600 84px ${inputs.headingFont}, system-ui, sans-serif`;
|
|
349
|
+
ctx.fillText(inputs.siteName, WIDTH / 2, HEIGHT / 2, WIDTH * 0.86);
|
|
350
|
+
}
|
|
351
|
+
return await new Promise((resolve, reject) => {
|
|
352
|
+
canvas.toBlob(
|
|
353
|
+
(blob) => blob ? resolve(blob) : reject(new Error("toBlob returned null")),
|
|
354
|
+
"image/webp",
|
|
355
|
+
0.9
|
|
356
|
+
);
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
function loadImage(url) {
|
|
360
|
+
return new Promise((resolve, reject) => {
|
|
361
|
+
const img = new Image();
|
|
362
|
+
img.crossOrigin = "anonymous";
|
|
363
|
+
img.onload = () => resolve(img);
|
|
364
|
+
img.onerror = () => reject(new Error(`failed to load ${url}`));
|
|
365
|
+
img.src = url;
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
|
|
311
369
|
// src/media/index.ts
|
|
312
370
|
var MEDIA_KEY = /* @__PURE__ */ Symbol.for("@drawnagency/primitives/media");
|
|
313
371
|
var _g = globalThis;
|
|
@@ -339,6 +397,7 @@ export {
|
|
|
339
397
|
rebindImageRef,
|
|
340
398
|
resolveLogo,
|
|
341
399
|
generateVideoPoster,
|
|
400
|
+
composePreviewImage,
|
|
342
401
|
setMediaProvider,
|
|
343
402
|
getMediaProvider
|
|
344
403
|
};
|
|
@@ -100,7 +100,10 @@ var MediaItemSchema = z2.object({
|
|
|
100
100
|
duration: z2.number().positive().optional(),
|
|
101
101
|
// Display folder (MediaFolderSchema key). Absent = root/unfiled. NOT the
|
|
102
102
|
// git storage dir — that's `folder` above, which never changes.
|
|
103
|
-
folderId: z2.string().optional()
|
|
103
|
+
folderId: z2.string().optional(),
|
|
104
|
+
// System-generated assets (e.g. the Phase 3 social-preview raster) set this
|
|
105
|
+
// so the media-library UI can exclude them. Absent on all user uploads.
|
|
106
|
+
hidden: z2.boolean().optional()
|
|
104
107
|
});
|
|
105
108
|
var ImageManifestSchema = z2.object({
|
|
106
109
|
images: z2.record(z2.string(), MediaItemSchema),
|
|
@@ -239,6 +242,15 @@ var ChatbotTaskSchema = z3.object({
|
|
|
239
242
|
});
|
|
240
243
|
var ChatbotConfigSchema = z3.object({
|
|
241
244
|
enabled: z3.boolean().default(false),
|
|
245
|
+
// Assistant display name shown in the widget header and used in the system
|
|
246
|
+
// prompt. Blank falls back to "Portal Assistant" (resolveChatbotName).
|
|
247
|
+
name: z3.string().max(60).default("Portal Assistant"),
|
|
248
|
+
// Per-audience name overrides, keyed by audience name — same inert-when-
|
|
249
|
+
// deselected semantics as audiencePrompts.
|
|
250
|
+
audienceNames: z3.record(z3.string(), z3.string().max(60)).default({}),
|
|
251
|
+
// Brand-flavored waiting phrases, shown (with "…" appended) while the
|
|
252
|
+
// assistant streams no text yet. Empty = the widget's "Thinking…" default.
|
|
253
|
+
thinkingPhrases: z3.array(z3.string().max(80)).max(30).default([]),
|
|
242
254
|
systemPrompt: z3.string().max(8e3).default(""),
|
|
243
255
|
// Audience names the widget is shown to — strict opt-in: [] = no viewer
|
|
244
256
|
// sees it (editors always can via /edit). Gates: [...slug].astro + /api/chat.
|
|
@@ -288,10 +300,23 @@ var SiteConfigSchema = z3.object({
|
|
|
288
300
|
showInNav: z3.boolean().default(true)
|
|
289
301
|
}).nullable().default(null),
|
|
290
302
|
media: MediaConfigSchema.default(MediaConfigSchema.parse({})),
|
|
303
|
+
// Composed social-preview raster, stored as a media-library reference so it
|
|
304
|
+
// participates in usage tracking + GC protection. Composed client-side at
|
|
305
|
+
// save time (Phase 3). `width`/`height` are the ACTUAL served variant size
|
|
306
|
+
// (the /api/media route only serves exact generated-variant widths), so the
|
|
307
|
+
// og:image URL + dimensions are correct. Defaults null so pre-existing
|
|
308
|
+
// configs keep parsing and sites without a preview emit no og:image tags.
|
|
309
|
+
previewImage: z3.object({
|
|
310
|
+
imageId: z3.string(),
|
|
311
|
+
width: z3.number().int().positive(),
|
|
312
|
+
height: z3.number().int().positive()
|
|
313
|
+
}).nullable().default(null),
|
|
314
|
+
// Optional site description → og:description + <meta name="description">.
|
|
315
|
+
description: z3.string().max(300).nullable().default(null),
|
|
291
316
|
// Brand chatbot config (editor-owned; the platform kill switch lives in the
|
|
292
317
|
// sites table, not here). Every field defaults so pre-existing
|
|
293
318
|
// site-config.json files keep parsing.
|
|
294
|
-
chatbot: ChatbotConfigSchema.default({ enabled: false, systemPrompt: "", audiences: [], tasks: [], audiencePrompts: {} })
|
|
319
|
+
chatbot: ChatbotConfigSchema.default({ enabled: false, name: "Portal Assistant", audienceNames: {}, thinkingPhrases: [], systemPrompt: "", audiences: [], tasks: [], audiencePrompts: {} })
|
|
295
320
|
});
|
|
296
321
|
|
|
297
322
|
export {
|
|
@@ -305,6 +330,7 @@ export {
|
|
|
305
330
|
MediaItemSchema,
|
|
306
331
|
ImageManifestSchema,
|
|
307
332
|
MediaConfigSchema,
|
|
333
|
+
StatusSchema,
|
|
308
334
|
SectionMetaSchema,
|
|
309
335
|
RESERVED_SLUGS,
|
|
310
336
|
PageStatusSchema,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
SettingsIcon,
|
|
15
15
|
useMediaLibrary,
|
|
16
16
|
useResolvedMedia
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NV4R6VHN.js";
|
|
18
18
|
import {
|
|
19
19
|
cn
|
|
20
20
|
} from "./chunk-7EOSDFS3.js";
|
|
@@ -24,13 +24,21 @@ import { forwardRef } from "react";
|
|
|
24
24
|
|
|
25
25
|
// src/components/shared/Tooltip.tsx
|
|
26
26
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
27
|
-
|
|
27
|
+
var sideClasses = {
|
|
28
|
+
bottom: "left-1/2 top-full mt-1.5 -translate-x-1/2",
|
|
29
|
+
right: "left-full top-1/2 ml-1.5 -translate-y-1/2",
|
|
30
|
+
"bottom-clamp": "top-full mt-1.5 left-1/2 -translate-x-1/2 max-xl:left-auto max-xl:right-0 max-xl:translate-x-0"
|
|
31
|
+
};
|
|
32
|
+
function Tooltip({ content, children, className, side = "bottom" }) {
|
|
28
33
|
return /* @__PURE__ */ jsxs("div", { className: cn("group/tooltip relative inline-flex", className), children: [
|
|
29
34
|
children,
|
|
30
35
|
/* @__PURE__ */ jsx(
|
|
31
36
|
"span",
|
|
32
37
|
{
|
|
33
|
-
className:
|
|
38
|
+
className: cn(
|
|
39
|
+
"pointer-events-none absolute z-50 opacity-0 transition-opacity delay-300 group-hover/tooltip:opacity-100",
|
|
40
|
+
sideClasses[side]
|
|
41
|
+
),
|
|
34
42
|
role: "tooltip",
|
|
35
43
|
children: /* @__PURE__ */ jsx("span", { className: "block whitespace-nowrap rounded bg-tooltip px-2 py-1 text-center text-xs leading-relaxed text-tooltip-muted", children: content })
|
|
36
44
|
}
|
|
@@ -43,8 +51,8 @@ function Kbd({ children }) {
|
|
|
43
51
|
|
|
44
52
|
// src/components/editor/DragHandle.tsx
|
|
45
53
|
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
46
|
-
var DragHandle2 = forwardRef(function DragHandle3(
|
|
47
|
-
return /* @__PURE__ */ jsx2(Tooltip, { content: /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
54
|
+
var DragHandle2 = forwardRef(function DragHandle3({ tooltipSide }, ref) {
|
|
55
|
+
return /* @__PURE__ */ jsx2(Tooltip, { side: tooltipSide, content: /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
48
56
|
/* @__PURE__ */ jsx2(Kbd, { children: "Drag" }),
|
|
49
57
|
" to move"
|
|
50
58
|
] }), children: /* @__PURE__ */ jsx2(
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
SettingsIcon,
|
|
7
7
|
useMediaLibrary,
|
|
8
8
|
useResolvedMedia
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NV4R6VHN.js";
|
|
10
10
|
import {
|
|
11
11
|
rebindImageRef
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CZ3YXGK5.js";
|
|
13
13
|
import {
|
|
14
14
|
cn
|
|
15
15
|
} from "./chunk-7EOSDFS3.js";
|
|
@@ -340,6 +340,14 @@ var colSpanClass = {
|
|
|
340
340
|
5: { 1: "", 2: "col-span-1 @xs:col-span-2", 3: "col-span-1 @xs:col-span-2 @md:col-span-3", 4: "col-span-1 @xs:col-span-2 @md:col-span-3 @xl:col-span-4", 5: "col-span-1 @xs:col-span-2 @md:col-span-3 @xl:col-span-5" },
|
|
341
341
|
6: { 1: "", 2: "col-span-1 @xs:col-span-2", 3: "col-span-1 @xs:col-span-2 @md:col-span-3", 4: "col-span-1 @xs:col-span-2 @md:col-span-3 @2xl:col-span-4", 5: "col-span-1 @xs:col-span-2 @md:col-span-3 @2xl:col-span-5", 6: "col-span-1 @xs:col-span-2 @md:col-span-3 @2xl:col-span-6" }
|
|
342
342
|
};
|
|
343
|
+
var masonryColumnsClass = {
|
|
344
|
+
1: "columns-1",
|
|
345
|
+
2: "columns-1 @sm:columns-2",
|
|
346
|
+
3: "columns-1 @sm:columns-2 @lg:columns-3",
|
|
347
|
+
4: "columns-1 @xs:columns-2 @lg:columns-4",
|
|
348
|
+
5: "columns-1 @xs:columns-2 @md:columns-3 @xl:columns-5",
|
|
349
|
+
6: "columns-1 @xs:columns-2 @md:columns-3 @2xl:columns-6"
|
|
350
|
+
};
|
|
343
351
|
var spacerHiddenClass = {
|
|
344
352
|
1: "hidden",
|
|
345
353
|
2: "hidden @sm:block",
|
|
@@ -705,6 +713,7 @@ export {
|
|
|
705
713
|
MAX_CONTAINER_COLUMNS,
|
|
706
714
|
containerGridClass,
|
|
707
715
|
colSpanClass,
|
|
716
|
+
masonryColumnsClass,
|
|
708
717
|
spacerHiddenClass,
|
|
709
718
|
useEditableCollection,
|
|
710
719
|
EditableGrid
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
MediaBlock,
|
|
10
10
|
containerGridClass,
|
|
11
11
|
useEditableCollection
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-XKRQMTE4.js";
|
|
13
13
|
import {
|
|
14
14
|
AddIcon,
|
|
15
15
|
DeleteIcon,
|
|
16
16
|
DragHandle,
|
|
17
17
|
IconButton
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NV4R6VHN.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-KMQZYORS.js";
|
|
34
34
|
import {
|
|
35
35
|
defineSection
|
|
36
36
|
} from "./chunk-VKAGMEKE.js";
|