@alpaca-editor/core 1.0.3907 → 1.0.3911
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/ActionButton.d.ts +1 -1
- package/dist/components/ui/card.js +3 -3
- package/dist/components/ui/card.js.map +1 -1
- package/dist/config/config.js +32 -0
- package/dist/config/config.js.map +1 -1
- package/dist/editor/ConfirmationDialog.js +1 -1
- package/dist/editor/ConfirmationDialog.js.map +1 -1
- package/dist/editor/Titlebar.js +2 -2
- package/dist/editor/Titlebar.js.map +1 -1
- package/dist/editor/client/EditorClient.js +4 -2
- package/dist/editor/client/EditorClient.js.map +1 -1
- package/dist/editor/menubar/ActionsMenu.js +1 -0
- package/dist/editor/menubar/ActionsMenu.js.map +1 -1
- package/dist/editor/ui/Icons.d.ts +1 -0
- package/dist/editor/ui/Icons.js +3 -0
- package/dist/editor/ui/Icons.js.map +1 -1
- package/dist/editor/ui/Spinner.js +1 -1
- package/dist/editor/ui/Spinner.js.map +1 -1
- package/dist/images/wizard-tour.png +0 -0
- package/dist/images/wizard.png +0 -0
- package/dist/page-wizard/WizardSteps.js +1 -1
- package/dist/page-wizard/WizardSteps.js.map +1 -1
- package/dist/page-wizard/steps/CollectStep.js +9 -9
- package/dist/page-wizard/steps/CollectStep.js.map +1 -1
- package/dist/page-wizard/steps/ComponentTypesSelector.js +3 -5
- package/dist/page-wizard/steps/ComponentTypesSelector.js.map +1 -1
- package/dist/page-wizard/steps/ContentStep.js +1 -1
- package/dist/page-wizard/steps/ContentStep.js.map +1 -1
- package/dist/page-wizard/steps/ImagesStep.js +12 -2
- package/dist/page-wizard/steps/ImagesStep.js.map +1 -1
- package/dist/page-wizard/steps/LayoutStep.js +1 -1
- package/dist/page-wizard/steps/LayoutStep.js.map +1 -1
- package/dist/page-wizard/steps/MetaDataStep.js +1 -1
- package/dist/page-wizard/steps/MetaDataStep.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/splash-screen/NewPage.js +15 -13
- package/dist/splash-screen/NewPage.js.map +1 -1
- package/dist/splash-screen/OpenPage.d.ts +1 -0
- package/dist/splash-screen/OpenPage.js +51 -0
- package/dist/splash-screen/OpenPage.js.map +1 -0
- package/dist/splash-screen/RecentPages.d.ts +1 -0
- package/dist/splash-screen/RecentPages.js +50 -0
- package/dist/splash-screen/RecentPages.js.map +1 -0
- package/dist/splash-screen/SplashScreen.d.ts +1 -1
- package/dist/splash-screen/SplashScreen.js +54 -75
- package/dist/splash-screen/SplashScreen.js.map +1 -1
- package/dist/styles.css +66 -28
- package/dist/tour/Tour.js +6 -6
- package/dist/tour/Tour.js.map +1 -1
- package/dist/tour/default-tour.js +2 -1
- package/dist/tour/default-tour.js.map +1 -1
- package/dist/tour/preview-tour.js +2 -1
- package/dist/tour/preview-tour.js.map +1 -1
- package/images/wizard-tour.png +0 -0
- package/images/wizard.png +0 -0
- package/package.json +1 -1
- package/src/components/ActionButton.tsx +1 -1
- package/src/components/ui/card.tsx +52 -47
- package/src/config/config.tsx +33 -2
- package/src/editor/ConfirmationDialog.tsx +1 -1
- package/src/editor/Titlebar.tsx +2 -2
- package/src/editor/client/EditorClient.tsx +5 -2
- package/src/editor/menubar/ActionsMenu.tsx +1 -0
- package/src/editor/menubar/SecondaryControls.tsx +1 -1
- package/src/editor/ui/Icons.tsx +20 -0
- package/src/editor/ui/Spinner.tsx +5 -1
- package/src/page-wizard/WizardSteps.tsx +1 -1
- package/src/page-wizard/steps/CollectStep.tsx +33 -29
- package/src/page-wizard/steps/ComponentTypesSelector.tsx +4 -25
- package/src/page-wizard/steps/ContentStep.tsx +1 -1
- package/src/page-wizard/steps/ImagesStep.tsx +43 -3
- package/src/page-wizard/steps/LayoutStep.tsx +1 -1
- package/src/page-wizard/steps/MetaDataStep.tsx +1 -1
- package/src/revision.ts +2 -2
- package/src/splash-screen/NewPage.tsx +133 -104
- package/src/splash-screen/OpenPage.tsx +113 -0
- package/src/splash-screen/RecentPages.tsx +123 -0
- package/src/splash-screen/SplashScreen.tsx +108 -162
- package/src/tour/Tour.tsx +133 -125
- package/src/tour/default-tour.tsx +7 -6
- package/src/tour/preview-tour.tsx +2 -1
- package/styles.css +14 -0
|
@@ -832,7 +832,10 @@ export function EditorClient({
|
|
|
832
832
|
const page = pageViewContext.page;
|
|
833
833
|
|
|
834
834
|
useEffect(() => {
|
|
835
|
-
const isLoading =
|
|
835
|
+
const isLoading =
|
|
836
|
+
!!contentEditorItem &&
|
|
837
|
+
contentEditorItem.hasLayout &&
|
|
838
|
+
(!page || (page?.editRevision ?? "") != (revision ?? ""));
|
|
836
839
|
setIsRefreshing(isLoading && viewName === "page-editor");
|
|
837
840
|
if (!isLoading) setInserting(undefined);
|
|
838
841
|
}, [page, viewName, revision]);
|
|
@@ -1433,7 +1436,7 @@ export function EditorClient({
|
|
|
1433
1436
|
|
|
1434
1437
|
const loadWorkboxDebounced = useDebouncedCallback(
|
|
1435
1438
|
(items: ItemDescriptor[]) => loadWorkbox(items),
|
|
1436
|
-
|
|
1439
|
+
5000,
|
|
1437
1440
|
);
|
|
1438
1441
|
|
|
1439
1442
|
useEffect(() => {
|
|
@@ -3,7 +3,7 @@ import { ItemLanguageVersion } from "./ItemLanguageVersion";
|
|
|
3
3
|
import { ActiveUsers } from "./ActiveUsers";
|
|
4
4
|
import { ActionsMenu } from "./ActionsMenu";
|
|
5
5
|
import { Separator } from "../menubar/Separator";
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
export function SecondaryControls() {
|
|
8
8
|
const editContext = useEditContext();
|
|
9
9
|
|
package/src/editor/ui/Icons.tsx
CHANGED
|
@@ -686,3 +686,23 @@ export function Logo({ className }: { className?: string }) {
|
|
|
686
686
|
</svg>
|
|
687
687
|
);
|
|
688
688
|
}
|
|
689
|
+
export function MagicEditIcon() {
|
|
690
|
+
return (
|
|
691
|
+
<svg
|
|
692
|
+
width="21"
|
|
693
|
+
height="17"
|
|
694
|
+
viewBox="0 0 21 17"
|
|
695
|
+
fill="none"
|
|
696
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
697
|
+
>
|
|
698
|
+
<path
|
|
699
|
+
d="M20.4141 5.70117C20.7921 5.32317 21.0001 4.82117 21.0001 4.28717C21.0001 3.75317 20.7921 3.25117 20.4141 2.87317L18.8281 1.28717C18.4501 0.909172 17.9481 0.701172 17.4141 0.701172C16.8801 0.701172 16.3781 0.909172 16.0011 1.28617L5.36914 11.8852V16.3002H9.78214L20.4141 5.70117ZM7.36914 14.3002V12.7152L14.4091 5.69717L15.9951 7.28317L8.95614 14.3002H7.36914Z"
|
|
700
|
+
fill="white"
|
|
701
|
+
/>
|
|
702
|
+
<path
|
|
703
|
+
d="M0.376146 4.6906C0.63534 4.62716 0.873518 4.56373 1.1117 4.50029C1.39891 4.42276 1.69313 4.35932 1.97334 4.26064C3.05916 3.85183 3.74567 3.0765 4.03989 1.9558C4.14497 1.54699 4.25005 1.13818 4.35513 0.736414C4.35513 0.722317 4.35513 0.715269 4.37615 0.701172C4.39716 0.771656 4.41117 0.842141 4.43219 0.912625C4.54427 1.34258 4.63534 1.77254 4.77545 2.19544C5.15373 3.3232 5.93131 4.04919 7.07317 4.36637C7.47947 4.47915 7.89278 4.57782 8.29909 4.6906C8.3201 4.6906 8.33411 4.69765 8.36914 4.71174C8.21502 4.75403 8.07492 4.78928 7.92781 4.82452C7.54953 4.93025 7.16424 5.00778 6.79296 5.13465C5.71415 5.52232 5.02063 6.2906 4.7124 7.40426C4.59331 7.83421 4.48823 8.26417 4.36214 8.70117C4.36214 8.68003 4.34813 8.65888 4.34112 8.63774C4.22904 8.20073 4.13096 7.76373 3.99786 7.33377C3.64059 6.14258 2.85601 5.3743 1.65811 5.04302C1.2518 4.93025 0.845498 4.83157 0.439193 4.72584C0.418178 4.72584 0.404167 4.71879 0.369141 4.7047L0.376146 4.6906Z"
|
|
704
|
+
fill="white"
|
|
705
|
+
/>
|
|
706
|
+
</svg>
|
|
707
|
+
);
|
|
708
|
+
}
|
|
@@ -3,5 +3,9 @@ export function Spinner({
|
|
|
3
3
|
}: {
|
|
4
4
|
size?: "2xl" | "3xl" | "4xl" | "5xl";
|
|
5
5
|
}) {
|
|
6
|
-
return
|
|
6
|
+
return (
|
|
7
|
+
<i
|
|
8
|
+
className={`pi pi-cog pi-spin text-${size} text-theme-secondary-light`}
|
|
9
|
+
></i>
|
|
10
|
+
);
|
|
7
11
|
}
|
|
@@ -407,7 +407,7 @@ export function WizardSteps({ wizard, parentItem }: WizardStepsProps) {
|
|
|
407
407
|
};
|
|
408
408
|
|
|
409
409
|
const handleFinish = () => {
|
|
410
|
-
editContext?.switchView("editor", { skipConfirmation: true });
|
|
410
|
+
editContext?.switchView("page-editor", { skipConfirmation: true });
|
|
411
411
|
};
|
|
412
412
|
|
|
413
413
|
const currentStep = wizard.steps[currentStepIndex];
|
|
@@ -154,7 +154,7 @@ export function CollectStep({
|
|
|
154
154
|
{error && <div className="mt-2 text-sm text-red-500">{error}</div>}
|
|
155
155
|
<div
|
|
156
156
|
className={`flex flex-col items-center justify-center border border-dashed border-gray-300 p-8 ${
|
|
157
|
-
isUploading ? "
|
|
157
|
+
isUploading ? "" : "bg-white"
|
|
158
158
|
}`}
|
|
159
159
|
onDrop={handleDrop}
|
|
160
160
|
onDragOver={(e) => e.preventDefault()}
|
|
@@ -182,34 +182,38 @@ export function CollectStep({
|
|
|
182
182
|
</svg>
|
|
183
183
|
)}
|
|
184
184
|
{isUploading && <Spinner />}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
className=
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
185
|
+
{!isUploading && (
|
|
186
|
+
<>
|
|
187
|
+
<input
|
|
188
|
+
ref={fileInputRef}
|
|
189
|
+
type="file"
|
|
190
|
+
multiple
|
|
191
|
+
accept=".pdf,.doc,.docx"
|
|
192
|
+
style={{ display: "none" }}
|
|
193
|
+
onChange={(e) => {
|
|
194
|
+
const file = e.target.files?.[0];
|
|
195
|
+
if (file) {
|
|
196
|
+
uploadFile(file);
|
|
197
|
+
}
|
|
198
|
+
}}
|
|
199
|
+
onDrop={handleDrop}
|
|
200
|
+
disabled={isUploading}
|
|
201
|
+
/>
|
|
202
|
+
<div className="flex items-center gap-1">
|
|
203
|
+
<span
|
|
204
|
+
className={`text-sm font-medium ${
|
|
205
|
+
isUploading
|
|
206
|
+
? "text-gray-500"
|
|
207
|
+
: "text-theme-secondary cursor-pointer underline"
|
|
208
|
+
} `}
|
|
209
|
+
onClick={triggerFileInput}
|
|
210
|
+
>
|
|
211
|
+
Click
|
|
212
|
+
</span>
|
|
213
|
+
or drag & drop to upload
|
|
214
|
+
</div>
|
|
215
|
+
</>
|
|
216
|
+
)}
|
|
213
217
|
</div>
|
|
214
218
|
</div>
|
|
215
219
|
</Card>
|
|
@@ -249,17 +249,11 @@ export function ComponentTypeSelector({
|
|
|
249
249
|
/>
|
|
250
250
|
</div>
|
|
251
251
|
|
|
252
|
-
<div className="mb-3 flex flex-col gap-3">
|
|
252
|
+
<div className="mb-3 flex flex-col gap-3 py-2">
|
|
253
253
|
{/* Component Types Section */}
|
|
254
|
-
<div className="min-w-0 flex-1 rounded
|
|
254
|
+
<div className="min-w-0 flex-1 rounded">
|
|
255
255
|
<div className="mb-2 flex items-center justify-between">
|
|
256
256
|
<h4 className="text-sm font-bold">Component Types</h4>
|
|
257
|
-
<span className="rounded-full bg-gray-200 px-2 py-1 text-xs text-gray-500">
|
|
258
|
-
{selectedComponentTypes && Array.isArray(selectedComponentTypes)
|
|
259
|
-
? selectedComponentTypes.length
|
|
260
|
-
: 0}{" "}
|
|
261
|
-
of {availableComponentTypes.length} selected
|
|
262
|
-
</span>
|
|
263
257
|
</div>
|
|
264
258
|
|
|
265
259
|
{/* Selected component tags */}
|
|
@@ -323,7 +317,7 @@ export function ComponentTypeSelector({
|
|
|
323
317
|
return (
|
|
324
318
|
<div
|
|
325
319
|
key={type}
|
|
326
|
-
className={`relative cursor-pointer rounded-lg border p-
|
|
320
|
+
className={`relative cursor-pointer rounded-lg border p-2 transition-all ${
|
|
327
321
|
isSelected
|
|
328
322
|
? "border-theme-secondary bg-theme-secondary-50"
|
|
329
323
|
: "border-gray-200 bg-white hover:border-gray-300 hover:bg-gray-50"
|
|
@@ -334,22 +328,7 @@ export function ComponentTypeSelector({
|
|
|
334
328
|
<div className="min-w-0 flex-1">
|
|
335
329
|
<div className="mb-1 flex items-center gap-2">
|
|
336
330
|
<div className="flex items-center gap-2">
|
|
337
|
-
<
|
|
338
|
-
className="h-5 w-5 text-gray-400"
|
|
339
|
-
fill="none"
|
|
340
|
-
stroke="currentColor"
|
|
341
|
-
viewBox="0 0 24 24"
|
|
342
|
-
>
|
|
343
|
-
<path
|
|
344
|
-
strokeLinecap="round"
|
|
345
|
-
strokeLinejoin="round"
|
|
346
|
-
strokeWidth={2}
|
|
347
|
-
d="M4 6h16M4 10h16M4 14h16M4 18h16"
|
|
348
|
-
/>
|
|
349
|
-
</svg>
|
|
350
|
-
<h3 className="font-medium text-gray-900">
|
|
351
|
-
{type}
|
|
352
|
-
</h3>
|
|
331
|
+
<h3 className="text-sm text-gray-900">{type}</h3>
|
|
353
332
|
{isPreselected && (
|
|
354
333
|
<span
|
|
355
334
|
className="text-theme-secondary text-sm"
|
|
@@ -519,7 +519,7 @@ export function ContentStep({
|
|
|
519
519
|
createWizardAiContext,
|
|
520
520
|
{ allowedFunctions: [] },
|
|
521
521
|
{ signal: localAbortController.signal },
|
|
522
|
-
step.aiModel || "
|
|
522
|
+
step.aiModel || "gpt-4.1",
|
|
523
523
|
(response) => {
|
|
524
524
|
try {
|
|
525
525
|
const newLayout = JSON.parse(response.content) as WizardPageModel;
|
|
@@ -18,6 +18,7 @@ type Thumbnail = {
|
|
|
18
18
|
id: string;
|
|
19
19
|
name: string;
|
|
20
20
|
thumbUrl?: string;
|
|
21
|
+
previewUrl?: string;
|
|
21
22
|
description?: string;
|
|
22
23
|
selected?: boolean;
|
|
23
24
|
};
|
|
@@ -28,6 +29,43 @@ type Image = {
|
|
|
28
29
|
options?: Thumbnail[];
|
|
29
30
|
};
|
|
30
31
|
|
|
32
|
+
// Responsive image component that chooses the best image size
|
|
33
|
+
const ResponsiveImage = ({
|
|
34
|
+
thumbUrl,
|
|
35
|
+
previewUrl,
|
|
36
|
+
alt,
|
|
37
|
+
className,
|
|
38
|
+
}: {
|
|
39
|
+
thumbUrl?: string;
|
|
40
|
+
previewUrl?: string;
|
|
41
|
+
alt: string;
|
|
42
|
+
className?: string;
|
|
43
|
+
}) => {
|
|
44
|
+
// If we have both URLs, use srcset to let browser choose
|
|
45
|
+
if (thumbUrl && previewUrl) {
|
|
46
|
+
return (
|
|
47
|
+
<img
|
|
48
|
+
src={thumbUrl} // fallback for older browsers
|
|
49
|
+
srcSet={`${thumbUrl} 96w, ${previewUrl} 400w`}
|
|
50
|
+
sizes="(max-width: 640px) calc(50vw - 1rem), (max-width: 768px) calc(33vw - 1rem), calc(16.666vw - 1rem)"
|
|
51
|
+
alt={alt}
|
|
52
|
+
className={className}
|
|
53
|
+
loading="lazy"
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Fallback to available URL
|
|
59
|
+
return (
|
|
60
|
+
<img
|
|
61
|
+
src={previewUrl || thumbUrl}
|
|
62
|
+
alt={alt}
|
|
63
|
+
className={className}
|
|
64
|
+
loading="lazy"
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
31
69
|
export const ImagesStep = (props: StepComponentProps) => {
|
|
32
70
|
const mediaRootId = "3D6658D8-A0BF-4E75-B3E2-D050FABCF4E1";
|
|
33
71
|
const [selectedFolderId, setSelectedFolderId] = useState<string>(mediaRootId);
|
|
@@ -78,7 +116,7 @@ export const ImagesStep = (props: StepComponentProps) => {
|
|
|
78
116
|
createWizardAiContext,
|
|
79
117
|
{},
|
|
80
118
|
undefined,
|
|
81
|
-
"
|
|
119
|
+
"gpt-4.1",
|
|
82
120
|
);
|
|
83
121
|
const images = JSON.parse(aiPromptResult.content).images;
|
|
84
122
|
|
|
@@ -99,6 +137,7 @@ export const ImagesStep = (props: StepComponentProps) => {
|
|
|
99
137
|
name: thumbnail.name,
|
|
100
138
|
id: thumbnail.id,
|
|
101
139
|
thumbUrl: thumbnail.thumbUrl,
|
|
140
|
+
previewUrl: thumbnail.previewUrl,
|
|
102
141
|
description: thumbnail.description,
|
|
103
142
|
}),
|
|
104
143
|
);
|
|
@@ -314,8 +353,9 @@ export const ImagesStep = (props: StepComponentProps) => {
|
|
|
314
353
|
}));
|
|
315
354
|
}}
|
|
316
355
|
>
|
|
317
|
-
<
|
|
318
|
-
|
|
356
|
+
<ResponsiveImage
|
|
357
|
+
thumbUrl={option.thumbUrl}
|
|
358
|
+
previewUrl={option.previewUrl}
|
|
319
359
|
alt={option.name}
|
|
320
360
|
className="h-full w-full object-cover"
|
|
321
361
|
/>
|
package/src/revision.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = "1.0.
|
|
2
|
-
export const buildDate = "2025-05-
|
|
1
|
+
export const version = "1.0.3911";
|
|
2
|
+
export const buildDate = "2025-05-29 17:38:34";
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
loadInsertOptions,
|
|
11
11
|
} from "../editor/services/editService";
|
|
12
12
|
import { InputText } from "primereact/inputtext";
|
|
13
|
-
import { Button } from "primereact/button";
|
|
14
13
|
import { getAbsoluteIconUrl, getItemDescriptor } from "../editor/utils";
|
|
15
14
|
import { classNames } from "primereact/utils";
|
|
16
15
|
import { useEditContext } from "../client-components";
|
|
@@ -22,6 +21,10 @@ import { getWizards } from "../page-wizard/service";
|
|
|
22
21
|
import { Wizard } from "../page-wizard/PageWizard";
|
|
23
22
|
import { Card } from "../components/ui/card";
|
|
24
23
|
import { CardConnector } from "../components/ui/CardConnector";
|
|
24
|
+
import { Logo } from "../editor/ui/Icons";
|
|
25
|
+
import { ActionButton } from "../components/ActionButton";
|
|
26
|
+
import { FilePenLine, Palette } from "lucide-react";
|
|
27
|
+
|
|
25
28
|
export function NewPage({ selectedItemId }: { selectedItemId?: string }) {
|
|
26
29
|
const [selectedItem, setSelectedItem] = useState<ItemDescriptor | null>(null);
|
|
27
30
|
const [isValid, setIsValid] = useState<boolean>(false);
|
|
@@ -145,121 +148,147 @@ export function NewPage({ selectedItemId }: { selectedItemId?: string }) {
|
|
|
145
148
|
};
|
|
146
149
|
|
|
147
150
|
return (
|
|
148
|
-
<div className="flex h-full flex-col bg-gray-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
className="h-full"
|
|
156
|
-
>
|
|
157
|
-
<div className="relative h-full">
|
|
158
|
-
<div className="absolute inset-0 overflow-auto">
|
|
159
|
-
<ScrollingContentTree
|
|
160
|
-
selectedItemId={selectedItem?.id || selectedItemId}
|
|
161
|
-
onSelectionChange={(selection) => {
|
|
162
|
-
const selected = selection[0] as ItemTreeNodeData;
|
|
163
|
-
if (selected) setSelectedItem(selected);
|
|
164
|
-
}}
|
|
165
|
-
/>
|
|
166
|
-
</div>
|
|
151
|
+
<div className="flex h-full flex-col gap-6 bg-gray-100 p-4 md:p-8">
|
|
152
|
+
{/* Header with icon, title, description, and back button */}
|
|
153
|
+
<div className="flex gap-4">
|
|
154
|
+
<Logo className="h-8 w-8" />
|
|
155
|
+
<div className="flex-1 text-neutral-800">
|
|
156
|
+
<div className="text-lg font-semibold md:text-xl">
|
|
157
|
+
Create New Page
|
|
167
158
|
</div>
|
|
168
|
-
|
|
169
|
-
|
|
159
|
+
<div className="mt-1 text-xs font-light md:text-sm">
|
|
160
|
+
Select a location, choose a template or wizard, and name your new
|
|
161
|
+
page
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
170
164
|
|
|
171
|
-
|
|
172
|
-
|
|
165
|
+
<div className="flex items-start">
|
|
166
|
+
<ActionButton onClick={() => editContext?.switchView("open-page")}>
|
|
167
|
+
Open Existing
|
|
168
|
+
</ActionButton>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
173
171
|
|
|
174
|
-
{/*
|
|
175
|
-
|
|
176
|
-
<div className="
|
|
172
|
+
{/* Content */}
|
|
173
|
+
<div className="flex flex-1 flex-col md:flex-row">
|
|
174
|
+
<div className="tour-pick-location flex-1">
|
|
177
175
|
<Card
|
|
178
|
-
icon={<i className="pi pi-
|
|
179
|
-
title="
|
|
180
|
-
description="Select
|
|
176
|
+
icon={<i className="pi pi-map-marker text-sm"></i>}
|
|
177
|
+
title="Pick Location"
|
|
178
|
+
description="Select where to create your new page"
|
|
179
|
+
noPadding
|
|
180
|
+
className="h-full"
|
|
181
181
|
>
|
|
182
|
-
<div className="
|
|
183
|
-
<div className="
|
|
184
|
-
|
|
185
|
-
<
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
selectedTemplate === option.id
|
|
194
|
-
? "tour-selected-template bg-gray-200 outline-2 outline-offset-2 outline-gray-200"
|
|
195
|
-
: "bg-gray-100",
|
|
196
|
-
)}
|
|
197
|
-
>
|
|
198
|
-
{
|
|
199
|
-
<img
|
|
200
|
-
src={getAbsoluteIconUrl(option.icon)}
|
|
201
|
-
width="32"
|
|
202
|
-
height="32"
|
|
203
|
-
></img>
|
|
204
|
-
}
|
|
205
|
-
{option.name}
|
|
206
|
-
</div>
|
|
207
|
-
))}
|
|
182
|
+
<div className="h-full px-4 pb-4 md:px-6">
|
|
183
|
+
<div className="relative h-full">
|
|
184
|
+
<div className="absolute inset-0 overflow-auto">
|
|
185
|
+
<ScrollingContentTree
|
|
186
|
+
selectedItemId={selectedItem?.id || selectedItemId}
|
|
187
|
+
onSelectionChange={(selection) => {
|
|
188
|
+
const selected = selection[0] as ItemTreeNodeData;
|
|
189
|
+
if (selected) setSelectedItem(selected);
|
|
190
|
+
}}
|
|
191
|
+
/>
|
|
192
|
+
</div>
|
|
208
193
|
</div>
|
|
209
|
-
{selectedTemplate &&
|
|
210
|
-
wizards?.find((x) => x.id === selectedTemplate) && (
|
|
211
|
-
<div className="mt-4">
|
|
212
|
-
<Button
|
|
213
|
-
onClick={launchWizard}
|
|
214
|
-
label="Start Wizard"
|
|
215
|
-
id="launch-wizard-button"
|
|
216
|
-
/>
|
|
217
|
-
</div>
|
|
218
|
-
)}
|
|
219
194
|
</div>
|
|
220
195
|
</Card>
|
|
196
|
+
</div>
|
|
221
197
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
198
|
+
{/* Card Connector - only visible when location is selected */}
|
|
199
|
+
{selectedItem && <CardConnector />}
|
|
200
|
+
|
|
201
|
+
{/* Second card - only visible when location is selected */}
|
|
202
|
+
{selectedItem && (
|
|
203
|
+
<div className="flex flex-1 flex-col">
|
|
204
|
+
<Card
|
|
205
|
+
icon={<Palette className="h-4 w-4" />}
|
|
206
|
+
title="Choose Template or Wizard"
|
|
207
|
+
description="Select a template or wizard to create your page"
|
|
208
|
+
>
|
|
209
|
+
<div className="tour-choose-template">
|
|
210
|
+
<div className="flex min-h-8 flex-wrap gap-3">
|
|
211
|
+
{!insertOptions?.length && (
|
|
212
|
+
<div className="text-sm text-gray-500">
|
|
213
|
+
You cannot insert content at the selected location.
|
|
214
|
+
</div>
|
|
215
|
+
)}
|
|
216
|
+
{insertOptionsAndWizards?.map((option) => (
|
|
217
|
+
<div
|
|
218
|
+
key={option.id}
|
|
219
|
+
onClick={() => setSelectedTemplate(option.id)}
|
|
220
|
+
className={classNames(
|
|
221
|
+
"hover:border-theme-secondary flex h-23 min-w-34 cursor-pointer flex-col items-center justify-center gap-2 rounded border border-gray-200 text-xs",
|
|
222
|
+
selectedTemplate === option.id
|
|
223
|
+
? "bg-theme-secondary-light border-theme-secondary"
|
|
224
|
+
: "bg-white",
|
|
225
|
+
)}
|
|
226
|
+
>
|
|
227
|
+
{
|
|
228
|
+
<img
|
|
229
|
+
src={getAbsoluteIconUrl(option.icon)}
|
|
230
|
+
width="32"
|
|
231
|
+
height="32"
|
|
232
|
+
></img>
|
|
233
|
+
}
|
|
234
|
+
{option.name}
|
|
235
|
+
</div>
|
|
236
|
+
))}
|
|
237
|
+
</div>
|
|
238
|
+
{selectedTemplate &&
|
|
239
|
+
wizards?.find((x) => x.id === selectedTemplate) && (
|
|
249
240
|
<div className="mt-4">
|
|
250
|
-
<
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
241
|
+
<ActionButton onClick={launchWizard} isLoading={false}>
|
|
242
|
+
Start wizard
|
|
243
|
+
</ActionButton>
|
|
244
|
+
</div>
|
|
245
|
+
)}
|
|
246
|
+
</div>
|
|
247
|
+
</Card>
|
|
248
|
+
|
|
249
|
+
{/* Name Your Page card - only visible when template is selected */}
|
|
250
|
+
{selectedTemplate &&
|
|
251
|
+
insertOptions?.find((x) => x.id === selectedTemplate) && (
|
|
252
|
+
<>
|
|
253
|
+
<CardConnector direction="vertical" />
|
|
254
|
+
<Card
|
|
255
|
+
icon={<FilePenLine />}
|
|
256
|
+
title="Name Your Page"
|
|
257
|
+
description="Enter a name for your new page"
|
|
258
|
+
>
|
|
259
|
+
<div>
|
|
260
|
+
<InputText
|
|
261
|
+
className="w-full rounded p-1.5 text-xs"
|
|
262
|
+
value={name}
|
|
263
|
+
id="new-page-name"
|
|
264
|
+
onChange={(e) => setName(e.target.value)}
|
|
265
|
+
onKeyDown={(ev) => {
|
|
266
|
+
if (ev.key === "Enter" && isValid) handleOk();
|
|
267
|
+
}}
|
|
268
|
+
data-testid="new-page-name"
|
|
269
|
+
placeholder="Enter page name..."
|
|
255
270
|
/>
|
|
271
|
+
{validationMessage && (
|
|
272
|
+
<div className="mt-2 text-red-500">
|
|
273
|
+
{validationMessage}
|
|
274
|
+
</div>
|
|
275
|
+
)}
|
|
276
|
+
<div className="mt-4">
|
|
277
|
+
<ActionButton
|
|
278
|
+
onClick={handleOk}
|
|
279
|
+
disabled={!isValid}
|
|
280
|
+
isLoading={false}
|
|
281
|
+
>
|
|
282
|
+
Create page
|
|
283
|
+
</ActionButton>
|
|
284
|
+
</div>
|
|
256
285
|
</div>
|
|
257
|
-
</
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
286
|
+
</Card>
|
|
287
|
+
</>
|
|
288
|
+
)}
|
|
289
|
+
</div>
|
|
290
|
+
)}
|
|
291
|
+
</div>
|
|
263
292
|
</div>
|
|
264
293
|
);
|
|
265
294
|
}
|