@orion-studios/payload-studio 0.5.0-beta.113 → 0.5.0-beta.114
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/admin/client.js +1915 -490
- package/dist/admin/client.mjs +1327 -445
- package/dist/admin/index.d.mts +2 -1
- package/dist/admin/index.d.ts +2 -1
- package/dist/admin/index.js +253 -50
- package/dist/admin/index.mjs +1 -1
- package/dist/admin-app/client.d.mts +1 -0
- package/dist/admin-app/client.d.ts +1 -0
- package/dist/admin-app/client.js +266 -105
- package/dist/admin-app/client.mjs +105 -456
- package/dist/admin-app/index.d.mts +2 -1
- package/dist/admin-app/index.d.ts +2 -1
- package/dist/admin-app/styles.css +351 -0
- package/dist/admin.css +9 -0
- package/dist/{chunk-DAIZDGHL.mjs → chunk-4YPHQYRR.mjs} +253 -50
- package/dist/chunk-6NE7GIVT.mjs +555 -0
- package/dist/{chunk-3T2P6SDM.mjs → chunk-XKUTZ7IU.mjs} +215 -6
- package/dist/{index-DUi_XND6.d.ts → index-Crx_MtPw.d.ts} +33 -3
- package/dist/{index-gLl_358v.d.mts → index-Cv-6qnrw.d.mts} +33 -3
- package/dist/index-D5yjivF7.d.ts +382 -0
- package/dist/index-DH9KGEZ8.d.mts +382 -0
- package/dist/{index-BzKOThsI.d.mts → index-DWmudwDm.d.mts} +1 -1
- package/dist/{index-BzKOThsI.d.ts → index-DWmudwDm.d.ts} +1 -1
- package/dist/{index-7lxTrxSG.d.mts → index-c5-qTRbH.d.mts} +7 -1
- package/dist/{index-7lxTrxSG.d.ts → index-yfpxsgUu.d.ts} +7 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +459 -56
- package/dist/index.mjs +9 -9
- package/dist/nextjs/index.mjs +2 -2
- package/dist/sitePreviewTypes-BECnq9xI.d.mts +41 -0
- package/dist/sitePreviewTypes-BECnq9xI.d.ts +41 -0
- package/dist/studio/index.d.mts +1 -1
- package/dist/studio/index.d.ts +1 -1
- package/dist/studio-pages/index.d.mts +3 -3
- package/dist/studio-pages/index.d.ts +3 -3
- package/dist/studio-pages/index.js +330 -7
- package/dist/studio-pages/index.mjs +10 -3
- package/package.json +1 -1
- package/dist/index-B7QvY3yF.d.mts +0 -245
- package/dist/index-BK03FiEM.d.ts +0 -245
- package/dist/{chunk-BET2YLAS.mjs → chunk-OTHERBGX.mjs} +3 -3
|
@@ -8,6 +8,12 @@ import {
|
|
|
8
8
|
migrateBlockToSettingsV2,
|
|
9
9
|
studioDocumentToLayout
|
|
10
10
|
} from "./chunk-PF3EBZXF.mjs";
|
|
11
|
+
import {
|
|
12
|
+
assertStudioDocumentV1,
|
|
13
|
+
compileStudioDocument,
|
|
14
|
+
createEmptyStudioDocument,
|
|
15
|
+
validateStudioDocument
|
|
16
|
+
} from "./chunk-ADIIWIYL.mjs";
|
|
11
17
|
import {
|
|
12
18
|
__export
|
|
13
19
|
} from "./chunk-6BWS3CLP.mjs";
|
|
@@ -16,14 +22,17 @@ import {
|
|
|
16
22
|
var studio_pages_exports = {};
|
|
17
23
|
__export(studio_pages_exports, {
|
|
18
24
|
createDefaultStudioDocument: () => createDefaultStudioDocument,
|
|
25
|
+
createStudioPageService: () => createStudioPageService,
|
|
19
26
|
defaultBuilderThemeTokens: () => defaultBuilderThemeTokens,
|
|
27
|
+
getStudioDocumentFromPage: () => getStudioDocumentFromPage,
|
|
20
28
|
layoutToStudioDocument: () => layoutToStudioDocument,
|
|
21
29
|
pageInspectorPanels: () => pageInspectorPanels,
|
|
22
30
|
pageNodeTypes: () => pageNodeTypes,
|
|
23
31
|
pagePaletteGroups: () => pagePaletteGroups,
|
|
24
32
|
pageStudioModuleManifest: () => pageStudioModuleManifest,
|
|
25
33
|
resolveBuilderThemeTokens: () => resolveBuilderThemeTokens,
|
|
26
|
-
studioDocumentToLayout: () => studioDocumentToLayout
|
|
34
|
+
studioDocumentToLayout: () => studioDocumentToLayout,
|
|
35
|
+
toEditorInitialDoc: () => toEditorInitialDoc
|
|
27
36
|
});
|
|
28
37
|
|
|
29
38
|
// src/studio-pages/builder/settings-v2/themeTokens.ts
|
|
@@ -400,10 +409,207 @@ var inspectorDefinitionByBlockType = {
|
|
|
400
409
|
}
|
|
401
410
|
};
|
|
402
411
|
|
|
403
|
-
// src/studio-pages/
|
|
412
|
+
// src/studio-pages/pageService.ts
|
|
404
413
|
var isRecord2 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
405
|
-
var
|
|
414
|
+
var toRecordArray = (value) => Array.isArray(value) ? value.filter((item) => isRecord2(item)) : [];
|
|
415
|
+
var getRelationID = (value) => {
|
|
416
|
+
if (typeof value === "number" || typeof value === "string") {
|
|
417
|
+
return value;
|
|
418
|
+
}
|
|
406
419
|
if (!isRecord2(value)) {
|
|
420
|
+
return null;
|
|
421
|
+
}
|
|
422
|
+
const id = value.id;
|
|
423
|
+
return typeof id === "number" || typeof id === "string" ? id : null;
|
|
424
|
+
};
|
|
425
|
+
var asLayoutArray = (value) => toRecordArray(value);
|
|
426
|
+
var hydrateRelationship = (valueFromStudio, valueFromLayout) => {
|
|
427
|
+
if (isRecord2(valueFromStudio)) {
|
|
428
|
+
return valueFromStudio;
|
|
429
|
+
}
|
|
430
|
+
if (!isRecord2(valueFromLayout)) {
|
|
431
|
+
return valueFromStudio;
|
|
432
|
+
}
|
|
433
|
+
const studioID = getRelationID(valueFromStudio);
|
|
434
|
+
const layoutID = getRelationID(valueFromLayout);
|
|
435
|
+
if (studioID === null || layoutID === null || String(studioID) !== String(layoutID)) {
|
|
436
|
+
return valueFromStudio;
|
|
437
|
+
}
|
|
438
|
+
return valueFromLayout;
|
|
439
|
+
};
|
|
440
|
+
var hydrateDocumentWithLayoutRelations = (document, layout) => {
|
|
441
|
+
const nextNodes = document.nodes.map((node, index) => {
|
|
442
|
+
const layoutBlock = layout[index];
|
|
443
|
+
if (!isRecord2(layoutBlock)) {
|
|
444
|
+
return node;
|
|
445
|
+
}
|
|
446
|
+
if (typeof layoutBlock.blockType !== "string" || layoutBlock.blockType !== node.type) {
|
|
447
|
+
return node;
|
|
448
|
+
}
|
|
449
|
+
const nextData = { ...node.data };
|
|
450
|
+
if (node.type === "hero") {
|
|
451
|
+
nextData.media = hydrateRelationship(nextData.media, layoutBlock.media);
|
|
452
|
+
}
|
|
453
|
+
if (node.type === "media") {
|
|
454
|
+
nextData.image = hydrateRelationship(nextData.image, layoutBlock.image);
|
|
455
|
+
}
|
|
456
|
+
if (node.type === "featureGrid" || node.type === "logoWall" || node.type === "beforeAfter") {
|
|
457
|
+
const studioItems = Array.isArray(nextData.items) ? nextData.items : [];
|
|
458
|
+
const layoutItems = Array.isArray(layoutBlock.items) ? layoutBlock.items : [];
|
|
459
|
+
nextData.items = studioItems.map((rawStudioItem, itemIndex) => {
|
|
460
|
+
if (!isRecord2(rawStudioItem)) {
|
|
461
|
+
return rawStudioItem;
|
|
462
|
+
}
|
|
463
|
+
const layoutItem = layoutItems[itemIndex];
|
|
464
|
+
if (!isRecord2(layoutItem)) {
|
|
465
|
+
return rawStudioItem;
|
|
466
|
+
}
|
|
467
|
+
const nextItem = { ...rawStudioItem };
|
|
468
|
+
nextItem.media = hydrateRelationship(nextItem.media, layoutItem.media);
|
|
469
|
+
nextItem.beforeMedia = hydrateRelationship(nextItem.beforeMedia, layoutItem.beforeMedia);
|
|
470
|
+
nextItem.afterMedia = hydrateRelationship(nextItem.afterMedia, layoutItem.afterMedia);
|
|
471
|
+
return nextItem;
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
return {
|
|
475
|
+
...node,
|
|
476
|
+
data: nextData
|
|
477
|
+
};
|
|
478
|
+
});
|
|
479
|
+
return {
|
|
480
|
+
...document,
|
|
481
|
+
nodes: nextNodes
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
var normalizeDocument = (document) => ({
|
|
485
|
+
...document,
|
|
486
|
+
schemaVersion: 1,
|
|
487
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
488
|
+
});
|
|
489
|
+
var normalizeLegacyHeroDefaults = (document) => {
|
|
490
|
+
const nodes = document.nodes.map((node) => {
|
|
491
|
+
if (node.type !== "hero" || !isRecord2(node.data)) {
|
|
492
|
+
return node;
|
|
493
|
+
}
|
|
494
|
+
const nextData = { ...node.data };
|
|
495
|
+
const heroBackgroundColor = typeof nextData.backgroundColor === "string" ? nextData.backgroundColor.trim().toLowerCase() : "";
|
|
496
|
+
const sectionBackgroundMode = typeof nextData.sectionBackgroundMode === "string" ? nextData.sectionBackgroundMode : "none";
|
|
497
|
+
const hasBackgroundImageURL = typeof nextData.backgroundImageURL === "string" && nextData.backgroundImageURL.trim().length > 0;
|
|
498
|
+
const mediaRelation = getRelationID(nextData.media);
|
|
499
|
+
if (heroBackgroundColor === "#124a37" && sectionBackgroundMode === "none" && !hasBackgroundImageURL && mediaRelation === null) {
|
|
500
|
+
nextData.backgroundColor = "";
|
|
501
|
+
}
|
|
502
|
+
return {
|
|
503
|
+
...node,
|
|
504
|
+
data: nextData
|
|
505
|
+
};
|
|
506
|
+
});
|
|
507
|
+
return {
|
|
508
|
+
...document,
|
|
509
|
+
nodes
|
|
510
|
+
};
|
|
511
|
+
};
|
|
512
|
+
var assertCanPublish = (issues) => {
|
|
513
|
+
const publishErrors = issues.filter((issue) => issue.severity === "error");
|
|
514
|
+
if (publishErrors.length > 0) {
|
|
515
|
+
throw new Error(`Cannot publish page: ${publishErrors[0].message}`);
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
var getStudioDocumentFromPage = (doc) => {
|
|
519
|
+
const title = typeof doc.title === "string" ? doc.title : void 0;
|
|
520
|
+
const layout = asLayoutArray(doc.layout);
|
|
521
|
+
try {
|
|
522
|
+
const studioDocument = assertStudioDocumentV1(doc.studioDocument);
|
|
523
|
+
if (layout.length > 0) {
|
|
524
|
+
return hydrateDocumentWithLayoutRelations(studioDocument, layout);
|
|
525
|
+
}
|
|
526
|
+
return studioDocument;
|
|
527
|
+
} catch {
|
|
528
|
+
if (layout.length > 0) {
|
|
529
|
+
return layoutToStudioDocument(layout, title);
|
|
530
|
+
}
|
|
531
|
+
return createEmptyStudioDocument(title);
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
var createStudioPageService = ({
|
|
535
|
+
collectionSlug = "pages",
|
|
536
|
+
modules,
|
|
537
|
+
payload,
|
|
538
|
+
user
|
|
539
|
+
}) => ({
|
|
540
|
+
getPageForStudio: async (pageID) => {
|
|
541
|
+
const page = await payload.findByID({
|
|
542
|
+
collection: collectionSlug,
|
|
543
|
+
depth: 2,
|
|
544
|
+
draft: true,
|
|
545
|
+
id: pageID,
|
|
546
|
+
overrideAccess: false,
|
|
547
|
+
user
|
|
548
|
+
});
|
|
549
|
+
const studioDocument = getStudioDocumentFromPage(page);
|
|
550
|
+
return {
|
|
551
|
+
id: String(page.id),
|
|
552
|
+
slug: typeof page.slug === "string" ? page.slug : "",
|
|
553
|
+
studioDocument,
|
|
554
|
+
title: typeof page.title === "string" ? page.title : "Untitled Page"
|
|
555
|
+
};
|
|
556
|
+
},
|
|
557
|
+
validateStudioDocument: (document) => validateStudioDocument(document, modules),
|
|
558
|
+
saveDraft: async (pageID, document, _metadata) => {
|
|
559
|
+
const normalizedDocument = normalizeLegacyHeroDefaults(normalizeDocument(document));
|
|
560
|
+
const compileResult = compileStudioDocument(normalizedDocument, modules);
|
|
561
|
+
await payload.update({
|
|
562
|
+
collection: collectionSlug,
|
|
563
|
+
data: {
|
|
564
|
+
_status: "draft",
|
|
565
|
+
layout: compileResult.layout,
|
|
566
|
+
studioDocument: normalizedDocument,
|
|
567
|
+
studioValidationIssues: compileResult.issues,
|
|
568
|
+
title: normalizedDocument.title
|
|
569
|
+
},
|
|
570
|
+
id: pageID,
|
|
571
|
+
overrideAccess: false,
|
|
572
|
+
user
|
|
573
|
+
});
|
|
574
|
+
return {
|
|
575
|
+
id: pageID,
|
|
576
|
+
status: "draft"
|
|
577
|
+
};
|
|
578
|
+
},
|
|
579
|
+
publish: async (pageID, document, _metadata) => {
|
|
580
|
+
const normalizedDocument = normalizeLegacyHeroDefaults(normalizeDocument(document));
|
|
581
|
+
const compileResult = compileStudioDocument(normalizedDocument, modules);
|
|
582
|
+
assertCanPublish(compileResult.issues);
|
|
583
|
+
await payload.update({
|
|
584
|
+
collection: collectionSlug,
|
|
585
|
+
data: {
|
|
586
|
+
_status: "published",
|
|
587
|
+
layout: compileResult.layout,
|
|
588
|
+
studioDocument: normalizedDocument,
|
|
589
|
+
studioValidationIssues: compileResult.issues,
|
|
590
|
+
title: normalizedDocument.title
|
|
591
|
+
},
|
|
592
|
+
id: pageID,
|
|
593
|
+
overrideAccess: false,
|
|
594
|
+
user
|
|
595
|
+
});
|
|
596
|
+
return {
|
|
597
|
+
id: pageID,
|
|
598
|
+
status: "published"
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
var toEditorInitialDoc = (payloadPage) => ({
|
|
603
|
+
layout: studioDocumentToLayout(payloadPage.studioDocument),
|
|
604
|
+
slug: typeof payloadPage.slug === "string" ? payloadPage.slug : "",
|
|
605
|
+
studioDocument: payloadPage.studioDocument,
|
|
606
|
+
title: payloadPage.title
|
|
607
|
+
});
|
|
608
|
+
|
|
609
|
+
// src/studio-pages/migrations.ts
|
|
610
|
+
var isRecord3 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
611
|
+
var assertPageStudioDocumentV1 = (value) => {
|
|
612
|
+
if (!isRecord3(value)) {
|
|
407
613
|
throw new Error("Studio document must be an object");
|
|
408
614
|
}
|
|
409
615
|
if (value.schemaVersion !== 1) {
|
|
@@ -413,7 +619,7 @@ var assertPageStudioDocumentV1 = (value) => {
|
|
|
413
619
|
throw new Error("Studio document nodes must be an array");
|
|
414
620
|
}
|
|
415
621
|
const nodes = value.nodes.map((node, index) => {
|
|
416
|
-
if (!
|
|
622
|
+
if (!isRecord3(node)) {
|
|
417
623
|
throw new Error(`Node at index ${index} must be an object`);
|
|
418
624
|
}
|
|
419
625
|
if (typeof node.id !== "string" || node.id.length === 0) {
|
|
@@ -422,7 +628,7 @@ var assertPageStudioDocumentV1 = (value) => {
|
|
|
422
628
|
if (typeof node.type !== "string" || node.type.length === 0) {
|
|
423
629
|
throw new Error(`Node at index ${index} has invalid type`);
|
|
424
630
|
}
|
|
425
|
-
if (!
|
|
631
|
+
if (!isRecord3(node.data)) {
|
|
426
632
|
throw new Error(`Node at index ${index} has invalid data`);
|
|
427
633
|
}
|
|
428
634
|
return {
|
|
@@ -432,7 +638,7 @@ var assertPageStudioDocumentV1 = (value) => {
|
|
|
432
638
|
};
|
|
433
639
|
});
|
|
434
640
|
return {
|
|
435
|
-
metadata:
|
|
641
|
+
metadata: isRecord3(value.metadata) ? value.metadata : void 0,
|
|
436
642
|
nodes,
|
|
437
643
|
schemaVersion: 1,
|
|
438
644
|
title: typeof value.title === "string" ? value.title : void 0,
|
|
@@ -755,6 +961,9 @@ var pageStudioModuleManifest = {
|
|
|
755
961
|
|
|
756
962
|
export {
|
|
757
963
|
resolveBuilderThemeTokens,
|
|
964
|
+
getStudioDocumentFromPage,
|
|
965
|
+
createStudioPageService,
|
|
966
|
+
toEditorInitialDoc,
|
|
758
967
|
pageNodeTypes,
|
|
759
968
|
pagePaletteGroups,
|
|
760
969
|
pageInspectorPanels,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { S as StudioDocumentV1, a as
|
|
1
|
+
import { S as StudioDocumentV1, a as StudioModuleManifest, b as StudioPageService, c as StudioNodeTypeDefinition } from './index-DWmudwDm.js';
|
|
2
|
+
import { Payload } from 'payload';
|
|
2
3
|
import { ComponentType, CSSProperties, ReactNode } from 'react';
|
|
3
4
|
|
|
4
5
|
type InspectorGroupKey = 'advanced' | 'basics' | 'media' | 'typography';
|
|
@@ -97,6 +98,32 @@ declare const layoutToStudioDocument: (layout: Array<Record<string, unknown>>, t
|
|
|
97
98
|
declare const studioDocumentToLayout: (document: StudioDocumentV1) => Array<Record<string, unknown>>;
|
|
98
99
|
declare const createDefaultStudioDocument: (title?: string) => StudioDocumentV1;
|
|
99
100
|
|
|
101
|
+
type StudioPagePayloadDoc = {
|
|
102
|
+
id: number | string;
|
|
103
|
+
layout?: unknown;
|
|
104
|
+
slug?: unknown;
|
|
105
|
+
studioDocument?: unknown;
|
|
106
|
+
title?: unknown;
|
|
107
|
+
};
|
|
108
|
+
type CreateStudioPageServiceArgs = {
|
|
109
|
+
collectionSlug?: string;
|
|
110
|
+
modules: StudioModuleManifest[];
|
|
111
|
+
payload: Payload;
|
|
112
|
+
user: Record<string, unknown>;
|
|
113
|
+
};
|
|
114
|
+
declare const getStudioDocumentFromPage: (doc: StudioPagePayloadDoc) => StudioDocumentV1;
|
|
115
|
+
declare const createStudioPageService: ({ collectionSlug, modules, payload, user, }: CreateStudioPageServiceArgs) => StudioPageService;
|
|
116
|
+
declare const toEditorInitialDoc: (payloadPage: {
|
|
117
|
+
slug?: string;
|
|
118
|
+
studioDocument: StudioDocumentV1;
|
|
119
|
+
title: string;
|
|
120
|
+
}) => {
|
|
121
|
+
layout: Record<string, unknown>[];
|
|
122
|
+
slug: string;
|
|
123
|
+
studioDocument: StudioDocumentV1;
|
|
124
|
+
title: string;
|
|
125
|
+
};
|
|
126
|
+
|
|
100
127
|
type BuilderBlock$1 = {
|
|
101
128
|
blockType: string;
|
|
102
129
|
[key: string]: unknown;
|
|
@@ -178,7 +205,9 @@ type index_BuilderThemeTokenOverrides = BuilderThemeTokenOverrides;
|
|
|
178
205
|
type index_BuilderThemeTokens = BuilderThemeTokens;
|
|
179
206
|
type index_SectionPreset = SectionPreset;
|
|
180
207
|
declare const index_createDefaultStudioDocument: typeof createDefaultStudioDocument;
|
|
208
|
+
declare const index_createStudioPageService: typeof createStudioPageService;
|
|
181
209
|
declare const index_defaultBuilderThemeTokens: typeof defaultBuilderThemeTokens;
|
|
210
|
+
declare const index_getStudioDocumentFromPage: typeof getStudioDocumentFromPage;
|
|
182
211
|
declare const index_layoutToStudioDocument: typeof layoutToStudioDocument;
|
|
183
212
|
declare const index_pageInspectorPanels: typeof pageInspectorPanels;
|
|
184
213
|
declare const index_pageNodeTypes: typeof pageNodeTypes;
|
|
@@ -186,8 +215,9 @@ declare const index_pagePaletteGroups: typeof pagePaletteGroups;
|
|
|
186
215
|
declare const index_pageStudioModuleManifest: typeof pageStudioModuleManifest;
|
|
187
216
|
declare const index_resolveBuilderThemeTokens: typeof resolveBuilderThemeTokens;
|
|
188
217
|
declare const index_studioDocumentToLayout: typeof studioDocumentToLayout;
|
|
218
|
+
declare const index_toEditorInitialDoc: typeof toEditorInitialDoc;
|
|
189
219
|
declare namespace index {
|
|
190
|
-
export { type BuilderBlock$1 as BuilderBlock, type index_BuilderBlockPreviewRenderArgs as BuilderBlockPreviewRenderArgs, type index_BuilderBlockPreviewRenderer as BuilderBlockPreviewRenderer, type index_BuilderBlockSettingsV2 as BuilderBlockSettingsV2, type index_BuilderInlineTextComponentProps as BuilderInlineTextComponentProps, type index_BuilderPreviewEditingHelpers as BuilderPreviewEditingHelpers, type index_BuilderPreviewTextFieldOptions as BuilderPreviewTextFieldOptions, type index_BuilderRenderWithSectionShell as BuilderRenderWithSectionShell, type index_BuilderSettingsPanelMode as BuilderSettingsPanelMode, type index_BuilderThemeTokenOverrides as BuilderThemeTokenOverrides, type index_BuilderThemeTokens as BuilderThemeTokens, type index_SectionPreset as SectionPreset, index_createDefaultStudioDocument as createDefaultStudioDocument, index_defaultBuilderThemeTokens as defaultBuilderThemeTokens, index_layoutToStudioDocument as layoutToStudioDocument, index_pageInspectorPanels as pageInspectorPanels, index_pageNodeTypes as pageNodeTypes, index_pagePaletteGroups as pagePaletteGroups, index_pageStudioModuleManifest as pageStudioModuleManifest, index_resolveBuilderThemeTokens as resolveBuilderThemeTokens, index_studioDocumentToLayout as studioDocumentToLayout };
|
|
220
|
+
export { type BuilderBlock$1 as BuilderBlock, type index_BuilderBlockPreviewRenderArgs as BuilderBlockPreviewRenderArgs, type index_BuilderBlockPreviewRenderer as BuilderBlockPreviewRenderer, type index_BuilderBlockSettingsV2 as BuilderBlockSettingsV2, type index_BuilderInlineTextComponentProps as BuilderInlineTextComponentProps, type index_BuilderPreviewEditingHelpers as BuilderPreviewEditingHelpers, type index_BuilderPreviewTextFieldOptions as BuilderPreviewTextFieldOptions, type index_BuilderRenderWithSectionShell as BuilderRenderWithSectionShell, type index_BuilderSettingsPanelMode as BuilderSettingsPanelMode, type index_BuilderThemeTokenOverrides as BuilderThemeTokenOverrides, type index_BuilderThemeTokens as BuilderThemeTokens, type index_SectionPreset as SectionPreset, index_createDefaultStudioDocument as createDefaultStudioDocument, index_createStudioPageService as createStudioPageService, index_defaultBuilderThemeTokens as defaultBuilderThemeTokens, index_getStudioDocumentFromPage as getStudioDocumentFromPage, index_layoutToStudioDocument as layoutToStudioDocument, index_pageInspectorPanels as pageInspectorPanels, index_pageNodeTypes as pageNodeTypes, index_pagePaletteGroups as pagePaletteGroups, index_pageStudioModuleManifest as pageStudioModuleManifest, index_resolveBuilderThemeTokens as resolveBuilderThemeTokens, index_studioDocumentToLayout as studioDocumentToLayout, index_toEditorInitialDoc as toEditorInitialDoc };
|
|
191
221
|
}
|
|
192
222
|
|
|
193
|
-
export { type BuilderBlock$1 as B, type SectionPreset as S, type BuilderBlockPreviewRenderArgs as a, type BuilderBlockPreviewRenderer as b, type BuilderBlockSettingsV2 as c, type BuilderInlineTextComponentProps as d, type BuilderPreviewEditingHelpers as e, type BuilderPreviewTextFieldOptions as f, type BuilderRenderWithSectionShell as g, type BuilderSettingsPanelMode as h, index as i, type BuilderThemeTokenOverrides as j, type BuilderThemeTokens as k, createDefaultStudioDocument as l,
|
|
223
|
+
export { type BuilderBlock$1 as B, type SectionPreset as S, type BuilderBlockPreviewRenderArgs as a, type BuilderBlockPreviewRenderer as b, type BuilderBlockSettingsV2 as c, type BuilderInlineTextComponentProps as d, type BuilderPreviewEditingHelpers as e, type BuilderPreviewTextFieldOptions as f, type BuilderRenderWithSectionShell as g, type BuilderSettingsPanelMode as h, index as i, type BuilderThemeTokenOverrides as j, type BuilderThemeTokens as k, createDefaultStudioDocument as l, createStudioPageService as m, defaultBuilderThemeTokens as n, getStudioDocumentFromPage as o, layoutToStudioDocument as p, pageInspectorPanels as q, pageNodeTypes as r, pagePaletteGroups as s, pageStudioModuleManifest as t, resolveBuilderThemeTokens as u, studioDocumentToLayout as v, toEditorInitialDoc as w };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { S as StudioDocumentV1, a as
|
|
1
|
+
import { S as StudioDocumentV1, a as StudioModuleManifest, b as StudioPageService, c as StudioNodeTypeDefinition } from './index-DWmudwDm.mjs';
|
|
2
|
+
import { Payload } from 'payload';
|
|
2
3
|
import { ComponentType, CSSProperties, ReactNode } from 'react';
|
|
3
4
|
|
|
4
5
|
type InspectorGroupKey = 'advanced' | 'basics' | 'media' | 'typography';
|
|
@@ -97,6 +98,32 @@ declare const layoutToStudioDocument: (layout: Array<Record<string, unknown>>, t
|
|
|
97
98
|
declare const studioDocumentToLayout: (document: StudioDocumentV1) => Array<Record<string, unknown>>;
|
|
98
99
|
declare const createDefaultStudioDocument: (title?: string) => StudioDocumentV1;
|
|
99
100
|
|
|
101
|
+
type StudioPagePayloadDoc = {
|
|
102
|
+
id: number | string;
|
|
103
|
+
layout?: unknown;
|
|
104
|
+
slug?: unknown;
|
|
105
|
+
studioDocument?: unknown;
|
|
106
|
+
title?: unknown;
|
|
107
|
+
};
|
|
108
|
+
type CreateStudioPageServiceArgs = {
|
|
109
|
+
collectionSlug?: string;
|
|
110
|
+
modules: StudioModuleManifest[];
|
|
111
|
+
payload: Payload;
|
|
112
|
+
user: Record<string, unknown>;
|
|
113
|
+
};
|
|
114
|
+
declare const getStudioDocumentFromPage: (doc: StudioPagePayloadDoc) => StudioDocumentV1;
|
|
115
|
+
declare const createStudioPageService: ({ collectionSlug, modules, payload, user, }: CreateStudioPageServiceArgs) => StudioPageService;
|
|
116
|
+
declare const toEditorInitialDoc: (payloadPage: {
|
|
117
|
+
slug?: string;
|
|
118
|
+
studioDocument: StudioDocumentV1;
|
|
119
|
+
title: string;
|
|
120
|
+
}) => {
|
|
121
|
+
layout: Record<string, unknown>[];
|
|
122
|
+
slug: string;
|
|
123
|
+
studioDocument: StudioDocumentV1;
|
|
124
|
+
title: string;
|
|
125
|
+
};
|
|
126
|
+
|
|
100
127
|
type BuilderBlock$1 = {
|
|
101
128
|
blockType: string;
|
|
102
129
|
[key: string]: unknown;
|
|
@@ -178,7 +205,9 @@ type index_BuilderThemeTokenOverrides = BuilderThemeTokenOverrides;
|
|
|
178
205
|
type index_BuilderThemeTokens = BuilderThemeTokens;
|
|
179
206
|
type index_SectionPreset = SectionPreset;
|
|
180
207
|
declare const index_createDefaultStudioDocument: typeof createDefaultStudioDocument;
|
|
208
|
+
declare const index_createStudioPageService: typeof createStudioPageService;
|
|
181
209
|
declare const index_defaultBuilderThemeTokens: typeof defaultBuilderThemeTokens;
|
|
210
|
+
declare const index_getStudioDocumentFromPage: typeof getStudioDocumentFromPage;
|
|
182
211
|
declare const index_layoutToStudioDocument: typeof layoutToStudioDocument;
|
|
183
212
|
declare const index_pageInspectorPanels: typeof pageInspectorPanels;
|
|
184
213
|
declare const index_pageNodeTypes: typeof pageNodeTypes;
|
|
@@ -186,8 +215,9 @@ declare const index_pagePaletteGroups: typeof pagePaletteGroups;
|
|
|
186
215
|
declare const index_pageStudioModuleManifest: typeof pageStudioModuleManifest;
|
|
187
216
|
declare const index_resolveBuilderThemeTokens: typeof resolveBuilderThemeTokens;
|
|
188
217
|
declare const index_studioDocumentToLayout: typeof studioDocumentToLayout;
|
|
218
|
+
declare const index_toEditorInitialDoc: typeof toEditorInitialDoc;
|
|
189
219
|
declare namespace index {
|
|
190
|
-
export { type BuilderBlock$1 as BuilderBlock, type index_BuilderBlockPreviewRenderArgs as BuilderBlockPreviewRenderArgs, type index_BuilderBlockPreviewRenderer as BuilderBlockPreviewRenderer, type index_BuilderBlockSettingsV2 as BuilderBlockSettingsV2, type index_BuilderInlineTextComponentProps as BuilderInlineTextComponentProps, type index_BuilderPreviewEditingHelpers as BuilderPreviewEditingHelpers, type index_BuilderPreviewTextFieldOptions as BuilderPreviewTextFieldOptions, type index_BuilderRenderWithSectionShell as BuilderRenderWithSectionShell, type index_BuilderSettingsPanelMode as BuilderSettingsPanelMode, type index_BuilderThemeTokenOverrides as BuilderThemeTokenOverrides, type index_BuilderThemeTokens as BuilderThemeTokens, type index_SectionPreset as SectionPreset, index_createDefaultStudioDocument as createDefaultStudioDocument, index_defaultBuilderThemeTokens as defaultBuilderThemeTokens, index_layoutToStudioDocument as layoutToStudioDocument, index_pageInspectorPanels as pageInspectorPanels, index_pageNodeTypes as pageNodeTypes, index_pagePaletteGroups as pagePaletteGroups, index_pageStudioModuleManifest as pageStudioModuleManifest, index_resolveBuilderThemeTokens as resolveBuilderThemeTokens, index_studioDocumentToLayout as studioDocumentToLayout };
|
|
220
|
+
export { type BuilderBlock$1 as BuilderBlock, type index_BuilderBlockPreviewRenderArgs as BuilderBlockPreviewRenderArgs, type index_BuilderBlockPreviewRenderer as BuilderBlockPreviewRenderer, type index_BuilderBlockSettingsV2 as BuilderBlockSettingsV2, type index_BuilderInlineTextComponentProps as BuilderInlineTextComponentProps, type index_BuilderPreviewEditingHelpers as BuilderPreviewEditingHelpers, type index_BuilderPreviewTextFieldOptions as BuilderPreviewTextFieldOptions, type index_BuilderRenderWithSectionShell as BuilderRenderWithSectionShell, type index_BuilderSettingsPanelMode as BuilderSettingsPanelMode, type index_BuilderThemeTokenOverrides as BuilderThemeTokenOverrides, type index_BuilderThemeTokens as BuilderThemeTokens, type index_SectionPreset as SectionPreset, index_createDefaultStudioDocument as createDefaultStudioDocument, index_createStudioPageService as createStudioPageService, index_defaultBuilderThemeTokens as defaultBuilderThemeTokens, index_getStudioDocumentFromPage as getStudioDocumentFromPage, index_layoutToStudioDocument as layoutToStudioDocument, index_pageInspectorPanels as pageInspectorPanels, index_pageNodeTypes as pageNodeTypes, index_pagePaletteGroups as pagePaletteGroups, index_pageStudioModuleManifest as pageStudioModuleManifest, index_resolveBuilderThemeTokens as resolveBuilderThemeTokens, index_studioDocumentToLayout as studioDocumentToLayout, index_toEditorInitialDoc as toEditorInitialDoc };
|
|
191
221
|
}
|
|
192
222
|
|
|
193
|
-
export { type BuilderBlock$1 as B, type SectionPreset as S, type BuilderBlockPreviewRenderArgs as a, type BuilderBlockPreviewRenderer as b, type BuilderBlockSettingsV2 as c, type BuilderInlineTextComponentProps as d, type BuilderPreviewEditingHelpers as e, type BuilderPreviewTextFieldOptions as f, type BuilderRenderWithSectionShell as g, type BuilderSettingsPanelMode as h, index as i, type BuilderThemeTokenOverrides as j, type BuilderThemeTokens as k, createDefaultStudioDocument as l,
|
|
223
|
+
export { type BuilderBlock$1 as B, type SectionPreset as S, type BuilderBlockPreviewRenderArgs as a, type BuilderBlockPreviewRenderer as b, type BuilderBlockSettingsV2 as c, type BuilderInlineTextComponentProps as d, type BuilderPreviewEditingHelpers as e, type BuilderPreviewTextFieldOptions as f, type BuilderRenderWithSectionShell as g, type BuilderSettingsPanelMode as h, index as i, type BuilderThemeTokenOverrides as j, type BuilderThemeTokens as k, createDefaultStudioDocument as l, createStudioPageService as m, defaultBuilderThemeTokens as n, getStudioDocumentFromPage as o, layoutToStudioDocument as p, pageInspectorPanels as q, pageNodeTypes as r, pagePaletteGroups as s, pageStudioModuleManifest as t, resolveBuilderThemeTokens as u, studioDocumentToLayout as v, toEditorInitialDoc as w };
|