@alpaca-editor/core 1.0.3880 → 1.0.3882

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.
Files changed (103) hide show
  1. package/dist/config/config.js +30 -13
  2. package/dist/config/config.js.map +1 -1
  3. package/dist/config/types.d.ts +1 -3
  4. package/dist/editor/ContentTree.js +1 -3
  5. package/dist/editor/ContentTree.js.map +1 -1
  6. package/dist/editor/Editor.js +1 -2
  7. package/dist/editor/Editor.js.map +1 -1
  8. package/dist/editor/FieldListField.js +19 -16
  9. package/dist/editor/FieldListField.js.map +1 -1
  10. package/dist/editor/ImageEditor.js +2 -3
  11. package/dist/editor/ImageEditor.js.map +1 -1
  12. package/dist/editor/LinkEditorDialog.d.ts +1 -1
  13. package/dist/editor/LinkEditorDialog.js +4 -0
  14. package/dist/editor/LinkEditorDialog.js.map +1 -1
  15. package/dist/editor/ScrollingContentTree.d.ts +2 -1
  16. package/dist/editor/ScrollingContentTree.js +19 -2
  17. package/dist/editor/ScrollingContentTree.js.map +1 -1
  18. package/dist/editor/ai/AiTerminal.js +0 -1
  19. package/dist/editor/ai/AiTerminal.js.map +1 -1
  20. package/dist/editor/ai/AiToolCall.js +1 -1
  21. package/dist/editor/ai/AiToolCall.js.map +1 -1
  22. package/dist/editor/client/AboutDialog.d.ts +1 -1
  23. package/dist/editor/client/EditorClient.js +15 -8
  24. package/dist/editor/client/EditorClient.js.map +1 -1
  25. package/dist/editor/client/editContext.d.ts +5 -2
  26. package/dist/editor/client/editContext.js.map +1 -1
  27. package/dist/editor/client/operations.d.ts +1 -1
  28. package/dist/editor/client/operations.js +2 -1
  29. package/dist/editor/client/operations.js.map +1 -1
  30. package/dist/editor/commands/commands.d.ts +1 -1
  31. package/dist/editor/commands/itemCommands.js +45 -9
  32. package/dist/editor/commands/itemCommands.js.map +1 -1
  33. package/dist/editor/commands/localizeItem/LocalizeItemDialog.d.ts +1 -1
  34. package/dist/editor/commands/localizeItem/LocalizeItemDialog.js +5 -5
  35. package/dist/editor/commands/localizeItem/LocalizeItemDialog.js.map +1 -1
  36. package/dist/editor/component-designer/ComponentDesignerMenu.js +58 -58
  37. package/dist/editor/component-designer/ComponentDesignerMenu.js.map +1 -1
  38. package/dist/editor/component-designer/PlaceholdersEditor.js +22 -27
  39. package/dist/editor/component-designer/PlaceholdersEditor.js.map +1 -1
  40. package/dist/editor/componentTreeHelper.js +3 -0
  41. package/dist/editor/componentTreeHelper.js.map +1 -1
  42. package/dist/editor/context-menu/CopyMoveMenu.d.ts +1 -1
  43. package/dist/editor/context-menu/CopyMoveMenu.js +2 -0
  44. package/dist/editor/context-menu/CopyMoveMenu.js.map +1 -1
  45. package/dist/editor/context-menu/InsertMenu.d.ts +1 -1
  46. package/dist/editor/context-menu/InsertMenu.js +2 -0
  47. package/dist/editor/context-menu/InsertMenu.js.map +1 -1
  48. package/dist/editor/menubar/PageSelector.d.ts +1 -1
  49. package/dist/editor/menubar/PageSelector.js +2 -0
  50. package/dist/editor/menubar/PageSelector.js.map +1 -1
  51. package/dist/editor/page-viewer/EditorForm.js +2 -1
  52. package/dist/editor/page-viewer/EditorForm.js.map +1 -1
  53. package/dist/editor/sidebar/ComponentTree.js +5 -3
  54. package/dist/editor/sidebar/ComponentTree.js.map +1 -1
  55. package/dist/editor/ui/CopyMoveTargetSelectorDialog.d.ts +10 -0
  56. package/dist/editor/ui/CopyMoveTargetSelectorDialog.js +32 -0
  57. package/dist/editor/ui/CopyMoveTargetSelectorDialog.js.map +1 -0
  58. package/dist/editor/ui/ItemNameDialogNew.d.ts +1 -1
  59. package/dist/editor/ui/ItemNameDialogNew.js +2 -2
  60. package/dist/index.d.ts +1 -1
  61. package/dist/revision.d.ts +2 -2
  62. package/dist/revision.js +2 -2
  63. package/dist/styles.css +2 -7
  64. package/package.json +3 -5
  65. package/src/config/config.tsx +31 -29
  66. package/src/config/types.ts +2 -3
  67. package/src/editor/ContentTree.tsx +1 -4
  68. package/src/editor/Editor.tsx +7 -9
  69. package/src/editor/FieldListField.tsx +17 -14
  70. package/src/editor/ImageEditor.tsx +3 -3
  71. package/src/editor/LinkEditorDialog.tsx +5 -1
  72. package/src/editor/ScrollingContentTree.tsx +23 -3
  73. package/src/editor/ai/AiTerminal.tsx +1 -6
  74. package/src/editor/ai/AiToolCall.tsx +0 -1
  75. package/src/editor/client/AboutDialog.tsx +1 -1
  76. package/src/editor/client/EditorClient.tsx +20 -8
  77. package/src/editor/client/editContext.ts +9 -2
  78. package/src/editor/client/operations.ts +2 -1
  79. package/src/editor/commands/commands.ts +2 -3
  80. package/src/editor/commands/itemCommands.tsx +64 -9
  81. package/src/editor/commands/localizeItem/LocalizeItemDialog.tsx +17 -17
  82. package/src/editor/component-designer/ComponentDesignerMenu.tsx +60 -60
  83. package/src/editor/component-designer/PlaceholdersEditor.tsx +39 -43
  84. package/src/editor/componentTreeHelper.tsx +7 -0
  85. package/src/editor/context-menu/CopyMoveMenu.tsx +1 -0
  86. package/src/editor/context-menu/InsertMenu.tsx +2 -0
  87. package/src/editor/menubar/PageSelector.tsx +2 -0
  88. package/src/editor/page-viewer/EditorForm.tsx +4 -1
  89. package/src/editor/pageModel.ts +1 -1
  90. package/src/editor/sidebar/ComponentTree.tsx +4 -3
  91. package/src/editor/ui/CopyMoveTargetSelectorDialog.tsx +72 -0
  92. package/src/editor/ui/ItemNameDialogNew.tsx +7 -7
  93. package/src/index.ts +1 -1
  94. package/src/revision.ts +2 -2
  95. package/styles.css +2 -2
  96. package/dist/editor/client/DialogContext.d.ts +0 -12
  97. package/dist/editor/client/DialogContext.js +0 -25
  98. package/dist/editor/client/DialogContext.js.map +0 -1
  99. package/dist/editor/ui/ItemNameDialog.d.ts +0 -11
  100. package/dist/editor/ui/ItemNameDialog.js +0 -40
  101. package/dist/editor/ui/ItemNameDialog.js.map +0 -1
  102. package/src/editor/client/DialogContext.tsx +0 -49
  103. 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
- });