@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
|
@@ -516,6 +516,7 @@ export function ContextInfoBar({
|
|
|
516
516
|
onClick={() => setIsCollapsed(!isCollapsed)}
|
|
517
517
|
role="button"
|
|
518
518
|
aria-label={isCollapsed ? "Expand context" : "Collapse context"}
|
|
519
|
+
data-testid="context-toggle"
|
|
519
520
|
>
|
|
520
521
|
<div className="min-w-0 flex-1">
|
|
521
522
|
<div className="text-2xs text-gray-1">Context</div>
|
|
@@ -537,11 +538,18 @@ export function ContextInfoBar({
|
|
|
537
538
|
/>
|
|
538
539
|
</div>
|
|
539
540
|
{!isCollapsed && (
|
|
540
|
-
<div className="flex
|
|
541
|
-
<div className="flex
|
|
542
|
-
|
|
541
|
+
<div className="flex flex-col gap-2">
|
|
542
|
+
<div className="flex items-center justify-between text-xs text-gray-600">
|
|
543
|
+
<div className="flex flex-wrap items-center gap-2">{chips}</div>
|
|
544
|
+
</div>
|
|
545
|
+
<div className="flex flex-col items-start gap-1">
|
|
543
546
|
{canAddPage && (
|
|
544
|
-
<Button
|
|
547
|
+
<Button
|
|
548
|
+
size="xs"
|
|
549
|
+
variant="outline"
|
|
550
|
+
onClick={addPagesToContext}
|
|
551
|
+
data-testid="add-current-item"
|
|
552
|
+
>
|
|
545
553
|
<Plus className="mr-1 h-3 w-3" strokeWidth={1} /> Add current
|
|
546
554
|
item
|
|
547
555
|
</Button>
|
|
@@ -556,9 +564,9 @@ export function ContextInfoBar({
|
|
|
556
564
|
components
|
|
557
565
|
</Button>
|
|
558
566
|
)}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
567
|
+
</div>
|
|
568
|
+
<div className="text-2xs text-gray-400">
|
|
569
|
+
Tip: Drag items or components here to add them
|
|
562
570
|
</div>
|
|
563
571
|
</div>
|
|
564
572
|
)}
|
|
@@ -1903,6 +1903,9 @@ export function EditorShell({
|
|
|
1903
1903
|
contextMenuRef.current?.show(event, items);
|
|
1904
1904
|
setCurrentOverlay("context-menu");
|
|
1905
1905
|
},
|
|
1906
|
+
updateContextMenu: (items: MenuItem[]) => {
|
|
1907
|
+
contextMenuRef.current?.update(items);
|
|
1908
|
+
},
|
|
1906
1909
|
|
|
1907
1910
|
showFieldEditorPopup: (fields: Field[], sections: string[], ev: any) => {
|
|
1908
1911
|
setCurrentOverlay("fields");
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
Dialog,
|
|
3
|
+
DialogContent,
|
|
4
|
+
DialogHeader,
|
|
5
|
+
DialogTitle,
|
|
6
|
+
} from "../../components/ui/dialog";
|
|
3
7
|
import { forwardRef, useImperativeHandle, useState } from "react";
|
|
4
8
|
|
|
5
9
|
export interface GenericDialogHandle {
|
|
@@ -38,13 +42,13 @@ export const GenericDialog = forwardRef<GenericDialogHandle>((_, ref) => {
|
|
|
38
42
|
}));
|
|
39
43
|
|
|
40
44
|
return (
|
|
41
|
-
<Dialog
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
<Dialog open={visible} onOpenChange={(open) => !open && setVisible(false)}>
|
|
46
|
+
<DialogContent className="max-w-none" style={{ width, height }}>
|
|
47
|
+
<DialogHeader>
|
|
48
|
+
<DialogTitle>{title}</DialogTitle>
|
|
49
|
+
</DialogHeader>
|
|
50
|
+
<div className="flex-1 overflow-auto p-6">{content}</div>
|
|
51
|
+
</DialogContent>
|
|
48
52
|
</Dialog>
|
|
49
53
|
);
|
|
50
54
|
});
|
|
@@ -15,7 +15,7 @@ import type {
|
|
|
15
15
|
WebSocketMessage,
|
|
16
16
|
} from "./EditorShell";
|
|
17
17
|
import type { QuotaInfo } from "./hooks/useQuota";
|
|
18
|
-
import { MenuItem } from "
|
|
18
|
+
import { MenuItem } from "../../config/types";
|
|
19
19
|
import { Command, CommandData } from "../commands/commands";
|
|
20
20
|
import { ComponentDetails } from "../services/componentDesignerService";
|
|
21
21
|
import { PageViewContext } from "../page-viewer/pageViewContext";
|
|
@@ -248,6 +248,7 @@ export type EditContextType = {
|
|
|
248
248
|
dismissFieldAction: (field: FieldDescriptor) => void;
|
|
249
249
|
activeFieldActions: FieldAction[];
|
|
250
250
|
showContextMenu(e: any, menuItems: MenuItem[]): void;
|
|
251
|
+
updateContextMenu(menuItems: MenuItem[]): void;
|
|
251
252
|
setCurrentOverlay: React.Dispatch<React.SetStateAction<any>>;
|
|
252
253
|
currentOverlay?: any;
|
|
253
254
|
|
|
@@ -34,7 +34,7 @@ export function EditorChrome(props: {
|
|
|
34
34
|
centerPanelView={centerPanelView}
|
|
35
35
|
rightSidebar={
|
|
36
36
|
currentView.rightSidebar &&
|
|
37
|
-
editContext.page &&
|
|
37
|
+
(editContext.page || editContext.contentEditorItem?.hasLayout) &&
|
|
38
38
|
showComponentNavigator && (
|
|
39
39
|
<SidebarView
|
|
40
40
|
sidebar={currentView.rightSidebar}
|
|
@@ -49,9 +49,13 @@ export function EditorChrome(props: {
|
|
|
49
49
|
farRightSidebar={
|
|
50
50
|
showAgentsPanel &&
|
|
51
51
|
!editContext.currentWizardId &&
|
|
52
|
-
![
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
![
|
|
53
|
+
"splash-screen",
|
|
54
|
+
"open-page",
|
|
55
|
+
"new-page",
|
|
56
|
+
"page-wizard",
|
|
57
|
+
"control-center",
|
|
58
|
+
].includes(viewName) && (
|
|
55
59
|
<SidebarView
|
|
56
60
|
sidebar={{
|
|
57
61
|
title: "Agents",
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { Button } from "
|
|
2
|
-
import {
|
|
1
|
+
import { Button } from "../../../components/ui/button";
|
|
2
|
+
import {
|
|
3
|
+
Dialog,
|
|
4
|
+
DialogContent,
|
|
5
|
+
DialogHeader,
|
|
6
|
+
DialogTitle,
|
|
7
|
+
} from "../../../components/ui/dialog";
|
|
3
8
|
import { useEffect, useState } from "react";
|
|
4
9
|
import DialogButtons from "../../ui/DialogButtons";
|
|
5
10
|
import { DialogProps } from "../../client/editContext";
|
|
@@ -119,7 +124,9 @@ export function LocalizeItemDialog(
|
|
|
119
124
|
</div>
|
|
120
125
|
)}
|
|
121
126
|
<DialogButtons>
|
|
122
|
-
<Button onClick={() => props.onClose?.(null)}
|
|
127
|
+
<Button onClick={() => props.onClose?.(null)} size="sm">
|
|
128
|
+
Close
|
|
129
|
+
</Button>
|
|
123
130
|
</DialogButtons>
|
|
124
131
|
</div>
|
|
125
132
|
);
|
|
@@ -179,8 +186,12 @@ export function LocalizeItemDialog(
|
|
|
179
186
|
</div>
|
|
180
187
|
</div>
|
|
181
188
|
<DialogButtons>
|
|
182
|
-
<Button onClick={startLocalization}
|
|
183
|
-
|
|
189
|
+
<Button onClick={startLocalization} size="sm">
|
|
190
|
+
Start
|
|
191
|
+
</Button>
|
|
192
|
+
<Button onClick={() => props.onClose?.(null)} size="sm">
|
|
193
|
+
Cancel
|
|
194
|
+
</Button>
|
|
184
195
|
</DialogButtons>
|
|
185
196
|
</div>
|
|
186
197
|
);
|
|
@@ -188,14 +199,22 @@ export function LocalizeItemDialog(
|
|
|
188
199
|
|
|
189
200
|
return (
|
|
190
201
|
<Dialog
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
202
|
+
open={true}
|
|
203
|
+
onOpenChange={(open) => {
|
|
204
|
+
if (!open) {
|
|
205
|
+
props.onClose?.(null);
|
|
206
|
+
}
|
|
194
207
|
}}
|
|
195
|
-
style={{ width: "75vw", height: "75vh" }}
|
|
196
|
-
header="Localize"
|
|
197
208
|
>
|
|
198
|
-
|
|
209
|
+
<DialogContent
|
|
210
|
+
className="max-w-none"
|
|
211
|
+
style={{ width: "75vw", height: "75vh" }}
|
|
212
|
+
>
|
|
213
|
+
<DialogHeader>
|
|
214
|
+
<DialogTitle>Localize</DialogTitle>
|
|
215
|
+
</DialogHeader>
|
|
216
|
+
<div className="flex-1 overflow-auto">{dialogContent}</div>
|
|
217
|
+
</DialogContent>
|
|
199
218
|
</Dialog>
|
|
200
219
|
);
|
|
201
220
|
}
|
|
@@ -3,7 +3,7 @@ import { useEditContext } from "../client/editContext";
|
|
|
3
3
|
import { MoveCopyItemsCommand } from "../commands/itemCommands";
|
|
4
4
|
import { FullItem, ItemDescriptor } from "../pageModel";
|
|
5
5
|
import { ScrollingContentTree } from "../ScrollingContentTree";
|
|
6
|
-
import { Button } from "
|
|
6
|
+
import { Button } from "../../components/ui/button";
|
|
7
7
|
|
|
8
8
|
export const CopyMoveMenuTemplate = ({
|
|
9
9
|
items,
|
|
@@ -85,7 +85,7 @@ export const CopyMoveMenuTemplate = ({
|
|
|
85
85
|
</div>
|
|
86
86
|
<div className="flex justify-end">
|
|
87
87
|
<Button
|
|
88
|
-
|
|
88
|
+
size="sm"
|
|
89
89
|
onClick={() => {
|
|
90
90
|
if (!selectedItem) return;
|
|
91
91
|
const result = editContext?.executeCommand({
|
|
@@ -94,7 +94,9 @@ export const CopyMoveMenuTemplate = ({
|
|
|
94
94
|
});
|
|
95
95
|
commandCallback?.(command, result);
|
|
96
96
|
}}
|
|
97
|
-
|
|
97
|
+
>
|
|
98
|
+
{mode === "copy" ? "Copy" : "Move"}
|
|
99
|
+
</Button>
|
|
98
100
|
</div>
|
|
99
101
|
</div>
|
|
100
102
|
</div>
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
Trash2,
|
|
10
10
|
} from "lucide-react";
|
|
11
11
|
import { Button } from "../../components/ui/button";
|
|
12
|
-
import {
|
|
12
|
+
import { cn } from "../../lib/utils";
|
|
13
13
|
import { formatDateOnly, formatDateTime } from "../utils";
|
|
14
14
|
import {
|
|
15
15
|
IndexStatus,
|
|
@@ -201,7 +201,6 @@ export function IndexOverview() {
|
|
|
201
201
|
editContext?.switchView("control-center");
|
|
202
202
|
}, [editContext]);
|
|
203
203
|
|
|
204
|
-
|
|
205
204
|
const getIndexStatusInfo = (
|
|
206
205
|
isCollecting: boolean,
|
|
207
206
|
isSubmitting: boolean,
|
|
@@ -212,33 +211,55 @@ export function IndexOverview() {
|
|
|
212
211
|
const batches = indexStatus?.batches || [];
|
|
213
212
|
const inProgress = batches.some((b) => {
|
|
214
213
|
const s = (b.status || "").toLowerCase();
|
|
215
|
-
return
|
|
216
|
-
s === "submitted" || s === "processing" || s === "queued"
|
|
217
|
-
);
|
|
214
|
+
return s === "submitted" || s === "processing" || s === "queued";
|
|
218
215
|
});
|
|
219
216
|
|
|
220
217
|
if (isCollecting) {
|
|
221
|
-
return {
|
|
218
|
+
return {
|
|
219
|
+
statusLabel: "Collecting items",
|
|
220
|
+
statusClass: "text-indigo-600",
|
|
221
|
+
hasSettingsIssue: false,
|
|
222
|
+
};
|
|
222
223
|
} else if (isSubmitting || inProgress) {
|
|
223
|
-
return {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
return {
|
|
225
|
+
statusLabel: "Generating Embeddings",
|
|
226
|
+
statusClass: "text-blue-600",
|
|
227
|
+
hasSettingsIssue: false,
|
|
228
|
+
};
|
|
229
|
+
} else if (importStatus?.isImporting) {
|
|
230
|
+
return {
|
|
231
|
+
statusLabel: importStatus.status || "Importing embeddings",
|
|
227
232
|
statusClass: "text-purple-600",
|
|
228
|
-
hasSettingsIssue: false
|
|
233
|
+
hasSettingsIssue: false,
|
|
229
234
|
};
|
|
230
235
|
} else if (centroidsStatus?.isPopulating) {
|
|
231
|
-
return {
|
|
232
|
-
statusLabel: centroidsStatus.status || "Populating centroids",
|
|
236
|
+
return {
|
|
237
|
+
statusLabel: centroidsStatus.status || "Populating centroids",
|
|
233
238
|
statusClass: "text-pink-600",
|
|
234
|
-
hasSettingsIssue: false
|
|
239
|
+
hasSettingsIssue: false,
|
|
235
240
|
};
|
|
236
241
|
} else if (indexStatus?.rebuilding) {
|
|
237
|
-
return {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
+
return {
|
|
243
|
+
statusLabel: "Rebuilding",
|
|
244
|
+
statusClass: "text-orange-600",
|
|
245
|
+
hasSettingsIssue: false,
|
|
246
|
+
};
|
|
247
|
+
} else if (
|
|
248
|
+
indexStatus?.messages != null &&
|
|
249
|
+
indexStatus.messages.length > 0 &&
|
|
250
|
+
indexStatus.messages[0]?.message
|
|
251
|
+
) {
|
|
252
|
+
return {
|
|
253
|
+
statusLabel: indexStatus.messages[0].message,
|
|
254
|
+
statusClass: "text-red-600",
|
|
255
|
+
hasSettingsIssue: true,
|
|
256
|
+
};
|
|
257
|
+
} else {
|
|
258
|
+
return {
|
|
259
|
+
statusLabel: "Ready",
|
|
260
|
+
statusClass: "text-green-600",
|
|
261
|
+
hasSettingsIssue: false,
|
|
262
|
+
};
|
|
242
263
|
}
|
|
243
264
|
};
|
|
244
265
|
|
|
@@ -281,7 +302,7 @@ export function IndexOverview() {
|
|
|
281
302
|
<button
|
|
282
303
|
onClick={handleSubmitStaged}
|
|
283
304
|
disabled={isSubmitting || stagedCount === 0}
|
|
284
|
-
className={
|
|
305
|
+
className={cn(
|
|
285
306
|
"flex items-center gap-2 rounded px-3 py-1.5 text-sm font-medium transition-colors",
|
|
286
307
|
{
|
|
287
308
|
"bg-amber-600 text-white hover:bg-amber-700":
|
|
@@ -299,7 +320,7 @@ export function IndexOverview() {
|
|
|
299
320
|
<button
|
|
300
321
|
onClick={handleStartDirect}
|
|
301
322
|
disabled={isStartingDirect || stagedCount === 0}
|
|
302
|
-
className={
|
|
323
|
+
className={cn(
|
|
303
324
|
"flex items-center gap-2 rounded px-3 py-1.5 text-sm font-medium transition-colors",
|
|
304
325
|
{
|
|
305
326
|
"bg-rose-600 text-white hover:bg-rose-700":
|
|
@@ -321,7 +342,7 @@ export function IndexOverview() {
|
|
|
321
342
|
<button
|
|
322
343
|
onClick={handleFinalize}
|
|
323
344
|
disabled={isFinalizing}
|
|
324
|
-
className={
|
|
345
|
+
className={cn(
|
|
325
346
|
"flex items-center gap-2 rounded px-3 py-1.5 text-sm font-medium transition-colors",
|
|
326
347
|
{
|
|
327
348
|
"bg-green-600 text-white hover:bg-green-700":
|
|
@@ -340,7 +361,7 @@ export function IndexOverview() {
|
|
|
340
361
|
<button
|
|
341
362
|
onClick={handleCollectAndUpload}
|
|
342
363
|
disabled={isCollecting}
|
|
343
|
-
className={
|
|
364
|
+
className={cn(
|
|
344
365
|
"flex items-center gap-2 rounded px-3 py-1.5 text-sm font-medium transition-colors",
|
|
345
366
|
{
|
|
346
367
|
"bg-indigo-600 text-white hover:bg-indigo-700":
|
|
@@ -369,7 +390,7 @@ export function IndexOverview() {
|
|
|
369
390
|
<button
|
|
370
391
|
onClick={handlePopulateCentroids}
|
|
371
392
|
disabled={centroidsStatus?.isPopulating || isPopulating}
|
|
372
|
-
className={
|
|
393
|
+
className={cn(
|
|
373
394
|
"flex items-center gap-2 rounded px-3 py-1.5 text-sm font-medium transition-colors",
|
|
374
395
|
{
|
|
375
396
|
"bg-purple-500 text-white hover:bg-purple-600":
|
|
@@ -387,7 +408,7 @@ export function IndexOverview() {
|
|
|
387
408
|
<button
|
|
388
409
|
onClick={handleCleanup}
|
|
389
410
|
disabled={isCleaning}
|
|
390
|
-
className={
|
|
411
|
+
className={cn(
|
|
391
412
|
"flex items-center gap-2 rounded px-3 py-1.5 text-sm font-medium transition-colors",
|
|
392
413
|
{
|
|
393
414
|
"bg-gray-100 text-gray-700 hover:bg-gray-200": !isCleaning,
|
|
@@ -427,20 +448,28 @@ export function IndexOverview() {
|
|
|
427
448
|
<div className="rounded bg-gray-50 p-3">
|
|
428
449
|
<div className="text-sm text-gray-600">Status</div>
|
|
429
450
|
{(() => {
|
|
430
|
-
const { statusLabel, statusClass, hasSettingsIssue } =
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
451
|
+
const { statusLabel, statusClass, hasSettingsIssue } =
|
|
452
|
+
getIndexStatusInfo(
|
|
453
|
+
isCollecting,
|
|
454
|
+
isSubmitting,
|
|
455
|
+
indexStatus,
|
|
456
|
+
importStatus,
|
|
457
|
+
centroidsStatus,
|
|
458
|
+
);
|
|
437
459
|
return (
|
|
438
460
|
<div
|
|
439
|
-
className={
|
|
461
|
+
className={cn(
|
|
462
|
+
"flex items-center gap-2 text-sm font-medium",
|
|
463
|
+
statusClass,
|
|
464
|
+
)}
|
|
440
465
|
>
|
|
441
466
|
{statusLabel}
|
|
442
467
|
{hasSettingsIssue && (
|
|
443
|
-
<Button
|
|
468
|
+
<Button
|
|
469
|
+
size="sm"
|
|
470
|
+
variant="outline"
|
|
471
|
+
onClick={goToSettings}
|
|
472
|
+
>
|
|
444
473
|
<ExternalLink className="h-4 w-4" strokeWidth={1} />
|
|
445
474
|
Settings
|
|
446
475
|
</Button>
|
|
@@ -99,11 +99,16 @@ export function SettingsSetupStep() {
|
|
|
99
99
|
setCreatingSettings(true);
|
|
100
100
|
setSettingsError(null);
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
// Resolve /sitecore/content/Settings to get the current parent ID (do not rely on fixed GUID)
|
|
103
|
+
const settingsParent = await resolvePathUnderContent(["Settings"]);
|
|
104
|
+
if (!settingsParent) {
|
|
105
|
+
setSettingsState("error");
|
|
106
|
+
setSettingsError(
|
|
107
|
+
"Settings parent not found at /sitecore/content/Settings",
|
|
108
|
+
);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const parentDescriptor: ItemDescriptor = settingsParent;
|
|
107
112
|
|
|
108
113
|
const branchOrTemplateId = "f133cae9-8fbc-4cdf-868e-321a533dec5b";
|
|
109
114
|
|
|
@@ -126,7 +131,7 @@ export function SettingsSetupStep() {
|
|
|
126
131
|
} finally {
|
|
127
132
|
setCreatingSettings(false);
|
|
128
133
|
}
|
|
129
|
-
}, [editContext, userLang]);
|
|
134
|
+
}, [editContext, userLang, resolvePathUnderContent]);
|
|
130
135
|
|
|
131
136
|
React.useEffect(() => {
|
|
132
137
|
checkSettingsItem();
|
|
@@ -4,7 +4,7 @@ import { useEditContext } from "../client/editContext";
|
|
|
4
4
|
|
|
5
5
|
import { Checkbox } from "../../components/ui/checkbox";
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { Loader2 } from "lucide-react";
|
|
8
8
|
import { CheckboxField } from "../fieldTypes";
|
|
9
9
|
|
|
10
10
|
export function CheckboxEditor({
|
|
@@ -26,7 +26,7 @@ export function CheckboxEditor({
|
|
|
26
26
|
if (!fieldItem) return;
|
|
27
27
|
|
|
28
28
|
if (isUpdating) {
|
|
29
|
-
return <
|
|
29
|
+
return <Loader2 className="h-[18px] w-[18px] animate-spin" />;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
return (
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "../../components/ui/popover";
|
|
14
14
|
import { Calendar } from "../../components/ui/calendar";
|
|
15
15
|
import { useEffect, useState } from "react";
|
|
16
|
-
import {
|
|
16
|
+
import { Loader2 } from "lucide-react";
|
|
17
17
|
import { DateField, DateFieldValue } from "../fieldTypes";
|
|
18
18
|
|
|
19
19
|
// Helper function to format date to compact ISO format: YYYYMMDDTHHMMSSZ
|
|
@@ -79,7 +79,7 @@ export function DateFieldEditor({
|
|
|
79
79
|
if (!fieldItem) return null;
|
|
80
80
|
|
|
81
81
|
if (isUpdating) {
|
|
82
|
-
return <
|
|
82
|
+
return <Loader2 className="h-[18px] w-[18px] animate-spin" />;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
const handleDateSelect = async (selectedDate: Date | undefined) => {
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
import { Calendar } from "../../components/ui/calendar";
|
|
15
15
|
import { Input } from "../../components/ui/input";
|
|
16
16
|
import { useEffect, useState } from "react";
|
|
17
|
-
import { ProgressSpinner } from "primereact/progressspinner";
|
|
18
17
|
import { DateTimeField, DateTimeFieldValue } from "../fieldTypes";
|
|
19
18
|
|
|
20
19
|
// Helper function to format date to compact ISO format: YYYYMMDDTHHMMSSZ
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useEditContext } from "../client/editContext";
|
|
4
|
-
import {
|
|
4
|
+
import { Input } from "../../components/ui/input";
|
|
5
5
|
import { ImageField } from "../fieldTypes";
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
7
7
|
import { ImageEditor } from "../ImageEditor";
|
|
@@ -43,12 +43,11 @@ export function ImageFieldEditor({
|
|
|
43
43
|
</div>
|
|
44
44
|
<div className="mt-2">
|
|
45
45
|
<div className="mb-1">Alt Text</div>
|
|
46
|
-
<
|
|
46
|
+
<Input
|
|
47
47
|
key={item!.id + field.id + item!.language + item!.version}
|
|
48
48
|
value={altText}
|
|
49
49
|
disabled={readOnly}
|
|
50
|
-
className="focus-shadow bg-gray-5 p-1.5 text-xs"
|
|
51
|
-
style={{ width: "100%" }}
|
|
50
|
+
className="focus-shadow bg-gray-5 w-full p-1.5 text-xs"
|
|
52
51
|
onChange={(e) => {
|
|
53
52
|
setAltText(e.target.value);
|
|
54
53
|
if (field.value) field.value.alt = e.target.value;
|
|
@@ -9,7 +9,7 @@ import { ScrollingContentTree } from "../ScrollingContentTree";
|
|
|
9
9
|
|
|
10
10
|
import { InternalLinkField } from "../fieldTypes";
|
|
11
11
|
import { getLookupSources } from "../services/editService";
|
|
12
|
-
import {
|
|
12
|
+
import { cn } from "../../lib/utils";
|
|
13
13
|
import ItemSearch from "../ui/ItemSearch";
|
|
14
14
|
import { normalizeGuid } from "../utils";
|
|
15
15
|
import {
|
|
@@ -120,7 +120,7 @@ export function InternalLinkFieldEditor({
|
|
|
120
120
|
<Popover open={showTree} onOpenChange={setShowTree}>
|
|
121
121
|
<PopoverTrigger asChild disabled={readOnly}>
|
|
122
122
|
<div
|
|
123
|
-
className={
|
|
123
|
+
className={cn(
|
|
124
124
|
"justiy-between focus-shadow bg-gray-5 flex cursor-pointer justify-between rounded-sm border p-1.5 text-xs",
|
|
125
125
|
readOnly ? "cursor-default bg-gray-100" : "",
|
|
126
126
|
)}
|
|
@@ -5,7 +5,7 @@ import { useEffect, useState } from "react";
|
|
|
5
5
|
import { Link, LinkEditorDialog } from "../LinkEditorDialog";
|
|
6
6
|
import { useEditContext } from "../client/editContext";
|
|
7
7
|
import { LinkField } from "../fieldTypes";
|
|
8
|
-
import {
|
|
8
|
+
import { cn } from "../../lib/utils";
|
|
9
9
|
import { Link as LinkIcon } from "lucide-react";
|
|
10
10
|
|
|
11
11
|
export function LinkFieldEditor({
|
|
@@ -27,6 +27,7 @@ export function LinkFieldEditor({
|
|
|
27
27
|
type: field.value.type,
|
|
28
28
|
itemId: field.value.targetItemLongId?.split("/").pop(),
|
|
29
29
|
queryString: field.value.queryString,
|
|
30
|
+
text: field.value.text,
|
|
30
31
|
});
|
|
31
32
|
}, [field]);
|
|
32
33
|
if (!field.value) return;
|
|
@@ -34,7 +35,7 @@ export function LinkFieldEditor({
|
|
|
34
35
|
return (
|
|
35
36
|
<>
|
|
36
37
|
<div
|
|
37
|
-
className={
|
|
38
|
+
className={cn(
|
|
38
39
|
"focus-shadow border-gray-3 bg-gray-5 flex justify-between rounded-sm border p-1.5",
|
|
39
40
|
readOnly ? "bg-gray-100" : "cursor-pointer",
|
|
40
41
|
)}
|
|
@@ -50,11 +51,14 @@ export function LinkFieldEditor({
|
|
|
50
51
|
{showDialog && (
|
|
51
52
|
<LinkEditorDialog
|
|
52
53
|
linkValue={link || { type: "internal" }}
|
|
54
|
+
showText={true}
|
|
53
55
|
onOk={(link) => {
|
|
54
56
|
const xml =
|
|
55
57
|
link.type == "internal"
|
|
56
58
|
? '<link linktype="internal" querystring="' +
|
|
57
59
|
(link.queryString ?? "") +
|
|
60
|
+
'" text="' +
|
|
61
|
+
(link.text ?? "") +
|
|
58
62
|
'" id="' +
|
|
59
63
|
link.itemId +
|
|
60
64
|
'" target="' +
|
|
@@ -62,6 +66,8 @@ export function LinkFieldEditor({
|
|
|
62
66
|
'" />'
|
|
63
67
|
: '<link linktype="external" querystring="' +
|
|
64
68
|
(link.queryString ?? "") +
|
|
69
|
+
'" text="' +
|
|
70
|
+
(link.text ?? "") +
|
|
65
71
|
'" url="' +
|
|
66
72
|
link.url +
|
|
67
73
|
'" target="' +
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Textarea } from "../../components/ui/textarea";
|
|
4
4
|
import {
|
|
5
5
|
useEditContextRef,
|
|
6
6
|
useFieldsEditContextRef,
|
|
@@ -68,15 +68,14 @@ export function MultiLineText({
|
|
|
68
68
|
}, [fieldsContextRef.current?.focusedField]);
|
|
69
69
|
|
|
70
70
|
return (
|
|
71
|
-
<
|
|
71
|
+
<Textarea
|
|
72
72
|
ref={inputRef}
|
|
73
73
|
key={fieldItem.id + field.id + fieldItem.language + fieldItem.version}
|
|
74
74
|
value={value}
|
|
75
75
|
disabled={readOnly}
|
|
76
|
-
className="focus-shadow bg-gray-5 p-2 text-xs"
|
|
77
|
-
style={{ width: "100%" }}
|
|
76
|
+
className="focus-shadow bg-gray-5 w-full p-2 text-xs"
|
|
78
77
|
rows={12}
|
|
79
|
-
onChange={(e) => {
|
|
78
|
+
onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
80
79
|
setValue(e.target.value);
|
|
81
80
|
updateFieldValue(e.target.value as string);
|
|
82
81
|
}}
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { useEditContext } from "../client/editContext";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Input } from "../../components/ui/input";
|
|
6
6
|
|
|
7
7
|
import { PictureEditor } from "../PictureEditor";
|
|
8
8
|
import { PictureField, PictureRawValue } from "../fieldTypes";
|
|
9
9
|
import { useEffect, useState } from "react";
|
|
10
10
|
import { SimpleIconButton } from "../ui/SimpleIconButton";
|
|
11
|
+
import { Trash } from "lucide-react";
|
|
11
12
|
|
|
12
13
|
export function PictureFieldEditor({
|
|
13
14
|
field,
|
|
@@ -83,7 +84,7 @@ export function PictureFieldEditor({
|
|
|
83
84
|
refresh: "immediate",
|
|
84
85
|
});
|
|
85
86
|
}}
|
|
86
|
-
icon="
|
|
87
|
+
icon={<Trash className="h-4 w-4" />}
|
|
87
88
|
label="Remove"
|
|
88
89
|
/>
|
|
89
90
|
</div>
|
|
@@ -93,12 +94,11 @@ export function PictureFieldEditor({
|
|
|
93
94
|
</div>
|
|
94
95
|
<div className="mt-2">
|
|
95
96
|
<div className="mb-1">Alt Text</div>
|
|
96
|
-
<
|
|
97
|
+
<Input
|
|
97
98
|
key={item!.id + field.id + item!.language + item!.version}
|
|
98
99
|
value={altText}
|
|
99
100
|
disabled={readOnly}
|
|
100
|
-
className="focus-shadow bg-gray-5 p-1.5 text-xs"
|
|
101
|
-
style={{ width: "100%" }}
|
|
101
|
+
className="focus-shadow bg-gray-5 w-full p-1.5 text-xs"
|
|
102
102
|
onChange={(e) => {
|
|
103
103
|
setAltText(e.target.value);
|
|
104
104
|
const raw = field?.rawValue
|