@alpaca-editor/core 1.0.4114 → 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/input.js +1 -1
- package/dist/components/ui/input.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/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/GenericDialog.js +3 -3
- package/dist/editor/client/GenericDialog.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/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/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 +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/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/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/input.tsx +1 -1
- package/src/config/config.tsx +1 -1
- 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/GenericDialog.tsx +13 -9
- 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/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 +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/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/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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn } from "../../lib/utils";
|
|
2
2
|
import { Logo } from "../../editor/ui/Icons";
|
|
3
3
|
|
|
4
4
|
interface GenerateProps {
|
|
@@ -37,7 +37,7 @@ function Generate({ title, size }: GenerateProps) {
|
|
|
37
37
|
`}
|
|
38
38
|
</style>
|
|
39
39
|
<div
|
|
40
|
-
className={
|
|
40
|
+
className={cn(
|
|
41
41
|
"animate-fadeIn flex h-full flex-col items-center justify-center transition-all duration-300",
|
|
42
42
|
)}
|
|
43
43
|
>
|
|
@@ -7,9 +7,14 @@ import { executePrompt } from "../../editor/services/aiService";
|
|
|
7
7
|
import { executeSearch } from "../../editor/services/searchService";
|
|
8
8
|
import { createWizardAiContext } from "../service";
|
|
9
9
|
import { ActionButton } from "../../components/ActionButton";
|
|
10
|
-
import {
|
|
11
|
-
import { Button } from "
|
|
12
|
-
import {
|
|
10
|
+
import { cn } from "../../lib/utils";
|
|
11
|
+
import { Button } from "../../components/ui/button";
|
|
12
|
+
import {
|
|
13
|
+
Dialog,
|
|
14
|
+
DialogContent,
|
|
15
|
+
DialogHeader,
|
|
16
|
+
DialogTitle,
|
|
17
|
+
} from "../../components/ui/dialog";
|
|
13
18
|
import { FullItem } from "../../editor/pageModel";
|
|
14
19
|
import { WizardBox } from "../WizardBox";
|
|
15
20
|
import { WizardBoxConnector } from "../WizardBoxConnector";
|
|
@@ -257,32 +262,46 @@ export const ImagesStep = (props: StepComponentProps) => {
|
|
|
257
262
|
</div>
|
|
258
263
|
)}
|
|
259
264
|
<Button
|
|
260
|
-
|
|
265
|
+
size="sm"
|
|
261
266
|
onClick={() => {
|
|
262
267
|
setShowFolderDialog(true);
|
|
263
268
|
}}
|
|
264
|
-
|
|
269
|
+
>
|
|
270
|
+
Change Folder
|
|
271
|
+
</Button>
|
|
265
272
|
<Dialog
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
273
|
+
open={showFolderDialog}
|
|
274
|
+
onOpenChange={(open) => {
|
|
275
|
+
if (!open) {
|
|
276
|
+
setShowFolderDialog(false);
|
|
277
|
+
}
|
|
270
278
|
}}
|
|
271
|
-
style={{ width: "50vw", height: "50vh" }}
|
|
272
279
|
>
|
|
273
|
-
<
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
280
|
+
<DialogContent
|
|
281
|
+
className="max-w-none"
|
|
282
|
+
style={{ width: "50vw", height: "50vh" }}
|
|
283
|
+
>
|
|
284
|
+
<DialogHeader>
|
|
285
|
+
<DialogTitle>Select Folder</DialogTitle>
|
|
286
|
+
</DialogHeader>
|
|
287
|
+
<div className="flex-1 overflow-auto">
|
|
288
|
+
<div className="flex h-full flex-col p-1">
|
|
289
|
+
<div className="relative flex-1">
|
|
290
|
+
<ScrollingContentTree
|
|
291
|
+
rootItemId={mediaRootId}
|
|
292
|
+
onSelectionChange={(selection) => {
|
|
293
|
+
const selectedNode =
|
|
294
|
+
selection[0] as ItemTreeNodeData;
|
|
295
|
+
if (selectedNode)
|
|
296
|
+
setSelectedFolderId(selectedNode.id);
|
|
297
|
+
else setSelectedFolderId(mediaRootId);
|
|
298
|
+
setShowFolderDialog(false);
|
|
299
|
+
}}
|
|
300
|
+
/>
|
|
301
|
+
</div>
|
|
302
|
+
</div>
|
|
284
303
|
</div>
|
|
285
|
-
</
|
|
304
|
+
</DialogContent>
|
|
286
305
|
</Dialog>
|
|
287
306
|
</div>
|
|
288
307
|
</div>
|
|
@@ -323,7 +342,7 @@ export const ImagesStep = (props: StepComponentProps) => {
|
|
|
323
342
|
{image.title}
|
|
324
343
|
</h3>
|
|
325
344
|
<ChevronDown
|
|
326
|
-
className={
|
|
345
|
+
className={cn(
|
|
327
346
|
"h-5 w-5 text-gray-500 transition-transform",
|
|
328
347
|
isCollapsed ? "-rotate-90" : "rotate-0",
|
|
329
348
|
)}
|
|
@@ -336,7 +355,7 @@ export const ImagesStep = (props: StepComponentProps) => {
|
|
|
336
355
|
(option: Thumbnail, thumbnailIndex: number) => (
|
|
337
356
|
<div
|
|
338
357
|
key={thumbnailIndex}
|
|
339
|
-
className={
|
|
358
|
+
className={cn(
|
|
340
359
|
"relative aspect-square cursor-pointer overflow-hidden rounded-lg border-2 transition-all",
|
|
341
360
|
option.selected
|
|
342
361
|
? "border-purple-500 ring-2 ring-purple-200"
|
|
@@ -4,7 +4,7 @@ import { WizardPageModel } from "../PageWizard";
|
|
|
4
4
|
import { executePrompt } from "../../editor/services/aiService";
|
|
5
5
|
import { createWizardAiContext } from "../service";
|
|
6
6
|
import { useEditContext } from "../../editor/client/editContext";
|
|
7
|
-
import {
|
|
7
|
+
import { Textarea } from "../../components/ui/textarea";
|
|
8
8
|
import { WizardBox } from "../WizardBox";
|
|
9
9
|
import { FileText, RotateCcw } from "lucide-react";
|
|
10
10
|
import { StepComponentProps } from "../../config/types";
|
|
@@ -195,11 +195,11 @@ export function MetaDataStep({
|
|
|
195
195
|
>
|
|
196
196
|
Meta Description
|
|
197
197
|
</label>
|
|
198
|
-
<
|
|
198
|
+
<Textarea
|
|
199
199
|
id="metaDescription"
|
|
200
200
|
className="min-h-[100px] w-full rounded border p-2 text-sm"
|
|
201
201
|
value={pageModel.metaDescription}
|
|
202
|
-
onChange={(e) =>
|
|
202
|
+
onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) =>
|
|
203
203
|
handleInputChange("metaDescription", e.target.value)
|
|
204
204
|
}
|
|
205
205
|
placeholder="Enter meta description"
|
|
@@ -212,11 +212,11 @@ export function MetaDataStep({
|
|
|
212
212
|
>
|
|
213
213
|
Meta Keywords
|
|
214
214
|
</label>
|
|
215
|
-
<
|
|
215
|
+
<Textarea
|
|
216
216
|
id="metaKeywords"
|
|
217
217
|
className="min-h-[100px] w-full rounded border p-2 text-sm"
|
|
218
218
|
value={pageModel.metaKeywords}
|
|
219
|
-
onChange={(e) =>
|
|
219
|
+
onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) =>
|
|
220
220
|
handleInputChange("metaKeywords", e.target.value)
|
|
221
221
|
}
|
|
222
222
|
placeholder="Enter meta keywords"
|
|
@@ -3,8 +3,8 @@ import { WizardData } from "../PageWizard";
|
|
|
3
3
|
import { useEditContext } from "../../editor/client/editContext";
|
|
4
4
|
import { executePrompt } from "../../editor/services/aiService";
|
|
5
5
|
import { createWizardAiContext } from "../service";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { cn } from "../../lib/utils";
|
|
7
|
+
import { Textarea } from "../../components/ui/textarea";
|
|
8
8
|
import { StepComponentProps } from "../../config/types";
|
|
9
9
|
import { ActionButton } from "../../components/ActionButton";
|
|
10
10
|
import Generate from "./Generate";
|
|
@@ -281,10 +281,12 @@ Create ${step.fields.numberOfOptions || 5} relevant options.`,
|
|
|
281
281
|
<div className="relative flex-1">
|
|
282
282
|
<div className="absolute inset-0 overflow-y-auto">
|
|
283
283
|
<h3 className="text-sm font-bold">Instructions</h3>
|
|
284
|
-
<
|
|
284
|
+
<Textarea
|
|
285
285
|
className="h-48 w-full text-sm"
|
|
286
286
|
value={instructions}
|
|
287
|
-
onChange={(e) =>
|
|
287
|
+
onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) =>
|
|
288
|
+
setInstructions(e.target.value)
|
|
289
|
+
}
|
|
288
290
|
placeholder="Enter instructions for generating the options"
|
|
289
291
|
/>
|
|
290
292
|
</div>
|
|
@@ -335,7 +337,7 @@ Create ${step.fields.numberOfOptions || 5} relevant options.`,
|
|
|
335
337
|
return (
|
|
336
338
|
<div
|
|
337
339
|
key={option.id}
|
|
338
|
-
className={
|
|
340
|
+
className={cn(
|
|
339
341
|
"mb-3 flex items-center rounded border-2 bg-white p-3",
|
|
340
342
|
index % 2 === 0
|
|
341
343
|
? "animate-fadeRight"
|
|
@@ -353,7 +355,7 @@ Create ${step.fields.numberOfOptions || 5} relevant options.`,
|
|
|
353
355
|
</div>
|
|
354
356
|
</div>
|
|
355
357
|
<div
|
|
356
|
-
className={
|
|
358
|
+
className={cn(
|
|
357
359
|
"ml-2 flex h-6 w-6 items-center justify-center rounded-full text-white",
|
|
358
360
|
isSelected
|
|
359
361
|
? "bg-theme-secondary opacity-100"
|
|
@@ -8,7 +8,7 @@ import Generate from "./Generate";
|
|
|
8
8
|
import { WizardBox } from "../WizardBox";
|
|
9
9
|
|
|
10
10
|
import { Settings, Layout, ChevronDown, ChevronRight } from "lucide-react";
|
|
11
|
-
import {
|
|
11
|
+
import { Textarea } from "../../components/ui/textarea";
|
|
12
12
|
import {
|
|
13
13
|
evaluateDataExpression,
|
|
14
14
|
setDataProperty,
|
|
@@ -207,7 +207,6 @@ ${customInstructionsResult.value ? `Additional requirements: ${customInstruction
|
|
|
207
207
|
sections: StructureElement[];
|
|
208
208
|
};
|
|
209
209
|
|
|
210
|
-
|
|
211
210
|
const sections: StructureElement[] | undefined = Array.isArray(
|
|
212
211
|
generatedStructure?.sections,
|
|
213
212
|
)
|
|
@@ -323,9 +322,11 @@ ${customInstructionsResult.value ? `Additional requirements: ${customInstruction
|
|
|
323
322
|
<label className="block text-sm font-medium text-gray-700">
|
|
324
323
|
Additional Requirements (Optional)
|
|
325
324
|
</label>
|
|
326
|
-
<
|
|
325
|
+
<Textarea
|
|
327
326
|
value={customInstructions}
|
|
328
|
-
onChange={(e) =>
|
|
327
|
+
onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) =>
|
|
328
|
+
setCustomInstructions(e.target.value)
|
|
329
|
+
}
|
|
329
330
|
placeholder="Describe any specific requirements for your page structure..."
|
|
330
331
|
rows={3}
|
|
331
332
|
className="w-full"
|
|
@@ -402,11 +403,11 @@ ${customInstructionsResult.value ? `Additional requirements: ${customInstruction
|
|
|
402
403
|
<label className="block text-xs font-medium text-gray-700">
|
|
403
404
|
Content
|
|
404
405
|
</label>
|
|
405
|
-
<
|
|
406
|
+
<Textarea
|
|
406
407
|
value={element.content}
|
|
407
|
-
onChange={(
|
|
408
|
-
|
|
409
|
-
}
|
|
408
|
+
onChange={(
|
|
409
|
+
e: React.ChangeEvent<HTMLTextAreaElement>,
|
|
410
|
+
) => editElement(index, e.target.value)}
|
|
410
411
|
className="w-full"
|
|
411
412
|
rows={4}
|
|
412
413
|
/>
|
|
@@ -3,7 +3,7 @@ import { useEffect, useState, useCallback } from "react";
|
|
|
3
3
|
import { useEditContext } from "../../editor/client/editContext";
|
|
4
4
|
import { Language } from "../../editor/pageModel";
|
|
5
5
|
import { ActionButton } from "../../components/ActionButton";
|
|
6
|
-
import {
|
|
6
|
+
import { Textarea } from "../../components/ui/textarea";
|
|
7
7
|
import { executePrompt } from "../../editor/services/aiService";
|
|
8
8
|
import { createWizardAiContext } from "../service";
|
|
9
9
|
import { LanguageSelector } from "../../components/ui/LanguageSelector";
|
|
@@ -1183,11 +1183,13 @@ Return your response as a JSON object in this exact format:
|
|
|
1183
1183
|
className="min-h-[70px] text-xs"
|
|
1184
1184
|
/>
|
|
1185
1185
|
) : (
|
|
1186
|
-
<
|
|
1186
|
+
<Textarea
|
|
1187
1187
|
value={
|
|
1188
1188
|
translatedField?.translatedValue || ""
|
|
1189
1189
|
}
|
|
1190
|
-
onChange={(
|
|
1190
|
+
onChange={(
|
|
1191
|
+
e: React.ChangeEvent<HTMLTextAreaElement>,
|
|
1192
|
+
) =>
|
|
1191
1193
|
handleFieldChange(
|
|
1192
1194
|
itemId,
|
|
1193
1195
|
field.fieldId,
|
package/src/revision.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = "1.0.
|
|
2
|
-
export const buildDate = "2025-09-
|
|
1
|
+
export const version = "1.0.4118";
|
|
2
|
+
export const buildDate = "2025-09-26 10:16:39";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "../editor/services/editService";
|
|
12
12
|
import { InputText } from "primereact/inputtext";
|
|
13
13
|
import { getAbsoluteIconUrl, getItemDescriptor } from "../editor/utils";
|
|
14
|
-
import {
|
|
14
|
+
import { cn } from "../lib/utils";
|
|
15
15
|
import { useEditContext } from "../client-components";
|
|
16
16
|
|
|
17
17
|
import { ItemDescriptor } from "../editor/pageModel";
|
|
@@ -240,7 +240,7 @@ export function NewPage({ selectedItemId }: { selectedItemId?: string }) {
|
|
|
240
240
|
<div
|
|
241
241
|
key={option.id}
|
|
242
242
|
onClick={() => setSelectedTemplate(option.id)}
|
|
243
|
-
className={
|
|
243
|
+
className={cn(
|
|
244
244
|
"hover:border-theme-secondary flex h-23 min-w-34 cursor-pointer flex-col items-center justify-center gap-2 rounded border border-gray-200 text-xs",
|
|
245
245
|
selectedTemplate === option.id
|
|
246
246
|
? "bg-theme-secondary-light border-theme-secondary"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn } from "../lib/utils";
|
|
2
2
|
import { ArrowRightIcon } from "../editor/ui/Icons";
|
|
3
3
|
|
|
4
4
|
export function SectionHeadline({
|
|
@@ -10,9 +10,9 @@ export function SectionHeadline({
|
|
|
10
10
|
}) {
|
|
11
11
|
return (
|
|
12
12
|
<div
|
|
13
|
-
className={
|
|
14
|
-
"mt-2 mb-2
|
|
15
|
-
className
|
|
13
|
+
className={cn(
|
|
14
|
+
"mt-2 mb-2 flex w-fit items-center gap-2 font-bold",
|
|
15
|
+
className,
|
|
16
16
|
)}
|
|
17
17
|
>
|
|
18
18
|
<ArrowRightIcon /> {children}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function ComponentDesigner(): void;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export function ComponentDesigner() {
|
|
2
|
-
// const [allComponents, setAllComponents] = useState<Component[]>([]);
|
|
3
|
-
// const context = useEditContext();
|
|
4
|
-
// if (!context?.page) return null;
|
|
5
|
-
// useEffect(() => {
|
|
6
|
-
// async function loadComponents() {
|
|
7
|
-
// if (context?.page) {
|
|
8
|
-
// const components = await getAllComponents(context.page.item.id);
|
|
9
|
-
// setAllComponents(components);
|
|
10
|
-
// } else setAllComponents([]);
|
|
11
|
-
// }
|
|
12
|
-
// loadComponents();
|
|
13
|
-
// }, [context.page]);
|
|
14
|
-
// const mainPanels: Panel[] = [
|
|
15
|
-
// {
|
|
16
|
-
// name: "template",
|
|
17
|
-
// title: "Component",
|
|
18
|
-
// initialSize: 30,
|
|
19
|
-
// icon: <PuzzleIcon />,
|
|
20
|
-
// noOverflow: true,
|
|
21
|
-
// content: <ComponentEditor allComponents={allComponents} />,
|
|
22
|
-
// },
|
|
23
|
-
// {
|
|
24
|
-
// name: "placeholders",
|
|
25
|
-
// title: "Placeholders",
|
|
26
|
-
// icon: "pi pi-th-large",
|
|
27
|
-
// initialSize: 30,
|
|
28
|
-
// noOverflow: true,
|
|
29
|
-
// content: <PlaceholdersEditor allComponents={allComponents} />,
|
|
30
|
-
// },
|
|
31
|
-
// {
|
|
32
|
-
// name: "rendering",
|
|
33
|
-
// title: "Rendering",
|
|
34
|
-
// icon: "pi pi-palette",
|
|
35
|
-
// initialSize: 40,
|
|
36
|
-
// content: <ComponentRenderingEditor />,
|
|
37
|
-
// noOverflow: true,
|
|
38
|
-
// },
|
|
39
|
-
// ];
|
|
40
|
-
// return (
|
|
41
|
-
// <Splitter className="h-full">
|
|
42
|
-
// <SplitterPanel>
|
|
43
|
-
// <StackedPanels panels={mainPanels} />
|
|
44
|
-
// </SplitterPanel>
|
|
45
|
-
// <SplitterPanel>
|
|
46
|
-
// <PageViewerFrame compareView={false} />
|
|
47
|
-
// </SplitterPanel>
|
|
48
|
-
// </Splitter>
|
|
49
|
-
// );
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=ComponentDesigner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentDesigner.js","sourceRoot":"","sources":["../../../src/editor/component-designer/ComponentDesigner.tsx"],"names":[],"mappings":"AAgBA,MAAM,UAAU,iBAAiB;IAC/B,uEAAuE;IACvE,oCAAoC;IACpC,mCAAmC;IACnC,oBAAoB;IACpB,sCAAsC;IACtC,2BAA2B;IAC3B,yEAAyE;IACzE,sCAAsC;IACtC,mCAAmC;IACnC,MAAM;IACN,sBAAsB;IACtB,sBAAsB;IACtB,gCAAgC;IAChC,MAAM;IACN,wBAAwB;IACxB,0BAA0B;IAC1B,uBAAuB;IACvB,4BAA4B;IAC5B,wBAAwB;IACxB,kEAAkE;IAClE,OAAO;IACP,MAAM;IACN,4BAA4B;IAC5B,6BAA6B;IAC7B,8BAA8B;IAC9B,uBAAuB;IACvB,wBAAwB;IACxB,qEAAqE;IACrE,OAAO;IACP,MAAM;IACN,yBAAyB;IACzB,0BAA0B;IAC1B,6BAA6B;IAC7B,uBAAuB;IACvB,6CAA6C;IAC7C,wBAAwB;IACxB,OAAO;IACP,KAAK;IACL,WAAW;IACX,kCAAkC;IAClC,sBAAsB;IACtB,8CAA8C;IAC9C,uBAAuB;IACvB,sBAAsB;IACtB,gDAAgD;IAChD,uBAAuB;IACvB,gBAAgB;IAChB,KAAK;AACP,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function ComponentDesignerMenu(): import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEditContext } from "../client/editContext";
|
|
3
|
-
export function ComponentDesignerMenu() {
|
|
4
|
-
const context = useEditContext();
|
|
5
|
-
if (!context)
|
|
6
|
-
return;
|
|
7
|
-
// const menuItems = [
|
|
8
|
-
// {
|
|
9
|
-
// id: "newComponent",
|
|
10
|
-
// label: "New Component",
|
|
11
|
-
// icon: "pi pi-fw pi-plus",
|
|
12
|
-
// command: () => createNew(),
|
|
13
|
-
// // disabled: !context.componentRenderingFolder,
|
|
14
|
-
// },
|
|
15
|
-
// {
|
|
16
|
-
// id: "newRendering",
|
|
17
|
-
// label: "New Rendering",
|
|
18
|
-
// icon: "pi pi-fw pi-palette",
|
|
19
|
-
// command: () => createNewRendering(),
|
|
20
|
-
// disabled: !context.componentDesignerComponent,
|
|
21
|
-
// },
|
|
22
|
-
// {
|
|
23
|
-
// id: "delete",
|
|
24
|
-
// label: "Delete rendering",
|
|
25
|
-
// icon: "pi pi-fw pi-trash",
|
|
26
|
-
// disabled: !context.componentDesignerRendering,
|
|
27
|
-
// },
|
|
28
|
-
// ];
|
|
29
|
-
// const itemNameDialogRef = useRef<ItemNameDialogHandle>(null);
|
|
30
|
-
// const createNew = async () => {
|
|
31
|
-
// itemNameDialogRef.current?.show({
|
|
32
|
-
// title: "Choose Component Name",
|
|
33
|
-
// accept: async (name) => {
|
|
34
|
-
// await createNewComponent(name, context.page!.item);
|
|
35
|
-
// },
|
|
36
|
-
// });
|
|
37
|
-
// };
|
|
38
|
-
// const createNewRendering = async () => {
|
|
39
|
-
// itemNameDialogRef.current?.show({
|
|
40
|
-
// title: "Choose Rendering Name",
|
|
41
|
-
// accept: async (name) => {
|
|
42
|
-
// if (!context.componentDesignerComponent) return;
|
|
43
|
-
// const details = await createRendering(
|
|
44
|
-
// name,
|
|
45
|
-
// context.page!.item,
|
|
46
|
-
// context.componentDesignerComponent.templateId
|
|
47
|
-
// );
|
|
48
|
-
// if (!("id" in details)) return;
|
|
49
|
-
// const component = await loadComponentDetails(
|
|
50
|
-
// context.componentDesignerComponent.templateId,
|
|
51
|
-
// context!.page!.item.id
|
|
52
|
-
// );
|
|
53
|
-
// // const rendering = await getItem({
|
|
54
|
-
// // id: details.id,
|
|
55
|
-
// // language: "en",
|
|
56
|
-
// // version: 0,
|
|
57
|
-
// // });
|
|
58
|
-
// context.setComponentDesignerComponent(component);
|
|
59
|
-
// // context.setComponentDesignerRendering(rendering);
|
|
60
|
-
// },
|
|
61
|
-
// });
|
|
62
|
-
// };
|
|
63
|
-
return (_jsx(_Fragment, {}));
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=ComponentDesignerMenu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentDesignerMenu.js","sourceRoot":"","sources":["../../../src/editor/component-designer/ComponentDesignerMenu.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,MAAM,UAAU,qBAAqB;IACnC,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;IACjC,IAAI,CAAC,OAAO;QAAE,OAAO;IAErB,sBAAsB;IACtB,MAAM;IACN,0BAA0B;IAC1B,8BAA8B;IAC9B,gCAAgC;IAChC,kCAAkC;IAClC,2DAA2D;IAC3D,OAAO;IACP,MAAM;IACN,0BAA0B;IAC1B,8BAA8B;IAC9B,mCAAmC;IACnC,2CAA2C;IAC3C,qDAAqD;IACrD,OAAO;IACP,MAAM;IACN,oBAAoB;IACpB,iCAAiC;IACjC,iCAAiC;IACjC,qDAAqD;IACrD,OAAO;IACP,KAAK;IACL,gEAAgE;IAEhE,kCAAkC;IAClC,sCAAsC;IACtC,sCAAsC;IACtC,gCAAgC;IAChC,4DAA4D;IAC5D,SAAS;IACT,QAAQ;IACR,KAAK;IAEL,2CAA2C;IAC3C,sCAAsC;IACtC,sCAAsC;IACtC,gCAAgC;IAChC,yDAAyD;IACzD,+CAA+C;IAC/C,gBAAgB;IAChB,8BAA8B;IAC9B,wDAAwD;IACxD,WAAW;IACX,wCAAwC;IAExC,sDAAsD;IACtD,yDAAyD;IACzD,iCAAiC;IACjC,WAAW;IACX,6CAA6C;IAC7C,6BAA6B;IAC7B,6BAA6B;IAC7B,yBAAyB;IACzB,eAAe;IACf,0DAA0D;IAC1D,gEAAgE;IAChE,SAAS;IACT,QAAQ;IACR,KAAK;IAEL,OAAO,CACL,mBAWG,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect } from "react";
|
|
3
|
-
import { Toolbar } from "../ui/Toolbar";
|
|
4
|
-
import { ComponentsDropdown } from "./ComponentsDropdown";
|
|
5
|
-
import { TemplateEditor } from "./TemplateEditor";
|
|
6
|
-
import { getSelectedComponents } from "../componentTreeHelper";
|
|
7
|
-
import { useEditContext } from "../client/editContext";
|
|
8
|
-
import { toast } from "sonner";
|
|
9
|
-
import { loadComponentDetails, saveComponentDetails, } from "../services/componentDesignerService";
|
|
10
|
-
import { Button } from "primereact/button";
|
|
11
|
-
export function ComponentEditor({ allComponents, }) {
|
|
12
|
-
const context = useEditContext();
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
const loadSelectedComponent = async () => {
|
|
15
|
-
const selectedComponents = getSelectedComponents(context);
|
|
16
|
-
if (selectedComponents.length !== 1) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const component = selectedComponents[0];
|
|
20
|
-
if (!component) {
|
|
21
|
-
context.setComponentDesignerComponent(undefined);
|
|
22
|
-
context.setComponentDesignerRendering(undefined);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
context.setComponentDesignerComponent(await loadComponentDetails(component.datasourceItem.templateId, context.page.item.id));
|
|
26
|
-
// if (component.rendering) {
|
|
27
|
-
// context.setComponentDesignerRendering(
|
|
28
|
-
// await getItem({
|
|
29
|
-
// id: component.rendering.id,
|
|
30
|
-
// language: "en",
|
|
31
|
-
// version: 0,
|
|
32
|
-
// })
|
|
33
|
-
// );
|
|
34
|
-
// } else context.setComponentDesignerRendering(undefined);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
loadSelectedComponent();
|
|
38
|
-
}, [context.selection]);
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
const refresh = async () => {
|
|
41
|
-
if (context.componentDesignerComponent) {
|
|
42
|
-
context.setComponentDesignerComponent(await loadComponentDetails(context.componentDesignerComponent.templateId, context.page.item.id));
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
refresh();
|
|
46
|
-
}, [context.refreshCompletedFlag]);
|
|
47
|
-
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsxs(Toolbar, { children: [_jsx(ComponentsDropdown, { allComponents: allComponents }), " ", _jsx(Button, { icon: "pi pi-fw pi-save", text: true, size: "small", disabled: !context.componentDesignerComponent, onClick: () => {
|
|
48
|
-
const save = async () => {
|
|
49
|
-
await saveComponentDetails(context.componentDesignerComponent, context.page.item);
|
|
50
|
-
toast.success("Component saved");
|
|
51
|
-
};
|
|
52
|
-
save();
|
|
53
|
-
} })] }), _jsx("div", { className: "flex-1 overflow-auto", children: _jsx(TemplateEditor, {}) })] }));
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=ComponentEditor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentEditor.js","sourceRoot":"","sources":["../../../src/editor/component-designer/ComponentEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAEL,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,UAAU,eAAe,CAAC,EAC9B,aAAa,GAGd;IACC,MAAM,OAAO,GAAG,cAAc,EAAG,CAAC;IAElC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,qBAAqB,GAAG,KAAK,IAAI,EAAE;YACvC,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,OAAQ,CAAC,CAAC;YAC3D,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACpC,OAAO;YACT,CAAC;YACD,MAAM,SAAS,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;YAExC,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,OAAO,CAAC,6BAA6B,CAAC,SAAS,CAAC,CAAC;gBACjD,OAAO,CAAC,6BAA6B,CAAC,SAAS,CAAC,CAAC;YACnD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,6BAA6B,CACnC,MAAM,oBAAoB,CACxB,SAAS,CAAC,cAAe,CAAC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C,GACD,IACM,EACV,cAAK,SAAS,EAAC,sBAAsB,YACnC,KAAC,cAAc,KAAG,GACd,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "@uiw/react-textarea-code-editor/dist.css";
|
|
3
|
-
import CodeEditor from "@uiw/react-textarea-code-editor";
|
|
4
|
-
export function ComponentRenderingCodeEditor({ code, setCode, }) {
|
|
5
|
-
return (_jsx("div", { className: "size-full relative", children: _jsx("div", { className: "absolute inset-0 overflow-auto", children: _jsx(CodeEditor, { value: code, language: "js", placeholder: "Please enter TSX code.", onChange: (evn) => setCode(evn.target.value), padding: 15, style: {
|
|
6
|
-
fontSize: 12,
|
|
7
|
-
backgroundColor: "#f5f5f5",
|
|
8
|
-
fontFamily: "ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace",
|
|
9
|
-
} }) }) }));
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=ComponentRenderingCodeEditor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentRenderingCodeEditor.js","sourceRoot":"","sources":["../../../src/editor/component-designer/ComponentRenderingCodeEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,0CAA0C,CAAC;AAElD,OAAO,UAAU,MAAM,iCAAiC,CAAC;AAEzD,MAAM,UAAU,4BAA4B,CAAC,EAC3C,IAAI,EACJ,OAAO,GAIR;IACC,OAAO,CACL,cAAK,SAAS,EAAC,oBAAoB,YACjC,cAAK,SAAS,EAAC,gCAAgC,YAC7C,KAAC,UAAU,IACT,KAAK,EAAE,IAAI,EACX,QAAQ,EAAC,IAAI,EACb,WAAW,EAAC,wBAAwB,EACpC,QAAQ,EAAE,CAAC,GAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EACjD,OAAO,EAAE,EAAE,EACX,KAAK,EAAE;oBACL,QAAQ,EAAE,EAAE;oBACZ,eAAe,EAAE,SAAS;oBAC1B,UAAU,EACR,8EAA8E;iBACjF,GACD,GACE,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function ComponentRenderingEditor(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { Toolbar } from "../ui/Toolbar";
|
|
4
|
-
import { ComponentRenderingCodeEditor } from "./ComponentRenderingCodeEditor";
|
|
5
|
-
import { RenderingsDropdown } from "./RenderingsDropdown";
|
|
6
|
-
import { useEditContext } from "../client/editContext";
|
|
7
|
-
import { getSelectedComponents } from "../componentTreeHelper";
|
|
8
|
-
import { Button } from "primereact/button";
|
|
9
|
-
export function ComponentRenderingEditor() {
|
|
10
|
-
const context = useEditContext();
|
|
11
|
-
const [code, setCode] = useState("");
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
async function loadRendering() {
|
|
14
|
-
const selectedComponents = getSelectedComponents(context);
|
|
15
|
-
if (selectedComponents.length !== 1) {
|
|
16
|
-
context;
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const component = selectedComponents[0];
|
|
20
|
-
const renderingId = component?.rendering?.id;
|
|
21
|
-
if (renderingId) {
|
|
22
|
-
const renderingItem = await context.itemsRepository.getItem({
|
|
23
|
-
id: renderingId,
|
|
24
|
-
language: "en",
|
|
25
|
-
version: 0,
|
|
26
|
-
});
|
|
27
|
-
context?.setComponentDesignerRendering(renderingItem);
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
context?.setComponentDesignerRendering(undefined);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
loadRendering();
|
|
34
|
-
}, [context.selection]);
|
|
35
|
-
const codeField = context.componentDesignerRendering?.fields.find((x) => x.name === "code");
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
if (codeField) {
|
|
38
|
-
setCode(codeField.value);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
setCode("");
|
|
42
|
-
}
|
|
43
|
-
}, [context.componentDesignerRendering]);
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
const refresh = async () => {
|
|
46
|
-
if (context.componentDesignerRendering) {
|
|
47
|
-
const renderingItem = await context.itemsRepository.getItem({
|
|
48
|
-
id: context.componentDesignerRendering.id,
|
|
49
|
-
language: "en",
|
|
50
|
-
version: 0,
|
|
51
|
-
});
|
|
52
|
-
context?.setComponentDesignerRendering(renderingItem);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
refresh();
|
|
56
|
-
}, [context.refreshCompletedFlag]);
|
|
57
|
-
if (!context.componentDesignerComponent)
|
|
58
|
-
return (_jsx("div", { className: "flex items-center justify-center h-full text-xs", children: "Select a component" }));
|
|
59
|
-
else
|
|
60
|
-
return (_jsxs("div", { className: "flex flex-col h-full", children: [_jsxs(Toolbar, { children: [_jsx(RenderingsDropdown, {}), _jsx(Button, { icon: "pi pi-fw pi-save", text: true, size: "small", disabled: !codeField, onClick: () => {
|
|
61
|
-
if (!codeField)
|
|
62
|
-
return;
|
|
63
|
-
context.operations.editField({
|
|
64
|
-
field: codeField.descriptor,
|
|
65
|
-
value: code,
|
|
66
|
-
});
|
|
67
|
-
} })] }), _jsxs("div", { className: "flex-1", children: [!codeField && (_jsx("div", { className: "flex items-center justify-center h-full text-xs", children: "Select a rendering" })), codeField && (_jsx(ComponentRenderingCodeEditor, { code: code, setCode: setCode }))] })] }));
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=ComponentRenderingEditor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentRenderingEditor.js","sourceRoot":"","sources":["../../../src/editor/component-designer/ComponentRenderingEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAA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