@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
package/dist/styles.css
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
--color-red-50: oklch(97.1% 0.013 17.38);
|
|
8
8
|
--color-red-100: oklch(93.6% 0.032 17.717);
|
|
9
9
|
--color-red-200: oklch(88.5% 0.062 18.334);
|
|
10
|
+
--color-red-300: oklch(80.8% 0.114 19.571);
|
|
10
11
|
--color-red-400: oklch(70.4% 0.191 22.216);
|
|
11
12
|
--color-red-500: oklch(63.7% 0.237 25.331);
|
|
12
13
|
--color-red-600: oklch(57.7% 0.245 27.325);
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
--color-green-50: oklch(98.2% 0.018 155.826);
|
|
39
40
|
--color-green-100: oklch(96.2% 0.044 156.743);
|
|
40
41
|
--color-green-200: oklch(92.5% 0.084 155.995);
|
|
42
|
+
--color-green-300: oklch(87.1% 0.15 154.449);
|
|
41
43
|
--color-green-400: oklch(79.2% 0.209 151.711);
|
|
42
44
|
--color-green-500: oklch(72.3% 0.219 149.579);
|
|
43
45
|
--color-green-600: oklch(62.7% 0.194 149.214);
|
|
@@ -243,9 +245,6 @@
|
|
|
243
245
|
.top-\[-5px\] {
|
|
244
246
|
top: -5px;
|
|
245
247
|
}
|
|
246
|
-
.top-\[-12px\] {
|
|
247
|
-
top: -12px;
|
|
248
|
-
}
|
|
249
248
|
.top-\[-18px\] {
|
|
250
249
|
top: -18px;
|
|
251
250
|
}
|
|
@@ -273,18 +272,12 @@
|
|
|
273
272
|
.right-1 {
|
|
274
273
|
right: calc(var(--spacing) * 1);
|
|
275
274
|
}
|
|
276
|
-
.right-1\.5 {
|
|
277
|
-
right: calc(var(--spacing) * 1.5);
|
|
278
|
-
}
|
|
279
275
|
.right-2 {
|
|
280
276
|
right: calc(var(--spacing) * 2);
|
|
281
277
|
}
|
|
282
278
|
.right-4 {
|
|
283
279
|
right: calc(var(--spacing) * 4);
|
|
284
280
|
}
|
|
285
|
-
.right-\[-12px\] {
|
|
286
|
-
right: -12px;
|
|
287
|
-
}
|
|
288
281
|
.right-\[-18px\] {
|
|
289
282
|
right: -18px;
|
|
290
283
|
}
|
|
@@ -417,9 +410,6 @@
|
|
|
417
410
|
.mt-1 {
|
|
418
411
|
margin-top: calc(var(--spacing) * 1);
|
|
419
412
|
}
|
|
420
|
-
.mt-1\.5 {
|
|
421
|
-
margin-top: calc(var(--spacing) * 1.5);
|
|
422
|
-
}
|
|
423
413
|
.mt-2 {
|
|
424
414
|
margin-top: calc(var(--spacing) * 2);
|
|
425
415
|
}
|
|
@@ -589,10 +579,6 @@
|
|
|
589
579
|
width: calc(var(--spacing) * 9);
|
|
590
580
|
height: calc(var(--spacing) * 9);
|
|
591
581
|
}
|
|
592
|
-
.size-full {
|
|
593
|
-
width: 100%;
|
|
594
|
-
height: 100%;
|
|
595
|
-
}
|
|
596
582
|
.h-\(--cell-size\) {
|
|
597
583
|
height: var(--cell-size);
|
|
598
584
|
}
|
|
@@ -686,6 +672,9 @@
|
|
|
686
672
|
.h-\[16px\] {
|
|
687
673
|
height: 16px;
|
|
688
674
|
}
|
|
675
|
+
.h-\[18px\] {
|
|
676
|
+
height: 18px;
|
|
677
|
+
}
|
|
689
678
|
.h-\[23px\] {
|
|
690
679
|
height: 23px;
|
|
691
680
|
}
|
|
@@ -902,6 +891,9 @@
|
|
|
902
891
|
.w-\[12px\] {
|
|
903
892
|
width: 12px;
|
|
904
893
|
}
|
|
894
|
+
.w-\[18px\] {
|
|
895
|
+
width: 18px;
|
|
896
|
+
}
|
|
905
897
|
.w-\[24px\] {
|
|
906
898
|
width: 24px;
|
|
907
899
|
}
|
|
@@ -953,6 +945,9 @@
|
|
|
953
945
|
.max-w-\[240px\] {
|
|
954
946
|
max-width: 240px;
|
|
955
947
|
}
|
|
948
|
+
.max-w-\[320px\] {
|
|
949
|
+
max-width: 320px;
|
|
950
|
+
}
|
|
956
951
|
.max-w-\[450px\] {
|
|
957
952
|
max-width: 450px;
|
|
958
953
|
}
|
|
@@ -1341,13 +1336,6 @@
|
|
|
1341
1336
|
margin-inline-end: calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-x-reverse)));
|
|
1342
1337
|
}
|
|
1343
1338
|
}
|
|
1344
|
-
.space-x-2 {
|
|
1345
|
-
:where(& > :not(:last-child)) {
|
|
1346
|
-
--tw-space-x-reverse: 0;
|
|
1347
|
-
margin-inline-start: calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));
|
|
1348
|
-
margin-inline-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)));
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
1339
|
.space-x-3 {
|
|
1352
1340
|
:where(& > :not(:last-child)) {
|
|
1353
1341
|
--tw-space-x-reverse: 0;
|
|
@@ -1591,6 +1579,9 @@
|
|
|
1591
1579
|
.border-green-200 {
|
|
1592
1580
|
border-color: var(--color-green-200);
|
|
1593
1581
|
}
|
|
1582
|
+
.border-green-300 {
|
|
1583
|
+
border-color: var(--color-green-300);
|
|
1584
|
+
}
|
|
1594
1585
|
.border-green-500 {
|
|
1595
1586
|
border-color: var(--color-green-500);
|
|
1596
1587
|
}
|
|
@@ -1618,6 +1609,9 @@
|
|
|
1618
1609
|
.border-red-200 {
|
|
1619
1610
|
border-color: var(--color-red-200);
|
|
1620
1611
|
}
|
|
1612
|
+
.border-red-300 {
|
|
1613
|
+
border-color: var(--color-red-300);
|
|
1614
|
+
}
|
|
1621
1615
|
.border-red-400 {
|
|
1622
1616
|
border-color: var(--color-red-400);
|
|
1623
1617
|
}
|
|
@@ -2068,9 +2062,6 @@
|
|
|
2068
2062
|
.py-8 {
|
|
2069
2063
|
padding-block: calc(var(--spacing) * 8);
|
|
2070
2064
|
}
|
|
2071
|
-
.py-\[7px\] {
|
|
2072
|
-
padding-block: 7px;
|
|
2073
|
-
}
|
|
2074
2065
|
.py-\[9px\] {
|
|
2075
2066
|
padding-block: 9px;
|
|
2076
2067
|
}
|
|
@@ -2116,6 +2107,9 @@
|
|
|
2116
2107
|
.pr-7 {
|
|
2117
2108
|
padding-right: calc(var(--spacing) * 7);
|
|
2118
2109
|
}
|
|
2110
|
+
.pr-8 {
|
|
2111
|
+
padding-right: calc(var(--spacing) * 8);
|
|
2112
|
+
}
|
|
2119
2113
|
.pb-0 {
|
|
2120
2114
|
padding-bottom: calc(var(--spacing) * 0);
|
|
2121
2115
|
}
|
|
@@ -2272,6 +2266,9 @@
|
|
|
2272
2266
|
.text-amber-600 {
|
|
2273
2267
|
color: var(--color-amber-600);
|
|
2274
2268
|
}
|
|
2269
|
+
.text-amber-700 {
|
|
2270
|
+
color: var(--color-amber-700);
|
|
2271
|
+
}
|
|
2275
2272
|
.text-amber-900 {
|
|
2276
2273
|
color: var(--color-amber-900);
|
|
2277
2274
|
}
|
|
@@ -2512,6 +2509,10 @@
|
|
|
2512
2509
|
--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.05));
|
|
2513
2510
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2514
2511
|
}
|
|
2512
|
+
.ring {
|
|
2513
|
+
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
2514
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2515
|
+
}
|
|
2515
2516
|
.ring-0 {
|
|
2516
2517
|
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
2517
2518
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -3358,6 +3359,31 @@
|
|
|
3358
3359
|
}
|
|
3359
3360
|
}
|
|
3360
3361
|
}
|
|
3362
|
+
.focus-visible\:outline {
|
|
3363
|
+
&:focus-visible {
|
|
3364
|
+
outline-style: var(--tw-outline-style);
|
|
3365
|
+
outline-width: 1px;
|
|
3366
|
+
}
|
|
3367
|
+
}
|
|
3368
|
+
.focus-visible\:outline-2 {
|
|
3369
|
+
&:focus-visible {
|
|
3370
|
+
outline-style: var(--tw-outline-style);
|
|
3371
|
+
outline-width: 2px;
|
|
3372
|
+
}
|
|
3373
|
+
}
|
|
3374
|
+
.focus-visible\:-outline-offset-2 {
|
|
3375
|
+
&:focus-visible {
|
|
3376
|
+
outline-offset: calc(2px * -1);
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
.focus-visible\:outline-ring\/70 {
|
|
3380
|
+
&:focus-visible {
|
|
3381
|
+
outline-color: var(--ring);
|
|
3382
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
3383
|
+
outline-color: color-mix(in oklab, var(--ring) 70%, transparent);
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
}
|
|
3361
3387
|
.disabled\:pointer-events-none {
|
|
3362
3388
|
&:disabled {
|
|
3363
3389
|
pointer-events: none;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InputText } from "primereact/inputtext";
|
|
2
|
-
import { ProgressSpinner } from "primereact/progressspinner";
|
|
3
1
|
import { forwardRef } from "react";
|
|
2
|
+
import { Search, X, Loader2 } from "lucide-react";
|
|
3
|
+
import { Input } from "./ui/input";
|
|
4
4
|
import { cn } from "../lib/utils";
|
|
5
5
|
|
|
6
6
|
export interface FilterInputProps {
|
|
@@ -45,36 +45,33 @@ export const FilterInput = forwardRef<HTMLInputElement, FilterInputProps>(
|
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
47
|
<div className={cn("relative flex items-center", className)}>
|
|
48
|
-
<
|
|
48
|
+
<Input
|
|
49
49
|
ref={ref}
|
|
50
50
|
type="text"
|
|
51
51
|
value={value}
|
|
52
52
|
onChange={(e) => onChange(e.target.value)}
|
|
53
53
|
className={cn(
|
|
54
|
-
"
|
|
55
|
-
size === "sm" && "
|
|
56
|
-
size === "md" && "
|
|
54
|
+
"pr-8 text-xs",
|
|
55
|
+
size === "sm" && "h-7",
|
|
56
|
+
size === "md" && "h-8",
|
|
57
|
+
size === "lg" && "h-9",
|
|
57
58
|
)}
|
|
58
59
|
placeholder={placeholder}
|
|
59
60
|
disabled={disabled}
|
|
60
61
|
autoFocus={autoFocus}
|
|
61
62
|
/>
|
|
62
63
|
{loading && (
|
|
63
|
-
<
|
|
64
|
-
className="absolute right-
|
|
65
|
-
style={
|
|
66
|
-
width: "18px",
|
|
67
|
-
height: "18px",
|
|
68
|
-
...spinnerStyle,
|
|
69
|
-
}}
|
|
64
|
+
<Loader2
|
|
65
|
+
className="absolute right-2 h-4 w-4 animate-spin text-gray-400"
|
|
66
|
+
style={spinnerStyle}
|
|
70
67
|
/>
|
|
71
68
|
)}
|
|
72
69
|
{!loading && !value && showSearchIcon && (
|
|
73
|
-
<
|
|
70
|
+
<Search className="absolute right-2 h-4 w-4 text-gray-400" />
|
|
74
71
|
)}
|
|
75
72
|
{!loading && value && showClearIcon && (
|
|
76
|
-
<
|
|
77
|
-
className="
|
|
73
|
+
<X
|
|
74
|
+
className="absolute right-2 h-4 w-4 cursor-pointer text-gray-400 hover:text-gray-600"
|
|
78
75
|
onClick={handleClear}
|
|
79
76
|
/>
|
|
80
77
|
)}
|
|
@@ -8,8 +8,9 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
|
|
|
8
8
|
type={type}
|
|
9
9
|
data-slot="input"
|
|
10
10
|
className={cn(
|
|
11
|
-
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex w-full min-w-0 rounded-md border bg-transparent p-1 px-3 text-base
|
|
12
|
-
|
|
11
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex w-full min-w-0 rounded-md border bg-transparent p-1 px-3 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-xs file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-xs",
|
|
12
|
+
// Use outline for focus instead of ring (box-shadow) so it doesn't override .focus-shadow
|
|
13
|
+
"focus-visible:border-ring focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring/70",
|
|
13
14
|
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
14
15
|
className,
|
|
15
16
|
)}
|
|
@@ -11,7 +11,9 @@ const Textarea = React.forwardRef<
|
|
|
11
11
|
ref={ref}
|
|
12
12
|
data-slot="textarea"
|
|
13
13
|
className={cn(
|
|
14
|
-
"border-input placeholder:text-muted-foreground
|
|
14
|
+
"border-input placeholder:text-muted-foreground aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-sm transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
15
|
+
// Use outline for focus instead of ring (box-shadow) so it doesn't override .focus-shadow
|
|
16
|
+
"focus-visible:border-ring focus-visible:outline-ring/70 focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2",
|
|
15
17
|
className,
|
|
16
18
|
)}
|
|
17
19
|
{...props}
|
package/src/config/config.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
3
|
|
|
4
4
|
export interface AspectRatioOption {
|
|
5
5
|
label: string;
|
|
@@ -46,7 +46,7 @@ export function AspectRatioSelector({
|
|
|
46
46
|
: ratiosToShow;
|
|
47
47
|
|
|
48
48
|
return (
|
|
49
|
-
<div className={
|
|
49
|
+
<div className={cn("space-y-2", className)}>
|
|
50
50
|
<div className="text-sm font-medium">Aspect Ratio</div>
|
|
51
51
|
<div className="flex flex-wrap gap-2">
|
|
52
52
|
{finalRatios.map((option) => (
|
|
@@ -119,7 +119,7 @@ function AspectRatioTile({
|
|
|
119
119
|
<button
|
|
120
120
|
onClick={onClick}
|
|
121
121
|
disabled={disabled}
|
|
122
|
-
className={
|
|
122
|
+
className={cn(
|
|
123
123
|
"relative rounded border-2 transition-all",
|
|
124
124
|
"hover:border-theme-secondary/50 focus:ring-theme-secondary/20 flex items-center justify-center focus:ring-2 focus:outline-none",
|
|
125
125
|
{
|
|
@@ -480,6 +480,10 @@ export default function ContentTree({
|
|
|
480
480
|
event: React.DragEvent;
|
|
481
481
|
isMultiSelect: boolean;
|
|
482
482
|
}): void {
|
|
483
|
+
try {
|
|
484
|
+
// Allow both copy and move operations when dragging items
|
|
485
|
+
data.event.dataTransfer.effectAllowed = "copyMove";
|
|
486
|
+
} catch {}
|
|
483
487
|
const items = data.isMultiSelect
|
|
484
488
|
? selectedItemIds
|
|
485
489
|
?.map((x) => nodeDictionary.current[x]?.data)
|
|
@@ -593,6 +597,10 @@ export default function ContentTree({
|
|
|
593
597
|
let itemIds = selectedItemIds;
|
|
594
598
|
if (!enableContextMenu) return;
|
|
595
599
|
|
|
600
|
+
// Always block the native context menu immediately
|
|
601
|
+
originalEvent.preventDefault();
|
|
602
|
+
originalEvent.stopPropagation();
|
|
603
|
+
|
|
596
604
|
if (!itemIds || !itemIds.includes(key as string)) {
|
|
597
605
|
if (onSelectionChange && selectionMode === "single") {
|
|
598
606
|
onSelectionChange([node.data as ItemTreeNodeData]);
|
|
@@ -600,6 +608,33 @@ export default function ContentTree({
|
|
|
600
608
|
itemIds = [key as string];
|
|
601
609
|
}
|
|
602
610
|
|
|
611
|
+
// Prepare a synthetic event for later use (to avoid React event pooling)
|
|
612
|
+
const { clientX, clientY, shiftKey, altKey, ctrlKey } = originalEvent;
|
|
613
|
+
const syntheticEvent = new MouseEvent("contextmenu", {
|
|
614
|
+
bubbles: true,
|
|
615
|
+
cancelable: true,
|
|
616
|
+
view: window,
|
|
617
|
+
clientX,
|
|
618
|
+
clientY,
|
|
619
|
+
shiftKey,
|
|
620
|
+
altKey,
|
|
621
|
+
ctrlKey,
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
// Only show a spinner if work takes longer than 100ms
|
|
625
|
+
let loadingShown = false;
|
|
626
|
+
const loadingTimer = setTimeout(() => {
|
|
627
|
+
loadingShown = true;
|
|
628
|
+
editContext?.showContextMenu(syntheticEvent, [
|
|
629
|
+
{
|
|
630
|
+
id: "loading",
|
|
631
|
+
label: "Loading…",
|
|
632
|
+
disabled: true,
|
|
633
|
+
icon: <Spinner size="sm" className="mr-2" />,
|
|
634
|
+
},
|
|
635
|
+
]);
|
|
636
|
+
}, 100);
|
|
637
|
+
|
|
603
638
|
const items = await editContext?.itemsRepository.getItems(
|
|
604
639
|
itemIds.map((x) => ({
|
|
605
640
|
id: x,
|
|
@@ -608,7 +643,16 @@ export default function ContentTree({
|
|
|
608
643
|
})),
|
|
609
644
|
);
|
|
610
645
|
|
|
611
|
-
|
|
646
|
+
// Build the final menu, then either show or update depending on whether loading is visible
|
|
647
|
+
if (!items || items.length === 0) {
|
|
648
|
+
clearTimeout(loadingTimer);
|
|
649
|
+
const emptyMenu = [
|
|
650
|
+
{ id: "empty", label: "No actions available", disabled: true },
|
|
651
|
+
];
|
|
652
|
+
if (loadingShown) editContext?.updateContextMenu(emptyMenu);
|
|
653
|
+
else editContext?.showContextMenu(syntheticEvent, emptyMenu);
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
612
656
|
|
|
613
657
|
const menuItems =
|
|
614
658
|
await editContext?.configuration.editor.contentTree.contextMenu.factory(
|
|
@@ -626,7 +670,11 @@ export default function ContentTree({
|
|
|
626
670
|
},
|
|
627
671
|
},
|
|
628
672
|
);
|
|
629
|
-
if (menuItems
|
|
673
|
+
if (menuItems && menuItems.length > 0) {
|
|
674
|
+
clearTimeout(loadingTimer);
|
|
675
|
+
if (loadingShown) editContext?.updateContextMenu(menuItems);
|
|
676
|
+
else editContext?.showContextMenu(syntheticEvent, menuItems);
|
|
677
|
+
}
|
|
630
678
|
},
|
|
631
679
|
[
|
|
632
680
|
itemCommands,
|
|
@@ -775,6 +823,7 @@ export default function ContentTree({
|
|
|
775
823
|
selectedKeys={selectedKeys}
|
|
776
824
|
onContextMenu={onContextMenu}
|
|
777
825
|
enableDragAndDrop={enableDragAndDrop}
|
|
826
|
+
multiDragNoun={"items"}
|
|
778
827
|
onStartDrag={handleDragStart}
|
|
779
828
|
onDragOverZone={handleDragOverZone}
|
|
780
829
|
onDragEnd={handleDragEnd}
|
|
@@ -70,7 +70,7 @@ import { cn } from "../lib/utils";
|
|
|
70
70
|
// };
|
|
71
71
|
// }
|
|
72
72
|
|
|
73
|
-
export async function
|
|
73
|
+
export async function buildComponentContextMenuItems(
|
|
74
74
|
components: Component[],
|
|
75
75
|
editContext: EditContextType,
|
|
76
76
|
field?: FieldDescriptor,
|
|
@@ -81,13 +81,13 @@ export async function showComponentContextMenu(
|
|
|
81
81
|
allFieldButtons: FieldButton[],
|
|
82
82
|
event: any,
|
|
83
83
|
) => void,
|
|
84
|
-
) {
|
|
84
|
+
): Promise<MenuItem[]> {
|
|
85
85
|
const componentCommandMenuItems = await getComponentMenuItems(
|
|
86
86
|
editContext,
|
|
87
87
|
components,
|
|
88
88
|
);
|
|
89
89
|
|
|
90
|
-
const menuItems = componentCommandMenuItems;
|
|
90
|
+
const menuItems = [...componentCommandMenuItems];
|
|
91
91
|
|
|
92
92
|
// Only show field actions when a single component is selected
|
|
93
93
|
if (
|
|
@@ -107,17 +107,13 @@ export async function showComponentContextMenu(
|
|
|
107
107
|
id: button.id,
|
|
108
108
|
label: button.label,
|
|
109
109
|
command: async (event) => {
|
|
110
|
-
// Check if the button has parameters
|
|
111
110
|
if (button.parameters && button.parameters.length > 0) {
|
|
112
|
-
// If we have a parameterized action handler, use it
|
|
113
111
|
if (onParameterizedAction) {
|
|
114
112
|
onParameterizedAction(field, button, fieldButtons, event);
|
|
115
113
|
} else {
|
|
116
|
-
// Fallback: execute without parameters (might not work well)
|
|
117
114
|
editContext!.triggerFieldAction(field, button);
|
|
118
115
|
}
|
|
119
116
|
} else {
|
|
120
|
-
// For simple actions, execute directly
|
|
121
117
|
editContext!.triggerFieldAction(field, button);
|
|
122
118
|
}
|
|
123
119
|
},
|
|
@@ -161,10 +157,32 @@ export async function showComponentContextMenu(
|
|
|
161
157
|
}
|
|
162
158
|
}
|
|
163
159
|
|
|
160
|
+
return menuItems;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export async function showComponentContextMenu(
|
|
164
|
+
components: Component[],
|
|
165
|
+
editContext: EditContextType,
|
|
166
|
+
field?: FieldDescriptor,
|
|
167
|
+
fieldButtons?: FieldButton[],
|
|
168
|
+
onParameterizedAction?: (
|
|
169
|
+
field: FieldDescriptor,
|
|
170
|
+
action: FieldButton,
|
|
171
|
+
allFieldButtons: FieldButton[],
|
|
172
|
+
event: any,
|
|
173
|
+
) => void,
|
|
174
|
+
) {
|
|
175
|
+
const menuItems = await buildComponentContextMenuItems(
|
|
176
|
+
components,
|
|
177
|
+
editContext,
|
|
178
|
+
field,
|
|
179
|
+
fieldButtons,
|
|
180
|
+
onParameterizedAction,
|
|
181
|
+
);
|
|
182
|
+
|
|
164
183
|
return (e: any) => {
|
|
165
184
|
if (!e.shiftKey && !e.altKey) {
|
|
166
185
|
if (menuItems.length) {
|
|
167
|
-
// editContext.select([component.id]);
|
|
168
186
|
editContext!.showContextMenu(e, menuItems);
|
|
169
187
|
}
|
|
170
188
|
|
|
@@ -176,6 +194,7 @@ export async function showComponentContextMenu(
|
|
|
176
194
|
|
|
177
195
|
export interface EditContextMenuRef {
|
|
178
196
|
show: (event: any, menuItems: MenuItem[]) => void;
|
|
197
|
+
update: (menuItems: MenuItem[]) => void;
|
|
179
198
|
close: (event: any) => void;
|
|
180
199
|
}
|
|
181
200
|
|
|
@@ -199,6 +218,9 @@ export const EditContextMenu = forwardRef<
|
|
|
199
218
|
});
|
|
200
219
|
}
|
|
201
220
|
},
|
|
221
|
+
update: (items: MenuItem[]) => {
|
|
222
|
+
setMenuItems(items);
|
|
223
|
+
},
|
|
202
224
|
close: (event: any) => {
|
|
203
225
|
try {
|
|
204
226
|
// Close Radix ContextMenu by sending Escape to the document
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn } from "../lib/utils";
|
|
2
2
|
|
|
3
3
|
export function EditorWarning({
|
|
4
4
|
title,
|
|
@@ -13,16 +13,16 @@ export function EditorWarning({
|
|
|
13
13
|
severity === "info"
|
|
14
14
|
? "bg-blue-100"
|
|
15
15
|
: severity === "error"
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
? "bg-red-100"
|
|
17
|
+
: "bg-yellow-100";
|
|
18
18
|
return (
|
|
19
19
|
<div
|
|
20
|
-
className={
|
|
20
|
+
className={cn(
|
|
21
21
|
background,
|
|
22
|
-
"
|
|
22
|
+
"flex items-stretch gap-2 border-b border-yellow-300 text-sm text-gray-500",
|
|
23
23
|
)}
|
|
24
24
|
>
|
|
25
|
-
<div className="bg-yellow-200 px-4
|
|
25
|
+
<div className="flex items-center bg-yellow-200 px-4 text-gray-900">
|
|
26
26
|
<span className="pi pi-exclamation-triangle text-2xl" />
|
|
27
27
|
</div>
|
|
28
28
|
<div className="p-2">
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Popover,
|
|
5
|
+
PopoverContent,
|
|
6
|
+
PopoverTrigger,
|
|
7
|
+
} from "../components/ui/popover";
|
|
4
8
|
import {
|
|
5
9
|
SyntheticEvent,
|
|
6
10
|
forwardRef,
|
|
7
11
|
useImperativeHandle,
|
|
8
|
-
useRef,
|
|
9
12
|
useState,
|
|
10
13
|
} from "react";
|
|
14
|
+
import { X } from "lucide-react";
|
|
11
15
|
|
|
12
16
|
import { FieldList } from "./FieldList";
|
|
13
17
|
import { Field } from "./pageModel";
|
|
@@ -23,8 +27,7 @@ export const FieldEditorPopup = forwardRef<
|
|
|
23
27
|
FieldEditorPopupRef,
|
|
24
28
|
FieldEditorPopupProps
|
|
25
29
|
>((_, ref) => {
|
|
26
|
-
const
|
|
27
|
-
|
|
30
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
28
31
|
const [sections, setSections] = useState<string[]>([]);
|
|
29
32
|
const [fields, setFields] = useState<Field[]>([]);
|
|
30
33
|
|
|
@@ -32,34 +35,41 @@ export const FieldEditorPopup = forwardRef<
|
|
|
32
35
|
show: (fields: Field[], sections: string[], ev: SyntheticEvent) => {
|
|
33
36
|
setFields(fields);
|
|
34
37
|
setSections(sections);
|
|
35
|
-
|
|
38
|
+
setIsOpen(true);
|
|
36
39
|
},
|
|
37
40
|
close: () => {
|
|
38
|
-
|
|
41
|
+
setIsOpen(false);
|
|
39
42
|
},
|
|
40
43
|
}));
|
|
41
44
|
|
|
42
45
|
return (
|
|
43
|
-
<
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
>
|
|
48
|
-
<div
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
<Popover open={isOpen} onOpenChange={setIsOpen}>
|
|
47
|
+
<PopoverTrigger asChild>
|
|
48
|
+
<div style={{ display: "none" }} />
|
|
49
|
+
</PopoverTrigger>
|
|
50
|
+
<PopoverContent className="h-96 w-96">
|
|
51
|
+
<div
|
|
52
|
+
className="flex flex-col gap-2 overflow-auto"
|
|
53
|
+
onClick={(ev) => ev.stopPropagation()}
|
|
54
|
+
>
|
|
55
|
+
<div className="flex justify-end p-3">
|
|
56
|
+
<X
|
|
57
|
+
className="h-4 w-4 cursor-pointer"
|
|
58
|
+
onClick={() => setIsOpen(false)}
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
54
61
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
{fields && (
|
|
63
|
+
<FieldList
|
|
64
|
+
fields={[{ fields }]}
|
|
65
|
+
sections={sections}
|
|
66
|
+
validators={[]}
|
|
67
|
+
/>
|
|
68
|
+
)}
|
|
69
|
+
|
|
70
|
+
<div className="p-2 text-xs text-gray-500">TEST</div>
|
|
71
|
+
</div>
|
|
72
|
+
</PopoverContent>
|
|
73
|
+
</Popover>
|
|
64
74
|
);
|
|
65
75
|
});
|
|
@@ -8,6 +8,7 @@ import { useEditContext } from "./client/editContext";
|
|
|
8
8
|
import { formatDate } from "./utils";
|
|
9
9
|
import { SimpleTable } from "./ui/SimpleTable";
|
|
10
10
|
import { SimpleIconButton } from "./ui/SimpleIconButton";
|
|
11
|
+
import { Undo } from "lucide-react";
|
|
11
12
|
|
|
12
13
|
export function FieldHistory({
|
|
13
14
|
field,
|
|
@@ -54,7 +55,7 @@ export function FieldHistory({
|
|
|
54
55
|
header: "Revert",
|
|
55
56
|
body: (x) => (
|
|
56
57
|
<SimpleIconButton
|
|
57
|
-
icon="
|
|
58
|
+
icon={<Undo className="h-4 w-4" />}
|
|
58
59
|
onClick={async () => {
|
|
59
60
|
await editContext.operations.editField({
|
|
60
61
|
field: field.descriptor,
|
|
@@ -270,14 +270,14 @@ export default function FieldListField({
|
|
|
270
270
|
</PopoverTrigger>
|
|
271
271
|
<PopoverContent className="w-56 p-1" align="start" side="bottom">
|
|
272
272
|
<button
|
|
273
|
-
className="flex w-full items-center gap-2 rounded px-3 py-2 text-
|
|
273
|
+
className="flex w-full items-center gap-2 rounded px-3 py-2 text-xs transition-colors hover:bg-gray-100"
|
|
274
274
|
onClick={handleOpenFieldItem}
|
|
275
275
|
>
|
|
276
276
|
<ExternalLink strokeWidth={1} className="h-4 w-4" />
|
|
277
277
|
Open Field Item
|
|
278
278
|
</button>
|
|
279
279
|
<button
|
|
280
|
-
className="flex w-full items-center gap-2 rounded px-3 py-2 text-
|
|
280
|
+
className="flex w-full items-center gap-2 rounded px-3 py-2 text-xs transition-colors hover:bg-gray-100"
|
|
281
281
|
onClick={handleShowFieldJson}
|
|
282
282
|
>
|
|
283
283
|
<span className="font-mono text-sm">{"{}"}</span>
|