@react-fabric/lexical 1.0.0-beta.61 → 1.0.0-beta.63
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/css/_lexical.css +67 -9
- package/dist/cjs/editor/LexicalEditor.js +34 -11
- package/dist/cjs/hooks/useFormatWatcher.js +54 -56
- package/dist/cjs/i18n/{ar.json.js → ar/lexical.json.js} +10 -4
- package/dist/cjs/i18n/{en.json.js → en/lexical.json.js} +7 -1
- package/dist/cjs/i18n/index.js +4 -4
- package/dist/cjs/plugins/CommentPlugin.js +471 -0
- package/dist/cjs/plugins/DraggableBlockPlugin.js +10 -13
- package/dist/esm/editor/LexicalEditor.js +35 -12
- package/dist/esm/hooks/useFormatWatcher.js +54 -56
- package/dist/esm/i18n/{ar.json.js → ar/lexical.json.js} +9 -5
- package/dist/esm/i18n/{en.json.js → en/lexical.json.js} +6 -2
- package/dist/esm/i18n/index.js +2 -2
- package/dist/esm/plugins/CommentPlugin.js +471 -0
- package/dist/esm/plugins/DraggableBlockPlugin.js +11 -14
- package/dist/types/editor/LexicalEditor.d.ts +13 -4
- package/dist/types/hooks/useFormatWatcher.d.ts +1 -1
- package/dist/types/plugins/CommentPlugin.d.ts +5 -0
- package/dist/types/plugins/DraggableBlockPlugin.d.ts +3 -2
- package/package.json +14 -13
- package/src/editor/LexicalEditor.tsx +66 -19
- package/src/hooks/useFormatWatcher.ts +0 -2
- package/src/i18n/{ar.json → ar/lexical.json} +6 -4
- package/src/i18n/{en.json → en/lexical.json} +3 -1
- package/src/i18n/index.ts +2 -2
- package/src/plugins/CommentPlugin.tsx +554 -0
- package/src/plugins/DraggableBlockPlugin.tsx +8 -13
- package/dist/cjs/components/StickyComponent.js +0 -220
- package/dist/cjs/nodes/StickyNode.js +0 -218
- package/dist/cjs/plugins/StickyPlugin.js +0 -20
- package/dist/esm/components/StickyComponent.js +0 -220
- package/dist/esm/nodes/StickyNode.js +0 -216
- package/dist/esm/plugins/StickyPlugin.js +0 -20
- package/dist/types/components/StickyComponent.d.ts +0 -9
- package/dist/types/nodes/StickyNode.d.ts +0 -34
- package/dist/types/plugins/StickyPlugin.d.ts +0 -1
- package/src/components/StickyComponent.tsx +0 -270
- package/src/nodes/StickyNode.tsx +0 -249
- package/src/plugins/StickyPlugin.ts +0 -38
package/css/_lexical.css
CHANGED
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
/* stylelint-disable custom-property-pattern */
|
|
25
25
|
|
|
26
26
|
@layer utilities {
|
|
27
|
+
[dir="rtl"] .fabric-lexicalEditor * {
|
|
28
|
+
text-align: start;
|
|
29
|
+
}
|
|
30
|
+
|
|
27
31
|
.fabric-lexicalEditor,
|
|
28
32
|
.fabric-lexicalToolbar {
|
|
29
33
|
width: 21cm;
|
|
@@ -35,9 +39,28 @@
|
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
.fabric-lexicalEditor {
|
|
42
|
+
.editor-cover {
|
|
43
|
+
position: relative;
|
|
44
|
+
break-after: page;
|
|
45
|
+
|
|
46
|
+
&::after {
|
|
47
|
+
content: "page break";
|
|
48
|
+
|
|
49
|
+
position: absolute;
|
|
50
|
+
bottom: 0;
|
|
51
|
+
inset-inline: 0;
|
|
52
|
+
|
|
53
|
+
border-bottom: 1px dashed #ccc;
|
|
54
|
+
|
|
55
|
+
font-size: 11px;
|
|
56
|
+
line-height: 0;
|
|
57
|
+
color: #ccc;
|
|
58
|
+
text-align: center;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
38
62
|
.editor-container.editor-container.editor-container {
|
|
39
|
-
|
|
40
|
-
font-family: "Sakkal Majalla";
|
|
63
|
+
font-family: "Noto Sans Kufi Arabic", "Noto Sans", Arial, sans-serif;
|
|
41
64
|
font-size: 18px;
|
|
42
65
|
color: #0f172a;
|
|
43
66
|
background-color: #fff;
|
|
@@ -87,13 +110,12 @@
|
|
|
87
110
|
margin-top: 1.5em;
|
|
88
111
|
margin-bottom: 1.5em;
|
|
89
112
|
padding-inline-start: 1em;
|
|
113
|
+
border-color: #64748b;
|
|
114
|
+
border-inline-start-width: 4px;
|
|
90
115
|
|
|
91
116
|
font-size: 1.125em;
|
|
92
117
|
line-height: 1.5;
|
|
93
118
|
color: #1e293b;
|
|
94
|
-
|
|
95
|
-
border-color: #64748b;
|
|
96
|
-
border-inline-start-width: 4px;
|
|
97
119
|
}
|
|
98
120
|
|
|
99
121
|
.editor-code {
|
|
@@ -102,13 +124,13 @@
|
|
|
102
124
|
margin-top: 1.5em;
|
|
103
125
|
margin-bottom: 1.5em;
|
|
104
126
|
padding: 1em;
|
|
127
|
+
border-inline-start-width: 4px;
|
|
105
128
|
|
|
106
129
|
font-size: 1.125em;
|
|
107
130
|
line-height: 1.5;
|
|
108
131
|
color: #1e293b;
|
|
109
132
|
|
|
110
133
|
background-color: #e2e8f0;
|
|
111
|
-
border-inline-start-width: 4px;
|
|
112
134
|
}
|
|
113
135
|
|
|
114
136
|
.editor-textUnderline {
|
|
@@ -124,11 +146,11 @@
|
|
|
124
146
|
}
|
|
125
147
|
|
|
126
148
|
.editor-page-break {
|
|
127
|
-
|
|
149
|
+
break-after: always;
|
|
128
150
|
}
|
|
129
151
|
|
|
130
152
|
.editor-no-break {
|
|
131
|
-
|
|
153
|
+
break-inside: avoid;
|
|
132
154
|
}
|
|
133
155
|
|
|
134
156
|
.editor-textSmall {
|
|
@@ -162,6 +184,43 @@
|
|
|
162
184
|
text-align: start;
|
|
163
185
|
}
|
|
164
186
|
|
|
187
|
+
.editor-comment {
|
|
188
|
+
width: 100%;
|
|
189
|
+
padding: 0.25em 0.5em;
|
|
190
|
+
border: 2px solid var(--color-marigold-200);
|
|
191
|
+
|
|
192
|
+
font-size: 0.825rem;
|
|
193
|
+
font-weight: initial;
|
|
194
|
+
font-style: initial;
|
|
195
|
+
|
|
196
|
+
background-color: --alpha(var(--color-marigold-100) / 50%);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.editor-comment-hilight {
|
|
200
|
+
outline: 2px solid var(--color-marigold-300);
|
|
201
|
+
outline-offset: 8px;
|
|
202
|
+
transition: outline-offset ease 2s;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.editor-has-comment::before {
|
|
206
|
+
cursor: pointer;
|
|
207
|
+
content: " ";
|
|
208
|
+
|
|
209
|
+
position: absolute;
|
|
210
|
+
inset-inline-start: 1.5cm;
|
|
211
|
+
|
|
212
|
+
display: inline-block;
|
|
213
|
+
|
|
214
|
+
width: 1rem;
|
|
215
|
+
height: 1rem;
|
|
216
|
+
border-radius: 1rem;
|
|
217
|
+
|
|
218
|
+
opacity: 0.5;
|
|
219
|
+
background-color: var(--color-marigold-700);
|
|
220
|
+
|
|
221
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3C!-- Icon from Material Design Icons by Pictogrammers - https://github.com/Templarian/MaterialDesign/blob/master/LICENSE --%3E%3Cpath fill='currentColor' d='M9 22a1 1 0 0 1-1-1v-3H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6.1l-3.7 3.71c-.2.19-.45.29-.7.29zm1-6v3.08L13.08 16H20V4H4v12zM6 7h12v2H6zm0 4h9v2H6z'/%3E%3C/svg%3E");
|
|
222
|
+
}
|
|
223
|
+
|
|
165
224
|
@media print {
|
|
166
225
|
html,
|
|
167
226
|
body {
|
|
@@ -199,7 +258,6 @@
|
|
|
199
258
|
margin: 0 auto;
|
|
200
259
|
|
|
201
260
|
background-image: inherit;
|
|
202
|
-
|
|
203
261
|
-webkit-print-color-adjust: exact;
|
|
204
262
|
print-color-adjust: exact;
|
|
205
263
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
3
4
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
4
5
|
var code = require('@lexical/code');
|
|
5
6
|
var list = require('@lexical/list');
|
|
@@ -18,9 +19,8 @@ var core = require('@react-fabric/core');
|
|
|
18
19
|
var utilities = require('@react-fabric/utilities');
|
|
19
20
|
var classNames = require('classnames');
|
|
20
21
|
var react = require('react');
|
|
21
|
-
var
|
|
22
|
+
var CommentPlugin = require('../plugins/CommentPlugin.js');
|
|
22
23
|
var DraggableBlockPlugin = require('../plugins/DraggableBlockPlugin.js');
|
|
23
|
-
var StickyPlugin = require('../plugins/StickyPlugin.js');
|
|
24
24
|
var ToolbarPlugin = require('../plugins/ToolbarPlugin.js');
|
|
25
25
|
var theme = require('./theme.js');
|
|
26
26
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -34,7 +34,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
34
34
|
* It uses a custom theme and provides error handling for Lexical updates.
|
|
35
35
|
*
|
|
36
36
|
* @param {EditorProps} props - The properties for the LexicalEditor component.
|
|
37
|
-
* @returns {
|
|
37
|
+
* @returns {React.ReactElement} The rendered LexicalEditor component.
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
* ```jsx
|
|
@@ -54,6 +54,14 @@ var LexicalEditor = function LexicalEditor(_ref) {
|
|
|
54
54
|
var value = _ref.value,
|
|
55
55
|
readOnly = _ref.readOnly,
|
|
56
56
|
publishMode = _ref.publishMode,
|
|
57
|
+
header = _ref.header,
|
|
58
|
+
footer = _ref.footer,
|
|
59
|
+
coverPage = _ref.coverPage,
|
|
60
|
+
isRtl = _ref.isRtl,
|
|
61
|
+
_ref$username = _ref.username,
|
|
62
|
+
username = _ref$username === void 0 ? "Guest" : _ref$username,
|
|
63
|
+
_ref$nodes = _ref.nodes,
|
|
64
|
+
nodes = _ref$nodes === void 0 ? utilities.EMPTY_ARRAY : _ref$nodes,
|
|
57
65
|
onChange = _ref.onChange,
|
|
58
66
|
onDirty = _ref.onDirty;
|
|
59
67
|
var editorRef = react.useRef(null);
|
|
@@ -123,7 +131,7 @@ var LexicalEditor = function LexicalEditor(_ref) {
|
|
|
123
131
|
namespace: "MyEditor",
|
|
124
132
|
editable: !readOnly && !publishMode,
|
|
125
133
|
theme: theme.LexicalTheme,
|
|
126
|
-
nodes: [richText.QuoteNode, richText.HeadingNode, code.CodeHighlightNode, code.CodeNode, list.ListItemNode, list.ListNode, table.TableCellNode, table.TableNode, table.TableRowNode
|
|
134
|
+
nodes: [richText.QuoteNode, richText.HeadingNode, code.CodeHighlightNode, code.CodeNode, list.ListItemNode, list.ListNode, table.TableCellNode, table.TableNode, table.TableRowNode].concat(_toConsumableArray(nodes)),
|
|
127
135
|
onError: onError
|
|
128
136
|
};
|
|
129
137
|
}, []);
|
|
@@ -131,15 +139,15 @@ var LexicalEditor = function LexicalEditor(_ref) {
|
|
|
131
139
|
var children = _ref3.children;
|
|
132
140
|
return !publishMode ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
133
141
|
className: "lexical-scroller area-content overflow-auto",
|
|
134
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
142
|
+
children: [!readOnly && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
135
143
|
className: classNames("fabric-lexicalToolbar", "sticky top-0 z-1"),
|
|
136
144
|
children: /*#__PURE__*/jsxRuntime.jsx(core.Header, {
|
|
137
|
-
className: "bg-
|
|
145
|
+
className: "bg-default",
|
|
138
146
|
children: /*#__PURE__*/jsxRuntime.jsx(ToolbarPlugin.ToolbarPlugin, {})
|
|
139
147
|
})
|
|
140
148
|
}), children]
|
|
141
149
|
}) : children;
|
|
142
|
-
}, [publishMode]);
|
|
150
|
+
}, [publishMode, readOnly]);
|
|
143
151
|
return /*#__PURE__*/jsxRuntime.jsx(core.ErrorBoundary, {
|
|
144
152
|
children: /*#__PURE__*/jsxRuntime.jsx(LexicalComposer.LexicalComposer, {
|
|
145
153
|
initialConfig: initialConfig,
|
|
@@ -149,6 +157,7 @@ var LexicalEditor = function LexicalEditor(_ref) {
|
|
|
149
157
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
150
158
|
role: "none",
|
|
151
159
|
className: classNames("fabric-lexicalEditor", "lexical-container relative bg-white min-h-full mx-auto shadow-md print:shadow-none"),
|
|
160
|
+
dir: isRtl ? "rtl" : "ltr",
|
|
152
161
|
onDragOver: function onDragOver(e) {
|
|
153
162
|
return e.stopPropagation();
|
|
154
163
|
},
|
|
@@ -156,20 +165,34 @@ var LexicalEditor = function LexicalEditor(_ref) {
|
|
|
156
165
|
return e.stopPropagation();
|
|
157
166
|
},
|
|
158
167
|
ref: setEditorContainer,
|
|
159
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
168
|
+
children: [!publishMode && header && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
169
|
+
className: "editor-header",
|
|
170
|
+
children: header
|
|
171
|
+
}), coverPage && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
172
|
+
className: "editor-cover px-[2cm] py-[1cm]",
|
|
173
|
+
children: coverPage
|
|
174
|
+
}), /*#__PURE__*/jsxRuntime.jsx(LexicalRichTextPlugin.RichTextPlugin, {
|
|
160
175
|
contentEditable: /*#__PURE__*/jsxRuntime.jsx(LexicalContentEditable.ContentEditable, {
|
|
161
176
|
readOnly: !!readOnly || publishMode,
|
|
162
|
-
className: "lexical-editor px-[2cm] py-[1cm]
|
|
177
|
+
className: "lexical-editor min-h-screen px-[2cm] py-[1cm]"
|
|
163
178
|
}),
|
|
164
179
|
placeholder: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
165
180
|
className: "text-muted overflow-hidden absolute mt-6 top-[1cm] left-[2cm] select-none pointer-events-none",
|
|
166
181
|
children: "Enter some text..."
|
|
167
182
|
}),
|
|
168
183
|
ErrorBoundary: LexicalErrorBoundary.LexicalErrorBoundary
|
|
169
|
-
}), /*#__PURE__*/jsxRuntime.jsx(LexicalListPlugin.ListPlugin, {}), /*#__PURE__*/jsxRuntime.jsx(LexicalCheckListPlugin.CheckListPlugin, {}), /*#__PURE__*/jsxRuntime.jsx(LexicalTablePlugin.TablePlugin, {}), /*#__PURE__*/jsxRuntime.jsx(LexicalHistoryPlugin.HistoryPlugin, {}), /*#__PURE__*/jsxRuntime.jsx(
|
|
184
|
+
}), /*#__PURE__*/jsxRuntime.jsx(LexicalListPlugin.ListPlugin, {}), /*#__PURE__*/jsxRuntime.jsx(LexicalCheckListPlugin.CheckListPlugin, {}), /*#__PURE__*/jsxRuntime.jsx(LexicalTablePlugin.TablePlugin, {}), /*#__PURE__*/jsxRuntime.jsx(LexicalHistoryPlugin.HistoryPlugin, {}), /*#__PURE__*/jsxRuntime.jsx(LexicalAutoFocusPlugin.AutoFocusPlugin, {
|
|
170
185
|
defaultSelection: "rootStart"
|
|
171
186
|
}), editorContainer && /*#__PURE__*/jsxRuntime.jsx(DraggableBlockPlugin.DraggableBlockPlugin, {
|
|
172
|
-
anchorElem: editorContainer
|
|
187
|
+
anchorElem: editorContainer,
|
|
188
|
+
isEditable: !readOnly && !publishMode
|
|
189
|
+
}), editorContainer && /*#__PURE__*/jsxRuntime.jsx(CommentPlugin.CommentPlugin, {
|
|
190
|
+
username: username,
|
|
191
|
+
anchorElem: editorContainer,
|
|
192
|
+
isPublishMode: !!publishMode
|
|
193
|
+
}), !publishMode && footer && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
194
|
+
className: "editor-footer",
|
|
195
|
+
children: footer
|
|
173
196
|
})]
|
|
174
197
|
})
|
|
175
198
|
})
|
|
@@ -65,83 +65,83 @@ var useFormatWatcher = function useFormatWatcher() {
|
|
|
65
65
|
rootType = _useState8[0],
|
|
66
66
|
setRootType = _useState8[1];
|
|
67
67
|
var _useState9 = react.useState(null),
|
|
68
|
-
|
|
69
|
-
selectedElementKey =
|
|
70
|
-
setSelectedElementKey =
|
|
71
|
-
var
|
|
68
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
69
|
+
selectedElementKey = _useState0[0],
|
|
70
|
+
setSelectedElementKey = _useState0[1];
|
|
71
|
+
var _useState1 = react.useState("16"),
|
|
72
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
73
|
+
fontSize = _useState10[0],
|
|
74
|
+
setFontSize = _useState10[1];
|
|
75
|
+
var _useState11 = react.useState("#000"),
|
|
72
76
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
var _useState13 = react.useState("#
|
|
77
|
+
fontColor = _useState12[0],
|
|
78
|
+
setFontColor = _useState12[1];
|
|
79
|
+
var _useState13 = react.useState("#fff"),
|
|
76
80
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var _useState15 = react.useState("
|
|
81
|
+
bgColor = _useState14[0],
|
|
82
|
+
setBgColor = _useState14[1];
|
|
83
|
+
var _useState15 = react.useState("Arial"),
|
|
80
84
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var _useState17 = react.useState("
|
|
85
|
+
fontFamily = _useState16[0],
|
|
86
|
+
setFontFamily = _useState16[1];
|
|
87
|
+
var _useState17 = react.useState(""),
|
|
84
88
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var _useState19 = react.useState(
|
|
89
|
+
align = _useState18[0],
|
|
90
|
+
setAlign = _useState18[1];
|
|
91
|
+
var _useState19 = react.useState(false),
|
|
88
92
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
isLink = _useState20[0],
|
|
94
|
+
setIsLink = _useState20[1];
|
|
91
95
|
var _useState21 = react.useState(false),
|
|
92
96
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
isBold = _useState22[0],
|
|
98
|
+
setIsBold = _useState22[1];
|
|
95
99
|
var _useState23 = react.useState(false),
|
|
96
100
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
isItalic = _useState24[0],
|
|
102
|
+
setIsItalic = _useState24[1];
|
|
99
103
|
var _useState25 = react.useState(false),
|
|
100
104
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
isUnderline = _useState26[0],
|
|
106
|
+
setIsUnderline = _useState26[1];
|
|
103
107
|
var _useState27 = react.useState(false),
|
|
104
108
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
105
|
-
|
|
106
|
-
|
|
109
|
+
isStrikethrough = _useState28[0],
|
|
110
|
+
setIsStrikethrough = _useState28[1];
|
|
107
111
|
var _useState29 = react.useState(false),
|
|
108
112
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
isSubscript = _useState30[0],
|
|
114
|
+
setIsSubscript = _useState30[1];
|
|
111
115
|
var _useState31 = react.useState(false),
|
|
112
116
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
113
|
-
|
|
114
|
-
|
|
117
|
+
isSuperscript = _useState32[0],
|
|
118
|
+
setIsSuperscript = _useState32[1];
|
|
115
119
|
var _useState33 = react.useState(false),
|
|
116
120
|
_useState34 = _slicedToArray(_useState33, 2),
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
isCode = _useState34[0],
|
|
122
|
+
setIsCode = _useState34[1];
|
|
119
123
|
var _useState35 = react.useState(false),
|
|
120
124
|
_useState36 = _slicedToArray(_useState35, 2),
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
canUndo = _useState36[0],
|
|
126
|
+
setCanUndo = _useState36[1];
|
|
123
127
|
var _useState37 = react.useState(false),
|
|
124
128
|
_useState38 = _slicedToArray(_useState37, 2),
|
|
125
|
-
|
|
126
|
-
|
|
129
|
+
canRedo = _useState38[0],
|
|
130
|
+
setCanRedo = _useState38[1];
|
|
127
131
|
var _useState39 = react.useState(false),
|
|
128
132
|
_useState40 = _slicedToArray(_useState39, 2),
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
var _useState41 = react.useState(
|
|
133
|
+
isRTL = _useState40[0],
|
|
134
|
+
setIsRTL = _useState40[1];
|
|
135
|
+
var _useState41 = react.useState(""),
|
|
132
136
|
_useState42 = _slicedToArray(_useState41, 2),
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
var _useState43 = react.useState(
|
|
136
|
-
_useState44 = _slicedToArray(_useState43, 2),
|
|
137
|
-
codeLanguage = _useState44[0],
|
|
138
|
-
setCodeLanguage = _useState44[1];
|
|
139
|
-
var _useState45 = react.useState(function () {
|
|
137
|
+
codeLanguage = _useState42[0],
|
|
138
|
+
setCodeLanguage = _useState42[1];
|
|
139
|
+
var _useState43 = react.useState(function () {
|
|
140
140
|
return editor.isEditable();
|
|
141
141
|
}),
|
|
142
|
-
|
|
143
|
-
isEditable =
|
|
144
|
-
setIsEditable =
|
|
142
|
+
_useState44 = _slicedToArray(_useState43, 2),
|
|
143
|
+
isEditable = _useState44[0],
|
|
144
|
+
setIsEditable = _useState44[1];
|
|
145
145
|
var $updateToolbar = react.useCallback(function () {
|
|
146
146
|
var selection$1 = lexical.$getSelection();
|
|
147
147
|
if (lexical.$isRangeSelection(selection$1)) {
|
|
@@ -205,11 +205,9 @@ var useFormatWatcher = function useFormatWatcher() {
|
|
|
205
205
|
setFontSize(parseInt(selection.$getSelectionStyleValueForProperty(selection$1, "font-size", "16")) + "");
|
|
206
206
|
setFontColor(selection.$getSelectionStyleValueForProperty(selection$1, "color",
|
|
207
207
|
// @ts-expect-error ignore
|
|
208
|
-
// eslint-disable-next-line no-new-wrappers
|
|
209
208
|
new String("#000")));
|
|
210
209
|
setBgColor(selection.$getSelectionStyleValueForProperty(selection$1, "background-color",
|
|
211
210
|
// @ts-expect-error ignore
|
|
212
|
-
// eslint-disable-next-line no-new-wrappers
|
|
213
211
|
new String("#fff")));
|
|
214
212
|
setFontFamily(selection.$getSelectionStyleValueForProperty(selection$1, "font-family", "inherit"));
|
|
215
213
|
}
|
|
@@ -397,20 +395,20 @@ var useFormatWatcher = function useFormatWatcher() {
|
|
|
397
395
|
}, [applyStyleText]);
|
|
398
396
|
|
|
399
397
|
// @ts-expect-error ignore
|
|
400
|
-
window.$getSelection = /*#__PURE__*/_asyncToGenerator(
|
|
401
|
-
return _regeneratorRuntime.wrap(function
|
|
398
|
+
window.$getSelection = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
399
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
402
400
|
while (1) switch (_context.prev = _context.next) {
|
|
403
401
|
case 0:
|
|
404
|
-
_context.next =
|
|
402
|
+
_context.next = 1;
|
|
405
403
|
return new Promise(function (resolve) {
|
|
406
404
|
activeEditor.update(function () {
|
|
407
405
|
var selection = lexical.$getSelection();
|
|
408
406
|
resolve(selection);
|
|
409
407
|
});
|
|
410
408
|
});
|
|
411
|
-
case
|
|
409
|
+
case 1:
|
|
412
410
|
return _context.abrupt("return", _context.sent);
|
|
413
|
-
case
|
|
411
|
+
case 2:
|
|
414
412
|
case "end":
|
|
415
413
|
return _context.stop();
|
|
416
414
|
}
|
|
@@ -2,23 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var addComment = "أضف تعليقا";
|
|
6
|
+
var reply = "رد";
|
|
5
7
|
var tool = {
|
|
6
8
|
alignCenter: "محاذاة المركز",
|
|
7
|
-
alignJustify: "محاذاة وضبط",
|
|
8
9
|
alignEnd: "محاذاة النهاية",
|
|
10
|
+
alignJustify: "محاذاة وضبط",
|
|
9
11
|
alignStart: "محاذاة البداية",
|
|
10
12
|
bold: "عريض",
|
|
11
13
|
clear: "مسح التنسيق",
|
|
12
14
|
hilight: "تسليط الضوء",
|
|
13
15
|
indentIn: "المسافة البادئة في",
|
|
14
|
-
|
|
15
|
-
strikethrough: "يتوسطه خط",
|
|
16
|
+
indentOut: "مسافة بادئة للخارج",
|
|
16
17
|
italic: "مائل",
|
|
17
|
-
|
|
18
|
+
strikethrough: "يتوسطه خط",
|
|
19
|
+
underline: "تسطير"
|
|
18
20
|
};
|
|
19
21
|
var ar = {
|
|
22
|
+
addComment: addComment,
|
|
23
|
+
reply: reply,
|
|
20
24
|
tool: tool
|
|
21
25
|
};
|
|
22
26
|
|
|
27
|
+
exports.addComment = addComment;
|
|
23
28
|
exports.default = ar;
|
|
29
|
+
exports.reply = reply;
|
|
24
30
|
exports.tool = tool;
|
|
@@ -16,9 +16,15 @@ var tool = {
|
|
|
16
16
|
hilight: "Highlight",
|
|
17
17
|
clear: "Clear Formatting"
|
|
18
18
|
};
|
|
19
|
+
var addComment = "Add comment";
|
|
20
|
+
var reply = "Reply";
|
|
19
21
|
var en = {
|
|
20
|
-
tool: tool
|
|
22
|
+
tool: tool,
|
|
23
|
+
addComment: addComment,
|
|
24
|
+
reply: reply
|
|
21
25
|
};
|
|
22
26
|
|
|
27
|
+
exports.addComment = addComment;
|
|
23
28
|
exports.default = en;
|
|
29
|
+
exports.reply = reply;
|
|
24
30
|
exports.tool = tool;
|
package/dist/cjs/i18n/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var core = require('@react-fabric/core');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var lexical$1 = require('./ar/lexical.json.js');
|
|
5
|
+
var lexical = require('./en/lexical.json.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
* React Fabric
|
|
@@ -28,6 +28,6 @@ var en = require('./en.json.js');
|
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
core.addTranslationBundle("lexical", {
|
|
31
|
-
en:
|
|
32
|
-
ar:
|
|
31
|
+
en: lexical.default,
|
|
32
|
+
ar: lexical$1.default
|
|
33
33
|
});
|