@cgboiler/biz-basic 1.0.67 → 1.0.68

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.
Files changed (59) hide show
  1. package/es/index.d.ts +1 -1
  2. package/es/index.js +1 -1
  3. package/es/rich-text-editor/RichTextEditor.js +3 -0
  4. package/es/rich-text-editor/index.css +1 -1
  5. package/es/rich-text-editor/index.less +437 -436
  6. package/es/rich-text-editor/lib/utils.d.ts +123 -0
  7. package/es/rich-text-editor/lib/utils.js +244 -0
  8. package/es/rich-text-editor/menu-system/components/_atomic.css +2 -0
  9. package/es/rich-text-editor/menu-system/components/table-dropdown-menu.d.ts +25 -0
  10. package/es/rich-text-editor/menu-system/components/table-dropdown-menu.js +167 -0
  11. package/es/rich-text-editor/menu-system/icons/index.d.ts +13 -0
  12. package/es/rich-text-editor/menu-system/icons/index.js +26 -0
  13. package/es/rich-text-editor/menu-system/styles/animations.less +91 -91
  14. package/es/rich-text-editor/menu-system/styles/button-colors.less +142 -142
  15. package/es/rich-text-editor/menu-system/styles/button-group.less +23 -23
  16. package/es/rich-text-editor/menu-system/styles/button.less +322 -322
  17. package/es/rich-text-editor/menu-system/styles/card.less +78 -78
  18. package/es/rich-text-editor/menu-system/styles/color-highlight-button.less +57 -57
  19. package/es/rich-text-editor/menu-system/styles/color-highlight-popover.less +51 -51
  20. package/es/rich-text-editor/menu-system/styles/dropdown-menu.less +40 -40
  21. package/es/rich-text-editor/menu-system/styles/image-upload-node.less +240 -240
  22. package/es/rich-text-editor/menu-system/styles/input.less +53 -53
  23. package/es/rich-text-editor/menu-system/styles/link-popover.less +32 -32
  24. package/es/rich-text-editor/menu-system/styles/separator.less +26 -26
  25. package/es/rich-text-editor/menu-system/styles/simple-editor.less +39 -39
  26. package/es/rich-text-editor/menu-system/styles/toolbar.less +87 -87
  27. package/es/rich-text-editor/menu-system/styles/variables.less +294 -294
  28. package/es/vue-sfc-shim.d.ts +6 -6
  29. package/es/vue-tsx-shim.d.ts +24 -24
  30. package/lib/index.d.ts +1 -1
  31. package/lib/index.js +1 -1
  32. package/lib/rich-text-editor/RichTextEditor.js +3 -0
  33. package/lib/rich-text-editor/index.css +1 -1
  34. package/lib/rich-text-editor/index.less +437 -436
  35. package/lib/rich-text-editor/lib/utils.d.ts +123 -0
  36. package/lib/rich-text-editor/lib/utils.js +263 -0
  37. package/lib/rich-text-editor/menu-system/components/_atomic.css +2 -0
  38. package/lib/rich-text-editor/menu-system/components/table-dropdown-menu.d.ts +25 -0
  39. package/lib/rich-text-editor/menu-system/components/table-dropdown-menu.js +186 -0
  40. package/lib/rich-text-editor/menu-system/icons/index.d.ts +13 -0
  41. package/lib/rich-text-editor/menu-system/icons/index.js +26 -0
  42. package/lib/rich-text-editor/menu-system/styles/animations.less +91 -91
  43. package/lib/rich-text-editor/menu-system/styles/button-colors.less +142 -142
  44. package/lib/rich-text-editor/menu-system/styles/button-group.less +23 -23
  45. package/lib/rich-text-editor/menu-system/styles/button.less +322 -322
  46. package/lib/rich-text-editor/menu-system/styles/card.less +78 -78
  47. package/lib/rich-text-editor/menu-system/styles/color-highlight-button.less +57 -57
  48. package/lib/rich-text-editor/menu-system/styles/color-highlight-popover.less +51 -51
  49. package/lib/rich-text-editor/menu-system/styles/dropdown-menu.less +40 -40
  50. package/lib/rich-text-editor/menu-system/styles/image-upload-node.less +240 -240
  51. package/lib/rich-text-editor/menu-system/styles/input.less +53 -53
  52. package/lib/rich-text-editor/menu-system/styles/link-popover.less +32 -32
  53. package/lib/rich-text-editor/menu-system/styles/separator.less +26 -26
  54. package/lib/rich-text-editor/menu-system/styles/simple-editor.less +39 -39
  55. package/lib/rich-text-editor/menu-system/styles/toolbar.less +87 -87
  56. package/lib/rich-text-editor/menu-system/styles/variables.less +294 -294
  57. package/lib/vue-sfc-shim.d.ts +6 -6
  58. package/lib/vue-tsx-shim.d.ts +24 -24
  59. package/package.json +1 -1
