ct-rich-text-editor 1.1.1 → 1.1.3

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/README.md CHANGED
@@ -1,147 +1,147 @@
1
- # CT Rich Text Editor
2
-
3
- A configurable rich text editor component with API key authentication.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install ct-rich-text-editor
9
- # or
10
- yarn add ct-rich-text-editor
11
- ```
12
-
13
- ## Features
14
-
15
- - Rich text editor with extensive formatting options
16
- - API key authentication
17
- - Configurable UI components (toolbar, floating menu)
18
- - HTML view option
19
- - Support for tables, images, links, and more
20
- - AI chat integration (for premium plans)
21
- - Environment-based API configuration
22
-
23
- ## Usage
24
-
25
- ### Important: Importing Styles
26
- To ensure proper styling of the editor components including tables, you must import the package's CSS:
27
-
28
- ```jsx
29
- // Import the styles in your application
30
- import 'ct-rich-text-editor/style.css';
31
- ```
32
-
33
- ### Basic Setup
34
-
35
- ```jsx
36
- import React from 'react';
37
- import {
38
- ConfigurableEditorWithAuth,
39
- EditorProvider,
40
- defaultEditorConfig
41
- } from 'ct-rich-text-editor';
42
- // Import required styles
43
- import 'ct-rich-text-editor/style.css';
44
-
45
- function App() {
46
- const apiKey = 'your-api-key'; // Replace with your actual API key
47
-
48
- return (
49
- <EditorProvider
50
- defaultFontFamilies={defaultEditorConfig.defaultFontFamilies}
51
- mentionUserList={defaultEditorConfig.mentionUserList}
52
- >
53
- <ConfigurableEditorWithAuth
54
- apiKey={apiKey}
55
- onAuthSuccess={() => console.log('Authentication successful')}
56
- onAuthError={(error) => console.error('Authentication error:', error)}
57
- />
58
- </EditorProvider>
59
- );
60
- }
61
- ```
62
-
63
- ## API Reference
64
-
65
- ### EditorProvider
66
-
67
- Provides authentication and configuration context for the editor.
68
-
69
- #### Props
70
-
71
- - `children`: React nodes to render
72
- - `defaultFontFamilies`: Array of font names (optional)
73
- - `mentionUserList`: Array of usernames for mention functionality (optional)
74
-
75
- ### ConfigurableEditorWithAuth
76
-
77
- The main editor component with authentication.
78
-
79
- #### Props
80
-
81
- - `apiKey`: Your API key for authentication (required)
82
- - `onAuthSuccess`: Callback function when authentication is successful (optional)
83
- - `onAuthError`: Callback function when authentication fails (optional)
84
- - `showToolbar`: Boolean to show/hide the toolbar (optional, default: true)
85
- - `showFloatingMenu`: Boolean to show/hide the floating menu (optional, default: true)
86
- - `showHtmlView`: Boolean to show/hide HTML view option (optional, default: true)
87
- - `initialContent`: Initial content for the editor (optional)
88
- - `onChange`: Callback function when editor content changes (optional)
89
- - `readOnly`: Boolean to make editor read-only (optional, default: false)
90
- - `placeholder`: Placeholder text when editor is empty (optional)
91
- - `theme`: Custom theme object for styling (optional)
92
- - `plugins`: Array of custom plugins (optional)
93
- - `aiEnabled`: Boolean to enable/disable AI features (optional, default: false)
94
- - `onAiResponse`: Callback function for AI responses (optional)
95
- - `onAiError`: Callback function for AI errors (optional)
96
-
97
- ## Examples
98
-
99
- ### Basic Editor with Authentication
100
-
101
- ```jsx
102
- import React from 'react';
103
- import { ConfigurableEditorWithAuth, EditorProvider } from 'ct-rich-text-editor';
104
- import 'ct-rich-text-editor/style.css';
105
-
106
- function App() {
107
- return (
108
- <EditorProvider>
109
- <ConfigurableEditorWithAuth
110
- apiKey="your-api-key"
111
- onAuthSuccess={() => console.log('Authenticated')}
112
- onAuthError={(error) => console.error(error)}
113
- />
114
- </EditorProvider>
115
- );
116
- }
117
- ```
118
-
119
- ### Editor with Custom Configuration
120
-
121
- ```jsx
122
- import React from 'react';
123
- import { ConfigurableEditorWithAuth, EditorProvider } from 'ct-rich-text-editor';
124
- import 'ct-rich-text-editor/style.css';
125
-
126
- function App() {
127
- return (
128
- <EditorProvider>
129
- <ConfigurableEditorWithAuth
130
- apiKey="your-api-key"
131
- showToolbar={true}
132
- showFloatingMenu={true}
133
- showHtmlView={true}
134
- readOnly={false}
135
- placeholder="Start typing..."
136
- aiEnabled={true}
137
- onAiResponse={(response) => console.log('AI Response:', response)}
138
- onAiError={(error) => console.error('AI Error:', error)}
139
- />
140
- </EditorProvider>
141
- );
142
- }
143
- ```
144
-
145
- ## License
146
-
147
- This project is licensed under the MIT License - see the LICENSE file for details.
1
+ # CT Rich Text Editor
2
+
3
+ A configurable rich text editor component with API key authentication.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install ct-rich-text-editor
9
+ # or
10
+ yarn add ct-rich-text-editor
11
+ ```
12
+
13
+ ## Features
14
+
15
+ - Rich text editor with extensive formatting options
16
+ - API key authentication
17
+ - Configurable UI components (toolbar, floating menu)
18
+ - HTML view option
19
+ - Support for tables, images, links, and more
20
+ - AI chat integration (for premium plans)
21
+ - Environment-based API configuration
22
+
23
+ ## Usage
24
+
25
+ ### Important: Importing Styles
26
+ To ensure proper styling of the editor components including tables, you must import the package's CSS:
27
+
28
+ ```jsx
29
+ // Import the styles in your application
30
+ import 'ct-rich-text-editor/style.css';
31
+ ```
32
+
33
+ ### Basic Setup
34
+
35
+ ```jsx
36
+ import React from 'react';
37
+ import {
38
+ ConfigurableEditorWithAuth,
39
+ EditorProvider,
40
+ defaultEditorConfig
41
+ } from 'ct-rich-text-editor';
42
+ // Import required styles
43
+ import 'ct-rich-text-editor/style.css';
44
+
45
+ function App() {
46
+ const apiKey = 'your-api-key'; // Replace with your actual API key
47
+
48
+ return (
49
+ <EditorProvider
50
+ defaultFontFamilies={defaultEditorConfig.defaultFontFamilies}
51
+ mentionUserList={defaultEditorConfig.mentionUserList}
52
+ >
53
+ <ConfigurableEditorWithAuth
54
+ apiKey={apiKey}
55
+ onAuthSuccess={() => console.log('Authentication successful')}
56
+ onAuthError={(error) => console.error('Authentication error:', error)}
57
+ />
58
+ </EditorProvider>
59
+ );
60
+ }
61
+ ```
62
+
63
+ ## API Reference
64
+
65
+ ### EditorProvider
66
+
67
+ Provides authentication and configuration context for the editor.
68
+
69
+ #### Props
70
+
71
+ - `children`: React nodes to render
72
+ - `defaultFontFamilies`: Array of font names (optional)
73
+ - `mentionUserList`: Array of usernames for mention functionality (optional)
74
+
75
+ ### ConfigurableEditorWithAuth
76
+
77
+ The main editor component with authentication.
78
+
79
+ #### Props
80
+
81
+ - `apiKey`: Your API key for authentication (required)
82
+ - `onAuthSuccess`: Callback function when authentication is successful (optional)
83
+ - `onAuthError`: Callback function when authentication fails (optional)
84
+ - `showToolbar`: Boolean to show/hide the toolbar (optional, default: true)
85
+ - `showFloatingMenu`: Boolean to show/hide the floating menu (optional, default: true)
86
+ - `showHtmlView`: Boolean to show/hide HTML view option (optional, default: true)
87
+ - `initialContent`: Initial content for the editor (optional)
88
+ - `onChange`: Callback function when editor content changes (optional)
89
+ - `readOnly`: Boolean to make editor read-only (optional, default: false)
90
+ - `placeholder`: Placeholder text when editor is empty (optional)
91
+ - `theme`: Custom theme object for styling (optional)
92
+ - `plugins`: Array of custom plugins (optional)
93
+ - `aiEnabled`: Boolean to enable/disable AI features (optional, default: false)
94
+ - `onAiResponse`: Callback function for AI responses (optional)
95
+ - `onAiError`: Callback function for AI errors (optional)
96
+
97
+ ## Examples
98
+
99
+ ### Basic Editor with Authentication
100
+
101
+ ```jsx
102
+ import React from 'react';
103
+ import { ConfigurableEditorWithAuth, EditorProvider } from 'ct-rich-text-editor';
104
+ import 'ct-rich-text-editor/style.css';
105
+
106
+ function App() {
107
+ return (
108
+ <EditorProvider>
109
+ <ConfigurableEditorWithAuth
110
+ apiKey="your-api-key"
111
+ onAuthSuccess={() => console.log('Authenticated')}
112
+ onAuthError={(error) => console.error(error)}
113
+ />
114
+ </EditorProvider>
115
+ );
116
+ }
117
+ ```
118
+
119
+ ### Editor with Custom Configuration
120
+
121
+ ```jsx
122
+ import React from 'react';
123
+ import { ConfigurableEditorWithAuth, EditorProvider } from 'ct-rich-text-editor';
124
+ import 'ct-rich-text-editor/style.css';
125
+
126
+ function App() {
127
+ return (
128
+ <EditorProvider>
129
+ <ConfigurableEditorWithAuth
130
+ apiKey="your-api-key"
131
+ showToolbar={true}
132
+ showFloatingMenu={true}
133
+ showHtmlView={true}
134
+ readOnly={false}
135
+ placeholder="Start typing..."
136
+ aiEnabled={true}
137
+ onAiResponse={(response) => console.log('AI Response:', response)}
138
+ onAiError={(error) => console.error('AI Error:', error)}
139
+ />
140
+ </EditorProvider>
141
+ );
142
+ }
143
+ ```
144
+
145
+ ## License
146
+
147
+ This project is licensed under the MIT License - see the LICENSE file for details.
@@ -1,4 +1,4 @@
1
- import { u as q, L as F, c as ae, j as i, a as he, b as be, $ as Y, R as Ce, C as xe, d as _e, O as ye, H as ve, e as Ee, i as we } from "./index-33d833ec.js";
1
+ import { u as q, L as F, c as ae, j as i, a as he, b as be, $ as Y, R as Ce, C as xe, d as _e, O as ye, H as ve, e as Ee, i as we } from "./index-dc480b69.js";
2
2
  import { CodeNode as Me } from "@lexical/code";
