eddyter 1.3.73 → 1.3.75

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 (29) hide show
  1. package/LICENSE +24 -24
  2. package/README.md +478 -478
  3. package/dist/EddyterIcon.svg +24 -24
  4. package/dist/{ImageResizer-FrE13F54.js → ImageResizer-o0eMm1Mg.js} +56 -50
  5. package/dist/api/ai/aiAgentService.d.ts +22 -1
  6. package/dist/api/config/endpoints.d.ts +3 -0
  7. package/dist/assets/style.css +1 -1
  8. package/dist/{babel-CCPWkrf4.js → babel-B9hn44Wo.js} +726 -1302
  9. package/dist/components/VideoView/index.d.ts +3 -1
  10. package/dist/constants.d.ts +2 -1
  11. package/dist/{estree-CxUPh9wa.js → estree-CocPn_Md.js} +529 -917
  12. package/dist/hooks/useBlockFormat.d.ts +1 -0
  13. package/dist/{html-CmniStvG.js → html-CxCicOef.js} +350 -589
  14. package/dist/{html2pdf.bundle-CQue4YDW.js → html2pdf.bundle-CVq-OpZt.js} +2778 -3797
  15. package/dist/{html2pdf.bundle.min-BEj2NT3U.js → html2pdf.bundle.min-BxzIoi3T.js} +3405 -5221
  16. package/dist/{index-CX3cfSUQ.js → index-CtPRZTab.js} +27 -18
  17. package/dist/index-Cuv9ugJL.js +381 -0
  18. package/dist/{index-CfRDm1jv.js → index-DxEP36zG.js} +12228 -12186
  19. package/dist/{index-BO5ICrpG.js → index-eRyVFO7x.js} +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/{markdown-B0mEGGfQ.js → markdown-BUjgWFLu.js} +578 -1015
  22. package/dist/nodes/GeneratingImageNode.d.ts +30 -0
  23. package/dist/nodes/VideoNode.d.ts +10 -3
  24. package/dist/{postcss-B0bxXf7u.js → postcss-CGIcwj_g.js} +615 -1065
  25. package/dist/{standalone-DmuJV5rn.js → standalone-C0qguT38.js} +350 -596
  26. package/dist/{typescript-DZlC_9M8.js → typescript-BM7wk6k-.js} +1114 -1806
  27. package/dist/ui/Icons.d.ts +2 -1
  28. package/package.json +149 -152
  29. package/dist/index-Buj5fA92.js +0 -274
@@ -82,4 +82,5 @@ declare const WrapTextLeftIcon: () => import("react/jsx-runtime").JSX.Element;
82
82
  declare const WrapTextRightIcon: () => import("react/jsx-runtime").JSX.Element;
83
83
  declare const BugIcon: () => import("react/jsx-runtime").JSX.Element;
84
84
  declare const LockIcon: () => import("react/jsx-runtime").JSX.Element;
