@alpaca-editor/core 1.0.4170 → 1.0.4173
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/agents-view/AgentsView.d.ts +5 -0
- package/dist/agents-view/AgentsView.js +213 -0
- package/dist/agents-view/AgentsView.js.map +1 -0
- package/dist/components/ui/context-menu.js +51 -7
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/config/config.d.ts +1 -2
- package/dist/config/config.js +103 -8
- package/dist/config/config.js.map +1 -1
- package/dist/config/types.d.ts +1 -1
- package/dist/editor/ConfirmationDialog.js +2 -1
- package/dist/editor/ConfirmationDialog.js.map +1 -1
- package/dist/editor/ContentTree.d.ts +2 -1
- package/dist/editor/ContentTree.js +18 -3
- package/dist/editor/ContentTree.js.map +1 -1
- package/dist/editor/ContextMenu.js +1 -1
- package/dist/editor/ContextMenu.js.map +1 -1
- package/dist/editor/FieldList.js +7 -3
- package/dist/editor/FieldList.js.map +1 -1
- package/dist/editor/FieldListField.d.ts +3 -2
- package/dist/editor/FieldListField.js +4 -4
- package/dist/editor/FieldListField.js.map +1 -1
- package/dist/editor/FieldListFieldWithFallbacks.d.ts +2 -1
- package/dist/editor/FieldListFieldWithFallbacks.js +5 -2
- package/dist/editor/FieldListFieldWithFallbacks.js.map +1 -1
- package/dist/editor/ItemInfo.js +8 -2
- package/dist/editor/ItemInfo.js.map +1 -1
- package/dist/editor/MainLayout.js +1 -1
- package/dist/editor/PictureEditor.js +2 -4
- package/dist/editor/PictureEditor.js.map +1 -1
- package/dist/editor/QuickItemSwitcher.d.ts +9 -0
- package/dist/editor/QuickItemSwitcher.js +56 -0
- package/dist/editor/QuickItemSwitcher.js.map +1 -0
- package/dist/editor/ai/AgentCostDisplay.js +4 -4
- package/dist/editor/ai/AgentCostDisplay.js.map +1 -1
- package/dist/editor/ai/AgentProfilesOverview.d.ts +9 -0
- package/dist/editor/ai/AgentProfilesOverview.js +16 -0
- package/dist/editor/ai/AgentProfilesOverview.js.map +1 -0
- package/dist/editor/ai/AgentTerminal.d.ts +2 -1
- package/dist/editor/ai/AgentTerminal.js +1051 -557
- package/dist/editor/ai/AgentTerminal.js.map +1 -1
- package/dist/editor/ai/Agents.js +108 -31
- package/dist/editor/ai/Agents.js.map +1 -1
- package/dist/editor/ai/AiResponseMessage.d.ts +2 -1
- package/dist/editor/ai/AiResponseMessage.js +4 -2
- package/dist/editor/ai/AiResponseMessage.js.map +1 -1
- package/dist/editor/ai/ContextInfoBar.js +17 -17
- package/dist/editor/ai/ToolCallDisplay.js +4 -2
- package/dist/editor/ai/ToolCallDisplay.js.map +1 -1
- package/dist/editor/ai/useAgentStatus.js +21 -9
- package/dist/editor/ai/useAgentStatus.js.map +1 -1
- package/dist/editor/client/EditorShell.js +172 -21
- package/dist/editor/client/EditorShell.js.map +1 -1
- package/dist/editor/client/hooks/useSocketMessageHandler.js +12 -0
- package/dist/editor/client/hooks/useSocketMessageHandler.js.map +1 -1
- package/dist/editor/client/ui/EditorChrome.js +1 -1
- package/dist/editor/client/ui/EditorChrome.js.map +1 -1
- package/dist/editor/commands/itemCommands.d.ts +1 -0
- package/dist/editor/commands/itemCommands.js +53 -1
- package/dist/editor/commands/itemCommands.js.map +1 -1
- package/dist/editor/control-center/WebSocketMessages.js +4 -1
- package/dist/editor/control-center/WebSocketMessages.js.map +1 -1
- package/dist/editor/control-center/parhelia-setup/Overview.d.ts +1 -0
- package/dist/editor/control-center/parhelia-setup/Overview.js +91 -0
- package/dist/editor/control-center/parhelia-setup/Overview.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/tools/GenerateToolsSection.js +4 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/tools/GenerateToolsSection.js.map +1 -1
- package/dist/editor/field-types/AttachmentEditor.d.ts +7 -2
- package/dist/editor/field-types/AttachmentEditor.js +71 -3
- package/dist/editor/field-types/AttachmentEditor.js.map +1 -1
- package/dist/editor/field-types/DropLinkEditor.js +2 -2
- package/dist/editor/field-types/DropLinkEditor.js.map +1 -1
- package/dist/editor/field-types/DropListEditor.js +2 -1
- package/dist/editor/field-types/DropListEditor.js.map +1 -1
- package/dist/editor/field-types/InternalLinkFieldEditor.js +3 -3
- package/dist/editor/field-types/InternalLinkFieldEditor.js.map +1 -1
- package/dist/editor/field-types/MultiLineText.d.ts +2 -1
- package/dist/editor/field-types/MultiLineText.js +2 -2
- package/dist/editor/field-types/MultiLineText.js.map +1 -1
- package/dist/editor/field-types/RawEditor.d.ts +2 -1
- package/dist/editor/field-types/RawEditor.js +2 -2
- package/dist/editor/field-types/RawEditor.js.map +1 -1
- package/dist/editor/field-types/SingleLineText.d.ts +2 -1
- package/dist/editor/field-types/SingleLineText.js +2 -2
- package/dist/editor/field-types/SingleLineText.js.map +1 -1
- package/dist/editor/field-types/TreeListEditor.js +9 -7
- package/dist/editor/field-types/TreeListEditor.js.map +1 -1
- package/dist/editor/fieldTypes.d.ts +4 -0
- package/dist/editor/media-selector/MediaFolderBrowser.js +68 -7
- package/dist/editor/media-selector/MediaFolderBrowser.js.map +1 -1
- package/dist/editor/media-selector/TreeSelector.js +1 -1
- package/dist/editor/media-selector/TreeSelector.js.map +1 -1
- package/dist/editor/menubar/ActiveUsers.js +2 -2
- package/dist/editor/menubar/FavoritesControls.js +2 -2
- package/dist/editor/menubar/FavoritesControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js +1 -1
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js.map +1 -1
- package/dist/editor/page-editor-chrome/FrameMenu.js +10 -1
- package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +14 -4
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.js +17 -7
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js +14 -0
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js.map +1 -1
- package/dist/editor/services/agentService.d.ts +6 -2
- package/dist/editor/services/agentService.js +13 -2
- package/dist/editor/services/agentService.js.map +1 -1
- package/dist/editor/services/aiService.d.ts +5 -1
- package/dist/editor/services/aiService.js +1 -1
- package/dist/editor/services/aiService.js.map +1 -1
- package/dist/editor/services/contentService.d.ts +1 -1
- package/dist/editor/services/contentService.js +4 -2
- package/dist/editor/services/contentService.js.map +1 -1
- package/dist/editor/services/editService.d.ts +6 -1
- package/dist/editor/services/editService.js +7 -1
- package/dist/editor/services/editService.js.map +1 -1
- package/dist/editor/services/setupService.d.ts +21 -0
- package/dist/editor/services/setupService.js +10 -0
- package/dist/editor/services/setupService.js.map +1 -0
- package/dist/editor/sidebar/ComponentTree.js +15 -1
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/sidebar/SidebarView.js +1 -1
- package/dist/editor/sidebar/SidebarView.js.map +1 -1
- package/dist/editor/ui/ItemSearch.d.ts +1 -0
- package/dist/editor/ui/ItemSearch.js +2 -2
- package/dist/editor/ui/ItemSearch.js.map +1 -1
- package/dist/editor/ui/PerfectTree.d.ts +5 -1
- package/dist/editor/ui/PerfectTree.js +308 -29
- package/dist/editor/ui/PerfectTree.js.map +1 -1
- package/dist/editor/ui/SimpleIconButton.js +1 -1
- package/dist/editor/ui/SimpleIconButton.js.map +1 -1
- package/dist/editor/ui/TemplateSelectorDialog.d.ts +8 -0
- package/dist/editor/ui/TemplateSelectorDialog.js +61 -0
- package/dist/editor/ui/TemplateSelectorDialog.js.map +1 -0
- package/dist/editor/utils/keyboardNavigation.d.ts +2 -0
- package/dist/editor/utils/keyboardNavigation.js +80 -2
- package/dist/editor/utils/keyboardNavigation.js.map +1 -1
- package/dist/editor/views/SingleEditView.js +6 -4
- package/dist/editor/views/SingleEditView.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/splash-screen/SplashScreen.js +78 -4
- package/dist/splash-screen/SplashScreen.js.map +1 -1
- package/dist/styles.css +164 -20
- package/dist/types.d.ts +7 -1
- package/package.json +1 -1
- package/src/agents-view/AgentsView.tsx +431 -0
- package/src/components/ui/context-menu.tsx +62 -7
- package/src/config/config.tsx +112 -7
- package/src/config/types.ts +8 -2
- package/src/editor/ConfirmationDialog.tsx +42 -10
- package/src/editor/ContentTree.tsx +20 -1
- package/src/editor/ContextMenu.tsx +4 -1
- package/src/editor/FieldList.tsx +10 -4
- package/src/editor/FieldListField.tsx +7 -0
- package/src/editor/FieldListFieldWithFallbacks.tsx +10 -0
- package/src/editor/ItemInfo.tsx +15 -1
- package/src/editor/MainLayout.tsx +1 -1
- package/src/editor/PictureEditor.tsx +21 -23
- package/src/editor/QuickItemSwitcher.tsx +190 -0
- package/src/editor/ai/AgentCostDisplay.tsx +28 -6
- package/src/editor/ai/AgentProfilesOverview.tsx +81 -0
- package/src/editor/ai/AgentTerminal.tsx +734 -187
- package/src/editor/ai/Agents.tsx +167 -67
- package/src/editor/ai/AiResponseMessage.tsx +12 -1
- package/src/editor/ai/ContextInfoBar.tsx +17 -17
- package/src/editor/ai/ToolCallDisplay.tsx +2 -5
- package/src/editor/ai/useAgentStatus.ts +24 -9
- package/src/editor/client/EditorShell.tsx +231 -31
- package/src/editor/client/hooks/useSocketMessageHandler.ts +28 -13
- package/src/editor/client/ui/EditorChrome.tsx +1 -1
- package/src/editor/commands/itemCommands.tsx +77 -0
- package/src/editor/control-center/WebSocketMessages.tsx +4 -1
- package/src/editor/control-center/parhelia-setup/Overview.tsx +184 -0
- package/src/editor/control-center/setup-steps/AiSetupStep/tools/GenerateToolsSection.tsx +5 -0
- package/src/editor/field-types/AttachmentEditor.tsx +111 -3
- package/src/editor/field-types/DropLinkEditor.tsx +2 -2
- package/src/editor/field-types/DropListEditor.tsx +2 -1
- package/src/editor/field-types/InternalLinkFieldEditor.tsx +3 -3
- package/src/editor/field-types/MultiLineText.tsx +3 -0
- package/src/editor/field-types/RawEditor.tsx +3 -0
- package/src/editor/field-types/SingleLineText.tsx +3 -0
- package/src/editor/field-types/TreeListEditor.tsx +32 -24
- package/src/editor/fieldTypes.ts +4 -0
- package/src/editor/media-selector/MediaFolderBrowser.tsx +93 -9
- package/src/editor/media-selector/TreeSelector.tsx +1 -0
- package/src/editor/menubar/ActiveUsers.tsx +2 -2
- package/src/editor/menubar/FavoritesControls.tsx +5 -5
- package/src/editor/menubar/toolbar-sections/UtilityControls.tsx +1 -1
- package/src/editor/page-editor-chrome/FrameMenu.tsx +10 -1
- package/src/editor/page-editor-chrome/PlaceholderDropZone.tsx +12 -4
- package/src/editor/page-viewer/PageViewerFrame.tsx +15 -6
- package/src/editor/page-viewer/pageModelSkeletonBuilder.ts +17 -0
- package/src/editor/services/agentService.ts +18 -2
- package/src/editor/services/aiService.ts +6 -2
- package/src/editor/services/contentService.ts +4 -1
- package/src/editor/services/editService.ts +23 -3
- package/src/editor/services/setupService.ts +35 -0
- package/src/editor/sidebar/ComponentTree.tsx +16 -1
- package/src/editor/sidebar/SidebarView.tsx +1 -1
- package/src/editor/ui/ItemSearch.tsx +3 -1
- package/src/editor/ui/PerfectTree.tsx +393 -42
- package/src/editor/ui/SimpleIconButton.tsx +1 -0
- package/src/editor/ui/TemplateSelectorDialog.tsx +129 -0
- package/src/editor/utils/keyboardNavigation.ts +97 -1
- package/src/editor/views/SingleEditView.tsx +27 -13
- package/src/index.ts +3 -3
- package/src/revision.ts +2 -2
- package/src/splash-screen/SplashScreen.tsx +134 -2
- package/src/types.ts +9 -1
|
@@ -23,6 +23,8 @@ export interface KeyboardNavigationDependencies {
|
|
|
23
23
|
data?: any;
|
|
24
24
|
event?: React.SyntheticEvent;
|
|
25
25
|
}) => Promise<any>;
|
|
26
|
+
showQuickSwitcher?: (show: boolean) => void;
|
|
27
|
+
cycleQuickSwitcher?: (direction: "next" | "prev" | "up" | "down") => void;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
export function useKeyboardNavigation(deps: KeyboardNavigationDependencies) {
|
|
@@ -36,6 +38,8 @@ export function useKeyboardNavigation(deps: KeyboardNavigationDependencies) {
|
|
|
36
38
|
loadItem,
|
|
37
39
|
showInfoToast,
|
|
38
40
|
executeCommand,
|
|
41
|
+
showQuickSwitcher,
|
|
42
|
+
cycleQuickSwitcher,
|
|
39
43
|
} = deps;
|
|
40
44
|
|
|
41
45
|
const handleKeyDownDebounced = useDebouncedCallback(
|
|
@@ -169,6 +173,18 @@ export function useKeyboardNavigation(deps: KeyboardNavigationDependencies) {
|
|
|
169
173
|
);
|
|
170
174
|
|
|
171
175
|
if (command) {
|
|
176
|
+
// Check if user is typing in an input field
|
|
177
|
+
const target = event.target as HTMLElement;
|
|
178
|
+
const isTyping =
|
|
179
|
+
target instanceof HTMLInputElement ||
|
|
180
|
+
target instanceof HTMLTextAreaElement ||
|
|
181
|
+
target.isContentEditable;
|
|
182
|
+
|
|
183
|
+
// Don't execute commands when typing in text fields
|
|
184
|
+
// F2 works everywhere except when typing
|
|
185
|
+
// Delete also won't trigger when typing
|
|
186
|
+
if (isTyping) return;
|
|
187
|
+
|
|
172
188
|
event.preventDefault();
|
|
173
189
|
const contentEditorItem = editContextRef.current?.contentEditorItem;
|
|
174
190
|
if (!contentEditorItem) return;
|
|
@@ -211,6 +227,80 @@ export function useKeyboardNavigation(deps: KeyboardNavigationDependencies) {
|
|
|
211
227
|
return;
|
|
212
228
|
}
|
|
213
229
|
|
|
230
|
+
// Check if quick switcher is currently visible
|
|
231
|
+
const isQuickSwitcherVisible = editContextRef.current
|
|
232
|
+
? (editContextRef.current as any).isQuickSwitcherVisible
|
|
233
|
+
: false;
|
|
234
|
+
|
|
235
|
+
// Handle navigation keys when switcher is visible (check this FIRST)
|
|
236
|
+
if (isQuickSwitcherVisible && editContextRef.current) {
|
|
237
|
+
// Shift key acts as ArrowRight for easy one-handed navigation
|
|
238
|
+
if (event.key === "Shift" && event.ctrlKey) {
|
|
239
|
+
console.log(`[KeyNav] Shift pressed (Ctrl held) - moving right`);
|
|
240
|
+
event.preventDefault();
|
|
241
|
+
event.stopPropagation();
|
|
242
|
+
cycleQuickSwitcher?.("next");
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// Arrow keys for navigation
|
|
247
|
+
if (
|
|
248
|
+
event.key === "ArrowLeft" ||
|
|
249
|
+
event.key === "ArrowRight" ||
|
|
250
|
+
event.key === "ArrowUp" ||
|
|
251
|
+
event.key === "ArrowDown"
|
|
252
|
+
) {
|
|
253
|
+
console.log(`[KeyNav] Arrow key navigation: ${event.key}`);
|
|
254
|
+
event.preventDefault();
|
|
255
|
+
event.stopPropagation();
|
|
256
|
+
|
|
257
|
+
let direction: "next" | "prev" | "up" | "down";
|
|
258
|
+
switch (event.key) {
|
|
259
|
+
case "ArrowLeft":
|
|
260
|
+
direction = "prev";
|
|
261
|
+
break;
|
|
262
|
+
case "ArrowRight":
|
|
263
|
+
direction = "next";
|
|
264
|
+
break;
|
|
265
|
+
case "ArrowUp":
|
|
266
|
+
direction = "up";
|
|
267
|
+
break;
|
|
268
|
+
case "ArrowDown":
|
|
269
|
+
direction = "down";
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
cycleQuickSwitcher?.(direction);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Enter or Escape to close
|
|
277
|
+
if (event.key === "Enter" || event.key === "Escape") {
|
|
278
|
+
console.log(
|
|
279
|
+
`[KeyNav] ${event.key} pressed - closing switcher with selection: ${event.key === "Enter"}`,
|
|
280
|
+
);
|
|
281
|
+
event.preventDefault();
|
|
282
|
+
event.stopPropagation();
|
|
283
|
+
// showQuickSwitcher(false) will be handled by the Enter key handler in EditorShell
|
|
284
|
+
// For now, we just let the keyup handler in EditorShell handle it
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Handle quick switcher trigger (Ctrl+Shift pressed together) - only if NOT already visible
|
|
290
|
+
if (
|
|
291
|
+
!isQuickSwitcherVisible &&
|
|
292
|
+
((event.key === "Shift" && event.ctrlKey) ||
|
|
293
|
+
(event.key === "Control" && event.shiftKey)) &&
|
|
294
|
+
editContextRef.current &&
|
|
295
|
+
browseHistory.length > 1
|
|
296
|
+
) {
|
|
297
|
+
console.log("[KeyNav] Quick switcher trigger: Ctrl+Shift");
|
|
298
|
+
event.preventDefault();
|
|
299
|
+
event.stopPropagation();
|
|
300
|
+
showQuickSwitcher?.(true);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
|
|
214
304
|
const target = event.target as HTMLElement;
|
|
215
305
|
const isTyping =
|
|
216
306
|
target instanceof HTMLInputElement ||
|
|
@@ -230,7 +320,13 @@ export function useKeyboardNavigation(deps: KeyboardNavigationDependencies) {
|
|
|
230
320
|
}
|
|
231
321
|
handleKeyDownDebounced(event);
|
|
232
322
|
},
|
|
233
|
-
[
|
|
323
|
+
[
|
|
324
|
+
handleKeyDownDebounced,
|
|
325
|
+
editContextRef,
|
|
326
|
+
showQuickSwitcher,
|
|
327
|
+
cycleQuickSwitcher,
|
|
328
|
+
browseHistory,
|
|
329
|
+
],
|
|
234
330
|
);
|
|
235
331
|
|
|
236
332
|
return { handleKeyDown };
|
|
@@ -38,23 +38,37 @@ export function SingleEditView({
|
|
|
38
38
|
item?.templateId?.toLowerCase() ===
|
|
39
39
|
"fe5dd826-48c6-436d-b87a-7c4210c7413b";
|
|
40
40
|
|
|
41
|
-
if (
|
|
42
|
-
|
|
41
|
+
// Check if this is the media library root item (typically has template ID eb22c1a2-8899-4d2d-b36c-4aeb209e66b7)
|
|
42
|
+
const isMediaLibraryRoot =
|
|
43
|
+
item?.id?.toLowerCase() === "3d6658d8-a0bf-4e75-b3e2-d050fabcf4e1";
|
|
44
|
+
|
|
45
|
+
if (isMediaFolder || isMediaLibraryRoot) {
|
|
46
|
+
return (
|
|
47
|
+
<div data-view="media-folder-edit-view" className="h-full w-full">
|
|
48
|
+
<MediaFolderEditView item={item} />
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
43
51
|
}
|
|
44
52
|
|
|
45
|
-
return
|
|
53
|
+
return (
|
|
54
|
+
<div data-view="item-editor-view" className="h-full w-full">
|
|
55
|
+
<ItemEditor item={item} />
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
46
58
|
}
|
|
47
59
|
|
|
48
60
|
return (
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
<div data-view="single-edit-view" className="h-full w-full">
|
|
62
|
+
<PageViewer
|
|
63
|
+
pageViewContext={pageViewContext}
|
|
64
|
+
showFormEditor={
|
|
65
|
+
editContext?.viewName == "page-editor" || !editContext?.isMobile
|
|
66
|
+
}
|
|
67
|
+
compareView={compareView}
|
|
68
|
+
name={name}
|
|
69
|
+
followEditsDefault={false}
|
|
70
|
+
className={className}
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
59
73
|
);
|
|
60
74
|
}
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ export {
|
|
|
8
8
|
|
|
9
9
|
export { Editor } from "./editor/Editor";
|
|
10
10
|
|
|
11
|
-
export { configureForUser
|
|
11
|
+
export { configureForUser } from "./config/config";
|
|
12
12
|
|
|
13
13
|
export type { DialogProps } from "./editor/client/editContext";
|
|
14
14
|
export { useEditContext } from "./editor/client/editContext";
|
|
@@ -30,8 +30,8 @@ export {
|
|
|
30
30
|
DialogContent,
|
|
31
31
|
DialogHeader,
|
|
32
32
|
DialogTitle,
|
|
33
|
-
DialogFooter,
|
|
34
|
-
DialogClose
|
|
33
|
+
DialogFooter,
|
|
34
|
+
DialogClose,
|
|
35
35
|
} from "./components/ui/dialog";
|
|
36
36
|
export { Input } from "./components/ui/input";
|
|
37
37
|
export { Select } from "./components/ui/select";
|
package/src/revision.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = "1.0.
|
|
2
|
-
export const buildDate = "2025-10-
|
|
1
|
+
export const version = "1.0.4173";
|
|
2
|
+
export const buildDate = "2025-10-20 01:57:31";
|
|
@@ -7,12 +7,18 @@ import { Wizard } from "../page-wizard/PageWizard";
|
|
|
7
7
|
import { ActionButton } from "../components/ActionButton";
|
|
8
8
|
import { RecentPages } from "./RecentPages";
|
|
9
9
|
import { Spinner } from "../editor/ui/Spinner";
|
|
10
|
-
import { PanelsTopLeft } from "lucide-react";
|
|
10
|
+
import { PanelsTopLeft, Bot } from "lucide-react";
|
|
11
|
+
|
|
12
|
+
import { AgentProfilesOverview } from "../editor/ai/AgentProfilesOverview";
|
|
13
|
+
import { AiProfile, loadAiProfiles } from "../editor/services/aiService";
|
|
14
|
+
import { contentItemId } from "../config/config";
|
|
11
15
|
|
|
12
16
|
export function SplashScreen() {
|
|
13
17
|
const editContext = useEditContext();
|
|
14
18
|
const [demoId, setDemoId] = useState<string | null>(null);
|
|
15
19
|
const [demoWizard, setDemoWizard] = useState<Wizard | null>(null);
|
|
20
|
+
const [profiles, setProfiles] = useState<AiProfile[] | null>(null);
|
|
21
|
+
const [loadingProfiles, setLoadingProfiles] = useState(false);
|
|
16
22
|
|
|
17
23
|
useEffect(() => {
|
|
18
24
|
// Check for demoId in URL parameters
|
|
@@ -45,6 +51,28 @@ export function SplashScreen() {
|
|
|
45
51
|
loadDemoData();
|
|
46
52
|
}, [demoId]);
|
|
47
53
|
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
const loadProfiles = async () => {
|
|
56
|
+
try {
|
|
57
|
+
if (!editContext) return;
|
|
58
|
+
// Prefer demo item when present; otherwise current item; fallback to optional (server provides defaults)
|
|
59
|
+
const itemDescriptor = demoId
|
|
60
|
+
? { id: demoId, language: "en", version: 0 }
|
|
61
|
+
: editContext.currentItemDescriptor || undefined;
|
|
62
|
+
setLoadingProfiles(true);
|
|
63
|
+
const list = await loadAiProfiles(itemDescriptor);
|
|
64
|
+
setProfiles(list || []);
|
|
65
|
+
} catch (e) {
|
|
66
|
+
console.error("Failed to load AI profiles on splash:", e);
|
|
67
|
+
setProfiles([]);
|
|
68
|
+
} finally {
|
|
69
|
+
setLoadingProfiles(false);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
loadProfiles();
|
|
74
|
+
}, [editContext?.currentItemDescriptor?.id, demoId]);
|
|
75
|
+
|
|
48
76
|
const launchDemoWizard = () => {
|
|
49
77
|
if (!demoWizard || !demoId || !editContext) return;
|
|
50
78
|
|
|
@@ -129,6 +157,53 @@ export function SplashScreen() {
|
|
|
129
157
|
<RecentPages />
|
|
130
158
|
</div>
|
|
131
159
|
</div>
|
|
160
|
+
{/* Agent Profiles Overview Card (Demo view) */}
|
|
161
|
+
<Card
|
|
162
|
+
title="AI Agent Profiles"
|
|
163
|
+
description="Choose a profile to start a new agent"
|
|
164
|
+
icon={<Bot strokeWidth={1} />}
|
|
165
|
+
className="w-full md:max-w-screen-xl"
|
|
166
|
+
>
|
|
167
|
+
{loadingProfiles ? (
|
|
168
|
+
<div className="flex h-80 items-center justify-center text-xs text-gray-500">
|
|
169
|
+
Loading profiles...
|
|
170
|
+
</div>
|
|
171
|
+
) : profiles && profiles.length > 0 ? (
|
|
172
|
+
<AgentProfilesOverview
|
|
173
|
+
profiles={profiles}
|
|
174
|
+
onSelectProfile={(profileId) => {
|
|
175
|
+
// Switch to agents overview to show both overview and agents panel
|
|
176
|
+
editContext?.switchView("agents-overview");
|
|
177
|
+
editContext?.setShowAgentsPanel?.(true);
|
|
178
|
+
// Longer delay to allow view switch and Agents panel to mount
|
|
179
|
+
setTimeout(() => {
|
|
180
|
+
try {
|
|
181
|
+
const selectedProfile = profiles.find(
|
|
182
|
+
(p) => p.id === profileId,
|
|
183
|
+
);
|
|
184
|
+
window.dispatchEvent(
|
|
185
|
+
new CustomEvent("editor:addNewAgent", {
|
|
186
|
+
detail: {
|
|
187
|
+
metadata: {
|
|
188
|
+
profile: selectedProfile?.name,
|
|
189
|
+
additionalData: {
|
|
190
|
+
profileId: selectedProfile?.id,
|
|
191
|
+
profileName: selectedProfile?.name,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
}),
|
|
196
|
+
);
|
|
197
|
+
} catch {}
|
|
198
|
+
}, 500);
|
|
199
|
+
}}
|
|
200
|
+
/>
|
|
201
|
+
) : (
|
|
202
|
+
<div className="flex h-80 items-center justify-center text-xs text-gray-500">
|
|
203
|
+
No agent profiles available
|
|
204
|
+
</div>
|
|
205
|
+
)}
|
|
206
|
+
</Card>
|
|
132
207
|
</div>
|
|
133
208
|
<div className="bg-wizard absolute inset-0" />
|
|
134
209
|
</div>
|
|
@@ -136,7 +211,7 @@ export function SplashScreen() {
|
|
|
136
211
|
);
|
|
137
212
|
} else {
|
|
138
213
|
return (
|
|
139
|
-
<div className="flex h-full w-full gap-2 bg-gray-100 md:items-center md:justify-center">
|
|
214
|
+
<div className="flex h-full w-full flex-col gap-2 bg-gray-100 md:items-center md:justify-center">
|
|
140
215
|
<div className="z-10 flex flex-1 flex-col items-stretch gap-4 p-4 md:min-h-[40vh] md:max-w-screen-xl md:flex-row">
|
|
141
216
|
<Card
|
|
142
217
|
title=<span className="tracking-wides text-2xl font-extralight">
|
|
@@ -162,6 +237,14 @@ export function SplashScreen() {
|
|
|
162
237
|
>
|
|
163
238
|
Open existing page
|
|
164
239
|
</ActionButton>
|
|
240
|
+
<ActionButton
|
|
241
|
+
onClick={() => {
|
|
242
|
+
editContext?.switchView("agents-overview");
|
|
243
|
+
editContext?.setShowAgentsPanel?.(true);
|
|
244
|
+
}}
|
|
245
|
+
>
|
|
246
|
+
My Agents <Bot strokeWidth={1} />
|
|
247
|
+
</ActionButton>
|
|
165
248
|
<ActionButton onClick={() => editContext?.startTour()}>
|
|
166
249
|
Take tour <MagicEditIcon />
|
|
167
250
|
</ActionButton>
|
|
@@ -191,6 +274,55 @@ export function SplashScreen() {
|
|
|
191
274
|
<RecentPages />
|
|
192
275
|
</div>
|
|
193
276
|
</div>
|
|
277
|
+
{/* Agent Profiles Overview Card */}
|
|
278
|
+
<div className="z-10 mt-2 flex w-full max-w-screen-xl flex-1 px-4">
|
|
279
|
+
<Card
|
|
280
|
+
title="AI Agent Profiles"
|
|
281
|
+
description="Choose a profile to start a new agent"
|
|
282
|
+
icon={<Bot strokeWidth={1} />}
|
|
283
|
+
className="w-full"
|
|
284
|
+
>
|
|
285
|
+
{loadingProfiles ? (
|
|
286
|
+
<div className="flex h-80 items-center justify-center text-xs text-gray-500">
|
|
287
|
+
Loading profiles...
|
|
288
|
+
</div>
|
|
289
|
+
) : profiles && profiles.length > 0 ? (
|
|
290
|
+
<AgentProfilesOverview
|
|
291
|
+
profiles={profiles}
|
|
292
|
+
onSelectProfile={(profileId) => {
|
|
293
|
+
// Switch to agents overview to show both overview and agents panel
|
|
294
|
+
editContext?.switchView("agents-overview");
|
|
295
|
+
editContext?.setShowAgentsPanel?.(true);
|
|
296
|
+
// Longer delay to allow view switch and Agents panel to mount
|
|
297
|
+
setTimeout(() => {
|
|
298
|
+
try {
|
|
299
|
+
const selectedProfile = profiles.find(
|
|
300
|
+
(p) => p.id === profileId,
|
|
301
|
+
);
|
|
302
|
+
window.dispatchEvent(
|
|
303
|
+
new CustomEvent("editor:addNewAgent", {
|
|
304
|
+
detail: {
|
|
305
|
+
metadata: {
|
|
306
|
+
profile: selectedProfile?.name,
|
|
307
|
+
additionalData: {
|
|
308
|
+
profileId: selectedProfile?.id,
|
|
309
|
+
profileName: selectedProfile?.name,
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
}),
|
|
314
|
+
);
|
|
315
|
+
} catch {}
|
|
316
|
+
}, 500);
|
|
317
|
+
}}
|
|
318
|
+
/>
|
|
319
|
+
) : (
|
|
320
|
+
<div className="flex h-80 items-center justify-center text-xs text-gray-500">
|
|
321
|
+
No agent profiles available
|
|
322
|
+
</div>
|
|
323
|
+
)}
|
|
324
|
+
</Card>
|
|
325
|
+
</div>
|
|
194
326
|
<div className="bg-wizard absolute inset-0" />
|
|
195
327
|
</div>
|
|
196
328
|
);
|
package/src/types.ts
CHANGED
|
@@ -70,7 +70,8 @@ export type EditOperation = {
|
|
|
70
70
|
| "synchronize-components"
|
|
71
71
|
| "link-component"
|
|
72
72
|
| "duplicate-components"
|
|
73
|
-
| "rename-item"
|
|
73
|
+
| "rename-item"
|
|
74
|
+
| "change-template";
|
|
74
75
|
|
|
75
76
|
date: string;
|
|
76
77
|
id: string;
|
|
@@ -91,6 +92,13 @@ export type RenameItemOperation = EditOperation & {
|
|
|
91
92
|
oldName?: string;
|
|
92
93
|
};
|
|
93
94
|
|
|
95
|
+
export type ChangeTemplateOperation = EditOperation & {
|
|
96
|
+
type: "change-template";
|
|
97
|
+
itemId: string;
|
|
98
|
+
newTemplateId: string;
|
|
99
|
+
oldTemplateId?: string;
|
|
100
|
+
};
|
|
101
|
+
|
|
94
102
|
export type EditFieldOperation = EditOperation & {
|
|
95
103
|
type: "edit-field";
|
|
96
104
|
itemId: string;
|