@alpaca-editor/core 1.0.4114 → 1.0.4120
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/FilterInput.js +3 -7
- package/dist/components/FilterInput.js.map +1 -1
- package/dist/components/ui/input.js +3 -1
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/textarea.js +3 -1
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/config/config.js +1 -1
- package/dist/editor/AspectRatioSelector.js +3 -3
- package/dist/editor/AspectRatioSelector.js.map +1 -1
- package/dist/editor/ContentTree.js +52 -4
- package/dist/editor/ContentTree.js.map +1 -1
- package/dist/editor/ContextMenu.d.ts +2 -0
- package/dist/editor/ContextMenu.js +9 -7
- package/dist/editor/ContextMenu.js.map +1 -1
- package/dist/editor/EditorWarning.js +2 -2
- package/dist/editor/EditorWarning.js.map +1 -1
- package/dist/editor/FieldEditorPopup.js +7 -6
- package/dist/editor/FieldEditorPopup.js.map +1 -1
- package/dist/editor/FieldHistory.js +2 -1
- package/dist/editor/FieldHistory.js.map +1 -1
- package/dist/editor/FieldListField.js +1 -1
- package/dist/editor/LinkEditorDialog.d.ts +3 -1
- package/dist/editor/LinkEditorDialog.js +7 -3
- package/dist/editor/LinkEditorDialog.js.map +1 -1
- package/dist/editor/MainLayout.js +3 -3
- package/dist/editor/MainLayout.js.map +1 -1
- package/dist/editor/PictureCropper.js +3 -3
- package/dist/editor/PictureCropper.js.map +1 -1
- package/dist/editor/PictureEditor.d.ts +2 -1
- package/dist/editor/PictureEditor.js +2 -2
- package/dist/editor/PictureEditor.js.map +1 -1
- package/dist/editor/PictureEditorDialog.js +55 -50
- package/dist/editor/PictureEditorDialog.js.map +1 -1
- package/dist/editor/Terminal.js +4 -4
- package/dist/editor/Terminal.js.map +1 -1
- package/dist/editor/ai/AgentTerminal.js +298 -53
- package/dist/editor/ai/AgentTerminal.js.map +1 -1
- package/dist/editor/ai/Agents.js +2 -2
- package/dist/editor/ai/Agents.js.map +1 -1
- package/dist/editor/ai/ContextInfoBar.js +2 -2
- package/dist/editor/ai/ContextInfoBar.js.map +1 -1
- package/dist/editor/client/EditorShell.js +3 -0
- package/dist/editor/client/EditorShell.js.map +1 -1
- package/dist/editor/client/GenericDialog.js +3 -3
- package/dist/editor/client/GenericDialog.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +2 -1
- package/dist/editor/client/editContext.js.map +1 -1
- package/dist/editor/client/ui/EditorChrome.js +8 -2
- package/dist/editor/client/ui/EditorChrome.js.map +1 -1
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js +9 -7
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js.map +1 -1
- package/dist/editor/context-menu/CopyMoveMenu.js +3 -3
- package/dist/editor/context-menu/CopyMoveMenu.js.map +1 -1
- package/dist/editor/control-center/IndexOverview.js +39 -17
- package/dist/editor/control-center/IndexOverview.js.map +1 -1
- package/dist/editor/control-center/setup-steps/SettingsSetupStep.js +9 -6
- package/dist/editor/control-center/setup-steps/SettingsSetupStep.js.map +1 -1
- package/dist/editor/field-types/CheckboxEditor.js +2 -2
- package/dist/editor/field-types/CheckboxEditor.js.map +1 -1
- package/dist/editor/field-types/DateFieldEditor.js +2 -2
- package/dist/editor/field-types/DateFieldEditor.js.map +1 -1
- package/dist/editor/field-types/DateTimeFieldEditor.js.map +1 -1
- package/dist/editor/field-types/ImageFieldEditor.js +2 -2
- package/dist/editor/field-types/ImageFieldEditor.js.map +1 -1
- package/dist/editor/field-types/InternalLinkFieldEditor.js +2 -2
- package/dist/editor/field-types/InternalLinkFieldEditor.js.map +1 -1
- package/dist/editor/field-types/LinkFieldEditor.js +8 -3
- package/dist/editor/field-types/LinkFieldEditor.js.map +1 -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/PictureFieldEditor.js +3 -2
- package/dist/editor/field-types/PictureFieldEditor.js.map +1 -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.js +2 -2
- package/dist/editor/field-types/SingleLineText.js.map +1 -1
- package/dist/editor/field-types/richtext/components/ReactSlate.js +2 -2
- package/dist/editor/field-types/richtext/components/ReactSlate.js.map +1 -1
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.js +2 -2
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.js.map +1 -1
- package/dist/editor/fieldTypes.d.ts +1 -0
- package/dist/editor/media-selector/AiImageSearch.js +5 -4
- package/dist/editor/media-selector/AiImageSearch.js.map +1 -1
- package/dist/editor/media-selector/MediaFolderBrowser.js +8 -8
- package/dist/editor/media-selector/MediaFolderBrowser.js.map +1 -1
- package/dist/editor/media-selector/Thumbnails.js +2 -2
- package/dist/editor/media-selector/Thumbnails.js.map +1 -1
- package/dist/editor/media-selector/TreeSelector.js +2 -2
- package/dist/editor/media-selector/TreeSelector.js.map +1 -1
- package/dist/editor/media-selector/UploadZone.js +2 -2
- package/dist/editor/media-selector/UploadZone.js.map +1 -1
- package/dist/editor/menubar/NavButtons.js +3 -5
- package/dist/editor/menubar/NavButtons.js.map +1 -1
- package/dist/editor/menubar/Separator.js +2 -2
- package/dist/editor/menubar/Separator.js.map +1 -1
- package/dist/editor/menubar/SiteInfo.js +9 -9
- package/dist/editor/menubar/SiteInfo.js.map +1 -1
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +2 -2
- package/dist/editor/page-editor-chrome/CommentHighlighting.js.map +1 -1
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +2 -2
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js.map +1 -1
- package/dist/editor/page-editor-chrome/FrameMenu.js +6 -1
- package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -1
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +34 -1
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +6 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
- package/dist/editor/page-editor-chrome/SuggestionHighlighting.js +2 -2
- package/dist/editor/page-editor-chrome/SuggestionHighlighting.js.map +1 -1
- package/dist/editor/page-viewer/DeviceToolbar.js +3 -3
- package/dist/editor/page-viewer/DeviceToolbar.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.js +20 -4
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/reviews/Reviews.js +55 -54
- package/dist/editor/reviews/Reviews.js.map +1 -1
- package/dist/editor/services/agentService.d.ts +4 -3
- package/dist/editor/services/agentService.js.map +1 -1
- package/dist/editor/services/aiService.js +5 -5
- package/dist/editor/services/aiService.js.map +1 -1
- package/dist/editor/sidebar/ComponentPalette.js +3 -3
- package/dist/editor/sidebar/ComponentPalette.js.map +1 -1
- package/dist/editor/sidebar/ComponentTree.js +14 -10
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/sidebar/DictionaryEditor.js +9 -9
- package/dist/editor/sidebar/DictionaryEditor.js.map +1 -1
- package/dist/editor/sidebar/EditHistory.js +4 -3
- package/dist/editor/sidebar/EditHistory.js.map +1 -1
- package/dist/editor/sidebar/SEOInfo.js +3 -2
- package/dist/editor/sidebar/SEOInfo.js.map +1 -1
- package/dist/editor/sidebar/SidebarView.js +5 -6
- package/dist/editor/sidebar/SidebarView.js.map +1 -1
- package/dist/editor/sidebar/Translations.js +5 -2
- package/dist/editor/sidebar/Translations.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/ViewSelector.js +22 -5
- package/dist/editor/sidebar/ViewSelector.js.map +1 -1
- package/dist/editor/sidebar/Workbox.js +14 -13
- package/dist/editor/sidebar/Workbox.js.map +1 -1
- package/dist/editor/ui/DragPreview.d.ts +3 -2
- package/dist/editor/ui/DragPreview.js +4 -6
- package/dist/editor/ui/DragPreview.js.map +1 -1
- package/dist/editor/ui/ItemNameDialogNew.js +2 -2
- package/dist/editor/ui/ItemNameDialogNew.js.map +1 -1
- package/dist/editor/ui/PerfectTree.d.ts +4 -2
- package/dist/editor/ui/PerfectTree.js +6 -6
- package/dist/editor/ui/PerfectTree.js.map +1 -1
- package/dist/editor/ui/Section.js +3 -3
- package/dist/editor/ui/Section.js.map +1 -1
- package/dist/editor/ui/SimpleTable.js +3 -3
- package/dist/editor/ui/SimpleTable.js.map +1 -1
- package/dist/editor/ui/Splitter.js +8 -5
- package/dist/editor/ui/Splitter.js.map +1 -1
- package/dist/editor/views/ItemEditor.js +1 -1
- package/dist/editor/views/ItemEditor.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/page-wizard/WizardSteps.js +2 -3
- package/dist/page-wizard/WizardSteps.js.map +1 -1
- package/dist/page-wizard/steps/CollectStep.js +2 -2
- package/dist/page-wizard/steps/CollectStep.js.map +1 -1
- package/dist/page-wizard/steps/ContentStep.js +3 -4
- package/dist/page-wizard/steps/ContentStep.js.map +1 -1
- package/dist/page-wizard/steps/Generate.js +2 -2
- package/dist/page-wizard/steps/Generate.js.map +1 -1
- package/dist/page-wizard/steps/ImagesStep.js +17 -15
- package/dist/page-wizard/steps/ImagesStep.js.map +1 -1
- package/dist/page-wizard/steps/MetaDataStep.js +2 -2
- package/dist/page-wizard/steps/MetaDataStep.js.map +1 -1
- package/dist/page-wizard/steps/SelectStep.js +5 -5
- package/dist/page-wizard/steps/SelectStep.js.map +1 -1
- package/dist/page-wizard/steps/StructureStep.js +3 -3
- package/dist/page-wizard/steps/StructureStep.js.map +1 -1
- package/dist/page-wizard/steps/TranslateStep.js +2 -2
- package/dist/page-wizard/steps/TranslateStep.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/SectionHeadline.js +2 -2
- package/dist/splash-screen/SectionHeadline.js.map +1 -1
- package/dist/styles.css +52 -26
- package/package.json +1 -1
- package/src/components/FilterInput.tsx +13 -16
- package/src/components/ui/input.tsx +3 -2
- package/src/components/ui/textarea.tsx +3 -1
- package/src/config/config.tsx +1 -1
- package/src/editor/AspectRatioSelector.tsx +3 -3
- package/src/editor/ContentTree.tsx +51 -2
- package/src/editor/ContextMenu.tsx +30 -8
- package/src/editor/EditorWarning.tsx +6 -6
- package/src/editor/FieldEditorPopup.tsx +36 -26
- package/src/editor/FieldHistory.tsx +2 -1
- package/src/editor/FieldListField.tsx +2 -2
- package/src/editor/LinkEditorDialog.tsx +20 -0
- package/src/editor/MainLayout.tsx +3 -3
- package/src/editor/PictureCropper.tsx +3 -3
- package/src/editor/PictureEditor.tsx +3 -0
- package/src/editor/PictureEditorDialog.tsx +167 -145
- package/src/editor/Terminal.tsx +5 -6
- package/src/editor/ai/AgentTerminal.tsx +410 -87
- package/src/editor/ai/Agents.tsx +2 -2
- package/src/editor/ai/ContextInfoBar.tsx +15 -7
- package/src/editor/client/EditorShell.tsx +3 -0
- package/src/editor/client/GenericDialog.tsx +13 -9
- package/src/editor/client/editContext.ts +2 -1
- package/src/editor/client/ui/EditorChrome.tsx +8 -4
- package/src/editor/commands/localizeItem/LocalizeItemDialog.tsx +30 -11
- package/src/editor/context-menu/CopyMoveMenu.tsx +5 -3
- package/src/editor/control-center/IndexOverview.tsx +63 -34
- package/src/editor/control-center/setup-steps/SettingsSetupStep.tsx +11 -6
- package/src/editor/field-types/CheckboxEditor.tsx +2 -2
- package/src/editor/field-types/DateFieldEditor.tsx +2 -2
- package/src/editor/field-types/DateTimeFieldEditor.tsx +0 -1
- package/src/editor/field-types/ImageFieldEditor.tsx +3 -4
- package/src/editor/field-types/InternalLinkFieldEditor.tsx +2 -2
- package/src/editor/field-types/LinkFieldEditor.tsx +8 -2
- package/src/editor/field-types/MultiLineText.tsx +4 -5
- package/src/editor/field-types/PictureFieldEditor.tsx +5 -5
- package/src/editor/field-types/RawEditor.tsx +4 -5
- package/src/editor/field-types/SingleLineText.tsx +4 -6
- package/src/editor/field-types/richtext/components/ReactSlate.tsx +2 -2
- package/src/editor/field-types/richtext/components/SimpleRichTextEditor.tsx +2 -2
- package/src/editor/fieldTypes.ts +1 -0
- package/src/editor/media-selector/AiImageSearch.tsx +11 -14
- package/src/editor/media-selector/MediaFolderBrowser.tsx +42 -35
- package/src/editor/media-selector/Thumbnails.tsx +3 -3
- package/src/editor/media-selector/TreeSelector.tsx +2 -2
- package/src/editor/media-selector/UploadZone.tsx +2 -2
- package/src/editor/menubar/NavButtons.tsx +12 -14
- package/src/editor/menubar/Separator.tsx +2 -2
- package/src/editor/menubar/SiteInfo.tsx +29 -23
- package/src/editor/page-editor-chrome/CommentHighlighting.tsx +2 -2
- package/src/editor/page-editor-chrome/FieldActionIndicator.tsx +2 -2
- package/src/editor/page-editor-chrome/FrameMenu.tsx +6 -1
- package/src/editor/page-editor-chrome/PictureEditorOverlay.tsx +46 -0
- package/src/editor/page-editor-chrome/PlaceholderDropZone.tsx +6 -1
- package/src/editor/page-editor-chrome/SuggestionHighlighting.tsx +2 -2
- package/src/editor/page-viewer/DeviceToolbar.tsx +4 -3
- package/src/editor/page-viewer/PageViewerFrame.tsx +19 -3
- package/src/editor/reviews/Reviews.tsx +116 -106
- package/src/editor/services/agentService.ts +8 -3
- package/src/editor/services/aiService.ts +5 -5
- package/src/editor/sidebar/ComponentPalette.tsx +3 -3
- package/src/editor/sidebar/ComponentTree.tsx +19 -10
- package/src/editor/sidebar/DictionaryEditor.tsx +12 -13
- package/src/editor/sidebar/EditHistory.tsx +4 -3
- package/src/editor/sidebar/SEOInfo.tsx +9 -7
- package/src/editor/sidebar/SidebarView.tsx +8 -6
- package/src/editor/sidebar/Translations.tsx +9 -5
- package/src/editor/sidebar/Validation.tsx +2 -2
- package/src/editor/sidebar/ViewSelector.tsx +32 -6
- package/src/editor/sidebar/Workbox.tsx +81 -63
- package/src/editor/ui/DragPreview.tsx +10 -5
- package/src/editor/ui/ItemNameDialogNew.tsx +2 -2
- package/src/editor/ui/PerfectTree.tsx +14 -6
- package/src/editor/ui/Section.tsx +4 -4
- package/src/editor/ui/SimpleTable.tsx +3 -3
- package/src/editor/ui/Splitter.tsx +11 -5
- package/src/editor/views/ItemEditor.tsx +1 -1
- package/src/index.ts +6 -0
- package/src/page-wizard/WizardSteps.tsx +2 -3
- package/src/page-wizard/steps/CollectStep.tsx +3 -3
- package/src/page-wizard/steps/ContentStep.tsx +4 -5
- package/src/page-wizard/steps/Generate.tsx +2 -2
- package/src/page-wizard/steps/ImagesStep.tsx +43 -24
- package/src/page-wizard/steps/MetaDataStep.tsx +5 -5
- package/src/page-wizard/steps/SelectStep.tsx +8 -6
- package/src/page-wizard/steps/StructureStep.tsx +9 -8
- package/src/page-wizard/steps/TranslateStep.tsx +5 -3
- package/src/revision.ts +2 -2
- package/src/splash-screen/NewPage.tsx +2 -2
- package/src/splash-screen/SectionHeadline.tsx +4 -4
- package/dist/editor/component-designer/ComponentDesigner.d.ts +0 -1
- package/dist/editor/component-designer/ComponentDesigner.js +0 -51
- package/dist/editor/component-designer/ComponentDesigner.js.map +0 -1
- package/dist/editor/component-designer/ComponentDesignerMenu.d.ts +0 -1
- package/dist/editor/component-designer/ComponentDesignerMenu.js +0 -65
- package/dist/editor/component-designer/ComponentDesignerMenu.js.map +0 -1
- package/dist/editor/component-designer/ComponentEditor.d.ts +0 -4
- package/dist/editor/component-designer/ComponentEditor.js +0 -55
- package/dist/editor/component-designer/ComponentEditor.js.map +0 -1
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.d.ts +0 -5
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js +0 -11
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js.map +0 -1
- package/dist/editor/component-designer/ComponentRenderingEditor.d.ts +0 -1
- package/dist/editor/component-designer/ComponentRenderingEditor.js +0 -69
- package/dist/editor/component-designer/ComponentRenderingEditor.js.map +0 -1
- package/dist/editor/component-designer/ComponentsDropdown.d.ts +0 -4
- package/dist/editor/component-designer/ComponentsDropdown.js +0 -20
- package/dist/editor/component-designer/ComponentsDropdown.js.map +0 -1
- package/dist/editor/component-designer/PlaceholdersEditor.d.ts +0 -4
- package/dist/editor/component-designer/PlaceholdersEditor.js +0 -63
- package/dist/editor/component-designer/PlaceholdersEditor.js.map +0 -1
- package/dist/editor/component-designer/RenderingsDropdown.d.ts +0 -1
- package/dist/editor/component-designer/RenderingsDropdown.js +0 -23
- package/dist/editor/component-designer/RenderingsDropdown.js.map +0 -1
- package/dist/editor/component-designer/TemplateEditor.d.ts +0 -1
- package/dist/editor/component-designer/TemplateEditor.js +0 -142
- package/dist/editor/component-designer/TemplateEditor.js.map +0 -1
- package/dist/editor/component-designer/aiContext.d.ts +0 -5
- package/dist/editor/component-designer/aiContext.js +0 -14
- package/dist/editor/component-designer/aiContext.js.map +0 -1
- package/src/editor/component-designer/ComponentDesigner.tsx +0 -66
- package/src/editor/component-designer/ComponentDesignerMenu.tsx +0 -91
- package/src/editor/component-designer/ComponentEditor.tsx +0 -95
- package/src/editor/component-designer/ComponentRenderingCodeEditor.tsx +0 -31
- package/src/editor/component-designer/ComponentRenderingEditor.tsx +0 -104
- package/src/editor/component-designer/ComponentsDropdown.tsx +0 -39
- package/src/editor/component-designer/PlaceholdersEditor.tsx +0 -179
- package/src/editor/component-designer/RenderingsDropdown.tsx +0 -36
- package/src/editor/component-designer/TemplateEditor.tsx +0 -236
- package/src/editor/component-designer/aiContext.ts +0 -21
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Textarea } from "../../components/ui/textarea";
|
|
4
4
|
import { useEditContext } from "../client/editContext";
|
|
5
5
|
import { useEffect, useRef, useState } from "react";
|
|
6
6
|
import { useDebouncedCallback } from "use-debounce";
|
|
@@ -35,15 +35,14 @@ export function RawEditor({
|
|
|
35
35
|
const fieldItem = field.descriptor.item;
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
|
-
<
|
|
38
|
+
<Textarea
|
|
39
39
|
ref={inputRef}
|
|
40
40
|
key={fieldItem.id + field.id + fieldItem.language + fieldItem.version}
|
|
41
41
|
value={value || ""}
|
|
42
42
|
disabled={readOnly}
|
|
43
|
-
className="focus-shadow bg-gray-5 p-2 text-xs"
|
|
44
|
-
style={{ width: "100%" }}
|
|
43
|
+
className="focus-shadow bg-gray-5 w-full p-2 text-xs"
|
|
45
44
|
rows={12}
|
|
46
|
-
onChange={(e) => {
|
|
45
|
+
onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
47
46
|
setValue(e.target.value);
|
|
48
47
|
debouncedSetFieldvalue(e.target.value as string);
|
|
49
48
|
// field.value = e.target.value;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Input } from "../../components/ui/input";
|
|
4
4
|
import {
|
|
5
5
|
useEditContext,
|
|
6
6
|
useEditContextRef,
|
|
7
|
-
useFieldsEditContext,
|
|
8
7
|
useFieldsEditContextRef,
|
|
9
8
|
SelectionRange,
|
|
10
9
|
} from "../client/editContext";
|
|
11
10
|
import { useFieldModification } from "../client/fieldModificationStore";
|
|
12
11
|
|
|
13
|
-
import { useEffect, useRef, useState
|
|
12
|
+
import { useEffect, useRef, useState } from "react";
|
|
14
13
|
import { RefreshCw } from "lucide-react";
|
|
15
14
|
|
|
16
15
|
import { Field } from "../pageModel";
|
|
@@ -163,13 +162,12 @@ export function SingleLineText({
|
|
|
163
162
|
|
|
164
163
|
return (
|
|
165
164
|
<div className="relative">
|
|
166
|
-
<
|
|
165
|
+
<Input
|
|
167
166
|
ref={inputRef}
|
|
168
167
|
key={fieldItem.id + field.id + fieldItem.language + fieldItem.version}
|
|
169
168
|
value={value || ""}
|
|
170
169
|
disabled={readOnly}
|
|
171
|
-
className="focus-shadow bg-gray-5 p-1.5 pr-7 text-xs"
|
|
172
|
-
style={{ width: "100%" }}
|
|
170
|
+
className="focus-shadow bg-gray-5 w-full p-1.5 pr-7 text-xs"
|
|
173
171
|
onChange={handleChange}
|
|
174
172
|
onSelect={handleSelect}
|
|
175
173
|
/>
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
import { normalizeUrl } from "../../../utils/urlUtils";
|
|
48
48
|
|
|
49
49
|
import { useCachedSimplifiedProfile } from "../hooks/useProfileCache";
|
|
50
|
-
import {
|
|
50
|
+
import { cn } from "../../../../lib/utils";
|
|
51
51
|
|
|
52
52
|
// Memoized toolbar button component using useSlateSelector for performance
|
|
53
53
|
const ToolbarButtonWrapper: React.FC<{
|
|
@@ -971,7 +971,7 @@ export const ReactSlate = forwardRef<any, ReactSlateProps>((props, ref) => {
|
|
|
971
971
|
</div>
|
|
972
972
|
)}
|
|
973
973
|
<Editable
|
|
974
|
-
className={
|
|
974
|
+
className={cn(
|
|
975
975
|
"border-gray-3 min-h-7 rounded-sm border p-1.5",
|
|
976
976
|
readOnly ? "bg-gray-5" : "bg-gray-5",
|
|
977
977
|
"focus-shadow",
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
BlockId,
|
|
16
16
|
} from "../types";
|
|
17
17
|
import { SimpleToolbar } from "./SimpleToolbar";
|
|
18
|
-
import {
|
|
18
|
+
import { cn } from "../../../../lib/utils";
|
|
19
19
|
import "./SimpleRichTextEditor.css";
|
|
20
20
|
|
|
21
21
|
interface SimpleRichTextEditorState {
|
|
@@ -481,7 +481,7 @@ export const SimpleRichTextEditor = forwardRef<HTMLDivElement, ReactSlateProps>(
|
|
|
481
481
|
<div
|
|
482
482
|
ref={editorRef}
|
|
483
483
|
contentEditable={!readOnly}
|
|
484
|
-
className={
|
|
484
|
+
className={cn(
|
|
485
485
|
"simple-editor-content",
|
|
486
486
|
readOnly ? "bg-gray-5" : "bg-gray-5",
|
|
487
487
|
"focus-shadow p-2",
|
package/src/editor/fieldTypes.ts
CHANGED
|
@@ -5,14 +5,15 @@ import { createEditorAiContext } from "../ai/editorAiContext";
|
|
|
5
5
|
import { executePrompt } from "../services/aiService";
|
|
6
6
|
import { executeSearch } from "../services/searchService";
|
|
7
7
|
import { useEditContext } from "../client/editContext";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { Loader2 } from "lucide-react";
|
|
9
|
+
import { Input } from "../../components/ui/input";
|
|
10
10
|
import { Thumbnail } from "../services/contentService";
|
|
11
11
|
import { Thumbnails } from "./Thumbnails";
|
|
12
12
|
import { Splitter, SplitterPanel } from "primereact/splitter";
|
|
13
13
|
import { Preview } from "./Preview";
|
|
14
14
|
import DialogButtons from "../ui/DialogButtons";
|
|
15
|
-
import { Button } from "
|
|
15
|
+
import { Button } from "../../components/ui/button";
|
|
16
|
+
import { Sparkles } from "lucide-react";
|
|
16
17
|
import { toast } from "sonner";
|
|
17
18
|
|
|
18
19
|
export function AiImageSearch({
|
|
@@ -125,7 +126,7 @@ export function AiImageSearch({
|
|
|
125
126
|
<div>
|
|
126
127
|
Search prompt
|
|
127
128
|
<div className="flex items-center gap-2">
|
|
128
|
-
<
|
|
129
|
+
<Input
|
|
129
130
|
ref={inputRef} // Add ref to InputText
|
|
130
131
|
value={prompt}
|
|
131
132
|
onChange={onPromptChange}
|
|
@@ -133,25 +134,21 @@ export function AiImageSearch({
|
|
|
133
134
|
/>
|
|
134
135
|
{loadingPrompt && (
|
|
135
136
|
<div className="flex h-10 items-center">
|
|
136
|
-
<
|
|
137
|
-
style={{ width: "24px", height: "24px" }}
|
|
138
|
-
/>
|
|
137
|
+
<Loader2 className="h-6 w-6 animate-spin" />
|
|
139
138
|
</div>
|
|
140
139
|
)}
|
|
141
140
|
{!loadingPrompt && (
|
|
142
|
-
<Button
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
size="small"
|
|
147
|
-
/>
|
|
141
|
+
<Button onClick={() => suggestPrompt()} size="sm">
|
|
142
|
+
<Sparkles className="mr-2 h-4 w-4" />
|
|
143
|
+
Suggest
|
|
144
|
+
</Button>
|
|
148
145
|
)}
|
|
149
146
|
</div>
|
|
150
147
|
</div>
|
|
151
148
|
<div className="relative flex-1">
|
|
152
149
|
{loadingThumbnails && (
|
|
153
150
|
<div className="flex h-full items-center">
|
|
154
|
-
<
|
|
151
|
+
<Loader2 className="h-6 w-6 animate-spin" />
|
|
155
152
|
</div>
|
|
156
153
|
)}
|
|
157
154
|
<Thumbnails
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { Button } from "
|
|
4
|
-
import {
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
import { Button } from "../../components/ui/button";
|
|
4
|
+
import {
|
|
5
|
+
Grid3X3,
|
|
6
|
+
Square,
|
|
7
|
+
List,
|
|
8
|
+
Upload,
|
|
9
|
+
RefreshCw,
|
|
10
|
+
Loader2,
|
|
11
|
+
} from "lucide-react";
|
|
5
12
|
import { useEditContext } from "../client/editContext";
|
|
6
13
|
import { getChildren } from "../services/contentService";
|
|
7
14
|
import { Thumbnail } from "../services/contentService";
|
|
@@ -114,7 +121,7 @@ export function MediaFolderBrowser({
|
|
|
114
121
|
{images.map((t) => (
|
|
115
122
|
<div
|
|
116
123
|
key={t.id}
|
|
117
|
-
className={
|
|
124
|
+
className={cn(
|
|
118
125
|
selectedImage?.id === t.id
|
|
119
126
|
? "shadow-lg ring-2 ring-blue-500"
|
|
120
127
|
: "shadow-sm hover:shadow-md",
|
|
@@ -149,7 +156,7 @@ export function MediaFolderBrowser({
|
|
|
149
156
|
{images.map((t) => (
|
|
150
157
|
<div
|
|
151
158
|
key={t.id}
|
|
152
|
-
className={
|
|
159
|
+
className={cn(
|
|
153
160
|
selectedImage?.id === t.id
|
|
154
161
|
? "shadow-lg ring-2 ring-blue-500"
|
|
155
162
|
: "shadow-sm hover:shadow-md",
|
|
@@ -179,7 +186,7 @@ export function MediaFolderBrowser({
|
|
|
179
186
|
{images.map((t) => (
|
|
180
187
|
<div
|
|
181
188
|
key={t.id}
|
|
182
|
-
className={
|
|
189
|
+
className={cn(
|
|
183
190
|
selectedImage?.id === t.id
|
|
184
191
|
? "border-blue-300 bg-blue-100"
|
|
185
192
|
: "bg-white hover:bg-gray-50",
|
|
@@ -209,7 +216,7 @@ export function MediaFolderBrowser({
|
|
|
209
216
|
if (loading) {
|
|
210
217
|
return (
|
|
211
218
|
<div className="flex h-64 items-center justify-center">
|
|
212
|
-
<
|
|
219
|
+
<Loader2 className="h-8 w-8 animate-spin" />
|
|
213
220
|
</div>
|
|
214
221
|
);
|
|
215
222
|
}
|
|
@@ -245,49 +252,49 @@ export function MediaFolderBrowser({
|
|
|
245
252
|
</div>
|
|
246
253
|
<div className="flex gap-1">
|
|
247
254
|
<Button
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
outlined={viewMode === "grid"}
|
|
255
|
+
size="sm"
|
|
256
|
+
variant={viewMode === "grid" ? "outline" : "default"}
|
|
251
257
|
onClick={() => setViewMode("grid")}
|
|
252
|
-
|
|
253
|
-
tooltipOptions={{ position: "bottom" }}
|
|
258
|
+
title="Grid View"
|
|
254
259
|
className="p-1"
|
|
255
|
-
|
|
260
|
+
>
|
|
261
|
+
<Grid3X3 className="h-4 w-4" />
|
|
262
|
+
</Button>
|
|
256
263
|
<Button
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
outlined={viewMode === "large-grid"}
|
|
264
|
+
size="sm"
|
|
265
|
+
variant={viewMode === "large-grid" ? "outline" : "default"}
|
|
260
266
|
onClick={() => setViewMode("large-grid")}
|
|
261
|
-
|
|
262
|
-
tooltipOptions={{ position: "bottom" }}
|
|
267
|
+
title="Large Grid View"
|
|
263
268
|
className="p-1"
|
|
264
|
-
|
|
269
|
+
>
|
|
270
|
+
<Square className="h-4 w-4" />
|
|
271
|
+
</Button>
|
|
265
272
|
<Button
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
outlined={viewMode === "list"}
|
|
273
|
+
size="sm"
|
|
274
|
+
variant={viewMode === "list" ? "outline" : "default"}
|
|
269
275
|
onClick={() => setViewMode("list")}
|
|
270
|
-
|
|
271
|
-
tooltipOptions={{ position: "bottom" }}
|
|
276
|
+
title="List View"
|
|
272
277
|
className="p-1"
|
|
273
|
-
|
|
278
|
+
>
|
|
279
|
+
<List className="h-4 w-4" />
|
|
280
|
+
</Button>
|
|
274
281
|
<Button
|
|
275
|
-
|
|
276
|
-
size="small"
|
|
282
|
+
size="sm"
|
|
277
283
|
onClick={handleUpload}
|
|
278
284
|
disabled={uploading || !folderId}
|
|
279
|
-
|
|
280
|
-
tooltipOptions={{ position: "bottom" }}
|
|
285
|
+
title="Upload Files"
|
|
281
286
|
className="ml-2 p-1"
|
|
282
|
-
|
|
287
|
+
>
|
|
288
|
+
<Upload className="h-4 w-4" />
|
|
289
|
+
</Button>
|
|
283
290
|
<Button
|
|
284
|
-
|
|
285
|
-
size="small"
|
|
291
|
+
size="sm"
|
|
286
292
|
onClick={loadMediaFiles}
|
|
287
|
-
|
|
288
|
-
tooltipOptions={{ position: "bottom" }}
|
|
293
|
+
title="Refresh"
|
|
289
294
|
className="ml-1 p-1"
|
|
290
|
-
|
|
295
|
+
>
|
|
296
|
+
<RefreshCw className="h-4 w-4" />
|
|
297
|
+
</Button>
|
|
291
298
|
</div>
|
|
292
299
|
</div>
|
|
293
300
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn } from "../../lib/utils";
|
|
2
2
|
import { Thumbnail } from "../services/contentService";
|
|
3
3
|
import { Check } from "lucide-react";
|
|
4
4
|
|
|
@@ -16,7 +16,7 @@ export function Thumbnails({
|
|
|
16
16
|
onHide: () => void;
|
|
17
17
|
}) {
|
|
18
18
|
return (
|
|
19
|
-
<div
|
|
19
|
+
<div
|
|
20
20
|
data-testid="media-selector-thumbnails-container"
|
|
21
21
|
className="absolute inset-0 flex flex-col overflow-auto p-2"
|
|
22
22
|
>
|
|
@@ -24,7 +24,7 @@ export function Thumbnails({
|
|
|
24
24
|
{images?.map((t) => (
|
|
25
25
|
<div
|
|
26
26
|
key={t.id}
|
|
27
|
-
className={
|
|
27
|
+
className={cn(
|
|
28
28
|
selectedImage?.id == t.id ? "border-theme-secondary" : "",
|
|
29
29
|
"hover:border-theme-secondary relative flex h-[160px] w-[160px] cursor-pointer flex-col items-center justify-center rounded-md border p-2",
|
|
30
30
|
)}
|
|
@@ -17,7 +17,7 @@ import { Preview } from "./Preview";
|
|
|
17
17
|
import { UploadZone } from "./UploadZone";
|
|
18
18
|
import { AiImageSearchPrompt } from "./AiImageSearchPrompt";
|
|
19
19
|
import { useDebouncedCallback } from "use-debounce";
|
|
20
|
-
import {
|
|
20
|
+
import { Loader2 } from "lucide-react";
|
|
21
21
|
import {
|
|
22
22
|
Popover,
|
|
23
23
|
PopoverTrigger,
|
|
@@ -277,7 +277,7 @@ export const TreeSelector = ({
|
|
|
277
277
|
<div className="relative flex-1">
|
|
278
278
|
{loadingThumbnails && (
|
|
279
279
|
<div className="flex h-full items-center">
|
|
280
|
-
<
|
|
280
|
+
<Loader2 className="h-6 w-6 animate-spin" />
|
|
281
281
|
</div>
|
|
282
282
|
)}
|
|
283
283
|
{!loadingThumbnails && (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn } from "../../lib/utils";
|
|
2
2
|
import { useCallback, useRef } from "react";
|
|
3
3
|
|
|
4
4
|
import { useState } from "react";
|
|
@@ -95,7 +95,7 @@ export function UploadZone({
|
|
|
95
95
|
<>
|
|
96
96
|
<div
|
|
97
97
|
ref={dragZoneRef}
|
|
98
|
-
className={
|
|
98
|
+
className={cn(
|
|
99
99
|
"mx-6 my-4 flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-4",
|
|
100
100
|
isDragging
|
|
101
101
|
? "border-blue-400 bg-blue-50"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEditContext } from "../client/editContext";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
3
|
|
|
4
4
|
export function NavButtons() {
|
|
5
5
|
const editContext = useEditContext();
|
|
@@ -11,21 +11,19 @@ export function NavButtons() {
|
|
|
11
11
|
const history = editContext.browseHistory;
|
|
12
12
|
|
|
13
13
|
const currentIndex = history.findIndex(
|
|
14
|
-
(x) => x.id === item.id && x.language === item.language
|
|
14
|
+
(x) => x.id === item.id && x.language === item.language,
|
|
15
15
|
);
|
|
16
16
|
return (
|
|
17
17
|
<>
|
|
18
18
|
<div
|
|
19
19
|
key="nav-fwd"
|
|
20
|
-
className={
|
|
21
|
-
currentIndex < history.length - 1
|
|
22
|
-
|
|
23
|
-
: "text-gray-400",
|
|
24
|
-
"cursor-pointer hover:bg-gray-500 flex gap-2 p-2 rounded-md "
|
|
20
|
+
className={cn(
|
|
21
|
+
currentIndex < history.length - 1 ? "text-gray-200" : "text-gray-400",
|
|
22
|
+
"flex cursor-pointer gap-2 rounded-md p-2 hover:bg-gray-500",
|
|
25
23
|
)}
|
|
26
24
|
onClick={() => {
|
|
27
25
|
const currentIndex = history.findIndex(
|
|
28
|
-
(x) => x.id === item.id && x.language === item.language
|
|
26
|
+
(x) => x.id === item.id && x.language === item.language,
|
|
29
27
|
);
|
|
30
28
|
if (currentIndex < history.length - 1) {
|
|
31
29
|
const historyItem = history[currentIndex + 1];
|
|
@@ -36,7 +34,7 @@ export function NavButtons() {
|
|
|
36
34
|
language: historyItem.language,
|
|
37
35
|
version: historyItem.version || 0,
|
|
38
36
|
},
|
|
39
|
-
{ addToBrowseHistory: false }
|
|
37
|
+
{ addToBrowseHistory: false },
|
|
40
38
|
);
|
|
41
39
|
}
|
|
42
40
|
}}
|
|
@@ -45,13 +43,13 @@ export function NavButtons() {
|
|
|
45
43
|
</div>
|
|
46
44
|
<div
|
|
47
45
|
key="nav-back"
|
|
48
|
-
className={
|
|
49
|
-
currentIndex > 0 ? "
|
|
50
|
-
"cursor-pointer
|
|
46
|
+
className={cn(
|
|
47
|
+
currentIndex > 0 ? "text-gray-200" : "text-gray-400",
|
|
48
|
+
"flex cursor-pointer gap-2 rounded-md p-2 hover:bg-gray-500",
|
|
51
49
|
)}
|
|
52
50
|
onClick={() => {
|
|
53
51
|
const currentIndex = history.findIndex(
|
|
54
|
-
(x) => x.id === item.id && x.language === item.language
|
|
52
|
+
(x) => x.id === item.id && x.language === item.language,
|
|
55
53
|
);
|
|
56
54
|
if (currentIndex > 0) {
|
|
57
55
|
const historyItem = history[currentIndex - 1];
|
|
@@ -62,7 +60,7 @@ export function NavButtons() {
|
|
|
62
60
|
language: historyItem.language,
|
|
63
61
|
version: historyItem.version || 0,
|
|
64
62
|
},
|
|
65
|
-
{ addToBrowseHistory: false }
|
|
63
|
+
{ addToBrowseHistory: false },
|
|
66
64
|
);
|
|
67
65
|
}
|
|
68
66
|
}}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn } from "../../lib/utils";
|
|
2
2
|
|
|
3
3
|
export function Separator({ size }: { size?: "large" | "small" }) {
|
|
4
4
|
return (
|
|
5
5
|
<div
|
|
6
|
-
className={
|
|
6
|
+
className={cn(
|
|
7
7
|
"border-r border-gray-400",
|
|
8
8
|
size === "large" ? "mx-3 h-7" : "mx-1 h-4",
|
|
9
9
|
)}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Popover,
|
|
3
|
+
PopoverContent,
|
|
4
|
+
PopoverTrigger,
|
|
5
|
+
} from "../../components/ui/popover";
|
|
2
6
|
import { useEditContext } from "../client/editContext";
|
|
3
|
-
import {
|
|
7
|
+
import { useState } from "react";
|
|
4
8
|
import { getSites } from "../services/contentService";
|
|
5
9
|
import { Site } from "../../types";
|
|
6
|
-
import {
|
|
10
|
+
import { Loader2, Globe } from "lucide-react";
|
|
7
11
|
|
|
8
12
|
export function SiteInfo() {
|
|
9
13
|
const editContext = useEditContext();
|
|
10
|
-
const
|
|
14
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
11
15
|
const [sites, setSites] = useState<Site[]>();
|
|
12
16
|
if (!editContext) return null;
|
|
13
17
|
|
|
@@ -17,27 +21,29 @@ export function SiteInfo() {
|
|
|
17
21
|
};
|
|
18
22
|
|
|
19
23
|
return (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
<Popover open={isOpen} onOpenChange={setIsOpen}>
|
|
25
|
+
<PopoverTrigger asChild>
|
|
26
|
+
<div
|
|
27
|
+
className="my-2 flex cursor-pointer items-center gap-2 text-gray-200"
|
|
28
|
+
title={editContext.pageView.site?.name}
|
|
29
|
+
onClick={async () => {
|
|
30
|
+
setSites(undefined);
|
|
31
|
+
setIsOpen(true);
|
|
32
|
+
await loadSites();
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<Globe className="h-4 w-4" />
|
|
36
|
+
</div>
|
|
37
|
+
</PopoverTrigger>
|
|
38
|
+
<PopoverContent className="w-80">
|
|
39
|
+
<div className="flex max-h-[45vh] min-w-20 flex-col overflow-hidden text-xs">
|
|
32
40
|
<div className="p-4">
|
|
33
41
|
This page is part of the site:{" "}
|
|
34
|
-
<span className="font-bold">
|
|
35
|
-
|
|
36
|
-
</span>
|
|
37
|
-
{!sites && <ProgressSpinner className="w-5 h-5" />}
|
|
42
|
+
<span className="font-bold">{editContext.pageView.site?.name}</span>
|
|
43
|
+
{!sites && <Loader2 className="h-5 w-5 animate-spin" />}
|
|
38
44
|
{sites && (
|
|
39
45
|
<div>
|
|
40
|
-
<div className="border-b
|
|
46
|
+
<div className="my-2 border-b">Sites registered:</div>
|
|
41
47
|
<ul>
|
|
42
48
|
{sites.map((site) => (
|
|
43
49
|
<li key={site.name}>{site.name}</li>
|
|
@@ -47,7 +53,7 @@ export function SiteInfo() {
|
|
|
47
53
|
)}
|
|
48
54
|
</div>
|
|
49
55
|
</div>
|
|
50
|
-
</
|
|
51
|
-
</
|
|
56
|
+
</PopoverContent>
|
|
57
|
+
</Popover>
|
|
52
58
|
);
|
|
53
59
|
}
|
|
@@ -3,7 +3,7 @@ import { findComponentRect, findFieldElement } from "../utils";
|
|
|
3
3
|
import { Comment } from "../../types";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { useEffect } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { cn } from "../../lib/utils";
|
|
7
7
|
import { CommentIcon } from "../ui/Icons";
|
|
8
8
|
import { CommentDisplayPopover } from "../reviews/CommentDisplayPopover";
|
|
9
9
|
|
|
@@ -182,7 +182,7 @@ export function CommentHighlighting({
|
|
|
182
182
|
}}
|
|
183
183
|
>
|
|
184
184
|
<div
|
|
185
|
-
className={
|
|
185
|
+
className={cn(
|
|
186
186
|
"pointer-events-auto absolute h-5 w-5 cursor-pointer",
|
|
187
187
|
rect.top * scale < 18 ? "top-0" : "top-[-18px]",
|
|
188
188
|
(rect.left + rect.width) * scale > iframeRect.width - 18
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Loader2 } from "lucide-react";
|
|
2
2
|
import type { FieldAction } from "../client/EditorShell";
|
|
3
3
|
import { useEditContext } from "../client/editContext";
|
|
4
4
|
import { AlertCircle } from "lucide-react";
|
|
@@ -59,7 +59,7 @@ function SingleIndicator({
|
|
|
59
59
|
{isRunning && (
|
|
60
60
|
<div className="text-theme-secondary rounded-mdp-3 bg-theme-secondary-light border-theme-secondary text-3xs pointer-events-none absolute top-1/2 left-1/2 flex -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center gap-1.5 rounded border p-1 font-bold">
|
|
61
61
|
<div className="flex items-center gap-1">
|
|
62
|
-
<
|
|
62
|
+
<Loader2 className="h-4 w-4 animate-spin" />
|
|
63
63
|
{action.label}
|
|
64
64
|
</div>
|
|
65
65
|
{action.message && <div className="text-3xs">{action.message}</div>}
|
|
@@ -211,7 +211,12 @@ export function FrameMenu({
|
|
|
211
211
|
if (!component?.datasourceItem) return;
|
|
212
212
|
// For multi-select, show a custom drag image indicating the number of items
|
|
213
213
|
const selectedCount = editContext?.selection?.length || 0;
|
|
214
|
-
if (selectedCount > 1)
|
|
214
|
+
if (selectedCount > 1)
|
|
215
|
+
setMultiDragImage(event, selectedCount, "components");
|
|
216
|
+
// Allow both copy and move from component drag origins
|
|
217
|
+
try {
|
|
218
|
+
event.dataTransfer.effectAllowed = "copyMove";
|
|
219
|
+
} catch {}
|
|
215
220
|
event.dataTransfer.setData("componentId", component.id);
|
|
216
221
|
setTimeout(() => {
|
|
217
222
|
if (!component?.datasourceItem) return;
|
|
@@ -4,6 +4,9 @@ import { useEditContext } from "../client/editContext";
|
|
|
4
4
|
import { PictureEditor } from "../PictureEditor";
|
|
5
5
|
import { getComponentById } from "../componentTreeHelper";
|
|
6
6
|
import { PictureField } from "../fieldTypes";
|
|
7
|
+
import { showComponentContextMenu } from "../ContextMenu";
|
|
8
|
+
import { loadFieldButtons } from "../services/editService";
|
|
9
|
+
import { Component } from "../pageModel";
|
|
7
10
|
|
|
8
11
|
export function PictureEditorOverlay() {
|
|
9
12
|
const editContext = useEditContext();
|
|
@@ -147,6 +150,49 @@ export function PictureEditorOverlay() {
|
|
|
147
150
|
style={style}
|
|
148
151
|
forwardScrollevents={true}
|
|
149
152
|
isPageEditor={true}
|
|
153
|
+
onContextMenu={async (e) => {
|
|
154
|
+
e.preventDefault();
|
|
155
|
+
e.stopPropagation();
|
|
156
|
+
if (!editContext?.pageView?.page) return;
|
|
157
|
+
|
|
158
|
+
// Focus the picture field so Add Comment associates with it
|
|
159
|
+
try {
|
|
160
|
+
await editContext.setFocusedField(field.descriptor, false);
|
|
161
|
+
} catch {}
|
|
162
|
+
|
|
163
|
+
// Determine target components: prefer current selection, fallback to hovered element's component
|
|
164
|
+
const selectedComponents: Component[] = (editContext.selection || [])
|
|
165
|
+
.map((id) => getComponentById(id, editContext.pageView!.page!))
|
|
166
|
+
.filter((x) => x) as Component[];
|
|
167
|
+
|
|
168
|
+
const targetComponents = selectedComponents.length
|
|
169
|
+
? selectedComponents
|
|
170
|
+
: (() => {
|
|
171
|
+
const itemId = element?.getAttribute("data-itemid");
|
|
172
|
+
if (!itemId) return [] as Component[];
|
|
173
|
+
const comp = getComponentById(
|
|
174
|
+
itemId,
|
|
175
|
+
editContext.pageView!.page!,
|
|
176
|
+
);
|
|
177
|
+
return comp ? [comp] : [];
|
|
178
|
+
})();
|
|
179
|
+
|
|
180
|
+
if (
|
|
181
|
+
editContext.showLayoutComponents === false &&
|
|
182
|
+
targetComponents.some((c) => c.layoutId)
|
|
183
|
+
) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const fieldButtons = await loadFieldButtons(field.descriptor);
|
|
188
|
+
const showMenu = await showComponentContextMenu(
|
|
189
|
+
targetComponents,
|
|
190
|
+
editContext,
|
|
191
|
+
field.descriptor,
|
|
192
|
+
fieldButtons,
|
|
193
|
+
);
|
|
194
|
+
if (showMenu) showMenu(e);
|
|
195
|
+
}}
|
|
150
196
|
/>
|
|
151
197
|
);
|
|
152
198
|
}
|
|
@@ -113,9 +113,14 @@ export function PlaceholderDropZone({
|
|
|
113
113
|
onDrop={drop}
|
|
114
114
|
onDragLeave={() => setIsHovering(false)}
|
|
115
115
|
onClick={(e) => {
|
|
116
|
+
// Prevent the initiating click from bubbling to the window-level
|
|
117
|
+
// context menu close handlers, which would immediately close the menu
|
|
118
|
+
// after opening it.
|
|
119
|
+
e.stopPropagation();
|
|
116
120
|
// Quick-insert on Ctrl+Click: add a component of the provided type immediately
|
|
117
121
|
if ((e as any).ctrlKey && typeIdOnCtrlClick) {
|
|
118
122
|
e.preventDefault();
|
|
123
|
+
e.stopPropagation();
|
|
119
124
|
const sameTypeOption = placeholder.insertOptions?.find(
|
|
120
125
|
(x) =>
|
|
121
126
|
x.typeId === typeIdOnCtrlClick && !x.isHidden && !x.isInvalid,
|
|
@@ -188,7 +193,7 @@ export function PlaceholderDropZone({
|
|
|
188
193
|
label: insertMenuTitle || "Insert",
|
|
189
194
|
disabled: true,
|
|
190
195
|
className:
|
|
191
|
-
"bg-gray-
|
|
196
|
+
"bg-gray-50 text-dark font-medium py-1.5 text-xs border-b border-gray-3",
|
|
192
197
|
},
|
|
193
198
|
...insertOptions,
|
|
194
199
|
]);
|