@drawnagency/primitives 0.1.72 → 0.1.74
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-2HZB675H.js → chunk-7T2WQSWF.js} +2 -2
- package/dist/{chunk-7SIZ2LV5.js → chunk-IFHRHV7S.js} +1 -1
- package/dist/{chunk-VHINNGIF.js → chunk-NKVZGPR6.js} +1 -1
- package/dist/{chunk-BTGHF3SW.js → chunk-RIVBCL6U.js} +29 -3
- package/dist/{chunk-TOBPMMRM.js → chunk-S55OZ7F2.js} +8 -0
- package/dist/{chunk-WCALKWPO.js → chunk-T7MP7ANP.js} +11 -7
- package/dist/{chunk-RBTSUR5V.js → chunk-Y4JQGO6G.js} +10 -1
- package/dist/{chunk-UBK2IZ6G.js → chunk-YYDQGA2N.js} +13 -12
- package/dist/components/editor/index.js +3 -3
- package/dist/components/primitives/ResolvedMedia.d.ts.map +1 -1
- package/dist/components/primitives/index.js +4 -4
- package/dist/components/sections/Media/MediaBlock.d.ts.map +1 -1
- package/dist/components/sections/Video/VideoBlock.d.ts +2 -1
- package/dist/components/sections/Video/VideoBlock.d.ts.map +1 -1
- package/dist/components/sections/Video/index.d.ts +2 -1
- package/dist/components/sections/Video/index.d.ts.map +1 -1
- package/dist/components/sections/all-sections.d.ts +2 -1
- package/dist/components/sections/all-sections.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.js +4 -4
- package/dist/components/sections/core-sections.d.ts +2 -1
- 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/VideoSourceField.d.ts.map +1 -1
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/hooks/useEditorPublish.d.ts +4 -1
- package/dist/hooks/useEditorPublish.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/lib/save-chunks.d.ts +28 -0
- package/dist/lib/save-chunks.d.ts.map +1 -0
- package/dist/lib/video-url.d.ts +10 -1
- package/dist/lib/video-url.d.ts.map +1 -1
- package/dist/lib/video-url.js +1 -1
- package/dist/media/index.js +5 -1
- package/dist/media/resolve.d.ts +14 -0
- package/dist/media/resolve.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/primitives/ResolvedMedia.tsx +10 -5
- package/src/components/sections/Media/MediaBlock.tsx +2 -1
- package/src/components/sections/Video/VideoBlock.tsx +9 -1
- package/src/components/sections/Video/index.tsx +11 -6
- package/src/components/shared/VideoSourceField.tsx +32 -1
- package/src/components/shell/EditorShell.tsx +8 -2
- package/src/hooks/useEditorPublish.ts +134 -50
- package/src/lib/save-chunks.ts +53 -0
- package/src/lib/video-url.ts +18 -5
- package/src/media/resolve.ts +18 -0
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
MediaBlock,
|
|
5
5
|
containerGridClass,
|
|
6
6
|
useEditableCollection
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-T7MP7ANP.js";
|
|
8
8
|
import {
|
|
9
9
|
Checkbox,
|
|
10
10
|
FormLabel,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
DeleteIcon,
|
|
16
16
|
DragHandle,
|
|
17
17
|
IconButton
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IFHRHV7S.js";
|
|
19
19
|
import {
|
|
20
20
|
DEFAULT_LINK,
|
|
21
21
|
LinkValueSchema
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
SettingsIcon,
|
|
15
15
|
useMediaLibrary,
|
|
16
16
|
useResolvedMedia
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-IFHRHV7S.js";
|
|
18
18
|
import {
|
|
19
19
|
cn
|
|
20
20
|
} from "./chunk-7EOSDFS3.js";
|
|
@@ -211,6 +211,11 @@ function LinkField({ label, value, onChange }) {
|
|
|
211
211
|
// src/components/shared/VideoSourceField.tsx
|
|
212
212
|
import { useState } from "react";
|
|
213
213
|
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
214
|
+
var ASPECTS = [
|
|
215
|
+
{ label: "9:16", width: 9, height: 16 },
|
|
216
|
+
{ label: "4:5", width: 4, height: 5 },
|
|
217
|
+
{ label: "1:1", width: 1, height: 1 }
|
|
218
|
+
];
|
|
214
219
|
function VideoSourceField({ value, onChange }) {
|
|
215
220
|
const mediaLibrary = useMediaLibrary();
|
|
216
221
|
const [mode, setMode] = useState(value?.type === "external" ? "embed" : "library");
|
|
@@ -238,6 +243,7 @@ function VideoSourceField({ value, onChange }) {
|
|
|
238
243
|
type: "external",
|
|
239
244
|
provider: body.provider,
|
|
240
245
|
id: body.id,
|
|
246
|
+
...body.kind ? { kind: body.kind } : {},
|
|
241
247
|
url: body.url,
|
|
242
248
|
width: body.width,
|
|
243
249
|
height: body.height
|
|
@@ -300,7 +306,7 @@ function VideoSourceField({ value, onChange }) {
|
|
|
300
306
|
void submitEmbed();
|
|
301
307
|
}
|
|
302
308
|
},
|
|
303
|
-
placeholder: "Paste a YouTube or
|
|
309
|
+
placeholder: "Paste a YouTube, Vimeo, or Instagram URL\u2026",
|
|
304
310
|
className: "flex-1 rounded border border-base-200 bg-base px-2 py-1 text-sm text-base-contrast placeholder:text-base-contrast-light focus:outline-none focus:ring-1 focus:ring-primary"
|
|
305
311
|
}
|
|
306
312
|
),
|
|
@@ -317,7 +323,27 @@ function VideoSourceField({ value, onChange }) {
|
|
|
317
323
|
)
|
|
318
324
|
] }),
|
|
319
325
|
error ? /* @__PURE__ */ jsx7("p", { className: "text-xs text-red-600", children: error }) : null,
|
|
320
|
-
!error && fallback ? /* @__PURE__ */ jsx7("p", { className: "text-xs text-base-contrast-light/70", children: "Added \u2014 couldn't fetch exact dimensions, using 16:9." }) : null
|
|
326
|
+
!error && fallback ? /* @__PURE__ */ jsx7("p", { className: "text-xs text-base-contrast-light/70", children: "Added \u2014 couldn't fetch exact dimensions, using 16:9." }) : null,
|
|
327
|
+
value?.type === "external" && value.provider === "instagram" ? /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
|
|
328
|
+
/* @__PURE__ */ jsx7("span", { className: "text-xs text-base-contrast-light", children: "Aspect" }),
|
|
329
|
+
ASPECTS.map(({ label, width, height }) => {
|
|
330
|
+
const active = value.width === width && value.height === height;
|
|
331
|
+
return /* @__PURE__ */ jsx7(
|
|
332
|
+
"button",
|
|
333
|
+
{
|
|
334
|
+
type: "button",
|
|
335
|
+
"aria-pressed": active,
|
|
336
|
+
onClick: () => onChange({ ...value, width, height }),
|
|
337
|
+
className: cn(
|
|
338
|
+
"cursor-pointer rounded border px-2 py-0.5 text-xs",
|
|
339
|
+
active ? "border-primary bg-primary text-primary-contrast" : "border-base-200 text-base-contrast"
|
|
340
|
+
),
|
|
341
|
+
children: label
|
|
342
|
+
},
|
|
343
|
+
label
|
|
344
|
+
);
|
|
345
|
+
})
|
|
346
|
+
] }) : null
|
|
321
347
|
] })
|
|
322
348
|
] });
|
|
323
349
|
}
|
|
@@ -220,6 +220,12 @@ function resolveManifestReferences(content, manifest, sizes, provider) {
|
|
|
220
220
|
}
|
|
221
221
|
return content;
|
|
222
222
|
}
|
|
223
|
+
var BAKED_MEDIA_KEYS = ["src", "srcset", "alt", "width", "height", "poster"];
|
|
224
|
+
function rebindImageRef(ref, imageId) {
|
|
225
|
+
const fresh = { ...ref, imageId };
|
|
226
|
+
for (const key of BAKED_MEDIA_KEYS) delete fresh[key];
|
|
227
|
+
return fresh;
|
|
228
|
+
}
|
|
223
229
|
|
|
224
230
|
// src/media/videoPoster.ts
|
|
225
231
|
function generateVideoPoster(blob, quality) {
|
|
@@ -312,6 +318,8 @@ export {
|
|
|
312
318
|
ProcessingQueue,
|
|
313
319
|
resolveMedia,
|
|
314
320
|
resolveManifestReferences,
|
|
321
|
+
BAKED_MEDIA_KEYS,
|
|
322
|
+
rebindImageRef,
|
|
315
323
|
generateVideoPoster,
|
|
316
324
|
setMediaProvider,
|
|
317
325
|
getMediaProvider
|
|
@@ -6,7 +6,10 @@ import {
|
|
|
6
6
|
SettingsIcon,
|
|
7
7
|
useMediaLibrary,
|
|
8
8
|
useResolvedMedia
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-IFHRHV7S.js";
|
|
10
|
+
import {
|
|
11
|
+
rebindImageRef
|
|
12
|
+
} from "./chunk-S55OZ7F2.js";
|
|
10
13
|
import {
|
|
11
14
|
cn
|
|
12
15
|
} from "./chunk-7EOSDFS3.js";
|
|
@@ -140,13 +143,14 @@ function ResolvedMedia({
|
|
|
140
143
|
invertFrom
|
|
141
144
|
}) {
|
|
142
145
|
const resolved = useResolvedMedia(imageId);
|
|
143
|
-
const
|
|
144
|
-
const
|
|
146
|
+
const hasResolved = !!resolved.src;
|
|
147
|
+
const src = hasResolved ? resolved.src : propSrc;
|
|
148
|
+
const srcset = hasResolved ? resolved.srcset : propSrcset;
|
|
145
149
|
const poster = resolved.poster;
|
|
146
|
-
const alt =
|
|
150
|
+
const alt = hasResolved ? resolved.alt : propAlt ?? "";
|
|
147
151
|
const kind = resolved.kind;
|
|
148
|
-
const width =
|
|
149
|
-
const height =
|
|
152
|
+
const width = hasResolved ? resolved.width : propWidth;
|
|
153
|
+
const height = hasResolved ? resolved.height : propHeight;
|
|
150
154
|
const [loaded, setLoaded] = useState2(false);
|
|
151
155
|
const invertClass = invertFrom === "light" ? "invert dark:invert-0" : invertFrom === "dark" ? "dark:invert" : void 0;
|
|
152
156
|
const mediaClass = cn("relative h-full w-full", imgClassName, invertClass);
|
|
@@ -259,7 +263,7 @@ function MediaBlock({ refValue, options, link, isEditMode, onRefChange }) {
|
|
|
259
263
|
const fitClass = fit === "cover" ? "object-cover" : "object-contain";
|
|
260
264
|
const showBorder = refValue.border ?? options.border;
|
|
261
265
|
const captionStr = refValue.caption ? Array.isArray(refValue.caption) ? refValue.caption.join("\n") : refValue.caption : "";
|
|
262
|
-
const replace = onRefChange ? (imageId) => onRefChange(
|
|
266
|
+
const replace = onRefChange ? (imageId) => onRefChange(rebindImageRef(refValue, imageId)) : void 0;
|
|
263
267
|
const baked = refValue;
|
|
264
268
|
const bakedWidth = typeof baked.width === "number" ? baked.width : void 0;
|
|
265
269
|
const bakedHeight = typeof baked.height === "number" ? baked.height : void 0;
|
|
@@ -25,10 +25,19 @@ function parseVideoUrl(raw) {
|
|
|
25
25
|
const m = url.pathname.match(/\/(\d{6,12})$/);
|
|
26
26
|
return m ? { provider: "vimeo", id: m[1] } : null;
|
|
27
27
|
}
|
|
28
|
+
if (host === "instagram.com" || host === "m.instagram.com") {
|
|
29
|
+
const m = url.pathname.match(/^(?:\/([\w.]+))?\/(p|reel|reels|tv)\/([\w-]{5,20})\/?$/);
|
|
30
|
+
if (!m || m[1] === "share") return null;
|
|
31
|
+
const kind = m[2] === "p" ? "post" : m[2] === "tv" ? "tv" : "reel";
|
|
32
|
+
return { provider: "instagram", id: m[3], kind };
|
|
33
|
+
}
|
|
28
34
|
return null;
|
|
29
35
|
}
|
|
36
|
+
var IG_PATH = { post: "p", reel: "reel", tv: "tv" };
|
|
30
37
|
function embedUrl(p) {
|
|
31
|
-
|
|
38
|
+
if (p.provider === "youtube") return `https://www.youtube-nocookie.com/embed/${p.id}`;
|
|
39
|
+
if (p.provider === "instagram") return `https://www.instagram.com/${IG_PATH[p.kind ?? "post"]}/${p.id}/embed/`;
|
|
40
|
+
return `https://player.vimeo.com/video/${p.id}`;
|
|
32
41
|
}
|
|
33
42
|
|
|
34
43
|
export {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EditableRichText,
|
|
3
3
|
defineHeadingSection
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NKVZGPR6.js";
|
|
5
5
|
import {
|
|
6
6
|
embedUrl
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Y4JQGO6G.js";
|
|
8
8
|
import {
|
|
9
9
|
brandGuideSectionDefs,
|
|
10
10
|
pluralize,
|
|
11
11
|
stripHtmlToPlainText,
|
|
12
12
|
truncate
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7T2WQSWF.js";
|
|
14
14
|
import {
|
|
15
15
|
EditablePlainText,
|
|
16
16
|
ImageDropZone,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
colSpanClass,
|
|
20
20
|
containerGridClass,
|
|
21
21
|
spacerHiddenClass
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-T7MP7ANP.js";
|
|
23
23
|
import {
|
|
24
24
|
DeleteButton,
|
|
25
25
|
DragHandle,
|
|
@@ -31,11 +31,11 @@ import {
|
|
|
31
31
|
buildBlockDropData,
|
|
32
32
|
canDropBlock,
|
|
33
33
|
isBlockDragData
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-RIVBCL6U.js";
|
|
35
35
|
import {
|
|
36
36
|
useMediaLibrary,
|
|
37
37
|
useResolvedMedia
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-IFHRHV7S.js";
|
|
39
39
|
import {
|
|
40
40
|
DEFAULT_LINK,
|
|
41
41
|
LinkValueSchema
|
|
@@ -322,16 +322,17 @@ var LibrarySource = z3.object({
|
|
|
322
322
|
});
|
|
323
323
|
var ExternalSource = z3.object({
|
|
324
324
|
type: z3.literal("external"),
|
|
325
|
-
provider: z3.enum(["youtube", "vimeo"]).describe("Hosting provider, derived from the pasted URL."),
|
|
326
|
-
id: z3.string().describe("Provider video id parsed from the pasted URL."),
|
|
325
|
+
provider: z3.enum(["youtube", "vimeo", "instagram"]).describe("Hosting provider, derived from the pasted URL."),
|
|
326
|
+
id: z3.string().describe("Provider video id parsed from the pasted URL (Instagram: the post/reel shortcode)."),
|
|
327
|
+
kind: z3.enum(["post", "reel", "tv"]).optional().describe("Instagram only: which embed path the shortcode came from ('p' \u2192 post). Omitted for other providers."),
|
|
327
328
|
url: z3.string().describe("The original video page URL as pasted."),
|
|
328
|
-
width: z3.number().positive().describe("
|
|
329
|
-
height: z3.number().positive().describe("
|
|
329
|
+
width: z3.number().positive().describe("Aspect-ratio width (from oEmbed; Instagram: 9 for reels/tv, 4 for posts; editors can override)."),
|
|
330
|
+
height: z3.number().positive().describe("Aspect-ratio height (from oEmbed; Instagram: 16 for reels/tv, 5 for posts; editors can override).")
|
|
330
331
|
});
|
|
331
332
|
var schema3 = z3.object({
|
|
332
333
|
type: z3.literal("video"),
|
|
333
334
|
content: z3.object({
|
|
334
|
-
source: z3.discriminatedUnion("type", [LibrarySource, ExternalSource]).describe("Where the video comes from: a media-library upload or an external YouTube/Vimeo URL."),
|
|
335
|
+
source: z3.discriminatedUnion("type", [LibrarySource, ExternalSource]).describe("Where the video comes from: a media-library upload or an external YouTube/Vimeo/Instagram URL."),
|
|
335
336
|
caption: z3.string().optional().describe("Optional caption rendered beneath the player when Show caption is on.")
|
|
336
337
|
}),
|
|
337
338
|
options: z3.object({
|
|
@@ -344,7 +345,7 @@ var Video_default = defineSection({
|
|
|
344
345
|
label: "Video",
|
|
345
346
|
icon: /* @__PURE__ */ jsx8(Clapperboard, { size: 18 }),
|
|
346
347
|
schema: schema3,
|
|
347
|
-
authoringNote: "A watchable video player \u2014 self-hosted from the media library or embedded from YouTube/Vimeo. Use playback 'click' for content viewers press play on (controls + audio) and 'ambient' for silent looping footage. For decorative loops inside grids prefer the Media block; large self-hosted files require the site's asset storage.",
|
|
348
|
+
authoringNote: "A watchable video player \u2014 self-hosted from the media library or embedded from YouTube/Vimeo/Instagram. Instagram embeds render the post card at a kind-derived aspect ratio (reels 9:16, posts 4:5) that editors can override. Use playback 'click' for content viewers press play on (controls + audio) and 'ambient' for silent looping footage. For decorative loops inside grids prefer the Media block; large self-hosted files require the site's asset storage.",
|
|
348
349
|
component: ({ content, options, onChange }) => /* @__PURE__ */ jsx8(
|
|
349
350
|
VideoBlock,
|
|
350
351
|
{
|
|
@@ -11,14 +11,14 @@ import {
|
|
|
11
11
|
buildBlockDropData,
|
|
12
12
|
canDropBlock,
|
|
13
13
|
isBlockDragData
|
|
14
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-RIVBCL6U.js";
|
|
15
15
|
import "../../chunk-ZSPCE6MZ.js";
|
|
16
16
|
import "../../chunk-5THS4K5D.js";
|
|
17
17
|
import {
|
|
18
18
|
AddIcon,
|
|
19
19
|
IconButton
|
|
20
|
-
} from "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
20
|
+
} from "../../chunk-IFHRHV7S.js";
|
|
21
|
+
import "../../chunk-S55OZ7F2.js";
|
|
22
22
|
import "../../chunk-677NTHAZ.js";
|
|
23
23
|
import {
|
|
24
24
|
cn
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResolvedMedia.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/ResolvedMedia.tsx"],"names":[],"mappings":"AAKA,UAAU,kBAAkB;IAC1B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,UAAU,EAClB,SAAS,EACT,YAAY,EACZ,UAAU,GACX,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ResolvedMedia.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/ResolvedMedia.tsx"],"names":[],"mappings":"AAKA,UAAU,kBAAkB;IAC1B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,UAAU,EAClB,SAAS,EACT,YAAY,EACZ,UAAU,GACX,EAAE,kBAAkB,2CA2EpB"}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
EditableRichText,
|
|
3
3
|
LinkPopover,
|
|
4
4
|
defineHeadingSection
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-NKVZGPR6.js";
|
|
6
6
|
import {
|
|
7
7
|
EditableGrid,
|
|
8
8
|
EditablePlainText,
|
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
MediaBlock,
|
|
11
11
|
ResolvedMedia,
|
|
12
12
|
useEditableCollection
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-T7MP7ANP.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-IFHRHV7S.js";
|
|
20
|
+
import "../../chunk-S55OZ7F2.js";
|
|
21
21
|
import "../../chunk-53DKVAB6.js";
|
|
22
22
|
import {
|
|
23
23
|
cn
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Media/MediaBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"MediaBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Media/MediaBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQvD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,OAAO,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAAE,CAAC;IACxG,4EAA4E;IAC5E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACnD;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,eAAe,2CA2F/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Video/VideoBlock.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GACzF;
|
|
1
|
+
{"version":3,"file":"VideoBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Video/VideoBlock.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GACzF;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEN,UAAU,eAAe;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QAAE,QAAQ,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACnE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,eAAe,EAAE,EAAE,eAAe,2CAgIpH"}
|
|
@@ -11,11 +11,12 @@ declare const _default: import("../../..").SectionDefinition<{
|
|
|
11
11
|
} | undefined;
|
|
12
12
|
} | {
|
|
13
13
|
type: "external";
|
|
14
|
-
provider: "youtube" | "vimeo";
|
|
14
|
+
provider: "youtube" | "vimeo" | "instagram";
|
|
15
15
|
id: string;
|
|
16
16
|
url: string;
|
|
17
17
|
width: number;
|
|
18
18
|
height: number;
|
|
19
|
+
kind?: "post" | "reel" | "tv" | undefined;
|
|
19
20
|
};
|
|
20
21
|
caption?: string | undefined;
|
|
21
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Video/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Video/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,wBA2DG"}
|
|
@@ -80,11 +80,12 @@ export declare const allSectionDefs: (import("../..").SectionDefinition<{
|
|
|
80
80
|
} | undefined;
|
|
81
81
|
} | {
|
|
82
82
|
type: "external";
|
|
83
|
-
provider: "youtube" | "vimeo";
|
|
83
|
+
provider: "youtube" | "vimeo" | "instagram";
|
|
84
84
|
id: string;
|
|
85
85
|
url: string;
|
|
86
86
|
width: number;
|
|
87
87
|
height: number;
|
|
88
|
+
kind?: "post" | "reel" | "tv" | undefined;
|
|
88
89
|
};
|
|
89
90
|
caption?: string | undefined;
|
|
90
91
|
};
|
|
@@ -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"}
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
ColorItemSchema,
|
|
3
3
|
ColorSpaceSchema,
|
|
4
4
|
brandGuideSectionDefs
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-7T2WQSWF.js";
|
|
6
|
+
import "../../chunk-T7MP7ANP.js";
|
|
7
7
|
import "../../chunk-5THS4K5D.js";
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-IFHRHV7S.js";
|
|
9
|
+
import "../../chunk-S55OZ7F2.js";
|
|
10
10
|
import "../../chunk-PZJL2S3Z.js";
|
|
11
11
|
import "../../chunk-WDSVHKAH.js";
|
|
12
12
|
import "../../chunk-7EOSDFS3.js";
|
|
@@ -75,11 +75,12 @@ export declare const coreSectionDefs: (import("../..").SectionDefinition<{
|
|
|
75
75
|
} | undefined;
|
|
76
76
|
} | {
|
|
77
77
|
type: "external";
|
|
78
|
-
provider: "youtube" | "vimeo";
|
|
78
|
+
provider: "youtube" | "vimeo" | "instagram";
|
|
79
79
|
id: string;
|
|
80
80
|
url: string;
|
|
81
81
|
width: number;
|
|
82
82
|
height: number;
|
|
83
|
+
kind?: "post" | "reel" | "tv" | undefined;
|
|
83
84
|
};
|
|
84
85
|
caption?: string | undefined;
|
|
85
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-sections.d.ts","sourceRoot":"","sources":["../../../src/components/sections/core-sections.ts"],"names":[],"mappings":"AAUA;;+BAE+B;AAK/B,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"core-sections.d.ts","sourceRoot":"","sources":["../../../src/components/sections/core-sections.ts"],"names":[],"mappings":"AAUA;;+BAE+B;AAK/B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAU3B,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
allSectionDefs
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-YYDQGA2N.js";
|
|
4
|
+
import "../../chunk-NKVZGPR6.js";
|
|
5
|
+
import "../../chunk-Y4JQGO6G.js";
|
|
6
|
+
import "../../chunk-7T2WQSWF.js";
|
|
7
|
+
import "../../chunk-T7MP7ANP.js";
|
|
8
|
+
import "../../chunk-RIVBCL6U.js";
|
|
9
9
|
import "../../chunk-ZSPCE6MZ.js";
|
|
10
10
|
import "../../chunk-5THS4K5D.js";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-IFHRHV7S.js";
|
|
12
|
+
import "../../chunk-S55OZ7F2.js";
|
|
13
13
|
import "../../chunk-PZJL2S3Z.js";
|
|
14
14
|
import "../../chunk-53DKVAB6.js";
|
|
15
15
|
import "../../chunk-WDSVHKAH.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
allSectionDefs
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-YYDQGA2N.js";
|
|
4
|
+
import "../../chunk-NKVZGPR6.js";
|
|
5
|
+
import "../../chunk-Y4JQGO6G.js";
|
|
6
|
+
import "../../chunk-7T2WQSWF.js";
|
|
7
|
+
import "../../chunk-T7MP7ANP.js";
|
|
8
|
+
import "../../chunk-RIVBCL6U.js";
|
|
9
9
|
import "../../chunk-ZSPCE6MZ.js";
|
|
10
10
|
import "../../chunk-5THS4K5D.js";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-IFHRHV7S.js";
|
|
12
|
+
import "../../chunk-S55OZ7F2.js";
|
|
13
13
|
import "../../chunk-PZJL2S3Z.js";
|
|
14
14
|
import "../../chunk-53DKVAB6.js";
|
|
15
15
|
import "../../chunk-WDSVHKAH.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoSourceField.d.ts","sourceRoot":"","sources":["../../../src/components/shared/VideoSourceField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAGhE,UAAU,KAAK;IACb,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CACzC;
|
|
1
|
+
{"version":3,"file":"VideoSourceField.d.ts","sourceRoot":"","sources":["../../../src/components/shared/VideoSourceField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAGhE,UAAU,KAAK;IACb,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CACzC;AAYD,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,2CAuJ1D"}
|
|
@@ -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;AA0EjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAQxD,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;CAClC;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,OAAO,EACP,YAAY,EACZ,MAAM,EACN,SAAS,EAAE,gBAAgB,EAC3B,YAAY,EACZ,WAAW,EACX,sBAA8B,GAC/B,EAAE,KAAK,
|
|
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;AA0EjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAQxD,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;CAClC;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,OAAO,EACP,YAAY,EACZ,MAAM,EACN,SAAS,EAAE,gBAAgB,EAC3B,YAAY,EACZ,WAAW,EACX,sBAA8B,GAC/B,EAAE,KAAK,2CA08BP"}
|
|
@@ -20,11 +20,14 @@ interface PublishDeps {
|
|
|
20
20
|
onShasUpdated: (savedSha: string | null, mainSha: string | null) => void;
|
|
21
21
|
onPublishComplete?: () => void;
|
|
22
22
|
getBaseVersion: () => string | null;
|
|
23
|
+
/** Test hook: overrides the per-request payload budget (default 4MB). */
|
|
24
|
+
saveChunkBudget?: number;
|
|
23
25
|
}
|
|
24
26
|
export type PublishAction = "idle" | "saving" | "publishing";
|
|
25
|
-
export declare function useEditorPublish({ flushNow, cancelPendingFlush, isConfigDirty, clearConfigDirty, siteIndexRef, siteConfig, sections, deletedSectionIds, onSuccess, mediaManifest, manifestDirty, clearManifestDirty, pendingMediaItems, pendingMediaDeletions, onMediaPublished, onShasUpdated, onPublishComplete, getBaseVersion, }: PublishDeps): {
|
|
27
|
+
export declare function useEditorPublish({ flushNow, cancelPendingFlush, isConfigDirty, clearConfigDirty, siteIndexRef, siteConfig, sections, deletedSectionIds, onSuccess, mediaManifest, manifestDirty, clearManifestDirty, pendingMediaItems, pendingMediaDeletions, onMediaPublished, onShasUpdated, onPublishComplete, getBaseVersion, saveChunkBudget, }: PublishDeps): {
|
|
26
28
|
publishAction: PublishAction;
|
|
27
29
|
publishFeedback: string | null;
|
|
30
|
+
saveProgress: string | null;
|
|
28
31
|
handleSave: () => Promise<void>;
|
|
29
32
|
handlePublish: () => Promise<void>;
|
|
30
33
|
handleSaveAndPublish: () => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditorPublish.d.ts","sourceRoot":"","sources":["../../src/hooks/useEditorPublish.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"useEditorPublish.d.ts","sourceRoot":"","sources":["../../src/hooks/useEditorPublish.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA6C/D,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,OAAO,CAAC;IAC7B,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACzC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,aAAa,EAAE,aAAa,CAAC;IAC7B,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,iBAAiB,EAAE,SAAS,EAAE,CAAC;IAC/B,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,gBAAgB,EAAE,CAAC,cAAc,EAAE,SAAS,EAAE,EAAE,kBAAkB,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACtF,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzE,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAI/B,cAAc,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACpC,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAQD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAC;AAE7D,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,eAAe,GAChB,EAAE,WAAW;;;;;;;EAoXb"}
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
verifySessionToken
|
|
14
14
|
} from "./chunk-EM5DFHDZ.js";
|
|
15
15
|
import {
|
|
16
|
+
BAKED_MEDIA_KEYS,
|
|
16
17
|
EXT_TO_MIME,
|
|
17
18
|
MIME_TO_EXT,
|
|
18
19
|
ProcessingQueue,
|
|
@@ -23,11 +24,12 @@ import {
|
|
|
23
24
|
getMediaProvider,
|
|
24
25
|
hashFileBuffer,
|
|
25
26
|
mimeToExt,
|
|
27
|
+
rebindImageRef,
|
|
26
28
|
resolveManifestReferences,
|
|
27
29
|
resolveMedia,
|
|
28
30
|
sanitizeMediaName,
|
|
29
31
|
setMediaProvider
|
|
30
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-S55OZ7F2.js";
|
|
31
33
|
import {
|
|
32
34
|
AudienceColorSchema,
|
|
33
35
|
AudienceNameSchema,
|
|
@@ -140,6 +142,7 @@ export {
|
|
|
140
142
|
AudienceColorSchema,
|
|
141
143
|
AudienceNameSchema,
|
|
142
144
|
AudienceSchema,
|
|
145
|
+
BAKED_MEDIA_KEYS,
|
|
143
146
|
ChatbotConfigSchema,
|
|
144
147
|
ChatbotTaskSchema,
|
|
145
148
|
DEFAULT_LINK,
|
|
@@ -210,6 +213,7 @@ export {
|
|
|
210
213
|
mimeToExt,
|
|
211
214
|
navChangeEvent,
|
|
212
215
|
normalizeSiteIndex,
|
|
216
|
+
rebindImageRef,
|
|
213
217
|
registerSchema,
|
|
214
218
|
registerSection,
|
|
215
219
|
requireSessionSecret,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { MediaItem } from "../media/types";
|
|
2
|
+
export interface MediaUploadPayload {
|
|
3
|
+
item: MediaItem;
|
|
4
|
+
blobs: {
|
|
5
|
+
path: string;
|
|
6
|
+
base64: string;
|
|
7
|
+
}[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Serialized-payload budget per /api/save request. Netlify rejects function
|
|
11
|
+
* request bodies over ~6MB at the platform level (before the app runs); 4MB
|
|
12
|
+
* leaves headroom for the JSON envelope plus sections/index/config riding the
|
|
13
|
+
* final chunk.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SAVE_CHUNK_BUDGET_BYTES: number;
|
|
16
|
+
/** Approximate serialized size of one upload: base64 dominates; the fixed
|
|
17
|
+
* allowances cover JSON keys, quoting, and the item's manifest metadata. */
|
|
18
|
+
export declare function uploadSizeBytes(upload: MediaUploadPayload): number;
|
|
19
|
+
export interface PackedUploads {
|
|
20
|
+
chunks: MediaUploadPayload[][];
|
|
21
|
+
oversized: MediaUploadPayload[];
|
|
22
|
+
}
|
|
23
|
+
/** Greedy in-order packing of uploads into budget-sized chunks. An item whose
|
|
24
|
+
* blobs alone exceed the budget can never be sent — it lands in `oversized`
|
|
25
|
+
* for the caller to reject with a per-file error. Items are never split
|
|
26
|
+
* across chunks (the manifest may only reference fully-committed items). */
|
|
27
|
+
export declare function packUploads(uploads: MediaUploadPayload[], budget?: number): PackedUploads;
|
|
28
|
+
//# sourceMappingURL=save-chunks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-chunks.d.ts","sourceRoot":"","sources":["../../src/lib/save-chunks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC3C;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,QAAkB,CAAC;AAEvD;6EAC6E;AAC7E,wBAAgB,eAAe,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAElE;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,kBAAkB,EAAE,EAAE,CAAC;IAC/B,SAAS,EAAE,kBAAkB,EAAE,CAAC;CACjC;AAED;;;6EAG6E;AAC7E,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,MAAM,SAA0B,GAAG,aAAa,CAsB1G"}
|
package/dist/lib/video-url.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
export type InstagramKind = "post" | "reel" | "tv";
|
|
1
2
|
export type ParsedVideoUrl = {
|
|
2
3
|
provider: "youtube" | "vimeo";
|
|
3
4
|
id: string;
|
|
5
|
+
} | {
|
|
6
|
+
provider: "instagram";
|
|
7
|
+
id: string;
|
|
8
|
+
kind: InstagramKind;
|
|
4
9
|
};
|
|
5
10
|
export declare function parseVideoUrl(raw: string): ParsedVideoUrl | null;
|
|
6
|
-
export declare function embedUrl(p:
|
|
11
|
+
export declare function embedUrl(p: {
|
|
12
|
+
provider: "youtube" | "vimeo" | "instagram";
|
|
13
|
+
id: string;
|
|
14
|
+
kind?: InstagramKind;
|
|
15
|
+
}): string;
|
|
7
16
|
//# sourceMappingURL=video-url.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-url.d.ts","sourceRoot":"","sources":["../../src/lib/video-url.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"video-url.d.ts","sourceRoot":"","sources":["../../src/lib/video-url.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AACnD,MAAM,MAAM,cAAc,GACtB;IAAE,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,QAAQ,EAAE,WAAW,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC;AAI/D,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAoChE;AAID,wBAAgB,QAAQ,CAAC,CAAC,EAAE;IAAE,QAAQ,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,aAAa,CAAA;CAAE,GAAG,MAAM,CAIrH"}
|