@vizel/core 0.0.1-alpha.1 → 0.0.1-alpha.3
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/LICENSE +21 -0
- package/dist/index.d.ts +13 -13
- package/dist/index.js +141 -141
- package/dist/index10.js +70 -110
- package/dist/index11.js +135 -168
- package/dist/index12.js +83 -74
- package/dist/index13.js +13 -134
- package/dist/index14.js +13 -146
- package/dist/index15.js +303 -15
- package/dist/index16.js +69 -14
- package/dist/index17.js +26 -295
- package/dist/index18.js +2 -2
- package/dist/index19.js +355 -24
- package/dist/index20.js +25 -264
- package/dist/index21.js +85 -68
- package/dist/index22.js +97 -353
- package/dist/index23.js +66 -84
- package/dist/index24.js +12 -36
- package/dist/index25.js +53 -92
- package/dist/index26.js +132 -96
- package/dist/index27.js +59 -126
- package/dist/index28.js +37 -53
- package/dist/index29.js +19 -62
- package/dist/index3.js +165 -60
- package/dist/index30.js +9 -37
- package/dist/index31.js +143 -19
- package/dist/index32.js +264 -11
- package/dist/index33.js +92 -9
- package/dist/index34.js +63 -16
- package/dist/index35.js +4 -58
- package/dist/index36.js +123 -15
- package/dist/index37.js +305 -42
- package/dist/index38.js +487 -4
- package/dist/index39.js +37 -112
- package/dist/index4.js +10 -86
- package/dist/index40.js +653 -301
- package/dist/index41.js +4 -487
- package/dist/index42.js +4 -48
- package/dist/index43.js +206 -642
- package/dist/index44.js +82 -4
- package/dist/index45.js +17 -4
- package/dist/index46.js +57 -237
- package/dist/index47.js +15 -82
- package/dist/index48.js +190 -274
- package/dist/index49.js +281 -1497
- package/dist/index5.js +132 -10
- package/dist/index50.js +1502 -5
- package/dist/index51.js +5 -1561
- package/dist/index52.js +1551 -192
- package/dist/index53.js +1 -1
- package/dist/index54.js +84 -21
- package/dist/index55.js +246 -10
- package/dist/index56.js +3 -7
- package/dist/index57.js +1231 -7
- package/dist/index58.js +731 -11
- package/dist/index59.js +21 -19
- package/dist/index6.js +48 -131
- package/dist/index60.js +10 -25
- package/dist/index61.js +6 -83
- package/dist/index62.js +7 -245
- package/dist/index63.js +11 -1229
- package/dist/index64.js +17 -732
- package/dist/index65.js +25 -3
- package/dist/index66.js +53 -1059
- package/dist/index67.js +1059 -53
- package/dist/index69.js +90 -3
- package/dist/index7.js +228 -409
- package/dist/index70.js +3 -90
- package/dist/index8.js +111 -45
- package/dist/index9.js +409 -228
- package/package.json +54 -80
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Seiji Kohara
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -2575,17 +2575,14 @@ export { }
|
|
|
2575
2575
|
|
|
2576
2576
|
declare module "@tiptap/core" {
|
|
2577
2577
|
interface Commands<ReturnType> {
|
|
2578
|
-
|
|
2578
|
+
diagram: {
|
|
2579
2579
|
/**
|
|
2580
|
-
*
|
|
2580
|
+
* Insert a diagram block
|
|
2581
2581
|
*/
|
|
2582
|
-
|
|
2583
|
-
|
|
2582
|
+
insertDiagram: (options: {
|
|
2583
|
+
code: string;
|
|
2584
|
+
type?: VizelDiagramType;
|
|
2584
2585
|
}) => ReturnType;
|
|
2585
|
-
/**
|
|
2586
|
-
* Update embed data
|
|
2587
|
-
*/
|
|
2588
|
-
updateEmbed: (data: Partial<VizelEmbedData>) => ReturnType;
|
|
2589
2586
|
};
|
|
2590
2587
|
}
|
|
2591
2588
|
}
|
|
@@ -2609,14 +2606,17 @@ declare module "@tiptap/core" {
|
|
|
2609
2606
|
|
|
2610
2607
|
declare module "@tiptap/core" {
|
|
2611
2608
|
interface Commands<ReturnType> {
|
|
2612
|
-
|
|
2609
|
+
embed: {
|
|
2613
2610
|
/**
|
|
2614
|
-
*
|
|
2611
|
+
* Set an embed from URL
|
|
2615
2612
|
*/
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
type?: VizelDiagramType;
|
|
2613
|
+
setEmbed: (options: {
|
|
2614
|
+
url: string;
|
|
2619
2615
|
}) => ReturnType;
|
|
2616
|
+
/**
|
|
2617
|
+
* Update embed data
|
|
2618
|
+
*/
|
|
2619
|
+
updateEmbed: (data: Partial<VizelEmbedData>) => ReturnType;
|
|
2620
2620
|
};
|
|
2621
2621
|
}
|
|
2622
2622
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,150 +1,150 @@
|
|
|
1
1
|
import { BubbleMenuPlugin as r } from "@tiptap/extension-bubble-menu";
|
|
2
2
|
import { VIZEL_DEFAULT_AUTO_SAVE_OPTIONS as o, createVizelAutoSaveHandlers as t, formatVizelRelativeTime as i, getVizelStorageBackend as n } from "./index2.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { createVizelTableExtensions as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
3
|
+
import { createVizelExtensions as z } from "./index3.js";
|
|
4
|
+
import { createVizelCharacterCountExtension as m } from "./index4.js";
|
|
5
|
+
import { createVizelCodeBlockExtension as E, findVizelLanguage as p, getAllVizelLanguageIds as c, getVizelRegisteredLanguages as x } from "./index5.js";
|
|
6
|
+
import { createVizelDetailsExtensions as g } from "./index6.js";
|
|
7
|
+
import { VizelDiagram as T, createVizelDiagramExtension as _ } from "./index7.js";
|
|
8
|
+
import { VizelBlockMoveKeymap as h, createVizelDragHandleExtension as L, createVizelDragHandleExtensions as S } from "./index8.js";
|
|
9
|
+
import { VizelEmbed as D, createVizelDefaultFetchEmbedData as M, createVizelEmbedExtension as v, detectVizelEmbedProvider as A, vizelDefaultEmbedProviders as P, vizelEmbedPastePluginKey as H } from "./index9.js";
|
|
10
|
+
import { VIZEL_DEFAULT_FILE_MIME_TYPES as O, createVizelFileHandlerExtension as R, createVizelImageFileHandlers as b, filterVizelFilesByMimeType as k } from "./index10.js";
|
|
11
|
+
import { createVizelImageExtension as F, createVizelImageUploadExtensions as B, createVizelImageUploadWithFileHandler as y, vizelDefaultBase64Upload as G } from "./index11.js";
|
|
12
|
+
import { VizelResizableImage as w, VizelResizableImage as K } from "./index12.js";
|
|
13
|
+
import { createVizelLinkExtension as X } from "./index13.js";
|
|
14
|
+
import { VizelMarkdown as j, createVizelMarkdownExtension as q } from "./index14.js";
|
|
15
|
+
import { VizelMathBlock as Q, VizelMathInline as $, createVizelMathematicsExtensions as ee } from "./index15.js";
|
|
16
|
+
import { getVizelActiveNodeType as re, vizelDefaultNodeTypes as ae } from "./index16.js";
|
|
17
|
+
import { VizelSlashCommand as te } from "./index17.js";
|
|
18
|
+
import { createVizelTableExtensions as ne } from "./index18.js";
|
|
19
|
+
import { VIZEL_TABLE_MENU_ITEMS as ze, VizelTableWithControls as se } from "./index19.js";
|
|
20
|
+
import { createVizelTaskListExtensions as de } from "./index20.js";
|
|
21
|
+
import { VIZEL_HIGHLIGHT_COLORS as pe, VIZEL_TEXT_COLORS as ce, addVizelRecentColor as xe, createVizelTextColorExtensions as fe, getVizelRecentColors as ge } from "./index21.js";
|
|
22
|
+
import { getVizelIconId as Te, initVizelIconRenderer as _e, renderVizelIcon as ue, renderVizelIconSvg as he, setVizelIconRenderer as Le, vizelDefaultIconIds as Se } from "./index22.js";
|
|
23
|
+
import { VIZEL_DEFAULT_THEME as De, VIZEL_DEFAULT_THEME_STORAGE_KEY as Me, VIZEL_THEME_DATA_ATTRIBUTE as ve, applyVizelTheme as Ae, createVizelSystemThemeListener as Pe, getStoredVizelTheme as He, getVizelSystemTheme as Ue, getVizelThemeInitScript as Oe, resolveVizelTheme as Re, storeVizelTheme as be } from "./index23.js";
|
|
24
|
+
import { isVizelValidHexColor as Ze, normalizeVizelHexColor as Fe } from "./index24.js";
|
|
25
|
+
import { createVizelEditorInstance as ye } from "./index25.js";
|
|
26
|
+
import { VIZEL_UPLOAD_IMAGE_EVENT as Ne, convertVizelCodeBlocksToDiagrams as we, createVizelUploadEventHandler as Ke, getVizelEditorState as We, registerVizelUploadEventHandler as Xe, resolveVizelFeatures as Ye, transformVizelDiagramCodeBlocks as je, vizelDefaultEditorProps as qe } from "./index26.js";
|
|
27
|
+
import { VIZEL_DEFAULT_MARKDOWN_DEBOUNCE_MS as Qe, createVizelMarkdownSyncHandlers as $e, getVizelMarkdown as el, initializeVizelMarkdownContent as ll, parseVizelMarkdown as rl, setVizelMarkdown as al } from "./index27.js";
|
|
28
|
+
import { VIZEL_PORTAL_ID as tl, VIZEL_PORTAL_Z_INDEX as il, createVizelPortalElement as nl, getVizelPortalContainer as Vl, hasVizelPortalContainer as zl, mountToVizelPortal as sl, removeVizelPortalContainer as ml, unmountFromVizelPortal as dl } from "./index28.js";
|
|
29
|
+
import { VIZEL_SUGGESTION_Z_INDEX as pl, createVizelSuggestionContainer as cl, handleVizelSuggestionEscape as xl } from "./index29.js";
|
|
30
|
+
import { splitVizelTextByMatches as gl } from "./index30.js";
|
|
31
|
+
import { createVizelImageUploadPlugin as Tl, createVizelImageUploader as _l, getVizelImageUploadPluginKey as ul, handleVizelImageDrop as hl, handleVizelImagePaste as Ll, validateVizelImageFile as Sl } from "./index31.js";
|
|
32
|
+
import { filterSlashCommands as Dl, flattenSlashCommandGroups as Ml, groupSlashCommands as vl, searchSlashCommands as Al, defaultGroupOrder as Pl, defaultSlashCommands as Hl } from "./index32.js";
|
|
33
|
+
import { default as Ol } from "@tiptap/extension-drag-handle";
|
|
34
|
+
import { default as bl } from "@tiptap/extension-image";
|
|
35
|
+
import { VizelTable as Zl, VizelTableCell as Fl, VizelTableHeader as Bl } from "./index33.js";
|
|
36
36
|
export {
|
|
37
37
|
r as BubbleMenuPlugin,
|
|
38
38
|
o as VIZEL_DEFAULT_AUTO_SAVE_OPTIONS,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
39
|
+
O as VIZEL_DEFAULT_FILE_MIME_TYPES,
|
|
40
|
+
Qe as VIZEL_DEFAULT_MARKDOWN_DEBOUNCE_MS,
|
|
41
|
+
De as VIZEL_DEFAULT_THEME,
|
|
42
|
+
Me as VIZEL_DEFAULT_THEME_STORAGE_KEY,
|
|
43
|
+
pe as VIZEL_HIGHLIGHT_COLORS,
|
|
44
|
+
tl as VIZEL_PORTAL_ID,
|
|
45
|
+
il as VIZEL_PORTAL_Z_INDEX,
|
|
46
|
+
pl as VIZEL_SUGGESTION_Z_INDEX,
|
|
47
|
+
ze as VIZEL_TABLE_MENU_ITEMS,
|
|
48
|
+
ce as VIZEL_TEXT_COLORS,
|
|
49
|
+
ve as VIZEL_THEME_DATA_ATTRIBUTE,
|
|
50
|
+
Ne as VIZEL_UPLOAD_IMAGE_EVENT,
|
|
51
|
+
h as VizelBlockMoveKeymap,
|
|
52
|
+
T as VizelDiagram,
|
|
53
|
+
Ol as VizelDragHandle,
|
|
54
|
+
D as VizelEmbed,
|
|
55
|
+
bl as VizelImage,
|
|
56
|
+
w as VizelImageResize,
|
|
57
|
+
j as VizelMarkdown,
|
|
58
|
+
Q as VizelMathBlock,
|
|
59
|
+
$ as VizelMathInline,
|
|
60
|
+
K as VizelResizableImage,
|
|
61
|
+
te as VizelSlashCommand,
|
|
62
|
+
Zl as VizelTable,
|
|
63
|
+
Fl as VizelTableCell,
|
|
64
|
+
Bl as VizelTableHeader,
|
|
65
|
+
se as VizelTableWithControls,
|
|
66
|
+
xe as addVizelRecentColor,
|
|
67
|
+
Ae as applyVizelTheme,
|
|
68
|
+
we as convertVizelCodeBlocksToDiagrams,
|
|
69
69
|
t as createVizelAutoSaveHandlers,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
70
|
+
m as createVizelCharacterCountExtension,
|
|
71
|
+
E as createVizelCodeBlockExtension,
|
|
72
|
+
M as createVizelDefaultFetchEmbedData,
|
|
73
|
+
g as createVizelDetailsExtensions,
|
|
74
|
+
_ as createVizelDiagramExtension,
|
|
75
|
+
L as createVizelDragHandleExtension,
|
|
76
|
+
S as createVizelDragHandleExtensions,
|
|
77
|
+
ye as createVizelEditorInstance,
|
|
78
|
+
v as createVizelEmbedExtension,
|
|
79
|
+
z as createVizelExtensions,
|
|
80
|
+
R as createVizelFileHandlerExtension,
|
|
81
|
+
F as createVizelImageExtension,
|
|
82
|
+
b as createVizelImageFileHandlers,
|
|
83
|
+
B as createVizelImageUploadExtensions,
|
|
84
|
+
Tl as createVizelImageUploadPlugin,
|
|
85
|
+
y as createVizelImageUploadWithFileHandler,
|
|
86
|
+
_l as createVizelImageUploader,
|
|
87
|
+
X as createVizelLinkExtension,
|
|
88
|
+
q as createVizelMarkdownExtension,
|
|
89
|
+
$e as createVizelMarkdownSyncHandlers,
|
|
90
|
+
ee as createVizelMathematicsExtensions,
|
|
91
|
+
nl as createVizelPortalElement,
|
|
92
|
+
cl as createVizelSuggestionContainer,
|
|
93
|
+
Pe as createVizelSystemThemeListener,
|
|
94
|
+
ne as createVizelTableExtensions,
|
|
95
|
+
de as createVizelTaskListExtensions,
|
|
96
|
+
fe as createVizelTextColorExtensions,
|
|
97
|
+
Ke as createVizelUploadEventHandler,
|
|
98
|
+
A as detectVizelEmbedProvider,
|
|
99
|
+
k as filterVizelFilesByMimeType,
|
|
100
|
+
Dl as filterVizelSlashCommands,
|
|
101
|
+
p as findVizelLanguage,
|
|
102
|
+
Ml as flattenVizelSlashCommandGroups,
|
|
103
103
|
i as formatVizelRelativeTime,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
c as getAllVizelLanguageIds,
|
|
105
|
+
He as getStoredVizelTheme,
|
|
106
|
+
re as getVizelActiveNodeType,
|
|
107
|
+
We as getVizelEditorState,
|
|
108
|
+
Te as getVizelIconId,
|
|
109
|
+
ul as getVizelImageUploadPluginKey,
|
|
110
|
+
el as getVizelMarkdown,
|
|
111
|
+
Vl as getVizelPortalContainer,
|
|
112
|
+
ge as getVizelRecentColors,
|
|
113
|
+
x as getVizelRegisteredLanguages,
|
|
114
114
|
n as getVizelStorageBackend,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
115
|
+
Ue as getVizelSystemTheme,
|
|
116
|
+
Oe as getVizelThemeInitScript,
|
|
117
|
+
vl as groupVizelSlashCommands,
|
|
118
|
+
hl as handleVizelImageDrop,
|
|
119
|
+
Ll as handleVizelImagePaste,
|
|
120
|
+
xl as handleVizelSuggestionEscape,
|
|
121
|
+
zl as hasVizelPortalContainer,
|
|
122
|
+
_e as initVizelIconRenderer,
|
|
123
|
+
ll as initializeVizelMarkdownContent,
|
|
124
|
+
Ze as isVizelValidHexColor,
|
|
125
|
+
sl as mountToVizelPortal,
|
|
126
|
+
Fe as normalizeVizelHexColor,
|
|
127
|
+
rl as parseVizelMarkdown,
|
|
128
|
+
Xe as registerVizelUploadEventHandler,
|
|
129
|
+
ml as removeVizelPortalContainer,
|
|
130
|
+
ue as renderVizelIcon,
|
|
131
|
+
he as renderVizelIconSvg,
|
|
132
|
+
Ye as resolveVizelFeatures,
|
|
133
|
+
Re as resolveVizelTheme,
|
|
134
|
+
Al as searchVizelSlashCommands,
|
|
135
|
+
Le as setVizelIconRenderer,
|
|
136
|
+
al as setVizelMarkdown,
|
|
137
|
+
gl as splitVizelTextByMatches,
|
|
138
|
+
be as storeVizelTheme,
|
|
139
|
+
je as transformVizelDiagramCodeBlocks,
|
|
140
|
+
dl as unmountFromVizelPortal,
|
|
141
|
+
Sl as validateVizelImageFile,
|
|
142
|
+
G as vizelDefaultBase64Upload,
|
|
143
|
+
qe as vizelDefaultEditorProps,
|
|
144
|
+
P as vizelDefaultEmbedProviders,
|
|
145
|
+
Pl as vizelDefaultGroupOrder,
|
|
146
|
+
Se as vizelDefaultIconIds,
|
|
147
|
+
ae as vizelDefaultNodeTypes,
|
|
148
|
+
Hl as vizelDefaultSlashCommands,
|
|
149
|
+
H as vizelEmbedPastePluginKey
|
|
150
150
|
};
|
package/dist/index10.js
CHANGED
|
@@ -1,118 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
t.classList.add("vizel-drag-handle"), t.setAttribute("data-vizel-drag-handle", ""), t.setAttribute("draggable", "true"), t.setAttribute("aria-label", "Drag to reorder block"), t.setAttribute("role", "button");
|
|
15
|
-
const n = document.createElement("div");
|
|
16
|
-
return n.classList.add("vizel-drag-handle-grip"), n.innerHTML = m("grip", { width: 14, height: 14 }), t.appendChild(n), r = t, t;
|
|
17
|
-
},
|
|
18
|
-
onNodeChange({ node: t }) {
|
|
19
|
-
r && (t ? r.classList.add("is-visible") : r.classList.remove("is-visible"));
|
|
20
|
-
},
|
|
21
|
-
computePositionConfig: {
|
|
22
|
-
placement: "left"
|
|
1
|
+
import { FileHandler as d } from "./index39.js";
|
|
2
|
+
const g = [
|
|
3
|
+
"image/jpeg",
|
|
4
|
+
"image/png",
|
|
5
|
+
"image/gif",
|
|
6
|
+
"image/webp",
|
|
7
|
+
"image/svg+xml"
|
|
8
|
+
], m = 20 * 1024 * 1024;
|
|
9
|
+
function c(l, r) {
|
|
10
|
+
return l.filter((i) => r.includes(i.type) ? !0 : r.some((t) => {
|
|
11
|
+
if (t.endsWith("/*")) {
|
|
12
|
+
const n = t.slice(0, -2);
|
|
13
|
+
return i.type.startsWith(`${n}/`);
|
|
23
14
|
}
|
|
24
|
-
|
|
15
|
+
return !1;
|
|
16
|
+
}));
|
|
25
17
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
18
|
+
function p(l = {}) {
|
|
19
|
+
const { allowedMimeTypes: r = g, onPaste: i, onDrop: a, onError: t } = l;
|
|
20
|
+
return d.configure({
|
|
21
|
+
allowedMimeTypes: r,
|
|
22
|
+
onPaste: (n, e, o) => {
|
|
23
|
+
if (e.length === 0)
|
|
24
|
+
return;
|
|
25
|
+
const s = c(e, r);
|
|
26
|
+
if (s.length === 0) {
|
|
27
|
+
t?.({
|
|
28
|
+
type: "invalid_mime_type",
|
|
29
|
+
message: `No files with allowed MIME types. Allowed: ${r.join(", ")}`,
|
|
30
|
+
files: e
|
|
31
|
+
});
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
i?.(n, s, o);
|
|
35
|
+
},
|
|
36
|
+
onDrop: (n, e, o) => {
|
|
37
|
+
if (e.length === 0)
|
|
38
|
+
return;
|
|
39
|
+
const s = c(e, r);
|
|
40
|
+
if (s.length === 0) {
|
|
41
|
+
t?.({
|
|
42
|
+
type: "invalid_mime_type",
|
|
43
|
+
message: `No files with allowed MIME types. Allowed: ${r.join(", ")}`,
|
|
44
|
+
files: e
|
|
45
|
+
});
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
a?.(n, s, o);
|
|
54
49
|
}
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
if (l <= 0) return null;
|
|
58
|
-
let c = n;
|
|
59
|
-
for (let s = 0; s < l - 1; s++)
|
|
60
|
-
c += i.child(s).nodeSize;
|
|
61
|
-
return { pos: c, node: i.child(l - 1) };
|
|
62
|
-
}
|
|
63
|
-
function h(e, o) {
|
|
64
|
-
const r = o.pos + o.node.nodeSize, t = e.doc.resolve(r);
|
|
65
|
-
if (r >= t.end(t.depth)) return null;
|
|
66
|
-
const n = e.doc.nodeAt(r);
|
|
67
|
-
return n ? { pos: r, node: n } : null;
|
|
50
|
+
});
|
|
68
51
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (!i) return !1;
|
|
78
|
-
if (r) {
|
|
79
|
-
const d = n.pos + n.node.nodeSize;
|
|
80
|
-
e.delete(n.pos, d), e.insert(i.pos, n.node);
|
|
81
|
-
const l = i.pos + 1;
|
|
82
|
-
e.setSelection(a.near(e.doc.resolve(l)));
|
|
83
|
-
}
|
|
84
|
-
return !0;
|
|
85
|
-
},
|
|
86
|
-
moveBlockDown: () => ({ tr: e, state: o, dispatch: r }) => {
|
|
87
|
-
const { $from: t } = o.selection, n = u(t);
|
|
88
|
-
if (!n) return !1;
|
|
89
|
-
const i = h(o, n);
|
|
90
|
-
if (!i) return !1;
|
|
91
|
-
if (r) {
|
|
92
|
-
const d = n.pos + n.node.nodeSize;
|
|
93
|
-
e.delete(n.pos, d);
|
|
94
|
-
const l = n.pos + i.node.nodeSize;
|
|
95
|
-
e.insert(l, n.node);
|
|
96
|
-
const c = l + 1;
|
|
97
|
-
e.setSelection(a.near(e.doc.resolve(c)));
|
|
98
|
-
}
|
|
99
|
-
return !0;
|
|
52
|
+
function f(l) {
|
|
53
|
+
const { onUpload: r, onUploadError: i } = l, a = async (t, n) => {
|
|
54
|
+
for (const e of n)
|
|
55
|
+
try {
|
|
56
|
+
const o = await r(e);
|
|
57
|
+
t.chain().focus().setImage({ src: o }).run();
|
|
58
|
+
} catch (o) {
|
|
59
|
+
i?.(o instanceof Error ? o : new Error(String(o)), e);
|
|
100
60
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
function x(e = {}) {
|
|
111
|
-
return [v(e), S];
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
onPaste: (t, n, e) => {
|
|
64
|
+
a(t, n);
|
|
65
|
+
},
|
|
66
|
+
onDrop: (t, n, e) => {
|
|
67
|
+
a(t, n);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
112
70
|
}
|
|
113
71
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
72
|
+
d as FileHandler,
|
|
73
|
+
g as VIZEL_DEFAULT_FILE_MIME_TYPES,
|
|
74
|
+
m as VIZEL_DEFAULT_IMAGE_MAX_FILE_SIZE,
|
|
75
|
+
p as createVizelFileHandlerExtension,
|
|
76
|
+
f as createVizelImageFileHandlers,
|
|
77
|
+
c as filterVizelFilesByMimeType
|
|
118
78
|
};
|