@alpaca-editor/core 1.0.3979 → 1.0.3981
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/ui/badge.d.ts +1 -1
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/config/config.js +18 -2
- package/dist/config/config.js.map +1 -1
- package/dist/editor/AspectRatioSelector.d.ts +13 -0
- package/dist/editor/AspectRatioSelector.js +71 -0
- package/dist/editor/AspectRatioSelector.js.map +1 -0
- package/dist/editor/ConfirmationDialog.js +4 -5
- package/dist/editor/ConfirmationDialog.js.map +1 -1
- package/dist/editor/PictureCropper.d.ts +1 -1
- package/dist/editor/PictureCropper.js +466 -113
- package/dist/editor/PictureCropper.js.map +1 -1
- package/dist/editor/Terminal.js +5 -4
- package/dist/editor/Terminal.js.map +1 -1
- package/dist/editor/ai/AiTerminal.js +20 -2
- package/dist/editor/ai/AiTerminal.js.map +1 -1
- package/dist/editor/client/EditorClient.js +14 -3
- package/dist/editor/client/EditorClient.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +3 -0
- package/dist/editor/client/editContext.js.map +1 -1
- package/dist/editor/commands/componentCommands.js +13 -5
- package/dist/editor/commands/componentCommands.js.map +1 -1
- package/dist/editor/media-selector/Preview.js +1 -1
- package/dist/editor/media-selector/Preview.js.map +1 -1
- package/dist/editor/page-editor-chrome/FrameMenu.js +48 -24
- package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +3 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +6 -6
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js +26 -4
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js.map +1 -1
- package/dist/editor/page-viewer/EditorForm.d.ts +2 -1
- package/dist/editor/page-viewer/EditorForm.js +16 -2
- package/dist/editor/page-viewer/EditorForm.js.map +1 -1
- package/dist/editor/page-viewer/EditorFormPopup.d.ts +11 -0
- package/dist/editor/page-viewer/EditorFormPopup.js +41 -0
- package/dist/editor/page-viewer/EditorFormPopup.js.map +1 -0
- package/dist/editor/page-viewer/PageViewer.js +4 -6
- package/dist/editor/page-viewer/PageViewer.js.map +1 -1
- package/dist/editor/services/contextService.d.ts +26 -0
- package/dist/editor/services/contextService.js +102 -0
- package/dist/editor/services/contextService.js.map +1 -0
- package/dist/editor/sidebar/Completions.d.ts +1 -0
- package/dist/editor/sidebar/Completions.js +54 -0
- package/dist/editor/sidebar/Completions.js.map +1 -0
- package/dist/editor/ui/SimpleTabs.d.ts +2 -1
- package/dist/editor/ui/SimpleTabs.js +2 -2
- package/dist/editor/ui/SimpleTabs.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/styles.css +127 -26
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/ui/switch.tsx +1 -1
- package/src/config/config.tsx +18 -1
- package/src/editor/AspectRatioSelector.tsx +146 -0
- package/src/editor/ConfirmationDialog.tsx +36 -45
- package/src/editor/PictureCropper.tsx +724 -233
- package/src/editor/Terminal.tsx +9 -8
- package/src/editor/ai/AiTerminal.tsx +58 -15
- package/src/editor/client/EditorClient.tsx +26 -1
- package/src/editor/client/editContext.ts +7 -0
- package/src/editor/commands/componentCommands.tsx +14 -9
- package/src/editor/media-selector/Preview.tsx +7 -5
- package/src/editor/page-editor-chrome/FrameMenu.tsx +70 -15
- package/src/editor/page-editor-chrome/PlaceholderDropZone.tsx +9 -3
- package/src/editor/page-editor-chrome/useInlineAICompletion.tsx +31 -5
- package/src/editor/page-viewer/EditorForm.tsx +21 -1
- package/src/editor/page-viewer/EditorFormPopup.tsx +104 -0
- package/src/editor/page-viewer/PageViewer.tsx +3 -11
- package/src/editor/services/contextService.ts +146 -0
- package/src/editor/sidebar/Completions.tsx +160 -0
- package/src/editor/ui/SimpleTabs.tsx +4 -1
- package/src/revision.ts +2 -2
- package/src/types.ts +1 -0
- package/dist/editor/menubar/BrowseHistory.d.ts +0 -6
- package/dist/editor/menubar/BrowseHistory.js +0 -11
- package/dist/editor/menubar/BrowseHistory.js.map +0 -1
- package/src/editor/menubar/BrowseHistory.tsx +0 -28
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { useState, forwardRef, useImperativeHandle } from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
Dialog,
|
|
4
|
+
DialogContent,
|
|
5
|
+
DialogHeader,
|
|
6
|
+
DialogTitle,
|
|
7
|
+
DialogFooter,
|
|
8
|
+
} from "../components/ui/dialog";
|
|
9
|
+
import { Button } from "../components/ui/button";
|
|
4
10
|
|
|
5
11
|
export type ConfirmationDialogProps = {};
|
|
6
12
|
|
|
@@ -30,7 +36,7 @@ const ConfirmationDialog = forwardRef<
|
|
|
30
36
|
|
|
31
37
|
const [props, setProps] = useState<ConfirmationProps>();
|
|
32
38
|
|
|
33
|
-
const showAccept = props?.
|
|
39
|
+
const showAccept = props?.showAccept === undefined ? true : props.showAccept;
|
|
34
40
|
|
|
35
41
|
useImperativeHandle(ref, () => ({
|
|
36
42
|
confirm: (props: ConfirmationProps) => {
|
|
@@ -53,50 +59,35 @@ const ConfirmationDialog = forwardRef<
|
|
|
53
59
|
setVisible(false);
|
|
54
60
|
};
|
|
55
61
|
|
|
56
|
-
const dialogFooter = (
|
|
57
|
-
<div>
|
|
58
|
-
{showAccept && (
|
|
59
|
-
<Button
|
|
60
|
-
label={props?.acceptLabel || "Yes"}
|
|
61
|
-
icon={props?.acceptIcon || "pi pi-check"}
|
|
62
|
-
onClick={handleAccept}
|
|
63
|
-
className="p-button-text"
|
|
64
|
-
/>
|
|
65
|
-
)}
|
|
66
|
-
{props?.rejectLabel && (
|
|
67
|
-
<Button
|
|
68
|
-
label={props?.rejectLabel}
|
|
69
|
-
icon={props?.rejectIcon || "pi pi-times"}
|
|
70
|
-
onClick={handleReject}
|
|
71
|
-
className="p-button-text"
|
|
72
|
-
/>
|
|
73
|
-
)}
|
|
74
|
-
{props?.showCancel && (
|
|
75
|
-
<Button
|
|
76
|
-
label="Cancel"
|
|
77
|
-
icon="pi pi-ban"
|
|
78
|
-
onClick={handleCancel}
|
|
79
|
-
className="p-button-text"
|
|
80
|
-
/>
|
|
81
|
-
)}
|
|
82
|
-
</div>
|
|
83
|
-
);
|
|
84
|
-
|
|
85
62
|
return (
|
|
86
|
-
visible
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
<div className="flex items-center gap-2 p-3">
|
|
95
|
-
{props?.icon && <i className={props.icon + " text-3xl"}></i>}
|
|
96
|
-
{props?.message}
|
|
63
|
+
<Dialog open={visible} onOpenChange={setVisible}>
|
|
64
|
+
<DialogContent className="sm:max-w-[425px]">
|
|
65
|
+
<DialogHeader>
|
|
66
|
+
<DialogTitle>{props?.header || "Confirm"}</DialogTitle>
|
|
67
|
+
</DialogHeader>
|
|
68
|
+
<div className="flex items-center gap-3 p-3">
|
|
69
|
+
{props?.icon && <div className="text-2xl">{props.icon}</div>}
|
|
70
|
+
<div className="flex-1">{props?.message}</div>
|
|
97
71
|
</div>
|
|
98
|
-
|
|
99
|
-
|
|
72
|
+
<DialogFooter className="gap-2 border-t p-2">
|
|
73
|
+
{props?.showCancel && (
|
|
74
|
+
<Button variant="ghost" onClick={handleCancel}>
|
|
75
|
+
Cancel
|
|
76
|
+
</Button>
|
|
77
|
+
)}
|
|
78
|
+
{props?.rejectLabel && (
|
|
79
|
+
<Button variant="destructive" onClick={handleReject}>
|
|
80
|
+
{props.rejectLabel}
|
|
81
|
+
</Button>
|
|
82
|
+
)}
|
|
83
|
+
{showAccept && (
|
|
84
|
+
<Button onClick={handleAccept}>
|
|
85
|
+
{props?.acceptLabel || "Yes"}
|
|
86
|
+
</Button>
|
|
87
|
+
)}
|
|
88
|
+
</DialogFooter>
|
|
89
|
+
</DialogContent>
|
|
90
|
+
</Dialog>
|
|
100
91
|
);
|
|
101
92
|
});
|
|
102
93
|
|