@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
|
@@ -25,21 +25,25 @@ export type Link = {
|
|
|
25
25
|
targetItemLongId?: string;
|
|
26
26
|
targetItemName?: string;
|
|
27
27
|
originalHref?: string; // Preserves original Sitecore RTE href format
|
|
28
|
+
text?: string;
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
export function LinkEditorDialog({
|
|
31
32
|
linkValue,
|
|
32
33
|
onCancel,
|
|
33
34
|
onOk,
|
|
35
|
+
showText,
|
|
34
36
|
}: {
|
|
35
37
|
linkValue: Link;
|
|
36
38
|
onOk: (link: Link) => void;
|
|
37
39
|
onCancel: () => void;
|
|
40
|
+
showText?: boolean;
|
|
38
41
|
}) {
|
|
39
42
|
const [url, setUrl] = useState<string>();
|
|
40
43
|
const [targetWindow, setTargetWindow] = useState<string>();
|
|
41
44
|
const [customTarget, setCustomTarget] = useState<string>();
|
|
42
45
|
const [queryString, setQueryString] = useState<string>();
|
|
46
|
+
const [text, setText] = useState<string>();
|
|
43
47
|
const [activeTabIndex, setActiveTabIndex] = useState<number>(0);
|
|
44
48
|
const [selectedItemId, setSelectedItemId] = useState<string>("");
|
|
45
49
|
const [hoveredItemId, setHoveredItemId] = useState<string>();
|
|
@@ -59,6 +63,7 @@ export function LinkEditorDialog({
|
|
|
59
63
|
|
|
60
64
|
if (linkValue.itemId) setSelectedItemId(linkValue.itemId);
|
|
61
65
|
if (linkValue.queryString) setQueryString(linkValue.queryString);
|
|
66
|
+
if (linkValue.text) setText(linkValue.text);
|
|
62
67
|
}, [linkValue]);
|
|
63
68
|
|
|
64
69
|
const targetWindows = [
|
|
@@ -161,6 +166,20 @@ export function LinkEditorDialog({
|
|
|
161
166
|
</div>
|
|
162
167
|
<div className="flex h-full w-64 shrink-0 flex-col justify-center border-l border-gray-200 p-3">
|
|
163
168
|
<div className="flex flex-col gap-2">
|
|
169
|
+
{showText && (
|
|
170
|
+
<>
|
|
171
|
+
<label className="text-xs">Link description</label>
|
|
172
|
+
<Input
|
|
173
|
+
value={text || ""}
|
|
174
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
175
|
+
setText(e.target.value)
|
|
176
|
+
}
|
|
177
|
+
className="text-sm"
|
|
178
|
+
/>
|
|
179
|
+
</>
|
|
180
|
+
)}
|
|
181
|
+
</div>
|
|
182
|
+
<div className="mt-2 flex flex-col gap-2">
|
|
164
183
|
<label className="text-xs">Query String</label>
|
|
165
184
|
<Input
|
|
166
185
|
value={queryString || ""}
|
|
@@ -208,6 +227,7 @@ export function LinkEditorDialog({
|
|
|
208
227
|
customTarget: customTarget,
|
|
209
228
|
itemId: selectedItemId,
|
|
210
229
|
queryString: queryString,
|
|
230
|
+
text: text,
|
|
211
231
|
type: isExternal ? "external" : "internal",
|
|
212
232
|
});
|
|
213
233
|
}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { EditorView } from "../config/types";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
4
|
import { useEditContext } from "./client/editContext";
|
|
5
5
|
import { SidebarView } from "./sidebar/SidebarView";
|
|
6
6
|
import { Splitter, SplitterPanel } from "./ui/Splitter";
|
|
@@ -76,11 +76,11 @@ export default function MainLayout(props: MainLayoutProps) {
|
|
|
76
76
|
let className = props.className;
|
|
77
77
|
|
|
78
78
|
if (!editContext?.configuration.editor.embedded) {
|
|
79
|
-
className =
|
|
79
|
+
className = cn("fixed inset-0", props.className);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
return (
|
|
83
|
-
<div className={
|
|
83
|
+
<div className={cn("flex font-normal select-none", className)}>
|
|
84
84
|
<div className="flex flex-1">
|
|
85
85
|
{!props.view.hideViewSelector && <LeftToolbar />}
|
|
86
86
|
<div className="flex flex-1 flex-col">
|
|
@@ -9,7 +9,7 @@ import { ReactNode, useEffect, useRef, useState } from "react";
|
|
|
9
9
|
import { Button } from "../components/ui/button";
|
|
10
10
|
import DialogButtons from "./ui/DialogButtons";
|
|
11
11
|
import { Rect } from "./utils";
|
|
12
|
-
import {
|
|
12
|
+
import { cn } from "../lib/utils";
|
|
13
13
|
import {
|
|
14
14
|
PictureField,
|
|
15
15
|
PictureRawValue,
|
|
@@ -952,7 +952,7 @@ export function PictureCropper({
|
|
|
952
952
|
|
|
953
953
|
{/* Crop area border and interaction */}
|
|
954
954
|
<div
|
|
955
|
-
className={
|
|
955
|
+
className={cn(
|
|
956
956
|
"absolute cursor-move border-2 border-dashed",
|
|
957
957
|
isValid
|
|
958
958
|
? "border-theme-secondary"
|
|
@@ -983,7 +983,7 @@ export function PictureCropper({
|
|
|
983
983
|
{/* Dimensions text */}
|
|
984
984
|
{rect.width > 0.05 && (
|
|
985
985
|
<div
|
|
986
|
-
className={
|
|
986
|
+
className={cn(
|
|
987
987
|
"absolute right-1 bottom-1 rounded p-2 text-xs text-nowrap",
|
|
988
988
|
isValid
|
|
989
989
|
? "bg-black/40 text-white"
|
|
@@ -17,12 +17,14 @@ export function PictureEditor({
|
|
|
17
17
|
style,
|
|
18
18
|
forwardScrollevents,
|
|
19
19
|
isPageEditor,
|
|
20
|
+
onContextMenu,
|
|
20
21
|
}: {
|
|
21
22
|
field: PictureField;
|
|
22
23
|
variantName: string;
|
|
23
24
|
style?: React.CSSProperties;
|
|
24
25
|
forwardScrollevents?: boolean;
|
|
25
26
|
isPageEditor?: boolean;
|
|
27
|
+
onContextMenu?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
26
28
|
}) {
|
|
27
29
|
const [showCropper, setShowCropper] = useState(false);
|
|
28
30
|
const [fieldButtons, setFieldButtons] = useState<FieldButton[]>([]);
|
|
@@ -212,6 +214,7 @@ export function PictureEditor({
|
|
|
212
214
|
const itemId = field.descriptor.item?.id;
|
|
213
215
|
if (itemId) editContext?.select([itemId]);
|
|
214
216
|
}}
|
|
217
|
+
onContextMenu={onContextMenu}
|
|
215
218
|
onWheel={(e) => {
|
|
216
219
|
if (forwardScrollevents)
|
|
217
220
|
editContext?.pageView.editorIframe!?.contentWindow?.document.documentElement?.scrollBy(
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Dialog,
|
|
3
|
+
DialogContent,
|
|
4
|
+
DialogHeader,
|
|
5
|
+
DialogTitle,
|
|
6
|
+
} from "../components/ui/dialog";
|
|
2
7
|
|
|
3
8
|
import { useEditContext } from "./client/editContext";
|
|
4
9
|
|
|
5
10
|
import { useCallback, useEffect, useState } from "react";
|
|
6
|
-
import { Button } from "
|
|
11
|
+
import { Button } from "../components/ui/button";
|
|
7
12
|
import DialogButtons from "./ui/DialogButtons";
|
|
8
13
|
|
|
9
14
|
import { getPictureValue } from "./services/editService";
|
|
@@ -68,7 +73,7 @@ export function PictureEditorDialog({
|
|
|
68
73
|
imageSelected(
|
|
69
74
|
chosenImage,
|
|
70
75
|
variantName ?? selectedVariantName,
|
|
71
|
-
raw ?? rawValue
|
|
76
|
+
raw ?? rawValue,
|
|
72
77
|
);
|
|
73
78
|
}
|
|
74
79
|
|
|
@@ -83,7 +88,7 @@ export function PictureEditorDialog({
|
|
|
83
88
|
(!selectedVariant.aspectRatioLock ||
|
|
84
89
|
Math.abs(
|
|
85
90
|
selectedVariant.aspectRatioLock -
|
|
86
|
-
selectedVariant.region.width / selectedVariant.region.height
|
|
91
|
+
selectedVariant.region.width / selectedVariant.region.height,
|
|
87
92
|
) < 0.1)
|
|
88
93
|
)
|
|
89
94
|
setRect({
|
|
@@ -99,7 +104,7 @@ export function PictureEditorDialog({
|
|
|
99
104
|
|
|
100
105
|
const getPictureFieldValue = async (
|
|
101
106
|
field: Field,
|
|
102
|
-
rawValue: PictureRawValue
|
|
107
|
+
rawValue: PictureRawValue,
|
|
103
108
|
): Promise<PictureValue | null> => {
|
|
104
109
|
if (!editContext?.pageView.site) return null;
|
|
105
110
|
|
|
@@ -107,7 +112,7 @@ export function PictureEditorDialog({
|
|
|
107
112
|
field,
|
|
108
113
|
rawValue,
|
|
109
114
|
editContext.pageView.site?.name,
|
|
110
|
-
editContext.sessionId
|
|
115
|
+
editContext.sessionId,
|
|
111
116
|
);
|
|
112
117
|
};
|
|
113
118
|
|
|
@@ -115,7 +120,7 @@ export function PictureEditorDialog({
|
|
|
115
120
|
async (
|
|
116
121
|
imageId: string,
|
|
117
122
|
variantName?: string,
|
|
118
|
-
rawValue?: PictureRawValue
|
|
123
|
+
rawValue?: PictureRawValue,
|
|
119
124
|
) => {
|
|
120
125
|
if (!variantName || !rawValue) return;
|
|
121
126
|
|
|
@@ -135,7 +140,7 @@ export function PictureEditorDialog({
|
|
|
135
140
|
setPictureValue(newValue);
|
|
136
141
|
}
|
|
137
142
|
},
|
|
138
|
-
[]
|
|
143
|
+
[],
|
|
139
144
|
);
|
|
140
145
|
const updateRawValue = async (rawValue: PictureRawValue) => {
|
|
141
146
|
setRawValue(rawValue);
|
|
@@ -151,7 +156,7 @@ export function PictureEditorDialog({
|
|
|
151
156
|
|
|
152
157
|
if (selectedVariant) {
|
|
153
158
|
let selected = rawValue.Variants?.find(
|
|
154
|
-
(x: PictureRawVariant) => x.Name == selectedVariantName
|
|
159
|
+
(x: PictureRawVariant) => x.Name == selectedVariantName,
|
|
155
160
|
);
|
|
156
161
|
if (!selected) {
|
|
157
162
|
selected = {
|
|
@@ -177,158 +182,175 @@ export function PictureEditorDialog({
|
|
|
177
182
|
return (
|
|
178
183
|
<>
|
|
179
184
|
<Dialog
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
185
|
+
open={true}
|
|
186
|
+
onOpenChange={(open) => {
|
|
187
|
+
if (!open) {
|
|
188
|
+
onCancel();
|
|
189
|
+
}
|
|
190
|
+
}}
|
|
184
191
|
>
|
|
185
|
-
<
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
192
|
+
<DialogContent
|
|
193
|
+
className="max-w-none"
|
|
194
|
+
style={{ width: "70vw", height: "70vh" }}
|
|
195
|
+
>
|
|
196
|
+
<DialogHeader>
|
|
197
|
+
<DialogTitle>{"Edit " + field.name}</DialogTitle>
|
|
198
|
+
</DialogHeader>
|
|
199
|
+
<div className="flex-1 overflow-auto">
|
|
200
|
+
<div className="justify flex h-full flex-col gap-1">
|
|
201
|
+
<div className="flex flex-1 gap-2">
|
|
202
|
+
<div className="relative h-full w-48 border-r pt-3">
|
|
203
|
+
<div className="absolute inset-0 flex flex-col gap-6 overflow-y-auto">
|
|
204
|
+
{pictureValue &&
|
|
205
|
+
pictureValue.variants?.map((variant) => (
|
|
206
|
+
<div
|
|
207
|
+
key={variant.name}
|
|
208
|
+
onClick={() => setSelectedVariantName(variant.name)}
|
|
209
|
+
className="flex cursor-pointer flex-col items-center justify-center gap-1 text-xs"
|
|
210
|
+
>
|
|
211
|
+
<div
|
|
212
|
+
className={
|
|
213
|
+
"relative flex h-40 w-40 items-center justify-center border" +
|
|
214
|
+
(selectedVariantName == variant.name
|
|
215
|
+
? " shadow-xl"
|
|
216
|
+
: "")
|
|
217
|
+
}
|
|
218
|
+
>
|
|
219
|
+
{variant.src && <img src={variant.thumbSrc} />}
|
|
212
220
|
</div>
|
|
213
|
-
<div>
|
|
214
|
-
|
|
221
|
+
<div className="w-40">
|
|
222
|
+
<div>{variant.name}</div>
|
|
223
|
+
<div>{variant.aspectRatioLockText}</div>
|
|
224
|
+
<div>
|
|
225
|
+
<div className="break-all">
|
|
226
|
+
Name: {variant.mediaItemName}
|
|
227
|
+
</div>
|
|
228
|
+
<div>
|
|
229
|
+
Orig. size: {variant.width} x {variant.height}
|
|
230
|
+
</div>
|
|
231
|
+
{(variant.width < 1 || variant.height < 1) && (
|
|
232
|
+
<span>
|
|
233
|
+
{" "}
|
|
234
|
+
<i className="pi pi-exclamation-triangle text-red-600"></i>
|
|
235
|
+
</span>
|
|
236
|
+
)}
|
|
237
|
+
</div>
|
|
215
238
|
</div>
|
|
216
|
-
{(variant.width < 1 || variant.height < 1) && (
|
|
217
|
-
<span>
|
|
218
|
-
{" "}
|
|
219
|
-
<i className="pi pi-exclamation-triangle text-red-600 "></i>
|
|
220
|
-
</span>
|
|
221
|
-
)}
|
|
222
239
|
</div>
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
const bounds = ev.currentTarget.getBoundingClientRect();
|
|
240
|
+
))}
|
|
241
|
+
</div>
|
|
242
|
+
{usage && <div className="text-xs">{usage}</div>}
|
|
243
|
+
</div>
|
|
244
|
+
<div className="relative flex-1 p-3">
|
|
245
|
+
<div className="align-center absolute inset-0 top-3 flex justify-center overflow-auto select-none">
|
|
246
|
+
{selectedVariant && (
|
|
247
|
+
<div
|
|
248
|
+
className="relative"
|
|
249
|
+
onDoubleClick={() => selectMedia()}
|
|
250
|
+
onMouseDown={(ev) => {
|
|
251
|
+
ev.preventDefault();
|
|
252
|
+
ev.stopPropagation();
|
|
253
|
+
const bounds =
|
|
254
|
+
ev.currentTarget.getBoundingClientRect();
|
|
239
255
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
256
|
+
setRect({
|
|
257
|
+
left: (ev.clientX - bounds.left) / bounds.width,
|
|
258
|
+
top: (ev.clientY - bounds.top) / bounds.height,
|
|
259
|
+
width: 0,
|
|
260
|
+
height: 0,
|
|
261
|
+
});
|
|
262
|
+
}}
|
|
263
|
+
onMouseMoveCapture={(ev) => {
|
|
264
|
+
if (ev.buttons === 1) {
|
|
265
|
+
const bounds =
|
|
266
|
+
ev.currentTarget.getBoundingClientRect();
|
|
250
267
|
|
|
251
|
-
|
|
252
|
-
|
|
268
|
+
const width =
|
|
269
|
+
(ev.clientX - bounds.left) / bounds.width -
|
|
270
|
+
rect.left;
|
|
253
271
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
272
|
+
const newRect = {
|
|
273
|
+
...rect,
|
|
274
|
+
width,
|
|
275
|
+
height: selectedVariant.aspectRatioLock
|
|
276
|
+
? width / selectedVariant.aspectRatioLock
|
|
277
|
+
: (ev.clientY - bounds.top) / bounds.height -
|
|
278
|
+
rect.top,
|
|
279
|
+
};
|
|
262
280
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
281
|
+
setRect(newRect);
|
|
282
|
+
ev.preventDefault();
|
|
283
|
+
ev.stopPropagation();
|
|
284
|
+
}
|
|
285
|
+
}}
|
|
286
|
+
onMouseUp={() => setVariantCrop()}
|
|
287
|
+
>
|
|
288
|
+
<img
|
|
289
|
+
src={
|
|
290
|
+
selectedVariant.originalSrc ?? selectedVariant.src
|
|
291
|
+
}
|
|
292
|
+
className="h-full w-full object-contain"
|
|
293
|
+
/>
|
|
294
|
+
<div
|
|
295
|
+
className="bg-opacity-70 absolute bg-gray-300"
|
|
296
|
+
style={{
|
|
297
|
+
left: rect.left * 100 + "%",
|
|
298
|
+
top: rect.top * 100 + "%",
|
|
299
|
+
width: rect.width * 100 + "%",
|
|
300
|
+
height: rect.height * 100 + "%",
|
|
301
|
+
}}
|
|
302
|
+
/>
|
|
303
|
+
</div>
|
|
304
|
+
)}
|
|
305
|
+
{selectedVariant && (
|
|
306
|
+
<div
|
|
307
|
+
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
|
+
onClick={() => selectMedia()}
|
|
309
|
+
>
|
|
310
|
+
<i className="pi pi-pencil text-xl"></i>
|
|
311
|
+
Choose
|
|
312
|
+
</div>
|
|
313
|
+
)}
|
|
292
314
|
</div>
|
|
293
|
-
|
|
315
|
+
</div>
|
|
294
316
|
</div>
|
|
317
|
+
<DialogButtons>
|
|
318
|
+
<Button
|
|
319
|
+
size="sm"
|
|
320
|
+
onClick={() => {
|
|
321
|
+
if (pictureValue) {
|
|
322
|
+
if (field) {
|
|
323
|
+
editContext?.operations.editField({
|
|
324
|
+
field: field.descriptor,
|
|
325
|
+
rawValue: JSON.stringify(rawValue),
|
|
326
|
+
refresh: "immediate",
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
onOk(pictureValue);
|
|
330
|
+
}
|
|
331
|
+
}}
|
|
332
|
+
>
|
|
333
|
+
Ok
|
|
334
|
+
</Button>
|
|
335
|
+
<Button
|
|
336
|
+
onClick={() => {
|
|
337
|
+
onCancel();
|
|
338
|
+
}}
|
|
339
|
+
size="sm"
|
|
340
|
+
>
|
|
341
|
+
Cancel
|
|
342
|
+
</Button>
|
|
343
|
+
</DialogButtons>
|
|
295
344
|
</div>
|
|
296
345
|
</div>
|
|
297
|
-
|
|
298
|
-
<Button
|
|
299
|
-
size="small"
|
|
300
|
-
onClick={() => {
|
|
301
|
-
if (pictureValue) {
|
|
302
|
-
if (field) {
|
|
303
|
-
editContext?.operations.editField({
|
|
304
|
-
field: field.descriptor,
|
|
305
|
-
rawValue: JSON.stringify(rawValue),
|
|
306
|
-
refresh: "immediate",
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
onOk(pictureValue);
|
|
310
|
-
}
|
|
311
|
-
}}
|
|
312
|
-
>
|
|
313
|
-
Ok
|
|
314
|
-
</Button>
|
|
315
|
-
<Button
|
|
316
|
-
onClick={() => {
|
|
317
|
-
onCancel();
|
|
318
|
-
}}
|
|
319
|
-
size="small"
|
|
320
|
-
>
|
|
321
|
-
Cancel
|
|
322
|
-
</Button>
|
|
323
|
-
</DialogButtons>
|
|
324
|
-
</div>
|
|
346
|
+
</DialogContent>
|
|
325
347
|
</Dialog>
|
|
326
348
|
</>
|
|
327
349
|
);
|
|
328
350
|
}
|
|
329
351
|
function getUsage(
|
|
330
352
|
pictureValue: PictureValue | undefined,
|
|
331
|
-
params: PictureParams | MediaPictureParams | undefined
|
|
353
|
+
params: PictureParams | MediaPictureParams | undefined,
|
|
332
354
|
) {
|
|
333
355
|
if (!params) return;
|
|
334
356
|
if (!pictureValue) return;
|
|
@@ -343,7 +365,7 @@ function getUsage(
|
|
|
343
365
|
source,
|
|
344
366
|
variant: getRenderedPictureVariant(
|
|
345
367
|
mediaParams[source],
|
|
346
|
-
pictureValue.variants
|
|
368
|
+
pictureValue.variants,
|
|
347
369
|
),
|
|
348
370
|
}))
|
|
349
371
|
.filter((x) => x.variant);
|
|
@@ -371,7 +393,7 @@ function getUsage(
|
|
|
371
393
|
{
|
|
372
394
|
getRenderedPictureVariant(
|
|
373
395
|
params as PictureParams,
|
|
374
|
-
pictureValue.variants
|
|
396
|
+
pictureValue.variants,
|
|
375
397
|
)?.name
|
|
376
398
|
}
|
|
377
399
|
.
|
package/src/editor/Terminal.tsx
CHANGED
|
@@ -5,9 +5,8 @@ import React, {
|
|
|
5
5
|
useState,
|
|
6
6
|
useImperativeHandle,
|
|
7
7
|
} from "react";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { classNames } from "primereact/utils";
|
|
8
|
+
import { Textarea } from "../components/ui/textarea";
|
|
9
|
+
import { cn } from "../lib/utils";
|
|
11
10
|
import { SimpleIconButton } from "./ui/SimpleIconButton";
|
|
12
11
|
import { Trash2, Send } from "lucide-react";
|
|
13
12
|
import { TerminalService } from "primereact/terminalservice";
|
|
@@ -211,7 +210,7 @@ export const Terminal = forwardRef<
|
|
|
211
210
|
}));
|
|
212
211
|
|
|
213
212
|
return (
|
|
214
|
-
<div className={
|
|
213
|
+
<div className={cn("flex h-full flex-col", className)}>
|
|
215
214
|
<div className="flex items-center justify-between gap-2 border-b border-gray-200 p-1 text-xs">
|
|
216
215
|
<SimpleIconButton
|
|
217
216
|
onClick={() => {
|
|
@@ -246,12 +245,12 @@ export const Terminal = forwardRef<
|
|
|
246
245
|
</div>
|
|
247
246
|
<div className="flex flex-col p-1 pb-0">
|
|
248
247
|
{infobar}
|
|
249
|
-
<
|
|
248
|
+
<Textarea
|
|
250
249
|
ref={inputRef}
|
|
251
250
|
value={prompt}
|
|
252
251
|
className="flex-1 resize-none self-stretch rounded border border-gray-300 text-xs"
|
|
253
252
|
onKeyDown={handleKeyPress}
|
|
254
|
-
onChange={(e) => {
|
|
253
|
+
onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
255
254
|
setPrompt(e.target.value);
|
|
256
255
|
// Reset history index when user starts typing
|
|
257
256
|
if (currentHistoryIndex !== -1) {
|