@@ -0,0 +1,123 @@
1
+ import type { Node as TiptapNode } from '@tiptap/pm/model';
2
+ import type { Editor } from '@tiptap/core';
3
+ import { type ClassValue } from 'clsx';
4
+ export declare const MAX_FILE_SIZE: number;
5
+ export declare const MAC_SYMBOLS: Record<string, string>;
6
+ export declare function cn(...inputs: ClassValue[]): string;
7
+ /**
8
+ * Determines if the current platform is macOS
9
+ * @returns boolean indicating if the current platform is Mac
10
+ */
11
+ export declare function isMac(): boolean;
12
+ /**
13
+ * Formats a shortcut key based on the platform (Mac or non-Mac)
14
+ * @param key - The key to format (e.g., "ctrl", "alt", "shift")
15
+ * @param isMac - Boolean indicating if the platform is Mac
16
+ * @param capitalize - Whether to capitalize the key (default: true)
17
+ * @returns Formatted shortcut key symbol
18
+ */
19
+ export declare const formatShortcutKey: (key: string, isMac: boolean, capitalize?: boolean) => string;
20
+ /**
21
+ * Parses a shortcut key string into an array of formatted key symbols
22
+ * @param shortcutKeys - The string of shortcut keys (e.g., "ctrl-alt-shift")
23
+ * @param delimiter - The delimiter used to split the keys (default: "-")
24
+ * @param capitalize - Whether to capitalize the keys (default: true)
25
+ * @returns Array of formatted shortcut key symbols
26
+ */
27
+ export declare const parseShortcutKeys: (props: {
28
+ shortcutKeys: string | undefined;
29
+ delimiter?: string;
30
+ capitalize?: boolean;
31
+ }) => string[];
32
+ /**
33
+ * Checks if a mark exists in the editor schema
34
+ * @param markName - The name of the mark to check
35
+ * @param editor - The editor instance
36
+ * @returns boolean indicating if the mark exists in the schema
37
+ */
38
+ export declare const isMarkInSchema: (markName: string, editor: Editor | null) => boolean;
39
+ /**
40
+ * Checks if a node exists in the editor schema
41
+ * @param nodeName - The name of the node to check
42
+ * @param editor - The editor instance
43
+ * @returns boolean indicating if the node exists in the schema
44
+ */
45
+ export declare const isNodeInSchema: (nodeName: string, editor: Editor | null) => boolean;
46
+ /**
47
+ * Moves the focus to the next node in the editor
48
+ * @param editor - The editor instance
49
+ * @returns boolean indicating if the focus was moved
50
+ */
51
+ export declare function focusNextNode(editor: Editor): boolean;
52
+ /**
53
+ * Checks if a value is a valid number (not null, undefined, or NaN)
54
+ * @param value - The value to check
55
+ * @returns boolean indicating if the value is a valid number
56
+ */
57
+ export declare function isValidPosition(pos: number | null | undefined): pos is number;
58
+ /**
59
+ * Checks if one or more extensions are registered in the Tiptap editor.
60
+ * @param editor - The Tiptap editor instance
61
+ * @param extensionNames - A single extension name or an array of names to check
62
+ * @returns True if at least one of the extensions is available, false otherwise
63
+ */
64
+ export declare function isExtensionAvailable(editor: Editor | null, extensionNames: string | string[]): boolean;
65
+ /**
66
+ * Finds a node at the specified position with error handling
67
+ * @param editor The Tiptap editor instance
68
+ * @param position The position in the document to find the node
69
+ * @returns The node at the specified position, or null if not found
70
+ */
71
+ export declare function findNodeAtPosition(editor: Editor, position: number): TiptapNode | null;
72
+ /**
73
+ * Finds the position and instance of a node in the document
74
+ * @param props Object containing editor, node (optional), and nodePos (optional)
75
+ * @param props.editor The Tiptap editor instance
76
+ * @param props.node The node to find (optional if nodePos is provided)
77
+ * @param props.nodePos The position of the node to find (optional if node is provided)
78
+ * @returns An object with the position and node, or null if not found
79
+ */
80
+ export declare function findNodePosition(props: {
81
+ editor: Editor | null;
82
+ node?: TiptapNode | null;
83
+ nodePos?: number | null;
84
+ }): {
85
+ pos: number;
86
+ node: TiptapNode;
87
+ } | null;
88
+ /**
89
+ * Checks if the current selection in the editor is a node selection of specified types
90
+ * @param editor The Tiptap editor instance
91
+ * @param types An array of node type names to check against
92
+ * @returns boolean indicating if the selected node matches any of the specified types
93
+ */
94
+ export declare function isNodeTypeSelected(editor: Editor | null, types?: string[]): boolean;
95
+ /**
96
+ * Handles image upload with progress tracking and abort capability
97
+ * @param file The file to upload
98
+ * @param onProgress Optional callback for tracking upload progress
99
+ * @param abortSignal Optional AbortSignal for cancelling the upload
100
+ * @returns Promise resolving to the URL of the uploaded image
101
+ */
102
+ export declare const handleImageUpload: (file: File, onProgress?: (event: {
103
+ progress: number;
104
+ }) => void, abortSignal?: AbortSignal) => Promise<string>;
105
+ type ProtocolOptions = {
106
+ /**
107
+ * The protocol scheme to be registered.
108
+ * @default '''
109
+ * @example 'ftp'
110
+ * @example 'git'
111
+ */
112
+ scheme: string;
113
+ /**
114
+ * If enabled, it allows optional slashes after the protocol.
115
+ * @default false
116
+ * @example true
117
+ */
118
+ optionalSlashes?: boolean;
119
+ };
120
+ type ProtocolConfig = Array<ProtocolOptions | string>;
121
+ export declare function isAllowedUri(uri: string | undefined, protocols?: ProtocolConfig): true | RegExpMatchArray | null;
122
+ export declare function sanitizeUrl(inputUrl: string, baseUrl: string, protocols?: ProtocolConfig): string;
123
+ export {};
@@ -0,0 +1,244 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+ import { NodeSelection, Selection, TextSelection } from "@tiptap/pm/state";
22
+ import { clsx } from "clsx";
23
+ const MAX_FILE_SIZE = 5 * 1024 * 1024;
24
+ const MAC_SYMBOLS = {
25
+ mod: "\u2318",
26
+ command: "\u2318",
27
+ meta: "\u2318",
28
+ ctrl: "\u2303",
29
+ control: "\u2303",
30
+ alt: "\u2325",
31
+ option: "\u2325",
32
+ shift: "\u21E7",
33
+ backspace: "Del",
34
+ delete: "\u2326",
35
+ enter: "\u23CE",
36
+ escape: "\u238B",
37
+ capslock: "\u21EA"
38
+ };
39
+ function cn(...inputs) {
40
+ return clsx(inputs);
41
+ }
42
+ function isMac() {
43
+ return typeof navigator !== "undefined" && navigator.platform.toLowerCase().includes("mac");
44
+ }
45
+ const formatShortcutKey = (key, isMac2, capitalize = true) => {
46
+ if (isMac2) {
47
+ const lowerKey = key.toLowerCase();
48
+ return MAC_SYMBOLS[lowerKey] || (capitalize ? key.toUpperCase() : key);
49
+ }
50
+ return capitalize ? key.charAt(0).toUpperCase() + key.slice(1) : key;
51
+ };
52
+ const parseShortcutKeys = (props) => {
53
+ const { shortcutKeys, delimiter = "+", capitalize = true } = props;
54
+ if (!shortcutKeys)
55
+ return [];
56
+ return shortcutKeys.split(delimiter).map((key) => key.trim()).map((key) => formatShortcutKey(key, isMac(), capitalize));
57
+ };
58
+ const isMarkInSchema = (markName, editor) => {
59
+ if (!(editor == null ? void 0 : editor.schema))
60
+ return false;
61
+ return editor.schema.spec.marks.get(markName) !== void 0;
62
+ };
63
+ const isNodeInSchema = (nodeName, editor) => {
64
+ if (!(editor == null ? void 0 : editor.schema))
65
+ return false;
66
+ return editor.schema.spec.nodes.get(nodeName) !== void 0;
67
+ };
68
+ function focusNextNode(editor) {
69
+ const { state, view } = editor;
70
+ const { doc, selection } = state;
71
+ const nextSel = Selection.findFrom(selection.$to, 1, true);
72
+ if (nextSel) {
73
+ view.dispatch(state.tr.setSelection(nextSel).scrollIntoView());
74
+ return true;
75
+ }
76
+ const paragraphType = state.schema.nodes.paragraph;
77
+ if (!paragraphType) {
78
+ console.warn("No paragraph node type found in schema.");
79
+ return false;
80
+ }
81
+ const end = doc.content.size;
82
+ const para = paragraphType.create();
83
+ let tr = state.tr.insert(end, para);
84
+ const $inside = tr.doc.resolve(end + 1);
85
+ tr = tr.setSelection(TextSelection.near($inside)).scrollIntoView();
86
+ view.dispatch(tr);
87
+ return true;
88
+ }
89
+ function isValidPosition(pos) {
90
+ return typeof pos === "number" && pos >= 0;
91
+ }
92
+ function isExtensionAvailable(editor, extensionNames) {
93
+ if (!editor)
94
+ return false;
95
+ const names = Array.isArray(extensionNames) ? extensionNames : [extensionNames];
96
+ const found = names.some(
97
+ (name) => editor.extensionManager.extensions.some((ext) => ext.name === name)
98
+ );
99
+ if (!found) {
100
+ console.warn(
101
+ `None of the extensions [${names.join(
102
+ ", "
103
+ )}] were found in the editor schema. Ensure they are included in the editor configuration.`
104
+ );
105
+ }
106
+ return found;
107
+ }
108
+ function findNodeAtPosition(editor, position) {
109
+ try {
110
+ const node = editor.state.doc.nodeAt(position);
111
+ if (!node) {
112
+ console.warn(`No node found at position ${position}`);
113
+ return null;
114
+ }
115
+ return node;
116
+ } catch (error) {
117
+ console.error(`Error getting node at position ${position}:`, error);
118
+ return null;
119
+ }
120
+ }
121
+ function findNodePosition(props) {
122
+ var _a;
123
+ const { editor, node, nodePos } = props;
124
+ if (!editor || !((_a = editor.state) == null ? void 0 : _a.doc))
125
+ return null;
126
+ const hasValidNode = node !== void 0 && node !== null;
127
+ const hasValidPos = isValidPosition(nodePos);
128
+ if (!hasValidNode && !hasValidPos) {
129
+ return null;
130
+ }
131
+ if (hasValidNode) {
132
+ let foundPos = -1;
133
+ let foundNode = null;
134
+ editor.state.doc.descendants((currentNode, pos) => {
135
+ if (currentNode === node) {
136
+ foundPos = pos;
137
+ foundNode = currentNode;
138
+ return false;
139
+ }
140
+ return true;
141
+ });
142
+ if (foundPos !== -1 && foundNode !== null) {
143
+ return { pos: foundPos, node: foundNode };
144
+ }
145
+ }
146
+ if (hasValidPos) {
147
+ const nodeAtPos = findNodeAtPosition(editor, nodePos);
148
+ if (nodeAtPos) {
149
+ return { pos: nodePos, node: nodeAtPos };
150
+ }
151
+ }
152
+ return null;
153
+ }
154
+ function isNodeTypeSelected(editor, types = []) {
155
+ if (!editor || !editor.state.selection)
156
+ return false;
157
+ const { state } = editor;
158
+ const { selection } = state;
159
+ if (selection.empty)
160
+ return false;
161
+ if (selection instanceof NodeSelection) {
162
+ const node = selection.node;
163
+ return node ? types.includes(node.type.name) : false;
164
+ }
165
+ return false;
166
+ }
167
+ const handleImageUpload = (file, onProgress, abortSignal) => __async(void 0, null, function* () {
168
+ if (!file) {
169
+ throw new Error("No file provided");
170
+ }
171
+ if (file.size > MAX_FILE_SIZE) {
172
+ throw new Error(`File size exceeds maximum allowed (${MAX_FILE_SIZE / (1024 * 1024)}MB)`);
173
+ }
174
+ for (let progress = 0; progress <= 100; progress += 10) {
175
+ if (abortSignal == null ? void 0 : abortSignal.aborted) {
176
+ throw new Error("Upload cancelled");
177
+ }
178
+ yield new Promise((resolve) => setTimeout(resolve, 500));
179
+ onProgress == null ? void 0 : onProgress({ progress });
180
+ }
181
+ return "/images/tiptap-ui-placeholder-image.jpg";
182
+ });
183
+ const ATTR_WHITESPACE = (
184
+ // eslint-disable-next-line no-control-regex
185
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
186
+ );
187
+ function isAllowedUri(uri, protocols) {
188
+ const allowedProtocols = [
189
+ "http",
190
+ "https",
191
+ "ftp",
192
+ "ftps",
193
+ "mailto",
194
+ "tel",
195
+ "callto",
196
+ "sms",
197
+ "cid",
198
+ "xmpp"
199
+ ];
200
+ if (protocols) {
201
+ protocols.forEach((protocol) => {
202
+ const nextProtocol = typeof protocol === "string" ? protocol : protocol.scheme;
203
+ if (nextProtocol) {
204
+ allowedProtocols.push(nextProtocol);
205
+ }
206
+ });
207
+ }
208
+ return !uri || uri.replace(ATTR_WHITESPACE, "").match(
209
+ new RegExp(
210
+ // eslint-disable-next-line no-useless-escape
211
+ `^(?:(?:${allowedProtocols.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,
212
+ "i"
213
+ )
214
+ );
215
+ }
216
+ function sanitizeUrl(inputUrl, baseUrl, protocols) {
217
+ try {
218
+ const url = new URL(inputUrl, baseUrl);
219
+ if (isAllowedUri(url.href, protocols)) {
220
+ return url.href;
221
+ }
222
+ } catch (e) {
223
+ }
224
+ return "#";
225
+ }
226
+ export {
227
+ MAC_SYMBOLS,
228
+ MAX_FILE_SIZE,
229
+ cn,
230
+ findNodeAtPosition,
231
+ findNodePosition,
232
+ focusNextNode,
233
+ formatShortcutKey,
234
+ handleImageUpload,
235
+ isAllowedUri,
236
+ isExtensionAvailable,
237
+ isMac,
238
+ isMarkInSchema,
239
+ isNodeInSchema,
240
+ isNodeTypeSelected,
241
+ isValidPosition,
242
+ parseShortcutKeys,
243
+ sanitizeUrl
244
+ };
@@ -39,6 +39,8 @@
39
39
 
40
40
 
41
41
 
42
+ /* layer: default */
43
+ .cgx-atm .table{display:table;}
42
44
 
43
45
 
44
46
 
@@ -0,0 +1,25 @@
1
+ import { type PropType } from 'vue';
2
+ import 'element-plus/es/components/dropdown/style/css';
3
+ import 'element-plus/es/components/dropdown-menu/style/css';
4
+ import 'element-plus/es/components/dropdown-item/style/css';
5
+ export declare const TableDropdownMenu: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ editor: {
7
+ type: PropType<any>;
8
+ required: true;
9
+ };
10
+ className: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
14
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
+ editor: {
16
+ type: PropType<any>;
17
+ required: true;
18
+ };
19
+ className: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ }>> & Readonly<{}>, {
24
+ className: string;
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,167 @@
1
+ import { createVNode as _createVNode, mergeProps as _mergeProps, createTextVNode as _createTextVNode, Fragment as _Fragment } from "vue";
2
+ import "./_atomic.css";
3
+ import { defineComponent } from "vue";
4
+ import { Button } from "../primitives/button";
5
+ import { cn } from "../utils/tiptap-utils";
6
+ import { ElDropdown, ElDropdownMenu, ElDropdownItem } from "element-plus";
7
+ import { ChevronDownIcon, TableIcon } from "../icons";
8
+ import "element-plus/es/components/dropdown/style/css";
9
+ import "element-plus/es/components/dropdown-menu/style/css";
10
+ import "element-plus/es/components/dropdown-item/style/css";
11
+ const TableDropdownMenu = defineComponent({
12
+ name: "TableDropdownMenu",
13
+ props: {
14
+ editor: {
15
+ type: Object,
16
+ required: true
17
+ },
18
+ className: {
19
+ type: String,
20
+ default: ""
21
+ }
22
+ },
23
+ setup(props, {
24
+ attrs
25
+ }) {
26
+ const handleCommand = (command) => {
27
+ const editor = props.editor && "value" in props.editor ? props.editor.value : props.editor;
28
+ if (!editor)
29
+ return;
30
+ switch (command) {
31
+ case "insertTable":
32
+ editor.commands.insertTable({
33
+ rows: 3,
34
+ cols: 3,
35
+ withHeaderRow: true
36
+ });
37
+ break;
38
+ case "addColumnBefore":
39
+ editor.commands.addColumnBefore();
40
+ break;
41
+ case "addColumnAfter":
42
+ editor.commands.addColumnAfter();
43
+ break;
44
+ case "deleteColumn":
45
+ editor.commands.deleteColumn();
46
+ break;
47
+ case "addRowBefore":
48
+ editor.commands.addRowBefore();
49
+ break;
50
+ case "addRowAfter":
51
+ editor.commands.addRowAfter();
52
+ break;
53
+ case "deleteRow":
54
+ editor.commands.deleteRow();
55
+ break;
56
+ case "deleteTable":
57
+ editor.commands.deleteTable();
58
+ break;
59
+ case "mergeCells":
60
+ editor.commands.mergeCells();
61
+ break;
62
+ case "splitCell":
63
+ editor.commands.splitCell();
64
+ break;
65
+ case "toggleHeaderRow":
66
+ editor.commands.toggleHeaderRow();
67
+ break;
68
+ case "toggleHeaderColumn":
69
+ editor.commands.toggleHeaderColumn();
70
+ break;
71
+ case "toggleHeaderCell":
72
+ editor.commands.toggleHeaderCell();
73
+ break;
74
+ default:
75
+ break;
76
+ }
77
+ };
78
+ const isInTable = () => {
79
+ const editor = props.editor && "value" in props.editor ? props.editor.value : props.editor;
80
+ return editor == null ? void 0 : editor.isActive("table");
81
+ };
82
+ return () => {
83
+ const trigger = _createVNode(Button, _mergeProps({
84
+ "type": "button",
85
+ "data-style": "ghost",
86
+ "data-active-state": isInTable() ? "on" : "off",
87
+ "role": "button",
88
+ "tooltip": "\u8868\u683C\u64CD\u4F5C",
89
+ "class": cn(props.className, "tiptap-table-dropdown-trigger")
90
+ }, attrs), {
91
+ default: () => [_createVNode(TableIcon, {
92
+ "class": "tiptap-button-icon"
93
+ }, null), _createVNode(ChevronDownIcon, {
94
+ "class": "tiptap-button-icon-chevron"
95
+ }, null)]
96
+ });
97
+ return _createVNode(ElDropdown, {
98
+ "trigger": "click",
99
+ "onCommand": handleCommand,
100
+ "popper-class": "tiptap-dropdown-menu"
101
+ }, {
102
+ default: () => trigger,
103
+ dropdown: () => _createVNode(ElDropdownMenu, null, {
104
+ default: () => [!isInTable() ? _createVNode(ElDropdownItem, {
105
+ "command": "insertTable"
106
+ }, {
107
+ default: () => [_createTextVNode("\u63D2\u5165\u8868\u683C")]
108
+ }) : _createVNode(_Fragment, null, [_createVNode(ElDropdownItem, {
109
+ "command": "addColumnBefore"
110
+ }, {
111
+ default: () => [_createTextVNode("\u5728\u524D\u65B9\u63D2\u5165\u5217")]
112
+ }), _createVNode(ElDropdownItem, {
113
+ "command": "addColumnAfter"
114
+ }, {
115
+ default: () => [_createTextVNode("\u5728\u540E\u65B9\u63D2\u5165\u5217")]
116
+ }), _createVNode(ElDropdownItem, {
117
+ "command": "deleteColumn"
118
+ }, {
119
+ default: () => [_createTextVNode("\u5220\u9664\u5F53\u524D\u5217")]
120
+ }), _createVNode(ElDropdownItem, {
121
+ "divided": true,
122
+ "command": "addRowBefore"
123
+ }, {
124
+ default: () => [_createTextVNode("\u5728\u4E0A\u65B9\u63D2\u5165\u884C")]
125
+ }), _createVNode(ElDropdownItem, {
126
+ "command": "addRowAfter"
127
+ }, {
128
+ default: () => [_createTextVNode("\u5728\u4E0B\u65B9\u63D2\u5165\u884C")]
129
+ }), _createVNode(ElDropdownItem, {
130
+ "command": "deleteRow"
131
+ }, {
132
+ default: () => [_createTextVNode("\u5220\u9664\u5F53\u524D\u884C")]
133
+ }), _createVNode(ElDropdownItem, {
134
+ "divided": true,
135
+ "command": "mergeCells"
136
+ }, {
137
+ default: () => [_createTextVNode("\u5408\u5E76\u5355\u5143\u683C")]
138
+ }), _createVNode(ElDropdownItem, {
139
+ "command": "splitCell"
140
+ }, {
141
+ default: () => [_createTextVNode("\u62C6\u5206\u5355\u5143\u683C")]
142
+ }), _createVNode(ElDropdownItem, {
143
+ "divided": true,
144
+ "command": "toggleHeaderRow"
145
+ }, {
146
+ default: () => [_createTextVNode("\u5207\u6362\u8868\u5934\u884C")]
147
+ }), _createVNode(ElDropdownItem, {
148
+ "command": "toggleHeaderColumn"
149
+ }, {
150
+ default: () => [_createTextVNode("\u5207\u6362\u8868\u5934\u5217")]
151
+ }), _createVNode(ElDropdownItem, {
152
+ "divided": true,
153
+ "command": "deleteTable",
154
+ "style": {
155
+ color: "var(--red)"
156
+ }
157
+ }, {
158
+ default: () => [_createTextVNode("\u5220\u9664\u8868\u683C")]
159
+ })])]
160
+ })
161
+ });
162
+ };
163
+ }
164
+ });
165
+ export {
166
+ TableDropdownMenu
167
+ };
@@ -544,3 +544,16 @@ export declare const DivideIcon: import("vue").DefineComponent<import("vue").Ext
544
544
  }>> & Readonly<{}>, {
545
545
  className: string;
546
546
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
547
+ export declare const TableIcon: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
548
+ className: {
549
+ type: StringConstructor;
550
+ default: string;
551
+ };
552
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
553
+ className: {
554
+ type: StringConstructor;
555
+ default: string;
556
+ };
557
+ }>> & Readonly<{}>, {
558
+ className: string;
559
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -441,6 +441,31 @@ const DivideIcon = createIcon("DivideIcon", _createVNode("path", {
441
441
  "stroke-width": "2",
442
442
  "stroke-linecap": "round"
443
443
  }, null));
444
+ const TableIcon = createIcon("TableIcon", _createVNode(_Fragment, null, [_createVNode("rect", {
445
+ "x": "3",
446
+ "y": "3",
447
+ "width": "18",
448
+ "height": "18",
449
+ "rx": "2",
450
+ "stroke": "currentColor",
451
+ "stroke-width": "2"
452
+ }, null), _createVNode("path", {
453
+ "d": "M3 9H21",
454
+ "stroke": "currentColor",
455
+ "stroke-width": "2"
456
+ }, null), _createVNode("path", {
457
+ "d": "M3 15H21",
458
+ "stroke": "currentColor",
459
+ "stroke-width": "2"
460
+ }, null), _createVNode("path", {
461
+ "d": "M9 3V21",
462
+ "stroke": "currentColor",
463
+ "stroke-width": "2"
464
+ }, null), _createVNode("path", {
465
+ "d": "M15 3V21",
466
+ "stroke": "currentColor",
467
+ "stroke-width": "2"
468
+ }, null)]));
444
469
  export {
445
470
  AlignCenterIcon,
446
471
  AlignJustifyIcon,
@@ -481,6 +506,7 @@ export {
481
506
  StrikeIcon,
482
507
  SubscriptIcon,
483
508
  SuperscriptIcon,
509
+ TableIcon,
484
510
  TrashIcon,
485
511
  UnderlineIcon,
486
512
  Undo2Icon