@alpaca-editor/core 1.0.3903 → 1.0.3905
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/components/ui/CardConnector.d.ts +2 -1
- package/dist/components/ui/CardConnector.js +3 -3
- package/dist/components/ui/CardConnector.js.map +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/card.d.ts +7 -1
- package/dist/components/ui/card.js +71 -3
- package/dist/components/ui/card.js.map +1 -1
- package/dist/config/config.js +4 -2
- package/dist/config/config.js.map +1 -1
- package/dist/config/types.d.ts +1 -0
- package/dist/editor/MobileLayout.js +1 -1
- package/dist/editor/MobileLayout.js.map +1 -1
- package/dist/editor/PictureEditor.js +13 -5
- package/dist/editor/PictureEditor.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +14 -1
- package/dist/editor/client/editContext.js.map +1 -1
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +4 -1
- package/dist/editor/page-editor-chrome/CommentHighlighting.js.map +1 -1
- package/dist/editor/ui/Splitter.js +3 -1
- package/dist/editor/ui/Splitter.js.map +1 -1
- package/dist/page-wizard/WizardBoxConnector.d.ts +2 -1
- package/dist/page-wizard/WizardBoxConnector.js +3 -3
- package/dist/page-wizard/WizardBoxConnector.js.map +1 -1
- package/dist/page-wizard/WizardSteps.js +62 -16
- package/dist/page-wizard/WizardSteps.js.map +1 -1
- package/dist/page-wizard/service.d.ts +1 -1
- package/dist/page-wizard/service.js +1 -1
- package/dist/page-wizard/service.js.map +1 -1
- package/dist/page-wizard/steps/CollectStep.js +11 -17
- package/dist/page-wizard/steps/CollectStep.js.map +1 -1
- package/dist/page-wizard/steps/ComponentTypesSelector.d.ts +1 -0
- package/dist/page-wizard/steps/ComponentTypesSelector.js +53 -78
- package/dist/page-wizard/steps/ComponentTypesSelector.js.map +1 -1
- package/dist/page-wizard/steps/ContentStep.d.ts +2 -0
- package/dist/page-wizard/steps/ContentStep.js +403 -0
- package/dist/page-wizard/steps/ContentStep.js.map +1 -0
- package/dist/page-wizard/steps/Generate.js +1 -1
- package/dist/page-wizard/steps/Generate.js.map +1 -1
- package/dist/page-wizard/steps/ImagesStep.js +16 -13
- package/dist/page-wizard/steps/ImagesStep.js.map +1 -1
- package/dist/page-wizard/steps/SelectStep.js +1 -1
- package/dist/page-wizard/steps/SelectStep.js.map +1 -1
- package/dist/page-wizard/steps/SetupPageStep.d.ts +2 -0
- package/dist/page-wizard/steps/SetupPageStep.js +152 -0
- package/dist/page-wizard/steps/SetupPageStep.js.map +1 -0
- package/dist/page-wizard/steps/usePageCreator.js +4 -4
- package/dist/page-wizard/steps/usePageCreator.js.map +1 -1
- package/dist/page-wizard/usePageWizard.d.ts +17 -3
- package/dist/page-wizard/usePageWizard.js +62 -2
- package/dist/page-wizard/usePageWizard.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/splash-screen/NewPage.js +10 -10
- package/dist/splash-screen/NewPage.js.map +1 -1
- package/dist/splash-screen/SplashScreen.js +3 -3
- package/dist/splash-screen/SplashScreen.js.map +1 -1
- package/dist/styles.css +182 -63
- package/package.json +1 -1
- package/src/components/ui/CardConnector.tsx +50 -15
- package/src/components/ui/button.tsx +1 -1
- package/src/components/ui/card.tsx +331 -15
- package/src/config/config.tsx +4 -2
- package/src/config/types.ts +3 -0
- package/src/editor/MobileLayout.tsx +7 -9
- package/src/editor/PictureEditor.tsx +16 -10
- package/src/editor/client/editContext.ts +23 -1
- package/src/editor/page-editor-chrome/CommentHighlighting.tsx +6 -1
- package/src/editor/ui/Splitter.tsx +10 -1
- package/src/page-wizard/WizardBoxConnector.tsx +50 -15
- package/src/page-wizard/WizardSteps.tsx +161 -32
- package/src/page-wizard/service.ts +2 -2
- package/src/page-wizard/steps/CollectStep.tsx +95 -141
- package/src/page-wizard/steps/ComponentTypesSelector.tsx +225 -245
- package/src/page-wizard/steps/ContentStep.tsx +648 -0
- package/src/page-wizard/steps/Generate.tsx +3 -3
- package/src/page-wizard/steps/ImagesStep.tsx +20 -15
- package/src/page-wizard/steps/SelectStep.tsx +4 -4
- package/src/page-wizard/steps/SetupPageStep.tsx +329 -0
- package/src/page-wizard/steps/usePageCreator.ts +4 -4
- package/src/page-wizard/usePageWizard.ts +69 -4
- package/src/revision.ts +2 -2
- package/src/splash-screen/NewPage.tsx +22 -16
- package/src/splash-screen/SplashScreen.tsx +3 -1
- package/dist/page-wizard/steps/CreatePage.d.ts +0 -12
- package/dist/page-wizard/steps/CreatePage.js +0 -149
- package/dist/page-wizard/steps/CreatePage.js.map +0 -1
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.d.ts +0 -2
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.js +0 -236
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.js.map +0 -1
- package/src/page-wizard/steps/CreatePage.tsx +0 -329
- package/src/page-wizard/steps/CreatePageAndLayoutStep.tsx +0 -430
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { ActionButton } from "../../components/ActionButton";
|
|
4
|
-
import { useDebouncedCallback } from "use-debounce";
|
|
5
|
-
import { getChildren } from "../../editor/services/contentService";
|
|
6
|
-
import { executePrompt } from "../../editor/services/aiService";
|
|
7
|
-
import { createWizardAiContext } from "../service";
|
|
8
|
-
import { useEditContext } from "../../editor/client/editContext";
|
|
9
|
-
import { LanguageSelector } from "../../editor/menubar/LanguageSelector";
|
|
10
|
-
import { InputText } from "primereact/inputtext";
|
|
11
|
-
import { InputTextarea } from "primereact/inputtextarea";
|
|
12
|
-
import { getItemDescriptor } from "../../editor/utils";
|
|
13
|
-
import { WizardBox } from "../WizardBox";
|
|
14
|
-
import { WizardBoxConnector } from "../WizardBoxConnector";
|
|
15
|
-
import { Settings, FileText } from "lucide-react";
|
|
16
|
-
export function CreatePage({ wizard, parentItem, setPageItem, pageItem, pageModel, setPageModel, step, data, }) {
|
|
17
|
-
const [validationMessage, setValidationMessage] = useState();
|
|
18
|
-
const [isBuilding, setIsBuilding] = useState(false);
|
|
19
|
-
const [isGenerating, setIsGenerating] = useState(false);
|
|
20
|
-
const [language, setLanguage] = useState(parentItem.language || "en");
|
|
21
|
-
const [previousLanguage, setPreviousLanguage] = useState(language);
|
|
22
|
-
const [fullParentItem, setFullParentItem] = useState();
|
|
23
|
-
const editContext = useEditContext();
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (!editContext)
|
|
26
|
-
return;
|
|
27
|
-
if (editContext.mode !== "edit") {
|
|
28
|
-
editContext.setMode("edit");
|
|
29
|
-
}
|
|
30
|
-
const generateNameAndMetaDescription = async () => {
|
|
31
|
-
const metaInstructions = step["Instructions for generating item name and meta fields"];
|
|
32
|
-
setIsGenerating(true);
|
|
33
|
-
try {
|
|
34
|
-
const abortController = new AbortController();
|
|
35
|
-
const result = await executePrompt([
|
|
36
|
-
{
|
|
37
|
-
content: `${metaInstructions?.trim()} Reply with a json object of type PageModel = { name: string; metaDescription: string; metaKeywords: string; };
|
|
38
|
-
The item name should be a valid sitecore item name. Spaces are allowed but no special characters or Umlaute.
|
|
39
|
-
The language of the page is ${language}.
|
|
40
|
-
Input data: ${JSON.stringify(data)}`,
|
|
41
|
-
name: "system",
|
|
42
|
-
role: "system",
|
|
43
|
-
},
|
|
44
|
-
], editContext, createWizardAiContext, {}, { signal: abortController.signal }, "o3-mini-low", (response) => {
|
|
45
|
-
try {
|
|
46
|
-
const newLayout = JSON.parse(response.content);
|
|
47
|
-
setPageModel({
|
|
48
|
-
...pageModel,
|
|
49
|
-
name: newLayout.name,
|
|
50
|
-
metaDescription: newLayout.metaDescription,
|
|
51
|
-
metaKeywords: newLayout.metaKeywords,
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
catch (parseError) { }
|
|
55
|
-
});
|
|
56
|
-
const pageModel = JSON.parse(result.content);
|
|
57
|
-
setPageModel({
|
|
58
|
-
...pageModel,
|
|
59
|
-
name: pageModel.name,
|
|
60
|
-
metaDescription: pageModel.metaDescription,
|
|
61
|
-
metaKeywords: pageModel.metaKeywords,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
catch (error) {
|
|
65
|
-
console.error("Error generating name and meta description", error);
|
|
66
|
-
}
|
|
67
|
-
finally {
|
|
68
|
-
setIsGenerating(false);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
if (!pageModel.name || language !== previousLanguage) {
|
|
72
|
-
generateNameAndMetaDescription();
|
|
73
|
-
setPreviousLanguage(language);
|
|
74
|
-
}
|
|
75
|
-
}, [language, pageModel.name, previousLanguage, data, step, editContext]);
|
|
76
|
-
useEffect(() => {
|
|
77
|
-
const loadParentItem = async () => {
|
|
78
|
-
if (!parentItem)
|
|
79
|
-
return;
|
|
80
|
-
const item = await editContext?.itemsRepository.getItem(parentItem);
|
|
81
|
-
setFullParentItem(item);
|
|
82
|
-
};
|
|
83
|
-
loadParentItem();
|
|
84
|
-
}, [parentItem]);
|
|
85
|
-
const checkName = async () => {
|
|
86
|
-
if (!parentItem)
|
|
87
|
-
return;
|
|
88
|
-
let valid = !!wizard.templateId && pageModel.name.trim().length >= 3;
|
|
89
|
-
if (valid) {
|
|
90
|
-
const children = await getChildren(parentItem.id, editContext?.sessionId ?? "", [], false, editContext?.contentEditorItem?.language || "en");
|
|
91
|
-
if (children.find((x) => x.name.toLocaleLowerCase() ===
|
|
92
|
-
pageModel.name.trim().toLocaleLowerCase())) {
|
|
93
|
-
valid = false;
|
|
94
|
-
setValidationMessage("A page with this name already exists.");
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
if (pageModel.name.trim().length > 0 && pageModel.name.trim().length < 3)
|
|
99
|
-
setValidationMessage("Name is too short.");
|
|
100
|
-
else
|
|
101
|
-
setValidationMessage(undefined);
|
|
102
|
-
}
|
|
103
|
-
if (valid)
|
|
104
|
-
setValidationMessage(undefined);
|
|
105
|
-
return valid;
|
|
106
|
-
};
|
|
107
|
-
const checkNameValidDebounced = useDebouncedCallback(async () => checkName(), 500);
|
|
108
|
-
useEffect(() => {
|
|
109
|
-
checkNameValidDebounced();
|
|
110
|
-
}, [pageModel.name]);
|
|
111
|
-
const createPage = () => {
|
|
112
|
-
setTimeout(async () => {
|
|
113
|
-
if (!editContext || !parentItem)
|
|
114
|
-
return;
|
|
115
|
-
try {
|
|
116
|
-
if (!(await checkName()))
|
|
117
|
-
return;
|
|
118
|
-
setIsBuilding(true);
|
|
119
|
-
const result = await editContext.operations.createItem({ ...getItemDescriptor(parentItem), language }, wizard.templateId, pageModel.name);
|
|
120
|
-
if (result) {
|
|
121
|
-
editContext?.loadItem(result, { addToBrowseHistory: true });
|
|
122
|
-
const item = await editContext?.itemsRepository.getItem(result);
|
|
123
|
-
if (item)
|
|
124
|
-
setPageItem(item);
|
|
125
|
-
else
|
|
126
|
-
console.error("Failed to load newly created item", result);
|
|
127
|
-
console.log("Page created", result, "Page model", pageModel);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
catch (error) {
|
|
131
|
-
console.error("Error creating page", error);
|
|
132
|
-
}
|
|
133
|
-
finally {
|
|
134
|
-
setIsBuilding(false);
|
|
135
|
-
}
|
|
136
|
-
}, 1);
|
|
137
|
-
};
|
|
138
|
-
const handleInputChange = (field, value) => {
|
|
139
|
-
const updatedPageModel = {
|
|
140
|
-
...pageModel,
|
|
141
|
-
[field]: value,
|
|
142
|
-
};
|
|
143
|
-
setPageModel(updatedPageModel);
|
|
144
|
-
};
|
|
145
|
-
return (_jsxs("div", { className: "flex h-full", children: [_jsx(WizardBox, { title: "Page Setup", icon: _jsx(Settings, {}), description: "Configure the target location and language for your new page", className: "w-96", children: _jsx("div", { className: "flex h-full flex-col items-stretch", children: _jsx("div", { className: "relative flex-1", children: _jsxs("div", { className: "absolute inset-0 overflow-y-auto pr-6", children: [_jsxs("div", { className: "mb-4", children: [_jsx("div", { className: "mb-1 text-sm font-medium", children: "Target Parent Item" }), _jsx("div", { className: "mb-4 break-after-all text-xs", children: fullParentItem?.path })] }), _jsxs("div", { className: "relative mb-4", children: [_jsx("label", { htmlFor: "language", className: "mb-1 block text-sm font-medium", children: "Language" }), _jsx("div", { className: "w-fit", children: _jsx(LanguageSelector, { selectedLanguage: language, darkMode: true, disabled: isBuilding || isGenerating, onLanguageSelected: (language) => setLanguage(language.languageCode), showAllLanguages: true }) })] })] }) }) }) }), _jsx(WizardBoxConnector, { className: "mt-6" }), _jsx(WizardBox, { title: "Page Details", icon: _jsx(FileText, {}), description: "Define the page name and meta information for SEO optimization", className: "flex-1", children: _jsxs("div", { className: "flex h-full flex-col items-stretch", children: [_jsx("div", { className: "relative flex-1", children: _jsxs("div", { className: "absolute inset-0 overflow-y-auto pr-6", children: [_jsxs("div", { className: "mb-4", children: [_jsx("label", { htmlFor: "pageName", className: "mb-1 block text-sm font-medium", children: "Page Name" }), _jsx(InputText, { id: "pageName", type: "text", disabled: !!pageItem || isBuilding || isGenerating, className: "w-full rounded border p-2 text-sm", value: pageModel.name, onChange: (e) => handleInputChange("name", e.target.value), placeholder: "Enter page name" }), validationMessage && (_jsx("div", { className: "mt-2 text-sm text-red-500", children: validationMessage }))] }), _jsxs("div", { className: "mb-4", children: [_jsx("label", { htmlFor: "metaDescription", className: "mb-1 block text-sm font-medium", children: "Meta Description" }), _jsx(InputTextarea, { id: "metaDescription", disabled: !!pageItem || isBuilding || isGenerating, className: "min-h-[100px] w-full rounded border p-2 text-sm", value: pageModel.metaDescription, onChange: (e) => handleInputChange("metaDescription", e.target.value), placeholder: "Enter meta description" })] }), _jsxs("div", { className: "mb-4", children: [_jsx("label", { htmlFor: "metaKeywords", className: "mb-1 block text-sm font-medium", children: "Meta Keywords" }), _jsx(InputTextarea, { id: "metaKeywords", disabled: !!pageItem || isBuilding || isGenerating, className: "min-h-[100px] w-full rounded border p-2 text-sm", value: pageModel.metaKeywords, onChange: (e) => handleInputChange("metaKeywords", e.target.value), placeholder: "Enter meta keywords" })] })] }) }), !pageItem && (_jsx("div", { className: "py-2", children: _jsx(ActionButton, { disabled: isBuilding || isGenerating || !!validationMessage, className: "w-full", onClick: () => {
|
|
146
|
-
createPage();
|
|
147
|
-
}, isLoading: isBuilding || isGenerating, loadingText: isGenerating ? "Generating..." : "Create Page", children: "Create Page" }) }))] }) })] }));
|
|
148
|
-
}
|
|
149
|
-
//# sourceMappingURL=CreatePage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreatePage.js","sourceRoot":"","sources":["../../../src/page-wizard/steps/CreatePage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,UAAU,UAAU,CAAC,EACzB,MAAM,EACN,UAAU,EACV,WAAW,EACX,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AC,aAAa,IACZ,EAAE,EAAC,cAAc,EACjB,QAAQ,EAAE,CAAC,CAAC,QAAQ,IAAI,UAAU,IAAI,YAAY,EAClD,SAAS,EAAC,iDAAiD,EAC3D,KAAK,EAAE,SAAS,CAAC,YAAY,EAC7B,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACd,iBAAiB,CAAC,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAEnD,WAAW,EAAC,qBAAqB,GACjC,IACE,IACF,GACF,EACL,CAAC,QAAQ,IAAI,CACZ,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,YAAY,IACX,QAAQ,EAAE,UAAU,IAAI,YAAY,IAAI,CAAC,CAAC,iBAAiB,EAC3D,SAAS,EAAC,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE;oCACZ,UAAU,EAAE,CAAC;gCACf,CAAC,EACD,SAAS,EAAE,UAAU,IAAI,YAAY,EACrC,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,4BAG9C,GACX,CACP,IACG,GACI,IACR,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { StepComponentProps } from "../../config/types";
|
|
2
|
-
export declare function CreatePageAndLayoutStep({ wizard, step, parentItem, pageModel, setPageModel, data, setData, internalState, setInternalState, setStepCompleted, }: StepComponentProps): import("react/jsx-runtime").JSX.Element | "No parent item";
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CreatePage } from "./CreatePage";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
-
import { PageViewer } from "../../editor/page-viewer/PageViewer";
|
|
5
|
-
import { useEditContext, useModifiedFieldsContext, } from "../../editor/client/editContext";
|
|
6
|
-
import { ComponentTypeSelector } from "./ComponentTypesSelector";
|
|
7
|
-
import { ActionButton } from "../../components/ActionButton";
|
|
8
|
-
import { convertPageSchemaToWizardComponents } from "./schema";
|
|
9
|
-
import { createWizardAiContext, wipeComponents } from "../service";
|
|
10
|
-
import { executePrompt } from "../../editor/services/aiService";
|
|
11
|
-
import { usePageCreator } from "./usePageCreator";
|
|
12
|
-
import { useThrottledCallback } from "use-debounce";
|
|
13
|
-
import { InputTextarea } from "primereact/inputtextarea";
|
|
14
|
-
import { convertToAiPageModel } from "../../editor/ai/aiPageModel";
|
|
15
|
-
import { WizardBox } from "../WizardBox";
|
|
16
|
-
import { Layers, PanelsTopLeft } from "lucide-react";
|
|
17
|
-
import { cn } from "../../lib/utils";
|
|
18
|
-
import { WizardBoxConnector } from "../WizardBoxConnector";
|
|
19
|
-
export function CreatePageAndLayoutStep({ wizard, step, parentItem, pageModel, setPageModel, data, setData, internalState, setInternalState, setStepCompleted, }) {
|
|
20
|
-
const [pageLoaded, setPageLoaded] = useState(false);
|
|
21
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
22
|
-
const editContext = useEditContext();
|
|
23
|
-
const [abortController, setAbortController] = useState();
|
|
24
|
-
const [message, setMessage] = useState();
|
|
25
|
-
const [isCreatingComponents, setIsCreatingComponents] = useState(false);
|
|
26
|
-
const pageItem = internalState.pageItem;
|
|
27
|
-
const modifiedFieldsContext = useModifiedFieldsContext();
|
|
28
|
-
const pageCreator = usePageCreator(pageItem, wizard, setPageModel);
|
|
29
|
-
if (!parentItem)
|
|
30
|
-
return "No parent item";
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
editContext?.setMode("edit");
|
|
33
|
-
if (!internalState.layoutInstructions) {
|
|
34
|
-
setInternalState({
|
|
35
|
-
...internalState,
|
|
36
|
-
layoutInstructions: step.instructions,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}, []);
|
|
40
|
-
const createComponents = async () => {
|
|
41
|
-
if (!pageLoaded)
|
|
42
|
-
return;
|
|
43
|
-
if (pageModel?.components && !isCreatingComponents) {
|
|
44
|
-
try {
|
|
45
|
-
setIsCreatingComponents(true);
|
|
46
|
-
await pageCreator.createComponentsRecursively(pageModel.components, "root");
|
|
47
|
-
setInternalState((prev) => ({
|
|
48
|
-
...prev,
|
|
49
|
-
componentsCreated: true,
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
|
-
finally {
|
|
53
|
-
setIsCreatingComponents(false);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
if (internalState.componentsCreated &&
|
|
59
|
-
!isCreatingComponents &&
|
|
60
|
-
!isLoading) {
|
|
61
|
-
editContext?.requestRefresh("immediate");
|
|
62
|
-
}
|
|
63
|
-
}, [isCreatingComponents, isLoading]);
|
|
64
|
-
const createComponentsThrottled = useThrottledCallback(createComponents, 300);
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
createComponentsThrottled();
|
|
67
|
-
}, [pageModel]);
|
|
68
|
-
useEffect(() => {
|
|
69
|
-
if (editContext &&
|
|
70
|
-
editContext.page &&
|
|
71
|
-
editContext.page.item &&
|
|
72
|
-
pageItem &&
|
|
73
|
-
pageItem.id === editContext.page.item.descriptor.id)
|
|
74
|
-
setPageLoaded(true);
|
|
75
|
-
}, [editContext?.page, pageItem]);
|
|
76
|
-
if (!pageItem) {
|
|
77
|
-
return (_jsx(CreatePage, { wizard: wizard, parentItem: parentItem, setPageItem: (pageItem) => setInternalState((prev) => ({ ...prev, pageItem })), pageItem: pageItem, pageModel: pageModel, setPageModel: setPageModel, step: step, data: data }));
|
|
78
|
-
}
|
|
79
|
-
const createLayout = async () => {
|
|
80
|
-
try {
|
|
81
|
-
if (!editContext)
|
|
82
|
-
return;
|
|
83
|
-
setMessage("");
|
|
84
|
-
setIsLoading(true);
|
|
85
|
-
setStepCompleted(false);
|
|
86
|
-
if (internalState.componentsCreated) {
|
|
87
|
-
editContext?.itemsRepository.clear();
|
|
88
|
-
modifiedFieldsContext?.clear();
|
|
89
|
-
await wipeComponents(pageItem.descriptor);
|
|
90
|
-
setPageModel((prev) => ({
|
|
91
|
-
...prev,
|
|
92
|
-
components: [],
|
|
93
|
-
message: "",
|
|
94
|
-
}));
|
|
95
|
-
editContext?.requestRefresh("immediate");
|
|
96
|
-
}
|
|
97
|
-
// Parse schema if it's a string
|
|
98
|
-
const schema = typeof wizard.schema === "string"
|
|
99
|
-
? JSON.parse(wizard.schema)
|
|
100
|
-
: wizard.schema;
|
|
101
|
-
// Filter the schema based on selected component types and placeholders
|
|
102
|
-
const filteredSchema = convertPageSchemaToWizardComponents(schema, data.selectedComponentTypes);
|
|
103
|
-
const localAbortController = new AbortController();
|
|
104
|
-
setAbortController(localAbortController);
|
|
105
|
-
// Get the existing page model
|
|
106
|
-
const existingPageModel = await convertToAiPageModel(editContext.page, editContext);
|
|
107
|
-
const result = await executePrompt([
|
|
108
|
-
{
|
|
109
|
-
content: `${internalState.layoutInstructions?.trim()} Reply with a json object of type PageModel = { components: Component[]; message: string; };
|
|
110
|
-
Component = { id: string | undefined, name: string, type: string; fields: Field[]; placeholder?: string; children?: Component[]; };
|
|
111
|
-
Field = { name: string; value: string; type: string; };
|
|
112
|
-
Generate a descriptive name for each component including the topic.
|
|
113
|
-
Only use component types that are in the page schema.
|
|
114
|
-
Keep existing components with their ids. Leave id field empty for new components.
|
|
115
|
-
Existing page model: ${JSON.stringify(existingPageModel)}
|
|
116
|
-
Fill empty fields of existing components before you insert new components.
|
|
117
|
-
Component types: ${JSON.stringify(filteredSchema)} Root level component types ${filteredSchema
|
|
118
|
-
.filter((c) => c.allowedOnRoot)
|
|
119
|
-
.map((c) => c.type)
|
|
120
|
-
.join(", ")}
|
|
121
|
-
Tell the user your reasoning in the message field.
|
|
122
|
-
If the user provided image ids, fill them into picture / image fields with an "id:" prefix. The image id needs to be guid.
|
|
123
|
-
If you dont have a matching image id, provide a description of a picture that you would like to use with a "generate:" prefix instead.
|
|
124
|
-
The language of the page is ${pageItem.descriptor.language}.
|
|
125
|
-
Input data: ${JSON.stringify(data)}`,
|
|
126
|
-
name: "system",
|
|
127
|
-
role: "system",
|
|
128
|
-
},
|
|
129
|
-
], //Fill image ids into picture / image fields.
|
|
130
|
-
editContext, createWizardAiContext, { allowedFunctions: [] }, { signal: localAbortController.signal }, step.aiModel || "o3-mini-low", (response) => {
|
|
131
|
-
try {
|
|
132
|
-
const newLayout = JSON.parse(response.content);
|
|
133
|
-
if (newLayout) {
|
|
134
|
-
setPageModel((prev) => mergeLayout(prev, newLayout));
|
|
135
|
-
}
|
|
136
|
-
setMessage(newLayout.message);
|
|
137
|
-
}
|
|
138
|
-
catch (parseError) { }
|
|
139
|
-
});
|
|
140
|
-
const pageModel = result;
|
|
141
|
-
console.log("RESULT MODEL: ", pageModel);
|
|
142
|
-
setPageModel((prev) => mergeLayout(prev, pageModel));
|
|
143
|
-
//setMessage(pageModel.message);
|
|
144
|
-
setStepCompleted(true);
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
console.error(error);
|
|
148
|
-
}
|
|
149
|
-
finally {
|
|
150
|
-
setIsLoading(false);
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
// Custom instructions panel
|
|
154
|
-
const customInstructionsPanel = () => {
|
|
155
|
-
return (_jsxs("div", { className: "mb-4", children: [_jsx("h3", { className: "text-sm font-semibold", children: "Instructions" }), _jsx("div", { className: "mb-3 text-xs text-gray-500", children: "Provide guidance for the AI when generating your layout" }), _jsx(InputTextarea, { value: internalState.layoutInstructions, onChange: (e) => setInternalState({
|
|
156
|
-
...internalState,
|
|
157
|
-
layoutInstructions: e.target.value,
|
|
158
|
-
}), placeholder: "Example: Make it modern and minimalist. Focus on images. Include a hero section at the top.", className: "h-48 w-full rounded border border-gray-300 px-3 py-2 text-sm focus:ring-1 focus:ring-blue-500 focus:outline-none" })] }));
|
|
159
|
-
};
|
|
160
|
-
return (_jsxs("div", { className: "flex h-full", children: [_jsx(WizardBox, { title: "Generate content", icon: _jsx(Layers, {}), description: "Generate content for the page", className: "w-96", children: _jsxs("div", { className: "flex h-full flex-col items-stretch", children: [_jsx("div", { className: "relative flex-1", children: _jsxs("div", { className: "absolute inset-0 overflow-y-auto pr-6", children: [_jsx("div", { className: "text-sm font-medium", children: "Page item" }), _jsx("div", { className: "text-xs text-gray-500", children: pageItem.path }), _jsx(ComponentTypeSelector, { selectedComponentTypes: data.selectedComponentTypes, setSelectedComponentTypes: (selectedTypes) => {
|
|
161
|
-
setData({
|
|
162
|
-
...data,
|
|
163
|
-
selectedComponentTypes: selectedTypes,
|
|
164
|
-
});
|
|
165
|
-
}, schema: wizard.schema, data: data, setData: setData, step: step }), customInstructionsPanel()] }) }), _jsxs("div", { className: "py-2", children: [_jsxs("div", { className: "flex w-full gap-2", children: [_jsx(ActionButton, { onClick: createLayout, disabled: isLoading ||
|
|
166
|
-
isCreatingComponents ||
|
|
167
|
-
!data.selectedComponentTypes ||
|
|
168
|
-
data.selectedComponentTypes.length === 0, isLoading: isLoading ||
|
|
169
|
-
isCreatingComponents ||
|
|
170
|
-
!!editContext?.activeFieldActions.find((action) => action.state === "running"), loadingText: "Working", className: "w-full flex-1", children: internalState.componentsCreated
|
|
171
|
-
? "Reset and regenerate content"
|
|
172
|
-
: "Generate content" }), isLoading && (_jsx(ActionButton, { isLoading: false, onClick: () => abortController?.abort("User aborted"), children: "Abort" }))] }), message && _jsx("div", { className: "mt-2 text-xs", children: message })] })] }) }), _jsx(WizardBoxConnector, { className: "mt-6" }), _jsx(WizardBox, { title: "Page preview", icon: _jsx(PanelsTopLeft, {}), description: "After finalizing the page, you can edit, further enhance the content and share the page with your team for collaboration.", noPadding: true, className: "flex-1", children: _jsx("div", { className: cn("border-t border-gray-200", pageLoaded ? "h-full" : "h-0"), children: _jsx(PageViewer, { name: "single", compareView: false, showFormEditor: false, followEditsDefault: true, pageViewContext: editContext.pageView }) }) })] }));
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Merges a new layout with the previous layout
|
|
176
|
-
* - Keeps all previous components
|
|
177
|
-
* - Adds new components
|
|
178
|
-
* - Updates existing fields with new values
|
|
179
|
-
* - Adds new fields
|
|
180
|
-
*/
|
|
181
|
-
const mergeLayout = (prev, newLayout) => {
|
|
182
|
-
if (!prev)
|
|
183
|
-
return newLayout;
|
|
184
|
-
// Merge top-level properties
|
|
185
|
-
const result = {
|
|
186
|
-
name: newLayout.name || prev.name,
|
|
187
|
-
message: newLayout.message,
|
|
188
|
-
metaDescription: prev.metaDescription,
|
|
189
|
-
metaKeywords: prev.metaKeywords,
|
|
190
|
-
components: [...(prev.components || [])],
|
|
191
|
-
};
|
|
192
|
-
// Function to merge components recursively
|
|
193
|
-
const mergeComponents = (existingComponents, newComponents) => {
|
|
194
|
-
if (!newComponents?.length)
|
|
195
|
-
return existingComponents;
|
|
196
|
-
const result = [...existingComponents];
|
|
197
|
-
for (const newComp of newComponents) {
|
|
198
|
-
// Try to find a matching component by type and name
|
|
199
|
-
const existingIndex = result.findIndex((comp) => comp.type === newComp.type && comp.name === newComp.name);
|
|
200
|
-
if (existingIndex >= 0) {
|
|
201
|
-
// Update existing component
|
|
202
|
-
const existing = result[existingIndex];
|
|
203
|
-
// Merge fields - update existing fields and add new ones
|
|
204
|
-
const mergedFields = [...(existing.fields || [])];
|
|
205
|
-
for (const newField of newComp.fields || []) {
|
|
206
|
-
const fieldIndex = mergedFields.findIndex((f) => f.name === newField.name);
|
|
207
|
-
if (fieldIndex >= 0) {
|
|
208
|
-
mergedFields[fieldIndex].value = newField.value; // Update existing field
|
|
209
|
-
mergedFields[fieldIndex].type = newField.type;
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
mergedFields.push(newField); // Add new field
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
// Recursive merge of children components
|
|
216
|
-
const mergedChildren = mergeComponents(existing.children || [], newComp.children || []);
|
|
217
|
-
// Create updated component
|
|
218
|
-
result[existingIndex] = {
|
|
219
|
-
...existing,
|
|
220
|
-
fields: mergedFields,
|
|
221
|
-
children: mergedChildren,
|
|
222
|
-
placeholder: newComp.placeholder || existing.placeholder,
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
else {
|
|
226
|
-
// Add new component
|
|
227
|
-
result.push(newComp);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return result;
|
|
231
|
-
};
|
|
232
|
-
// Merge components recursively
|
|
233
|
-
result.components = mergeComponents(result.components, newLayout.components || []);
|
|
234
|
-
return result;
|
|
235
|
-
};
|
|
236
|
-
//# sourceMappingURL=CreatePageAndLayoutStep.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreatePageAndLayoutStep.js","sourceRoot":"","sources":["../../../src/page-wizard/steps/CreatePageAndLayoutStep.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EACL,cAAc,EACd,wBAAwB,GACzB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,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