3
3
  import { LinkNode as Ne } from "@lexical/link";
4
4
  import { useEffect as A, createContext as ce, useContext as B, useRef as $, useMemo as ue, useState as G, useCallback as I, Suspense as Se } from "react";
@@ -629,4 +629,4 @@ export {
629
629
  le as RIGHT_CLICK_IMAGE_COMMAND,
630
630
  Et as default
631
631
  };
632
- //# sourceMappingURL=index-837e960a.js.map
632
+ //# sourceMappingURL=index-2c5dedba.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-2c5dedba.js","sources":["../../../node_modules/.pnpm/@lexical+react@0.24.0_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.24/node_modules/@lexical/react/LexicalAutoFocusPlugin.dev.mjs","../../../node_modules/.pnpm/@lexical+react@0.24.0_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.24/node_modules/@lexical/react/LexicalAutoFocusPlugin.prod.mjs","../../../node_modules/.pnpm/@lexical+react@0.24.0_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.24/node_modules/@lexical/react/LexicalAutoFocusPlugin.mjs","../../../node_modules/.pnpm/@lexical+react@0.24.0_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.24/node_modules/@lexical/react/LexicalCollaborationContext.dev.mjs","../../../node_modules/.pnpm/@lexical+react@0.24.0_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.24/node_modules/@lexical/react/LexicalCollaborationContext.prod.mjs","../../../node_modules/.pnpm/@lexical+react@0.24.0_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.24/node_modules/@lexical/react/LexicalCollaborationContext.mjs","../../../node_modules/.pnpm/@lexical+react@0.24.0_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.24/node_modules/@lexical/react/LexicalNestedComposer.dev.mjs","../../../node_modules/.pnpm/@lexical+react@0.24.0_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.24/node_modules/@lexical/react/LexicalNestedComposer.prod.mjs","../../../node_modules/.pnpm/@lexical+react@0.24.0_react-dom@18.3.1_react@18.3.1__react@18.3.1_yjs@13.6.24/node_modules/@lexical/react/LexicalNestedComposer.mjs","../src/components/ImageView/ImageResizer.tsx","../src/components/ImageView/index.tsx"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { useEffect } from 'react';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction AutoFocusPlugin({\n defaultSelection\n}) {\n const [editor] = useLexicalComposerContext();\n useEffect(() => {\n editor.focus(() => {\n // If we try and move selection to the same point with setBaseAndExtent, it won't\n // trigger a re-focus on the element. So in the case this occurs, we'll need to correct it.\n // Normally this is fine, Selection API !== Focus API, but fore the intents of the naming\n // of this plugin, which should preserve focus too.\n const activeElement = document.activeElement;\n const rootElement = editor.getRootElement();\n if (rootElement !== null && (activeElement === null || !rootElement.contains(activeElement))) {\n // Note: preventScroll won't work in Webkit.\n rootElement.focus({\n preventScroll: true\n });\n }\n }, {\n defaultSelection\n });\n }, [defaultSelection, editor]);\n return null;\n}\n\nexport { AutoFocusPlugin };\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useLexicalComposerContext as e}from\"@lexical/react/LexicalComposerContext\";import{useEffect as t}from\"react\";function o({defaultSelection:o}){const[l]=e();return t((()=>{l.focus((()=>{const e=document.activeElement,t=l.getRootElement();null===t||null!==e&&t.contains(e)||t.focus({preventScroll:!0})}),{defaultSelection:o})}),[o,l]),null}export{o as AutoFocusPlugin};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalAutoFocusPlugin.dev.mjs';\nimport * as modProd from './LexicalAutoFocusPlugin.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const AutoFocusPlugin = mod.AutoFocusPlugin;","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { createContext, useContext } from 'react';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst entries = [['Cat', 'rgb(125, 50, 0)'], ['Dog', 'rgb(100, 0, 0)'], ['Rabbit', 'rgb(150, 0, 0)'], ['Frog', 'rgb(200, 0, 0)'], ['Fox', 'rgb(200, 75, 0)'], ['Hedgehog', 'rgb(0, 75, 0)'], ['Pigeon', 'rgb(0, 125, 0)'], ['Squirrel', 'rgb(75, 100, 0)'], ['Bear', 'rgb(125, 100, 0)'], ['Tiger', 'rgb(0, 0, 150)'], ['Leopard', 'rgb(0, 0, 200)'], ['Zebra', 'rgb(0, 0, 250)'], ['Wolf', 'rgb(0, 100, 150)'], ['Owl', 'rgb(0, 100, 100)'], ['Gull', 'rgb(100, 0, 100)'], ['Squid', 'rgb(150, 0, 150)']];\nconst randomEntry = entries[Math.floor(Math.random() * entries.length)];\nconst CollaborationContext = /*#__PURE__*/createContext({\n clientID: 0,\n color: randomEntry[1],\n isCollabActive: false,\n name: randomEntry[0],\n yjsDocMap: new Map()\n});\nfunction useCollaborationContext(username, color) {\n const collabContext = useContext(CollaborationContext);\n if (username != null) {\n collabContext.name = username;\n }\n if (color != null) {\n collabContext.color = color;\n }\n return collabContext;\n}\n\nexport { CollaborationContext, useCollaborationContext };\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{createContext as r,useContext as g}from\"react\";const o=[[\"Cat\",\"rgb(125, 50, 0)\"],[\"Dog\",\"rgb(100, 0, 0)\"],[\"Rabbit\",\"rgb(150, 0, 0)\"],[\"Frog\",\"rgb(200, 0, 0)\"],[\"Fox\",\"rgb(200, 75, 0)\"],[\"Hedgehog\",\"rgb(0, 75, 0)\"],[\"Pigeon\",\"rgb(0, 125, 0)\"],[\"Squirrel\",\"rgb(75, 100, 0)\"],[\"Bear\",\"rgb(125, 100, 0)\"],[\"Tiger\",\"rgb(0, 0, 150)\"],[\"Leopard\",\"rgb(0, 0, 200)\"],[\"Zebra\",\"rgb(0, 0, 250)\"],[\"Wolf\",\"rgb(0, 100, 150)\"],[\"Owl\",\"rgb(0, 100, 100)\"],[\"Gull\",\"rgb(100, 0, 100)\"],[\"Squid\",\"rgb(150, 0, 150)\"]],b=o[Math.floor(Math.random()*o.length)],e=r({clientID:0,color:b[1],isCollabActive:!1,name:b[0],yjsDocMap:new Map});function l(r,o){const b=g(e);return null!=r&&(b.name=r),null!=o&&(b.color=o),b}export{e as CollaborationContext,l as useCollaborationContext};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalCollaborationContext.dev.mjs';\nimport * as modProd from './LexicalCollaborationContext.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const CollaborationContext = mod.CollaborationContext;\nexport const useCollaborationContext = mod.useCollaborationContext;","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { useCollaborationContext } from '@lexical/react/LexicalCollaborationContext';\nimport { LexicalComposerContext, createLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { useRef, useContext, useMemo, useEffect } from 'react';\nimport { jsx } from 'react/jsx-runtime';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction getTransformSetFromKlass(klass) {\n const transform = klass.transform();\n return transform !== null ? new Set([transform]) : new Set();\n}\nfunction LexicalNestedComposer({\n initialEditor,\n children,\n initialNodes,\n initialTheme,\n skipCollabChecks\n}) {\n const wasCollabPreviouslyReadyRef = useRef(false);\n const parentContext = useContext(LexicalComposerContext);\n if (parentContext == null) {\n {\n throw Error(`Unexpected parent context null on a nested composer`);\n }\n }\n const [parentEditor, {\n getTheme: getParentTheme\n }] = parentContext;\n const composerContext = useMemo(() => {\n const composerTheme = initialTheme || getParentTheme() || undefined;\n const context = createLexicalComposerContext(parentContext, composerTheme);\n if (composerTheme !== undefined) {\n initialEditor._config.theme = composerTheme;\n }\n initialEditor._parentEditor = parentEditor;\n if (!initialNodes) {\n const parentNodes = initialEditor._nodes = new Map(parentEditor._nodes);\n for (const [type, entry] of parentNodes) {\n initialEditor._nodes.set(type, {\n exportDOM: entry.exportDOM,\n klass: entry.klass,\n replace: entry.replace,\n replaceWithKlass: entry.replaceWithKlass,\n transforms: getTransformSetFromKlass(entry.klass)\n });\n }\n } else {\n for (let klass of initialNodes) {\n let replace = null;\n let replaceWithKlass = null;\n if (typeof klass !== 'function') {\n const options = klass;\n klass = options.replace;\n replace = options.with;\n replaceWithKlass = options.withKlass || null;\n }\n const registeredKlass = initialEditor._nodes.get(klass.getType());\n initialEditor._nodes.set(klass.getType(), {\n exportDOM: registeredKlass ? registeredKlass.exportDOM : undefined,\n klass,\n replace,\n replaceWithKlass,\n transforms: getTransformSetFromKlass(klass)\n });\n }\n }\n initialEditor._config.namespace = parentEditor._config.namespace;\n initialEditor._editable = parentEditor._editable;\n return [initialEditor, context];\n },\n // We only do this for init\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []);\n\n // If collaboration is enabled, make sure we don't render the children until the collaboration subdocument is ready.\n const {\n isCollabActive,\n yjsDocMap\n } = useCollaborationContext();\n const isCollabReady = skipCollabChecks || wasCollabPreviouslyReadyRef.current || yjsDocMap.has(initialEditor.getKey());\n useEffect(() => {\n if (isCollabReady) {\n wasCollabPreviouslyReadyRef.current = true;\n }\n }, [isCollabReady]);\n\n // Update `isEditable` state of nested editor in response to the same change on parent editor.\n useEffect(() => {\n return parentEditor.registerEditableListener(editable => {\n initialEditor.setEditable(editable);\n });\n }, [initialEditor, parentEditor]);\n return /*#__PURE__*/jsx(LexicalComposerContext.Provider, {\n value: composerContext,\n children: !isCollabActive || isCollabReady ? children : null\n });\n}\n\nexport { LexicalNestedComposer };\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useCollaborationContext as e}from\"@lexical/react/LexicalCollaborationContext\";import{LexicalComposerContext as t,createLexicalComposerContext as r}from\"@lexical/react/LexicalComposerContext\";import{useRef as o,useContext as n,useMemo as l,useEffect as i}from\"react\";import{jsx as a}from\"react/jsx-runtime\";function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,\"default\")?e.default:e}var c=s((function(e){const t=new URLSearchParams;t.append(\"code\",e);for(let e=1;e<arguments.length;e++)t.append(\"v\",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));function p(e){const t=e.transform();return null!==t?new Set([t]):new Set}function d({initialEditor:s,children:d,initialNodes:f,initialTheme:u,skipCollabChecks:m}){const h=o(!1),x=n(t);null==x&&c(9);const[_,{getTheme:g}]=x,v=l((()=>{const e=u||g()||void 0,t=r(x,e);if(void 0!==e&&(s._config.theme=e),s._parentEditor=_,f)for(let e of f){let t=null,r=null;if(\"function\"!=typeof e){const o=e;e=o.replace,t=o.with,r=o.withKlass||null}const o=s._nodes.get(e.getType());s._nodes.set(e.getType(),{exportDOM:o?o.exportDOM:void 0,klass:e,replace:t,replaceWithKlass:r,transforms:p(e)})}else{const e=s._nodes=new Map(_._nodes);for(const[t,r]of e)s._nodes.set(t,{exportDOM:r.exportDOM,klass:r.klass,replace:r.replace,replaceWithKlass:r.replaceWithKlass,transforms:p(r.klass)})}return s._config.namespace=_._config.namespace,s._editable=_._editable,[s,t]}),[]),{isCollabActive:w,yjsDocMap:b}=e(),M=m||h.current||b.has(s.getKey());return i((()=>{M&&(h.current=!0)}),[M]),i((()=>_.registerEditableListener((e=>{s.setEditable(e)}))),[s,_]),a(t.Provider,{value:v,children:!w||M?d:null})}export{d as LexicalNestedComposer};\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalNestedComposer.dev.mjs';\nimport * as modProd from './LexicalNestedComposer.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const LexicalNestedComposer = mod.LexicalNestedComposer;","/**\r\n * Copyright (c) Meta Platforms, Inc. and affiliates.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n *\r\n */\r\n\r\nimport \"./image-caption-styles.css\";\r\n\r\nimport { calculateZoomLevel } from \"@lexical/utils\";\r\nimport type { LexicalEditor } from \"lexical\";\r\nimport * as React from \"react\";\r\nimport { useRef } from \"react\";\r\n\r\nfunction clamp(value: number, min: number, max: number) {\r\n return Math.min(Math.max(value, min), max);\r\n}\r\n\r\nconst Direction = {\r\n east: 1 << 0,\r\n north: 1 << 3,\r\n south: 1 << 1,\r\n west: 1 << 2,\r\n};\r\n\r\nexport default function ImageResizer({\r\n onResizeStart,\r\n onResizeEnd,\r\n buttonRef,\r\n imageRef,\r\n maxWidth,\r\n editor,\r\n showCaption,\r\n setShowCaption,\r\n captionsEnabled,\r\n}: {\r\n editor: LexicalEditor;\r\n buttonRef: { current: null | HTMLButtonElement };\r\n imageRef: { current: null | HTMLElement };\r\n maxWidth?: number;\r\n onResizeEnd: (width: \"inherit\" | number, height: \"inherit\" | number) => void;\r\n onResizeStart: () => void;\r\n setShowCaption: (show: boolean) => void;\r\n showCaption: boolean;\r\n captionsEnabled: boolean;\r\n}): JSX.Element {\r\n const controlWrapperRef = useRef<HTMLDivElement>(null);\r\n const userSelect = useRef({\r\n priority: \"\",\r\n value: \"default\",\r\n });\r\n const positioningRef = useRef<{\r\n currentHeight: \"inherit\" | number;\r\n currentWidth: \"inherit\" | number;\r\n direction: number;\r\n isResizing: boolean;\r\n ratio: number;\r\n startHeight: number;\r\n startWidth: number;\r\n startX: number;\r\n startY: number;\r\n }>({\r\n currentHeight: 0,\r\n currentWidth: 0,\r\n direction: 0,\r\n isResizing: false,\r\n ratio: 0,\r\n startHeight: 0,\r\n startWidth: 0,\r\n startX: 0,\r\n startY: 0,\r\n });\r\n const editorRootElement = editor.getRootElement();\r\n\r\n const maxWidthContainer = maxWidth\r\n ? maxWidth\r\n : editorRootElement !== null\r\n ? editorRootElement.getBoundingClientRect().width - 20\r\n : 100;\r\n const maxHeightContainer =\r\n editorRootElement !== null\r\n ? editorRootElement.getBoundingClientRect().height - 20\r\n : 100;\r\n\r\n const minWidth = 100;\r\n const minHeight = 100;\r\n\r\n /**\r\n * Sets the cursor style to indicate the resizing direction.\r\n * This function updates the cursor for the editor and document body\r\n * based on the resizing direction.\r\n */\r\n const setStartCursor = (direction: number) => {\r\n // Determine if the resizing is happening horizontally (east or west)\r\n const ew = direction === Direction.east || direction === Direction.west;\r\n // Determine if the resizing is happening vertically (north or south)\r\n const ns = direction === Direction.north || direction === Direction.south;\r\n // Determine if the resizing is diagonal (north-west, south-east, etc.)\r\n const nwse =\r\n (direction & Direction.north && direction & Direction.west) ||\r\n (direction & Direction.south && direction & Direction.east);\r\n\r\n // Set the appropriate cursor style based on the detected direction\r\n const cursorDir = ew ? \"ew\" : ns ? \"ns\" : nwse ? \"nwse\" : \"nesw\";\r\n\r\n // Apply the cursor style to the editor root element if it exists\r\n if (editorRootElement !== null) {\r\n editorRootElement.style.setProperty(\r\n \"cursor\",\r\n `${cursorDir}-resize`,\r\n \"important\"\r\n );\r\n }\r\n\r\n // Apply the cursor style to the document body\r\n if (document.body !== null) {\r\n document.body.style.setProperty(\r\n \"cursor\",\r\n `${cursorDir}-resize`,\r\n \"important\"\r\n );\r\n\r\n // Store the current user selection settings before modifying them\r\n userSelect.current.value = document.body.style.getPropertyValue(\r\n \"-webkit-user-select\"\r\n );\r\n userSelect.current.priority = document.body.style.getPropertyPriority(\r\n \"-webkit-user-select\"\r\n );\r\n\r\n // Disable text selection during resizing to prevent unwanted text selection\r\n document.body.style.setProperty(\r\n \"-webkit-user-select\",\r\n `none`,\r\n \"important\"\r\n );\r\n }\r\n };\r\n\r\n /**\r\n * Resets the cursor style when resizing ends.\r\n */\r\n\r\n const setEndCursor = () => {\r\n if (editorRootElement !== null) {\r\n editorRootElement.style.setProperty(\"cursor\", \"text\");\r\n }\r\n if (document.body !== null) {\r\n document.body.style.setProperty(\"cursor\", \"default\");\r\n document.body.style.setProperty(\r\n \"-webkit-user-select\",\r\n userSelect.current.value,\r\n userSelect.current.priority\r\n );\r\n }\r\n };\r\n\r\n /**\r\n * Handles pointer down event when resizing starts.\r\n */\r\n const handlePointerDown = (\r\n event: React.PointerEvent<HTMLDivElement>,\r\n direction: number\r\n ) => {\r\n if (!editor.isEditable()) {\r\n return;\r\n }\r\n const image = imageRef.current;\r\n const controlWrapper = controlWrapperRef.current;\r\n\r\n // Ensure both the image and control wrapper exist before proceeding\r\n if (image !== null && controlWrapper !== null) {\r\n event.preventDefault();\r\n\r\n // Get the image's current width and height from its bounding rectangle\r\n const { width, height } = image.getBoundingClientRect();\r\n // Calculate the zoom level to adjust calculations accordingly\r\n const zoom = calculateZoomLevel(image);\r\n // Retrieve the positioning reference object to store resize state\r\n const positioning = positioningRef.current;\r\n\r\n // Store the initial dimensions of the image\r\n positioning.startWidth = width;\r\n positioning.startHeight = height;\r\n // Store the aspect ratio to maintain proportions when resizing\r\n positioning.ratio = width / height;\r\n // Set the current width and height values for tracking changes\r\n positioning.currentWidth = width;\r\n positioning.currentHeight = height;\r\n // Store the initial pointer position, adjusted for zoom level\r\n positioning.startX = event.clientX / zoom;\r\n positioning.startY = event.clientY / zoom;\r\n // Mark the resizing state as active\r\n positioning.isResizing = true;\r\n // Store the resize direction (north, south, east, west, or combinations)\r\n positioning.direction = direction;\r\n\r\n // Set the cursor style to indicate resizing in the correct direction\r\n setStartCursor(direction);\r\n onResizeStart();\r\n\r\n controlWrapper.classList.add(\"image-control-wrapper--resizing\");\r\n image.style.height = `${height}px`;\r\n image.style.width = `${width}px`;\r\n document.addEventListener(\"pointermove\", handlePointerMove);\r\n document.addEventListener(\"pointerup\", handlePointerUp);\r\n }\r\n };\r\n\r\n /**\r\n * Handles pointer move event when resizing the image dynamically.\r\n */\r\n const handlePointerMove = (event: PointerEvent) => {\r\n const image = imageRef.current;\r\n const positioning = positioningRef.current;\r\n\r\n // Check if the resize direction includes horizontal movement (east or west)\r\n const isHorizontal =\r\n positioning.direction & (Direction.east | Direction.west);\r\n // Check if the resize direction includes vertical movement (north or south)\r\n const isVertical =\r\n positioning.direction & (Direction.south | Direction.north);\r\n\r\n if (image !== null && positioning.isResizing) {\r\n // Get the zoom level of the image to ensure accurate calculations\r\n const zoom = calculateZoomLevel(image);\r\n\r\n if (isHorizontal && isVertical) {\r\n // Calculate the difference in X position relative to the starting point\r\n let diff = Math.floor(positioning.startX - event.clientX / zoom);\r\n // Reverse the difference if resizing from the east to ensure correct calculations\r\n diff = positioning.direction & Direction.east ? -diff : diff;\r\n\r\n // Calculate the new width, ensuring it stays within allowed min and max limits\r\n const width = clamp(\r\n positioning.startWidth + diff,\r\n minWidth,\r\n maxWidthContainer\r\n );\r\n // Maintain the aspect ratio by adjusting height proportionally\r\n const height = width / positioning.ratio;\r\n // Apply the new width and height to the image\r\n image.style.width = `${width}px`;\r\n image.style.height = `${height}px`;\r\n // Update stored dimensions for ongoing tracking\r\n positioning.currentHeight = height;\r\n positioning.currentWidth = width;\r\n } else if (isVertical) {\r\n // Calculate the difference in Y position relative to the starting point\r\n let diff = Math.floor(positioning.startY - event.clientY / zoom);\r\n // Reverse the difference if resizing from the south to maintain correct direction\r\n diff = positioning.direction & Direction.south ? -diff : diff;\r\n\r\n // Calculate the new height, ensuring it stays within allowed min and max limits\r\n const height = clamp(\r\n positioning.startHeight + diff,\r\n minHeight,\r\n maxHeightContainer\r\n );\r\n\r\n // Apply the new height to the image\r\n image.style.height = `${height}px`;\r\n // Update stored height for ongoing tracking\r\n positioning.currentHeight = height;\r\n } else {\r\n // Calculate the difference in X position relative to the starting point\r\n let diff = Math.floor(positioning.startX - event.clientX / zoom);\r\n // Reverse the difference if resizing from the east to maintain correct direction\r\n diff = positioning.direction & Direction.east ? -diff : diff;\r\n\r\n // Calculate the new width, ensuring it stays within allowed min and max limits\r\n const width = clamp(\r\n positioning.startWidth + diff,\r\n minWidth,\r\n maxWidthContainer\r\n );\r\n\r\n // Apply the new width to the image\r\n image.style.width = `${width}px`;\r\n // Update stored width for ongoing tracking\r\n positioning.currentWidth = width;\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Handles the pointer up event when resizing ends.\r\n */\r\n const handlePointerUp = () => {\r\n const image = imageRef.current;\r\n const positioning = positioningRef.current;\r\n const controlWrapper = controlWrapperRef.current;\r\n\r\n // Ensure the image, control wrapper exist, and resizing is active before proceeding\r\n if (image !== null && controlWrapper !== null && positioning.isResizing) {\r\n // Capture the final width and height of the resized image\r\n const width = positioning.currentWidth;\r\n const height = positioning.currentHeight;\r\n\r\n // Reset positioning values after resizing is complete\r\n positioning.startWidth = 0;\r\n positioning.startHeight = 0;\r\n positioning.ratio = 0;\r\n positioning.startX = 0;\r\n positioning.startY = 0;\r\n positioning.currentWidth = 0;\r\n positioning.currentHeight = 0;\r\n positioning.isResizing = false; // Mark resizing as finished\r\n\r\n // Remove the resizing class from the control wrapper\r\n controlWrapper.classList.remove(\"image-control-wrapper--resizing\");\r\n\r\n // Restore default cursor appearance\r\n setEndCursor();\r\n // Trigger the resize end callback with the final dimensions\r\n onResizeEnd(width, height);\r\n\r\n // Remove event listeners for pointer movement and release to stop tracking\r\n document.removeEventListener(\"pointermove\", handlePointerMove);\r\n document.removeEventListener(\"pointerup\", handlePointerUp);\r\n }\r\n };\r\n\r\n return (\r\n <div ref={controlWrapperRef}>\r\n {!showCaption && captionsEnabled && (\r\n <button\r\n className=\"image-caption-button\"\r\n ref={buttonRef}\r\n onClick={() => {\r\n setShowCaption(!showCaption);\r\n }}\r\n >\r\n Add Caption\r\n </button>\r\n )}\r\n <div\r\n className=\"image-resizer image-resizer-n\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.north);\r\n }}\r\n />\r\n <div\r\n className=\"image-resizer image-resizer-ne\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.north | Direction.east);\r\n }}\r\n />\r\n <div\r\n className=\"image-resizer image-resizer-e\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.east);\r\n }}\r\n />\r\n <div\r\n className=\"image-resizer image-resizer-se\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.south | Direction.east);\r\n }}\r\n />\r\n <div\r\n className=\"image-resizer image-resizer-s\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.south);\r\n }}\r\n />\r\n <div\r\n className=\"image-resizer image-resizer-sw\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.south | Direction.west);\r\n }}\r\n />\r\n <div\r\n className=\"image-resizer image-resizer-w\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.west);\r\n }}\r\n />\r\n <div\r\n className=\"image-resizer image-resizer-nw\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.north | Direction.west);\r\n }}\r\n />\r\n </div>\r\n );\r\n}\r\n","/**\r\n * Copyright (c) Meta Platforms, Inc. and affiliates.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n *\r\n */\r\n\r\nimport \"./image-caption-styles.css\";\r\n\r\nimport { CodeNode } from \"@lexical/code\";\r\nimport { LinkNode } from \"@lexical/link\";\r\nimport { AutoFocusPlugin } from \"@lexical/react/LexicalAutoFocusPlugin\";\r\nimport { useCollaborationContext } from \"@lexical/react/LexicalCollaborationContext\";\r\nimport { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\r\nimport { ContentEditable } from \"@lexical/react/LexicalContentEditable\";\r\nimport { LexicalErrorBoundary } from \"@lexical/react/LexicalErrorBoundary\";\r\nimport { HistoryPlugin } from \"@lexical/react/LexicalHistoryPlugin\";\r\nimport { LexicalNestedComposer } from \"@lexical/react/LexicalNestedComposer\";\r\nimport { OnChangePlugin } from \"@lexical/react/LexicalOnChangePlugin\";\r\n// import './ImageNode.css';\r\nimport { RichTextPlugin } from \"@lexical/react/LexicalRichTextPlugin\";\r\nimport { useLexicalEditable } from \"@lexical/react/useLexicalEditable\";\r\nimport { useLexicalNodeSelection } from \"@lexical/react/useLexicalNodeSelection\";\r\nimport { mergeRegister } from \"@lexical/utils\";\r\nimport type {\r\n BaseSelection,\r\n LexicalCommand,\r\n LexicalEditor,\r\n NodeKey,\r\n} from \"lexical\";\r\nimport {\r\n $getNodeByKey,\r\n $getSelection,\r\n $isNodeSelection,\r\n $isRangeSelection,\r\n $setSelection,\r\n CLICK_COMMAND,\r\n COMMAND_PRIORITY_LOW,\r\n createCommand,\r\n DRAGSTART_COMMAND,\r\n KEY_BACKSPACE_COMMAND,\r\n KEY_DELETE_COMMAND,\r\n KEY_ENTER_COMMAND,\r\n KEY_ESCAPE_COMMAND,\r\n LineBreakNode,\r\n ParagraphNode,\r\n RootNode,\r\n SELECTION_CHANGE_COMMAND,\r\n TextNode,\r\n} from \"lexical\";\r\nimport * as React from \"react\";\r\nimport { Suspense, useCallback, useEffect, useRef, useState } from \"react\";\r\n// import brokenImage from '../images/image-broken.svg';\r\nimport { initialConfig } from \"src/constants\";\r\nimport { $isImageNode } from \"src/nodes/ImageNode\";\r\nimport LocalStoragePlugin from \"src/plugins/LocalStoragePlugin\";\r\n\r\nimport ImageResizer from \"./ImageResizer\";\r\n\r\nconst imageCache = new Set();\r\n\r\nexport const RIGHT_CLICK_IMAGE_COMMAND: LexicalCommand<MouseEvent> =\r\n createCommand(\"RIGHT_CLICK_IMAGE_COMMAND\");\r\n\r\nfunction useSuspenseImage(src: string) {\r\n if (!imageCache.has(src)) {\r\n throw new Promise((resolve) => {\r\n const img = new Image();\r\n img.src = src;\r\n img.onload = () => {\r\n imageCache.add(src);\r\n resolve(null);\r\n };\r\n img.onerror = () => {\r\n imageCache.add(src);\r\n };\r\n });\r\n }\r\n}\r\n\r\nfunction LazyImage({\r\n altText,\r\n className,\r\n imageRef,\r\n src,\r\n width,\r\n height,\r\n maxWidth,\r\n onError,\r\n}: {\r\n altText: string;\r\n className: string | null;\r\n height: \"inherit\" | number;\r\n imageRef: { current: null | HTMLImageElement };\r\n maxWidth: number;\r\n src: string;\r\n width: \"inherit\" | number;\r\n onError: () => void;\r\n}): JSX.Element {\r\n useSuspenseImage(src);\r\n return (\r\n <img\r\n className={className || undefined}\r\n src={src}\r\n alt={altText}\r\n ref={imageRef}\r\n style={{\r\n height,\r\n maxWidth,\r\n width,\r\n }}\r\n onError={onError}\r\n draggable=\"false\"\r\n />\r\n );\r\n}\r\n\r\n// if the image is broken ; we are showing this component\r\nfunction BrokenImage(): JSX.Element {\r\n return (\r\n <img\r\n src={\"\"} //TODO: NEED TO ADD BROKEN IMAGE\r\n style={{\r\n height: 200,\r\n opacity: 0.2,\r\n width: 200,\r\n }}\r\n draggable=\"false\"\r\n />\r\n );\r\n}\r\n\r\nexport default function ImageComponent({\r\n src,\r\n altText,\r\n nodeKey,\r\n width,\r\n height,\r\n maxWidth,\r\n resizable,\r\n showCaption,\r\n caption,\r\n captionsEnabled,\r\n}: {\r\n altText: string;\r\n caption: LexicalEditor;\r\n height: \"inherit\" | number;\r\n maxWidth: number;\r\n nodeKey: NodeKey;\r\n resizable: boolean;\r\n showCaption: boolean;\r\n src: string;\r\n width: \"inherit\" | number;\r\n captionsEnabled: boolean;\r\n}): JSX.Element {\r\n const imageRef = useRef<null | HTMLImageElement>(null);\r\n const buttonRef = useRef<HTMLButtonElement | null>(null);\r\n const [isSelected, setSelected, clearSelection] =\r\n useLexicalNodeSelection(nodeKey);\r\n const [isResizing, setIsResizing] = useState<boolean>(false);\r\n const { isCollabActive } = useCollaborationContext();\r\n const [editor] = useLexicalComposerContext();\r\n const [selection, setSelection] = useState<BaseSelection | null>(null);\r\n const activeEditorRef = useRef<LexicalEditor | null>(null);\r\n const [isLoadError, setIsLoadError] = useState<boolean>(false);\r\n const isEditable = useLexicalEditable();\r\n\r\n /**\r\n * Deletes the image node when the delete key is pressed.\r\n */\r\n const $onDelete = useCallback(\r\n (payload: KeyboardEvent) => {\r\n const deleteSelection = $getSelection();\r\n if (isSelected && $isNodeSelection(deleteSelection)) {\r\n const event: KeyboardEvent = payload;\r\n event.preventDefault();\r\n editor.update(() => {\r\n deleteSelection.getNodes().forEach((node) => {\r\n if ($isImageNode(node)) {\r\n node.remove();\r\n }\r\n });\r\n });\r\n }\r\n return false;\r\n },\r\n [editor, isSelected]\r\n );\r\n\r\n /**\r\n * Handles enter key to move focus into the caption editor.\r\n */\r\n const $onEnter = useCallback(\r\n (event: KeyboardEvent) => {\r\n const latestSelection = $getSelection();\r\n const buttonElem = buttonRef.current;\r\n if (\r\n isSelected &&\r\n $isNodeSelection(latestSelection) &&\r\n latestSelection.getNodes().length === 1\r\n ) {\r\n if (showCaption) {\r\n // Move focus into nested editor\r\n $setSelection(null);\r\n event.preventDefault();\r\n caption.focus();\r\n return true;\r\n } else if (\r\n buttonElem !== null &&\r\n buttonElem !== document.activeElement\r\n ) {\r\n event.preventDefault();\r\n buttonElem.focus();\r\n return true;\r\n }\r\n }\r\n return false;\r\n },\r\n [caption, isSelected, showCaption]\r\n );\r\n\r\n /**\r\n * Handles escape key to reset selection.\r\n */\r\n const $onEscape = useCallback(\r\n (event: KeyboardEvent) => {\r\n if (\r\n activeEditorRef.current === caption ||\r\n buttonRef.current === event.target\r\n ) {\r\n $setSelection(null);\r\n editor.update(() => {\r\n setSelected(true);\r\n const parentRootElement = editor.getRootElement();\r\n if (parentRootElement !== null) {\r\n parentRootElement.focus();\r\n }\r\n });\r\n return true;\r\n }\r\n return false;\r\n },\r\n [caption, editor, setSelected]\r\n );\r\n\r\n const onClick = useCallback(\r\n (payload: MouseEvent) => {\r\n const event = payload;\r\n\r\n if (isResizing) {\r\n return true;\r\n }\r\n if (event.target === imageRef.current) {\r\n if (event.shiftKey) {\r\n setSelected(!isSelected);\r\n } else {\r\n clearSelection();\r\n setSelected(true);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n },\r\n [isResizing, isSelected, setSelected, clearSelection]\r\n );\r\n\r\n const onRightClick = useCallback(\r\n (event: MouseEvent): void => {\r\n editor.getEditorState().read(() => {\r\n const latestSelection = $getSelection();\r\n const domElement = event.target as HTMLElement;\r\n if (\r\n domElement.tagName === \"IMG\" &&\r\n $isRangeSelection(latestSelection) &&\r\n latestSelection.getNodes().length === 1\r\n ) {\r\n editor.dispatchCommand(\r\n RIGHT_CLICK_IMAGE_COMMAND,\r\n event as MouseEvent\r\n );\r\n }\r\n });\r\n },\r\n [editor]\r\n );\r\n\r\n useEffect(() => {\r\n let isMounted = true;\r\n const rootElement = editor.getRootElement();\r\n const unregister = mergeRegister(\r\n editor.registerUpdateListener(({ editorState }) => {\r\n if (isMounted) {\r\n setSelection(editorState.read(() => $getSelection()));\r\n }\r\n }),\r\n editor.registerCommand(\r\n SELECTION_CHANGE_COMMAND,\r\n (_, activeEditor) => {\r\n activeEditorRef.current = activeEditor;\r\n return false;\r\n },\r\n COMMAND_PRIORITY_LOW\r\n ),\r\n editor.registerCommand<MouseEvent>(\r\n CLICK_COMMAND,\r\n onClick,\r\n COMMAND_PRIORITY_LOW\r\n ),\r\n editor.registerCommand<MouseEvent>(\r\n RIGHT_CLICK_IMAGE_COMMAND,\r\n onClick,\r\n COMMAND_PRIORITY_LOW\r\n ),\r\n editor.registerCommand(\r\n DRAGSTART_COMMAND,\r\n (event) => {\r\n if (event.target === imageRef.current) {\r\n alert(\"s\");\r\n // TODO This is just a temporary workaround for FF to behave like other browsers.\r\n // Ideally, this handles drag & drop too (and all browsers).\r\n event.preventDefault();\r\n return true;\r\n }\r\n return false;\r\n },\r\n COMMAND_PRIORITY_LOW\r\n ),\r\n editor.registerCommand(\r\n KEY_DELETE_COMMAND,\r\n $onDelete,\r\n COMMAND_PRIORITY_LOW\r\n ),\r\n editor.registerCommand(\r\n KEY_BACKSPACE_COMMAND,\r\n $onDelete,\r\n COMMAND_PRIORITY_LOW\r\n ),\r\n editor.registerCommand(KEY_ENTER_COMMAND, $onEnter, COMMAND_PRIORITY_LOW),\r\n editor.registerCommand(\r\n KEY_ESCAPE_COMMAND,\r\n $onEscape,\r\n COMMAND_PRIORITY_LOW\r\n )\r\n );\r\n\r\n rootElement?.addEventListener(\"contextmenu\", onRightClick);\r\n\r\n return () => {\r\n isMounted = false;\r\n unregister();\r\n rootElement?.removeEventListener(\"contextmenu\", onRightClick);\r\n };\r\n }, [\r\n clearSelection,\r\n editor,\r\n isResizing,\r\n isSelected,\r\n nodeKey,\r\n $onDelete,\r\n $onEnter,\r\n $onEscape,\r\n onClick,\r\n onRightClick,\r\n setSelected,\r\n ]);\r\n\r\n const setShowCaption = () => {\r\n editor.update(() => {\r\n const node = $getNodeByKey(nodeKey);\r\n if ($isImageNode(node)) {\r\n node.setShowCaption(true);\r\n }\r\n });\r\n };\r\n\r\n const onResizeEnd = (\r\n nextWidth: \"inherit\" | number,\r\n nextHeight: \"inherit\" | number\r\n ) => {\r\n // Delay hiding the resize bars for click case\r\n setTimeout(() => {\r\n setIsResizing(false);\r\n }, 200);\r\n\r\n editor.update(() => {\r\n const node = $getNodeByKey(nodeKey);\r\n if ($isImageNode(node)) {\r\n node.setWidthAndHeight(nextWidth, nextHeight);\r\n }\r\n });\r\n };\r\n\r\n const onResizeStart = () => {\r\n setIsResizing(true);\r\n };\r\n\r\n const draggable = isSelected && $isNodeSelection(selection) && !isResizing;\r\n const isFocused = (isSelected || isResizing) && isEditable;\r\n return (\r\n <Suspense fallback={null}>\r\n <>\r\n <div draggable={draggable}>\r\n {isLoadError ? (\r\n <BrokenImage />\r\n ) : (\r\n <LazyImage\r\n className={\r\n isFocused\r\n ? `focused ${$isNodeSelection(selection) ? \"draggable\" : \"\"}`\r\n : null\r\n }\r\n src={src}\r\n altText={altText}\r\n imageRef={imageRef}\r\n width={width}\r\n height={height}\r\n maxWidth={maxWidth}\r\n onError={() => setIsLoadError(true)}\r\n />\r\n )}\r\n </div>\r\n\r\n {showCaption && (\r\n <div className=\"image-caption-container\">\r\n <LexicalNestedComposer\r\n initialEditor={caption}\r\n initialNodes={[\r\n RootNode,\r\n TextNode,\r\n LineBreakNode,\r\n ParagraphNode,\r\n LinkNode,\r\n CodeNode,\r\n ]}\r\n >\r\n <AutoFocusPlugin />\r\n\r\n <RichTextPlugin\r\n contentEditable={\r\n <ContentEditable\r\n aria-placeholder=\"Enter a caption...\"\r\n placeholder={() => <span>Enter a caption...</span>}\r\n className=\"ImageNode__contentEditable\"\r\n />\r\n }\r\n ErrorBoundary={LexicalErrorBoundary}\r\n />\r\n\r\n <OnChangePlugin onChange={(e) => console.log(\"e\")} />\r\n <HistoryPlugin />\r\n <LocalStoragePlugin namespace={initialConfig.namespace} />\r\n </LexicalNestedComposer>\r\n </div>\r\n )}\r\n {resizable && $isNodeSelection(selection) && isFocused && (\r\n <ImageResizer\r\n showCaption={showCaption}\r\n setShowCaption={setShowCaption}\r\n editor={editor}\r\n buttonRef={buttonRef}\r\n imageRef={imageRef}\r\n maxWidth={maxWidth}\r\n onResizeStart={onResizeStart}\r\n onResizeEnd={onResizeEnd}\r\n captionsEnabled={!isLoadError && captionsEnabled}\r\n />\r\n )}\r\n </>\r\n </Suspense>\r\n );\r\n}\r\n"],"names":["AutoFocusPlugin","defaultSelection","editor","useLexicalComposerContext","useEffect","activeElement","rootElement","o","l","e","t","mod","modDev","modProd","entries","randomEntry","CollaborationContext","createContext","useCollaborationContext","username","color","collabContext","useContext","b","r","g","getTransformSetFromKlass","klass","transform","LexicalNestedComposer","initialEditor","children","initialNodes","initialTheme","skipCollabChecks","wasCollabPreviouslyReadyRef","useRef","parentContext","LexicalComposerContext","parentEditor","getParentTheme","composerContext","useMemo","composerTheme","context","createLexicalComposerContext","replace","replaceWithKlass","options","registeredKlass","parentNodes","type","entry","isCollabActive","yjsDocMap","isCollabReady","editable","jsx","s","c","p","d","f","u","m","h","x","n","_","v","w","M","i","a","clamp","value","min","max","Direction","ImageResizer","onResizeStart","onResizeEnd","buttonRef","imageRef","maxWidth","showCaption","setShowCaption","captionsEnabled","controlWrapperRef","userSelect","positioningRef","editorRootElement","maxWidthContainer","maxHeightContainer","minWidth","minHeight","setStartCursor","direction","ew","ns","nwse","cursorDir","setEndCursor","handlePointerDown","event","image","controlWrapper","width","height","zoom","calculateZoomLevel","positioning","handlePointerMove","handlePointerUp","isHorizontal","isVertical","diff","jsxs","imageCache","RIGHT_CLICK_IMAGE_COMMAND","createCommand","useSuspenseImage","src","resolve","img","LazyImage","altText","className","onError","BrokenImage","ImageComponent","nodeKey","resizable","caption","isSelected","setSelected","clearSelection","useLexicalNodeSelection","isResizing","setIsResizing","useState","selection","setSelection","activeEditorRef","isLoadError","setIsLoadError","isEditable","useLexicalEditable","$onDelete","useCallback","payload","deleteSelection","$getSelection","$isNodeSelection","node","$isImageNode","$onEnter","latestSelection","buttonElem","$setSelection","$onEscape","parentRootElement","onClick","onRightClick","$isRangeSelection","isMounted","unregister","mergeRegister","editorState","SELECTION_CHANGE_COMMAND","activeEditor","COMMAND_PRIORITY_LOW","CLICK_COMMAND","DRAGSTART_COMMAND","KEY_DELETE_COMMAND","KEY_BACKSPACE_COMMAND","KEY_ENTER_COMMAND","KEY_ESCAPE_COMMAND","$getNodeByKey","nextWidth","nextHeight","draggable","isFocused","Suspense","Fragment","RootNode","TextNode","LineBreakNode","ParagraphNode","LinkNode","CodeNode","RichTextPlugin","ContentEditable","LexicalErrorBoundary","OnChangePlugin","HistoryPlugin","LocalStoragePlugin","initialConfig"],"mappings":";;;;;;;;;;;;AAmBA,SAASA,GAAgB;AAAA,EACvB,kBAAAC;AACF,GAAG;AACD,QAAM,CAACC,CAAM,IAAIC;AACjB,SAAAC,EAAU,MAAM;AACd,IAAAF,EAAO,MAAM,MAAM;AAKjB,YAAMG,IAAgB,SAAS,eACzBC,IAAcJ,EAAO;AAC3B,MAAII,MAAgB,SAASD,MAAkB,QAAQ,CAACC,EAAY,SAASD,CAAa,MAExFC,EAAY,MAAM;AAAA,QAChB,eAAe;AAAA,MACzB,CAAS;AAAA,IAET,GAAO;AAAA,MACD,kBAAAL;AAAA,IACN,CAAK;AAAA,EACL,GAAK,CAACA,GAAkBC,CAAM,CAAC,GACtB;AACT;;;;;AClCoH,SAASK,GAAE,EAAC,kBAAiBA,EAAC,GAAE;AAAC,QAAK,CAACC,CAAC,IAAEC,EAAG;AAAC,SAAOC,EAAG,M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709
  }