85
- export { AddCommentIcon, AddImageIcon, AdjustToneIcon, AIChatIcon, AIIcon, AlignBottomIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignMiddleIcon, AlignRightIcon, AlignTopIcon, BoldIcon, BugIcon, BulletListIcon, ChartBarIcon, CheckBoxIcon, CheckIcon, ChevronDownIcon, CodeIcon, CompleteSentenceIcon, DisableIcon, EmojifyIcon, FaceSmileIcon, FileIcon, FixGrammarIcon, GenerateImageIcon, Heading1Icon, Heading2Icon, Heading3Icon, Heading4Icon, Heading5Icon, Heading6Icon, HorizontalRuleIcon, HtmlViewIcon, ImageIcon, ItalicIcon, LinkIcon, LockIcon, MagicoonIcon, MakeLongerIcon, MakeShorterIcon, MenuAltIcon, MessageEditIcon, MicrophoneIcon, NoteIcon, NumberListIcon, PauseCircleIcon, ParagraphIcon, PenLineIcon, PerspectiveIcon, PlayCircleIcon, PlusIcon, QuoteIcon, RecordingIcon, RedoIcon, SearchTextIcon, SearchTextIcon2, SendIcon, SignatureIcon, SimplifyIcon, SparkleIcon, StopCircleIcon, StrikethroughIcon, SubscriptIcon, SuperscriptIcon, TodoIcon, TranslateIcon, TypeCapitalizeIcon, TypeLowercaseIcon, TypeUppercaseIcon, UnderlineIcon, UndoIcon, UploadIcon, TableIcon, HighlighterIcon, LightbulbIcon, ClearFormattingIcon, CrossIcon, DownloadIcon, TrashIcon, ExternalLinkIcon, WrapTextLeftIcon, WrapTextRightIcon };
85
+ declare const AiSparkle: () => import("react/jsx-runtime").JSX.Element;
86
+ export { AddCommentIcon, AddImageIcon, AdjustToneIcon, AIChatIcon, AIIcon, AlignBottomIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignMiddleIcon, AlignRightIcon, AlignTopIcon, BoldIcon, BugIcon, BulletListIcon, ChartBarIcon, CheckBoxIcon, CheckIcon, ChevronDownIcon, CodeIcon, CompleteSentenceIcon, DisableIcon, EmojifyIcon, FaceSmileIcon, FileIcon, FixGrammarIcon, GenerateImageIcon, Heading1Icon, Heading2Icon, Heading3Icon, Heading4Icon, Heading5Icon, Heading6Icon, HorizontalRuleIcon, HtmlViewIcon, ImageIcon, ItalicIcon, LinkIcon, LockIcon, MagicoonIcon, MakeLongerIcon, MakeShorterIcon, MenuAltIcon, MessageEditIcon, MicrophoneIcon, NoteIcon, NumberListIcon, PauseCircleIcon, ParagraphIcon, PenLineIcon, PerspectiveIcon, PlayCircleIcon, PlusIcon, QuoteIcon, RecordingIcon, RedoIcon, SearchTextIcon, SearchTextIcon2, SendIcon, SignatureIcon, SimplifyIcon, SparkleIcon, StopCircleIcon, StrikethroughIcon, SubscriptIcon, SuperscriptIcon, TodoIcon, TranslateIcon, TypeCapitalizeIcon, TypeLowercaseIcon, TypeUppercaseIcon, UnderlineIcon, UndoIcon, UploadIcon, TableIcon, HighlighterIcon, LightbulbIcon, ClearFormattingIcon, CrossIcon, DownloadIcon, TrashIcon, ExternalLinkIcon, WrapTextLeftIcon, WrapTextRightIcon, AiSparkle };
package/package.json CHANGED
@@ -1,153 +1,150 @@
1
- {
2
- "name": "eddyter",
3
- "private": false,
4
- "version": "1.3.73",
5
- "type": "module",
6
- "packageManager": "pnpm@9.0.0",
7
- "keywords": [
8
- "rich-text-editor",
9
- "text-editor",
10
- "wysiwyg",
11
- "editor",
12
- "ai-editor",
13
- "ai-writing",
14
- "ai-assistant",
15
- "content-editor",
16
- "document-editor",
17
- "web-editor",
18
- "react-editor",
19
- "javascript-editor",
20
- "frontend-component",
21
- "ui-component",
22
- "saas-editor",
23
- "api-key",
24
- "authenticated-editor",
25
- "pluggable-editor",
26
- "configurable-editor",
27
- "eddyter"
28
- ],
29
- "main": "dist/index.js",
30
- "module": "dist/index.js",
31
- "types": "dist/index.d.ts",
32
- "style": "dist/assets/style.css",
33
- "files": [
34
- "dist"
35
- ],
36
- "exports": {
37
- ".": {
38
- "import": "./dist/index.js",
39
- "types": "./dist/index.d.ts"
40
- },
41
- "./style.css": "./dist/assets/style.css"
42
- },
43
- "peerDependencies": {
44
- "react": "^18.2.0 || ^19.0.0",
45
- "react-dom": "^18.2.0 || ^19.0.0"
46
- },
47
- "scripts": {
48
- "dev": "vite",
49
- "build": "tsc && vite build --mode production",
50
- "preview": "vite preview",
51
- "prettier:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\"",
52
- "prettier:format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
53
- "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
54
- "lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --fix",
55
- "format": "pnpm prettier:format && pnpm lint:fix",
56
- "check": "pnpm prettier:check && pnpm lint",
57
- "prepare": "husky",
58
- "prepublishOnly": "pnpm build"
59
- },
60
- "dependencies": {
61
- "@aws-sdk/client-s3": "^3.744.0",
62
- "@aws-sdk/s3-request-presigner": "^3.744.0",
63
- "@emotion/react": "^11.10.6",
64
- "@emotion/styled": "^11.10.6",
65
- "@lexical/clipboard": "^0.24.0",
66
- "@lexical/code": "^0.24.0",
67
- "@lexical/dragon": "^0.24.0",
68
- "@lexical/history": "^0.24.0",
69
- "@lexical/html": "^0.24.0",
70
- "@lexical/link": "^0.24.0",
71
- "@lexical/list": "^0.24.0",
72
- "@lexical/markdown": "0.24.0",
73
- "@lexical/react": "^0.24.0",
74
- "@lexical/rich-text": "^0.24.0",
75
- "@lexical/selection": "^0.24.0",
76
- "@lexical/table": "^0.24.0",
77
- "@lexical/text": "^0.24.0",
78
- "@lexical/utils": "^0.24.0",
79
- "@mui/icons-material": "^5.11.9",
80
- "@mui/material": "^5.11.9",
81
- "@mui/styles": "^5.11.9",
82
- "@radix-ui/react-avatar": "^1.1.3",
83
- "@radix-ui/react-checkbox": "^1.1.4",
84
- "@radix-ui/react-dialog": "^1.1.6",
85
- "@radix-ui/react-dropdown-menu": "^2.1.6",
86
- "@radix-ui/react-label": "^2.1.2",
87
- "@radix-ui/react-popover": "^1.1.13",
88
- "@radix-ui/react-select": "^2.2.6",
89
- "@radix-ui/react-separator": "^1.1.2",
90
- "@radix-ui/react-slot": "^1.2.2",
91
- "@radix-ui/react-tabs": "^1.1.3",
92
- "@radix-ui/react-tooltip": "^1.1.8",
93
- "@types/react-signature-canvas": "^1.0.7",
94
- "axios": "^1.8.1",
95
- "class-variance-authority": "^0.7.1",
96
- "classnames": "^2.3.2",
97
- "clsx": "^2.1.1",
98
- "emoji-picker-react": "^4.12.0",
99
- "framer-motion": "^12.5.0",
100
- "html2pdf.js": "^0.14.0",
101
- "lexical": "^0.24.0",
102
- "lexical-ai-plugin": "0.0.2-alpha",
103
- "lodash-es": "^4.17.21",
104
- "lucide-react": "^0.344.0",
105
- "marked": "^17.0.1",
106
- "prettier": "^3.5.1",
107
- "react-colorful": "^5.6.1",
108
- "react-router-dom": "^7.2.0",
109
- "react-signature-canvas": "^1.1.0-alpha.1",
110
- "sass": "^1.57.1",
111
- "sonner": "^2.0.3",
112
- "tailwind-merge": "^3.0.2",
113
- "tailwindcss": "3",
114
- "tailwindcss-animate": "^1.0.7"
115
- },
116
- "license": "SEE LICENSE IN LICENSE",
117
- "devDependencies": {
118
- "@types/he": "^1.2.3",
119
- "@types/lodash-es": "^4.17.12",
120
- "@types/node": "^22.13.10",
121
- "@types/react": "^18.0.26",
122
- "@types/react-dom": "^18.0.9",
123
- "@typescript-eslint/eslint-plugin": "5.62.0",
124
- "@typescript-eslint/parser": "5.62.0",
125
- "@vitejs/plugin-react-swc": "^3.11.0",
126
- "autoprefixer": "^10.4.18",
127
- "cross-env": "^7.0.3",
128
- "eslint": "8.56.0",
129
- "eslint-config-prettier": "^10.1.1",
130
- "eslint-import-resolver-typescript": "^3.8.5",
131
- "eslint-plugin-import": "^2.31.0",
132
- "eslint-plugin-react": "^7.37.4",
133
- "eslint-plugin-react-hooks": "^5.2.0",
134
- "eslint-plugin-simple-import-sort": "^12.1.1",
135
- "eslint-plugin-unused-imports": "^4.1.4",
136
- "husky": "^9.1.7",
137
- "lint-staged": "^15.4.3",
138
- "postcss": "^8.4.35",
139
- "postcss-prefix-selector": "^2.1.1",
140
- "react": "^18.2.0",
141
- "react-dom": "^18.2.0",
142
- "typescript": "^5.3.3",
143
- "vite": "^5.4.21",
144
- "vite-plugin-dts": "^4.5.3",
145
- "vite-tsconfig-paths": "^5.1.4"
146
- },
147
- "lint-staged": {
148
- "*.{js,jsx,ts,tsx}": [
149
- "prettier --write",
150
- "eslint --fix"
151
- ]
152
- }
1
+ {
2
+ "name": "eddyter",
3
+ "private": false,
4
+ "version": "1.3.75",
5
+ "type": "module",
6
+ "keywords": [
7
+ "rich-text-editor",
8
+ "text-editor",
9
+ "wysiwyg",
10
+ "editor",
11
+ "ai-editor",
12
+ "ai-writing",
13
+ "ai-assistant",
14
+ "content-editor",
15
+ "document-editor",
16
+ "web-editor",
17
+ "react-editor",
18
+ "javascript-editor",
19
+ "frontend-component",
20
+ "ui-component",
21
+ "saas-editor",
22
+ "api-key",
23
+ "authenticated-editor",
24
+ "pluggable-editor",
25
+ "configurable-editor",
26
+ "eddyter"
27
+ ],
28
+ "main": "dist/index.js",
29
+ "module": "dist/index.js",
30
+ "types": "dist/index.d.ts",
31
+ "style": "dist/assets/style.css",
32
+ "files": [
33
+ "dist"
34
+ ],
35
+ "exports": {
36
+ ".": {
37
+ "import": "./dist/index.js",
38
+ "types": "./dist/index.d.ts"
39
+ },
40
+ "./style.css": "./dist/assets/style.css"
41
+ },
42
+ "peerDependencies": {
43
+ "react": "^18.2.0 || ^19.0.0",
44
+ "react-dom": "^18.2.0 || ^19.0.0"
45
+ },
46
+ "dependencies": {
47
+ "@aws-sdk/client-s3": "^3.744.0",
48
+ "@aws-sdk/s3-request-presigner": "^3.744.0",
49
+ "@emotion/react": "^11.10.6",
50
+ "@emotion/styled": "^11.10.6",
51
+ "@lexical/clipboard": "^0.24.0",
52
+ "@lexical/code": "^0.24.0",
53
+ "@lexical/dragon": "^0.24.0",
54
+ "@lexical/history": "^0.24.0",
55
+ "@lexical/html": "^0.24.0",
56
+ "@lexical/link": "^0.24.0",
57
+ "@lexical/list": "^0.24.0",
58
+ "@lexical/markdown": "0.24.0",
59
+ "@lexical/react": "^0.24.0",
60
+ "@lexical/rich-text": "^0.24.0",
61
+ "@lexical/selection": "^0.24.0",
62
+ "@lexical/table": "^0.24.0",
63
+ "@lexical/text": "^0.24.0",
64
+ "@lexical/utils": "^0.24.0",
65
+ "@mui/icons-material": "^5.11.9",
66
+ "@mui/material": "^5.11.9",
67
+ "@mui/styles": "^5.11.9",
68
+ "@radix-ui/react-avatar": "^1.1.3",
69
+ "@radix-ui/react-checkbox": "^1.1.4",
70
+ "@radix-ui/react-dialog": "^1.1.6",
71
+ "@radix-ui/react-dropdown-menu": "^2.1.6",
72
+ "@radix-ui/react-label": "^2.1.2",
73
+ "@radix-ui/react-popover": "^1.1.13",
74
+ "@radix-ui/react-select": "^2.2.6",
75
+ "@radix-ui/react-separator": "^1.1.2",
76
+ "@radix-ui/react-slot": "^1.2.2",
77
+ "@radix-ui/react-tabs": "^1.1.3",
78
+ "@radix-ui/react-tooltip": "^1.1.8",
79
+ "@types/react-signature-canvas": "^1.0.7",
80
+ "axios": "^1.8.1",
81
+ "class-variance-authority": "^0.7.1",
82
+ "classnames": "^2.3.2",
83
+ "clsx": "^2.1.1",
84
+ "emoji-picker-react": "^4.12.0",
85
+ "framer-motion": "^12.5.0",
86
+ "html2pdf.js": "^0.14.0",
87
+ "lexical": "^0.24.0",
88
+ "lexical-ai-plugin": "0.0.2-alpha",
89
+ "lodash-es": "^4.17.21",
90
+ "lucide-react": "^0.344.0",
91
+ "marked": "^17.0.1",
92
+ "prettier": "^3.5.1",
93
+ "react-colorful": "^5.6.1",
94
+ "react-router-dom": "^7.2.0",
95
+ "react-signature-canvas": "^1.1.0-alpha.1",
96
+ "sass": "^1.57.1",
97
+ "sonner": "^2.0.3",
98
+ "tailwind-merge": "^3.0.2",
99
+ "tailwindcss": "3",
100
+ "tailwindcss-animate": "^1.0.7"
101
+ },
102
+ "license": "SEE LICENSE IN LICENSE",
103
+ "devDependencies": {
104
+ "@types/he": "^1.2.3",
105
+ "@types/lodash-es": "^4.17.12",
106
+ "@types/node": "^22.13.10",
107
+ "@types/react": "^18.0.26",
108
+ "@types/react-dom": "^18.0.9",
109
+ "@typescript-eslint/eslint-plugin": "5.62.0",
110
+ "@typescript-eslint/parser": "5.62.0",
111
+ "@vitejs/plugin-react-swc": "^3.11.0",
112
+ "autoprefixer": "^10.4.18",
113
+ "cross-env": "^7.0.3",
114
+ "eslint": "8.56.0",
115
+ "eslint-config-prettier": "^10.1.1",
116
+ "eslint-import-resolver-typescript": "^3.8.5",
117
+ "eslint-plugin-import": "^2.31.0",
118
+ "eslint-plugin-react": "^7.37.4",
119
+ "eslint-plugin-react-hooks": "^5.2.0",
120
+ "eslint-plugin-simple-import-sort": "^12.1.1",
121
+ "eslint-plugin-unused-imports": "^4.1.4",
122
+ "husky": "^9.1.7",
123
+ "lint-staged": "^15.4.3",
124
+ "postcss": "^8.4.35",
125
+ "postcss-prefix-selector": "^2.1.1",
126
+ "react": "^18.2.0",
127
+ "react-dom": "^18.2.0",
128
+ "typescript": "^5.3.3",
129
+ "vite": "^5.4.21",
130
+ "vite-plugin-dts": "^4.5.3",
131
+ "vite-tsconfig-paths": "^5.1.4"
132
+ },
133
+ "lint-staged": {
134
+ "*.{js,jsx,ts,tsx}": [
135
+ "prettier --write",
136
+ "eslint --fix"
137
+ ]
138
+ },
139
+ "scripts": {
140
+ "dev": "vite",
141
+ "build": "tsc && vite build --mode production",
142
+ "preview": "vite preview",
143
+ "prettier:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\"",
144
+ "prettier:format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
145
+ "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
146
+ "lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --fix",
147
+ "format": "pnpm prettier:format && pnpm lint:fix",
148
+ "check": "pnpm prettier:check && pnpm lint"
149
+ }
153
150
  }
@@ -1,274 +0,0 @@
1
- import { jsxs as S, Fragment as w, jsx as i } from "react/jsx-runtime";
2
- import { I as ee } from "./ImageResizer-FrE13F54.js";
3
- import { CodeNode as te } from "@lexical/code";
4
- import { LinkNode as oe } from "@lexical/link";
5
- import { AutoFocusPlugin as re } from "@lexical/react/LexicalAutoFocusPlugin";
6
- import { useLexicalComposerContext as ie } from "@lexical/react/LexicalComposerContext";
7
- import { ContentEditable as ne } from "@lexical/react/LexicalContentEditable";
8
- import { LexicalErrorBoundary as se } from "@lexical/react/LexicalErrorBoundary";
9
- import { HistoryPlugin as ce } from "@lexical/react/LexicalHistoryPlugin";
10
- import { LexicalNestedComposer as ae } from "@lexical/react/LexicalNestedComposer";
11
- import { OnChangePlugin as le } from "@lexical/react/LexicalOnChangePlugin";
12
- import { RichTextPlugin as de } from "@lexical/react/LexicalRichTextPlugin";
13
- import { useLexicalEditable as ue } from "@lexical/react/useLexicalEditable";
14
- import { useLexicalNodeSelection as me } from "@lexical/react/useLexicalNodeSelection";
15
- import { mergeRegister as fe } from "@lexical/utils";
16
- import { $getSelection as M, $isNodeSelection as m, $setSelection as $, SELECTION_CHANGE_COMMAND as ge, COMMAND_PRIORITY_LOW as u, CLICK_COMMAND as pe, DRAGSTART_COMMAND as Ce, KEY_DELETE_COMMAND as Ee, KEY_BACKSPACE_COMMAND as he, KEY_ENTER_COMMAND as Ne, KEY_ESCAPE_COMMAND as be, RootNode as ve, TextNode as Re, LineBreakNode as xe, ParagraphNode as De, $getNodeByKey as _ } from "lexical";
17
- import { useRef as A, useState as B, useCallback as E, useEffect as Se } from "react";
18
- import { x as v, r as Me, L as _e, i as Ae } from "./index-CfRDm1jv.js";
19
- function Ge({
20
- src: Y,
21
- nodeKey: f,
22
- width: g,
23
- height: R,
24
- maxWidth: z,
25
- resizable: I,
26
- showCaption: h,
27
- caption: p,
28
- captionsEnabled: W,
29
- controls: V = !0
30
- }) {
31
- const c = A(null), x = A(null), [n, a, C] = me(f), [l, L] = B(!1), [o] = ie(), [N, K] = B(null), O = A(null), H = ue(), D = E(
32
- (e) => {
33
- const t = M();
34
- return n && m(t) && (e.preventDefault(), o.update(() => {
35
- t.getNodes().forEach((s) => {
36
- v(s) && s.remove();
37
- });
38
- })), !1;
39
- },
40
- [o, n]
41
- ), k = E(
42
- (e) => {
43
- const t = M(), r = x.current;
44
- if (n && m(t) && t.getNodes().length === 1) {
45
- if (h)
46
- return $(null), e.preventDefault(), p.focus(), !0;
47
- if (r !== null && r !== document.activeElement)
48
- return e.preventDefault(), r.focus(), !0;
49
- }
50
- return !1;
51
- },
52
- [p, n, h]
53
- ), y = E(
54
- (e) => O.current === p || x.current === e.target ? ($(null), o.update(() => {
55
- a(!0);
56
- const t = o.getRootElement();
57
- t !== null && t.focus();
58
- }), !0) : !1,
59
- [p, o, a]
60
- ), P = E(
61
- (e) => {
62
- const t = e;
63
- if (l)
64
- return !0;
65
- const s = t.target === c.current;
66
- let d = !1;
67
- if (!s && c.current) {
68
- const b = c.current.getBoundingClientRect();
69
- d = t.clientX >= b.left && t.clientX <= b.right && t.clientY >= b.top && t.clientY <= b.bottom;
70
- }
71
- return s || d ? (t.shiftKey ? a(!n) : (C(), a(!0)), !0) : !1;
72
- },
73
- [l, n, a, C]
74
- );
75
- Se(() => {
76
- let e = !0;
77
- const t = fe(
78
- o.registerUpdateListener(({ editorState: r }) => {
79
- e && K(r.read(() => M()));
80
- }),
81
- o.registerCommand(
82
- ge,
83
- (r, s) => (O.current = s, !1),
84
- u
85
- ),
86
- o.registerCommand(
87
- pe,
88
- P,
89
- u
90
- ),
91
- o.registerCommand(
92
- Ce,
93
- (r) => r.target === c.current ? (r.preventDefault(), !0) : !1,
94
- u
95
- ),
96
- o.registerCommand(
97
- Ee,
98
- D,
99
- u
100
- ),
101
- o.registerCommand(
102
- he,
103
- D,
104
- u
105
- ),
106
- o.registerCommand(Ne, k, u),
107
- o.registerCommand(
108
- be,
109
- y,
110
- u
111
- )
112
- );
113
- return () => {
114
- e = !1, t();
115
- };
116
- }, [
117
- C,
118
- o,
119
- l,
120
- n,
121
- f,
122
- D,
123
- k,
124
- y,
125
- P,
126
- a
127
- ]);
128
- const X = () => {
129
- o.update(() => {
130
- const e = _(f);
131
- v(e) && e.setShowCaption(!0);
132
- });
133
- }, j = (e, t) => {
134
- setTimeout(() => {
135
- L(!1);
136
- }, 200), o.update(() => {
137
- const r = _(f);
138
- v(r) && r.setWidthAndHeight(e, t);
139
- });
140
- }, F = () => {
141
- L(!0);
142
- }, G = (e) => {
143
- e.preventDefault(), e.stopPropagation(), o.update(() => {
144
- const t = _(f);
145
- v(t) && t.remove();
146
- });
147
- }, U = E(
148
- (e) => {
149
- if (l || e.target.closest("button"))
150
- return;
151
- const r = e.target === c.current;
152
- let s = !1;
153
- if (!r && c.current) {
154
- const d = c.current.getBoundingClientRect();
155
- s = e.clientX >= d.left && e.clientX <= d.right && e.clientY >= d.top && e.clientY <= d.bottom;
156
- }
157
- !r && !s || (e.stopPropagation(), e.shiftKey ? a(!n) : (C(), a(!0)));
158
- },
159
- [l, n, a, C]
160
- ), q = n && m(N) && !l, T = (n || l) && H, J = typeof g == "number" && typeof R == "number", Q = typeof g == "number" ? g : "auto", Z = typeof R == "number" ? R : "auto";
161
- return /* @__PURE__ */ S(w, { children: [
162
- /* @__PURE__ */ S(
163
- "div",
164
- {
165
- draggable: q,
166
- style: {
167
- position: "relative",
168
- display: "inline-block"
169
- },
170
- onClick: U,
171
- children: [
172
- /* @__PURE__ */ i(
173
- "video",
174
- {
175
- ref: c,
176
- src: Y,
177
- controls: V,
178
- preload: "metadata",
179
- className: T ? `focused ${m(N) ? "draggable" : ""}` : void 0,
180
- style: J ? {
181
- width: Q,
182
- height: Z,
183
- maxWidth: "100%"
184
- } : {
185
- maxWidth: "100%",
186
- height: "auto"
187
- },
188
- draggable: "false"
189
- }
190
- ),
191
- n && m(N) && /* @__PURE__ */ i("div", { className: "cteditor-absolute cteditor-top-2 cteditor-right-2 cteditor-flex cteditor-gap-1 cteditor-z-10", children: /* @__PURE__ */ i(
192
- "button",
193
- {
194
- onClick: (e) => {
195
- e.stopPropagation(), G(e);
196
- },
197
- className: "cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-destructive hover:cteditor-text-destructive-foreground cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border",
198
- "aria-label": "Delete video",
199
- title: "Delete video",
200
- children: /* @__PURE__ */ i(Me, { className: "cteditor-w-4 cteditor-h-4" })
201
- }
202
- ) }),
203
- I && m(N) && T && /* @__PURE__ */ i(
204
- ee,
205
- {
206
- showCaption: h,
207
- setShowCaption: X,
208
- editor: o,
209
- buttonRef: x,
210
- imageRef: c,
211
- maxWidth: z,
212
- onResizeStart: F,
213
- onResizeEnd: j,
214
- captionsEnabled: W
215
- }
216
- )
217
- ]
218
- }
219
- ),
220
- h && /* @__PURE__ */ i(
221
- "div",
222
- {
223
- className: "image-caption-container",
224
- style: {
225
- width: typeof g == "number" ? `${g}px` : "100%",
226
- maxWidth: "100%"
227
- },
228
- children: /* @__PURE__ */ S(
229
- ae,
230
- {
231
- initialEditor: p,
232
- initialNodes: [
233
- ve,
234
- Re,
235
- xe,
236
- De,
237
- oe,
238
- te
239
- ],
240
- children: [
241
- /* @__PURE__ */ i(re, {}),
242
- /* @__PURE__ */ i(
243
- de,
244
- {
245
- contentEditable: /* @__PURE__ */ i(
246
- ne,
247
- {
248
- "aria-placeholder": "Enter a caption...",
249
- placeholder: () => /* @__PURE__ */ i("span", { className: "cteditor-text-xs", children: "Enter a caption..." }),
250
- className: "ImageNode__contentEditable"
251
- }
252
- ),
253
- ErrorBoundary: se
254
- }
255
- ),
256
- /* @__PURE__ */ i(
257
- le,
258
- {
259
- onChange: () => {
260
- }
261
- }
262
- ),
263
- /* @__PURE__ */ i(ce, {}),
264
- /* @__PURE__ */ i(_e, { namespace: Ae.namespace })
265
- ]
266
- }
267
- )
268
- }
269
- )
270
- ] });
271
- }
272
- export {
273
- Ge as default
274
- };