dishui 0.0.72 → 0.0.73
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/components/Button/index.d.ts +4 -4
- package/dist/components/Button/index.js +18 -17
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Card/Metric.d.ts +17 -0
- package/dist/components/Card/Metric2.js +50 -0
- package/dist/components/Card/Metric2.js.map +1 -0
- package/dist/components/Card/index.d.ts +3 -0
- package/dist/components/Card/index.js +118 -117
- package/dist/components/Card/index.js.map +1 -1
- package/dist/components/Group/index.d.ts +2 -0
- package/dist/components/GroupButton/index.d.ts +16 -0
- package/dist/components/GroupButton/index.js +41 -0
- package/dist/components/GroupButton/index.js.map +1 -0
- package/dist/components/GroupedTable/index.d.ts +38 -0
- package/dist/components/GroupedTable/index.js +92 -0
- package/dist/components/GroupedTable/index.js.map +1 -0
- package/dist/components/Layout/index.d.ts +4 -2
- package/dist/components/Layout/index.js +1 -1
- package/dist/components/Layout/index.js.map +1 -1
- package/dist/components/NavigationList/index.d.ts +17 -0
- package/dist/components/NavigationList/index.js +48 -0
- package/dist/components/NavigationList/index.js.map +1 -0
- package/dist/components/Section/index.d.ts +28 -0
- package/dist/components/Section/index.js +58 -0
- package/dist/components/Section/index.js.map +1 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/index.js +83 -82
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/SidebarToggleButton/index.d.ts +16 -1
- package/dist/components/SidebarToggleButton/index.js +90 -30
- package/dist/components/SidebarToggleButton/index.js.map +1 -1
- package/dist/components/Skeleton/index.d.ts +7 -0
- package/dist/components/Skeleton/index.js +21 -0
- package/dist/components/Skeleton/index.js.map +1 -0
- package/dist/components/Tree/Tree.js +5 -2
- package/dist/components/Tree/Tree.js.map +1 -1
- package/dist/components/pro/RichTextEditor/AIRewrite.js +114 -72
- package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BlockHandle.js +315 -196
- package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BubbleToolbar.d.ts +1 -1
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js +69 -33
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPanel.d.ts +2 -1
- package/dist/components/pro/RichTextEditor/CommentPanel.js +100 -81
- package/dist/components/pro/RichTextEditor/CommentPanel.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPopover.d.ts +2 -1
- package/dist/components/pro/RichTextEditor/CommentPopover.js +92 -68
- package/dist/components/pro/RichTextEditor/CommentPopover.js.map +1 -1
- package/dist/components/pro/RichTextEditor/RichTextEditor.js +24 -22
- package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/components/pro/RichTextEditor/SearchReplace.d.ts +7 -0
- package/dist/components/pro/RichTextEditor/SlashMenu.js +136 -73
- package/dist/components/pro/RichTextEditor/SlashMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.d.ts +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js +346 -313
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js +114 -146
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js +2 -2
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js +178 -163
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js +8 -5
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.d.ts +6 -0
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js +85 -74
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js.map +1 -1
- package/dist/components/pro/RichTextEditor/searchUtils.d.ts +23 -0
- package/dist/contexts/AppContext.js +47 -45
- package/dist/contexts/AppContext.js.map +1 -1
- package/dist/dishui.css +1 -1
- package/dist/index-nostyled.d.ts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +119 -114
- package/dist/layouts/MainLayout.js +9 -10
- package/dist/layouts/MainLayout.js.map +1 -1
- package/dist/layouts/Sidebar.d.ts +9 -0
- package/dist/layouts/Sidebar.js +99 -80
- package/dist/layouts/Sidebar.js.map +1 -1
- package/dist/layouts/headbar/Headbar.d.ts +1 -1
- package/dist/layouts/headbar/Headbar.js +2 -2
- package/dist/layouts/headbar/Headbar.js.map +1 -1
- package/dist/lite.d.ts +19 -1
- package/dist/lite.js +17 -8
- package/dist/styles/themeStyles.js +6 -6
- package/dist/styles/themeStyles.js.map +1 -1
- package/dist/utils/i18n.d.ts +3 -0
- package/dist/utils/i18n.js +78 -0
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/menu.js +23 -6
- package/dist/utils/menu.js.map +1 -1
- package/package.json +8 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { cn as e } from "../../../../utils/cn.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useNodeEditable as t } from "./MarkdownBlock.js";
|
|
3
|
+
import { useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
|
|
4
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
import { Node as c, NodeViewContent as l, NodeViewWrapper as u, ReactNodeViewRenderer as d, mergeAttributes as f } from "@tiptap/react";
|
|
5
6
|
//#region src/components/pro/RichTextEditor/extensions/FloatingDialog.tsx
|
|
6
|
-
var
|
|
7
|
+
var p = [
|
|
7
8
|
{
|
|
8
9
|
label: "Blue",
|
|
9
10
|
border: "#3b82f6",
|
|
@@ -34,11 +35,11 @@ var f = [
|
|
|
34
35
|
border: "#6b7280",
|
|
35
36
|
bg: "#f9fafb"
|
|
36
37
|
}
|
|
37
|
-
],
|
|
38
|
+
], m = [
|
|
38
39
|
{
|
|
39
40
|
key: "block",
|
|
40
41
|
label: "Block",
|
|
41
|
-
icon: /* @__PURE__ */
|
|
42
|
+
icon: /* @__PURE__ */ s("svg", {
|
|
42
43
|
width: "14",
|
|
43
44
|
height: "14",
|
|
44
45
|
viewBox: "0 0 24 24",
|
|
@@ -46,20 +47,20 @@ var f = [
|
|
|
46
47
|
stroke: "currentColor",
|
|
47
48
|
strokeWidth: "2",
|
|
48
49
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ o("rect", {
|
|
50
51
|
x: "3",
|
|
51
52
|
y: "5",
|
|
52
53
|
width: "18",
|
|
53
54
|
height: "14",
|
|
54
55
|
rx: "2"
|
|
55
56
|
}),
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ o("line", {
|
|
57
58
|
x1: "3",
|
|
58
59
|
y1: "3",
|
|
59
60
|
x2: "21",
|
|
60
61
|
y2: "3"
|
|
61
62
|
}),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ o("line", {
|
|
63
64
|
x1: "3",
|
|
64
65
|
y1: "21",
|
|
65
66
|
x2: "21",
|
|
@@ -71,7 +72,7 @@ var f = [
|
|
|
71
72
|
{
|
|
72
73
|
key: "wrap-left",
|
|
73
74
|
label: "Wrap Left",
|
|
74
|
-
icon: /* @__PURE__ */
|
|
75
|
+
icon: /* @__PURE__ */ s("svg", {
|
|
75
76
|
width: "14",
|
|
76
77
|
height: "14",
|
|
77
78
|
viewBox: "0 0 24 24",
|
|
@@ -79,38 +80,38 @@ var f = [
|
|
|
79
80
|
stroke: "currentColor",
|
|
80
81
|
strokeWidth: "2",
|
|
81
82
|
children: [
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ o("rect", {
|
|
83
84
|
x: "2",
|
|
84
85
|
y: "4",
|
|
85
86
|
width: "10",
|
|
86
87
|
height: "8",
|
|
87
88
|
rx: "1"
|
|
88
89
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ o("line", {
|
|
90
91
|
x1: "15",
|
|
91
92
|
y1: "5",
|
|
92
93
|
x2: "22",
|
|
93
94
|
y2: "5"
|
|
94
95
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ o("line", {
|
|
96
97
|
x1: "15",
|
|
97
98
|
y1: "8",
|
|
98
99
|
x2: "22",
|
|
99
100
|
y2: "8"
|
|
100
101
|
}),
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ o("line", {
|
|
102
103
|
x1: "15",
|
|
103
104
|
y1: "11",
|
|
104
105
|
x2: "22",
|
|
105
106
|
y2: "11"
|
|
106
107
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ o("line", {
|
|
108
109
|
x1: "2",
|
|
109
110
|
y1: "15",
|
|
110
111
|
x2: "22",
|
|
111
112
|
y2: "15"
|
|
112
113
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ o("line", {
|
|
114
115
|
x1: "2",
|
|
115
116
|
y1: "18",
|
|
116
117
|
x2: "22",
|
|
@@ -122,7 +123,7 @@ var f = [
|
|
|
122
123
|
{
|
|
123
124
|
key: "wrap-right",
|
|
124
125
|
label: "Wrap Right",
|
|
125
|
-
icon: /* @__PURE__ */
|
|
126
|
+
icon: /* @__PURE__ */ s("svg", {
|
|
126
127
|
width: "14",
|
|
127
128
|
height: "14",
|
|
128
129
|
viewBox: "0 0 24 24",
|
|
@@ -130,38 +131,38 @@ var f = [
|
|
|
130
131
|
stroke: "currentColor",
|
|
131
132
|
strokeWidth: "2",
|
|
132
133
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ o("rect", {
|
|
134
135
|
x: "12",
|
|
135
136
|
y: "4",
|
|
136
137
|
width: "10",
|
|
137
138
|
height: "8",
|
|
138
139
|
rx: "1"
|
|
139
140
|
}),
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ o("line", {
|
|
141
142
|
x1: "2",
|
|
142
143
|
y1: "5",
|
|
143
144
|
x2: "9",
|
|
144
145
|
y2: "5"
|
|
145
146
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ o("line", {
|
|
147
148
|
x1: "2",
|
|
148
149
|
y1: "8",
|
|
149
150
|
x2: "9",
|
|
150
151
|
y2: "8"
|
|
151
152
|
}),
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ o("line", {
|
|
153
154
|
x1: "2",
|
|
154
155
|
y1: "11",
|
|
155
156
|
x2: "9",
|
|
156
157
|
y2: "11"
|
|
157
158
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ o("line", {
|
|
159
160
|
x1: "2",
|
|
160
161
|
y1: "15",
|
|
161
162
|
x2: "22",
|
|
162
163
|
y2: "15"
|
|
163
164
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ o("line", {
|
|
165
166
|
x1: "2",
|
|
166
167
|
y1: "18",
|
|
167
168
|
x2: "22",
|
|
@@ -173,7 +174,7 @@ var f = [
|
|
|
173
174
|
{
|
|
174
175
|
key: "float",
|
|
175
176
|
label: "Float",
|
|
176
|
-
icon: /* @__PURE__ */
|
|
177
|
+
icon: /* @__PURE__ */ s("svg", {
|
|
177
178
|
width: "14",
|
|
178
179
|
height: "14",
|
|
179
180
|
viewBox: "0 0 24 24",
|
|
@@ -181,25 +182,25 @@ var f = [
|
|
|
181
182
|
stroke: "currentColor",
|
|
182
183
|
strokeWidth: "2",
|
|
183
184
|
children: [
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ o("rect", {
|
|
185
186
|
x: "6",
|
|
186
187
|
y: "6",
|
|
187
188
|
width: "12",
|
|
188
189
|
height: "12",
|
|
189
190
|
rx: "2"
|
|
190
191
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ o("path", {
|
|
192
193
|
d: "M2 2h4M18 2h4M2 22h4M18 22h4",
|
|
193
194
|
strokeDasharray: "2 2"
|
|
194
195
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ o("line", {
|
|
196
197
|
x1: "2",
|
|
197
198
|
y1: "12",
|
|
198
199
|
x2: "6",
|
|
199
200
|
y2: "12",
|
|
200
201
|
strokeDasharray: "2 2"
|
|
201
202
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ o("line", {
|
|
203
204
|
x1: "18",
|
|
204
205
|
y1: "12",
|
|
205
206
|
x2: "22",
|
|
@@ -210,119 +211,131 @@ var f = [
|
|
|
210
211
|
})
|
|
211
212
|
}
|
|
212
213
|
];
|
|
213
|
-
function
|
|
214
|
+
function h(e) {
|
|
214
215
|
let t = [];
|
|
215
216
|
return e.state.doc.descendants((e) => {
|
|
216
217
|
e.type.name === "floatingDialog" && e.attrs.layout === "float" && t.push(e.attrs.zIndex ?? 10);
|
|
217
218
|
}), t;
|
|
218
219
|
}
|
|
219
|
-
var
|
|
220
|
-
let
|
|
220
|
+
var g = ({ node: c, editor: d, updateAttributes: f, deleteNode: g, selected: _ }) => {
|
|
221
|
+
let v = t(d), y = n((e) => {
|
|
222
|
+
!d.isDestroyed && d.isEditable && f(e);
|
|
223
|
+
}, [d, f]), b = i(null), x = c.attrs, S = x.layout || "block", C = S === "float", w = x.zIndex ?? 10, [T, E] = a(!1), [D, O] = a(x.title), [k, A] = a(!1), [j, M] = a(!1), N = i({
|
|
221
224
|
mx: 0,
|
|
222
225
|
my: 0,
|
|
223
226
|
x: 0,
|
|
224
227
|
y: 0
|
|
225
|
-
}),
|
|
228
|
+
}), P = i({
|
|
226
229
|
mx: 0,
|
|
227
230
|
my: 0,
|
|
228
231
|
w: 0,
|
|
229
232
|
h: 0
|
|
230
|
-
}),
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}, [
|
|
233
|
+
}), F = i(null), I = i(null);
|
|
234
|
+
r(() => {
|
|
235
|
+
O(x.title);
|
|
236
|
+
}, [x.title]), r(() => {
|
|
237
|
+
v || (b.current?.(), E(!1), O(x.title), A(!1), M(!1));
|
|
238
|
+
}, [v, x.title]), r(() => {
|
|
239
|
+
let e = () => b.current?.();
|
|
240
|
+
return d.on("destroy", e), window.addEventListener("blur", e), () => {
|
|
241
|
+
e(), d.off("destroy", e), window.removeEventListener("blur", e);
|
|
242
|
+
};
|
|
243
|
+
}, [d]), r(() => {
|
|
234
244
|
let e = (e) => {
|
|
235
|
-
|
|
245
|
+
F.current && !F.current.contains(e.target) && A(!1), I.current && !I.current.contains(e.target) && M(!1);
|
|
236
246
|
};
|
|
237
247
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
238
248
|
}, []);
|
|
239
|
-
let
|
|
240
|
-
if (!
|
|
241
|
-
e.preventDefault(), e.stopPropagation(),
|
|
249
|
+
let L = n((e) => {
|
|
250
|
+
if (!C || d.isDestroyed || !d.isEditable || e.button !== 0) return;
|
|
251
|
+
b.current?.(), e.preventDefault(), e.stopPropagation(), N.current = {
|
|
242
252
|
mx: e.clientX,
|
|
243
253
|
my: e.clientY,
|
|
244
|
-
x:
|
|
245
|
-
y:
|
|
254
|
+
x: x.x,
|
|
255
|
+
y: x.y
|
|
246
256
|
};
|
|
247
257
|
let t = (e) => {
|
|
248
|
-
let t = e.clientX -
|
|
249
|
-
|
|
250
|
-
x:
|
|
251
|
-
y:
|
|
258
|
+
let t = e.clientX - N.current.mx, n = e.clientY - N.current.my;
|
|
259
|
+
y({
|
|
260
|
+
x: N.current.x + t,
|
|
261
|
+
y: N.current.y + n
|
|
252
262
|
});
|
|
253
263
|
}, n = () => {
|
|
254
264
|
document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
|
|
255
265
|
};
|
|
256
|
-
document.addEventListener("mousemove", t), document.addEventListener("mouseup", n);
|
|
266
|
+
document.addEventListener("mousemove", t), document.addEventListener("mouseup", n), b.current = n;
|
|
257
267
|
}, [
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
268
|
+
d,
|
|
269
|
+
C,
|
|
270
|
+
x.x,
|
|
271
|
+
x.y,
|
|
272
|
+
y
|
|
273
|
+
]), R = n((e) => {
|
|
274
|
+
if (d.isDestroyed || !d.isEditable || e.button !== 0) return;
|
|
275
|
+
b.current?.(), e.preventDefault(), e.stopPropagation(), P.current = {
|
|
264
276
|
mx: e.clientX,
|
|
265
277
|
my: e.clientY,
|
|
266
|
-
w:
|
|
267
|
-
h:
|
|
278
|
+
w: x.width,
|
|
279
|
+
h: x.height
|
|
268
280
|
};
|
|
269
281
|
let t = (e) => {
|
|
270
|
-
let t = e.clientX -
|
|
271
|
-
|
|
272
|
-
width: Math.max(160,
|
|
273
|
-
height: Math.max(80,
|
|
282
|
+
let t = e.clientX - P.current.mx, n = e.clientY - P.current.my;
|
|
283
|
+
y({
|
|
284
|
+
width: Math.max(160, P.current.w + t),
|
|
285
|
+
height: Math.max(80, P.current.h + n)
|
|
274
286
|
});
|
|
275
287
|
}, n = () => {
|
|
276
288
|
document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
|
|
277
289
|
};
|
|
278
|
-
document.addEventListener("mousemove", t), document.addEventListener("mouseup", n);
|
|
290
|
+
document.addEventListener("mousemove", t), document.addEventListener("mouseup", n), b.current = n;
|
|
279
291
|
}, [
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
292
|
+
d,
|
|
293
|
+
x.width,
|
|
294
|
+
x.height,
|
|
295
|
+
y
|
|
296
|
+
]), z = n(() => {
|
|
297
|
+
y({ title: D }), E(!1);
|
|
298
|
+
}, [D, y]), B = n(() => {
|
|
299
|
+
let e = h(d), t = Math.max(...e);
|
|
300
|
+
w < t && y({ zIndex: t + 1 });
|
|
288
301
|
}, [
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
]),
|
|
293
|
-
let e =
|
|
294
|
-
|
|
302
|
+
d,
|
|
303
|
+
w,
|
|
304
|
+
y
|
|
305
|
+
]), V = n(() => {
|
|
306
|
+
let e = h(d), t = Math.min(...e);
|
|
307
|
+
w > t ? y({ zIndex: t - 1 }) : w > 1 && y({ zIndex: w - 1 });
|
|
295
308
|
}, [
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
]),
|
|
309
|
+
d,
|
|
310
|
+
w,
|
|
311
|
+
y
|
|
312
|
+
]), H = e("rte-float-dialog", `rte-float-dialog--${S}`, _ && "rte-float-dialog--selected"), U = C ? {
|
|
300
313
|
position: "absolute",
|
|
301
|
-
left:
|
|
302
|
-
top:
|
|
303
|
-
zIndex:
|
|
304
|
-
} : {},
|
|
305
|
-
width:
|
|
306
|
-
minHeight:
|
|
307
|
-
borderColor:
|
|
308
|
-
backgroundColor:
|
|
309
|
-
},
|
|
310
|
-
return /* @__PURE__ */
|
|
311
|
-
className:
|
|
312
|
-
style:
|
|
313
|
-
children: /* @__PURE__ */
|
|
314
|
+
left: x.x,
|
|
315
|
+
top: x.y,
|
|
316
|
+
zIndex: w
|
|
317
|
+
} : {}, W = {
|
|
318
|
+
width: S === "block" ? "100%" : x.width,
|
|
319
|
+
minHeight: x.height,
|
|
320
|
+
borderColor: x.borderColor,
|
|
321
|
+
backgroundColor: x.bgColor
|
|
322
|
+
}, G = m.find((e) => e.key === S)?.icon;
|
|
323
|
+
return /* @__PURE__ */ o(u, {
|
|
324
|
+
className: H,
|
|
325
|
+
style: U,
|
|
326
|
+
children: /* @__PURE__ */ s("div", {
|
|
314
327
|
className: "rte-float-dialog__box",
|
|
315
|
-
style:
|
|
328
|
+
style: W,
|
|
316
329
|
children: [
|
|
317
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ s("div", {
|
|
318
331
|
className: "rte-float-dialog__titlebar",
|
|
319
|
-
style: { borderBottomColor:
|
|
320
|
-
onMouseDown:
|
|
332
|
+
style: { borderBottomColor: x.borderColor },
|
|
333
|
+
onMouseDown: L,
|
|
321
334
|
contentEditable: !1,
|
|
322
335
|
children: [
|
|
323
|
-
|
|
336
|
+
C && /* @__PURE__ */ o("span", {
|
|
324
337
|
className: "rte-float-dialog__drag-icon",
|
|
325
|
-
children: /* @__PURE__ */
|
|
338
|
+
children: /* @__PURE__ */ s("svg", {
|
|
326
339
|
width: "12",
|
|
327
340
|
height: "12",
|
|
328
341
|
viewBox: "0 0 24 24",
|
|
@@ -330,32 +343,32 @@ var h = ({ node: s, editor: u, updateAttributes: d, deleteNode: h, selected: g }
|
|
|
330
343
|
stroke: "currentColor",
|
|
331
344
|
strokeWidth: "2",
|
|
332
345
|
children: [
|
|
333
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ o("circle", {
|
|
334
347
|
cx: "9",
|
|
335
348
|
cy: "5",
|
|
336
349
|
r: "1.5"
|
|
337
350
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ o("circle", {
|
|
339
352
|
cx: "15",
|
|
340
353
|
cy: "5",
|
|
341
354
|
r: "1.5"
|
|
342
355
|
}),
|
|
343
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ o("circle", {
|
|
344
357
|
cx: "9",
|
|
345
358
|
cy: "12",
|
|
346
359
|
r: "1.5"
|
|
347
360
|
}),
|
|
348
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ o("circle", {
|
|
349
362
|
cx: "15",
|
|
350
363
|
cy: "12",
|
|
351
364
|
r: "1.5"
|
|
352
365
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ o("circle", {
|
|
354
367
|
cx: "9",
|
|
355
368
|
cy: "19",
|
|
356
369
|
r: "1.5"
|
|
357
370
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ o("circle", {
|
|
359
372
|
cx: "15",
|
|
360
373
|
cy: "19",
|
|
361
374
|
r: "1.5"
|
|
@@ -363,49 +376,51 @@ var h = ({ node: s, editor: u, updateAttributes: d, deleteNode: h, selected: g }
|
|
|
363
376
|
]
|
|
364
377
|
})
|
|
365
378
|
}),
|
|
366
|
-
|
|
379
|
+
T && v ? /* @__PURE__ */ o("input", {
|
|
367
380
|
className: "rte-float-dialog__title-input",
|
|
368
|
-
value:
|
|
369
|
-
onChange: (e) =>
|
|
381
|
+
value: D,
|
|
382
|
+
onChange: (e) => O(e.target.value),
|
|
370
383
|
placeholder: "Title...",
|
|
371
384
|
onMouseDown: (e) => e.stopPropagation(),
|
|
372
|
-
onBlur:
|
|
385
|
+
onBlur: z,
|
|
373
386
|
onKeyDown: (e) => {
|
|
374
|
-
(e.key === "Enter" || e.key === "Escape") &&
|
|
387
|
+
(e.key === "Enter" || e.key === "Escape") && z();
|
|
375
388
|
},
|
|
376
389
|
autoFocus: !0
|
|
377
|
-
}) : /* @__PURE__ */
|
|
390
|
+
}) : /* @__PURE__ */ o("span", {
|
|
378
391
|
className: "rte-float-dialog__title",
|
|
379
|
-
onDoubleClick: () =>
|
|
380
|
-
|
|
392
|
+
onDoubleClick: () => {
|
|
393
|
+
!d.isDestroyed && d.isEditable && E(!0);
|
|
394
|
+
},
|
|
395
|
+
children: x.title || "Dialog"
|
|
381
396
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
397
|
+
v && /* @__PURE__ */ s("div", {
|
|
383
398
|
className: "rte-float-dialog__actions",
|
|
384
399
|
children: [
|
|
385
|
-
|
|
400
|
+
C && /* @__PURE__ */ s("div", {
|
|
386
401
|
className: "rte-float-dialog__zorder",
|
|
387
|
-
children: [/* @__PURE__ */
|
|
402
|
+
children: [/* @__PURE__ */ o("button", {
|
|
388
403
|
type: "button",
|
|
389
404
|
className: "rte-float-dialog__action-btn",
|
|
390
405
|
onClick: (e) => {
|
|
391
|
-
e.stopPropagation(),
|
|
406
|
+
e.stopPropagation(), B();
|
|
392
407
|
},
|
|
393
408
|
title: "Bring to Front",
|
|
394
409
|
onMouseDown: (e) => e.stopPropagation(),
|
|
395
|
-
children: /* @__PURE__ */
|
|
410
|
+
children: /* @__PURE__ */ s("svg", {
|
|
396
411
|
width: "12",
|
|
397
412
|
height: "12",
|
|
398
413
|
viewBox: "0 0 24 24",
|
|
399
414
|
fill: "none",
|
|
400
415
|
stroke: "currentColor",
|
|
401
416
|
strokeWidth: "2",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
417
|
+
children: [/* @__PURE__ */ o("rect", {
|
|
403
418
|
x: "8",
|
|
404
419
|
y: "2",
|
|
405
420
|
width: "13",
|
|
406
421
|
height: "13",
|
|
407
422
|
rx: "2"
|
|
408
|
-
}), /* @__PURE__ */
|
|
423
|
+
}), /* @__PURE__ */ o("rect", {
|
|
409
424
|
x: "3",
|
|
410
425
|
y: "9",
|
|
411
426
|
width: "13",
|
|
@@ -414,28 +429,28 @@ var h = ({ node: s, editor: u, updateAttributes: d, deleteNode: h, selected: g }
|
|
|
414
429
|
opacity: "0.4"
|
|
415
430
|
})]
|
|
416
431
|
})
|
|
417
|
-
}), /* @__PURE__ */
|
|
432
|
+
}), /* @__PURE__ */ o("button", {
|
|
418
433
|
type: "button",
|
|
419
434
|
className: "rte-float-dialog__action-btn",
|
|
420
435
|
onClick: (e) => {
|
|
421
|
-
e.stopPropagation(),
|
|
436
|
+
e.stopPropagation(), V();
|
|
422
437
|
},
|
|
423
438
|
title: "Send to Back",
|
|
424
439
|
onMouseDown: (e) => e.stopPropagation(),
|
|
425
|
-
children: /* @__PURE__ */
|
|
440
|
+
children: /* @__PURE__ */ s("svg", {
|
|
426
441
|
width: "12",
|
|
427
442
|
height: "12",
|
|
428
443
|
viewBox: "0 0 24 24",
|
|
429
444
|
fill: "none",
|
|
430
445
|
stroke: "currentColor",
|
|
431
446
|
strokeWidth: "2",
|
|
432
|
-
children: [/* @__PURE__ */
|
|
447
|
+
children: [/* @__PURE__ */ o("rect", {
|
|
433
448
|
x: "3",
|
|
434
449
|
y: "9",
|
|
435
450
|
width: "13",
|
|
436
451
|
height: "13",
|
|
437
452
|
rx: "2"
|
|
438
|
-
}), /* @__PURE__ */
|
|
453
|
+
}), /* @__PURE__ */ o("rect", {
|
|
439
454
|
x: "8",
|
|
440
455
|
y: "2",
|
|
441
456
|
width: "13",
|
|
@@ -446,94 +461,94 @@ var h = ({ node: s, editor: u, updateAttributes: d, deleteNode: h, selected: g }
|
|
|
446
461
|
})
|
|
447
462
|
})]
|
|
448
463
|
}),
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
ref:
|
|
464
|
+
/* @__PURE__ */ s("div", {
|
|
465
|
+
ref: I,
|
|
451
466
|
style: { position: "relative" },
|
|
452
|
-
children: [/* @__PURE__ */
|
|
467
|
+
children: [/* @__PURE__ */ o("button", {
|
|
453
468
|
type: "button",
|
|
454
469
|
className: "rte-float-dialog__action-btn",
|
|
455
470
|
onClick: (e) => {
|
|
456
|
-
e.stopPropagation(),
|
|
471
|
+
e.stopPropagation(), M(!j);
|
|
457
472
|
},
|
|
458
|
-
title: `Layout: ${
|
|
473
|
+
title: `Layout: ${S}`,
|
|
459
474
|
onMouseDown: (e) => e.stopPropagation(),
|
|
460
|
-
children:
|
|
461
|
-
}),
|
|
475
|
+
children: G
|
|
476
|
+
}), j && /* @__PURE__ */ o("div", {
|
|
462
477
|
className: "rte-float-dialog__layout-dropdown",
|
|
463
478
|
onMouseDown: (e) => e.stopPropagation(),
|
|
464
|
-
children:
|
|
479
|
+
children: m.map((e) => /* @__PURE__ */ s("button", {
|
|
465
480
|
type: "button",
|
|
466
|
-
className: `rte-float-dialog__layout-option ${
|
|
481
|
+
className: `rte-float-dialog__layout-option ${S === e.key ? "rte-float-dialog__layout-option--active" : ""}`,
|
|
467
482
|
onClick: () => {
|
|
468
|
-
|
|
483
|
+
y({ layout: e.key }), M(!1);
|
|
469
484
|
},
|
|
470
485
|
title: e.label,
|
|
471
|
-
children: [e.icon, /* @__PURE__ */
|
|
486
|
+
children: [e.icon, /* @__PURE__ */ o("span", { children: e.label })]
|
|
472
487
|
}, e.key))
|
|
473
488
|
})]
|
|
474
489
|
}),
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
ref:
|
|
490
|
+
/* @__PURE__ */ s("div", {
|
|
491
|
+
ref: F,
|
|
477
492
|
style: { position: "relative" },
|
|
478
|
-
children: [/* @__PURE__ */
|
|
493
|
+
children: [/* @__PURE__ */ o("button", {
|
|
479
494
|
type: "button",
|
|
480
495
|
className: "rte-float-dialog__action-btn",
|
|
481
496
|
onClick: (e) => {
|
|
482
|
-
e.stopPropagation(),
|
|
497
|
+
e.stopPropagation(), A(!k);
|
|
483
498
|
},
|
|
484
499
|
title: "Color",
|
|
485
500
|
onMouseDown: (e) => e.stopPropagation(),
|
|
486
|
-
children: /* @__PURE__ */
|
|
501
|
+
children: /* @__PURE__ */ o("svg", {
|
|
487
502
|
width: "12",
|
|
488
503
|
height: "12",
|
|
489
504
|
viewBox: "0 0 24 24",
|
|
490
|
-
fill:
|
|
491
|
-
stroke:
|
|
505
|
+
fill: x.borderColor,
|
|
506
|
+
stroke: x.borderColor,
|
|
492
507
|
strokeWidth: "2",
|
|
493
|
-
children: /* @__PURE__ */
|
|
508
|
+
children: /* @__PURE__ */ o("circle", {
|
|
494
509
|
cx: "12",
|
|
495
510
|
cy: "12",
|
|
496
511
|
r: "8"
|
|
497
512
|
})
|
|
498
513
|
})
|
|
499
|
-
}),
|
|
514
|
+
}), k && /* @__PURE__ */ o("div", {
|
|
500
515
|
className: "rte-float-dialog__color-dropdown",
|
|
501
516
|
onMouseDown: (e) => e.stopPropagation(),
|
|
502
|
-
children:
|
|
517
|
+
children: p.map((e) => /* @__PURE__ */ o("button", {
|
|
503
518
|
type: "button",
|
|
504
519
|
className: "rte-float-dialog__color-swatch",
|
|
505
520
|
style: { backgroundColor: e.border },
|
|
506
521
|
onClick: () => {
|
|
507
|
-
|
|
522
|
+
y({
|
|
508
523
|
borderColor: e.border,
|
|
509
524
|
bgColor: e.bg
|
|
510
|
-
}),
|
|
525
|
+
}), A(!1);
|
|
511
526
|
},
|
|
512
527
|
title: e.label
|
|
513
528
|
}, e.label))
|
|
514
529
|
})]
|
|
515
530
|
}),
|
|
516
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ o("button", {
|
|
517
532
|
type: "button",
|
|
518
533
|
className: "rte-float-dialog__action-btn rte-float-dialog__action-btn--danger",
|
|
519
534
|
onClick: (e) => {
|
|
520
|
-
e.stopPropagation(),
|
|
535
|
+
e.stopPropagation(), !d.isDestroyed && d.isEditable && g();
|
|
521
536
|
},
|
|
522
537
|
title: "Delete",
|
|
523
538
|
onMouseDown: (e) => e.stopPropagation(),
|
|
524
|
-
children: /* @__PURE__ */
|
|
539
|
+
children: /* @__PURE__ */ s("svg", {
|
|
525
540
|
width: "12",
|
|
526
541
|
height: "12",
|
|
527
542
|
viewBox: "0 0 24 24",
|
|
528
543
|
fill: "none",
|
|
529
544
|
stroke: "currentColor",
|
|
530
545
|
strokeWidth: "2",
|
|
531
|
-
children: [/* @__PURE__ */
|
|
546
|
+
children: [/* @__PURE__ */ o("line", {
|
|
532
547
|
x1: "18",
|
|
533
548
|
y1: "6",
|
|
534
549
|
x2: "6",
|
|
535
550
|
y2: "18"
|
|
536
|
-
}), /* @__PURE__ */
|
|
551
|
+
}), /* @__PURE__ */ o("line", {
|
|
537
552
|
x1: "6",
|
|
538
553
|
y1: "6",
|
|
539
554
|
x2: "18",
|
|
@@ -545,28 +560,28 @@ var h = ({ node: s, editor: u, updateAttributes: d, deleteNode: h, selected: g }
|
|
|
545
560
|
})
|
|
546
561
|
]
|
|
547
562
|
}),
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ o(l, { className: "rte-float-dialog__body" }),
|
|
564
|
+
v && /* @__PURE__ */ o("div", {
|
|
550
565
|
className: "rte-float-dialog__resize-handle",
|
|
551
|
-
onMouseDown:
|
|
566
|
+
onMouseDown: R,
|
|
552
567
|
contentEditable: !1,
|
|
553
|
-
children: /* @__PURE__ */
|
|
568
|
+
children: /* @__PURE__ */ s("svg", {
|
|
554
569
|
width: "10",
|
|
555
570
|
height: "10",
|
|
556
571
|
viewBox: "0 0 10 10",
|
|
557
572
|
fill: "currentColor",
|
|
558
573
|
children: [
|
|
559
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ o("circle", {
|
|
560
575
|
cx: "8",
|
|
561
576
|
cy: "8",
|
|
562
577
|
r: "1.2"
|
|
563
578
|
}),
|
|
564
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ o("circle", {
|
|
565
580
|
cx: "4",
|
|
566
581
|
cy: "8",
|
|
567
582
|
r: "1.2"
|
|
568
583
|
}),
|
|
569
|
-
/* @__PURE__ */
|
|
584
|
+
/* @__PURE__ */ o("circle", {
|
|
570
585
|
cx: "8",
|
|
571
586
|
cy: "4",
|
|
572
587
|
r: "1.2"
|
|
@@ -578,7 +593,7 @@ var h = ({ node: s, editor: u, updateAttributes: d, deleteNode: h, selected: g }
|
|
|
578
593
|
})
|
|
579
594
|
});
|
|
580
595
|
};
|
|
581
|
-
function
|
|
596
|
+
function _(e) {
|
|
582
597
|
let t = 9;
|
|
583
598
|
return e.state.doc.descendants((e) => {
|
|
584
599
|
if (e.type.name === "floatingDialog" && e.attrs.layout === "float") {
|
|
@@ -587,7 +602,7 @@ function g(e) {
|
|
|
587
602
|
}
|
|
588
603
|
}), t + 1;
|
|
589
604
|
}
|
|
590
|
-
var
|
|
605
|
+
var v = c.create({
|
|
591
606
|
name: "floatingDialog",
|
|
592
607
|
group: "block",
|
|
593
608
|
content: "block+",
|
|
@@ -613,15 +628,15 @@ var _ = s.create({
|
|
|
613
628
|
renderHTML({ HTMLAttributes: e }) {
|
|
614
629
|
return [
|
|
615
630
|
"div",
|
|
616
|
-
|
|
631
|
+
f(e, { "data-type": "floating-dialog" }),
|
|
617
632
|
0
|
|
618
633
|
];
|
|
619
634
|
},
|
|
620
635
|
addNodeView() {
|
|
621
|
-
return
|
|
636
|
+
return d(g);
|
|
622
637
|
}
|
|
623
638
|
});
|
|
624
639
|
//#endregion
|
|
625
|
-
export {
|
|
640
|
+
export { v as FloatingDialogExtension, v as default, _ as getNextFloatZIndex };
|
|
626
641
|
|
|
627
642
|
//# sourceMappingURL=FloatingDialog.js.map
|