@baishuyun/ui-base 6.9.0 → 6.10.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/dist/Amap/AmapCircle/index.js +1 -1
- package/dist/Amap/AmapMarker/index.js +1 -1
- package/dist/Amap/AmapMarkerCluster/index.js +1 -1
- package/dist/Amap/AmapProvider/index.js +1 -1
- package/dist/Amap/hooks/index.js +1 -1
- package/dist/Amap/index.js +1 -1
- package/dist/Calendar/{AllDaySection-a96dIzs3.js → AllDaySection-DNsVyixx.js} +3 -3
- package/dist/Calendar/{Calendar-MghsGFZ0.js → Calendar-DL2X3z_z.js} +11 -11
- package/dist/Calendar/{CurrentTimeIndicator-CNKsVEXH.js → CurrentTimeIndicator-twXtFHIp.js} +1 -1
- package/dist/Calendar/{EventCard-B1LoBxth.js → EventCard-CvEnWcKd.js} +3 -3
- package/dist/Calendar/{TimeGrid-DIw8oCqY.js → TimeGrid-D62R57Bo.js} +1 -1
- package/dist/Calendar/context/index.js +2 -2
- package/dist/Calendar/index.js +17 -17
- package/dist/Calendar/subcomponents/AllDaySection/index.js +7 -7
- package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +5 -5
- package/dist/Calendar/subcomponents/EventCard/index.js +6 -6
- package/dist/Calendar/subcomponents/TimeAxis/index.js +4 -4
- package/dist/Calendar/subcomponents/TimeGrid/index.js +3 -3
- package/dist/Calendar/{theme-xnrMsnkg.js → theme-BRVmxhqD.js} +2 -2
- package/dist/Calendar/utils/index.js +4 -4
- package/dist/Calendar/utils/layout/index.js +3 -3
- package/dist/Calendar/utils/theme/index.js +2 -2
- package/dist/Card/index.js +1 -1
- package/dist/CheckBox/{CheckBox-nBm0u6zX.js → CheckBox-CcM19LnP.js} +1 -1
- package/dist/CheckBox/index.js +3 -3
- package/dist/ColorPicker/ColorPicker-D3JuQ7a7.js +153 -0
- package/dist/ColorPicker/index.js +3 -4
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/DatePicker/{DatePicker-uizefM92.js → DatePicker-Dah_CjYG.js} +5 -5
- package/dist/DatePicker/{DatePickerPanel-bbGVwlo7.js → DatePickerPanel-Bz3uvbYF.js} +3 -3
- package/dist/DatePicker/index.js +6 -6
- package/dist/DatePicker/style/index.js +2 -2
- package/dist/DatePicker/{style-CNtPPsZp.js → style-BwmM26RP.js} +1 -1
- package/dist/DropDown/{DropDown-yDH9V_9Y.js → DropDown-Daxr9BYf.js} +7 -7
- package/dist/DropDown/index.js +8 -8
- package/dist/DropDown/style/index.js +2 -2
- package/dist/DropDown/{style-Fdp-U4md.js → style-BSgosymi.js} +1 -1
- package/dist/Editor/Buttons-DG_-Sg_C.js +600 -0
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +12 -13
- package/dist/Editor/constants/index.js +1 -1
- package/dist/Editor/index.js +194 -180
- package/dist/Gantt/GanttChart/index.js +15 -15
- package/dist/Gantt/{GanttChart-CDw1IQ4F.js → GanttChart-6gpw5vi6.js} +22 -24
- package/dist/Gantt/GanttTable/index.js +9 -9
- package/dist/Gantt/{GanttTable-xbXD_PWI.js → GanttTable-lVu-YUtt.js} +5 -5
- package/dist/Gantt/GanttToolBar/index.js +11 -11
- package/dist/Gantt/{GanttToolBar-BTeTsR6Z.js → GanttToolBar-CarBWZg-.js} +2 -2
- package/dist/Gantt/{collapseKeys-B4SOVHjd.js → collapseKeys-_ShTXPKt.js} +2 -2
- package/dist/Gantt/index.js +23 -23
- package/dist/Gantt/{theme-DLNvgM9X.js → theme-CiMD9Y6i.js} +1 -1
- package/dist/Gantt/{timelineViewConfig-9HArvbmb.js → timelineViewConfig-CLIpppp0.js} +1 -1
- package/dist/Gantt/utils/index.js +6 -6
- package/dist/Gantt/utils/theme/index.js +2 -2
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/{InputTag-hzCCJQ1z.js → InputTag-DxPO0DwD.js} +1 -1
- package/dist/InputTag/index.js +3 -3
- package/dist/Loading/index.js +2 -2
- package/dist/Modal/index.js +1 -1
- package/dist/NotFoundContent/index.js +2 -2
- package/dist/Radio/index.js +2 -2
- package/dist/ScrollBar/{ScrollBar-QhXVe8zd.js → ScrollBar-CnwYQfXM.js} +1 -1
- package/dist/ScrollBar/index.js +2 -2
- package/dist/Segmented/{Segmented-BDz1hMDT.js → Segmented-Ck2ZmfF7.js} +1 -1
- package/dist/Segmented/index.js +2 -2
- package/dist/Select/{Select-D6EK7whJ.js → Select-CBI5PgeQ.js} +10 -8
- package/dist/Select/index.js +11 -11
- package/dist/Table/{Table-yQXQEk6d.js → Table-CL-KfNY3.js} +4 -4
- package/dist/Table/hooks/index.js +2 -2
- package/dist/Table/{hooks-BceUZQQm.js → hooks-uCDY9dqx.js} +1 -1
- package/dist/Table/index.js +6 -6
- package/dist/Table/{processRowspan-B0WELhG2.js → processRowspan-nIGqGyHh.js} +1 -1
- package/dist/Table/style/index.js +2 -2
- package/dist/Table/{style-DgiPEsSp.js → style-x9xfw6te.js} +1 -1
- package/dist/Table/utils/index.js +2 -2
- package/dist/Tabs/Tabs-B1RsYb2W.js +409 -0
- package/dist/Tabs/index.js +3 -4
- package/dist/Tooltip/{Tooltip-Ch9lti_7.js → Tooltip-DWWWYn1a.js} +1 -1
- package/dist/Tooltip/index.js +2 -2
- package/dist/Tree/index.js +4 -4
- package/dist/Tree/utils/index.js +1 -1
- package/dist/components/ColorPicker/ColorPalettes.d.ts +1 -8
- package/dist/components/ColorPicker/ColorPicker.type.d.ts +5 -2
- package/dist/components/ColorPicker/constants.d.ts +3 -1
- package/dist/components/ColorPicker/index.d.ts +1 -1
- package/dist/components/Editor/ToolbarPlugin/Buttons/PictureButton/UploadImage.d.ts +5 -4
- package/dist/components/Editor/plugins/LinkColorPlugin.d.ts +2 -0
- package/dist/index.js +36 -37
- package/dist/style.css +1 -1
- package/dist/vendors/{Tree-DXmVRDn0.js → Tree-D1s-eADo.js} +2 -2
- package/dist/vendors/{version-D76DufO-.js → version-L-kG2La0.js} +1 -1
- package/package.json +1 -1
- package/dist/ColorPicker/ColorPicker-t1uBeATW.js +0 -155
- package/dist/Editor/Buttons-BhStZyIa.js +0 -620
- package/dist/Tabs/Tabs-BiKW70CL.js +0 -398
- package/dist/vendors/color-D6XBXROa.js +0 -12
- /package/dist/Calendar/{TimeAxis-C9e2BdYs.js → TimeAxis-D7bgZDKs.js} +0 -0
- /package/dist/Calendar/{colorUtils-CBLTsDX0.js → colorUtils-lXNjGoCk.js} +0 -0
- /package/dist/Calendar/{context-4tCN5X33.js → context-CBJnz0IH.js} +0 -0
- /package/dist/Calendar/{layout-Dz-grtu9.js → layout-BglMom3m.js} +0 -0
- /package/dist/CheckBox/{CheckBox-ByWSy9Yr.js → CheckBox-Bb0UuX1Y.js} +0 -0
- /package/dist/DatePicker/{ensureDayjsPlugins-Cn9Bkjkj.js → ensureDayjsPlugins-CVL-fnAl.js} +0 -0
- /package/dist/DatePicker/{pickerLocale-BRnNjLcv.js → pickerLocale-BeMlfhKu.js} +0 -0
- /package/dist/Gantt/{GanttHighlightContext-ChThr8ia.js → GanttHighlightContext-grda5bhd.js} +0 -0
- /package/dist/Gantt/{columnResize-jG0Wy2PC.js → columnResize-DV1tSBx_.js} +0 -0
- /package/dist/Gantt/{constants-LIz5jwed.js → constants-BObDP0h6.js} +0 -0
- /package/dist/Gantt/{highlightTarget-BpkYTonb.js → highlightTarget-DrP0_NrM.js} +0 -0
- /package/dist/Loading/{Loading-DiywS7ex.js → Loading-CVyzO5-s.js} +0 -0
- /package/dist/NotFoundContent/{NotFoundContent-BLmzWNBi.js → NotFoundContent-J-TEnljc.js} +0 -0
- /package/dist/Radio/{Radio-CX9cUqb7.js → Radio-CBUZ7DB5.js} +0 -0
- /package/dist/Select/{SelectInputSearch-COUzreau.js → SelectInputSearch-CrGW_eVo.js} +0 -0
- /package/dist/Table/{constants-kRpjsoet.js → constants-CcwjDbe7.js} +0 -0
- /package/dist/vendors/{animations-rwUbyoT0.js → animations-Mlw78WYo.js} +0 -0
- /package/dist/vendors/{cssVars-BYg1matG.js → cssVars-B8o94Yao.js} +0 -0
- /package/dist/vendors/{mergeRefs-Bsywq1Vo.js → mergeRefs-Bai1cIzv.js} +0 -0
- /package/dist/vendors/{useFloatingPortal-CmVJbuRm.js → useFloatingPortal-C8V67X0v.js} +0 -0
- /package/dist/vendors/{useLatchedPopupPortalRoot-4fVhqVT4.js → useLatchedPopupPortalRoot-hwf14FJ5.js} +0 -0
package/dist/Editor/index.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import "../vendors/version-
|
|
1
|
+
import "../vendors/version-L-kG2La0.js";
|
|
2
2
|
import "../ScrollBar/style-D26azwz6.js";
|
|
3
3
|
import "../Icon/Icon-BBDcb-yw.js";
|
|
4
4
|
import "../vendors/LocaleContext-Dcw6C1LX.js";
|
|
5
5
|
import "../Modal/Modal-LiztSF7x.js";
|
|
6
|
-
import "../ColorPicker/ColorPicker-
|
|
6
|
+
import "../ColorPicker/ColorPicker-D3JuQ7a7.js";
|
|
7
7
|
import "../vendors/useFloatingOverlay-BApqkHSu.js";
|
|
8
8
|
import "../vendors/useLocale-BKZX2_zw.js";
|
|
9
|
-
import "../vendors/
|
|
10
|
-
import "../vendors/
|
|
11
|
-
import
|
|
12
|
-
import "../
|
|
13
|
-
import "../CheckBox/CheckBox-
|
|
14
|
-
import "../
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import "../
|
|
18
|
-
import "../DropDown/
|
|
19
|
-
import "
|
|
20
|
-
import { a as t, c as n, d as r, i, l as a, n as o, o as s, r as c, s as l, u } from "./Buttons-BhStZyIa.js";
|
|
9
|
+
import "../vendors/useLatchedPopupPortalRoot-hwf14FJ5.js";
|
|
10
|
+
import { t as e } from "../vendors/cssVars-B8o94Yao.js";
|
|
11
|
+
import "../Select/SelectInputSearch-CrGW_eVo.js";
|
|
12
|
+
import "../CheckBox/CheckBox-Bb0UuX1Y.js";
|
|
13
|
+
import "../CheckBox/CheckBox-CcM19LnP.js";
|
|
14
|
+
import "../NotFoundContent/NotFoundContent-J-TEnljc.js";
|
|
15
|
+
import "../ScrollBar/ScrollBar-CnwYQfXM.js";
|
|
16
|
+
import "../vendors/useFloatingPortal-C8V67X0v.js";
|
|
17
|
+
import "../DropDown/DropDown-Daxr9BYf.js";
|
|
18
|
+
import "../DropDown/style-BSgosymi.js";
|
|
19
|
+
import { a as t, c as n, d as r, i, l as a, n as o, o as s, r as c, s as l, u } from "./Buttons-DG_-Sg_C.js";
|
|
21
20
|
import { DEFAULT_BACKGROUND_COLOR as d, DEFAULT_FONT_COLOR as f, DEFAULT_FONT_SIZE as p } from "./constants/index.js";
|
|
22
21
|
import { omit as m } from "lodash-es";
|
|
23
22
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
@@ -30,11 +29,11 @@ import { HistoryPlugin as te } from "@lexical/react/LexicalHistoryPlugin";
|
|
|
30
29
|
import { OnChangePlugin as ne } from "@lexical/react/LexicalOnChangePlugin";
|
|
31
30
|
import { LexicalErrorBoundary as D } from "@lexical/react/LexicalErrorBoundary";
|
|
32
31
|
import { $generateHtmlFromNodes as re, $generateNodesFromDOM as ie } from "@lexical/html";
|
|
33
|
-
import { $applyNodeReplacement as O, $createParagraphNode as k, $getNodeByKey as A, $getRoot as
|
|
34
|
-
import { useLexicalComposerContext as
|
|
35
|
-
import { $getSelectionStyleValueForProperty as
|
|
36
|
-
import { $findMatchingParent as
|
|
37
|
-
import { $isLinkNode as
|
|
32
|
+
import { $applyNodeReplacement as O, $createParagraphNode as k, $getNodeByKey as A, $getRoot as ae, $getRoot as j, $getSelection as M, $insertNodes as N, $isElementNode as oe, $isRangeSelection as P, $isRootOrShadowRoot as se, $isTextNode as ce, COMMAND_PRIORITY_EDITOR as le, COMMAND_PRIORITY_LOW as ue, DecoratorNode as de, KEY_ENTER_COMMAND as fe, RootNode as pe, TextNode as F } from "lexical";
|
|
33
|
+
import { useLexicalComposerContext as me, useLexicalComposerContext as I } from "@lexical/react/LexicalComposerContext";
|
|
34
|
+
import { $getSelectionStyleValueForProperty as L, $patchStyleText as R, $trimTextContentFromAnchor as z } from "@lexical/selection";
|
|
35
|
+
import { $findMatchingParent as B, $restoreEditorState as he } from "@lexical/utils";
|
|
36
|
+
import { $isLinkNode as V, AutoLinkNode as ge, LinkNode as _e } from "@lexical/link";
|
|
38
37
|
import { useLexicalEditable as ve } from "@lexical/react/useLexicalEditable";
|
|
39
38
|
import { LinkPlugin as ye } from "@lexical/react/LexicalLinkPlugin";
|
|
40
39
|
//#region src/components/Editor/utils/resolveEditorToolbarThemeVars.ts
|
|
@@ -70,7 +69,7 @@ var H = (e) => {
|
|
|
70
69
|
//#endregion
|
|
71
70
|
//#region src/components/Editor/hooks/useTextFormatsState.ts
|
|
72
71
|
function Ce() {
|
|
73
|
-
let [e] =
|
|
72
|
+
let [e] = I(), [t, n] = C({
|
|
74
73
|
bold: !1,
|
|
75
74
|
italic: !1,
|
|
76
75
|
underline: !1,
|
|
@@ -82,14 +81,14 @@ function Ce() {
|
|
|
82
81
|
});
|
|
83
82
|
return b(() => e.registerUpdateListener(({ editorState: e }) => {
|
|
84
83
|
e.read(() => {
|
|
85
|
-
let e =
|
|
86
|
-
if (
|
|
87
|
-
let t =
|
|
84
|
+
let e = M();
|
|
85
|
+
if (P(e)) {
|
|
86
|
+
let t = L(e, "font-size", p), r = L(e, "color", f), i = L(e, "background-color", d), a = e.anchor.getNode(), o = a.getKey() === "root" ? a : B(a, (e) => {
|
|
88
87
|
let t = e.getParent();
|
|
89
|
-
return t !== null &&
|
|
88
|
+
return t !== null && se(t);
|
|
90
89
|
});
|
|
91
90
|
o === null && (o = a.getTopLevelElementOrThrow());
|
|
92
|
-
let s = {}, c =
|
|
91
|
+
let s = {}, c = B(a, V);
|
|
93
92
|
c ? (s.link = c.getURL(), s.linkText = c.getTextContent(), s.newBlank = c.getTarget() === "_blank") : s.linkText = e.getTextContent(), n({
|
|
94
93
|
bold: e.hasFormat("bold"),
|
|
95
94
|
italic: e.hasFormat("italic"),
|
|
@@ -97,7 +96,7 @@ function Ce() {
|
|
|
97
96
|
fontSize: t,
|
|
98
97
|
fontColor: r,
|
|
99
98
|
backgroundColor: i,
|
|
100
|
-
align:
|
|
99
|
+
align: oe(o) ? o.getFormatType() : "left",
|
|
101
100
|
link: s
|
|
102
101
|
});
|
|
103
102
|
}
|
|
@@ -145,13 +144,106 @@ var we = (e) => {
|
|
|
145
144
|
}) })
|
|
146
145
|
});
|
|
147
146
|
}, W = {
|
|
148
|
-
"bsy-lexical-editor": "_bsy-lexical-
|
|
149
|
-
"bsy-lexical-editor--floating": "_bsy-lexical-editor--
|
|
150
|
-
"bsy-lexical-editor__content-editable": "_bsy-lexical-editor__content-
|
|
151
|
-
"bsy-lexical-editor__content-editable--with-length-badge": "_bsy-lexical-editor__content-editable--with-length-
|
|
152
|
-
"bsy-lexical-editor__length-badge": "_bsy-lexical-editor__length-
|
|
153
|
-
"bsy-lexical-editor__length-badge--exceeded": "_bsy-lexical-editor__length-badge--
|
|
154
|
-
}, G = {
|
|
147
|
+
"bsy-lexical-editor": "_bsy-lexical-editor_1bhfo_1",
|
|
148
|
+
"bsy-lexical-editor--floating": "_bsy-lexical-editor--floating_1bhfo_7",
|
|
149
|
+
"bsy-lexical-editor__content-editable": "_bsy-lexical-editor__content-editable_1bhfo_10",
|
|
150
|
+
"bsy-lexical-editor__content-editable--with-length-badge": "_bsy-lexical-editor__content-editable--with-length-badge_1bhfo_17",
|
|
151
|
+
"bsy-lexical-editor__length-badge": "_bsy-lexical-editor__length-badge_1bhfo_20",
|
|
152
|
+
"bsy-lexical-editor__length-badge--exceeded": "_bsy-lexical-editor__length-badge--exceeded_1bhfo_36"
|
|
153
|
+
}, G = class e extends F {
|
|
154
|
+
constructor(e, t) {
|
|
155
|
+
super(e, t);
|
|
156
|
+
}
|
|
157
|
+
static getType() {
|
|
158
|
+
return "extended-text";
|
|
159
|
+
}
|
|
160
|
+
static clone(t) {
|
|
161
|
+
return new e(t.__text, t.__key);
|
|
162
|
+
}
|
|
163
|
+
static importDOM() {
|
|
164
|
+
let e = F.importDOM();
|
|
165
|
+
return {
|
|
166
|
+
...e,
|
|
167
|
+
code: () => ({
|
|
168
|
+
conversion: K(e?.code),
|
|
169
|
+
priority: 1
|
|
170
|
+
}),
|
|
171
|
+
em: () => ({
|
|
172
|
+
conversion: K(e?.em),
|
|
173
|
+
priority: 1
|
|
174
|
+
}),
|
|
175
|
+
span: () => ({
|
|
176
|
+
conversion: K(e?.span),
|
|
177
|
+
priority: 1
|
|
178
|
+
}),
|
|
179
|
+
strong: () => ({
|
|
180
|
+
conversion: K(e?.strong),
|
|
181
|
+
priority: 1
|
|
182
|
+
}),
|
|
183
|
+
sub: () => ({
|
|
184
|
+
conversion: K(e?.sub),
|
|
185
|
+
priority: 1
|
|
186
|
+
}),
|
|
187
|
+
sup: () => ({
|
|
188
|
+
conversion: K(e?.sup),
|
|
189
|
+
priority: 1
|
|
190
|
+
})
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
static importJSON(e) {
|
|
194
|
+
return Ee().updateFromJSON(e);
|
|
195
|
+
}
|
|
196
|
+
isSimpleText() {
|
|
197
|
+
return this.__type === "extended-text" && this.__mode === 0;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
function Ee(e = "") {
|
|
201
|
+
return O(new G(e));
|
|
202
|
+
}
|
|
203
|
+
function K(e) {
|
|
204
|
+
return (t) => {
|
|
205
|
+
let n = e?.(t);
|
|
206
|
+
if (!n) return null;
|
|
207
|
+
let r = n.conversion(t);
|
|
208
|
+
if (!r) return r;
|
|
209
|
+
let i = t.style.backgroundColor, a = t.style.color, o = t.style.fontFamily, s = t.style.fontWeight, c = t.style.fontSize, l = t.style.textDecoration;
|
|
210
|
+
return {
|
|
211
|
+
...r,
|
|
212
|
+
forChild: (e, t) => {
|
|
213
|
+
let n = (r?.forChild ?? ((e) => e))(e, t);
|
|
214
|
+
if (ce(n)) {
|
|
215
|
+
let e = [
|
|
216
|
+
i ? `background-color: ${i}` : null,
|
|
217
|
+
a ? `color: ${a}` : null,
|
|
218
|
+
o ? `font-family: ${o}` : null,
|
|
219
|
+
s ? `font-weight: ${s}` : null,
|
|
220
|
+
c ? `font-size: ${c}` : null,
|
|
221
|
+
l ? `text-decoration: ${l}` : null
|
|
222
|
+
].filter((e) => e !== null).join("; ");
|
|
223
|
+
if (e.length) return n.setStyle(e);
|
|
224
|
+
}
|
|
225
|
+
return n;
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/components/Editor/plugins/LinkColorPlugin.tsx
|
|
232
|
+
function De(e) {
|
|
233
|
+
return e.split(";").map((e) => e.trim()).filter((e) => e && e.split(":")[0].trim().toLowerCase() !== "color").join("; ");
|
|
234
|
+
}
|
|
235
|
+
function Oe(e) {
|
|
236
|
+
if (!B(e, V)) return;
|
|
237
|
+
let t = e.getStyle();
|
|
238
|
+
if (!t) return;
|
|
239
|
+
let n = De(t);
|
|
240
|
+
n !== t && e.setStyle(n);
|
|
241
|
+
}
|
|
242
|
+
function ke() {
|
|
243
|
+
let [e] = I();
|
|
244
|
+
return b(() => e.registerNodeTransform(G, Oe), [e]), null;
|
|
245
|
+
}
|
|
246
|
+
var q = {
|
|
155
247
|
imageWrapper: "_imageWrapper_y06h3_1",
|
|
156
248
|
selected: "_selected_y06h3_8",
|
|
157
249
|
resizing: "_resizing_y06h3_12",
|
|
@@ -161,8 +253,8 @@ var we = (e) => {
|
|
|
161
253
|
topRight: "_topRight_y06h3_49",
|
|
162
254
|
bottomLeft: "_bottomLeft_y06h3_54",
|
|
163
255
|
bottomRight: "_bottomRight_y06h3_59"
|
|
164
|
-
},
|
|
165
|
-
let [a] =
|
|
256
|
+
}, Ae = ({ src: e, altText: t, width: n, height: r, nodeKey: i }) => {
|
|
257
|
+
let [a] = I(), [o, s] = C(!1), [c, l] = C(null), u = S(null), [d, f] = C({
|
|
166
258
|
width: n || void 0,
|
|
167
259
|
height: r || void 0
|
|
168
260
|
}), p = y(() => {
|
|
@@ -211,7 +303,7 @@ var we = (e) => {
|
|
|
211
303
|
}, [c]), T = y(() => {
|
|
212
304
|
c?.isResizing && (a.update(() => {
|
|
213
305
|
let e = A(i);
|
|
214
|
-
|
|
306
|
+
je(e) && e.setWidthAndHeight(d.width, d.height);
|
|
215
307
|
}), l(null));
|
|
216
308
|
}, [
|
|
217
309
|
a,
|
|
@@ -233,8 +325,8 @@ var we = (e) => {
|
|
|
233
325
|
}, []);
|
|
234
326
|
return b(() => a.registerUpdateListener(({ editorState: e }) => {
|
|
235
327
|
e.read(() => {
|
|
236
|
-
let e =
|
|
237
|
-
|
|
328
|
+
let e = M();
|
|
329
|
+
P(e) && !e.getNodes().some((e) => e.getKey() === i || e.getParent() && e.getParent()?.getKey() === i) && o && s(!1);
|
|
238
330
|
});
|
|
239
331
|
}), [
|
|
240
332
|
a,
|
|
@@ -248,15 +340,15 @@ var we = (e) => {
|
|
|
248
340
|
document.removeEventListener("mousedown", e);
|
|
249
341
|
};
|
|
250
342
|
}, [o]), /* @__PURE__ */ _("div", {
|
|
251
|
-
className: w(
|
|
252
|
-
[
|
|
253
|
-
[
|
|
343
|
+
className: w(q.imageWrapper, {
|
|
344
|
+
[q.selected]: o,
|
|
345
|
+
[q.resizing]: c?.isResizing
|
|
254
346
|
}),
|
|
255
347
|
children: [/* @__PURE__ */ g("img", {
|
|
256
348
|
ref: u,
|
|
257
349
|
src: e,
|
|
258
350
|
alt: t,
|
|
259
|
-
className:
|
|
351
|
+
className: q.image,
|
|
260
352
|
style: {
|
|
261
353
|
width: d.width,
|
|
262
354
|
height: d.height
|
|
@@ -266,24 +358,24 @@ var we = (e) => {
|
|
|
266
358
|
draggable: !1
|
|
267
359
|
}), o && /* @__PURE__ */ _(h, { children: [
|
|
268
360
|
/* @__PURE__ */ g("div", {
|
|
269
|
-
className: w(
|
|
361
|
+
className: w(q.resizeHandle, q.bottomRight),
|
|
270
362
|
onMouseDown: (e) => m(e, "bottom-right")
|
|
271
363
|
}),
|
|
272
364
|
/* @__PURE__ */ g("div", {
|
|
273
|
-
className: w(
|
|
365
|
+
className: w(q.resizeHandle, q.bottomLeft),
|
|
274
366
|
onMouseDown: (e) => m(e, "bottom-left")
|
|
275
367
|
}),
|
|
276
368
|
/* @__PURE__ */ g("div", {
|
|
277
|
-
className: w(
|
|
369
|
+
className: w(q.resizeHandle, q.topRight),
|
|
278
370
|
onMouseDown: (e) => m(e, "top-right")
|
|
279
371
|
}),
|
|
280
372
|
/* @__PURE__ */ g("div", {
|
|
281
|
-
className: w(
|
|
373
|
+
className: w(q.resizeHandle, q.topLeft),
|
|
282
374
|
onMouseDown: (e) => m(e, "top-left")
|
|
283
375
|
})
|
|
284
376
|
] })]
|
|
285
377
|
});
|
|
286
|
-
},
|
|
378
|
+
}, J = class e extends de {
|
|
287
379
|
static getType() {
|
|
288
380
|
return "image";
|
|
289
381
|
}
|
|
@@ -329,7 +421,7 @@ var we = (e) => {
|
|
|
329
421
|
n.__width = e, n.__height = t;
|
|
330
422
|
}
|
|
331
423
|
decorate() {
|
|
332
|
-
return /* @__PURE__ */ g(
|
|
424
|
+
return /* @__PURE__ */ g(Ae, {
|
|
333
425
|
src: this.__src,
|
|
334
426
|
altText: this.__altText,
|
|
335
427
|
width: this.__width,
|
|
@@ -339,13 +431,13 @@ var we = (e) => {
|
|
|
339
431
|
}
|
|
340
432
|
static importDOM() {
|
|
341
433
|
return { img: () => ({
|
|
342
|
-
conversion:
|
|
434
|
+
conversion: Me,
|
|
343
435
|
priority: 0
|
|
344
436
|
}) };
|
|
345
437
|
}
|
|
346
438
|
static importJSON(e) {
|
|
347
439
|
let { src: t, altText: n, width: r, height: i } = e;
|
|
348
|
-
return
|
|
440
|
+
return Y({
|
|
349
441
|
src: t,
|
|
350
442
|
altText: n,
|
|
351
443
|
width: r,
|
|
@@ -366,13 +458,13 @@ var we = (e) => {
|
|
|
366
458
|
return !0;
|
|
367
459
|
}
|
|
368
460
|
};
|
|
369
|
-
function
|
|
370
|
-
return new
|
|
461
|
+
function Y({ src: e, altText: t, width: n, height: r, key: i }) {
|
|
462
|
+
return new J(e, t, n, r, i);
|
|
371
463
|
}
|
|
372
|
-
function
|
|
373
|
-
return e instanceof
|
|
464
|
+
function je(e) {
|
|
465
|
+
return e instanceof J;
|
|
374
466
|
}
|
|
375
|
-
function
|
|
467
|
+
function Me(e) {
|
|
376
468
|
if (e instanceof HTMLImageElement) {
|
|
377
469
|
let { src: t, alt: n, style: r } = e, i, a;
|
|
378
470
|
if (r.width) {
|
|
@@ -383,7 +475,7 @@ function Oe(e) {
|
|
|
383
475
|
let e = parseInt(r.height, 10);
|
|
384
476
|
isNaN(e) || (a = e);
|
|
385
477
|
}
|
|
386
|
-
return i === void 0 && e.width && (i = e.width), a === void 0 && e.height && (a = e.height), { node:
|
|
478
|
+
return i === void 0 && e.width && (i = e.width), a === void 0 && e.height && (a = e.height), { node: Y({
|
|
387
479
|
src: t,
|
|
388
480
|
altText: n,
|
|
389
481
|
width: i,
|
|
@@ -394,23 +486,23 @@ function Oe(e) {
|
|
|
394
486
|
}
|
|
395
487
|
//#endregion
|
|
396
488
|
//#region src/components/Editor/plugins/ImagePlugin.tsx
|
|
397
|
-
function
|
|
398
|
-
let [e] =
|
|
399
|
-
return b(() => e.registerCommand(s, (e) => (
|
|
489
|
+
function Ne() {
|
|
490
|
+
let [e] = I();
|
|
491
|
+
return b(() => e.registerCommand(s, (e) => (N([Y(e)]), !0), le), [e]), null;
|
|
400
492
|
}
|
|
401
493
|
//#endregion
|
|
402
494
|
//#region src/components/Editor/plugins/EnterKeyPlugin.tsx
|
|
403
|
-
function
|
|
404
|
-
let [e] =
|
|
405
|
-
return b(() => e.registerCommand(
|
|
495
|
+
function X() {
|
|
496
|
+
let [e] = I(), t = S(0);
|
|
497
|
+
return b(() => e.registerCommand(fe, (n) => {
|
|
406
498
|
let r = Date.now(), i = r - t.current;
|
|
407
499
|
return t.current = r, i < 250 && i > 0 ? (e.update(() => {
|
|
408
|
-
let e =
|
|
409
|
-
if (
|
|
500
|
+
let e = M();
|
|
501
|
+
if (P(e)) {
|
|
410
502
|
let t = e.anchor.getNode().getTopLevelElement();
|
|
411
503
|
if (t && t.getTextContent().trim() === "") {
|
|
412
504
|
let n = k();
|
|
413
|
-
|
|
505
|
+
R(e, {
|
|
414
506
|
"background-color": "",
|
|
415
507
|
color: "",
|
|
416
508
|
"font-size": "",
|
|
@@ -423,35 +515,35 @@ function Ae() {
|
|
|
423
515
|
}
|
|
424
516
|
}
|
|
425
517
|
}), n?.preventDefault(), !0) : !1;
|
|
426
|
-
},
|
|
518
|
+
}, ue), [e]), null;
|
|
427
519
|
}
|
|
428
520
|
//#endregion
|
|
429
521
|
//#region src/components/Editor/plugins/MaxLengthPlugin.tsx
|
|
430
|
-
function
|
|
431
|
-
let [n] =
|
|
522
|
+
function Pe({ maxLength: e, onMaxLengthExceed: t }) {
|
|
523
|
+
let [n] = I(), r = S(t);
|
|
432
524
|
return r.current = t, b(() => {
|
|
433
525
|
let t = null;
|
|
434
|
-
return n.registerNodeTransform(
|
|
526
|
+
return n.registerNodeTransform(pe, (i) => {
|
|
435
527
|
let a = i.getTextContentSize();
|
|
436
528
|
if (a <= e) return;
|
|
437
|
-
let o = n.getEditorState(), s = o.read(() => i.getTextContentSize()), c = a - e, l =
|
|
529
|
+
let o = n.getEditorState(), s = o.read(() => i.getTextContentSize()), c = a - e, l = M();
|
|
438
530
|
if (s === e && t !== o) {
|
|
439
|
-
t = o,
|
|
531
|
+
t = o, he(n, o), r.current?.();
|
|
440
532
|
return;
|
|
441
533
|
}
|
|
442
|
-
if (
|
|
443
|
-
|
|
534
|
+
if (P(l) && l.isCollapsed()) {
|
|
535
|
+
z(n, l.anchor, c), r.current?.();
|
|
444
536
|
return;
|
|
445
537
|
}
|
|
446
538
|
i.selectEnd();
|
|
447
|
-
let u =
|
|
448
|
-
|
|
539
|
+
let u = M();
|
|
540
|
+
P(u) && (z(n, u.anchor, c), r.current?.());
|
|
449
541
|
});
|
|
450
542
|
}, [n, e]), null;
|
|
451
543
|
}
|
|
452
544
|
//#endregion
|
|
453
545
|
//#region src/components/Editor/LengthBadge.tsx
|
|
454
|
-
var
|
|
546
|
+
var Z = ({ current: e, maxLength: t }) => {
|
|
455
547
|
let n = e > t;
|
|
456
548
|
return /* @__PURE__ */ _("div", {
|
|
457
549
|
className: w(W["bsy-lexical-editor__length-badge"], n && W["bsy-lexical-editor__length-badge--exceeded"]),
|
|
@@ -463,22 +555,22 @@ var J = ({ current: e, maxLength: t }) => {
|
|
|
463
555
|
]
|
|
464
556
|
});
|
|
465
557
|
};
|
|
466
|
-
|
|
558
|
+
Z.displayName = "BsyLexicalEditorLengthBadge";
|
|
467
559
|
//#endregion
|
|
468
560
|
//#region src/components/Editor/utils/textLength.ts
|
|
469
|
-
function
|
|
561
|
+
function Fe(e) {
|
|
470
562
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
471
563
|
}
|
|
472
|
-
function
|
|
473
|
-
let n =
|
|
564
|
+
function Ie(e, t) {
|
|
565
|
+
let n = j(), r = n.getTextContentSize();
|
|
474
566
|
if (r <= t) return !1;
|
|
475
567
|
let i = r - t;
|
|
476
568
|
n.selectEnd();
|
|
477
|
-
let a =
|
|
478
|
-
return
|
|
569
|
+
let a = M();
|
|
570
|
+
return P(a) ? z(e, a.anchor, i) : Le(i), !0;
|
|
479
571
|
}
|
|
480
|
-
function
|
|
481
|
-
let t = e, n =
|
|
572
|
+
function Le(e) {
|
|
573
|
+
let t = e, n = j().getAllTextNodes();
|
|
482
574
|
for (let e = n.length - 1; e >= 0 && t > 0; e--) {
|
|
483
575
|
let r = n[e], i = r.getTextContent();
|
|
484
576
|
i.length !== 0 && (i.length <= t ? (t -= i.length, r.remove()) : (r.setTextContent(i.slice(0, i.length - t)), t = 0));
|
|
@@ -486,16 +578,16 @@ function Ne(e) {
|
|
|
486
578
|
}
|
|
487
579
|
//#endregion
|
|
488
580
|
//#region src/components/Editor/EditorCore.tsx
|
|
489
|
-
var
|
|
490
|
-
let { height: t = 126, onChange: n, toolbar: r, theme: i, maxLength: a, onMaxLengthExceed: o } = e, [s] =
|
|
581
|
+
var Q = (e) => {
|
|
582
|
+
let { height: t = 126, onChange: n, toolbar: r, theme: i, maxLength: a, onMaxLengthExceed: o } = e, [s] = I(), c = S(null), u = S(null), d = S(null), f = S(o);
|
|
491
583
|
f.current = o;
|
|
492
|
-
let p =
|
|
584
|
+
let p = Fe(a) ? a : void 0, [m, h] = C(0), v = r?.mode === "floating", T = x(() => ({
|
|
493
585
|
containerRef: c,
|
|
494
586
|
toolbarRef: u,
|
|
495
587
|
getPopupContainer: () => v && u.current ? u.current : c.current || document.body
|
|
496
588
|
}), [v]), O = y((e) => {
|
|
497
589
|
e.read(() => {
|
|
498
|
-
let t =
|
|
590
|
+
let t = j().getTextContent(), r = re(s, null), i = !t.trim() && (r === "<p><br></p>" || r === "<p></p>" || r === "" || /^<p>\s*<br>\s*<\/p>$/.test(r)) ? null : r;
|
|
499
591
|
d.current = i, p !== void 0 && h(t.length), n({
|
|
500
592
|
text: t,
|
|
501
593
|
html: i
|
|
@@ -508,13 +600,13 @@ var X = (e) => {
|
|
|
508
600
|
]);
|
|
509
601
|
b(() => {
|
|
510
602
|
p !== void 0 && s.getEditorState().read(() => {
|
|
511
|
-
h(
|
|
603
|
+
h(j().getTextContentSize());
|
|
512
604
|
}, { editor: s });
|
|
513
605
|
}, [s, p]), b(() => {
|
|
514
606
|
if (e.value !== void 0 && e.value !== d.current) {
|
|
515
607
|
let t = !1;
|
|
516
608
|
s.update(() => {
|
|
517
|
-
|
|
609
|
+
j().clear(), e.value && e.value.trim() && (N(ie(s, new DOMParser().parseFromString(e.value, "text/html"))), p !== void 0 && (t = Ie(s, p)));
|
|
518
610
|
}), t && f.current?.();
|
|
519
611
|
}
|
|
520
612
|
}, [
|
|
@@ -552,14 +644,15 @@ var X = (e) => {
|
|
|
552
644
|
}),
|
|
553
645
|
/* @__PURE__ */ g(ye, {}),
|
|
554
646
|
/* @__PURE__ */ g(ke, {}),
|
|
555
|
-
/* @__PURE__ */ g(
|
|
556
|
-
|
|
647
|
+
/* @__PURE__ */ g(Ne, {}),
|
|
648
|
+
/* @__PURE__ */ g(X, {}),
|
|
649
|
+
p !== void 0 && /* @__PURE__ */ g(Pe, {
|
|
557
650
|
maxLength: p,
|
|
558
651
|
onMaxLengthExceed: o
|
|
559
652
|
}),
|
|
560
653
|
/* @__PURE__ */ g(te, {}),
|
|
561
654
|
/* @__PURE__ */ g(ne, { onChange: O }),
|
|
562
|
-
p !== void 0 && /* @__PURE__ */ g(
|
|
655
|
+
p !== void 0 && /* @__PURE__ */ g(Z, {
|
|
563
656
|
current: m,
|
|
564
657
|
maxLength: p
|
|
565
658
|
})
|
|
@@ -567,86 +660,7 @@ var X = (e) => {
|
|
|
567
660
|
})
|
|
568
661
|
});
|
|
569
662
|
};
|
|
570
|
-
|
|
571
|
-
//#endregion
|
|
572
|
-
//#region src/components/Editor/nodes/ExtendedTextNode.tsx
|
|
573
|
-
var Z = class e extends I {
|
|
574
|
-
constructor(e, t) {
|
|
575
|
-
super(e, t);
|
|
576
|
-
}
|
|
577
|
-
static getType() {
|
|
578
|
-
return "extended-text";
|
|
579
|
-
}
|
|
580
|
-
static clone(t) {
|
|
581
|
-
return new e(t.__text, t.__key);
|
|
582
|
-
}
|
|
583
|
-
static importDOM() {
|
|
584
|
-
let e = I.importDOM();
|
|
585
|
-
return {
|
|
586
|
-
...e,
|
|
587
|
-
code: () => ({
|
|
588
|
-
conversion: Q(e?.code),
|
|
589
|
-
priority: 1
|
|
590
|
-
}),
|
|
591
|
-
em: () => ({
|
|
592
|
-
conversion: Q(e?.em),
|
|
593
|
-
priority: 1
|
|
594
|
-
}),
|
|
595
|
-
span: () => ({
|
|
596
|
-
conversion: Q(e?.span),
|
|
597
|
-
priority: 1
|
|
598
|
-
}),
|
|
599
|
-
strong: () => ({
|
|
600
|
-
conversion: Q(e?.strong),
|
|
601
|
-
priority: 1
|
|
602
|
-
}),
|
|
603
|
-
sub: () => ({
|
|
604
|
-
conversion: Q(e?.sub),
|
|
605
|
-
priority: 1
|
|
606
|
-
}),
|
|
607
|
-
sup: () => ({
|
|
608
|
-
conversion: Q(e?.sup),
|
|
609
|
-
priority: 1
|
|
610
|
-
})
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
static importJSON(e) {
|
|
614
|
-
return Pe().updateFromJSON(e);
|
|
615
|
-
}
|
|
616
|
-
isSimpleText() {
|
|
617
|
-
return this.__type === "extended-text" && this.__mode === 0;
|
|
618
|
-
}
|
|
619
|
-
};
|
|
620
|
-
function Pe(e = "") {
|
|
621
|
-
return O(new Z(e));
|
|
622
|
-
}
|
|
623
|
-
function Q(e) {
|
|
624
|
-
return (t) => {
|
|
625
|
-
let n = e?.(t);
|
|
626
|
-
if (!n) return null;
|
|
627
|
-
let r = n.conversion(t);
|
|
628
|
-
if (!r) return r;
|
|
629
|
-
let i = t.style.backgroundColor, a = t.style.color, o = t.style.fontFamily, s = t.style.fontWeight, c = t.style.fontSize, l = t.style.textDecoration;
|
|
630
|
-
return {
|
|
631
|
-
...r,
|
|
632
|
-
forChild: (e, t) => {
|
|
633
|
-
let n = (r?.forChild ?? ((e) => e))(e, t);
|
|
634
|
-
if (se(n)) {
|
|
635
|
-
let e = [
|
|
636
|
-
i ? `background-color: ${i}` : null,
|
|
637
|
-
a ? `color: ${a}` : null,
|
|
638
|
-
o ? `font-family: ${o}` : null,
|
|
639
|
-
s ? `font-weight: ${s}` : null,
|
|
640
|
-
c ? `font-size: ${c}` : null,
|
|
641
|
-
l ? `text-decoration: ${l}` : null
|
|
642
|
-
].filter((e) => e !== null).join("; ");
|
|
643
|
-
if (e.length) return n.setStyle(e);
|
|
644
|
-
}
|
|
645
|
-
return n;
|
|
646
|
-
}
|
|
647
|
-
};
|
|
648
|
-
};
|
|
649
|
-
}
|
|
663
|
+
Q.displayName = "BsyLexicalEditorCore";
|
|
650
664
|
//#endregion
|
|
651
665
|
//#region src/components/Editor/Editor.tsx
|
|
652
666
|
var $ = (e) => {
|
|
@@ -669,18 +683,18 @@ var $ = (e) => {
|
|
|
669
683
|
nodes: [
|
|
670
684
|
_e,
|
|
671
685
|
ge,
|
|
672
|
-
|
|
673
|
-
|
|
686
|
+
J,
|
|
687
|
+
G,
|
|
674
688
|
{
|
|
675
|
-
replace:
|
|
676
|
-
with: (e) => new
|
|
677
|
-
withKlass:
|
|
689
|
+
replace: F,
|
|
690
|
+
with: (e) => new G(e.__text),
|
|
691
|
+
withKlass: G
|
|
678
692
|
}
|
|
679
693
|
]
|
|
680
694
|
}), [t]),
|
|
681
|
-
children: /* @__PURE__ */ g(
|
|
695
|
+
children: /* @__PURE__ */ g(Q, { ...e })
|
|
682
696
|
});
|
|
683
697
|
};
|
|
684
698
|
$.displayName = "BsyLexicalEditor";
|
|
685
699
|
//#endregion
|
|
686
|
-
export {
|
|
700
|
+
export { ae as $getRoot, a as BaseButton, $ as default, c as listRegisteredToolbarButtons, i as registerToolbarButton, t as unregisterToolbarButton, me as useLexicalComposerContext };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import "../../vendors/version-
|
|
1
|
+
import "../../vendors/version-L-kG2La0.js";
|
|
2
2
|
import "../../ScrollBar/style-D26azwz6.js";
|
|
3
3
|
import "../../Icon/Icon-BBDcb-yw.js";
|
|
4
4
|
import "../../vendors/LocaleContext-Dcw6C1LX.js";
|
|
5
5
|
import "../../vendors/useLocale-BKZX2_zw.js";
|
|
6
|
-
import "../../vendors/useLatchedPopupPortalRoot-
|
|
7
|
-
import "../../Tooltip/Tooltip-
|
|
8
|
-
import "../../Select/SelectInputSearch-
|
|
9
|
-
import "../../NotFoundContent/NotFoundContent-
|
|
10
|
-
import "../../ScrollBar/ScrollBar-
|
|
11
|
-
import "../../vendors/useFloatingPortal-
|
|
12
|
-
import "../../DropDown/DropDown-
|
|
13
|
-
import "../../DropDown/style-
|
|
14
|
-
import "../constants-
|
|
15
|
-
import "../GanttHighlightContext-
|
|
16
|
-
import "../timelineViewConfig-
|
|
17
|
-
import "../collapseKeys-
|
|
18
|
-
import { t as e } from "../GanttChart-
|
|
19
|
-
import "../GanttToolBar-
|
|
6
|
+
import "../../vendors/useLatchedPopupPortalRoot-hwf14FJ5.js";
|
|
7
|
+
import "../../Tooltip/Tooltip-DWWWYn1a.js";
|
|
8
|
+
import "../../Select/SelectInputSearch-CrGW_eVo.js";
|
|
9
|
+
import "../../NotFoundContent/NotFoundContent-J-TEnljc.js";
|
|
10
|
+
import "../../ScrollBar/ScrollBar-CnwYQfXM.js";
|
|
11
|
+
import "../../vendors/useFloatingPortal-C8V67X0v.js";
|
|
12
|
+
import "../../DropDown/DropDown-Daxr9BYf.js";
|
|
13
|
+
import "../../DropDown/style-BSgosymi.js";
|
|
14
|
+
import "../constants-BObDP0h6.js";
|
|
15
|
+
import "../GanttHighlightContext-grda5bhd.js";
|
|
16
|
+
import "../timelineViewConfig-CLIpppp0.js";
|
|
17
|
+
import "../collapseKeys-_ShTXPKt.js";
|
|
18
|
+
import { t as e } from "../GanttChart-6gpw5vi6.js";
|
|
19
|
+
import "../GanttToolBar-CarBWZg-.js";
|
|
20
20
|
export { e as default };
|