@alpaca-editor/core 1.0.4112 → 1.0.4118
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/context-menu.js +3 -0
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/input.js.map +1 -1
- package/dist/config/config.js +3 -3
- package/dist/config/config.js.map +1 -1
- package/dist/editor/AspectRatioSelector.js +3 -3
- package/dist/editor/AspectRatioSelector.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/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/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 +137 -6
- 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 +1 -1
- package/dist/editor/ai/ContextInfoBar.js.map +1 -1
- package/dist/editor/client/EditorShell.js +2 -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/hooks/useGlobalEditorKeyDown.d.ts +1 -0
- package/dist/editor/client/hooks/useGlobalEditorKeyDown.js +12 -0
- package/dist/editor/client/hooks/useGlobalEditorKeyDown.js.map +1 -0
- 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/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/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/reviews/CommentView.js +5 -3
- package/dist/editor/reviews/CommentView.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 +3 -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 +6 -1
- 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 +13 -8
- 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/ItemNameDialogNew.js +2 -2
- package/dist/editor/ui/ItemNameDialogNew.js.map +1 -1
- package/dist/editor/ui/PerfectTree.js +2 -2
- 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/utils/keyboardNavigation.js +1 -0
- package/dist/editor/utils/keyboardNavigation.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 +9 -26
- package/package.json +1 -1
- package/src/components/FilterInput.tsx +13 -16
- package/src/components/ui/context-menu.tsx +3 -0
- package/src/components/ui/input.tsx +1 -1
- package/src/config/config.tsx +3 -3
- package/src/editor/AspectRatioSelector.tsx +3 -3
- package/src/editor/EditorWarning.tsx +6 -6
- package/src/editor/FieldEditorPopup.tsx +36 -26
- package/src/editor/FieldHistory.tsx +2 -1
- package/src/editor/LinkEditorDialog.tsx +20 -0
- package/src/editor/MainLayout.tsx +3 -3
- package/src/editor/PictureCropper.tsx +3 -3
- package/src/editor/PictureEditorDialog.tsx +167 -145
- package/src/editor/Terminal.tsx +5 -6
- package/src/editor/ai/AgentTerminal.tsx +187 -23
- package/src/editor/ai/Agents.tsx +2 -2
- package/src/editor/ai/ContextInfoBar.tsx +8 -6
- package/src/editor/client/EditorShell.tsx +3 -0
- package/src/editor/client/GenericDialog.tsx +13 -9
- package/src/editor/client/hooks/useGlobalEditorKeyDown.ts +11 -0
- 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/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/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/reviews/CommentView.tsx +34 -10
- package/src/editor/reviews/Reviews.tsx +116 -106
- package/src/editor/services/agentService.ts +3 -3
- package/src/editor/services/aiService.ts +5 -5
- package/src/editor/sidebar/ComponentPalette.tsx +3 -3
- package/src/editor/sidebar/ComponentTree.tsx +10 -1
- 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 +16 -9
- 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/ItemNameDialogNew.tsx +2 -2
- package/src/editor/ui/PerfectTree.tsx +2 -5
- package/src/editor/ui/Section.tsx +4 -4
- package/src/editor/ui/SimpleTable.tsx +3 -3
- package/src/editor/utils/keyboardNavigation.ts +1 -0
- package/src/editor/views/ItemEditor.tsx +1 -1
- package/src/index.ts +6 -0
- package/src/page-wizard/WizardSteps.tsx +2 -3
- package/src/page-wizard/steps/CollectStep.tsx +3 -3
- package/src/page-wizard/steps/ContentStep.tsx +4 -5
- package/src/page-wizard/steps/Generate.tsx +2 -2
- package/src/page-wizard/steps/ImagesStep.tsx +43 -24
- package/src/page-wizard/steps/MetaDataStep.tsx +5 -5
- package/src/page-wizard/steps/SelectStep.tsx +8 -6
- package/src/page-wizard/steps/StructureStep.tsx +9 -8
- package/src/page-wizard/steps/TranslateStep.tsx +5 -3
- package/src/revision.ts +2 -2
- package/src/splash-screen/NewPage.tsx +2 -2
- package/src/splash-screen/SectionHeadline.tsx +4 -4
- package/dist/editor/component-designer/ComponentDesigner.d.ts +0 -1
- package/dist/editor/component-designer/ComponentDesigner.js +0 -51
- package/dist/editor/component-designer/ComponentDesigner.js.map +0 -1
- package/dist/editor/component-designer/ComponentDesignerMenu.d.ts +0 -1
- package/dist/editor/component-designer/ComponentDesignerMenu.js +0 -65
- package/dist/editor/component-designer/ComponentDesignerMenu.js.map +0 -1
- package/dist/editor/component-designer/ComponentEditor.d.ts +0 -4
- package/dist/editor/component-designer/ComponentEditor.js +0 -55
- package/dist/editor/component-designer/ComponentEditor.js.map +0 -1
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.d.ts +0 -5
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js +0 -11
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js.map +0 -1
- package/dist/editor/component-designer/ComponentRenderingEditor.d.ts +0 -1
- package/dist/editor/component-designer/ComponentRenderingEditor.js +0 -69
- package/dist/editor/component-designer/ComponentRenderingEditor.js.map +0 -1
- package/dist/editor/component-designer/ComponentsDropdown.d.ts +0 -4
- package/dist/editor/component-designer/ComponentsDropdown.js +0 -20
- package/dist/editor/component-designer/ComponentsDropdown.js.map +0 -1
- package/dist/editor/component-designer/PlaceholdersEditor.d.ts +0 -4
- package/dist/editor/component-designer/PlaceholdersEditor.js +0 -63
- package/dist/editor/component-designer/PlaceholdersEditor.js.map +0 -1
- package/dist/editor/component-designer/RenderingsDropdown.d.ts +0 -1
- package/dist/editor/component-designer/RenderingsDropdown.js +0 -23
- package/dist/editor/component-designer/RenderingsDropdown.js.map +0 -1
- package/dist/editor/component-designer/TemplateEditor.d.ts +0 -1
- package/dist/editor/component-designer/TemplateEditor.js +0 -142
- package/dist/editor/component-designer/TemplateEditor.js.map +0 -1
- package/dist/editor/component-designer/aiContext.d.ts +0 -5
- package/dist/editor/component-designer/aiContext.js +0 -14
- package/dist/editor/component-designer/aiContext.js.map +0 -1
- package/src/editor/component-designer/ComponentDesigner.tsx +0 -66
- package/src/editor/component-designer/ComponentDesignerMenu.tsx +0 -91
- package/src/editor/component-designer/ComponentEditor.tsx +0 -95
- package/src/editor/component-designer/ComponentRenderingCodeEditor.tsx +0 -31
- package/src/editor/component-designer/ComponentRenderingEditor.tsx +0 -104
- package/src/editor/component-designer/ComponentsDropdown.tsx +0 -39
- package/src/editor/component-designer/PlaceholdersEditor.tsx +0 -179
- package/src/editor/component-designer/RenderingsDropdown.tsx +0 -36
- package/src/editor/component-designer/TemplateEditor.tsx +0 -236
- package/src/editor/component-designer/aiContext.ts +0 -21
|
@@ -1,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) {
|