@alpaca-editor/core 1.0.4156 → 1.0.4157
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/config/config.js +26 -56
- package/dist/config/config.js.map +1 -1
- package/dist/editor/ContextMenu.js +17 -8
- package/dist/editor/ContextMenu.js.map +1 -1
- package/dist/editor/EditorWarning.js +2 -1
- package/dist/editor/EditorWarning.js.map +1 -1
- package/dist/editor/FieldListField.js +2 -2
- package/dist/editor/FieldListField.js.map +1 -1
- package/dist/editor/FieldListFieldWithFallbacks.js +2 -1
- package/dist/editor/FieldListFieldWithFallbacks.js.map +1 -1
- package/dist/editor/FloatingToolbar.js +3 -2
- package/dist/editor/FloatingToolbar.js.map +1 -1
- package/dist/editor/ImageEditButton.d.ts +1 -1
- package/dist/editor/ImageEditButton.js +2 -2
- package/dist/editor/ImageEditButton.js.map +1 -1
- package/dist/editor/ImageEditor.js +13 -2
- package/dist/editor/ImageEditor.js.map +1 -1
- package/dist/editor/PictureEditor.js +18 -33
- package/dist/editor/PictureEditor.js.map +1 -1
- package/dist/editor/PictureEditorDialog.js +3 -2
- package/dist/editor/PictureEditorDialog.js.map +1 -1
- package/dist/editor/ai/DancingDots.js +1 -1
- package/dist/editor/ai/DancingDots.js.map +1 -1
- package/dist/editor/client/AboutDialog.js +2 -2
- package/dist/editor/client/AboutDialog.js.map +1 -1
- package/dist/editor/client/EditorShell.d.ts +0 -2
- package/dist/editor/client/EditorShell.js +0 -2
- package/dist/editor/client/EditorShell.js.map +1 -1
- package/dist/editor/commands/createVersionCommand.js +1 -1
- package/dist/editor/commands/createVersionCommand.js.map +1 -1
- package/dist/editor/commands/deleteVersionCommand.js +1 -1
- package/dist/editor/commands/deleteVersionCommand.js.map +1 -1
- package/dist/editor/commands/undo.js +2 -2
- package/dist/editor/commands/undo.js.map +1 -1
- package/dist/editor/control-center/Status.js +2 -1
- package/dist/editor/control-center/Status.js.map +1 -1
- package/dist/editor/control-center/WebSocketMessages.js +3 -2
- package/dist/editor/control-center/WebSocketMessages.js.map +1 -1
- package/dist/editor/field-types/TreeListEditor.js +5 -3
- package/dist/editor/field-types/TreeListEditor.js.map +1 -1
- package/dist/editor/media-selector/AiImageSearch.js +0 -1
- package/dist/editor/media-selector/AiImageSearch.js.map +1 -1
- package/dist/editor/media-selector/UploadZone.js +2 -1
- package/dist/editor/media-selector/UploadZone.js.map +1 -1
- package/dist/editor/menubar/ActiveUsers.js +2 -1
- package/dist/editor/menubar/ActiveUsers.js.map +1 -1
- package/dist/editor/menubar/NavButtons.js +3 -2
- package/dist/editor/menubar/NavButtons.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +2 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
- package/dist/editor/pageModel.d.ts +2 -1
- package/dist/editor/reviews/PreviewInfo.js +2 -1
- package/dist/editor/reviews/PreviewInfo.js.map +1 -1
- package/dist/editor/reviews/Reviews.js +5 -5
- package/dist/editor/reviews/Reviews.js.map +1 -1
- package/dist/editor/reviews/SuggestedEdit.js +2 -2
- package/dist/editor/reviews/SuggestedEdit.js.map +1 -1
- package/dist/editor/sidebar/ComponentPalette.js +2 -1
- package/dist/editor/sidebar/ComponentPalette.js.map +1 -1
- package/dist/editor/sidebar/ComponentTree.js +14 -13
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/sidebar/Validation.js +2 -2
- package/dist/editor/sidebar/Validation.js.map +1 -1
- package/dist/editor/sidebar/Workbox.js.map +1 -1
- package/dist/editor/ui/Spinner.js +13 -1
- package/dist/editor/ui/Spinner.js.map +1 -1
- package/dist/page-wizard/startPageWizardCommand.js +1 -1
- package/dist/page-wizard/startPageWizardCommand.js.map +1 -1
- package/dist/page-wizard/steps/Components.js +2 -1
- package/dist/page-wizard/steps/Components.js.map +1 -1
- package/dist/page-wizard/steps/FieldEditor.js +2 -2
- package/dist/page-wizard/steps/FieldEditor.js.map +1 -1
- package/dist/page-wizard/steps/LayoutStep.js +2 -1
- package/dist/page-wizard/steps/LayoutStep.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/splash-screen/NewPage.js +2 -2
- package/dist/splash-screen/NewPage.js.map +1 -1
- package/dist/splash-screen/OpenPage.js +2 -2
- package/dist/splash-screen/OpenPage.js.map +1 -1
- package/dist/splash-screen/RecentPages.js +2 -1
- package/dist/splash-screen/RecentPages.js.map +1 -1
- package/dist/splash-screen/SplashScreen.js +1 -1
- package/dist/splash-screen/SplashScreen.js.map +1 -1
- package/dist/styles.css +0 -20
- package/dist/tour/default-tour.js +9 -8
- package/dist/tour/default-tour.js.map +1 -1
- package/dist/tour/preview-tour.js +7 -6
- package/dist/tour/preview-tour.js.map +1 -1
- package/package.json +2 -4
- package/src/config/config.tsx +42 -60
- package/src/editor/ContextMenu.tsx +17 -8
- package/src/editor/EditorWarning.tsx +2 -1
- package/src/editor/FieldListField.tsx +2 -1
- package/src/editor/FieldListFieldWithFallbacks.tsx +2 -1
- package/src/editor/FloatingToolbar.tsx +11 -13
- package/src/editor/ImageEditButton.tsx +3 -3
- package/src/editor/ImageEditor.tsx +14 -2
- package/src/editor/PictureEditor.tsx +40 -50
- package/src/editor/PictureEditorDialog.tsx +3 -2
- package/src/editor/PublishDialog.ignore +1 -2
- package/src/editor/ai/DancingDots.tsx +10 -5
- package/src/editor/client/AboutDialog.tsx +7 -2
- package/src/editor/client/EditorShell.tsx +0 -2
- package/src/editor/commands/createVersionCommand.ts +1 -1
- package/src/editor/commands/deleteVersionCommand.ts +1 -1
- package/src/editor/commands/undo.ts +2 -2
- package/src/editor/control-center/Status.tsx +2 -1
- package/src/editor/control-center/WebSocketMessages.tsx +7 -4
- package/src/editor/field-types/TreeListEditor.tsx +5 -3
- package/src/editor/media-selector/AiImageSearch.tsx +0 -1
- package/src/editor/media-selector/UploadZone.tsx +2 -1
- package/src/editor/menubar/ActiveUsers.tsx +3 -8
- package/src/editor/menubar/NavButtons.tsx +3 -2
- package/src/editor/page-editor-chrome/PlaceholderDropZone.tsx +1 -1
- package/src/editor/pageModel.ts +2 -1
- package/src/editor/reviews/PreviewInfo.tsx +7 -8
- package/src/editor/reviews/Reviews.tsx +5 -5
- package/src/editor/reviews/SuggestedEdit.tsx +4 -3
- package/src/editor/sidebar/ComponentPalette.tsx +4 -4
- package/src/editor/sidebar/ComponentTree.tsx +26 -12
- package/src/editor/sidebar/Validation.tsx +2 -2
- package/src/editor/sidebar/Workbox.tsx +3 -3
- package/src/editor/ui/Spinner.tsx +17 -3
- package/src/page-wizard/startPageWizardCommand.ts +1 -1
- package/src/page-wizard/steps/Components.tsx +2 -1
- package/src/page-wizard/steps/FieldEditor.tsx +5 -8
- package/src/page-wizard/steps/LayoutStep.tsx +2 -1
- package/src/revision.ts +2 -2
- package/src/splash-screen/NewPage.tsx +2 -2
- package/src/splash-screen/OpenPage.tsx +2 -2
- package/src/splash-screen/RecentPages.tsx +3 -2
- package/src/splash-screen/SplashScreen.tsx +4 -4
- package/src/tour/default-tour.tsx +9 -8
- package/src/tour/preview-tour.tsx +7 -6
- package/dist/editor/Terminal.d.ts +0 -24
- package/dist/editor/Terminal.js +0 -158
- package/dist/editor/Terminal.js.map +0 -1
- package/src/editor/Terminal.tsx +0 -286
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode, useCallback, useEffect, useState } from "react";
|
|
2
|
+
import { ArrowDownLeft, ChevronDown } from "lucide-react";
|
|
2
3
|
|
|
3
4
|
export default function FloatingToolbar({
|
|
4
5
|
children,
|
|
@@ -32,7 +33,7 @@ export default function FloatingToolbar({
|
|
|
32
33
|
y: e.clientY - position.y,
|
|
33
34
|
});
|
|
34
35
|
},
|
|
35
|
-
[position]
|
|
36
|
+
[position],
|
|
36
37
|
);
|
|
37
38
|
|
|
38
39
|
const handleMouseMove = useCallback(
|
|
@@ -45,7 +46,7 @@ export default function FloatingToolbar({
|
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
48
|
},
|
|
48
|
-
[dragging, offset]
|
|
49
|
+
[dragging, offset],
|
|
49
50
|
);
|
|
50
51
|
|
|
51
52
|
const handleMouseUp = useCallback(() => {
|
|
@@ -77,7 +78,7 @@ export default function FloatingToolbar({
|
|
|
77
78
|
});
|
|
78
79
|
}
|
|
79
80
|
},
|
|
80
|
-
[resizing, offset, size]
|
|
81
|
+
[resizing, offset, size],
|
|
81
82
|
);
|
|
82
83
|
|
|
83
84
|
const handleResizeMouseUp = useCallback(() => {
|
|
@@ -112,7 +113,7 @@ export default function FloatingToolbar({
|
|
|
112
113
|
|
|
113
114
|
return (
|
|
114
115
|
<div
|
|
115
|
-
className="border border-gray-200 drop-shadow
|
|
116
|
+
className="z-10 flex flex-col border border-gray-200 drop-shadow"
|
|
116
117
|
onMouseMove={handleMouseMove}
|
|
117
118
|
onMouseUp={handleMouseUp}
|
|
118
119
|
style={{
|
|
@@ -124,7 +125,7 @@ export default function FloatingToolbar({
|
|
|
124
125
|
}}
|
|
125
126
|
>
|
|
126
127
|
<div
|
|
127
|
-
className="
|
|
128
|
+
className="items-between flex w-full justify-between bg-gray-100 p-2 text-sm"
|
|
128
129
|
style={{ cursor: "move", userSelect: "none" }}
|
|
129
130
|
onMouseDown={handleMouseDown}
|
|
130
131
|
>
|
|
@@ -132,31 +133,28 @@ export default function FloatingToolbar({
|
|
|
132
133
|
<div className="flex gap-2">
|
|
133
134
|
{hidden && (
|
|
134
135
|
<div
|
|
135
|
-
className="
|
|
136
|
+
className="cusor-pointer h-4 w-4 border-2 border-gray-800"
|
|
136
137
|
onClick={() => setHidden(false)}
|
|
137
138
|
></div>
|
|
138
139
|
)}
|
|
139
140
|
{!hidden && (
|
|
140
141
|
<div
|
|
141
|
-
className="border-b-2 border-gray-800
|
|
142
|
+
className="cusor-pointer h-4 w-4 border-b-2 border-gray-800"
|
|
142
143
|
onClick={() => setHidden(true)}
|
|
143
144
|
></div>
|
|
144
145
|
)}
|
|
145
146
|
{onPin && (
|
|
146
|
-
<
|
|
147
|
-
className="pi pi-arrow-down-left cursor-pointer"
|
|
148
|
-
onClick={onPin}
|
|
149
|
-
></i>
|
|
147
|
+
<ArrowDownLeft className="h-4 w-4 cursor-pointer" onClick={onPin} />
|
|
150
148
|
)}
|
|
151
149
|
</div>
|
|
152
150
|
</div>
|
|
153
151
|
<div className="flex-1">{!hidden && children}</div>
|
|
154
152
|
<div className="h-4 bg-gray-100"></div>
|
|
155
153
|
<div
|
|
156
|
-
className="
|
|
154
|
+
className="absolute -right-2 -bottom-1 h-4 w-4 cursor-nwse-resize text-gray-500"
|
|
157
155
|
onMouseDown={handleResizeMouseDown}
|
|
158
156
|
>
|
|
159
|
-
<
|
|
157
|
+
<ChevronDown className="h-4 w-4 -rotate-45" />
|
|
160
158
|
</div>
|
|
161
159
|
</div>
|
|
162
160
|
);
|
|
@@ -11,7 +11,7 @@ import { ImagePlus } from "lucide-react";
|
|
|
11
11
|
export interface MenuAction {
|
|
12
12
|
id: string;
|
|
13
13
|
label: string;
|
|
14
|
-
icon:
|
|
14
|
+
icon: React.ReactNode;
|
|
15
15
|
onClick: (e?: React.MouseEvent) => void;
|
|
16
16
|
parameters?: any[];
|
|
17
17
|
}
|
|
@@ -39,7 +39,7 @@ export function ImageEditButton({
|
|
|
39
39
|
triggerButton,
|
|
40
40
|
|
|
41
41
|
buttonText = "Edit",
|
|
42
|
-
buttonIcon = "
|
|
42
|
+
buttonIcon = "MoreVertical",
|
|
43
43
|
testId = "menu-toggle-button",
|
|
44
44
|
buttonClassName,
|
|
45
45
|
defaultActionId = "select",
|
|
@@ -99,7 +99,7 @@ export function ImageEditButton({
|
|
|
99
99
|
setShowMenu(false);
|
|
100
100
|
}}
|
|
101
101
|
>
|
|
102
|
-
|
|
102
|
+
{action.icon}
|
|
103
103
|
{action.label}
|
|
104
104
|
</DropdownMenuItem>
|
|
105
105
|
))}
|
|
@@ -4,6 +4,7 @@ import { ImageField } from "./fieldTypes";
|
|
|
4
4
|
//import { useDialog } from "./client/DialogContext";
|
|
5
5
|
import { ClientFieldButton } from "../config/types";
|
|
6
6
|
import { ImageEditButton, MenuAction } from "./ImageEditButton";
|
|
7
|
+
import { Zap, Image as ImageIcon } from "lucide-react";
|
|
7
8
|
|
|
8
9
|
export function ImageEditor({
|
|
9
10
|
field,
|
|
@@ -55,19 +56,30 @@ export function ImageEditor({
|
|
|
55
56
|
return field.value.alt;
|
|
56
57
|
};
|
|
57
58
|
|
|
59
|
+
// Helper function to render icon
|
|
60
|
+
const renderIcon = (icon: any) => {
|
|
61
|
+
if (!icon) {
|
|
62
|
+
return <Zap strokeWidth={1} size={16} />;
|
|
63
|
+
}
|
|
64
|
+
if (typeof icon === "string") {
|
|
65
|
+
return <img src={icon} alt="" className="h-4 w-4" />;
|
|
66
|
+
}
|
|
67
|
+
return icon;
|
|
68
|
+
};
|
|
69
|
+
|
|
58
70
|
// Build actions for the dropdown menu
|
|
59
71
|
const menuActions: MenuAction[] = [
|
|
60
72
|
{
|
|
61
73
|
id: "select",
|
|
62
74
|
label: getImageSrc() ? "Change Image" : "Select Image",
|
|
63
|
-
icon:
|
|
75
|
+
icon: <ImageIcon strokeWidth={1} size={16} />,
|
|
64
76
|
onClick: () => selectMedia(),
|
|
65
77
|
},
|
|
66
78
|
...(editContext?.configuration?.fieldTypes["image"]?.buttons?.map(
|
|
67
79
|
(button: ClientFieldButton) => ({
|
|
68
80
|
id: button.id,
|
|
69
81
|
label: button.label,
|
|
70
|
-
icon: button.icon
|
|
82
|
+
icon: renderIcon(button.icon),
|
|
71
83
|
onClick: () => {
|
|
72
84
|
button?.clientAction?.({
|
|
73
85
|
field,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./FieldActionsOverlay";
|
|
11
11
|
import { ImageEditButton, MenuAction } from "./ImageEditButton";
|
|
12
12
|
import { MagicEditImageIcon } from "./ui/Icons";
|
|
13
|
-
import { ImagePlus, ExternalLink } from "lucide-react";
|
|
13
|
+
import { ImagePlus, ExternalLink, Settings, Zap } from "lucide-react";
|
|
14
14
|
|
|
15
15
|
export function PictureEditor({
|
|
16
16
|
field,
|
|
@@ -118,17 +118,28 @@ export function PictureEditor({
|
|
|
118
118
|
return true; // Show by default if no visible function
|
|
119
119
|
});
|
|
120
120
|
|
|
121
|
+
// Helper function to render icon
|
|
122
|
+
const renderIcon = (icon: any, isGenerator?: boolean) => {
|
|
123
|
+
if (!icon) {
|
|
124
|
+
return isGenerator ? (
|
|
125
|
+
<Settings strokeWidth={1} size={16} />
|
|
126
|
+
) : (
|
|
127
|
+
<Zap strokeWidth={1} size={16} />
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
if (typeof icon === "string") {
|
|
131
|
+
return <img src={icon} alt="" className="h-4 w-4" />;
|
|
132
|
+
}
|
|
133
|
+
return icon;
|
|
134
|
+
};
|
|
135
|
+
|
|
121
136
|
// Separate primary actions (outside menu) and menu actions
|
|
122
|
-
const primaryActions = visibleVariantButtons
|
|
137
|
+
const primaryActions: MenuAction[] = visibleVariantButtons
|
|
123
138
|
.filter((button) => (button as any).showInMenu === false)
|
|
124
139
|
.map((button) => ({
|
|
125
140
|
id: button.id,
|
|
126
141
|
label: button.label,
|
|
127
|
-
icon: button.isGenerator
|
|
128
|
-
? "pi pi-cog"
|
|
129
|
-
: button.icon && button.icon.trim() !== ""
|
|
130
|
-
? button.icon
|
|
131
|
-
: "pi pi-bolt",
|
|
142
|
+
icon: renderIcon(button.icon, button.isGenerator),
|
|
132
143
|
onClick: (e?: React.MouseEvent) => {
|
|
133
144
|
const clientButton = button as any;
|
|
134
145
|
// Handle component actions (like crop)
|
|
@@ -136,7 +147,7 @@ export function PictureEditor({
|
|
|
136
147
|
setShowCropper(true);
|
|
137
148
|
return;
|
|
138
149
|
}
|
|
139
|
-
|
|
150
|
+
|
|
140
151
|
if (button.parameters && button.parameters.length > 0) {
|
|
141
152
|
fieldActionsOverlay.current?.show(e, button);
|
|
142
153
|
} else {
|
|
@@ -154,11 +165,7 @@ export function PictureEditor({
|
|
|
154
165
|
.map((button) => ({
|
|
155
166
|
id: button.id,
|
|
156
167
|
label: button.label,
|
|
157
|
-
icon: button.isGenerator
|
|
158
|
-
? "pi pi-cog"
|
|
159
|
-
: button.icon && button.icon.trim() !== ""
|
|
160
|
-
? button.icon
|
|
161
|
-
: "pi pi-bolt",
|
|
168
|
+
icon: renderIcon(button.icon, button.isGenerator),
|
|
162
169
|
onClick: (e?: React.MouseEvent) => {
|
|
163
170
|
const clientButton = button as any;
|
|
164
171
|
// Handle component actions (like crop)
|
|
@@ -166,7 +173,7 @@ export function PictureEditor({
|
|
|
166
173
|
setShowCropper(true);
|
|
167
174
|
return;
|
|
168
175
|
}
|
|
169
|
-
|
|
176
|
+
|
|
170
177
|
if (button.parameters && button.parameters.length > 0) {
|
|
171
178
|
fieldActionsOverlay.current?.show(e, button);
|
|
172
179
|
} else {
|
|
@@ -179,11 +186,7 @@ export function PictureEditor({
|
|
|
179
186
|
...fieldButtons.map((button) => ({
|
|
180
187
|
id: button.id,
|
|
181
188
|
label: button.label,
|
|
182
|
-
icon: button.isGenerator
|
|
183
|
-
? "pi pi-cog"
|
|
184
|
-
: button.icon && button.icon.trim() !== ""
|
|
185
|
-
? button.icon
|
|
186
|
-
: "pi pi-bolt",
|
|
189
|
+
icon: renderIcon(button.icon, button.isGenerator),
|
|
187
190
|
onClick: (e?: React.MouseEvent) => {
|
|
188
191
|
if (button.parameters && button.parameters.length > 0) {
|
|
189
192
|
fieldActionsOverlay.current?.show(e, button);
|
|
@@ -233,44 +236,31 @@ export function PictureEditor({
|
|
|
233
236
|
}}
|
|
234
237
|
>
|
|
235
238
|
{/* Primary action buttons */}
|
|
236
|
-
{primaryActions.map((action, index) =>
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
239
|
+
{primaryActions.map((action, index) => (
|
|
240
|
+
<button
|
|
241
|
+
key={action.id}
|
|
242
|
+
type="button"
|
|
243
|
+
className={`hover:bg-gray-5 cursor-pointer px-2 py-1.5 ${index > 0 ? "border-gray-3 border-l" : ""}`}
|
|
244
|
+
onClick={(e) => {
|
|
245
|
+
e.stopPropagation();
|
|
246
|
+
action.onClick(e);
|
|
247
|
+
}}
|
|
248
|
+
data-testid={`primary-action-${action.id}`}
|
|
249
|
+
>
|
|
250
|
+
{action.icon}
|
|
251
|
+
</button>
|
|
252
|
+
))}
|
|
247
253
|
|
|
248
|
-
return (
|
|
249
|
-
<button
|
|
250
|
-
key={action.id}
|
|
251
|
-
type="button"
|
|
252
|
-
className={`hover:bg-gray-5 cursor-pointer px-2 py-1.5 ${index > 0 ? 'border-l border-gray-3' : ''}`}
|
|
253
|
-
onClick={(e) => {
|
|
254
|
-
e.stopPropagation();
|
|
255
|
-
action.onClick(e);
|
|
256
|
-
}}
|
|
257
|
-
data-testid={`primary-action-${action.id}`}
|
|
258
|
-
>
|
|
259
|
-
{renderIcon()}
|
|
260
|
-
</button>
|
|
261
|
-
);
|
|
262
|
-
})}
|
|
263
|
-
|
|
264
254
|
{/* Menu dropdown button */}
|
|
265
255
|
{menuActions.length > 0 && (
|
|
266
|
-
<ImageEditButton
|
|
267
|
-
actions={menuActions}
|
|
268
|
-
compact={true}
|
|
256
|
+
<ImageEditButton
|
|
257
|
+
actions={menuActions}
|
|
258
|
+
compact={true}
|
|
269
259
|
defaultActionId="select"
|
|
270
260
|
triggerButton={
|
|
271
261
|
<button
|
|
272
262
|
type="button"
|
|
273
|
-
className={`hover:bg-gray-5 flex cursor-pointer items-center gap-2 px-2 py-1.5 ${primaryActions.length > 0 ?
|
|
263
|
+
className={`hover:bg-gray-5 flex cursor-pointer items-center gap-2 px-2 py-1.5 ${primaryActions.length > 0 ? "border-gray-3 border-l" : ""}`}
|
|
274
264
|
data-testid="menu-toggle-button"
|
|
275
265
|
>
|
|
276
266
|
<MagicEditImageIcon className="mr-1" /> Edit
|
|
@@ -10,6 +10,7 @@ import { useEditContext } from "./client/editContext";
|
|
|
10
10
|
import { useCallback, useEffect, useState } from "react";
|
|
11
11
|
import { Button } from "../components/ui/button";
|
|
12
12
|
import DialogButtons from "./ui/DialogButtons";
|
|
13
|
+
import { AlertTriangle, Pencil } from "lucide-react";
|
|
13
14
|
|
|
14
15
|
import { getPictureValue } from "./services/editService";
|
|
15
16
|
import {
|
|
@@ -231,7 +232,7 @@ export function PictureEditorDialog({
|
|
|
231
232
|
{(variant.width < 1 || variant.height < 1) && (
|
|
232
233
|
<span>
|
|
233
234
|
{" "}
|
|
234
|
-
<
|
|
235
|
+
<AlertTriangle className="inline h-4 w-4 text-red-600" />
|
|
235
236
|
</span>
|
|
236
237
|
)}
|
|
237
238
|
</div>
|
|
@@ -307,7 +308,7 @@ export function PictureEditorDialog({
|
|
|
307
308
|
className="bg-opacity-70 absolute top-0 right-0 flex cursor-pointer flex-col items-center gap-1 bg-gray-100 p-2 text-sm"
|
|
308
309
|
onClick={() => selectMedia()}
|
|
309
310
|
>
|
|
310
|
-
<
|
|
311
|
+
<Pencil className="h-5 w-5" />
|
|
311
312
|
Choose
|
|
312
313
|
</div>
|
|
313
314
|
)}
|
|
@@ -3,11 +3,16 @@ import React from "react";
|
|
|
3
3
|
// Dancing dots component for streaming indicator
|
|
4
4
|
export function DancingDots() {
|
|
5
5
|
return (
|
|
6
|
-
<div className="sticky right-0 bottom-
|
|
7
|
-
<div className="flex
|
|
8
|
-
<div className="
|
|
9
|
-
<div className="
|
|
10
|
-
|
|
6
|
+
<div className="sticky right-0 bottom-2 left-0 z-10 bg-white/80 px-4 pb-4">
|
|
7
|
+
<div className="flex gap-3">
|
|
8
|
+
<div className="w-6 flex-shrink-0"></div>
|
|
9
|
+
<div className="min-w-0 flex-1">
|
|
10
|
+
<div className="flex items-center gap-1">
|
|
11
|
+
<div className="h-1 w-1 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.3s]"></div>
|
|
12
|
+
<div className="h-1 w-1 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.15s]"></div>
|
|
13
|
+
<div className="h-1 w-1 animate-bounce rounded-full bg-gray-400"></div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
11
16
|
</div>
|
|
12
17
|
</div>
|
|
13
18
|
);
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Dialog,
|
|
3
|
+
DialogContent,
|
|
4
|
+
DialogHeader,
|
|
5
|
+
DialogTitle,
|
|
6
|
+
} from "../../components/ui/dialog";
|
|
2
7
|
import { DialogProps } from "./editContext";
|
|
3
8
|
import { useImperativeHandle, useState, forwardRef, useEffect } from "react";
|
|
4
9
|
import { buildDate, version } from "../../revision";
|
|
@@ -30,7 +35,7 @@ export const AboutDialog = forwardRef<DialogProps<void>, DialogProps<void>>(
|
|
|
30
35
|
>
|
|
31
36
|
<DialogContent style={{ width: 400 }}>
|
|
32
37
|
<DialogHeader>
|
|
33
|
-
<DialogTitle>About
|
|
38
|
+
<DialogTitle>About parhelia</DialogTitle>
|
|
34
39
|
</DialogHeader>
|
|
35
40
|
<div className="flex flex-col gap-4 p-2">
|
|
36
41
|
<div className="bg-wizard-demo mt-3 aspect-[1.75] w-full rounded-lg"></div>
|
|
@@ -44,8 +44,6 @@ import {
|
|
|
44
44
|
import { useEditorWebSocket } from "./hooks/useEditorWebSocket";
|
|
45
45
|
import { useSocketMessageHandler } from "./hooks/useSocketMessageHandler";
|
|
46
46
|
|
|
47
|
-
import "primeicons/primeicons.css";
|
|
48
|
-
import "primereact/resources/themes/md-light-indigo/theme.css";
|
|
49
47
|
import "react-json-view-lite/dist/index.css";
|
|
50
48
|
import {
|
|
51
49
|
MediaSelector,
|
|
@@ -11,7 +11,7 @@ export function getCreateAndSwitchToNewVersionCommand({
|
|
|
11
11
|
id: "createAndSwitchToNewVersion",
|
|
12
12
|
execute: (context) => execute(context, language),
|
|
13
13
|
label: "Add Version",
|
|
14
|
-
icon: "
|
|
14
|
+
icon: "Plus",
|
|
15
15
|
disabled: (context: CommandContext<any>) =>
|
|
16
16
|
!context.editContext.item?.canLock,
|
|
17
17
|
};
|
|
@@ -9,7 +9,7 @@ export function getDeleteVersionCommand({}: {
|
|
|
9
9
|
id: "deleteVersion",
|
|
10
10
|
execute: (context) => execute(context),
|
|
11
11
|
label: "Delete Version",
|
|
12
|
-
icon: "
|
|
12
|
+
icon: "X",
|
|
13
13
|
disabled: (context: CommandContext<any>) =>
|
|
14
14
|
!context.editContext.item?.canLock ||
|
|
15
15
|
context.editContext.item.version === 0 ||
|
|
@@ -4,7 +4,7 @@ export function getUndoCommand() {
|
|
|
4
4
|
return {
|
|
5
5
|
id: "undo",
|
|
6
6
|
label: "Undo",
|
|
7
|
-
icon: "
|
|
7
|
+
icon: "Undo",
|
|
8
8
|
execute: async (context: CommandContext<any>) => {
|
|
9
9
|
context.editContext.operations.undo();
|
|
10
10
|
},
|
|
@@ -23,7 +23,7 @@ export function getRedoCommand() {
|
|
|
23
23
|
return {
|
|
24
24
|
id: "redo",
|
|
25
25
|
label: "Redo",
|
|
26
|
-
icon: "
|
|
26
|
+
icon: "RotateCw",
|
|
27
27
|
execute: async (context: CommandContext<any>) => {
|
|
28
28
|
context.editContext.operations.redo();
|
|
29
29
|
},
|
|
@@ -4,6 +4,7 @@ import { usePathname, useSearchParams } from "next/navigation";
|
|
|
4
4
|
import { useEditContext } from "../client/editContext";
|
|
5
5
|
import { SimpleMenu } from "../ui/SimpleMenu";
|
|
6
6
|
import { Splitter, SplitterPanel } from "../ui/Splitter";
|
|
7
|
+
import { Info } from "lucide-react";
|
|
7
8
|
|
|
8
9
|
export function Status() {
|
|
9
10
|
const editContext = useEditContext();
|
|
@@ -103,7 +104,7 @@ export function Status() {
|
|
|
103
104
|
selectedPanel.content
|
|
104
105
|
) : (
|
|
105
106
|
<div className="flex h-full flex-col items-center justify-center text-gray-500">
|
|
106
|
-
<
|
|
107
|
+
<Info className="mb-4 h-10 w-10" />
|
|
107
108
|
<p>Select a panel from the menu to view its content</p>
|
|
108
109
|
</div>
|
|
109
110
|
)}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState, useEffect, useRef } from "react";
|
|
2
2
|
import { formatTime } from "../utils";
|
|
3
3
|
import { useEditContext } from "../client/editContext";
|
|
4
|
+
import { MessageSquare, ChevronUp, ChevronDown } from "lucide-react";
|
|
4
5
|
|
|
5
6
|
export function WebSocketMessages() {
|
|
6
7
|
const editContext = useEditContext();
|
|
@@ -75,7 +76,7 @@ export function WebSocketMessages() {
|
|
|
75
76
|
{/* Header */}
|
|
76
77
|
<div className="flex items-center justify-between border-b border-gray-200 p-4">
|
|
77
78
|
<div className="flex items-center gap-2">
|
|
78
|
-
<
|
|
79
|
+
<MessageSquare className="h-5 w-5" />
|
|
79
80
|
<h3 className="text-lg font-semibold">WebSocket Messages</h3>
|
|
80
81
|
<span className="rounded bg-gray-100 px-2 py-1 text-sm text-gray-800">
|
|
81
82
|
{messages.length}
|
|
@@ -132,9 +133,11 @@ export function WebSocketMessages() {
|
|
|
132
133
|
: String(message.payload)}
|
|
133
134
|
</span>
|
|
134
135
|
</div>
|
|
135
|
-
|
|
136
|
-
className=
|
|
137
|
-
|
|
136
|
+
{expandedMessages.has(message.id) ? (
|
|
137
|
+
<ChevronUp className="h-4 w-4 text-gray-400" />
|
|
138
|
+
) : (
|
|
139
|
+
<ChevronDown className="h-4 w-4 text-gray-400" />
|
|
140
|
+
)}
|
|
138
141
|
</div>
|
|
139
142
|
|
|
140
143
|
{expandedMessages.has(message.id) && (
|
|
@@ -12,7 +12,7 @@ import { SimpleIconButton } from "../ui/SimpleIconButton";
|
|
|
12
12
|
import { normalizeGuid } from "../utils";
|
|
13
13
|
import ItemSearch from "../ui/ItemSearch";
|
|
14
14
|
import { Button } from "../../components/ui/button";
|
|
15
|
-
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
15
|
+
import { ChevronLeft, ChevronRight, ExternalLink } from "lucide-react";
|
|
16
16
|
import {
|
|
17
17
|
Tooltip,
|
|
18
18
|
TooltipContent,
|
|
@@ -118,7 +118,9 @@ export default function TreeListEditor({
|
|
|
118
118
|
|
|
119
119
|
// Clear pending items that are now present on the server (compare by normalized id)
|
|
120
120
|
let pendingChanged = false;
|
|
121
|
-
const nextPending: Record<string, ReferencedItem> = {
|
|
121
|
+
const nextPending: Record<string, ReferencedItem> = {
|
|
122
|
+
...pendingAddedItems,
|
|
123
|
+
};
|
|
122
124
|
for (const key of Object.keys(nextPending)) {
|
|
123
125
|
if (serverIdsNormalized.has(key)) {
|
|
124
126
|
delete nextPending[key];
|
|
@@ -426,7 +428,7 @@ export default function TreeListEditor({
|
|
|
426
428
|
}}
|
|
427
429
|
title="Open"
|
|
428
430
|
>
|
|
429
|
-
<
|
|
431
|
+
<ExternalLink className="h-3.5 w-3.5 text-gray-500" />
|
|
430
432
|
</button>
|
|
431
433
|
)}
|
|
432
434
|
</div>
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
// import { Input } from "../../components/ui/input";
|
|
10
10
|
// import { Thumbnail } from "../services/contentService";
|
|
11
11
|
// import { Thumbnails } from "./Thumbnails";
|
|
12
|
-
// import { Splitter, SplitterPanel } from "primereact/splitter";
|
|
13
12
|
// import { Preview } from "./Preview";
|
|
14
13
|
// import DialogButtons from "../ui/DialogButtons";
|
|
15
14
|
// import { Button } from "../../components/ui/button";
|
|
@@ -3,6 +3,7 @@ import { useCallback, useRef } from "react";
|
|
|
3
3
|
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { Spinner } from "../ui/Spinner";
|
|
6
|
+
import { Upload } from "lucide-react";
|
|
6
7
|
|
|
7
8
|
export function UploadZone({
|
|
8
9
|
selectedFolderId,
|
|
@@ -122,7 +123,7 @@ export function UploadZone({
|
|
|
122
123
|
}}
|
|
123
124
|
>
|
|
124
125
|
<div className="flex cursor-pointer items-center gap-2">
|
|
125
|
-
<
|
|
126
|
+
<Upload className="h-5 w-5" />
|
|
126
127
|
<span className="text-sm">
|
|
127
128
|
{isDragging
|
|
128
129
|
? "Drop files here"
|
|
@@ -10,6 +10,7 @@ import { getItemVisitors, ItemVisitor } from "../services/editService";
|
|
|
10
10
|
import { VerticalDotsIcon } from "../ui/Icons";
|
|
11
11
|
import { AboutDialog } from "../client/AboutDialog";
|
|
12
12
|
import { formatDateOnly } from "../utils";
|
|
13
|
+
import { Info, LogOut } from "lucide-react";
|
|
13
14
|
|
|
14
15
|
type UserListItem = {
|
|
15
16
|
type: "active" | "visitor";
|
|
@@ -253,10 +254,7 @@ export function ActiveUsers() {
|
|
|
253
254
|
onClick={handleAbout}
|
|
254
255
|
>
|
|
255
256
|
<div className="flex h-8 w-8 items-center justify-center">
|
|
256
|
-
<
|
|
257
|
-
className="pi pi-info-circle text-gray-600"
|
|
258
|
-
style={{ fontSize: "1rem" }}
|
|
259
|
-
/>
|
|
257
|
+
<Info className="h-4 w-4 text-gray-600" />
|
|
260
258
|
</div>
|
|
261
259
|
<div className="min-w-0 flex-1">
|
|
262
260
|
<div className="text-dark text-xs font-medium">About</div>
|
|
@@ -267,10 +265,7 @@ export function ActiveUsers() {
|
|
|
267
265
|
onClick={handleLogout}
|
|
268
266
|
>
|
|
269
267
|
<div className="flex h-8 w-8 items-center justify-center">
|
|
270
|
-
<
|
|
271
|
-
className="pi pi-sign-out text-gray-600"
|
|
272
|
-
style={{ fontSize: "1rem" }}
|
|
273
|
-
/>
|
|
268
|
+
<LogOut className="h-4 w-4 text-gray-600" />
|
|
274
269
|
</div>
|
|
275
270
|
<div className="min-w-0 flex-1">
|
|
276
271
|
<div className="text-dark text-xs font-medium">Log Out</div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useEditContext } from "../client/editContext";
|
|
2
2
|
import { cn } from "../../lib/utils";
|
|
3
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
3
4
|
|
|
4
5
|
export function NavButtons() {
|
|
5
6
|
const editContext = useEditContext();
|
|
@@ -39,7 +40,7 @@ export function NavButtons() {
|
|
|
39
40
|
}
|
|
40
41
|
}}
|
|
41
42
|
>
|
|
42
|
-
<
|
|
43
|
+
<ChevronLeft className="h-4 w-4" />
|
|
43
44
|
</div>
|
|
44
45
|
<div
|
|
45
46
|
key="nav-back"
|
|
@@ -65,7 +66,7 @@ export function NavButtons() {
|
|
|
65
66
|
}
|
|
66
67
|
}}
|
|
67
68
|
>
|
|
68
|
-
<
|
|
69
|
+
<ChevronRight className="h-4 w-4" />
|
|
69
70
|
</div>
|
|
70
71
|
</>
|
|
71
72
|
);
|
package/src/editor/pageModel.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { InsertOption } from "../types";
|
|
2
3
|
|
|
3
4
|
export type PageSkeleton = {
|
|
@@ -95,7 +96,7 @@ export type FieldButton = {
|
|
|
95
96
|
label: string;
|
|
96
97
|
description: string;
|
|
97
98
|
action?: string;
|
|
98
|
-
icon?:
|
|
99
|
+
icon?: React.ReactNode;
|
|
99
100
|
isGenerator: boolean;
|
|
100
101
|
parameters?: FieldButtonParameter[];
|
|
101
102
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useEditContext } from "../../client-components";
|
|
2
2
|
import { formatDate } from "../utils";
|
|
3
|
+
import { Check, X } from "lucide-react";
|
|
3
4
|
|
|
4
5
|
export function PreviewInfo() {
|
|
5
6
|
const editContext = useEditContext();
|
|
@@ -19,16 +20,14 @@ export function PreviewInfo() {
|
|
|
19
20
|
</div>
|
|
20
21
|
</div>
|
|
21
22
|
{review?.approvalDate && (
|
|
22
|
-
<
|
|
23
|
-
className="
|
|
24
|
-
|
|
25
|
-
></i>
|
|
23
|
+
<span title={"Approved " + formatDate(new Date(review.approvalDate))}>
|
|
24
|
+
<Check className="h-6 w-6 font-bold text-green-400" />
|
|
25
|
+
</span>
|
|
26
26
|
)}
|
|
27
27
|
{review?.rejectedDate && (
|
|
28
|
-
<
|
|
29
|
-
className="
|
|
30
|
-
|
|
31
|
-
></i>
|
|
28
|
+
<span title={"Rejected " + formatDate(new Date(review.rejectedDate))}>
|
|
29
|
+
<X className="h-6 w-6 font-bold text-red-400" />
|
|
30
|
+
</span>
|
|
32
31
|
)}
|
|
33
32
|
</div>
|
|
34
33
|
);
|