@alpaca-editor/core 1.0.3880 → 1.0.3881
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/config/config.js +30 -13
- package/dist/config/config.js.map +1 -1
- package/dist/config/types.d.ts +1 -3
- package/dist/editor/ContentTree.js +1 -3
- package/dist/editor/ContentTree.js.map +1 -1
- package/dist/editor/Editor.js +1 -2
- package/dist/editor/Editor.js.map +1 -1
- package/dist/editor/FieldListField.js +19 -16
- package/dist/editor/FieldListField.js.map +1 -1
- package/dist/editor/ImageEditor.js +2 -3
- package/dist/editor/ImageEditor.js.map +1 -1
- package/dist/editor/LinkEditorDialog.d.ts +1 -1
- package/dist/editor/LinkEditorDialog.js +4 -0
- package/dist/editor/LinkEditorDialog.js.map +1 -1
- package/dist/editor/ScrollingContentTree.d.ts +2 -1
- package/dist/editor/ScrollingContentTree.js +19 -2
- package/dist/editor/ScrollingContentTree.js.map +1 -1
- package/dist/editor/ai/AiTerminal.js +0 -1
- package/dist/editor/ai/AiTerminal.js.map +1 -1
- package/dist/editor/ai/AiToolCall.js +1 -1
- package/dist/editor/ai/AiToolCall.js.map +1 -1
- package/dist/editor/client/AboutDialog.d.ts +1 -1
- package/dist/editor/client/EditorClient.js +15 -8
- package/dist/editor/client/EditorClient.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +5 -2
- package/dist/editor/client/editContext.js.map +1 -1
- package/dist/editor/client/operations.d.ts +1 -1
- package/dist/editor/client/operations.js +2 -1
- package/dist/editor/client/operations.js.map +1 -1
- package/dist/editor/commands/commands.d.ts +1 -1
- package/dist/editor/commands/itemCommands.js +45 -9
- package/dist/editor/commands/itemCommands.js.map +1 -1
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.d.ts +1 -1
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js +5 -5
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js.map +1 -1
- package/dist/editor/component-designer/ComponentDesignerMenu.js +58 -58
- package/dist/editor/component-designer/ComponentDesignerMenu.js.map +1 -1
- package/dist/editor/component-designer/PlaceholdersEditor.js +22 -27
- package/dist/editor/component-designer/PlaceholdersEditor.js.map +1 -1
- package/dist/editor/componentTreeHelper.js +3 -0
- package/dist/editor/componentTreeHelper.js.map +1 -1
- package/dist/editor/context-menu/CopyMoveMenu.d.ts +1 -1
- package/dist/editor/context-menu/CopyMoveMenu.js +2 -0
- package/dist/editor/context-menu/CopyMoveMenu.js.map +1 -1
- package/dist/editor/context-menu/InsertMenu.d.ts +1 -1
- package/dist/editor/context-menu/InsertMenu.js +2 -0
- package/dist/editor/context-menu/InsertMenu.js.map +1 -1
- package/dist/editor/menubar/PageSelector.d.ts +1 -1
- package/dist/editor/menubar/PageSelector.js +2 -0
- package/dist/editor/menubar/PageSelector.js.map +1 -1
- package/dist/editor/page-viewer/EditorForm.js +2 -1
- package/dist/editor/page-viewer/EditorForm.js.map +1 -1
- package/dist/editor/sidebar/ComponentTree.js +5 -3
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/ui/CopyMoveTargetSelectorDialog.d.ts +10 -0
- package/dist/editor/ui/CopyMoveTargetSelectorDialog.js +32 -0
- package/dist/editor/ui/CopyMoveTargetSelectorDialog.js.map +1 -0
- package/dist/editor/ui/ItemNameDialogNew.d.ts +1 -1
- package/dist/editor/ui/ItemNameDialogNew.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/styles.css +2 -7
- package/package.json +3 -5
- package/src/config/config.tsx +31 -29
- package/src/config/types.ts +2 -3
- package/src/editor/ContentTree.tsx +1 -4
- package/src/editor/Editor.tsx +7 -9
- package/src/editor/FieldListField.tsx +17 -14
- package/src/editor/ImageEditor.tsx +3 -3
- package/src/editor/LinkEditorDialog.tsx +5 -1
- package/src/editor/ScrollingContentTree.tsx +23 -3
- package/src/editor/ai/AiTerminal.tsx +1 -6
- package/src/editor/ai/AiToolCall.tsx +0 -1
- package/src/editor/client/AboutDialog.tsx +1 -1
- package/src/editor/client/EditorClient.tsx +20 -8
- package/src/editor/client/editContext.ts +9 -2
- package/src/editor/client/operations.ts +2 -1
- package/src/editor/commands/commands.ts +2 -3
- package/src/editor/commands/itemCommands.tsx +64 -9
- package/src/editor/commands/localizeItem/LocalizeItemDialog.tsx +17 -17
- package/src/editor/component-designer/ComponentDesignerMenu.tsx +60 -60
- package/src/editor/component-designer/PlaceholdersEditor.tsx +39 -43
- package/src/editor/componentTreeHelper.tsx +7 -0
- package/src/editor/context-menu/CopyMoveMenu.tsx +1 -0
- package/src/editor/context-menu/InsertMenu.tsx +2 -0
- package/src/editor/menubar/PageSelector.tsx +2 -0
- package/src/editor/page-viewer/EditorForm.tsx +4 -1
- package/src/editor/pageModel.ts +1 -1
- package/src/editor/sidebar/ComponentTree.tsx +4 -3
- package/src/editor/ui/CopyMoveTargetSelectorDialog.tsx +72 -0
- package/src/editor/ui/ItemNameDialogNew.tsx +7 -7
- package/src/index.ts +1 -1
- package/src/revision.ts +2 -2
- package/styles.css +2 -2
- package/dist/editor/client/DialogContext.d.ts +0 -12
- package/dist/editor/client/DialogContext.js +0 -25
- package/dist/editor/client/DialogContext.js.map +0 -1
- package/dist/editor/ui/ItemNameDialog.d.ts +0 -11
- package/dist/editor/ui/ItemNameDialog.js +0 -40
- package/dist/editor/ui/ItemNameDialog.js.map +0 -1
- package/src/editor/client/DialogContext.tsx +0 -49
- package/src/editor/ui/ItemNameDialog.tsx +0 -94
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { Dialog } from "primereact/dialog";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
forwardRef,
|
|
5
|
-
useEffect,
|
|
6
|
-
useImperativeHandle,
|
|
7
|
-
useRef,
|
|
8
|
-
useState,
|
|
9
|
-
} from "react";
|
|
10
|
-
import DialogButtons from "./DialogButtons";
|
|
11
|
-
import { Button } from "primereact/button";
|
|
12
|
-
import { InputText } from "primereact/inputtext";
|
|
13
|
-
|
|
14
|
-
export interface ItemNameDialogHandle {
|
|
15
|
-
show: (props: ItemNameDialogProps) => void;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export type ItemNameDialogProps = {
|
|
19
|
-
name?: string;
|
|
20
|
-
title?: string;
|
|
21
|
-
message?: string;
|
|
22
|
-
accept: (name: string) => void;
|
|
23
|
-
onClose?: (result: string | null) => void;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
type ItemNameDialogPropsInternal = {};
|
|
27
|
-
|
|
28
|
-
export const ItemNameDialog = forwardRef<
|
|
29
|
-
ItemNameDialogHandle,
|
|
30
|
-
ItemNameDialogPropsInternal
|
|
31
|
-
>((_props, ref) => {
|
|
32
|
-
const [visible, setVisible] = useState(false);
|
|
33
|
-
|
|
34
|
-
const [props, setProps] = useState<ItemNameDialogProps>();
|
|
35
|
-
|
|
36
|
-
const [name, setName] = useState("");
|
|
37
|
-
const nameRef = useRef<HTMLInputElement>(null);
|
|
38
|
-
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
setName(props?.name || "");
|
|
41
|
-
}, [props]);
|
|
42
|
-
|
|
43
|
-
useImperativeHandle(ref, () => ({
|
|
44
|
-
show: (props: ItemNameDialogProps) => {
|
|
45
|
-
setVisible(true);
|
|
46
|
-
setProps(props);
|
|
47
|
-
},
|
|
48
|
-
}));
|
|
49
|
-
|
|
50
|
-
if (!visible) return null;
|
|
51
|
-
|
|
52
|
-
if (!props) return null;
|
|
53
|
-
|
|
54
|
-
const isValidName = name.trim().length > 0;
|
|
55
|
-
|
|
56
|
-
const handleOk = () => {
|
|
57
|
-
setVisible(false);
|
|
58
|
-
props?.accept(name);
|
|
59
|
-
props.onClose?.(name);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<Dialog
|
|
64
|
-
visible={visible}
|
|
65
|
-
onHide={() => {
|
|
66
|
-
setVisible(false);
|
|
67
|
-
}}
|
|
68
|
-
onShow={() => {
|
|
69
|
-
nameRef.current?.focus();
|
|
70
|
-
}}
|
|
71
|
-
style={{ width: "400px" }}
|
|
72
|
-
header={props?.title ?? "Name"}
|
|
73
|
-
>
|
|
74
|
-
<div className="py-3">
|
|
75
|
-
<div className="text-sm my-2">
|
|
76
|
-
{props.message || "Enter a name for the new item:"}
|
|
77
|
-
</div>
|
|
78
|
-
<InputText
|
|
79
|
-
ref={nameRef}
|
|
80
|
-
value={name}
|
|
81
|
-
className="w-full"
|
|
82
|
-
onChange={(e) => setName(e.target.value)}
|
|
83
|
-
onKeyDown={(ev) => {
|
|
84
|
-
if (ev.key === "Enter" && isValidName) handleOk();
|
|
85
|
-
}}
|
|
86
|
-
/>
|
|
87
|
-
</div>
|
|
88
|
-
<DialogButtons>
|
|
89
|
-
<Button onClick={handleOk} label="Ok" disabled={!isValidName} />
|
|
90
|
-
<Button onClick={() => props.onClose?.(null)} label="Cancel" />
|
|
91
|
-
</DialogButtons>
|
|
92
|
-
</Dialog>
|
|
93
|
-
);
|
|
94
|
-
});
|