@windoc/react 0.3.12 → 0.3.14
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/index.d.mts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +898 -590
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +882 -576
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/styles/editor.css +183 -192
package/dist/index.js
CHANGED
|
@@ -65,6 +65,8 @@ __export(index_exports, {
|
|
|
65
65
|
RightAlignTool: () => RightAlignTool,
|
|
66
66
|
SeparatorTool: () => SeparatorTool,
|
|
67
67
|
StrikeoutTool: () => StrikeoutTool,
|
|
68
|
+
TableCellBgColorTool: () => TableCellBgColorTool,
|
|
69
|
+
TableCellBorderColorTool: () => TableCellBorderColorTool,
|
|
68
70
|
TableTool: () => TableTool,
|
|
69
71
|
TitleTool: () => TitleTool,
|
|
70
72
|
UnderlineTool: () => UnderlineTool,
|
|
@@ -77,7 +79,7 @@ __export(index_exports, {
|
|
|
77
79
|
module.exports = __toCommonJS(index_exports);
|
|
78
80
|
|
|
79
81
|
// src/Editor.tsx
|
|
80
|
-
var
|
|
82
|
+
var import_react23 = require("react");
|
|
81
83
|
|
|
82
84
|
// src/EditorContext.tsx
|
|
83
85
|
var import_react = require("react");
|
|
@@ -86,13 +88,14 @@ var EditorContext = (0, import_react.createContext)(null);
|
|
|
86
88
|
function EditorProvider({
|
|
87
89
|
editorRef,
|
|
88
90
|
rangeStyle,
|
|
91
|
+
isInTable,
|
|
89
92
|
children
|
|
90
93
|
}) {
|
|
91
94
|
const [isApple, setIsApple] = (0, import_react.useState)(false);
|
|
92
95
|
(0, import_react.useEffect)(() => {
|
|
93
96
|
setIsApple(/Mac OS X/.test(navigator.userAgent));
|
|
94
97
|
}, []);
|
|
95
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EditorContext.Provider, { value: { editorRef, isApple, rangeStyle }, children });
|
|
98
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EditorContext.Provider, { value: { editorRef, isApple, rangeStyle, isInTable }, children });
|
|
96
99
|
}
|
|
97
100
|
function useEditor() {
|
|
98
101
|
const ctx = (0, import_react.useContext)(EditorContext);
|
|
@@ -183,69 +186,359 @@ function RedoTool() {
|
|
|
183
186
|
);
|
|
184
187
|
}
|
|
185
188
|
|
|
186
|
-
// src/toolbar/
|
|
189
|
+
// src/toolbar/TableCellBgColorTool.tsx
|
|
187
190
|
var import_react3 = require("react");
|
|
191
|
+
var import_lucide_react3 = require("lucide-react");
|
|
188
192
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
189
|
-
|
|
193
|
+
var COLOR_PALETTE = [
|
|
194
|
+
[
|
|
195
|
+
"#000000",
|
|
196
|
+
"#434343",
|
|
197
|
+
"#666666",
|
|
198
|
+
"#999999",
|
|
199
|
+
"#b7b7b7",
|
|
200
|
+
"#cccccc",
|
|
201
|
+
"#d9d9d9",
|
|
202
|
+
"#efefef",
|
|
203
|
+
"#f3f3f3",
|
|
204
|
+
"#ffffff"
|
|
205
|
+
],
|
|
206
|
+
[
|
|
207
|
+
"#980000",
|
|
208
|
+
"#ff0000",
|
|
209
|
+
"#ff9900",
|
|
210
|
+
"#ffff00",
|
|
211
|
+
"#00ff00",
|
|
212
|
+
"#00ffff",
|
|
213
|
+
"#4a86e8",
|
|
214
|
+
"#0000ff",
|
|
215
|
+
"#9900ff",
|
|
216
|
+
"#ff00ff"
|
|
217
|
+
],
|
|
218
|
+
[
|
|
219
|
+
"#e6b8af",
|
|
220
|
+
"#f4cccc",
|
|
221
|
+
"#fce5cd",
|
|
222
|
+
"#fff2cc",
|
|
223
|
+
"#d9ead3",
|
|
224
|
+
"#d0e0e3",
|
|
225
|
+
"#c9daf8",
|
|
226
|
+
"#cfe2f3",
|
|
227
|
+
"#d9d2e9",
|
|
228
|
+
"#ead1dc"
|
|
229
|
+
],
|
|
230
|
+
[
|
|
231
|
+
"#dd7e6b",
|
|
232
|
+
"#ea9999",
|
|
233
|
+
"#f9cb9c",
|
|
234
|
+
"#ffe599",
|
|
235
|
+
"#b6d7a8",
|
|
236
|
+
"#a2c4c9",
|
|
237
|
+
"#a4c2f4",
|
|
238
|
+
"#9fc5e8",
|
|
239
|
+
"#b4a7d6",
|
|
240
|
+
"#d5a6bd"
|
|
241
|
+
],
|
|
242
|
+
[
|
|
243
|
+
"#cc4125",
|
|
244
|
+
"#e06666",
|
|
245
|
+
"#f6b26b",
|
|
246
|
+
"#ffd966",
|
|
247
|
+
"#93c47d",
|
|
248
|
+
"#76a5af",
|
|
249
|
+
"#6d9eeb",
|
|
250
|
+
"#6fa8dc",
|
|
251
|
+
"#8e7cc3",
|
|
252
|
+
"#c27ba0"
|
|
253
|
+
],
|
|
254
|
+
[
|
|
255
|
+
"#a61c00",
|
|
256
|
+
"#cc0000",
|
|
257
|
+
"#e69138",
|
|
258
|
+
"#f1c232",
|
|
259
|
+
"#6aa84f",
|
|
260
|
+
"#45818e",
|
|
261
|
+
"#3c78d8",
|
|
262
|
+
"#3d85c6",
|
|
263
|
+
"#674ea7",
|
|
264
|
+
"#a64d79"
|
|
265
|
+
],
|
|
266
|
+
[
|
|
267
|
+
"#85200c",
|
|
268
|
+
"#990000",
|
|
269
|
+
"#b45f06",
|
|
270
|
+
"#bf9000",
|
|
271
|
+
"#38761d",
|
|
272
|
+
"#134f5c",
|
|
273
|
+
"#1155cc",
|
|
274
|
+
"#0b5394",
|
|
275
|
+
"#351c75",
|
|
276
|
+
"#741b47"
|
|
277
|
+
],
|
|
278
|
+
[
|
|
279
|
+
"#5b0f00",
|
|
280
|
+
"#660000",
|
|
281
|
+
"#783f04",
|
|
282
|
+
"#7f6000",
|
|
283
|
+
"#274e13",
|
|
284
|
+
"#0c343d",
|
|
285
|
+
"#1c4587",
|
|
286
|
+
"#073763",
|
|
287
|
+
"#20124d",
|
|
288
|
+
"#4c1130"
|
|
289
|
+
]
|
|
290
|
+
];
|
|
291
|
+
function TableCellBgColorTool() {
|
|
190
292
|
const { editorRef } = useEditor();
|
|
191
|
-
const
|
|
192
|
-
const [
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
editorRef.current?.command.
|
|
196
|
-
|
|
293
|
+
const dropdownRef = (0, import_react3.useRef)(null);
|
|
294
|
+
const [activeColor, setActiveColor] = (0, import_react3.useState)("");
|
|
295
|
+
const handleColor = (color) => {
|
|
296
|
+
setActiveColor(color);
|
|
297
|
+
editorRef.current?.command.executeTableTdBackgroundColor(color);
|
|
298
|
+
dropdownRef.current?.classList.remove("visible");
|
|
197
299
|
};
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
300
|
+
const handleNone = () => {
|
|
301
|
+
setActiveColor("");
|
|
302
|
+
editorRef.current?.command.executeTableTdBackgroundColor("");
|
|
303
|
+
dropdownRef.current?.classList.remove("visible");
|
|
202
304
|
};
|
|
203
305
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
204
306
|
"div",
|
|
205
307
|
{
|
|
206
|
-
className: "menu-
|
|
207
|
-
|
|
308
|
+
className: "menu-item__td-bg-color",
|
|
309
|
+
title: "Cell background color",
|
|
310
|
+
onClick: () => dropdownRef.current?.classList.toggle("visible"),
|
|
208
311
|
children: [
|
|
209
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
210
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
312
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react3.PaintBucket, { size: 14 }),
|
|
313
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { backgroundColor: activeColor || "transparent", border: activeColor ? "none" : "1px dashed #ccc" } }),
|
|
314
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "color-palette-dropdown", ref: dropdownRef, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { onClick: (e) => e.stopPropagation(), children: [
|
|
315
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { className: "color-palette-reset", onClick: handleNone, children: [
|
|
316
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react3.RotateCcw, { size: 12 }),
|
|
317
|
+
"No fill"
|
|
214
318
|
] }),
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
value: gap,
|
|
226
|
-
onChange: (e) => handleGapChange(Number(e.target.value)),
|
|
227
|
-
onClick: (e) => e.stopPropagation()
|
|
228
|
-
}
|
|
229
|
-
)
|
|
230
|
-
] })
|
|
231
|
-
] })
|
|
319
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "color-palette-grid", children: COLOR_PALETTE.map((row, ri) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "color-palette-row", children: row.map((color) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
320
|
+
"div",
|
|
321
|
+
{
|
|
322
|
+
className: `color-palette-swatch${activeColor.toLowerCase() === color.toLowerCase() ? " active" : ""}`,
|
|
323
|
+
style: { backgroundColor: color },
|
|
324
|
+
onClick: () => handleColor(color),
|
|
325
|
+
title: color
|
|
326
|
+
},
|
|
327
|
+
color
|
|
328
|
+
)) }, ri)) })
|
|
232
329
|
] }) })
|
|
233
330
|
]
|
|
234
331
|
}
|
|
235
332
|
);
|
|
236
333
|
}
|
|
237
334
|
|
|
238
|
-
// src/toolbar/
|
|
335
|
+
// src/toolbar/TableCellBorderColorTool.tsx
|
|
239
336
|
var import_react4 = require("react");
|
|
240
|
-
var
|
|
337
|
+
var import_lucide_react4 = require("lucide-react");
|
|
241
338
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
339
|
+
var COLOR_PALETTE2 = [
|
|
340
|
+
[
|
|
341
|
+
"#000000",
|
|
342
|
+
"#434343",
|
|
343
|
+
"#666666",
|
|
344
|
+
"#999999",
|
|
345
|
+
"#b7b7b7",
|
|
346
|
+
"#cccccc",
|
|
347
|
+
"#d9d9d9",
|
|
348
|
+
"#efefef",
|
|
349
|
+
"#f3f3f3",
|
|
350
|
+
"#ffffff"
|
|
351
|
+
],
|
|
352
|
+
[
|
|
353
|
+
"#980000",
|
|
354
|
+
"#ff0000",
|
|
355
|
+
"#ff9900",
|
|
356
|
+
"#ffff00",
|
|
357
|
+
"#00ff00",
|
|
358
|
+
"#00ffff",
|
|
359
|
+
"#4a86e8",
|
|
360
|
+
"#0000ff",
|
|
361
|
+
"#9900ff",
|
|
362
|
+
"#ff00ff"
|
|
363
|
+
],
|
|
364
|
+
[
|
|
365
|
+
"#e6b8af",
|
|
366
|
+
"#f4cccc",
|
|
367
|
+
"#fce5cd",
|
|
368
|
+
"#fff2cc",
|
|
369
|
+
"#d9ead3",
|
|
370
|
+
"#d0e0e3",
|
|
371
|
+
"#c9daf8",
|
|
372
|
+
"#cfe2f3",
|
|
373
|
+
"#d9d2e9",
|
|
374
|
+
"#ead1dc"
|
|
375
|
+
],
|
|
376
|
+
[
|
|
377
|
+
"#dd7e6b",
|
|
378
|
+
"#ea9999",
|
|
379
|
+
"#f9cb9c",
|
|
380
|
+
"#ffe599",
|
|
381
|
+
"#b6d7a8",
|
|
382
|
+
"#a2c4c9",
|
|
383
|
+
"#a4c2f4",
|
|
384
|
+
"#9fc5e8",
|
|
385
|
+
"#b4a7d6",
|
|
386
|
+
"#d5a6bd"
|
|
387
|
+
],
|
|
388
|
+
[
|
|
389
|
+
"#cc4125",
|
|
390
|
+
"#e06666",
|
|
391
|
+
"#f6b26b",
|
|
392
|
+
"#ffd966",
|
|
393
|
+
"#93c47d",
|
|
394
|
+
"#76a5af",
|
|
395
|
+
"#6d9eeb",
|
|
396
|
+
"#6fa8dc",
|
|
397
|
+
"#8e7cc3",
|
|
398
|
+
"#c27ba0"
|
|
399
|
+
],
|
|
400
|
+
[
|
|
401
|
+
"#a61c00",
|
|
402
|
+
"#cc0000",
|
|
403
|
+
"#e69138",
|
|
404
|
+
"#f1c232",
|
|
405
|
+
"#6aa84f",
|
|
406
|
+
"#45818e",
|
|
407
|
+
"#3c78d8",
|
|
408
|
+
"#3d85c6",
|
|
409
|
+
"#674ea7",
|
|
410
|
+
"#a64d79"
|
|
411
|
+
],
|
|
412
|
+
[
|
|
413
|
+
"#85200c",
|
|
414
|
+
"#990000",
|
|
415
|
+
"#b45f06",
|
|
416
|
+
"#bf9000",
|
|
417
|
+
"#38761d",
|
|
418
|
+
"#134f5c",
|
|
419
|
+
"#1155cc",
|
|
420
|
+
"#0b5394",
|
|
421
|
+
"#351c75",
|
|
422
|
+
"#741b47"
|
|
423
|
+
],
|
|
424
|
+
[
|
|
425
|
+
"#5b0f00",
|
|
426
|
+
"#660000",
|
|
427
|
+
"#783f04",
|
|
428
|
+
"#7f6000",
|
|
429
|
+
"#274e13",
|
|
430
|
+
"#0c343d",
|
|
431
|
+
"#1c4587",
|
|
432
|
+
"#073763",
|
|
433
|
+
"#20124d",
|
|
434
|
+
"#4c1130"
|
|
435
|
+
]
|
|
436
|
+
];
|
|
437
|
+
function TableCellBorderColorTool() {
|
|
438
|
+
const { editorRef } = useEditor();
|
|
439
|
+
const dropdownRef = (0, import_react4.useRef)(null);
|
|
440
|
+
const [activeColor, setActiveColor] = (0, import_react4.useState)("#000000");
|
|
441
|
+
const handleColor = (color) => {
|
|
442
|
+
setActiveColor(color);
|
|
443
|
+
editorRef.current?.command.executeTableTdBorderColor(color);
|
|
444
|
+
dropdownRef.current?.classList.remove("visible");
|
|
445
|
+
};
|
|
446
|
+
const handleReset = () => {
|
|
447
|
+
setActiveColor("#000000");
|
|
448
|
+
editorRef.current?.command.executeTableTdBorderColor("");
|
|
449
|
+
dropdownRef.current?.classList.remove("visible");
|
|
450
|
+
};
|
|
451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
452
|
+
"div",
|
|
453
|
+
{
|
|
454
|
+
className: "menu-item__td-border-color",
|
|
455
|
+
title: "Cell border color",
|
|
456
|
+
onClick: () => dropdownRef.current?.classList.toggle("visible"),
|
|
457
|
+
children: [
|
|
458
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.PenLine, { size: 14 }),
|
|
459
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { backgroundColor: activeColor } }),
|
|
460
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "color-palette-dropdown", ref: dropdownRef, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { onClick: (e) => e.stopPropagation(), children: [
|
|
461
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { className: "color-palette-reset", onClick: handleReset, children: [
|
|
462
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.RotateCcw, { size: 12 }),
|
|
463
|
+
"Reset"
|
|
464
|
+
] }),
|
|
465
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "color-palette-grid", children: COLOR_PALETTE2.map((row, ri) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "color-palette-row", children: row.map((color) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
466
|
+
"div",
|
|
467
|
+
{
|
|
468
|
+
className: `color-palette-swatch${activeColor.toLowerCase() === color.toLowerCase() ? " active" : ""}`,
|
|
469
|
+
style: { backgroundColor: color },
|
|
470
|
+
onClick: () => handleColor(color),
|
|
471
|
+
title: color
|
|
472
|
+
},
|
|
473
|
+
color
|
|
474
|
+
)) }, ri)) })
|
|
475
|
+
] }) })
|
|
476
|
+
]
|
|
477
|
+
}
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// src/toolbar/ColumnTool.tsx
|
|
482
|
+
var import_react5 = require("react");
|
|
483
|
+
var import_lucide_react5 = require("lucide-react");
|
|
484
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
485
|
+
function ColumnTool() {
|
|
486
|
+
const { editorRef } = useEditor();
|
|
487
|
+
const optionsRef = (0, import_react5.useRef)(null);
|
|
488
|
+
const [currentColumns, setCurrentColumns] = (0, import_react5.useState)(1);
|
|
489
|
+
const [gap, setGap] = (0, import_react5.useState)(20);
|
|
490
|
+
const toggle = () => optionsRef.current?.classList.toggle("visible");
|
|
491
|
+
const handleColumn = (col) => {
|
|
492
|
+
editorRef.current?.command.executeColumnCount(col);
|
|
493
|
+
setCurrentColumns(col);
|
|
494
|
+
};
|
|
495
|
+
const handleGapChange = (value) => {
|
|
496
|
+
const clampedValue = Math.max(0, Math.min(100, value));
|
|
497
|
+
setGap(clampedValue);
|
|
498
|
+
editorRef.current?.command.executeColumnGap(clampedValue);
|
|
499
|
+
};
|
|
500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "menu-item__select-group", children: [
|
|
501
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "menu-item__select-text", title: "Column Layout", onClick: toggle, children: currentColumns === 1 ? "1 Column" : `${currentColumns} Columns` }),
|
|
502
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "menu-item__select-arrow", onClick: toggle, children: [
|
|
503
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.ChevronDown, { size: 10, strokeWidth: 2.5 }),
|
|
504
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "options", ref: optionsRef, style: { width: "130px" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { onClick: (e) => e.stopPropagation(), children: [
|
|
505
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("ul", { children: [
|
|
506
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { onClick: () => handleColumn(1), children: "1 Column" }),
|
|
507
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { onClick: () => handleColumn(2), children: "2 Columns" })
|
|
508
|
+
] }),
|
|
509
|
+
currentColumns > 1 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
510
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "option-divider" }),
|
|
511
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "option-row", children: [
|
|
512
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { children: "Gap (px)" }),
|
|
513
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
514
|
+
"input",
|
|
515
|
+
{
|
|
516
|
+
type: "number",
|
|
517
|
+
min: 0,
|
|
518
|
+
max: 100,
|
|
519
|
+
value: gap,
|
|
520
|
+
onChange: (e) => handleGapChange(Number(e.target.value)),
|
|
521
|
+
onClick: (e) => e.stopPropagation()
|
|
522
|
+
}
|
|
523
|
+
)
|
|
524
|
+
] })
|
|
525
|
+
] })
|
|
526
|
+
] }) })
|
|
527
|
+
] })
|
|
528
|
+
] });
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// src/toolbar/TableTool.tsx
|
|
532
|
+
var import_react6 = require("react");
|
|
533
|
+
var import_lucide_react6 = require("lucide-react");
|
|
534
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
242
535
|
function TableTool() {
|
|
243
536
|
const { editorRef } = useEditor();
|
|
244
|
-
const [visible, setVisible] = (0,
|
|
245
|
-
const [hoverRow, setHoverRow] = (0,
|
|
246
|
-
const [hoverCol, setHoverCol] = (0,
|
|
247
|
-
const containerRef = (0,
|
|
248
|
-
(0,
|
|
537
|
+
const [visible, setVisible] = (0, import_react6.useState)(false);
|
|
538
|
+
const [hoverRow, setHoverRow] = (0, import_react6.useState)(0);
|
|
539
|
+
const [hoverCol, setHoverCol] = (0, import_react6.useState)(0);
|
|
540
|
+
const containerRef = (0, import_react6.useRef)(null);
|
|
541
|
+
(0, import_react6.useEffect)(() => {
|
|
249
542
|
if (!visible) return;
|
|
250
543
|
const handleClickOutside = (e) => {
|
|
251
544
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -265,18 +558,18 @@ function TableTool() {
|
|
|
265
558
|
setHoverRow(0);
|
|
266
559
|
setHoverCol(0);
|
|
267
560
|
};
|
|
268
|
-
return /* @__PURE__ */ (0,
|
|
269
|
-
/* @__PURE__ */ (0,
|
|
270
|
-
|
|
561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { ref: containerRef, className: "menu-item__table", title: "Table", children: [
|
|
562
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
563
|
+
import_lucide_react6.Table,
|
|
271
564
|
{
|
|
272
565
|
size: 16,
|
|
273
566
|
onClick: () => setVisible(!visible),
|
|
274
567
|
style: { cursor: "pointer" }
|
|
275
568
|
}
|
|
276
569
|
),
|
|
277
|
-
visible && /* @__PURE__ */ (0,
|
|
278
|
-
/* @__PURE__ */ (0,
|
|
279
|
-
/* @__PURE__ */ (0,
|
|
570
|
+
visible && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "table-dropdown", children: [
|
|
571
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "table-dropdown-header", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: hoverRow > 0 ? `${hoverRow} \xD7 ${hoverCol}` : "Insert Table" }) }),
|
|
572
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "table-dropdown-grid", onClick: handleInsertTable, children: Array.from({ length: 8 }).map((_, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "table-dropdown-row", children: Array.from({ length: 8 }).map((_2, colIdx) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
280
573
|
"div",
|
|
281
574
|
{
|
|
282
575
|
className: `table-dropdown-cell ${rowIdx < hoverRow && colIdx < hoverCol ? "active" : ""}`,
|
|
@@ -292,8 +585,9 @@ function TableTool() {
|
|
|
292
585
|
}
|
|
293
586
|
|
|
294
587
|
// src/toolbar/TitleTool.tsx
|
|
295
|
-
var
|
|
296
|
-
var
|
|
588
|
+
var import_react7 = require("react");
|
|
589
|
+
var import_lucide_react7 = require("lucide-react");
|
|
590
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
297
591
|
var LEVELS = [
|
|
298
592
|
{ level: null, label: "Body" },
|
|
299
593
|
{ level: "first", label: "Heading 1" },
|
|
@@ -305,37 +599,37 @@ var LEVELS = [
|
|
|
305
599
|
];
|
|
306
600
|
function TitleTool() {
|
|
307
601
|
const { editorRef, rangeStyle } = useEditor();
|
|
308
|
-
const optionsRef = (0,
|
|
602
|
+
const optionsRef = (0, import_react7.useRef)(null);
|
|
309
603
|
const activeLevel = rangeStyle?.level || null;
|
|
310
604
|
const activeLabel = LEVELS.find((l) => l.level === activeLevel)?.label || "Body";
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
"div",
|
|
316
|
-
|
|
317
|
-
className: "
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
onClick: () => handleTitle(level),
|
|
327
|
-
children: label
|
|
605
|
+
const toggle = () => optionsRef.current?.classList.toggle("visible");
|
|
606
|
+
const close = () => optionsRef.current?.classList.remove("visible");
|
|
607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "menu-item__select-group", children: [
|
|
608
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "menu-item__select-text", title: "Toggle Heading", onClick: toggle, children: activeLabel }),
|
|
609
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "menu-item__select-arrow", onClick: toggle, children: [
|
|
610
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.ChevronDown, { size: 10, strokeWidth: 2.5 }),
|
|
611
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "options", ref: optionsRef, style: { width: "100px" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("ul", { children: LEVELS.map(({ level, label }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
612
|
+
"li",
|
|
613
|
+
{
|
|
614
|
+
className: activeLevel === level ? "active" : "",
|
|
615
|
+
...level ? { "data-level": level } : {},
|
|
616
|
+
onClick: (e) => {
|
|
617
|
+
e.stopPropagation();
|
|
618
|
+
editorRef.current?.command.executeTitle(level);
|
|
619
|
+
close();
|
|
328
620
|
},
|
|
329
|
-
label
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
621
|
+
children: label
|
|
622
|
+
},
|
|
623
|
+
label
|
|
624
|
+
)) }) })
|
|
625
|
+
] })
|
|
626
|
+
] });
|
|
334
627
|
}
|
|
335
628
|
|
|
336
629
|
// src/toolbar/FontTool.tsx
|
|
337
|
-
var
|
|
338
|
-
var
|
|
630
|
+
var import_react8 = require("react");
|
|
631
|
+
var import_lucide_react8 = require("lucide-react");
|
|
632
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
339
633
|
var FONTS = [
|
|
340
634
|
{ family: "Arial", label: "Arial" },
|
|
341
635
|
{ family: "Times New Roman", label: "Times New Roman" },
|
|
@@ -348,105 +642,104 @@ var FONTS = [
|
|
|
348
642
|
];
|
|
349
643
|
function FontTool() {
|
|
350
644
|
const { editorRef, rangeStyle } = useEditor();
|
|
351
|
-
const optionsRef = (0,
|
|
645
|
+
const optionsRef = (0, import_react8.useRef)(null);
|
|
352
646
|
const activeFont = rangeStyle?.font || "Arial";
|
|
353
647
|
const activeLabel = FONTS.find((f) => f.family === activeFont)?.label || activeFont;
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
"div",
|
|
359
|
-
|
|
360
|
-
className: "
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
{
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
onClick: () => handleFont(family),
|
|
371
|
-
children: label
|
|
648
|
+
const toggle = () => optionsRef.current?.classList.toggle("visible");
|
|
649
|
+
const close = () => optionsRef.current?.classList.remove("visible");
|
|
650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "menu-item__select-group", children: [
|
|
651
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "menu-item__select-text", title: "Font", onClick: toggle, children: activeLabel }),
|
|
652
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "menu-item__select-arrow", onClick: toggle, children: [
|
|
653
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.ChevronDown, { size: 10, strokeWidth: 2.5 }),
|
|
654
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "options", ref: optionsRef, style: { width: "150px" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { children: FONTS.map(({ family, label }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
655
|
+
"li",
|
|
656
|
+
{
|
|
657
|
+
"data-family": family,
|
|
658
|
+
className: activeFont === family ? "active" : "",
|
|
659
|
+
style: { fontFamily: family },
|
|
660
|
+
onClick: (e) => {
|
|
661
|
+
e.stopPropagation();
|
|
662
|
+
editorRef.current?.command.executeFont(family);
|
|
663
|
+
close();
|
|
372
664
|
},
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
665
|
+
children: label
|
|
666
|
+
},
|
|
667
|
+
family
|
|
668
|
+
)) }) })
|
|
669
|
+
] })
|
|
670
|
+
] });
|
|
378
671
|
}
|
|
379
672
|
|
|
380
673
|
// src/toolbar/FontSizeTool.tsx
|
|
381
|
-
var
|
|
382
|
-
var
|
|
674
|
+
var import_react9 = require("react");
|
|
675
|
+
var import_lucide_react9 = require("lucide-react");
|
|
676
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
383
677
|
var SIZES = [72, 48, 36, 24, 20, 18, 16, 14, 12, 11, 10, 9, 8, 7];
|
|
384
678
|
function FontSizeTool() {
|
|
385
679
|
const { editorRef, rangeStyle } = useEditor();
|
|
386
|
-
const optionsRef = (0,
|
|
680
|
+
const optionsRef = (0, import_react9.useRef)(null);
|
|
387
681
|
const activeSize = rangeStyle?.size ?? 11;
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
"div",
|
|
393
|
-
|
|
394
|
-
className: "
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
onClick: () => handleSize(size),
|
|
403
|
-
children: size
|
|
682
|
+
const toggle = () => optionsRef.current?.classList.toggle("visible");
|
|
683
|
+
const close = () => optionsRef.current?.classList.remove("visible");
|
|
684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "menu-item__select-group", children: [
|
|
685
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "menu-item__select-text", title: "Font Size", onClick: toggle, children: activeSize }),
|
|
686
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "menu-item__select-arrow", onClick: toggle, children: [
|
|
687
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.ChevronDown, { size: 10, strokeWidth: 2.5 }),
|
|
688
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "options", ref: optionsRef, style: { width: "60px" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("ul", { children: SIZES.map((size) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
689
|
+
"li",
|
|
690
|
+
{
|
|
691
|
+
className: activeSize === size ? "active" : "",
|
|
692
|
+
onClick: (e) => {
|
|
693
|
+
e.stopPropagation();
|
|
694
|
+
editorRef.current?.command.executeSize(size);
|
|
695
|
+
close();
|
|
404
696
|
},
|
|
405
|
-
size
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
697
|
+
children: size
|
|
698
|
+
},
|
|
699
|
+
size
|
|
700
|
+
)) }) })
|
|
701
|
+
] })
|
|
702
|
+
] });
|
|
410
703
|
}
|
|
411
704
|
|
|
412
705
|
// src/toolbar/LineHeightTool.tsx
|
|
413
|
-
var
|
|
414
|
-
var
|
|
706
|
+
var import_react10 = require("react");
|
|
707
|
+
var import_lucide_react10 = require("lucide-react");
|
|
708
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
415
709
|
var LINE_HEIGHTS = ["1.0", "1.15", "1.5", "2.0", "2.5"];
|
|
416
710
|
function LineHeightTool() {
|
|
417
711
|
const { editorRef, rangeStyle } = useEditor();
|
|
418
|
-
const optionsRef = (0,
|
|
712
|
+
const optionsRef = (0, import_react10.useRef)(null);
|
|
419
713
|
const activeMargin = rangeStyle?.rowMargin ?? 1;
|
|
420
714
|
const activeLabel = Number.isInteger(activeMargin) ? `${activeMargin}.0` : String(activeMargin);
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
"div",
|
|
426
|
-
|
|
427
|
-
className: "
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
onClick: () => handleLineHeight(h),
|
|
436
|
-
children: h
|
|
715
|
+
const toggle = () => optionsRef.current?.classList.toggle("visible");
|
|
716
|
+
const close = () => optionsRef.current?.classList.remove("visible");
|
|
717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "menu-item__select-group", children: [
|
|
718
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "menu-item__select-text", title: "Line Height", onClick: toggle, children: activeLabel }),
|
|
719
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "menu-item__select-arrow", onClick: toggle, children: [
|
|
720
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react10.ChevronDown, { size: 10, strokeWidth: 2.5 }),
|
|
721
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "options", ref: optionsRef, style: { width: "60px" }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { children: LINE_HEIGHTS.map((h) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
722
|
+
"li",
|
|
723
|
+
{
|
|
724
|
+
className: String(activeMargin) === h || activeLabel === h ? "active" : "",
|
|
725
|
+
onClick: (e) => {
|
|
726
|
+
e.stopPropagation();
|
|
727
|
+
editorRef.current?.command.executeRowMargin(Number(h));
|
|
728
|
+
close();
|
|
437
729
|
},
|
|
438
|
-
h
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
730
|
+
children: h
|
|
731
|
+
},
|
|
732
|
+
h
|
|
733
|
+
)) }) })
|
|
734
|
+
] })
|
|
735
|
+
] });
|
|
443
736
|
}
|
|
444
737
|
|
|
445
738
|
// src/toolbar/ColorTool.tsx
|
|
446
|
-
var
|
|
447
|
-
var
|
|
448
|
-
var
|
|
449
|
-
var
|
|
739
|
+
var import_react11 = require("react");
|
|
740
|
+
var import_lucide_react11 = require("lucide-react");
|
|
741
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
742
|
+
var COLOR_PALETTE3 = [
|
|
450
743
|
[
|
|
451
744
|
"#000000",
|
|
452
745
|
"#434343",
|
|
@@ -546,7 +839,7 @@ var COLOR_PALETTE = [
|
|
|
546
839
|
];
|
|
547
840
|
function ColorTool() {
|
|
548
841
|
const { editorRef, rangeStyle } = useEditor();
|
|
549
|
-
const dropdownRef = (0,
|
|
842
|
+
const dropdownRef = (0, import_react11.useRef)(null);
|
|
550
843
|
const activeColor = rangeStyle?.color || "#000000";
|
|
551
844
|
const handleColor = (color) => {
|
|
552
845
|
editorRef.current?.command.executeColor(color);
|
|
@@ -554,22 +847,22 @@ function ColorTool() {
|
|
|
554
847
|
const handleReset = () => {
|
|
555
848
|
editorRef.current?.command.executeColor(null);
|
|
556
849
|
};
|
|
557
|
-
return /* @__PURE__ */ (0,
|
|
850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
558
851
|
"div",
|
|
559
852
|
{
|
|
560
853
|
className: "menu-item__color",
|
|
561
854
|
title: "Font Color",
|
|
562
855
|
onClick: () => dropdownRef.current?.classList.toggle("visible"),
|
|
563
856
|
children: [
|
|
564
|
-
/* @__PURE__ */ (0,
|
|
565
|
-
/* @__PURE__ */ (0,
|
|
566
|
-
/* @__PURE__ */ (0,
|
|
567
|
-
/* @__PURE__ */ (0,
|
|
568
|
-
/* @__PURE__ */ (0,
|
|
569
|
-
/* @__PURE__ */ (0,
|
|
857
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react11.Baseline, { size: 16 }),
|
|
858
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { backgroundColor: activeColor } }),
|
|
859
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { id: "color", type: "color", readOnly: true, tabIndex: -1 }),
|
|
860
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "color-palette-dropdown", ref: dropdownRef, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { onClick: (e) => e.stopPropagation(), children: [
|
|
861
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { className: "color-palette-reset", onClick: handleReset, children: [
|
|
862
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react11.RotateCcw, { size: 12 }),
|
|
570
863
|
"Reset"
|
|
571
864
|
] }),
|
|
572
|
-
/* @__PURE__ */ (0,
|
|
865
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "color-palette-grid", children: COLOR_PALETTE3.map((row, ri) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "color-palette-row", children: row.map((color) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
573
866
|
"div",
|
|
574
867
|
{
|
|
575
868
|
className: `color-palette-swatch${activeColor.toLowerCase() === color.toLowerCase() ? " active" : ""}`,
|
|
@@ -586,9 +879,9 @@ function ColorTool() {
|
|
|
586
879
|
}
|
|
587
880
|
|
|
588
881
|
// src/toolbar/HighlightTool.tsx
|
|
589
|
-
var
|
|
590
|
-
var
|
|
591
|
-
var
|
|
882
|
+
var import_react12 = require("react");
|
|
883
|
+
var import_lucide_react12 = require("lucide-react");
|
|
884
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
592
885
|
var HIGHLIGHT_PALETTE = [
|
|
593
886
|
[
|
|
594
887
|
"#000000",
|
|
@@ -689,7 +982,7 @@ var HIGHLIGHT_PALETTE = [
|
|
|
689
982
|
];
|
|
690
983
|
function HighlightTool() {
|
|
691
984
|
const { editorRef, rangeStyle } = useEditor();
|
|
692
|
-
const dropdownRef = (0,
|
|
985
|
+
const dropdownRef = (0, import_react12.useRef)(null);
|
|
693
986
|
const activeColor = rangeStyle?.highlight || "";
|
|
694
987
|
const handleColor = (color) => {
|
|
695
988
|
editorRef.current?.command.executeHighlight(color);
|
|
@@ -697,22 +990,22 @@ function HighlightTool() {
|
|
|
697
990
|
const handleReset = () => {
|
|
698
991
|
editorRef.current?.command.executeHighlight(null);
|
|
699
992
|
};
|
|
700
|
-
return /* @__PURE__ */ (0,
|
|
993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
701
994
|
"div",
|
|
702
995
|
{
|
|
703
996
|
className: "menu-item__highlight",
|
|
704
997
|
title: "Highlight",
|
|
705
998
|
onClick: () => dropdownRef.current?.classList.toggle("visible"),
|
|
706
999
|
children: [
|
|
707
|
-
/* @__PURE__ */ (0,
|
|
708
|
-
/* @__PURE__ */ (0,
|
|
709
|
-
/* @__PURE__ */ (0,
|
|
710
|
-
/* @__PURE__ */ (0,
|
|
711
|
-
/* @__PURE__ */ (0,
|
|
712
|
-
/* @__PURE__ */ (0,
|
|
1000
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Highlighter, { size: 16 }),
|
|
1001
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { backgroundColor: activeColor || "#ffff00" } }),
|
|
1002
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { id: "highlight", type: "color", readOnly: true, tabIndex: -1 }),
|
|
1003
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "color-palette-dropdown", ref: dropdownRef, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { onClick: (e) => e.stopPropagation(), children: [
|
|
1004
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { className: "color-palette-reset", onClick: handleReset, children: [
|
|
1005
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.RotateCcw, { size: 12 }),
|
|
713
1006
|
"None"
|
|
714
1007
|
] }),
|
|
715
|
-
/* @__PURE__ */ (0,
|
|
1008
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "color-palette-grid", children: HIGHLIGHT_PALETTE.map((row, ri) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "color-palette-row", children: row.map((color) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
716
1009
|
"div",
|
|
717
1010
|
{
|
|
718
1011
|
className: `color-palette-swatch${activeColor && activeColor.toLowerCase() === color.toLowerCase() ? " active" : ""}`,
|
|
@@ -729,174 +1022,173 @@ function HighlightTool() {
|
|
|
729
1022
|
}
|
|
730
1023
|
|
|
731
1024
|
// src/toolbar/BoldTool.tsx
|
|
732
|
-
var
|
|
733
|
-
var
|
|
1025
|
+
var import_lucide_react13 = require("lucide-react");
|
|
1026
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
734
1027
|
function BoldTool() {
|
|
735
1028
|
const { editorRef, isApple, rangeStyle } = useEditor();
|
|
736
1029
|
const isActive = rangeStyle?.bold === true;
|
|
737
|
-
return /* @__PURE__ */ (0,
|
|
1030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
738
1031
|
"div",
|
|
739
1032
|
{
|
|
740
1033
|
className: `menu-item__bold ${isActive ? "active" : ""}`,
|
|
741
1034
|
title: `Bold(${isApple ? "\u2318" : "Ctrl"}+B)`,
|
|
742
1035
|
onClick: () => editorRef.current?.command.executeBold(),
|
|
743
|
-
children: /* @__PURE__ */ (0,
|
|
1036
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react13.Bold, { size: 16 })
|
|
744
1037
|
}
|
|
745
1038
|
);
|
|
746
1039
|
}
|
|
747
1040
|
|
|
748
1041
|
// src/toolbar/ItalicTool.tsx
|
|
749
|
-
var
|
|
750
|
-
var
|
|
1042
|
+
var import_lucide_react14 = require("lucide-react");
|
|
1043
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
751
1044
|
function ItalicTool() {
|
|
752
1045
|
const { editorRef, isApple, rangeStyle } = useEditor();
|
|
753
1046
|
const isActive = rangeStyle?.italic === true;
|
|
754
|
-
return /* @__PURE__ */ (0,
|
|
1047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
755
1048
|
"div",
|
|
756
1049
|
{
|
|
757
1050
|
className: `menu-item__italic ${isActive ? "active" : ""}`,
|
|
758
1051
|
title: `Italic(${isApple ? "\u2318" : "Ctrl"}+I)`,
|
|
759
1052
|
onClick: () => editorRef.current?.command.executeItalic(),
|
|
760
|
-
children: /* @__PURE__ */ (0,
|
|
1053
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react14.Italic, { size: 16 })
|
|
761
1054
|
}
|
|
762
1055
|
);
|
|
763
1056
|
}
|
|
764
1057
|
|
|
765
1058
|
// src/toolbar/UnderlineTool.tsx
|
|
766
|
-
var
|
|
767
|
-
var
|
|
768
|
-
var
|
|
1059
|
+
var import_react13 = require("react");
|
|
1060
|
+
var import_lucide_react15 = require("lucide-react");
|
|
1061
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
769
1062
|
var STYLES = ["solid", "double", "dashed", "dotted", "wavy"];
|
|
770
1063
|
function UnderlineTool() {
|
|
771
1064
|
const { editorRef, isApple, rangeStyle } = useEditor();
|
|
772
|
-
const optionsRef = (0,
|
|
1065
|
+
const optionsRef = (0, import_react13.useRef)(null);
|
|
773
1066
|
const isActive = rangeStyle?.underline === true;
|
|
774
|
-
return /* @__PURE__ */ (0,
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
{
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
1067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "menu-item__underline-group", children: [
|
|
1068
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1069
|
+
"div",
|
|
1070
|
+
{
|
|
1071
|
+
className: `menu-item__underline-btn${isActive ? " active" : ""}`,
|
|
1072
|
+
title: `Underline(${isApple ? "\u2318" : "Ctrl"}+U)`,
|
|
1073
|
+
onClick: () => editorRef.current?.command.executeUnderline(),
|
|
1074
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react15.Underline, { size: 16 })
|
|
1075
|
+
}
|
|
1076
|
+
),
|
|
1077
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1078
|
+
"div",
|
|
1079
|
+
{
|
|
1080
|
+
className: "menu-item__underline-arrow",
|
|
1081
|
+
onClick: () => optionsRef.current?.classList.toggle("visible"),
|
|
1082
|
+
children: [
|
|
1083
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react15.ChevronDown, { size: 10, strokeWidth: 2.5 }),
|
|
1084
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "options", ref: optionsRef, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { children: STYLES.map((style) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1085
|
+
"li",
|
|
1086
|
+
{
|
|
1087
|
+
"data-decoration-style": style,
|
|
1088
|
+
onClick: (e) => {
|
|
1089
|
+
e.stopPropagation();
|
|
1090
|
+
editorRef.current?.command.executeUnderline({ style });
|
|
1091
|
+
optionsRef.current?.classList.remove("visible");
|
|
1092
|
+
},
|
|
1093
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", {})
|
|
801
1094
|
},
|
|
802
|
-
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
);
|
|
1095
|
+
style
|
|
1096
|
+
)) }) })
|
|
1097
|
+
]
|
|
1098
|
+
}
|
|
1099
|
+
)
|
|
1100
|
+
] });
|
|
809
1101
|
}
|
|
810
1102
|
|
|
811
1103
|
// src/toolbar/StrikeoutTool.tsx
|
|
812
|
-
var
|
|
813
|
-
var
|
|
1104
|
+
var import_lucide_react16 = require("lucide-react");
|
|
1105
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
814
1106
|
function StrikeoutTool() {
|
|
815
1107
|
const { editorRef, rangeStyle } = useEditor();
|
|
816
1108
|
const isActive = rangeStyle?.strikeout === true;
|
|
817
|
-
return /* @__PURE__ */ (0,
|
|
1109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
818
1110
|
"div",
|
|
819
1111
|
{
|
|
820
1112
|
className: `menu-item__strikeout ${isActive ? "active" : ""}`,
|
|
821
1113
|
title: "Strikethrough",
|
|
822
1114
|
onClick: () => editorRef.current?.command.executeStrikeout(),
|
|
823
|
-
children: /* @__PURE__ */ (0,
|
|
1115
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react16.Strikethrough, { size: 16 })
|
|
824
1116
|
}
|
|
825
1117
|
);
|
|
826
1118
|
}
|
|
827
1119
|
|
|
828
1120
|
// src/toolbar/LeftAlignTool.tsx
|
|
829
|
-
var
|
|
830
|
-
var
|
|
1121
|
+
var import_lucide_react17 = require("lucide-react");
|
|
1122
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
831
1123
|
function LeftAlignTool() {
|
|
832
1124
|
const { editorRef, isApple, rangeStyle } = useEditor();
|
|
833
1125
|
const isActive = !rangeStyle?.rowFlex || rangeStyle.rowFlex === "left";
|
|
834
|
-
return /* @__PURE__ */ (0,
|
|
1126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
835
1127
|
"div",
|
|
836
1128
|
{
|
|
837
1129
|
className: `menu-item__left ${isActive ? "active" : ""}`,
|
|
838
1130
|
title: `Left align(${isApple ? "\u2318" : "Ctrl"}+L)`,
|
|
839
1131
|
onClick: () => editorRef.current?.command.executeRowFlex("left"),
|
|
840
|
-
children: /* @__PURE__ */ (0,
|
|
1132
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react17.AlignLeft, { size: 16 })
|
|
841
1133
|
}
|
|
842
1134
|
);
|
|
843
1135
|
}
|
|
844
1136
|
|
|
845
1137
|
// src/toolbar/CenterAlignTool.tsx
|
|
846
|
-
var
|
|
847
|
-
var
|
|
1138
|
+
var import_lucide_react18 = require("lucide-react");
|
|
1139
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
848
1140
|
function CenterAlignTool() {
|
|
849
1141
|
const { editorRef, isApple, rangeStyle } = useEditor();
|
|
850
1142
|
const isActive = rangeStyle?.rowFlex === "center";
|
|
851
|
-
return /* @__PURE__ */ (0,
|
|
1143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
852
1144
|
"div",
|
|
853
1145
|
{
|
|
854
1146
|
className: `menu-item__center ${isActive ? "active" : ""}`,
|
|
855
1147
|
title: `Center align(${isApple ? "\u2318" : "Ctrl"}+E)`,
|
|
856
1148
|
onClick: () => editorRef.current?.command.executeRowFlex("center"),
|
|
857
|
-
children: /* @__PURE__ */ (0,
|
|
1149
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react18.AlignCenter, { size: 16 })
|
|
858
1150
|
}
|
|
859
1151
|
);
|
|
860
1152
|
}
|
|
861
1153
|
|
|
862
1154
|
// src/toolbar/RightAlignTool.tsx
|
|
863
|
-
var
|
|
864
|
-
var
|
|
1155
|
+
var import_lucide_react19 = require("lucide-react");
|
|
1156
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
865
1157
|
function RightAlignTool() {
|
|
866
1158
|
const { editorRef, isApple, rangeStyle } = useEditor();
|
|
867
1159
|
const isActive = rangeStyle?.rowFlex === "right";
|
|
868
|
-
return /* @__PURE__ */ (0,
|
|
1160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
869
1161
|
"div",
|
|
870
1162
|
{
|
|
871
1163
|
className: `menu-item__right ${isActive ? "active" : ""}`,
|
|
872
1164
|
title: `Right align(${isApple ? "\u2318" : "Ctrl"}+R)`,
|
|
873
1165
|
onClick: () => editorRef.current?.command.executeRowFlex("right"),
|
|
874
|
-
children: /* @__PURE__ */ (0,
|
|
1166
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react19.AlignRight, { size: 16 })
|
|
875
1167
|
}
|
|
876
1168
|
);
|
|
877
1169
|
}
|
|
878
1170
|
|
|
879
1171
|
// src/toolbar/JustifyTool.tsx
|
|
880
|
-
var
|
|
881
|
-
var
|
|
1172
|
+
var import_lucide_react20 = require("lucide-react");
|
|
1173
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
882
1174
|
function JustifyTool() {
|
|
883
1175
|
const { editorRef, isApple, rangeStyle } = useEditor();
|
|
884
1176
|
const isActive = rangeStyle?.rowFlex === "justify" || rangeStyle?.rowFlex === "alignment";
|
|
885
|
-
return /* @__PURE__ */ (0,
|
|
1177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
886
1178
|
"div",
|
|
887
1179
|
{
|
|
888
1180
|
className: `menu-item__justify ${isActive ? "active" : ""}`,
|
|
889
1181
|
title: `Distribute(${isApple ? "\u2318" : "Ctrl"}+Shift+J)`,
|
|
890
1182
|
onClick: () => editorRef.current?.command.executeRowFlex("justify"),
|
|
891
|
-
children: /* @__PURE__ */ (0,
|
|
1183
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react20.AlignJustify, { size: 16 })
|
|
892
1184
|
}
|
|
893
1185
|
);
|
|
894
1186
|
}
|
|
895
1187
|
|
|
896
1188
|
// src/toolbar/ListTool.tsx
|
|
897
|
-
var
|
|
898
|
-
var
|
|
899
|
-
var
|
|
1189
|
+
var import_react14 = require("react");
|
|
1190
|
+
var import_lucide_react21 = require("lucide-react");
|
|
1191
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
900
1192
|
var OL_PRESETS = [
|
|
901
1193
|
{ preset: "olDefault", label: "Default", preview: ["1.", "a.", "i."] },
|
|
902
1194
|
{ preset: "olParen", label: "Parenthesis", preview: ["1)", "a)", "i)"] },
|
|
@@ -917,14 +1209,14 @@ function PresetCell({
|
|
|
917
1209
|
option,
|
|
918
1210
|
onClick
|
|
919
1211
|
}) {
|
|
920
|
-
return /* @__PURE__ */ (0,
|
|
1212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { onClick, className: "list-preset-cell", title: option.label, children: option.preview.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
921
1213
|
"div",
|
|
922
1214
|
{
|
|
923
1215
|
className: "list-preset-line",
|
|
924
1216
|
style: { paddingLeft: `${i * 10}px` },
|
|
925
1217
|
children: [
|
|
926
|
-
/* @__PURE__ */ (0,
|
|
927
|
-
/* @__PURE__ */ (0,
|
|
1218
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "list-preset-marker", children: item }),
|
|
1219
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "list-preset-text" })
|
|
928
1220
|
]
|
|
929
1221
|
},
|
|
930
1222
|
i
|
|
@@ -932,13 +1224,9 @@ function PresetCell({
|
|
|
932
1224
|
}
|
|
933
1225
|
function ListTool() {
|
|
934
1226
|
const { editorRef, isApple, rangeStyle } = useEditor();
|
|
935
|
-
const optionsRef = (0,
|
|
1227
|
+
const optionsRef = (0, import_react14.useRef)(null);
|
|
936
1228
|
const isActive = !!rangeStyle?.listType;
|
|
937
1229
|
const close = () => optionsRef.current?.classList.remove("visible");
|
|
938
|
-
const handleList = (type, style) => {
|
|
939
|
-
editorRef.current?.command.executeList(type, style);
|
|
940
|
-
close();
|
|
941
|
-
};
|
|
942
1230
|
const handlePreset = (type, preset) => {
|
|
943
1231
|
const style = type === "ol" ? "decimal" : "disc";
|
|
944
1232
|
editorRef.current?.command.executeListWithPreset(type, style, preset);
|
|
@@ -954,114 +1242,122 @@ function ListTool() {
|
|
|
954
1242
|
editorRef.current?.command.executeListOutdent();
|
|
955
1243
|
close();
|
|
956
1244
|
};
|
|
957
|
-
return /* @__PURE__ */ (0,
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "menu-item__list-group", children: [
|
|
1246
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1247
|
+
"div",
|
|
1248
|
+
{
|
|
1249
|
+
className: `menu-item__list-btn${isActive ? " active" : ""}`,
|
|
1250
|
+
title: `List(${isApple ? "\u2318" : "Ctrl"}+Shift+U)`,
|
|
1251
|
+
onClick: () => handlePreset("ul", "ulDefault"),
|
|
1252
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react21.List, { size: 16 })
|
|
1253
|
+
}
|
|
1254
|
+
),
|
|
1255
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1256
|
+
"div",
|
|
1257
|
+
{
|
|
1258
|
+
className: "menu-item__list-arrow",
|
|
1259
|
+
onClick: () => optionsRef.current?.classList.toggle("visible"),
|
|
1260
|
+
children: [
|
|
1261
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react21.ChevronDown, { size: 10, strokeWidth: 2.5 }),
|
|
1262
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "options", ref: optionsRef, style: { width: "320px" }, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { padding: "8px" }, children: [
|
|
1263
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { display: "flex", gap: "4px", marginBottom: "8px" }, children: [
|
|
1264
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1265
|
+
"button",
|
|
1266
|
+
{
|
|
1267
|
+
onClick: (e) => {
|
|
1268
|
+
e.stopPropagation();
|
|
1269
|
+
editorRef.current?.command.executeList("ul", "checkbox");
|
|
1270
|
+
close();
|
|
1271
|
+
},
|
|
1272
|
+
className: "list-quick-btn",
|
|
1273
|
+
children: "Checkbox"
|
|
1274
|
+
}
|
|
1275
|
+
),
|
|
1276
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1277
|
+
"button",
|
|
1278
|
+
{
|
|
1279
|
+
onClick: handleIndent,
|
|
1280
|
+
className: "list-quick-btn",
|
|
1281
|
+
title: "Indent (Tab)",
|
|
1282
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react21.Indent, { size: 14 })
|
|
1283
|
+
}
|
|
1284
|
+
),
|
|
1285
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1286
|
+
"button",
|
|
1287
|
+
{
|
|
1288
|
+
onClick: handleOutdent,
|
|
1289
|
+
className: "list-quick-btn",
|
|
1290
|
+
title: "Outdent (Shift+Tab)",
|
|
1291
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react21.Outdent, { size: 14 })
|
|
1292
|
+
}
|
|
1293
|
+
)
|
|
1294
|
+
] }),
|
|
1295
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { marginBottom: "8px" }, children: [
|
|
1296
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1297
|
+
"div",
|
|
1298
|
+
{
|
|
1299
|
+
style: {
|
|
1300
|
+
display: "flex",
|
|
1301
|
+
alignItems: "center",
|
|
1302
|
+
gap: "4px",
|
|
1303
|
+
fontSize: "11px",
|
|
1304
|
+
color: "#667085",
|
|
1305
|
+
marginBottom: "6px",
|
|
1306
|
+
fontWeight: 500
|
|
1307
|
+
},
|
|
1308
|
+
children: [
|
|
1309
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react21.ListOrdered, { size: 12 }),
|
|
1310
|
+
"Ordered List"
|
|
1311
|
+
]
|
|
1312
|
+
}
|
|
1313
|
+
),
|
|
1314
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "list-preset-grid", children: OL_PRESETS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1315
|
+
PresetCell,
|
|
1316
|
+
{
|
|
1317
|
+
option,
|
|
1318
|
+
onClick: () => handlePreset("ol", option.preset)
|
|
1012
1319
|
},
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1320
|
+
option.preset
|
|
1321
|
+
)) })
|
|
1322
|
+
] }),
|
|
1323
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
1324
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1325
|
+
"div",
|
|
1326
|
+
{
|
|
1327
|
+
style: {
|
|
1328
|
+
display: "flex",
|
|
1329
|
+
alignItems: "center",
|
|
1330
|
+
gap: "4px",
|
|
1331
|
+
fontSize: "11px",
|
|
1332
|
+
color: "#667085",
|
|
1333
|
+
marginBottom: "6px",
|
|
1334
|
+
fontWeight: 500
|
|
1335
|
+
},
|
|
1336
|
+
children: [
|
|
1337
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react21.List, { size: 12 }),
|
|
1338
|
+
"Unordered List"
|
|
1339
|
+
]
|
|
1340
|
+
}
|
|
1341
|
+
),
|
|
1342
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "list-preset-grid", children: UL_PRESETS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1343
|
+
PresetCell,
|
|
1344
|
+
{
|
|
1345
|
+
option,
|
|
1346
|
+
onClick: () => handlePreset("ul", option.preset)
|
|
1040
1347
|
},
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
{
|
|
1050
|
-
option,
|
|
1051
|
-
onClick: () => handlePreset("ul", option.preset)
|
|
1052
|
-
},
|
|
1053
|
-
option.preset
|
|
1054
|
-
)) })
|
|
1055
|
-
] })
|
|
1056
|
-
] }) })
|
|
1057
|
-
]
|
|
1058
|
-
}
|
|
1059
|
-
);
|
|
1348
|
+
option.preset
|
|
1349
|
+
)) })
|
|
1350
|
+
] })
|
|
1351
|
+
] }) })
|
|
1352
|
+
]
|
|
1353
|
+
}
|
|
1354
|
+
)
|
|
1355
|
+
] });
|
|
1060
1356
|
}
|
|
1061
1357
|
|
|
1062
1358
|
// src/toolbar/ImageTool.tsx
|
|
1063
|
-
var
|
|
1064
|
-
var
|
|
1359
|
+
var import_lucide_react22 = require("lucide-react");
|
|
1360
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1065
1361
|
function ImageTool() {
|
|
1066
1362
|
const { editorRef } = useEditor();
|
|
1067
1363
|
const handleImageUpload = (e) => {
|
|
@@ -1082,14 +1378,14 @@ function ImageTool() {
|
|
|
1082
1378
|
};
|
|
1083
1379
|
e.target.value = "";
|
|
1084
1380
|
};
|
|
1085
|
-
return /* @__PURE__ */ (0,
|
|
1381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1086
1382
|
"div",
|
|
1087
1383
|
{
|
|
1088
1384
|
className: "menu-item__image",
|
|
1089
1385
|
onClick: () => document.getElementById("image")?.click(),
|
|
1090
1386
|
children: [
|
|
1091
|
-
/* @__PURE__ */ (0,
|
|
1092
|
-
/* @__PURE__ */ (0,
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react22.Image, { size: 16 }),
|
|
1388
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1093
1389
|
"input",
|
|
1094
1390
|
{
|
|
1095
1391
|
type: "file",
|
|
@@ -1104,9 +1400,9 @@ function ImageTool() {
|
|
|
1104
1400
|
}
|
|
1105
1401
|
|
|
1106
1402
|
// src/toolbar/SeparatorTool.tsx
|
|
1107
|
-
var
|
|
1108
|
-
var
|
|
1109
|
-
var
|
|
1403
|
+
var import_react15 = require("react");
|
|
1404
|
+
var import_lucide_react23 = require("lucide-react");
|
|
1405
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1110
1406
|
var DASH_STYLES = [
|
|
1111
1407
|
{ label: "Solid", dashArray: [] },
|
|
1112
1408
|
{ label: "Dotted", dashArray: [1, 1] },
|
|
@@ -1120,8 +1416,8 @@ var LINE_WIDTHS = [
|
|
|
1120
1416
|
];
|
|
1121
1417
|
function SeparatorTool() {
|
|
1122
1418
|
const { editorRef } = useEditor();
|
|
1123
|
-
const optionsRef = (0,
|
|
1124
|
-
const [selectedWidth, setSelectedWidth] = (0,
|
|
1419
|
+
const optionsRef = (0, import_react15.useRef)(null);
|
|
1420
|
+
const [selectedWidth, setSelectedWidth] = (0, import_react15.useState)(1);
|
|
1125
1421
|
const lineColor = "#344054";
|
|
1126
1422
|
const handleSeparator = (e, dashArray) => {
|
|
1127
1423
|
e.stopPropagation();
|
|
@@ -1130,7 +1426,7 @@ function SeparatorTool() {
|
|
|
1130
1426
|
});
|
|
1131
1427
|
optionsRef.current?.classList.remove("visible");
|
|
1132
1428
|
};
|
|
1133
|
-
return /* @__PURE__ */ (0,
|
|
1429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "menu-item", title: "Separator", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1134
1430
|
"span",
|
|
1135
1431
|
{
|
|
1136
1432
|
className: "menu-item__separator",
|
|
@@ -1149,15 +1445,15 @@ function SeparatorTool() {
|
|
|
1149
1445
|
position: "relative"
|
|
1150
1446
|
},
|
|
1151
1447
|
children: [
|
|
1152
|
-
/* @__PURE__ */ (0,
|
|
1153
|
-
/* @__PURE__ */ (0,
|
|
1448
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react23.Minus, { size: 16 }),
|
|
1449
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1154
1450
|
"div",
|
|
1155
1451
|
{
|
|
1156
1452
|
className: "options",
|
|
1157
1453
|
ref: optionsRef,
|
|
1158
1454
|
style: { width: "220px", height: "auto" },
|
|
1159
|
-
children: /* @__PURE__ */ (0,
|
|
1160
|
-
/* @__PURE__ */ (0,
|
|
1455
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { style: { padding: "8px 10px 10px" }, children: [
|
|
1456
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("ul", { style: { margin: 0, padding: 0, listStyle: "none" }, children: DASH_STYLES.map(({ label, dashArray }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1161
1457
|
"li",
|
|
1162
1458
|
{
|
|
1163
1459
|
onClick: (e) => handleSeparator(e, dashArray),
|
|
@@ -1170,12 +1466,12 @@ function SeparatorTool() {
|
|
|
1170
1466
|
borderRadius: "4px"
|
|
1171
1467
|
},
|
|
1172
1468
|
children: [
|
|
1173
|
-
/* @__PURE__ */ (0,
|
|
1469
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1174
1470
|
"svg",
|
|
1175
1471
|
{
|
|
1176
1472
|
style: { flex: 1, minWidth: 0, overflow: "hidden" },
|
|
1177
1473
|
height: "8",
|
|
1178
|
-
children: /* @__PURE__ */ (0,
|
|
1474
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1179
1475
|
"line",
|
|
1180
1476
|
{
|
|
1181
1477
|
x1: "0",
|
|
@@ -1189,7 +1485,7 @@ function SeparatorTool() {
|
|
|
1189
1485
|
)
|
|
1190
1486
|
}
|
|
1191
1487
|
),
|
|
1192
|
-
/* @__PURE__ */ (0,
|
|
1488
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1193
1489
|
"span",
|
|
1194
1490
|
{
|
|
1195
1491
|
style: {
|
|
@@ -1205,7 +1501,7 @@ function SeparatorTool() {
|
|
|
1205
1501
|
},
|
|
1206
1502
|
label
|
|
1207
1503
|
)) }),
|
|
1208
|
-
/* @__PURE__ */ (0,
|
|
1504
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1209
1505
|
"div",
|
|
1210
1506
|
{
|
|
1211
1507
|
style: {
|
|
@@ -1214,7 +1510,7 @@ function SeparatorTool() {
|
|
|
1214
1510
|
paddingTop: "8px"
|
|
1215
1511
|
},
|
|
1216
1512
|
children: [
|
|
1217
|
-
/* @__PURE__ */ (0,
|
|
1513
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1218
1514
|
"div",
|
|
1219
1515
|
{
|
|
1220
1516
|
style: {
|
|
@@ -1226,7 +1522,7 @@ function SeparatorTool() {
|
|
|
1226
1522
|
children: "Line Width"
|
|
1227
1523
|
}
|
|
1228
1524
|
),
|
|
1229
|
-
/* @__PURE__ */ (0,
|
|
1525
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { style: { display: "flex", gap: "4px" }, children: LINE_WIDTHS.map(({ label, value }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1230
1526
|
"button",
|
|
1231
1527
|
{
|
|
1232
1528
|
onClick: (e) => {
|
|
@@ -1260,11 +1556,11 @@ function SeparatorTool() {
|
|
|
1260
1556
|
}
|
|
1261
1557
|
|
|
1262
1558
|
// src/toolbar/WatermarkTool.tsx
|
|
1263
|
-
var
|
|
1264
|
-
var
|
|
1559
|
+
var import_react16 = require("react");
|
|
1560
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1265
1561
|
function InsertElementTool() {
|
|
1266
1562
|
const { editorRef } = useEditor();
|
|
1267
|
-
const optionsRef = (0,
|
|
1563
|
+
const optionsRef = (0, import_react16.useRef)(null);
|
|
1268
1564
|
const handleHeader = () => {
|
|
1269
1565
|
if (!editorRef.current) return;
|
|
1270
1566
|
const options = editorRef.current.command.getOptions();
|
|
@@ -1274,41 +1570,41 @@ function InsertElementTool() {
|
|
|
1274
1570
|
}
|
|
1275
1571
|
editorRef.current.command.executeSetZone("header");
|
|
1276
1572
|
};
|
|
1277
|
-
return /* @__PURE__ */ (0,
|
|
1573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1278
1574
|
"div",
|
|
1279
1575
|
{
|
|
1280
1576
|
className: "menu-item__insert-element",
|
|
1281
1577
|
onClick: () => optionsRef.current?.classList.toggle("visible"),
|
|
1282
1578
|
children: [
|
|
1283
|
-
/* @__PURE__ */ (0,
|
|
1284
|
-
/* @__PURE__ */ (0,
|
|
1579
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("i", { title: "Insert Element" }),
|
|
1580
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "options", ref: optionsRef, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("ul", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("li", { onClick: handleHeader, children: "Add Header" }) }) })
|
|
1285
1581
|
]
|
|
1286
1582
|
}
|
|
1287
1583
|
);
|
|
1288
1584
|
}
|
|
1289
1585
|
|
|
1290
1586
|
// src/toolbar/PageBreakTool.tsx
|
|
1291
|
-
var
|
|
1292
|
-
var
|
|
1587
|
+
var import_react17 = require("react");
|
|
1588
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1293
1589
|
function PageBreakTool() {
|
|
1294
1590
|
const { editorRef } = useEditor();
|
|
1295
|
-
const optionsRef = (0,
|
|
1591
|
+
const optionsRef = (0, import_react17.useRef)(null);
|
|
1296
1592
|
const handlePageBreak = () => {
|
|
1297
1593
|
editorRef.current?.command.executePageBreak();
|
|
1298
1594
|
};
|
|
1299
1595
|
const handleColumnBreak = () => {
|
|
1300
1596
|
editorRef.current?.command.executeColumnBreak();
|
|
1301
1597
|
};
|
|
1302
|
-
return /* @__PURE__ */ (0,
|
|
1598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1303
1599
|
"div",
|
|
1304
1600
|
{
|
|
1305
1601
|
className: "menu-item__page-break",
|
|
1306
1602
|
onClick: () => optionsRef.current?.classList.toggle("visible"),
|
|
1307
1603
|
children: [
|
|
1308
|
-
/* @__PURE__ */ (0,
|
|
1309
|
-
/* @__PURE__ */ (0,
|
|
1310
|
-
/* @__PURE__ */ (0,
|
|
1311
|
-
/* @__PURE__ */ (0,
|
|
1604
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("i", { title: "Break" }),
|
|
1605
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "options", ref: optionsRef, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("ul", { children: [
|
|
1606
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("li", { onClick: handlePageBreak, children: "Page Break" }),
|
|
1607
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("li", { onClick: handleColumnBreak, children: "Column Break" })
|
|
1312
1608
|
] }) })
|
|
1313
1609
|
]
|
|
1314
1610
|
}
|
|
@@ -1316,124 +1612,132 @@ function PageBreakTool() {
|
|
|
1316
1612
|
}
|
|
1317
1613
|
|
|
1318
1614
|
// src/EditorToolbar.tsx
|
|
1319
|
-
var
|
|
1615
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1320
1616
|
function EditorToolbar() {
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
/* @__PURE__ */ (0,
|
|
1617
|
+
const { isInTable } = useEditor();
|
|
1618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "menu", "editor-component": "menu", children: [
|
|
1619
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "menu-item", children: [
|
|
1620
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(UndoTool, {}),
|
|
1621
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(RedoTool, {})
|
|
1622
|
+
] }),
|
|
1623
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "menu-divider" }),
|
|
1624
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "menu-item", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ColumnTool, {}) }),
|
|
1625
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "menu-divider" }),
|
|
1626
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "menu-item", children: [
|
|
1627
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PageBreakTool, {}),
|
|
1628
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SeparatorTool, {})
|
|
1325
1629
|
] }),
|
|
1326
|
-
/* @__PURE__ */ (0,
|
|
1327
|
-
/* @__PURE__ */ (0,
|
|
1328
|
-
/* @__PURE__ */ (0,
|
|
1329
|
-
/* @__PURE__ */ (0,
|
|
1330
|
-
/* @__PURE__ */ (0,
|
|
1331
|
-
|
|
1630
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "menu-divider" }),
|
|
1631
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "menu-item", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableTool, {}) }),
|
|
1632
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "menu-divider" }),
|
|
1633
|
+
isInTable && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
1634
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "menu-item", children: [
|
|
1635
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableCellBgColorTool, {}),
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableCellBorderColorTool, {})
|
|
1637
|
+
] }),
|
|
1638
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "menu-divider" })
|
|
1332
1639
|
] }),
|
|
1333
|
-
/* @__PURE__ */ (0,
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
/* @__PURE__ */ (0,
|
|
1338
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FontTool, {}),
|
|
1339
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FontSizeTool, {}),
|
|
1340
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(LineHeightTool, {})
|
|
1640
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "menu-item", children: [
|
|
1641
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TitleTool, {}),
|
|
1642
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FontTool, {}),
|
|
1643
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FontSizeTool, {}),
|
|
1644
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LineHeightTool, {})
|
|
1341
1645
|
] }),
|
|
1342
|
-
/* @__PURE__ */ (0,
|
|
1343
|
-
/* @__PURE__ */ (0,
|
|
1344
|
-
/* @__PURE__ */ (0,
|
|
1345
|
-
/* @__PURE__ */ (0,
|
|
1346
|
-
/* @__PURE__ */ (0,
|
|
1347
|
-
/* @__PURE__ */ (0,
|
|
1348
|
-
/* @__PURE__ */ (0,
|
|
1349
|
-
/* @__PURE__ */ (0,
|
|
1646
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "menu-divider" }),
|
|
1647
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "menu-item", children: [
|
|
1648
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ColorTool, {}),
|
|
1649
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(HighlightTool, {}),
|
|
1650
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(BoldTool, {}),
|
|
1651
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ItalicTool, {}),
|
|
1652
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(UnderlineTool, {}),
|
|
1653
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(StrikeoutTool, {})
|
|
1350
1654
|
] }),
|
|
1351
|
-
/* @__PURE__ */ (0,
|
|
1352
|
-
/* @__PURE__ */ (0,
|
|
1353
|
-
/* @__PURE__ */ (0,
|
|
1354
|
-
/* @__PURE__ */ (0,
|
|
1355
|
-
/* @__PURE__ */ (0,
|
|
1356
|
-
/* @__PURE__ */ (0,
|
|
1655
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "menu-divider" }),
|
|
1656
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "menu-item", children: [
|
|
1657
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LeftAlignTool, {}),
|
|
1658
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CenterAlignTool, {}),
|
|
1659
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(RightAlignTool, {}),
|
|
1660
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(JustifyTool, {})
|
|
1357
1661
|
] }),
|
|
1358
|
-
/* @__PURE__ */ (0,
|
|
1359
|
-
/* @__PURE__ */ (0,
|
|
1360
|
-
/* @__PURE__ */ (0,
|
|
1361
|
-
/* @__PURE__ */ (0,
|
|
1362
|
-
/* @__PURE__ */ (0,
|
|
1662
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "menu-divider" }),
|
|
1663
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "menu-item", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ListTool, {}) }),
|
|
1664
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "menu-divider" }),
|
|
1665
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "menu-item", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ImageTool, {}) }),
|
|
1666
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "menu-item", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(InsertElementTool, {}) })
|
|
1363
1667
|
] });
|
|
1364
1668
|
}
|
|
1365
1669
|
|
|
1366
1670
|
// src/footer/CatalogToggleTool.tsx
|
|
1367
|
-
var
|
|
1671
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1368
1672
|
function CatalogToggleTool() {
|
|
1369
1673
|
const { handleToggleCatalogAction } = useFooter();
|
|
1370
|
-
return /* @__PURE__ */ (0,
|
|
1674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1371
1675
|
"div",
|
|
1372
1676
|
{
|
|
1373
1677
|
className: "catalog-mode",
|
|
1374
1678
|
title: "Catalog",
|
|
1375
1679
|
onClick: handleToggleCatalogAction,
|
|
1376
|
-
children: /* @__PURE__ */ (0,
|
|
1680
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("i", {})
|
|
1377
1681
|
}
|
|
1378
1682
|
);
|
|
1379
1683
|
}
|
|
1380
1684
|
|
|
1381
1685
|
// src/footer/PageModeTool.tsx
|
|
1382
|
-
var
|
|
1383
|
-
var
|
|
1686
|
+
var import_react18 = require("react");
|
|
1687
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1384
1688
|
function PageModeTool() {
|
|
1385
1689
|
const { editorRef } = useEditor();
|
|
1386
|
-
const [visible, setVisible] = (0,
|
|
1690
|
+
const [visible, setVisible] = (0, import_react18.useState)(false);
|
|
1387
1691
|
const handlePageMode = (mode) => {
|
|
1388
1692
|
editorRef.current?.command.executePageMode(mode);
|
|
1389
1693
|
setVisible(false);
|
|
1390
1694
|
};
|
|
1391
|
-
return /* @__PURE__ */ (0,
|
|
1392
|
-
/* @__PURE__ */ (0,
|
|
1393
|
-
/* @__PURE__ */ (0,
|
|
1394
|
-
/* @__PURE__ */ (0,
|
|
1395
|
-
/* @__PURE__ */ (0,
|
|
1695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "page-mode", onClick: () => setVisible(!visible), children: [
|
|
1696
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("i", { title: "Page Mode" }),
|
|
1697
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: `options ${visible ? "visible" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("ul", { children: [
|
|
1698
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("li", { onClick: () => handlePageMode("paging"), className: "active", children: "Paging" }),
|
|
1699
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("li", { onClick: () => handlePageMode("continuity"), children: "Continuity" })
|
|
1396
1700
|
] }) })
|
|
1397
1701
|
] });
|
|
1398
1702
|
}
|
|
1399
1703
|
|
|
1400
1704
|
// src/footer/FooterStatus.tsx
|
|
1401
|
-
var
|
|
1705
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1402
1706
|
function FooterStatus() {
|
|
1403
1707
|
const { pageNoList, pageNo, pageSize, wordCount, rowNo, colNo } = useFooter();
|
|
1404
|
-
return /* @__PURE__ */ (0,
|
|
1405
|
-
/* @__PURE__ */ (0,
|
|
1708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
1709
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
1406
1710
|
"Visible Pages: ",
|
|
1407
|
-
/* @__PURE__ */ (0,
|
|
1711
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "page-no-list", children: pageNoList })
|
|
1408
1712
|
] }),
|
|
1409
|
-
/* @__PURE__ */ (0,
|
|
1410
|
-
/* @__PURE__ */ (0,
|
|
1713
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "footer-divider" }),
|
|
1714
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
1411
1715
|
"Pages: ",
|
|
1412
|
-
/* @__PURE__ */ (0,
|
|
1716
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "page-no", children: pageNo }),
|
|
1413
1717
|
"/",
|
|
1414
|
-
/* @__PURE__ */ (0,
|
|
1718
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "page-size", children: pageSize })
|
|
1415
1719
|
] }),
|
|
1416
|
-
/* @__PURE__ */ (0,
|
|
1417
|
-
/* @__PURE__ */ (0,
|
|
1720
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "footer-divider" }),
|
|
1721
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
1418
1722
|
"Words: ",
|
|
1419
|
-
/* @__PURE__ */ (0,
|
|
1723
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "word-count", children: wordCount })
|
|
1420
1724
|
] }),
|
|
1421
|
-
/* @__PURE__ */ (0,
|
|
1422
|
-
/* @__PURE__ */ (0,
|
|
1725
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "footer-divider" }),
|
|
1726
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
1423
1727
|
"Row: ",
|
|
1424
|
-
/* @__PURE__ */ (0,
|
|
1728
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "row-no", children: rowNo })
|
|
1425
1729
|
] }),
|
|
1426
|
-
/* @__PURE__ */ (0,
|
|
1427
|
-
/* @__PURE__ */ (0,
|
|
1730
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "footer-divider" }),
|
|
1731
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
1428
1732
|
"Column: ",
|
|
1429
|
-
/* @__PURE__ */ (0,
|
|
1733
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "col-no", children: colNo })
|
|
1430
1734
|
] })
|
|
1431
1735
|
] });
|
|
1432
1736
|
}
|
|
1433
1737
|
|
|
1434
1738
|
// src/footer/EditorModeTool.tsx
|
|
1435
|
-
var
|
|
1436
|
-
var
|
|
1739
|
+
var import_react19 = require("react");
|
|
1740
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1437
1741
|
var MODE_LIST = [
|
|
1438
1742
|
{ mode: "edit", name: "Edit Mode" },
|
|
1439
1743
|
{ mode: "clean", name: "Clean Mode" },
|
|
@@ -1445,8 +1749,8 @@ var MODE_LIST = [
|
|
|
1445
1749
|
];
|
|
1446
1750
|
function EditorModeTool() {
|
|
1447
1751
|
const { editorRef } = useEditor();
|
|
1448
|
-
const [editorMode, setEditorMode] = (0,
|
|
1449
|
-
const modeIndexRef = (0,
|
|
1752
|
+
const [editorMode, setEditorMode] = (0, import_react19.useState)("Edit Mode");
|
|
1753
|
+
const modeIndexRef = (0, import_react19.useRef)(0);
|
|
1450
1754
|
const handleModeChange = () => {
|
|
1451
1755
|
modeIndexRef.current = modeIndexRef.current === MODE_LIST.length - 1 ? 0 : modeIndexRef.current + 1;
|
|
1452
1756
|
const { name, mode } = MODE_LIST[modeIndexRef.current];
|
|
@@ -1463,7 +1767,7 @@ function EditorModeTool() {
|
|
|
1463
1767
|
}
|
|
1464
1768
|
});
|
|
1465
1769
|
};
|
|
1466
|
-
return /* @__PURE__ */ (0,
|
|
1770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1467
1771
|
"div",
|
|
1468
1772
|
{
|
|
1469
1773
|
className: "editor-mode",
|
|
@@ -1475,26 +1779,26 @@ function EditorModeTool() {
|
|
|
1475
1779
|
}
|
|
1476
1780
|
|
|
1477
1781
|
// src/footer/PageScaleMinusTool.tsx
|
|
1478
|
-
var
|
|
1782
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1479
1783
|
function PageScaleMinusTool() {
|
|
1480
1784
|
const { editorRef } = useEditor();
|
|
1481
|
-
return /* @__PURE__ */ (0,
|
|
1785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1482
1786
|
"div",
|
|
1483
1787
|
{
|
|
1484
1788
|
className: "page-scale-minus",
|
|
1485
1789
|
title: "Zoom Out (Ctrl+-)",
|
|
1486
1790
|
onClick: () => editorRef.current?.command.executePageScaleMinus(),
|
|
1487
|
-
children: /* @__PURE__ */ (0,
|
|
1791
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", {})
|
|
1488
1792
|
}
|
|
1489
1793
|
);
|
|
1490
1794
|
}
|
|
1491
1795
|
|
|
1492
1796
|
// src/footer/PageScalePercentageTool.tsx
|
|
1493
|
-
var
|
|
1797
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1494
1798
|
function PageScalePercentageTool() {
|
|
1495
1799
|
const { editorRef } = useEditor();
|
|
1496
1800
|
const { pageScale } = useFooter();
|
|
1497
|
-
return /* @__PURE__ */ (0,
|
|
1801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1498
1802
|
"span",
|
|
1499
1803
|
{
|
|
1500
1804
|
className: "page-scale-percentage",
|
|
@@ -1509,23 +1813,23 @@ function PageScalePercentageTool() {
|
|
|
1509
1813
|
}
|
|
1510
1814
|
|
|
1511
1815
|
// src/footer/PageScaleAddTool.tsx
|
|
1512
|
-
var
|
|
1816
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1513
1817
|
function PageScaleAddTool() {
|
|
1514
1818
|
const { editorRef } = useEditor();
|
|
1515
|
-
return /* @__PURE__ */ (0,
|
|
1819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1516
1820
|
"div",
|
|
1517
1821
|
{
|
|
1518
1822
|
className: "page-scale-add",
|
|
1519
1823
|
title: "Zoom In (Ctrl+=)",
|
|
1520
1824
|
onClick: () => editorRef.current?.command.executePageScaleAdd(),
|
|
1521
|
-
children: /* @__PURE__ */ (0,
|
|
1825
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", {})
|
|
1522
1826
|
}
|
|
1523
1827
|
);
|
|
1524
1828
|
}
|
|
1525
1829
|
|
|
1526
1830
|
// src/footer/PaperSizeTool.tsx
|
|
1527
|
-
var
|
|
1528
|
-
var
|
|
1831
|
+
var import_react20 = require("react");
|
|
1832
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1529
1833
|
var SIZES2 = [
|
|
1530
1834
|
{ label: "A4", width: 794, height: 1123, active: true },
|
|
1531
1835
|
{ label: "A2", width: 1593, height: 2251 },
|
|
@@ -1534,14 +1838,14 @@ var SIZES2 = [
|
|
|
1534
1838
|
];
|
|
1535
1839
|
function PaperSizeTool() {
|
|
1536
1840
|
const { editorRef } = useEditor();
|
|
1537
|
-
const [visible, setVisible] = (0,
|
|
1841
|
+
const [visible, setVisible] = (0, import_react20.useState)(false);
|
|
1538
1842
|
const handlePaperSize = (width, height) => {
|
|
1539
1843
|
editorRef.current?.command.executePaperSize(width, height);
|
|
1540
1844
|
setVisible(false);
|
|
1541
1845
|
};
|
|
1542
|
-
return /* @__PURE__ */ (0,
|
|
1543
|
-
/* @__PURE__ */ (0,
|
|
1544
|
-
/* @__PURE__ */ (0,
|
|
1846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "paper-size", onClick: () => setVisible(!visible), children: [
|
|
1847
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("i", { title: "Paper Type" }),
|
|
1848
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: `options ${visible ? "visible" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("ul", { children: SIZES2.map(({ label, width, height, active }) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1545
1849
|
"li",
|
|
1546
1850
|
{
|
|
1547
1851
|
onClick: () => handlePaperSize(width, height),
|
|
@@ -1554,19 +1858,19 @@ function PaperSizeTool() {
|
|
|
1554
1858
|
}
|
|
1555
1859
|
|
|
1556
1860
|
// src/footer/PaperDirectionTool.tsx
|
|
1557
|
-
var
|
|
1558
|
-
var
|
|
1861
|
+
var import_react21 = require("react");
|
|
1862
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1559
1863
|
function PaperDirectionTool() {
|
|
1560
1864
|
const { editorRef } = useEditor();
|
|
1561
|
-
const [visible, setVisible] = (0,
|
|
1865
|
+
const [visible, setVisible] = (0, import_react21.useState)(false);
|
|
1562
1866
|
const handlePaperDirection = (direction) => {
|
|
1563
1867
|
editorRef.current?.command.executePaperDirection(direction);
|
|
1564
1868
|
setVisible(false);
|
|
1565
1869
|
};
|
|
1566
|
-
return /* @__PURE__ */ (0,
|
|
1567
|
-
/* @__PURE__ */ (0,
|
|
1568
|
-
/* @__PURE__ */ (0,
|
|
1569
|
-
/* @__PURE__ */ (0,
|
|
1870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "paper-direction", onClick: () => setVisible(!visible), children: [
|
|
1871
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { title: "Paper Direction" }),
|
|
1872
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: `options ${visible ? "visible" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("ul", { children: [
|
|
1873
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1570
1874
|
"li",
|
|
1571
1875
|
{
|
|
1572
1876
|
onClick: () => handlePaperDirection("vertical"),
|
|
@@ -1574,14 +1878,14 @@ function PaperDirectionTool() {
|
|
|
1574
1878
|
children: "Portrait"
|
|
1575
1879
|
}
|
|
1576
1880
|
),
|
|
1577
|
-
/* @__PURE__ */ (0,
|
|
1881
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("li", { onClick: () => handlePaperDirection("horizontal"), children: "Landscape" })
|
|
1578
1882
|
] }) })
|
|
1579
1883
|
] });
|
|
1580
1884
|
}
|
|
1581
1885
|
|
|
1582
1886
|
// src/footer/PaperMarginTool.tsx
|
|
1583
1887
|
var import_core = require("@windoc/core");
|
|
1584
|
-
var
|
|
1888
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1585
1889
|
function PaperMarginTool() {
|
|
1586
1890
|
const { editorRef } = useEditor();
|
|
1587
1891
|
const handlePaperMargin = async () => {
|
|
@@ -1642,19 +1946,19 @@ function PaperMarginTool() {
|
|
|
1642
1946
|
}
|
|
1643
1947
|
});
|
|
1644
1948
|
};
|
|
1645
|
-
return /* @__PURE__ */ (0,
|
|
1949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1646
1950
|
"div",
|
|
1647
1951
|
{
|
|
1648
1952
|
className: "paper-margin",
|
|
1649
1953
|
title: "Page Margins",
|
|
1650
1954
|
onClick: handlePaperMargin,
|
|
1651
|
-
children: /* @__PURE__ */ (0,
|
|
1955
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("i", {})
|
|
1652
1956
|
}
|
|
1653
1957
|
);
|
|
1654
1958
|
}
|
|
1655
1959
|
|
|
1656
1960
|
// src/footer/FullscreenTool.tsx
|
|
1657
|
-
var
|
|
1961
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1658
1962
|
function FullscreenTool() {
|
|
1659
1963
|
const handleFullscreen = () => {
|
|
1660
1964
|
if (!document.fullscreenElement) {
|
|
@@ -1663,11 +1967,11 @@ function FullscreenTool() {
|
|
|
1663
1967
|
document.exitFullscreen();
|
|
1664
1968
|
}
|
|
1665
1969
|
};
|
|
1666
|
-
return /* @__PURE__ */ (0,
|
|
1970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "fullscreen", title: "Fullscreen", onClick: handleFullscreen, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("i", {}) });
|
|
1667
1971
|
}
|
|
1668
1972
|
|
|
1669
1973
|
// src/footer/EditorOptionTool.tsx
|
|
1670
|
-
var
|
|
1974
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1671
1975
|
function EditorOptionTool() {
|
|
1672
1976
|
const { editorRef } = useEditor();
|
|
1673
1977
|
const handleEditorOption = async () => {
|
|
@@ -1695,21 +1999,21 @@ function EditorOptionTool() {
|
|
|
1695
1999
|
}
|
|
1696
2000
|
});
|
|
1697
2001
|
};
|
|
1698
|
-
return /* @__PURE__ */ (0,
|
|
2002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1699
2003
|
"div",
|
|
1700
2004
|
{
|
|
1701
2005
|
className: "editor-option",
|
|
1702
2006
|
title: "Editor Settings",
|
|
1703
2007
|
onClick: handleEditorOption,
|
|
1704
|
-
children: /* @__PURE__ */ (0,
|
|
2008
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("i", {})
|
|
1705
2009
|
}
|
|
1706
2010
|
);
|
|
1707
2011
|
}
|
|
1708
2012
|
|
|
1709
2013
|
// src/footer/WatermarkFooterTool.tsx
|
|
1710
|
-
var
|
|
1711
|
-
var
|
|
1712
|
-
var
|
|
2014
|
+
var import_react22 = require("react");
|
|
2015
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2016
|
+
var COLOR_PALETTE4 = [
|
|
1713
2017
|
["#000000", "#434343", "#666666", "#999999", "#b7b7b7", "#cccccc"],
|
|
1714
2018
|
["#980000", "#ff0000", "#ff9900", "#ffff00", "#00ff00", "#00ffff"],
|
|
1715
2019
|
["#4a86e8", "#0000ff", "#9900ff", "#ff00ff", "#e6b8af", "#f4cccc"]
|
|
@@ -1720,21 +2024,21 @@ var FONTS2 = [
|
|
|
1720
2024
|
];
|
|
1721
2025
|
function WatermarkFooterTool() {
|
|
1722
2026
|
const { editorRef } = useEditor();
|
|
1723
|
-
const [visible, setVisible] = (0,
|
|
1724
|
-
const [tab, setTab] = (0,
|
|
1725
|
-
const containerRef = (0,
|
|
1726
|
-
const panelRef = (0,
|
|
1727
|
-
const fileInputRef = (0,
|
|
1728
|
-
const [text, setText] = (0,
|
|
1729
|
-
const [font, setFont] = (0,
|
|
1730
|
-
const [color, setColor] = (0,
|
|
1731
|
-
const [opacity, setOpacity] = (0,
|
|
1732
|
-
const [rotation, setRotation] = (0,
|
|
1733
|
-
const [inFront, setInFront] = (0,
|
|
1734
|
-
const [imageData, setImageData] = (0,
|
|
1735
|
-
const [imgWidth, setImgWidth] = (0,
|
|
1736
|
-
const [imgHeight, setImgHeight] = (0,
|
|
1737
|
-
(0,
|
|
2027
|
+
const [visible, setVisible] = (0, import_react22.useState)(false);
|
|
2028
|
+
const [tab, setTab] = (0, import_react22.useState)("text");
|
|
2029
|
+
const containerRef = (0, import_react22.useRef)(null);
|
|
2030
|
+
const panelRef = (0, import_react22.useRef)(null);
|
|
2031
|
+
const fileInputRef = (0, import_react22.useRef)(null);
|
|
2032
|
+
const [text, setText] = (0, import_react22.useState)("WATERMARK");
|
|
2033
|
+
const [font, setFont] = (0, import_react22.useState)("Arial");
|
|
2034
|
+
const [color, setColor] = (0, import_react22.useState)("#AEB5C0");
|
|
2035
|
+
const [opacity, setOpacity] = (0, import_react22.useState)(30);
|
|
2036
|
+
const [rotation, setRotation] = (0, import_react22.useState)(-45);
|
|
2037
|
+
const [inFront, setInFront] = (0, import_react22.useState)(false);
|
|
2038
|
+
const [imageData, setImageData] = (0, import_react22.useState)("");
|
|
2039
|
+
const [imgWidth, setImgWidth] = (0, import_react22.useState)(200);
|
|
2040
|
+
const [imgHeight, setImgHeight] = (0, import_react22.useState)(200);
|
|
2041
|
+
(0, import_react22.useEffect)(() => {
|
|
1738
2042
|
if (!visible) return;
|
|
1739
2043
|
const handler = (e) => {
|
|
1740
2044
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -1744,7 +2048,7 @@ function WatermarkFooterTool() {
|
|
|
1744
2048
|
document.addEventListener("mousedown", handler);
|
|
1745
2049
|
return () => document.removeEventListener("mousedown", handler);
|
|
1746
2050
|
}, [visible]);
|
|
1747
|
-
(0,
|
|
2051
|
+
(0, import_react22.useEffect)(() => {
|
|
1748
2052
|
if (!visible || !panelRef.current) return;
|
|
1749
2053
|
const el = panelRef.current;
|
|
1750
2054
|
el.style.right = "";
|
|
@@ -1758,7 +2062,7 @@ function WatermarkFooterTool() {
|
|
|
1758
2062
|
el.style.left = `${-rect.left + 4}px`;
|
|
1759
2063
|
}
|
|
1760
2064
|
}, [visible]);
|
|
1761
|
-
const handleFileUpload = (0,
|
|
2065
|
+
const handleFileUpload = (0, import_react22.useCallback)(
|
|
1762
2066
|
(e) => {
|
|
1763
2067
|
const file = e.target.files?.[0];
|
|
1764
2068
|
if (!file) return;
|
|
@@ -1817,16 +2121,16 @@ function WatermarkFooterTool() {
|
|
|
1817
2121
|
editorRef.current?.command.executeDeleteWatermark();
|
|
1818
2122
|
setVisible(false);
|
|
1819
2123
|
};
|
|
1820
|
-
return /* @__PURE__ */ (0,
|
|
2124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
1821
2125
|
"div",
|
|
1822
2126
|
{
|
|
1823
2127
|
className: "watermark-footer",
|
|
1824
2128
|
ref: containerRef,
|
|
1825
2129
|
onClick: () => setVisible(!visible),
|
|
1826
2130
|
children: [
|
|
1827
|
-
/* @__PURE__ */ (0,
|
|
1828
|
-
visible && /* @__PURE__ */ (0,
|
|
1829
|
-
/* @__PURE__ */ (0,
|
|
2131
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("i", { title: "Watermark" }),
|
|
2132
|
+
visible && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
2133
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1830
2134
|
"div",
|
|
1831
2135
|
{
|
|
1832
2136
|
className: "wm-panel-mask",
|
|
@@ -1836,19 +2140,19 @@ function WatermarkFooterTool() {
|
|
|
1836
2140
|
}
|
|
1837
2141
|
}
|
|
1838
2142
|
),
|
|
1839
|
-
/* @__PURE__ */ (0,
|
|
2143
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
1840
2144
|
"div",
|
|
1841
2145
|
{
|
|
1842
2146
|
className: "watermark-footer-panel",
|
|
1843
2147
|
ref: panelRef,
|
|
1844
2148
|
onClick: (e) => e.stopPropagation(),
|
|
1845
2149
|
children: [
|
|
1846
|
-
/* @__PURE__ */ (0,
|
|
1847
|
-
/* @__PURE__ */ (0,
|
|
1848
|
-
/* @__PURE__ */ (0,
|
|
2150
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-title", children: [
|
|
2151
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: "Watermark" }),
|
|
2152
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("i", { onClick: () => setVisible(false) })
|
|
1849
2153
|
] }),
|
|
1850
|
-
/* @__PURE__ */ (0,
|
|
1851
|
-
/* @__PURE__ */ (0,
|
|
2154
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-tabs", children: [
|
|
2155
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1852
2156
|
"button",
|
|
1853
2157
|
{
|
|
1854
2158
|
className: `wm-panel-tab ${tab === "text" ? "active" : ""}`,
|
|
@@ -1856,7 +2160,7 @@ function WatermarkFooterTool() {
|
|
|
1856
2160
|
children: "Text"
|
|
1857
2161
|
}
|
|
1858
2162
|
),
|
|
1859
|
-
/* @__PURE__ */ (0,
|
|
2163
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1860
2164
|
"button",
|
|
1861
2165
|
{
|
|
1862
2166
|
className: `wm-panel-tab ${tab === "image" ? "active" : ""}`,
|
|
@@ -1865,11 +2169,11 @@ function WatermarkFooterTool() {
|
|
|
1865
2169
|
}
|
|
1866
2170
|
)
|
|
1867
2171
|
] }),
|
|
1868
|
-
/* @__PURE__ */ (0,
|
|
1869
|
-
tab === "text" ? /* @__PURE__ */ (0,
|
|
1870
|
-
/* @__PURE__ */ (0,
|
|
1871
|
-
/* @__PURE__ */ (0,
|
|
1872
|
-
/* @__PURE__ */ (0,
|
|
2172
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-body", children: [
|
|
2173
|
+
tab === "text" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
2174
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-field", children: [
|
|
2175
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { children: "Text" }),
|
|
2176
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1873
2177
|
"input",
|
|
1874
2178
|
{
|
|
1875
2179
|
type: "text",
|
|
@@ -1879,20 +2183,20 @@ function WatermarkFooterTool() {
|
|
|
1879
2183
|
}
|
|
1880
2184
|
)
|
|
1881
2185
|
] }),
|
|
1882
|
-
/* @__PURE__ */ (0,
|
|
1883
|
-
/* @__PURE__ */ (0,
|
|
1884
|
-
/* @__PURE__ */ (0,
|
|
2186
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-field", children: [
|
|
2187
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { children: "Font" }),
|
|
2188
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1885
2189
|
"select",
|
|
1886
2190
|
{
|
|
1887
2191
|
value: font,
|
|
1888
2192
|
onChange: (e) => setFont(e.target.value),
|
|
1889
|
-
children: FONTS2.map((f) => /* @__PURE__ */ (0,
|
|
2193
|
+
children: FONTS2.map((f) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("option", { value: f.family, children: f.label }, f.family))
|
|
1890
2194
|
}
|
|
1891
2195
|
)
|
|
1892
2196
|
] }),
|
|
1893
|
-
/* @__PURE__ */ (0,
|
|
1894
|
-
/* @__PURE__ */ (0,
|
|
1895
|
-
/* @__PURE__ */ (0,
|
|
2197
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-field", children: [
|
|
2198
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { children: "Color" }),
|
|
2199
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "wm-panel-colors", children: COLOR_PALETTE4.flat().map((c) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1896
2200
|
"div",
|
|
1897
2201
|
{
|
|
1898
2202
|
className: `wm-panel-color ${color.toLowerCase() === c.toLowerCase() ? "active" : ""}`,
|
|
@@ -1902,10 +2206,10 @@ function WatermarkFooterTool() {
|
|
|
1902
2206
|
c
|
|
1903
2207
|
)) })
|
|
1904
2208
|
] })
|
|
1905
|
-
] }) : /* @__PURE__ */ (0,
|
|
1906
|
-
/* @__PURE__ */ (0,
|
|
1907
|
-
/* @__PURE__ */ (0,
|
|
1908
|
-
/* @__PURE__ */ (0,
|
|
2209
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
2210
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-field", children: [
|
|
2211
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { children: "Image" }),
|
|
2212
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
1909
2213
|
"div",
|
|
1910
2214
|
{
|
|
1911
2215
|
style: {
|
|
@@ -1914,7 +2218,7 @@ function WatermarkFooterTool() {
|
|
|
1914
2218
|
gap: "6px"
|
|
1915
2219
|
},
|
|
1916
2220
|
children: [
|
|
1917
|
-
/* @__PURE__ */ (0,
|
|
2221
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1918
2222
|
"button",
|
|
1919
2223
|
{
|
|
1920
2224
|
className: "wm-panel-upload",
|
|
@@ -1922,7 +2226,7 @@ function WatermarkFooterTool() {
|
|
|
1922
2226
|
children: "Choose File"
|
|
1923
2227
|
}
|
|
1924
2228
|
),
|
|
1925
|
-
/* @__PURE__ */ (0,
|
|
2229
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1926
2230
|
"input",
|
|
1927
2231
|
{
|
|
1928
2232
|
ref: fileInputRef,
|
|
@@ -1932,12 +2236,12 @@ function WatermarkFooterTool() {
|
|
|
1932
2236
|
onChange: handleFileUpload
|
|
1933
2237
|
}
|
|
1934
2238
|
),
|
|
1935
|
-
imageData && /* @__PURE__ */ (0,
|
|
2239
|
+
imageData && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { style: { fontSize: "11px", color: "#667085" }, children: "Loaded" })
|
|
1936
2240
|
]
|
|
1937
2241
|
}
|
|
1938
2242
|
)
|
|
1939
2243
|
] }),
|
|
1940
|
-
imageData && /* @__PURE__ */ (0,
|
|
2244
|
+
imageData && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "wm-panel-field", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "wm-panel-preview", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1941
2245
|
"img",
|
|
1942
2246
|
{
|
|
1943
2247
|
src: imageData,
|
|
@@ -1949,10 +2253,10 @@ function WatermarkFooterTool() {
|
|
|
1949
2253
|
}
|
|
1950
2254
|
}
|
|
1951
2255
|
) }) }),
|
|
1952
|
-
/* @__PURE__ */ (0,
|
|
1953
|
-
/* @__PURE__ */ (0,
|
|
1954
|
-
/* @__PURE__ */ (0,
|
|
1955
|
-
/* @__PURE__ */ (0,
|
|
2256
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-field-row", children: [
|
|
2257
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-field wm-panel-field-half", children: [
|
|
2258
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { children: "W" }),
|
|
2259
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1956
2260
|
"input",
|
|
1957
2261
|
{
|
|
1958
2262
|
type: "number",
|
|
@@ -1962,9 +2266,9 @@ function WatermarkFooterTool() {
|
|
|
1962
2266
|
}
|
|
1963
2267
|
)
|
|
1964
2268
|
] }),
|
|
1965
|
-
/* @__PURE__ */ (0,
|
|
1966
|
-
/* @__PURE__ */ (0,
|
|
1967
|
-
/* @__PURE__ */ (0,
|
|
2269
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-field wm-panel-field-half", children: [
|
|
2270
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { children: "H" }),
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1968
2272
|
"input",
|
|
1969
2273
|
{
|
|
1970
2274
|
type: "number",
|
|
@@ -1976,15 +2280,15 @@ function WatermarkFooterTool() {
|
|
|
1976
2280
|
] })
|
|
1977
2281
|
] })
|
|
1978
2282
|
] }),
|
|
1979
|
-
/* @__PURE__ */ (0,
|
|
1980
|
-
/* @__PURE__ */ (0,
|
|
2283
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-field", children: [
|
|
2284
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { children: [
|
|
1981
2285
|
"Opacity ",
|
|
1982
|
-
/* @__PURE__ */ (0,
|
|
2286
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: "wm-panel-value", children: [
|
|
1983
2287
|
opacity,
|
|
1984
2288
|
"%"
|
|
1985
2289
|
] })
|
|
1986
2290
|
] }),
|
|
1987
|
-
/* @__PURE__ */ (0,
|
|
2291
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1988
2292
|
"input",
|
|
1989
2293
|
{
|
|
1990
2294
|
type: "range",
|
|
@@ -1996,15 +2300,15 @@ function WatermarkFooterTool() {
|
|
|
1996
2300
|
}
|
|
1997
2301
|
)
|
|
1998
2302
|
] }),
|
|
1999
|
-
/* @__PURE__ */ (0,
|
|
2000
|
-
/* @__PURE__ */ (0,
|
|
2303
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-field", children: [
|
|
2304
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { children: [
|
|
2001
2305
|
"Rotation ",
|
|
2002
|
-
/* @__PURE__ */ (0,
|
|
2306
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: "wm-panel-value", children: [
|
|
2003
2307
|
rotation,
|
|
2004
2308
|
"\xB0"
|
|
2005
2309
|
] })
|
|
2006
2310
|
] }),
|
|
2007
|
-
/* @__PURE__ */ (0,
|
|
2311
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2008
2312
|
"input",
|
|
2009
2313
|
{
|
|
2010
2314
|
type: "range",
|
|
@@ -2016,10 +2320,10 @@ function WatermarkFooterTool() {
|
|
|
2016
2320
|
}
|
|
2017
2321
|
)
|
|
2018
2322
|
] }),
|
|
2019
|
-
/* @__PURE__ */ (0,
|
|
2020
|
-
/* @__PURE__ */ (0,
|
|
2021
|
-
/* @__PURE__ */ (0,
|
|
2022
|
-
/* @__PURE__ */ (0,
|
|
2323
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-field", children: [
|
|
2324
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { children: "Position" }),
|
|
2325
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-toggle", children: [
|
|
2326
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2023
2327
|
"button",
|
|
2024
2328
|
{
|
|
2025
2329
|
className: !inFront ? "active" : "",
|
|
@@ -2027,7 +2331,7 @@ function WatermarkFooterTool() {
|
|
|
2027
2331
|
children: "Behind"
|
|
2028
2332
|
}
|
|
2029
2333
|
),
|
|
2030
|
-
/* @__PURE__ */ (0,
|
|
2334
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2031
2335
|
"button",
|
|
2032
2336
|
{
|
|
2033
2337
|
className: inFront ? "active" : "",
|
|
@@ -2038,9 +2342,9 @@ function WatermarkFooterTool() {
|
|
|
2038
2342
|
] })
|
|
2039
2343
|
] })
|
|
2040
2344
|
] }),
|
|
2041
|
-
/* @__PURE__ */ (0,
|
|
2042
|
-
/* @__PURE__ */ (0,
|
|
2043
|
-
/* @__PURE__ */ (0,
|
|
2345
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "wm-panel-actions", children: [
|
|
2346
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { className: "wm-panel-btn-delete", onClick: handleDelete, children: "Remove" }),
|
|
2347
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { className: "wm-panel-btn-apply", onClick: handleApply, children: "Apply" })
|
|
2044
2348
|
] })
|
|
2045
2349
|
]
|
|
2046
2350
|
}
|
|
@@ -2052,31 +2356,31 @@ function WatermarkFooterTool() {
|
|
|
2052
2356
|
}
|
|
2053
2357
|
|
|
2054
2358
|
// src/EditorFooter.tsx
|
|
2055
|
-
var
|
|
2359
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2056
2360
|
function EditorFooter() {
|
|
2057
|
-
return /* @__PURE__ */ (0,
|
|
2058
|
-
/* @__PURE__ */ (0,
|
|
2059
|
-
/* @__PURE__ */ (0,
|
|
2060
|
-
/* @__PURE__ */ (0,
|
|
2061
|
-
/* @__PURE__ */ (0,
|
|
2361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "footer", "editor-component": "footer", children: [
|
|
2362
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { children: [
|
|
2363
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(CatalogToggleTool, {}),
|
|
2364
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PageModeTool, {}),
|
|
2365
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FooterStatus, {})
|
|
2062
2366
|
] }),
|
|
2063
|
-
/* @__PURE__ */ (0,
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
2065
|
-
/* @__PURE__ */ (0,
|
|
2066
|
-
/* @__PURE__ */ (0,
|
|
2067
|
-
/* @__PURE__ */ (0,
|
|
2068
|
-
/* @__PURE__ */ (0,
|
|
2069
|
-
/* @__PURE__ */ (0,
|
|
2070
|
-
/* @__PURE__ */ (0,
|
|
2071
|
-
/* @__PURE__ */ (0,
|
|
2072
|
-
/* @__PURE__ */ (0,
|
|
2073
|
-
/* @__PURE__ */ (0,
|
|
2367
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(EditorModeTool, {}),
|
|
2368
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { children: [
|
|
2369
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PageScaleMinusTool, {}),
|
|
2370
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PageScalePercentageTool, {}),
|
|
2371
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PageScaleAddTool, {}),
|
|
2372
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PaperSizeTool, {}),
|
|
2373
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PaperDirectionTool, {}),
|
|
2374
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PaperMarginTool, {}),
|
|
2375
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WatermarkFooterTool, {}),
|
|
2376
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FullscreenTool, {}),
|
|
2377
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(EditorOptionTool, {})
|
|
2074
2378
|
] })
|
|
2075
2379
|
] });
|
|
2076
2380
|
}
|
|
2077
2381
|
|
|
2078
2382
|
// src/Editor.tsx
|
|
2079
|
-
var
|
|
2383
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2080
2384
|
function Editor({
|
|
2081
2385
|
defaultValue,
|
|
2082
2386
|
options: userOptions,
|
|
@@ -2092,7 +2396,7 @@ function Editor({
|
|
|
2092
2396
|
style,
|
|
2093
2397
|
onDrop: userOnDrop
|
|
2094
2398
|
}) {
|
|
2095
|
-
return /* @__PURE__ */ (0,
|
|
2399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FooterProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2096
2400
|
EditorInner,
|
|
2097
2401
|
{
|
|
2098
2402
|
defaultValue,
|
|
@@ -2126,9 +2430,10 @@ function EditorInner({
|
|
|
2126
2430
|
style,
|
|
2127
2431
|
onDrop: userOnDrop
|
|
2128
2432
|
}) {
|
|
2129
|
-
const containerRef = (0,
|
|
2130
|
-
const editorRef = (0,
|
|
2131
|
-
const [rangeStyle, setRangeStyle] = (0,
|
|
2433
|
+
const containerRef = (0, import_react23.useRef)(null);
|
|
2434
|
+
const editorRef = (0, import_react23.useRef)(null);
|
|
2435
|
+
const [rangeStyle, setRangeStyle] = (0, import_react23.useState)(null);
|
|
2436
|
+
const [isInTable, setIsInTable] = (0, import_react23.useState)(false);
|
|
2132
2437
|
const {
|
|
2133
2438
|
setPageNoList,
|
|
2134
2439
|
setPageNo,
|
|
@@ -2138,7 +2443,7 @@ function EditorInner({
|
|
|
2138
2443
|
setColNo,
|
|
2139
2444
|
setPageScale
|
|
2140
2445
|
} = useFooter();
|
|
2141
|
-
(0,
|
|
2446
|
+
(0, import_react23.useEffect)(() => {
|
|
2142
2447
|
let instance = null;
|
|
2143
2448
|
let cancelled = false;
|
|
2144
2449
|
let closeDropdowns = null;
|
|
@@ -2165,6 +2470,7 @@ function EditorInner({
|
|
|
2165
2470
|
setRangeStyle(payload);
|
|
2166
2471
|
onRangeStyleChange?.(payload);
|
|
2167
2472
|
const rangeContext = instance?.command.getRangeContext();
|
|
2473
|
+
setIsInTable(rangeContext?.isTable === true);
|
|
2168
2474
|
if (rangeContext) {
|
|
2169
2475
|
setRowNo(rangeContext.startRowNo + 1);
|
|
2170
2476
|
setColNo(rangeContext.startColNo + 1);
|
|
@@ -2286,11 +2592,11 @@ function EditorInner({
|
|
|
2286
2592
|
e.preventDefault();
|
|
2287
2593
|
e.dataTransfer.dropEffect = "copy";
|
|
2288
2594
|
};
|
|
2289
|
-
return /* @__PURE__ */ (0,
|
|
2290
|
-
toolbar && !renderToolbar && /* @__PURE__ */ (0,
|
|
2595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(EditorProvider, { editorRef, rangeStyle, isInTable, children: [
|
|
2596
|
+
toolbar && !renderToolbar && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EditorToolbar, {}),
|
|
2291
2597
|
renderToolbar,
|
|
2292
2598
|
children,
|
|
2293
|
-
/* @__PURE__ */ (0,
|
|
2599
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2294
2600
|
"div",
|
|
2295
2601
|
{
|
|
2296
2602
|
className: className ?? "editor",
|
|
@@ -2300,7 +2606,7 @@ function EditorInner({
|
|
|
2300
2606
|
onDragOver: handleDragOver
|
|
2301
2607
|
}
|
|
2302
2608
|
),
|
|
2303
|
-
footer && !renderFooter && /* @__PURE__ */ (0,
|
|
2609
|
+
footer && !renderFooter && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EditorFooter, {}),
|
|
2304
2610
|
renderFooter
|
|
2305
2611
|
] });
|
|
2306
2612
|
}
|
|
@@ -2341,6 +2647,8 @@ function EditorInner({
|
|
|
2341
2647
|
RightAlignTool,
|
|
2342
2648
|
SeparatorTool,
|
|
2343
2649
|
StrikeoutTool,
|
|
2650
|
+
TableCellBgColorTool,
|
|
2651
|
+
TableCellBorderColorTool,
|
|
2344
2652
|
TableTool,
|
|
2345
2653
|
TitleTool,
|
|
2346
2654
|
UnderlineTool,
|