@ctzhian/tiptap 1.3.0 → 1.3.1
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.
|
@@ -6,7 +6,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { Box, Divider, Stack } from '@mui/material';
|
|
8
8
|
import React, { useEffect, useState } from 'react';
|
|
9
|
-
import { ArrowGoBackLineIcon, ArrowGoForwardLineIcon, BoldIcon, DoubleQuotesLIcon, Information2LineIcon, ItalicIcon, LinkIcon, MenuFold2FillIcon, StrikethroughIcon, Table2Icon, UnderlineIcon } from "../component/Icons";
|
|
9
|
+
import { ArrowGoBackLineIcon, ArrowGoForwardLineIcon, BoldIcon, DoubleQuotesLIcon, Information2LineIcon, ItalicIcon, LinkIcon, MenuFold2FillIcon, StrikethroughIcon, Table2Icon, UnderlineIcon, WindowFillIcon } from "../component/Icons";
|
|
10
10
|
import { EditorAlignSelect, EditorCode, EditorFontBgColor, EditorFontColor, EditorFontSize, EditorHeading, EditorInsert, EditorListSelect, EditorMath, EditorMore, EditorScript, EditorVerticalAlignSelect, ToolbarItem } from "../component/Toolbar";
|
|
11
11
|
var EditorToolbar = function EditorToolbar(_ref) {
|
|
12
12
|
var editor = _ref.editor,
|
|
@@ -24,7 +24,8 @@ var EditorToolbar = function EditorToolbar(_ref) {
|
|
|
24
24
|
details: false,
|
|
25
25
|
table: false,
|
|
26
26
|
link: false,
|
|
27
|
-
alert: false
|
|
27
|
+
alert: false,
|
|
28
|
+
iframe: false
|
|
28
29
|
}),
|
|
29
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
30
31
|
active = _useState2[0],
|
|
@@ -43,7 +44,8 @@ var EditorToolbar = function EditorToolbar(_ref) {
|
|
|
43
44
|
details: editor.isActive('details'),
|
|
44
45
|
table: editor.isActive('table'),
|
|
45
46
|
link: editor.isActive('link'),
|
|
46
|
-
alert: editor.isActive('alert')
|
|
47
|
+
alert: editor.isActive('alert'),
|
|
48
|
+
iframe: editor.isActive('iframe')
|
|
47
49
|
});
|
|
48
50
|
};
|
|
49
51
|
useEffect(function () {
|
|
@@ -285,6 +287,21 @@ var EditorToolbar = function EditorToolbar(_ref) {
|
|
|
285
287
|
});
|
|
286
288
|
},
|
|
287
289
|
className: active.table ? 'tool-active' : ''
|
|
290
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
291
|
+
tip: 'iframe',
|
|
292
|
+
icon: /*#__PURE__*/React.createElement(WindowFillIcon, {
|
|
293
|
+
sx: {
|
|
294
|
+
fontSize: '1rem'
|
|
295
|
+
}
|
|
296
|
+
}),
|
|
297
|
+
onClick: function onClick() {
|
|
298
|
+
return editor.commands.setIframe({
|
|
299
|
+
src: '',
|
|
300
|
+
width: 760,
|
|
301
|
+
height: 400
|
|
302
|
+
});
|
|
303
|
+
},
|
|
304
|
+
className: active.iframe ? 'tool-active' : ''
|
|
288
305
|
}), /*#__PURE__*/React.createElement(Divider, {
|
|
289
306
|
orientation: "vertical",
|
|
290
307
|
flexItem: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UploadFunction } from "../../type";
|
|
2
2
|
export declare const FileHandlerExtension: (props: {
|
|
3
3
|
onUpload?: UploadFunction;
|
|
4
|
-
}) => import("@tiptap/core").Extension<Omit<import("@tiptap/extension-file-handler").FileHandlePluginOptions, "
|
|
4
|
+
}) => import("@tiptap/core").Extension<Omit<import("@tiptap/extension-file-handler").FileHandlePluginOptions, "editor" | "key">, any>;
|