@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.
Files changed (81) hide show
  1. package/dist/components/ui/badge.d.ts +1 -1
  2. package/dist/components/ui/button.d.ts +2 -2
  3. package/dist/components/ui/switch.js +1 -1
  4. package/dist/components/ui/switch.js.map +1 -1
  5. package/dist/config/config.js +18 -2
  6. package/dist/config/config.js.map +1 -1
  7. package/dist/editor/AspectRatioSelector.d.ts +13 -0
  8. package/dist/editor/AspectRatioSelector.js +71 -0
  9. package/dist/editor/AspectRatioSelector.js.map +1 -0
  10. package/dist/editor/ConfirmationDialog.js +4 -5
  11. package/dist/editor/ConfirmationDialog.js.map +1 -1
  12. package/dist/editor/PictureCropper.d.ts +1 -1
  13. package/dist/editor/PictureCropper.js +466 -113
  14. package/dist/editor/PictureCropper.js.map +1 -1
  15. package/dist/editor/Terminal.js +5 -4
  16. package/dist/editor/Terminal.js.map +1 -1
  17. package/dist/editor/ai/AiTerminal.js +20 -2
  18. package/dist/editor/ai/AiTerminal.js.map +1 -1
  19. package/dist/editor/client/EditorClient.js +14 -3
  20. package/dist/editor/client/EditorClient.js.map +1 -1
  21. package/dist/editor/client/editContext.d.ts +3 -0
  22. package/dist/editor/client/editContext.js.map +1 -1
  23. package/dist/editor/commands/componentCommands.js +13 -5
  24. package/dist/editor/commands/componentCommands.js.map +1 -1
  25. package/dist/editor/media-selector/Preview.js +1 -1
  26. package/dist/editor/media-selector/Preview.js.map +1 -1
  27. package/dist/editor/page-editor-chrome/FrameMenu.js +48 -24
  28. package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -1
  29. package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +3 -1
  30. package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +6 -6
  31. package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
  32. package/dist/editor/page-editor-chrome/useInlineAICompletion.js +26 -4
  33. package/dist/editor/page-editor-chrome/useInlineAICompletion.js.map +1 -1
  34. package/dist/editor/page-viewer/EditorForm.d.ts +2 -1
  35. package/dist/editor/page-viewer/EditorForm.js +16 -2
  36. package/dist/editor/page-viewer/EditorForm.js.map +1 -1
  37. package/dist/editor/page-viewer/EditorFormPopup.d.ts +11 -0
  38. package/dist/editor/page-viewer/EditorFormPopup.js +41 -0
  39. package/dist/editor/page-viewer/EditorFormPopup.js.map +1 -0
  40. package/dist/editor/page-viewer/PageViewer.js +4 -6
  41. package/dist/editor/page-viewer/PageViewer.js.map +1 -1
  42. package/dist/editor/services/contextService.d.ts +26 -0
  43. package/dist/editor/services/contextService.js +102 -0
  44. package/dist/editor/services/contextService.js.map +1 -0
  45. package/dist/editor/sidebar/Completions.d.ts +1 -0
  46. package/dist/editor/sidebar/Completions.js +54 -0
  47. package/dist/editor/sidebar/Completions.js.map +1 -0
  48. package/dist/editor/ui/SimpleTabs.d.ts +2 -1
  49. package/dist/editor/ui/SimpleTabs.js +2 -2
  50. package/dist/editor/ui/SimpleTabs.js.map +1 -1
  51. package/dist/revision.d.ts +2 -2
  52. package/dist/revision.js +2 -2
  53. package/dist/styles.css +127 -26
  54. package/dist/types.d.ts +1 -0
  55. package/package.json +1 -1
  56. package/src/components/ui/switch.tsx +1 -1
  57. package/src/config/config.tsx +18 -1
  58. package/src/editor/AspectRatioSelector.tsx +146 -0
  59. package/src/editor/ConfirmationDialog.tsx +36 -45
  60. package/src/editor/PictureCropper.tsx +724 -233
  61. package/src/editor/Terminal.tsx +9 -8
  62. package/src/editor/ai/AiTerminal.tsx +58 -15
  63. package/src/editor/client/EditorClient.tsx +26 -1
  64. package/src/editor/client/editContext.ts +7 -0
  65. package/src/editor/commands/componentCommands.tsx +14 -9
  66. package/src/editor/media-selector/Preview.tsx +7 -5
  67. package/src/editor/page-editor-chrome/FrameMenu.tsx +70 -15
  68. package/src/editor/page-editor-chrome/PlaceholderDropZone.tsx +9 -3
  69. package/src/editor/page-editor-chrome/useInlineAICompletion.tsx +31 -5
  70. package/src/editor/page-viewer/EditorForm.tsx +21 -1
  71. package/src/editor/page-viewer/EditorFormPopup.tsx +104 -0
  72. package/src/editor/page-viewer/PageViewer.tsx +3 -11
  73. package/src/editor/services/contextService.ts +146 -0
  74. package/src/editor/sidebar/Completions.tsx +160 -0
  75. package/src/editor/ui/SimpleTabs.tsx +4 -1
  76. package/src/revision.ts +2 -2
  77. package/src/types.ts +1 -0
  78. package/dist/editor/menubar/BrowseHistory.d.ts +0 -6
  79. package/dist/editor/menubar/BrowseHistory.js +0 -11
  80. package/dist/editor/menubar/BrowseHistory.js.map +0 -1
  81. package/src/editor/menubar/BrowseHistory.tsx +0 -28
@@ -1,6 +1,12 @@
1
1
  import { useState, forwardRef, useImperativeHandle } from "react";
2
- import { Dialog } from "primereact/dialog";
3
- import { Button } from "primereact/button";
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?.accept === undefined ? true : props.accept;
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
- <Dialog
88
- header={props?.header || "Confirm"}
89
- visible={visible}
90
- footer={dialogFooter}
91
- onHide={handleCancel}
92
- className="md:max-w-50vw"
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
- </Dialog>
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