710
710
  );
711
- }, bx = "https://api.cteditor.com/api/license/validate", Cx = () => bx, wx = async (e) => {
711
+ }, bx = "http://localhost:3000/api/license/validate", Cx = () => bx, wx = async (e) => {
712
712
  try {
713
713
  const t = Cx();
714
714
  return (await lm.post(
@@ -7683,7 +7683,7 @@ process.env.NODE_ENV !== "production" && (d1.propTypes = {
7683
7683
  useFlexGap: K.bool
7684
7684
  });
7685
7685
  const z4 = d1, H4 = lm.create({
7686
- baseURL: "https://api.cteditor.com/",
7686
+ baseURL: "http://localhost:3000/",
7687
7687
  headers: {
7688
7688
  "Content-Type": "application/json"
7689
7689
  }
@@ -7722,7 +7722,7 @@ const z4 = d1, H4 = lm.create({
7722
7722
  } catch (t) {
7723
7723
  throw console.error("Error in AiEditorAction:", t), t;
7724
7724
  }
7725
- }, W4 = Me.lazy(() => import("./index-837e960a.js"));
7725
+ }, W4 = Me.lazy(() => import("./index-2c5dedba.js"));
7726
7726
  function K4(e) {
7727
7727
  return e.parentElement != null && e.parentElement.tagName === "LI" && e.previousSibling === null && e.getAttribute("aria-roledescription") === "checkbox";
7728
7728
  }
@@ -13287,10 +13287,10 @@ const I7 = {
13287
13287
  "data-placeholder": `Enter your ${e} content...`,
13288
13288
  suppressContentEditableWarning: !0,
13289
13289
  onFocus: (u) => {
13290
- u.target.textContent === `Click here to edit this ${e} panel content...` && (u.target.textContent = "");
13290
+ u.target.textContent === `Please click here to edit this ${e} panel content...` && (u.target.textContent = "");
13291
13291
  },
13292
13292
  children: [
13293
- "Click here to edit this ",
13293
+ "Please click here to edit this ",
13294
13294
  e,
13295
13295
  " panel content..."
13296
13296
  ]
@@ -23969,7 +23969,7 @@ class KO {
23969
23969
  ke(this, "requestTimeout", 1e4);
23970
23970
  // 10 seconds timeout for more reliable responses
23971
23971
  ke(this, "pendingRequests", /* @__PURE__ */ new Map());
23972
- this.apiEndpoint = "https://api.cteditor.com/" + t;
23972
+ this.apiEndpoint = "http://localhost:3000/" + t;
23973
23973
  }
23974
23974
  async makeRequest(t) {
23975
23975
  const n = JSON.stringify(t);
@@ -27969,4 +27969,4 @@ export {
27969
27969
  se as u,
27970
27970
  wx as v
27971
27971
  };
27972
- //# sourceMappingURL=index-33d833ec.js.map
27972
+ //# sourceMappingURL=index-dc480b69.js.map