@webiny/lexical-editor 5.44.1-beta.0 → 5.45.0-beta.0
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 +6 -12
- package/commands/image.d.ts +2 -2
- package/commands/image.js +2 -8
- package/commands/image.js.map +1 -1
- package/commands/index.d.ts +5 -4
- package/commands/index.js +5 -49
- package/commands/index.js.map +1 -1
- package/commands/list.d.ts +1 -1
- package/commands/list.js +4 -10
- package/commands/list.js.map +1 -1
- package/commands/quote.d.ts +1 -1
- package/commands/quote.js +2 -8
- package/commands/quote.js.map +1 -1
- package/commands/toolbar.js +2 -8
- package/commands/toolbar.js.map +1 -1
- package/commands/typography.d.ts +8 -0
- package/commands/typography.js +4 -0
- package/commands/typography.js.map +1 -0
- package/components/Editor/EnsureHeadingTagPlugin.js +10 -16
- package/components/Editor/EnsureHeadingTagPlugin.js.map +1 -1
- package/components/Editor/RichTextEditor.d.ts +12 -8
- package/components/Editor/RichTextEditor.js +89 -102
- package/components/Editor/RichTextEditor.js.map +1 -1
- package/components/Editor/normalizeInputValue.d.ts +1 -1
- package/components/Editor/normalizeInputValue.js +2 -8
- package/components/Editor/normalizeInputValue.js.map +1 -1
- package/components/LexicalEditorConfig/LexicalEditorConfig.d.ts +14 -16
- package/components/LexicalEditorConfig/LexicalEditorConfig.js +21 -69
- package/components/LexicalEditorConfig/LexicalEditorConfig.js.map +1 -1
- package/components/LexicalEditorConfig/components/Node.d.ts +1 -1
- package/components/LexicalEditorConfig/components/Node.js +17 -26
- package/components/LexicalEditorConfig/components/Node.js.map +1 -1
- package/components/LexicalEditorConfig/components/Plugin.js +17 -26
- package/components/LexicalEditorConfig/components/Plugin.js.map +1 -1
- package/components/LexicalEditorConfig/components/ToolbarElement.js +17 -26
- package/components/LexicalEditorConfig/components/ToolbarElement.js.map +1 -1
- package/components/LexicalHtmlRenderer.d.ts +4 -7
- package/components/LexicalHtmlRenderer.js +35 -53
- package/components/LexicalHtmlRenderer.js.map +1 -1
- package/components/Toolbar/StaticToolbar.css +416 -0
- package/components/Toolbar/StaticToolbar.d.ts +3 -1
- package/components/Toolbar/StaticToolbar.js +19 -23
- package/components/Toolbar/StaticToolbar.js.map +1 -1
- package/components/ToolbarActions/BoldAction.js +16 -21
- package/components/ToolbarActions/BoldAction.js.map +1 -1
- package/components/ToolbarActions/BulletListAction.js +25 -31
- package/components/ToolbarActions/BulletListAction.js.map +1 -1
- package/components/ToolbarActions/CodeHighlightAction.js +16 -21
- package/components/ToolbarActions/CodeHighlightAction.js.map +1 -1
- package/components/ToolbarActions/FontColorAction.js +32 -42
- package/components/ToolbarActions/FontColorAction.js.map +1 -1
- package/components/ToolbarActions/ImageAction.js +19 -34
- package/components/ToolbarActions/ImageAction.js.map +1 -1
- package/components/ToolbarActions/ItalicAction.js +16 -21
- package/components/ToolbarActions/ItalicAction.js.map +1 -1
- package/components/ToolbarActions/LinkAction.js +19 -24
- package/components/ToolbarActions/LinkAction.js.map +1 -1
- package/components/ToolbarActions/NumberedListAction.js +25 -36
- package/components/ToolbarActions/NumberedListAction.js.map +1 -1
- package/components/ToolbarActions/QuoteAction.js +20 -25
- package/components/ToolbarActions/QuoteAction.js.map +1 -1
- package/components/ToolbarActions/TextAlignmentAction.js +36 -45
- package/components/ToolbarActions/TextAlignmentAction.js.map +1 -1
- package/components/ToolbarActions/TypographyAction.js +57 -79
- package/components/ToolbarActions/TypographyAction.js.map +1 -1
- package/components/ToolbarActions/UnderlineAction.js +16 -21
- package/components/ToolbarActions/UnderlineAction.js.map +1 -1
- package/context/FontColorActionContext.js +2 -9
- package/context/FontColorActionContext.js.map +1 -1
- package/context/RichTextEditorContext.d.ts +6 -7
- package/context/RichTextEditorContext.js +28 -26
- package/context/RichTextEditorContext.js.map +1 -1
- package/context/SharedHistoryContext.d.ts +2 -2
- package/context/SharedHistoryContext.js +12 -20
- package/context/SharedHistoryContext.js.map +1 -1
- package/context/TextAlignmentActionContextProps.d.ts +1 -1
- package/context/TextAlignmentActionContextProps.js +2 -9
- package/context/TextAlignmentActionContextProps.js.map +1 -1
- package/context/TypographyActionContext.d.ts +3 -2
- package/context/TypographyActionContext.js +2 -9
- package/context/TypographyActionContext.js.map +1 -1
- package/exports/admin/lexical.d.ts +15 -0
- package/exports/admin/lexical.js +23 -0
- package/exports/admin/lexical.js.map +1 -0
- package/hooks/index.d.ts +7 -8
- package/hooks/index.js +7 -93
- package/hooks/index.js.map +1 -1
- package/hooks/useCurrentElement.d.ts +3 -3
- package/hooks/useCurrentElement.js +11 -18
- package/hooks/useCurrentElement.js.map +1 -1
- package/hooks/useCurrentSelection.d.ts +2 -1
- package/hooks/useCurrentSelection.js +27 -40
- package/hooks/useCurrentSelection.js.map +1 -1
- package/hooks/useFontColorPicker.d.ts +1 -1
- package/hooks/useFontColorPicker.js +5 -11
- package/hooks/useFontColorPicker.js.map +1 -1
- package/hooks/useIsMounted.js +6 -14
- package/hooks/useIsMounted.js.map +1 -1
- package/hooks/useRichTextEditor.d.ts +1 -1
- package/hooks/useRichTextEditor.js +5 -11
- package/hooks/useRichTextEditor.js.map +1 -1
- package/hooks/useTextAlignmentAction.d.ts +1 -1
- package/hooks/useTextAlignmentAction.js +5 -11
- package/hooks/useTextAlignmentAction.js.map +1 -1
- package/hooks/useTypographyAction.d.ts +1 -1
- package/hooks/useTypographyAction.js +5 -11
- package/hooks/useTypographyAction.js.map +1 -1
- package/index.d.ts +33 -38
- package/index.js +44 -322
- package/index.js.map +1 -1
- package/package.json +18 -22
- package/plugins/BlurEventPlugin/BlurEventPlugin.d.ts +2 -2
- package/plugins/BlurEventPlugin/BlurEventPlugin.js +16 -22
- package/plugins/BlurEventPlugin/BlurEventPlugin.js.map +1 -1
- package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js +9 -14
- package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js.map +1 -1
- package/plugins/CodeHighlightPlugin/index.d.ts +1 -1
- package/plugins/CodeHighlightPlugin/index.js +1 -16
- package/plugins/CodeHighlightPlugin/index.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.d.ts +10 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js +28 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js.map +1 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.d.ts +7 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js +61 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js.map +1 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.css +2 -136
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.d.ts +4 -16
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js +7 -180
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/index.d.ts +1 -1
- package/plugins/FloatingLinkEditorPlugin/index.js +1 -16
- package/plugins/FloatingLinkEditorPlugin/index.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js +3 -9
- package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/types.d.ts +10 -0
- package/plugins/FloatingLinkEditorPlugin/types.js +3 -0
- package/plugins/FloatingLinkEditorPlugin/types.js.map +1 -0
- package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.d.ts +8 -2
- package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.js +120 -88
- package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.js.map +1 -1
- package/plugins/FontColorPlugin/FontColorPlugin.js +19 -22
- package/plugins/FontColorPlugin/FontColorPlugin.js.map +1 -1
- package/plugins/FontColorPlugin/applyColorToNode.d.ts +2 -2
- package/plugins/FontColorPlugin/applyColorToNode.js +4 -10
- package/plugins/FontColorPlugin/applyColorToNode.js.map +1 -1
- package/plugins/FontColorPlugin/applyColorToSelection.d.ts +2 -2
- package/plugins/FontColorPlugin/applyColorToSelection.js +28 -44
- package/plugins/FontColorPlugin/applyColorToSelection.js.map +1 -1
- package/plugins/ImagesPlugin/ImagesPlugin.d.ts +1 -2
- package/plugins/ImagesPlugin/ImagesPlugin.js +58 -60
- package/plugins/ImagesPlugin/ImagesPlugin.js.map +1 -1
- package/plugins/LinkPlugin/LinkPlugin.js +29 -37
- package/plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/plugins/ListPLugin/ListPlugin.js +52 -15
- package/plugins/ListPLugin/ListPlugin.js.map +1 -1
- package/plugins/QuoteNodePlugin/QuoteNodePlugin.js +19 -16
- package/plugins/QuoteNodePlugin/QuoteNodePlugin.js.map +1 -1
- package/plugins/StateHandlingPlugin.d.ts +1 -1
- package/plugins/StateHandlingPlugin.js +32 -39
- package/plugins/StateHandlingPlugin.js.map +1 -1
- package/plugins/TypographyPlugin/TypographyPlugin.js +17 -21
- package/plugins/TypographyPlugin/TypographyPlugin.js.map +1 -1
- package/types.d.ts +4 -4
- package/types.js +6 -38
- package/types.js.map +1 -1
- package/ui/ContentEditable.d.ts +0 -1
- package/ui/ContentEditable.js +7 -14
- package/ui/ContentEditable.js.map +1 -1
- package/ui/Divider.d.ts +0 -1
- package/ui/Divider.js +3 -10
- package/ui/Divider.js.map +1 -1
- package/ui/DropDown.d.ts +1 -1
- package/ui/DropDown.js +64 -90
- package/ui/DropDown.js.map +1 -1
- package/ui/ImageResizer.d.ts +0 -1
- package/ui/ImageResizer.js +78 -83
- package/ui/ImageResizer.js.map +1 -1
- package/ui/LinkPreview.d.ts +0 -1
- package/ui/LinkPreview.js +22 -29
- package/ui/LinkPreview.js.map +1 -1
- package/ui/Placeholder.d.ts +1 -1
- package/ui/Placeholder.js +10 -16
- package/ui/Placeholder.js.map +1 -1
- package/ui/TextInput.d.ts +0 -1
- package/ui/TextInput.js +11 -18
- package/ui/TextInput.js.map +1 -1
- package/ui/ToolbarActionDialog.js +30 -42
- package/ui/ToolbarActionDialog.js.map +1 -1
- package/utils/canUseDOM.js +1 -7
- package/utils/canUseDOM.js.map +1 -1
- package/utils/files.d.ts +6 -6
- package/utils/files.js +5 -32
- package/utils/files.js.map +1 -1
- package/utils/getDOMRangeRect.js +4 -10
- package/utils/getDOMRangeRect.js.map +1 -1
- package/utils/getSelectedNode.d.ts +1 -1
- package/utils/getSelectedNode.js +9 -16
- package/utils/getSelectedNode.js.map +1 -1
- package/utils/getTransparentImage.js +1 -7
- package/utils/getTransparentImage.js.map +1 -1
- package/utils/insertImage.d.ts +1 -1
- package/utils/insertImage.js +8 -14
- package/utils/insertImage.js.map +1 -1
- package/utils/isAnchorLink.js +1 -7
- package/utils/isAnchorLink.js.map +1 -1
- package/utils/isChildOfFloatingToolbar.js +3 -12
- package/utils/isChildOfFloatingToolbar.js.map +1 -1
- package/utils/isHTMLElement.js +1 -7
- package/utils/isHTMLElement.js.map +1 -1
- package/utils/isValidJSON.js +3 -9
- package/utils/isValidJSON.js.map +1 -1
- package/utils/isValidLexicalData.d.ts +3 -3
- package/utils/isValidLexicalData.js +6 -12
- package/utils/isValidLexicalData.js.map +1 -1
- package/utils/point.js +35 -60
- package/utils/point.js.map +1 -1
- package/utils/rect.d.ts +1 -1
- package/utils/rect.js +115 -149
- package/utils/rect.js.map +1 -1
- package/utils/sanitizeUrl.js +6 -13
- package/utils/sanitizeUrl.js.map +1 -1
- package/utils/setFloatingElemPosition.d.ts +1 -1
- package/utils/setFloatingElemPosition.js +24 -30
- package/utils/setFloatingElemPosition.js.map +1 -1
- package/components/Editor/HeadingEditor.d.ts +0 -7
- package/components/Editor/HeadingEditor.js +0 -30
- package/components/Editor/HeadingEditor.js.map +0 -1
- package/components/Editor/ParagraphEditor.d.ts +0 -7
- package/components/Editor/ParagraphEditor.js +0 -29
- package/components/Editor/ParagraphEditor.js.map +0 -1
- package/components/Toolbar/Toolbar.css +0 -643
- package/components/Toolbar/Toolbar.d.ts +0 -11
- package/components/Toolbar/Toolbar.js +0 -165
- package/components/Toolbar/Toolbar.js.map +0 -1
- package/components/ToolbarActions/FontSizeAction.d.ts +0 -14
- package/components/ToolbarActions/FontSizeAction.js +0 -109
- package/components/ToolbarActions/FontSizeAction.js.map +0 -1
- package/hooks/useList.d.ts +0 -2
- package/hooks/useList.js +0 -54
- package/hooks/useList.js.map +0 -1
- package/hooks/useQuote.d.ts +0 -2
- package/hooks/useQuote.js +0 -22
- package/hooks/useQuote.js.map +0 -1
- package/plugins/FloatingLinkEditorPlugin/LinkEditForm.d.ts +0 -9
- package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js +0 -118
- package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js.map +0 -1
- package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.d.ts +0 -9
- package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js +0 -44
- package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js.map +0 -1
- package/utils/generateInitialLexicalValue.d.ts +0 -4
- package/utils/generateInitialLexicalValue.js +0 -33
- package/utils/generateInitialLexicalValue.js.map +0 -1
package/index.js
CHANGED
|
@@ -1,324 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
Object.defineProperty(exports, "BlurEventPlugin", {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
get: function get() {
|
|
49
|
-
return _BlurEventPlugin.BlurEventPlugin;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
Object.defineProperty(exports, "BoldAction", {
|
|
53
|
-
enumerable: true,
|
|
54
|
-
get: function get() {
|
|
55
|
-
return _BoldAction.BoldAction;
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
Object.defineProperty(exports, "BulletListAction", {
|
|
59
|
-
enumerable: true,
|
|
60
|
-
get: function get() {
|
|
61
|
-
return _BulletListAction.BulletListAction;
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
Object.defineProperty(exports, "CodeHighlightAction", {
|
|
65
|
-
enumerable: true,
|
|
66
|
-
get: function get() {
|
|
67
|
-
return _CodeHighlightAction.CodeHighlightAction;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
Object.defineProperty(exports, "CodeHighlightPlugin", {
|
|
71
|
-
enumerable: true,
|
|
72
|
-
get: function get() {
|
|
73
|
-
return _CodeHighlightPlugin.CodeHighlightPlugin;
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
Object.defineProperty(exports, "Divider", {
|
|
77
|
-
enumerable: true,
|
|
78
|
-
get: function get() {
|
|
79
|
-
return _Divider.Divider;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
Object.defineProperty(exports, "DropDown", {
|
|
83
|
-
enumerable: true,
|
|
84
|
-
get: function get() {
|
|
85
|
-
return _DropDown.DropDown;
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
Object.defineProperty(exports, "DropDownItem", {
|
|
89
|
-
enumerable: true,
|
|
90
|
-
get: function get() {
|
|
91
|
-
return _DropDown.DropDownItem;
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
Object.defineProperty(exports, "FloatingLinkEditorPlugin", {
|
|
95
|
-
enumerable: true,
|
|
96
|
-
get: function get() {
|
|
97
|
-
return _FloatingLinkEditorPlugin.FloatingLinkEditorPlugin;
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
Object.defineProperty(exports, "FontColorAction", {
|
|
101
|
-
enumerable: true,
|
|
102
|
-
get: function get() {
|
|
103
|
-
return _FontColorAction.FontColorAction;
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
Object.defineProperty(exports, "FontColorPlugin", {
|
|
107
|
-
enumerable: true,
|
|
108
|
-
get: function get() {
|
|
109
|
-
return _FontColorPlugin.FontColorPlugin;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
Object.defineProperty(exports, "FontSizeAction", {
|
|
113
|
-
enumerable: true,
|
|
114
|
-
get: function get() {
|
|
115
|
-
return _FontSizeAction.FontSizeAction;
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
Object.defineProperty(exports, "HeadingEditor", {
|
|
119
|
-
enumerable: true,
|
|
120
|
-
get: function get() {
|
|
121
|
-
return _HeadingEditor.HeadingEditor;
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
Object.defineProperty(exports, "ImageAction", {
|
|
125
|
-
enumerable: true,
|
|
126
|
-
get: function get() {
|
|
127
|
-
return _ImageAction.ImageAction;
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
Object.defineProperty(exports, "ImagesPlugin", {
|
|
131
|
-
enumerable: true,
|
|
132
|
-
get: function get() {
|
|
133
|
-
return _ImagesPlugin.ImagesPlugin;
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
Object.defineProperty(exports, "ItalicAction", {
|
|
137
|
-
enumerable: true,
|
|
138
|
-
get: function get() {
|
|
139
|
-
return _ItalicAction.ItalicAction;
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
Object.defineProperty(exports, "LexicalEditorConfig", {
|
|
143
|
-
enumerable: true,
|
|
144
|
-
get: function get() {
|
|
145
|
-
return _LexicalEditorConfig.LexicalEditorConfig;
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
Object.defineProperty(exports, "LexicalHtmlRenderer", {
|
|
149
|
-
enumerable: true,
|
|
150
|
-
get: function get() {
|
|
151
|
-
return _LexicalHtmlRenderer.LexicalHtmlRenderer;
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
Object.defineProperty(exports, "LinkAction", {
|
|
155
|
-
enumerable: true,
|
|
156
|
-
get: function get() {
|
|
157
|
-
return _LinkAction.LinkAction;
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
Object.defineProperty(exports, "LinkPlugin", {
|
|
161
|
-
enumerable: true,
|
|
162
|
-
get: function get() {
|
|
163
|
-
return _LinkPlugin.LinkPlugin;
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
Object.defineProperty(exports, "ListPlugin", {
|
|
167
|
-
enumerable: true,
|
|
168
|
-
get: function get() {
|
|
169
|
-
return _ListPlugin.ListPlugin;
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
Object.defineProperty(exports, "NumberedListAction", {
|
|
173
|
-
enumerable: true,
|
|
174
|
-
get: function get() {
|
|
175
|
-
return _NumberedListAction.NumberedListAction;
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
Object.defineProperty(exports, "ParagraphEditor", {
|
|
179
|
-
enumerable: true,
|
|
180
|
-
get: function get() {
|
|
181
|
-
return _ParagraphEditor.ParagraphEditor;
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
Object.defineProperty(exports, "QuoteAction", {
|
|
185
|
-
enumerable: true,
|
|
186
|
-
get: function get() {
|
|
187
|
-
return _QuoteAction.QuoteAction;
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
Object.defineProperty(exports, "QuotePlugin", {
|
|
191
|
-
enumerable: true,
|
|
192
|
-
get: function get() {
|
|
193
|
-
return _QuoteNodePlugin.QuotePlugin;
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
Object.defineProperty(exports, "RichTextEditor", {
|
|
197
|
-
enumerable: true,
|
|
198
|
-
get: function get() {
|
|
199
|
-
return _RichTextEditor.RichTextEditor;
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
Object.defineProperty(exports, "StateHandlingPlugin", {
|
|
203
|
-
enumerable: true,
|
|
204
|
-
get: function get() {
|
|
205
|
-
return _StateHandlingPlugin.StateHandlingPlugin;
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
Object.defineProperty(exports, "StaticToolbar", {
|
|
209
|
-
enumerable: true,
|
|
210
|
-
get: function get() {
|
|
211
|
-
return _StaticToolbar.StaticToolbar;
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
Object.defineProperty(exports, "TextAlignmentAction", {
|
|
215
|
-
enumerable: true,
|
|
216
|
-
get: function get() {
|
|
217
|
-
return _TextAlignmentAction.TextAlignmentAction;
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
Object.defineProperty(exports, "Toolbar", {
|
|
221
|
-
enumerable: true,
|
|
222
|
-
get: function get() {
|
|
223
|
-
return _Toolbar.Toolbar;
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
Object.defineProperty(exports, "TypographyAction", {
|
|
227
|
-
enumerable: true,
|
|
228
|
-
get: function get() {
|
|
229
|
-
return _TypographyAction.TypographyAction;
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
Object.defineProperty(exports, "TypographyPlugin", {
|
|
233
|
-
enumerable: true,
|
|
234
|
-
get: function get() {
|
|
235
|
-
return _TypographyPlugin.TypographyPlugin;
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
Object.defineProperty(exports, "UnderlineAction", {
|
|
239
|
-
enumerable: true,
|
|
240
|
-
get: function get() {
|
|
241
|
-
return _UnderlineAction.UnderlineAction;
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
Object.defineProperty(exports, "generateInitialLexicalValue", {
|
|
245
|
-
enumerable: true,
|
|
246
|
-
get: function get() {
|
|
247
|
-
return _generateInitialLexicalValue.generateInitialLexicalValue;
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
Object.defineProperty(exports, "isValidLexicalData", {
|
|
251
|
-
enumerable: true,
|
|
252
|
-
get: function get() {
|
|
253
|
-
return _isValidLexicalData.isValidLexicalData;
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
exports.types = void 0;
|
|
257
|
-
Object.defineProperty(exports, "useLexicalEditorConfig", {
|
|
258
|
-
enumerable: true,
|
|
259
|
-
get: function get() {
|
|
260
|
-
return _LexicalEditorConfig.useLexicalEditorConfig;
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
var _LexicalHtmlRenderer = require("./components/LexicalHtmlRenderer");
|
|
264
|
-
var _hooks = require("./hooks");
|
|
265
|
-
Object.keys(_hooks).forEach(function (key) {
|
|
266
|
-
if (key === "default" || key === "__esModule") return;
|
|
267
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
268
|
-
if (key in exports && exports[key] === _hooks[key]) return;
|
|
269
|
-
Object.defineProperty(exports, key, {
|
|
270
|
-
enumerable: true,
|
|
271
|
-
get: function get() {
|
|
272
|
-
return _hooks[key];
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
});
|
|
276
|
-
var _Divider = require("./ui/Divider");
|
|
277
|
-
var _DropDown = require("./ui/DropDown");
|
|
278
|
-
var _BoldAction = require("./components/ToolbarActions/BoldAction");
|
|
279
|
-
var _BulletListAction = require("./components/ToolbarActions/BulletListAction");
|
|
280
|
-
var _CodeHighlightAction = require("./components/ToolbarActions/CodeHighlightAction");
|
|
281
|
-
var _FontSizeAction = require("./components/ToolbarActions/FontSizeAction");
|
|
282
|
-
var _FontColorAction = require("./components/ToolbarActions/FontColorAction");
|
|
283
|
-
var _ItalicAction = require("./components/ToolbarActions/ItalicAction");
|
|
284
|
-
var _LinkAction = require("./components/ToolbarActions/LinkAction");
|
|
285
|
-
var _NumberedListAction = require("./components/ToolbarActions/NumberedListAction");
|
|
286
|
-
var _QuoteAction = require("./components/ToolbarActions/QuoteAction");
|
|
287
|
-
var _UnderlineAction = require("./components/ToolbarActions/UnderlineAction");
|
|
288
|
-
var _TypographyAction = require("./components/ToolbarActions/TypographyAction");
|
|
289
|
-
var _TextAlignmentAction = require("./components/ToolbarActions/TextAlignmentAction");
|
|
290
|
-
var _ImageAction = require("./components/ToolbarActions/ImageAction");
|
|
291
|
-
var _Toolbar = require("./components/Toolbar/Toolbar");
|
|
292
|
-
var _StaticToolbar = require("./components/Toolbar/StaticToolbar");
|
|
293
|
-
var _RichTextEditor = require("./components/Editor/RichTextEditor");
|
|
294
|
-
var _HeadingEditor = require("./components/Editor/HeadingEditor");
|
|
295
|
-
var _ParagraphEditor = require("./components/Editor/ParagraphEditor");
|
|
296
|
-
var _StateHandlingPlugin = require("./plugins/StateHandlingPlugin");
|
|
297
|
-
var _LinkPlugin = require("./plugins/LinkPlugin/LinkPlugin");
|
|
298
|
-
var _FloatingLinkEditorPlugin = require("./plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin");
|
|
299
|
-
var _CodeHighlightPlugin = require("./plugins/CodeHighlightPlugin/CodeHighlightPlugin");
|
|
300
|
-
var _BlurEventPlugin = require("./plugins/BlurEventPlugin/BlurEventPlugin");
|
|
301
|
-
var _FontColorPlugin = require("./plugins/FontColorPlugin/FontColorPlugin");
|
|
302
|
-
var _TypographyPlugin = require("./plugins/TypographyPlugin/TypographyPlugin");
|
|
303
|
-
var _QuoteNodePlugin = require("./plugins/QuoteNodePlugin/QuoteNodePlugin");
|
|
304
|
-
var _ListPlugin = require("./plugins/ListPLugin/ListPlugin");
|
|
305
|
-
var _ImagesPlugin = require("./plugins/ImagesPlugin/ImagesPlugin");
|
|
306
|
-
var _generateInitialLexicalValue = require("./utils/generateInitialLexicalValue");
|
|
307
|
-
var _isValidLexicalData = require("./utils/isValidLexicalData");
|
|
308
|
-
var _commands = require("./commands");
|
|
309
|
-
Object.keys(_commands).forEach(function (key) {
|
|
310
|
-
if (key === "default" || key === "__esModule") return;
|
|
311
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
312
|
-
if (key in exports && exports[key] === _commands[key]) return;
|
|
313
|
-
Object.defineProperty(exports, key, {
|
|
314
|
-
enumerable: true,
|
|
315
|
-
get: function get() {
|
|
316
|
-
return _commands[key];
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
});
|
|
320
|
-
var _types = _interopRequireWildcard(require("./types"));
|
|
321
|
-
exports.types = _types;
|
|
322
|
-
var _LexicalEditorConfig = require("./components/LexicalEditorConfig/LexicalEditorConfig");
|
|
1
|
+
// render
|
|
2
|
+
export { LexicalHtmlRenderer } from "./components/LexicalHtmlRenderer.js";
|
|
3
|
+
// hooks
|
|
4
|
+
export * from "./hooks/index.js";
|
|
5
|
+
// UI elements
|
|
6
|
+
export { Divider } from "./ui/Divider.js";
|
|
7
|
+
export { DropDownItem } from "./ui/DropDown.js";
|
|
8
|
+
export { DropDown } from "./ui/DropDown.js";
|
|
9
|
+
// actions
|
|
10
|
+
export { BoldAction } from "./components/ToolbarActions/BoldAction.js";
|
|
11
|
+
export { BulletListAction } from "./components/ToolbarActions/BulletListAction.js";
|
|
12
|
+
export { CodeHighlightAction } from "./components/ToolbarActions/CodeHighlightAction.js";
|
|
13
|
+
export { FontColorAction } from "./components/ToolbarActions/FontColorAction.js";
|
|
14
|
+
export { ItalicAction } from "./components/ToolbarActions/ItalicAction.js";
|
|
15
|
+
export { LinkAction } from "./components/ToolbarActions/LinkAction.js";
|
|
16
|
+
export { NumberedListAction } from "./components/ToolbarActions/NumberedListAction.js";
|
|
17
|
+
export { QuoteAction } from "./components/ToolbarActions/QuoteAction.js";
|
|
18
|
+
export { UnderlineAction } from "./components/ToolbarActions/UnderlineAction.js";
|
|
19
|
+
export { TypographyAction } from "./components/ToolbarActions/TypographyAction.js";
|
|
20
|
+
export { TextAlignmentAction } from "./components/ToolbarActions/TextAlignmentAction.js";
|
|
21
|
+
export { ImageAction } from "./components/ToolbarActions/ImageAction.js";
|
|
22
|
+
// toolbars
|
|
23
|
+
export { StaticToolbar } from "./components/Toolbar/StaticToolbar.js";
|
|
24
|
+
// editor
|
|
25
|
+
export { RichTextEditor } from "./components/Editor/RichTextEditor.js";
|
|
26
|
+
// plugins
|
|
27
|
+
export { LinkPlugin } from "./plugins/LinkPlugin/LinkPlugin.js";
|
|
28
|
+
export { FloatingLinkEditorPlugin } from "./plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js";
|
|
29
|
+
export { CodeHighlightPlugin } from "./plugins/CodeHighlightPlugin/CodeHighlightPlugin.js";
|
|
30
|
+
export { BlurEventPlugin } from "./plugins/BlurEventPlugin/BlurEventPlugin.js";
|
|
31
|
+
export { FontColorPlugin } from "./plugins/FontColorPlugin/FontColorPlugin.js";
|
|
32
|
+
export { TypographyPlugin } from "./plugins/TypographyPlugin/TypographyPlugin.js";
|
|
33
|
+
export { QuotePlugin } from "./plugins/QuoteNodePlugin/QuoteNodePlugin.js";
|
|
34
|
+
export { ListPlugin } from "./plugins/ListPLugin/ListPlugin.js";
|
|
35
|
+
export { ImagesPlugin } from "./plugins/ImagesPlugin/ImagesPlugin.js";
|
|
36
|
+
export { StateHandlingPlugin } from "./plugins/StateHandlingPlugin.js";
|
|
37
|
+
// utils
|
|
38
|
+
export { isValidLexicalData } from "./utils/isValidLexicalData.js";
|
|
39
|
+
// Commands
|
|
40
|
+
export * from "./commands/index.js";
|
|
41
|
+
// types
|
|
42
|
+
export * as types from "./types.js";
|
|
43
|
+
// config
|
|
44
|
+
export { LexicalEditorConfig, useLexicalEditorConfig } from "./components/LexicalEditorConfig/LexicalEditorConfig.js";
|
|
323
45
|
|
|
324
46
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["LexicalHtmlRenderer","Divider","DropDownItem","DropDown","BoldAction","BulletListAction","CodeHighlightAction","FontColorAction","ItalicAction","LinkAction","NumberedListAction","QuoteAction","UnderlineAction","TypographyAction","TextAlignmentAction","ImageAction","StaticToolbar","RichTextEditor","LinkPlugin","FloatingLinkEditorPlugin","CodeHighlightPlugin","BlurEventPlugin","FontColorPlugin","TypographyPlugin","QuotePlugin","ListPlugin","ImagesPlugin","StateHandlingPlugin","isValidLexicalData","types","LexicalEditorConfig","useLexicalEditorConfig"],"sources":["index.ts"],"sourcesContent":["// render\nexport { LexicalHtmlRenderer } from \"~/components/LexicalHtmlRenderer.js\";\n// hooks\nexport * from \"./hooks/index.js\";\n// UI elements\nexport { Divider } from \"~/ui/Divider.js\";\nexport { DropDownItem } from \"~/ui/DropDown.js\";\nexport { DropDown } from \"~/ui/DropDown.js\";\n// actions\nexport { BoldAction } from \"~/components/ToolbarActions/BoldAction.js\";\nexport { BulletListAction } from \"~/components/ToolbarActions/BulletListAction.js\";\nexport { CodeHighlightAction } from \"~/components/ToolbarActions/CodeHighlightAction.js\";\nexport { FontColorAction } from \"~/components/ToolbarActions/FontColorAction.js\";\nexport { ItalicAction } from \"~/components/ToolbarActions/ItalicAction.js\";\nexport { LinkAction } from \"~/components/ToolbarActions/LinkAction.js\";\nexport { NumberedListAction } from \"~/components/ToolbarActions/NumberedListAction.js\";\nexport { QuoteAction } from \"~/components/ToolbarActions/QuoteAction.js\";\nexport { UnderlineAction } from \"~/components/ToolbarActions/UnderlineAction.js\";\nexport { TypographyAction } from \"~/components/ToolbarActions/TypographyAction.js\";\nexport { TextAlignmentAction } from \"~/components/ToolbarActions/TextAlignmentAction.js\";\nexport { ImageAction } from \"~/components/ToolbarActions/ImageAction.js\";\n// toolbars\nexport { StaticToolbar } from \"~/components/Toolbar/StaticToolbar.js\";\n// editor\nexport { RichTextEditor } from \"~/components/Editor/RichTextEditor.js\";\n// plugins\nexport { LinkPlugin } from \"~/plugins/LinkPlugin/LinkPlugin.js\";\nexport { FloatingLinkEditorPlugin } from \"~/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js\";\nexport { CodeHighlightPlugin } from \"~/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js\";\nexport { BlurEventPlugin } from \"~/plugins/BlurEventPlugin/BlurEventPlugin.js\";\nexport { FontColorPlugin } from \"~/plugins/FontColorPlugin/FontColorPlugin.js\";\nexport { TypographyPlugin } from \"~/plugins/TypographyPlugin/TypographyPlugin.js\";\nexport { QuotePlugin } from \"~/plugins/QuoteNodePlugin/QuoteNodePlugin.js\";\nexport { ListPlugin } from \"~/plugins/ListPLugin/ListPlugin.js\";\nexport { ImagesPlugin } from \"~/plugins/ImagesPlugin/ImagesPlugin.js\";\nexport { StateHandlingPlugin } from \"~/plugins/StateHandlingPlugin.js\";\n// utils\nexport { isValidLexicalData } from \"~/utils/isValidLexicalData.js\";\n// Commands\nexport * from \"~/commands/index.js\";\n// types\nexport * as types from \"./types.js\";\n// config\nexport {\n LexicalEditorConfig,\n useLexicalEditorConfig\n} from \"~/components/LexicalEditorConfig/LexicalEditorConfig.js\";\n"],"mappings":"AAAA;AACA,SAASA,mBAAmB;AAC5B;AACA;AACA;AACA,SAASC,OAAO;AAChB,SAASC,YAAY;AACrB,SAASC,QAAQ;AACjB;AACA,SAASC,UAAU;AACnB,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,eAAe;AACxB,SAASC,YAAY;AACrB,SAASC,UAAU;AACnB,SAASC,kBAAkB;AAC3B,SAASC,WAAW;AACpB,SAASC,eAAe;AACxB,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,WAAW;AACpB;AACA,SAASC,aAAa;AACtB;AACA,SAASC,cAAc;AACvB;AACA,SAASC,UAAU;AACnB,SAASC,wBAAwB;AACjC,SAASC,mBAAmB;AAC5B,SAASC,eAAe;AACxB,SAASC,eAAe;AACxB,SAASC,gBAAgB;AACzB,SAASC,WAAW;AACpB,SAASC,UAAU;AACnB,SAASC,YAAY;AACrB,SAASC,mBAAmB;AAC5B;AACA,SAASC,kBAAkB;AAC3B;AACA;AACA;AACA,OAAO,KAAKC,KAAK;AACjB;AACA,SACIC,mBAAmB,EACnBC,sBAAsB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,40 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/lexical-editor",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.45.0-beta.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"repository": {
|
|
5
6
|
"type": "git",
|
|
6
7
|
"url": "https://github.com/webiny/webiny-js.git"
|
|
7
8
|
},
|
|
8
9
|
"license": "MIT",
|
|
9
10
|
"dependencies": {
|
|
10
|
-
"@
|
|
11
|
-
"@lexical/code": "0.
|
|
12
|
-
"@lexical/history": "0.
|
|
13
|
-
"@lexical/react": "0.
|
|
14
|
-
"@lexical/rich-text": "0.
|
|
15
|
-
"@lexical/selection": "0.
|
|
16
|
-
"@lexical/text": "0.
|
|
17
|
-
"@lexical/utils": "0.
|
|
18
|
-
"@webiny/lexical-nodes": "5.
|
|
19
|
-
"@webiny/lexical-theme": "5.
|
|
20
|
-
"@webiny/react-composition": "5.
|
|
21
|
-
"@webiny/react-properties": "5.
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"lodash": "4.17.21",
|
|
11
|
+
"@floating-ui/dom": "1.7.5",
|
|
12
|
+
"@lexical/code": "0.40.0",
|
|
13
|
+
"@lexical/history": "0.40.0",
|
|
14
|
+
"@lexical/react": "0.40.0",
|
|
15
|
+
"@lexical/rich-text": "0.40.0",
|
|
16
|
+
"@lexical/selection": "0.40.0",
|
|
17
|
+
"@lexical/text": "0.40.0",
|
|
18
|
+
"@lexical/utils": "0.40.0",
|
|
19
|
+
"@webiny/lexical-nodes": "5.45.0-beta.0",
|
|
20
|
+
"@webiny/lexical-theme": "5.45.0-beta.0",
|
|
21
|
+
"@webiny/react-composition": "5.45.0-beta.0",
|
|
22
|
+
"@webiny/react-properties": "5.45.0-beta.0",
|
|
23
|
+
"lexical": "0.40.0",
|
|
24
|
+
"lodash": "4.17.23",
|
|
25
25
|
"react": "18.2.0",
|
|
26
26
|
"react-dom": "18.2.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@webiny/
|
|
29
|
+
"@webiny/build-tools": "5.45.0-beta.0"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public",
|
|
33
33
|
"directory": "dist"
|
|
34
34
|
},
|
|
35
|
-
"
|
|
36
|
-
"build": "node ../cli/bin.js run build",
|
|
37
|
-
"watch": "node ../cli/bin.js run watch"
|
|
38
|
-
},
|
|
39
|
-
"gitHead": "c80e6d88501ac84229f6577dee7b30163a906379"
|
|
35
|
+
"gitHead": "b85c33cfbe7c02c130445c918d913ef4b2c09cb2"
|
|
40
36
|
}
|
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
var editorState = editor.getEditorState();
|
|
18
|
-
onBlur(JSON.stringify(editorState.toJSON()));
|
|
19
|
-
}
|
|
20
|
-
return false;
|
|
21
|
-
}, _lexical.COMMAND_PRIORITY_LOW);
|
|
22
|
-
}, []);
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { BLUR_COMMAND, COMMAND_PRIORITY_LOW } from "lexical";
|
|
3
|
+
import { useRichTextEditor } from "../../hooks/index.js";
|
|
4
|
+
export const BlurEventPlugin = ({
|
|
5
|
+
onBlur
|
|
6
|
+
}) => {
|
|
7
|
+
const {
|
|
8
|
+
editor
|
|
9
|
+
} = useRichTextEditor();
|
|
10
|
+
useEffect(() => editor.registerCommand(BLUR_COMMAND, () => {
|
|
11
|
+
if (typeof onBlur === "function") {
|
|
12
|
+
const editorState = editor.getEditorState();
|
|
13
|
+
onBlur(JSON.stringify(editorState.toJSON()));
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
}, COMMAND_PRIORITY_LOW), []);
|
|
23
17
|
return null;
|
|
24
18
|
};
|
|
25
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useEffect","BLUR_COMMAND","COMMAND_PRIORITY_LOW","useRichTextEditor","BlurEventPlugin","onBlur","editor","registerCommand","editorState","getEditorState","JSON","stringify","toJSON"],"sources":["BlurEventPlugin.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useEffect } from \"react\";\nimport { BLUR_COMMAND, COMMAND_PRIORITY_LOW } from \"lexical\";\nimport type { LexicalValue } from \"~/types.js\";\nimport { useRichTextEditor } from \"~/hooks/index.js\";\n\ninterface BlurEventPlugin {\n onBlur?: (editorState: LexicalValue) => void;\n}\n\nexport const BlurEventPlugin: FC<BlurEventPlugin> = ({ onBlur }) => {\n const { editor } = useRichTextEditor();\n\n useEffect(\n () =>\n editor.registerCommand(\n BLUR_COMMAND,\n () => {\n if (typeof onBlur === \"function\") {\n const editorState = editor.getEditorState();\n onBlur(JSON.stringify(editorState.toJSON()));\n }\n return false;\n },\n COMMAND_PRIORITY_LOW\n ),\n []\n );\n return null;\n};\n"],"mappings":"AACA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,YAAY,EAAEC,oBAAoB,QAAQ,SAAS;AAE5D,SAASC,iBAAiB;AAM1B,OAAO,MAAMC,eAAoC,GAAGA,CAAC;EAAEC;AAAO,CAAC,KAAK;EAChE,MAAM;IAAEC;EAAO,CAAC,GAAGH,iBAAiB,CAAC,CAAC;EAEtCH,SAAS,CACL,MACIM,MAAM,CAACC,eAAe,CAClBN,YAAY,EACZ,MAAM;IACF,IAAI,OAAOI,MAAM,KAAK,UAAU,EAAE;MAC9B,MAAMG,WAAW,GAAGF,MAAM,CAACG,cAAc,CAAC,CAAC;MAC3CJ,MAAM,CAACK,IAAI,CAACC,SAAS,CAACH,WAAW,CAACI,MAAM,CAAC,CAAC,CAAC,CAAC;IAChD;IACA,OAAO,KAAK;EAChB,CAAC,EACDV,oBACJ,CAAC,EACL,EACJ,CAAC;EACD,OAAO,IAAI;AACf,CAAC","ignoreList":[]}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function CodeHighlightPlugin() {
|
|
11
|
-
var _useRichTextEditor = (0, _hooks.useRichTextEditor)(),
|
|
12
|
-
editor = _useRichTextEditor.editor;
|
|
13
|
-
(0, _react.useEffect)(function () {
|
|
14
|
-
return (0, _code.registerCodeHighlighting)(editor);
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { registerCodeHighlighting } from "@lexical/code";
|
|
3
|
+
import { useRichTextEditor } from "../../hooks/index.js";
|
|
4
|
+
export function CodeHighlightPlugin() {
|
|
5
|
+
const {
|
|
6
|
+
editor
|
|
7
|
+
} = useRichTextEditor();
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
return registerCodeHighlighting(editor);
|
|
15
10
|
}, [editor]);
|
|
16
11
|
return null;
|
|
17
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useEffect","registerCodeHighlighting","useRichTextEditor","CodeHighlightPlugin","editor"],"sources":["CodeHighlightPlugin.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport { registerCodeHighlighting } from \"@lexical/code\";\nimport { useRichTextEditor } from \"~/hooks/index.js\";\n\nexport function CodeHighlightPlugin() {\n const { editor } = useRichTextEditor();\n useEffect(() => {\n return registerCodeHighlighting(editor);\n }, [editor]);\n return null;\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,wBAAwB,QAAQ,eAAe;AACxD,SAASC,iBAAiB;AAE1B,OAAO,SAASC,mBAAmBA,CAAA,EAAG;EAClC,MAAM;IAAEC;EAAO,CAAC,GAAGF,iBAAiB,CAAC,CAAC;EACtCF,SAAS,CAAC,MAAM;IACZ,OAAOC,wBAAwB,CAACG,MAAM,CAAC;EAC3C,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EACZ,OAAO,IAAI;AACf","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./CodeHighlightPlugin";
|
|
1
|
+
export * from "./CodeHighlightPlugin.js";
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _CodeHighlightPlugin = require("./CodeHighlightPlugin");
|
|
7
|
-
Object.keys(_CodeHighlightPlugin).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _CodeHighlightPlugin[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _CodeHighlightPlugin[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
1
|
+
export * from "./CodeHighlightPlugin.js";
|
|
17
2
|
|
|
18
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CodeHighlightPlugin.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { LexicalEditor } from "lexical";
|
|
3
|
+
import { LinkFormProps } from "./types.js";
|
|
4
|
+
interface FloatingLinkEditorProps {
|
|
5
|
+
editor: LexicalEditor;
|
|
6
|
+
isVisible: boolean;
|
|
7
|
+
LinkForm: React.FunctionComponent<LinkFormProps>;
|
|
8
|
+
}
|
|
9
|
+
export declare function FloatingLinkEditor({ editor, isVisible, LinkForm }: FloatingLinkEditorProps): React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useFloatingLinkEditor } from "./useFloatingLinkEditor.js";
|
|
3
|
+
export function FloatingLinkEditor({
|
|
4
|
+
editor,
|
|
5
|
+
isVisible,
|
|
6
|
+
LinkForm
|
|
7
|
+
}) {
|
|
8
|
+
const {
|
|
9
|
+
editorRef,
|
|
10
|
+
linkData,
|
|
11
|
+
applyChanges,
|
|
12
|
+
removeLink
|
|
13
|
+
} = useFloatingLinkEditor(editor);
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
ref: editorRef,
|
|
16
|
+
className: "z-dialog absolute link-editor",
|
|
17
|
+
style: {
|
|
18
|
+
opacity: isVisible ? 1 : 0,
|
|
19
|
+
pointerEvents: isVisible ? "auto" : "none"
|
|
20
|
+
}
|
|
21
|
+
}, isVisible ? /*#__PURE__*/React.createElement(LinkForm, {
|
|
22
|
+
linkData: linkData,
|
|
23
|
+
onSave: applyChanges,
|
|
24
|
+
removeLink: removeLink
|
|
25
|
+
}) : null);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=FloatingLinkEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useFloatingLinkEditor","FloatingLinkEditor","editor","isVisible","LinkForm","editorRef","linkData","applyChanges","removeLink","createElement","ref","className","style","opacity","pointerEvents","onSave"],"sources":["FloatingLinkEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport type { LexicalEditor } from \"lexical\";\nimport { LinkFormProps } from \"./types.js\";\nimport { useFloatingLinkEditor } from \"./useFloatingLinkEditor.js\";\n\ninterface FloatingLinkEditorProps {\n editor: LexicalEditor;\n isVisible: boolean;\n LinkForm: React.FunctionComponent<LinkFormProps>;\n}\n\nexport function FloatingLinkEditor({ editor, isVisible, LinkForm }: FloatingLinkEditorProps) {\n const { editorRef, linkData, applyChanges, removeLink } = useFloatingLinkEditor(editor);\n\n return (\n <div\n ref={editorRef}\n className=\"z-dialog absolute link-editor\"\n style={{ opacity: isVisible ? 1 : 0, pointerEvents: isVisible ? \"auto\" : \"none\" }}\n >\n {isVisible ? (\n <LinkForm linkData={linkData} onSave={applyChanges} removeLink={removeLink} />\n ) : null}\n </div>\n );\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,SAASC,qBAAqB;AAQ9B,OAAO,SAASC,kBAAkBA,CAAC;EAAEC,MAAM;EAAEC,SAAS;EAAEC;AAAkC,CAAC,EAAE;EACzF,MAAM;IAAEC,SAAS;IAAEC,QAAQ;IAAEC,YAAY;IAAEC;EAAW,CAAC,GAAGR,qBAAqB,CAACE,MAAM,CAAC;EAEvF,oBACIH,KAAA,CAAAU,aAAA;IACIC,GAAG,EAAEL,SAAU;IACfM,SAAS,EAAC,+BAA+B;IACzCC,KAAK,EAAE;MAAEC,OAAO,EAAEV,SAAS,GAAG,CAAC,GAAG,CAAC;MAAEW,aAAa,EAAEX,SAAS,GAAG,MAAM,GAAG;IAAO;EAAE,GAEjFA,SAAS,gBACNJ,KAAA,CAAAU,aAAA,CAACL,QAAQ;IAACE,QAAQ,EAAEA,QAAS;IAACS,MAAM,EAAER,YAAa;IAACC,UAAU,EAAEA;EAAW,CAAE,CAAC,GAC9E,IACH,CAAC;AAEd","ignoreList":[]}
|