art-bd-ui 1.0.32 → 1.0.34
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/cjs/_virtual/index.js +7 -3
- package/dist/cjs/_virtual/index2.js +3 -7
- package/dist/cjs/_virtual/index3.js +8 -2
- package/dist/cjs/_virtual/index4.js +2 -8
- package/dist/cjs/_virtual/index5.js +2 -8
- package/dist/cjs/_virtual/index6.js +4 -4
- package/dist/cjs/_virtual/index7.js +8 -2
- package/dist/cjs/_virtual/index8.js +2 -8
- package/dist/cjs/_virtual/index9.js +8 -2
- package/dist/cjs/components/quiz/runner/question/question.js +1 -0
- package/dist/cjs/components/ui/rich-editor/extensions.js +1 -4
- package/dist/cjs/components/ui/rich-editor/rich-editor.js +15 -30
- package/dist/cjs/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +1 -1
- package/dist/cjs/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +1 -1
- package/dist/cjs/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +1 -1
- package/dist/cjs/node_modules/@pdf-lib/standard-fonts/es/utils.js +1 -1
- package/dist/cjs/node_modules/@pdf-lib/upng/UPNG.js +1 -1
- package/dist/cjs/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
- package/dist/cjs/node_modules/@tiptap/react/dist/index.js +1 -1
- package/dist/cjs/node_modules/attr-accept/dist/es/index.js +1 -1
- package/dist/cjs/node_modules/color-parse/index.js +1 -1
- package/dist/cjs/node_modules/pdf-lib/es/core/PDFContext.js +1 -1
- package/dist/cjs/node_modules/pdf-lib/es/core/structures/PDFFlateStream.js +1 -1
- package/dist/cjs/node_modules/prop-types/index.js +1 -1
- package/dist/cjs/node_modules/react-dropzone/dist/es/index.js +1 -1
- package/dist/cjs/node_modules/react-dropzone/dist/es/utils/index.js +1 -1
- package/dist/cjs/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/esm/_virtual/index.js +5 -3
- package/dist/esm/_virtual/index2.js +3 -5
- package/dist/esm/_virtual/index3.js +6 -2
- package/dist/esm/_virtual/index4.js +2 -6
- package/dist/esm/_virtual/index5.js +2 -6
- package/dist/esm/_virtual/index6.js +4 -4
- package/dist/esm/_virtual/index7.js +6 -2
- package/dist/esm/_virtual/index8.js +2 -6
- package/dist/esm/_virtual/index9.js +6 -2
- package/dist/esm/components/quiz/runner/question/question.js +1 -0
- package/dist/esm/components/ui/rich-editor/extensions.js +1 -4
- package/dist/esm/components/ui/rich-editor/rich-editor.js +16 -31
- package/dist/esm/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +1 -1
- package/dist/esm/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +1 -1
- package/dist/esm/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +1 -1
- package/dist/esm/node_modules/@pdf-lib/standard-fonts/es/utils.js +1 -1
- package/dist/esm/node_modules/@pdf-lib/upng/UPNG.js +1 -1
- package/dist/esm/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
- package/dist/esm/node_modules/@tiptap/react/dist/index.js +1 -1
- package/dist/esm/node_modules/attr-accept/dist/es/index.js +1 -1
- package/dist/esm/node_modules/color-parse/index.js +1 -1
- package/dist/esm/node_modules/pdf-lib/es/core/PDFContext.js +1 -1
- package/dist/esm/node_modules/pdf-lib/es/core/structures/PDFFlateStream.js +1 -1
- package/dist/esm/node_modules/prop-types/index.js +1 -1
- package/dist/esm/node_modules/react-dropzone/dist/es/index.js +1 -1
- package/dist/esm/node_modules/react-dropzone/dist/es/utils/index.js +1 -1
- package/dist/esm/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/types/index.d.ts +29 -30
- package/package.json +1 -1
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _commonjsHelpers = require('./_commonjsHelpers.js');
|
|
6
|
+
var index = require('../node_modules/prop-types/index.js');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
var propTypesExports = /*@__PURE__*/ index.__require();
|
|
9
|
+
var PropTypes = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(propTypesExports);
|
|
10
|
+
|
|
11
|
+
exports.default = PropTypes;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var index = require('../node_modules/use-sync-external-store/shim/index.js');
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var index = require('../node_modules/prop-types/index.js');
|
|
5
|
+
var shimExports = index.__require();
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
var PropTypes = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(propTypesExports);
|
|
10
|
-
|
|
11
|
-
exports.default = PropTypes;
|
|
7
|
+
exports.shimExports = shimExports;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
var _commonjsHelpers = require('./_commonjsHelpers.js');
|
|
6
|
+
var index = require('../node_modules/attr-accept/dist/es/index.js');
|
|
7
|
+
|
|
8
|
+
var esExports = index.__require();
|
|
9
|
+
var _accepts = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(esExports);
|
|
10
|
+
|
|
11
|
+
exports.default = _accepts;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var shim = {exports: {}};
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
var index = require('../node_modules/attr-accept/dist/es/index.js');
|
|
7
|
-
|
|
8
|
-
var esExports = index.__require();
|
|
9
|
-
var _accepts = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(esExports);
|
|
10
|
-
|
|
11
|
-
exports.default = _accepts;
|
|
5
|
+
exports.__module = shim;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var propTypes = {exports: {}};
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
var index = require('../node_modules/color-name/index.js');
|
|
7
|
-
|
|
8
|
-
var colorNameExports = index.__require();
|
|
9
|
-
var names = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(colorNameExports);
|
|
10
|
-
|
|
11
|
-
exports.default = names;
|
|
5
|
+
exports.__module = propTypes;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _commonjsHelpers = require('./_commonjsHelpers.js');
|
|
6
|
-
var index
|
|
6
|
+
var index = require('../node_modules/color-name/index.js');
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
var colorNameExports = index.__require();
|
|
9
|
+
var names = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(colorNameExports);
|
|
10
10
|
|
|
11
|
-
exports.default =
|
|
11
|
+
exports.default = names;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
var _commonjsHelpers = require('./_commonjsHelpers.js');
|
|
6
|
+
var index$1 = require('../node_modules/color-convert/index.js');
|
|
7
|
+
|
|
8
|
+
var colorConvertExports = index$1.__require();
|
|
9
|
+
var index = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(colorConvertExports);
|
|
10
|
+
|
|
11
|
+
exports.default = index;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var es = {};
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
var index = require('../node_modules/pako/index.js');
|
|
7
|
-
|
|
8
|
-
var pakoExports = index.__require();
|
|
9
|
-
var pako = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(pakoExports);
|
|
10
|
-
|
|
11
|
-
exports.default = pako;
|
|
5
|
+
exports.__exports = es;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
var _commonjsHelpers = require('./_commonjsHelpers.js');
|
|
6
|
+
var index = require('../node_modules/pako/index.js');
|
|
7
|
+
|
|
8
|
+
var pakoExports = index.__require();
|
|
9
|
+
var pako = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(pakoExports);
|
|
10
|
+
|
|
11
|
+
exports.default = pako;
|
|
@@ -13,6 +13,7 @@ require('../../../ui/rich-editor/extensions/carousel/extension.js');
|
|
|
13
13
|
require('../../../ui/rich-editor/extensions/carousel/editor.js');
|
|
14
14
|
require('../../../ui/carousel/carousel.js');
|
|
15
15
|
require('../../../forms/file-upload/file-upload.js');
|
|
16
|
+
require('../../../ui/rich-editor/extensions/code-block-lowlight.js');
|
|
16
17
|
require('../../../ui/rich-editor/extensions.js');
|
|
17
18
|
require('react-dom');
|
|
18
19
|
require('../../../../node_modules/prosemirror-tables/dist/index.js');
|
|
@@ -36,7 +36,6 @@ var horizontalRule = require('./extensions/horizontal-rule.js');
|
|
|
36
36
|
var details = require('./extensions/details.js');
|
|
37
37
|
var detailsSummary = require('./extensions/details-summary.js');
|
|
38
38
|
var detailsContent = require('./extensions/details-content.js');
|
|
39
|
-
var codeBlockLowlight = require('./extensions/code-block-lowlight.js');
|
|
40
39
|
var code = require('./extensions/code.js');
|
|
41
40
|
var subscript = require('./extensions/subscript.js');
|
|
42
41
|
var superscript = require('./extensions/superscript.js');
|
|
@@ -48,7 +47,6 @@ require('../carousel/carousel.js');
|
|
|
48
47
|
require('../../../node_modules/tslib/tslib.es6.js');
|
|
49
48
|
require('../../forms/file-upload/file-upload.js');
|
|
50
49
|
var columns = require('./extensions/columns.js');
|
|
51
|
-
var codeBlockLowlightBase = require('./extensions/code-block-lowlight-base.js');
|
|
52
50
|
|
|
53
51
|
/**
|
|
54
52
|
* Core content and formatting extensions used by both editor and renderer.
|
|
@@ -94,7 +92,7 @@ const CORE_EXTENSIONS = [
|
|
|
94
92
|
index$2.default,
|
|
95
93
|
extension.Carousel,
|
|
96
94
|
tableKit.TableKit,
|
|
97
|
-
|
|
95
|
+
// CodeBlockLowlightBase,
|
|
98
96
|
];
|
|
99
97
|
/**
|
|
100
98
|
* Default configurations for editor extensions.
|
|
@@ -169,7 +167,6 @@ const EDITOR_EXTENSIONS = [
|
|
|
169
167
|
tableActionsExtension.TableActionsExtension,
|
|
170
168
|
tableSelectionOverlay.TableSelectionOverlay,
|
|
171
169
|
tableHoverExtension.TableHoverExtension,
|
|
172
|
-
codeBlockLowlight.CodeBlockLowlight, // overrides CodeBlockLowlightBase from CORE_EXTENSIONS via unionBy
|
|
173
170
|
];
|
|
174
171
|
const configureExtension = (extension) => {
|
|
175
172
|
const { options } = extension;
|
|
@@ -11,6 +11,7 @@ require('./extensions/carousel/extension.js');
|
|
|
11
11
|
var editor = require('./extensions/carousel/editor.js');
|
|
12
12
|
require('../carousel/carousel.js');
|
|
13
13
|
require('../../forms/file-upload/file-upload.js');
|
|
14
|
+
var codeBlockLowlight = require('./extensions/code-block-lowlight.js');
|
|
14
15
|
var extensions = require('./extensions.js');
|
|
15
16
|
var tableFloatingControls = require('./extensions/table/table-floating-controls.js');
|
|
16
17
|
var toolbar = require('./toolbar.js');
|
|
@@ -24,22 +25,20 @@ const defaultOnFileUpload = (files) => tslib_es6.__awaiter(void 0, void 0, void
|
|
|
24
25
|
alt: file.name.replace(/\.[^/.]+$/, ""),
|
|
25
26
|
}));
|
|
26
27
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*/
|
|
34
|
-
function RichEditor({ value, outputFormat = "html", onChange, editable = true, placeholder = "Start typing…", maxChars, className, editorContentClassName, showToolbar = true, showBubbleMenu = true, showFooter = true, toolbarActions, onFileUpload = defaultOnFileUpload, }) {
|
|
35
|
-
const lastContent = React.useRef(value);
|
|
28
|
+
function RichEditor({ initialValue, outputFormat, onChange, editable = true, placeholder = "Start typing…", maxChars, className, editorContentClassName, showToolbar = true, showBubbleMenu = true, showFooter = true, toolbarActions, onFileUpload = defaultOnFileUpload, }) {
|
|
29
|
+
const format = outputFormat !== null && outputFormat !== void 0 ? outputFormat : "html";
|
|
30
|
+
const onChangeRef = React.useRef(onChange);
|
|
31
|
+
onChangeRef.current = onChange;
|
|
32
|
+
const onFileUploadRef = React.useRef(onFileUpload);
|
|
33
|
+
onFileUploadRef.current = onFileUpload;
|
|
36
34
|
const editor$1 = index.useEditor({
|
|
37
35
|
editable,
|
|
38
|
-
content:
|
|
36
|
+
content: initialValue || "",
|
|
39
37
|
extensions: extensions.getEditorExtensions([
|
|
38
|
+
codeBlockLowlight.CodeBlockLowlight,
|
|
40
39
|
index$1.default.configure({ placeholder }),
|
|
41
40
|
editor.CarouselEditor.configure({
|
|
42
|
-
onUploadFiles:
|
|
41
|
+
onUploadFiles: (files) => onFileUploadRef.current(files),
|
|
43
42
|
}),
|
|
44
43
|
index$2.default.configure({ limit: maxChars !== null && maxChars !== void 0 ? maxChars : 0 }),
|
|
45
44
|
]),
|
|
@@ -73,8 +72,9 @@ function RichEditor({ value, outputFormat = "html", onChange, editable = true, p
|
|
|
73
72
|
},
|
|
74
73
|
},
|
|
75
74
|
onUpdate: ({ editor }) => {
|
|
75
|
+
var _a;
|
|
76
76
|
let content;
|
|
77
|
-
switch (
|
|
77
|
+
switch (format) {
|
|
78
78
|
case "json":
|
|
79
79
|
content = editor.getJSON();
|
|
80
80
|
break;
|
|
@@ -86,29 +86,14 @@ function RichEditor({ value, outputFormat = "html", onChange, editable = true, p
|
|
|
86
86
|
content = editor.getHTML();
|
|
87
87
|
break;
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
const currentSerialized = typeof content === "object" ? JSON.stringify(content) : content;
|
|
91
|
-
const lastSerialized = typeof lastContent.current === "object" ? JSON.stringify(lastContent.current) : lastContent.current;
|
|
92
|
-
if (currentSerialized !== lastSerialized) {
|
|
93
|
-
lastContent.current = content;
|
|
94
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(content);
|
|
95
|
-
}
|
|
89
|
+
(_a = onChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onChangeRef, content);
|
|
96
90
|
},
|
|
97
91
|
immediatelyRender: false,
|
|
98
|
-
}, [editable, placeholder, maxChars,
|
|
99
|
-
React.useEffect(() => {
|
|
100
|
-
if (!editor$1)
|
|
101
|
-
return;
|
|
102
|
-
if (typeof value === "string" && value !== lastContent.current) {
|
|
103
|
-
// external update (e.g., form reset)
|
|
104
|
-
lastContent.current = value;
|
|
105
|
-
editor$1.commands.setContent(value);
|
|
106
|
-
}
|
|
107
|
-
}, [value, editor$1]);
|
|
92
|
+
}, [editable, placeholder, maxChars, outputFormat]);
|
|
108
93
|
if (!editor$1)
|
|
109
94
|
return null;
|
|
110
95
|
const isLimit = maxChars && editor$1.storage.characterCount.characters() >= (maxChars !== null && maxChars !== void 0 ? maxChars : 0);
|
|
111
|
-
return (jsxRuntime.jsx(tooltip.TooltipProvider, { children: jsxRuntime.jsxs("div", { className: "w-full rounded-2xl border bg-background shadow-sm " + (className !== null && className !== void 0 ? className : ""), children: [showToolbar && jsxRuntime.jsx(toolbar.Toolbar, { editor: editor$1, actions: toolbarActions, onFileUpload:
|
|
96
|
+
return (jsxRuntime.jsx(tooltip.TooltipProvider, { children: jsxRuntime.jsxs("div", { className: "w-full rounded-2xl border bg-background shadow-sm " + (className !== null && className !== void 0 ? className : ""), children: [showToolbar && (jsxRuntime.jsx(toolbar.Toolbar, { editor: editor$1, actions: toolbarActions, onFileUpload: (files) => onFileUploadRef.current(files) })), jsxRuntime.jsxs("div", { className: "relative px-4", children: [showBubbleMenu && jsxRuntime.jsx(floatingBubbleControls.FloatingBubbleControls, { editor: editor$1 }), jsxRuntime.jsx(index.EditorContent, { editor: editor$1, className: ["min-h-[220px] py-4", editorContentClassName].filter(Boolean).join(" ") }), jsxRuntime.jsx(tableFloatingControls.TableFloatingControls, { editor: editor$1 })] }), showFooter && jsxRuntime.jsx(Footer, { editor: editor$1, maxChars: maxChars, isLimit: !!isLimit })] }) }));
|
|
112
97
|
}
|
|
113
98
|
// ---------- Footer ----------
|
|
114
99
|
function Footer({ editor, maxChars, isLimit }) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
require('../../ckeditor5-core/dist/index.js');
|
|
4
4
|
var index = require('../../ckeditor5-utils/dist/index.js');
|
|
5
|
-
require('../../../../_virtual/index5.js');
|
|
6
5
|
require('../../../../_virtual/index6.js');
|
|
6
|
+
require('../../../../_virtual/index7.js');
|
|
7
7
|
require('../../ckeditor5-engine/dist/index.js');
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('../../ckeditor5-core/dist/index.js');
|
|
4
4
|
var index$1 = require('../../ckeditor5-utils/dist/index.js');
|
|
5
|
-
require('../../../../_virtual/index5.js');
|
|
6
5
|
require('../../../../_virtual/index6.js');
|
|
6
|
+
require('../../../../_virtual/index7.js');
|
|
7
7
|
require('../../ckeditor5-engine/dist/index.js');
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var index$1 = require('../../ckeditor5-utils/dist/index.js');
|
|
4
4
|
var index = require('../../ckeditor5-core/dist/index.js');
|
|
5
5
|
var index$3 = require('../../../color-parse/index.js');
|
|
6
|
-
var index$2 = require('../../../../_virtual/
|
|
6
|
+
var index$2 = require('../../../../_virtual/index7.js');
|
|
7
7
|
var hex = require('../../../vanilla-colorful/lib/entrypoints/hex.js');
|
|
8
8
|
require('../../ckeditor5-engine/dist/index.js');
|
|
9
9
|
var assignIn = require('../../../lodash-es/assignIn.js');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var ReactDOM = require('react-dom');
|
|
5
|
-
var index$1 = require('../../../../_virtual/
|
|
5
|
+
var index$1 = require('../../../../_virtual/index2.js');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var index = require('../../core/dist/index.js');
|
|
8
8
|
var react = require('../../../../_virtual/react.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var tslib_es6 = require('../../../tslib/tslib.es6.js');
|
|
6
|
-
var index = require('../../../../_virtual/
|
|
6
|
+
var index = require('../../../../_virtual/index9.js');
|
|
7
7
|
var PDFHeader = require('./document/PDFHeader.js');
|
|
8
8
|
var errors = require('./errors.js');
|
|
9
9
|
var PDFArray = require('./objects/PDFArray.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var tslib_es6 = require('../../../../tslib/tslib.es6.js');
|
|
6
|
-
var index = require('../../../../../_virtual/
|
|
6
|
+
var index = require('../../../../../_virtual/index9.js');
|
|
7
7
|
var errors = require('../errors.js');
|
|
8
8
|
var PDFName = require('../objects/PDFName.js');
|
|
9
9
|
var PDFStream = require('../objects/PDFStream.js');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index$1 = require('../../_virtual/
|
|
3
|
+
var index$1 = require('../../_virtual/index5.js');
|
|
4
4
|
var index = require('./node_modules/react-is/index.js');
|
|
5
5
|
var factoryWithTypeCheckers = require('./factoryWithTypeCheckers.js');
|
|
6
6
|
var factoryWithThrowingShims = require('./factoryWithThrowingShims.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var index$1 = require('../../../../_virtual/
|
|
6
|
+
var index$1 = require('../../../../_virtual/index.js');
|
|
7
7
|
var fileSelector = require('../../../file-selector/dist/es2015/file-selector.js');
|
|
8
8
|
var index = require('./utils/index.js');
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('../../../../../_virtual/
|
|
3
|
+
var index = require('../../../../../_virtual/index3.js');
|
|
4
4
|
|
|
5
5
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('../../../_virtual/
|
|
3
|
+
var index = require('../../../_virtual/index4.js');
|
|
4
4
|
var useSyncExternalStoreShim_production = require('../cjs/use-sync-external-store-shim.production.js');
|
|
5
5
|
var useSyncExternalStoreShim_development = require('../cjs/use-sync-external-store-shim.development.js');
|
|
6
6
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getDefaultExportFromCjs } from './_commonjsHelpers.js';
|
|
2
|
+
import { __require as requirePropTypes } from '../node_modules/prop-types/index.js';
|
|
2
3
|
|
|
3
|
-
var
|
|
4
|
+
var propTypesExports = /*@__PURE__*/ requirePropTypes();
|
|
5
|
+
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
4
6
|
|
|
5
|
-
export {
|
|
7
|
+
export { PropTypes as default };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { __require as requirePropTypes } from '../node_modules/prop-types/index.js';
|
|
1
|
+
import { __require as requireShim } from '../node_modules/use-sync-external-store/shim/index.js';
|
|
3
2
|
|
|
4
|
-
var
|
|
5
|
-
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
3
|
+
var shimExports = requireShim();
|
|
6
4
|
|
|
7
|
-
export {
|
|
5
|
+
export { shimExports as s };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { getDefaultExportFromCjs } from './_commonjsHelpers.js';
|
|
2
|
+
import { __require as requireEs } from '../node_modules/attr-accept/dist/es/index.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
var esExports = requireEs();
|
|
5
|
+
var _accepts = /*@__PURE__*/getDefaultExportFromCjs(esExports);
|
|
6
|
+
|
|
7
|
+
export { _accepts as default };
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { __require as requireEs } from '../node_modules/attr-accept/dist/es/index.js';
|
|
1
|
+
var shim = {exports: {}};
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
var _accepts = /*@__PURE__*/getDefaultExportFromCjs(esExports);
|
|
6
|
-
|
|
7
|
-
export { _accepts as default };
|
|
3
|
+
export { shim as __module };
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { __require as requireColorName } from '../node_modules/color-name/index.js';
|
|
1
|
+
var propTypes = {exports: {}};
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
var names = /*@__PURE__*/getDefaultExportFromCjs(colorNameExports);
|
|
6
|
-
|
|
7
|
-
export { names as default };
|
|
3
|
+
export { propTypes as __module };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs } from './_commonjsHelpers.js';
|
|
2
|
-
import { __require as
|
|
2
|
+
import { __require as requireColorName } from '../node_modules/color-name/index.js';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var colorNameExports = requireColorName();
|
|
5
|
+
var names = /*@__PURE__*/getDefaultExportFromCjs(colorNameExports);
|
|
6
6
|
|
|
7
|
-
export {
|
|
7
|
+
export { names as default };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { getDefaultExportFromCjs } from './_commonjsHelpers.js';
|
|
2
|
+
import { __require as requireColorConvert } from '../node_modules/color-convert/index.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
var colorConvertExports = requireColorConvert();
|
|
5
|
+
var index = /*@__PURE__*/getDefaultExportFromCjs(colorConvertExports);
|
|
6
|
+
|
|
7
|
+
export { index as default };
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { __require as requirePako } from '../node_modules/pako/index.js';
|
|
1
|
+
var es = {};
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
var pako = /*@__PURE__*/getDefaultExportFromCjs(pakoExports);
|
|
6
|
-
|
|
7
|
-
export { pako as default };
|
|
3
|
+
export { es as __exports };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { getDefaultExportFromCjs } from './_commonjsHelpers.js';
|
|
2
|
+
import { __require as requirePako } from '../node_modules/pako/index.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
var pakoExports = requirePako();
|
|
5
|
+
var pako = /*@__PURE__*/getDefaultExportFromCjs(pakoExports);
|
|
6
|
+
|
|
7
|
+
export { pako as default };
|
|
@@ -11,6 +11,7 @@ import '../../../ui/rich-editor/extensions/carousel/extension.js';
|
|
|
11
11
|
import '../../../ui/rich-editor/extensions/carousel/editor.js';
|
|
12
12
|
import '../../../ui/carousel/carousel.js';
|
|
13
13
|
import '../../../forms/file-upload/file-upload.js';
|
|
14
|
+
import '../../../ui/rich-editor/extensions/code-block-lowlight.js';
|
|
14
15
|
import '../../../ui/rich-editor/extensions.js';
|
|
15
16
|
import 'react-dom';
|
|
16
17
|
import '../../../../node_modules/prosemirror-tables/dist/index.js';
|
|
@@ -34,7 +34,6 @@ import { HorizontalRule } from './extensions/horizontal-rule.js';
|
|
|
34
34
|
import { Details } from './extensions/details.js';
|
|
35
35
|
import { DetailsSummary } from './extensions/details-summary.js';
|
|
36
36
|
import { DetailsContent } from './extensions/details-content.js';
|
|
37
|
-
import { CodeBlockLowlight } from './extensions/code-block-lowlight.js';
|
|
38
37
|
import { Code } from './extensions/code.js';
|
|
39
38
|
import { Subscript } from './extensions/subscript.js';
|
|
40
39
|
import { Superscript } from './extensions/superscript.js';
|
|
@@ -46,7 +45,6 @@ import '../carousel/carousel.js';
|
|
|
46
45
|
import '../../../node_modules/tslib/tslib.es6.js';
|
|
47
46
|
import '../../forms/file-upload/file-upload.js';
|
|
48
47
|
import { Columns, Column } from './extensions/columns.js';
|
|
49
|
-
import { CodeBlockLowlightBase } from './extensions/code-block-lowlight-base.js';
|
|
50
48
|
|
|
51
49
|
/**
|
|
52
50
|
* Core content and formatting extensions used by both editor and renderer.
|
|
@@ -92,7 +90,7 @@ const CORE_EXTENSIONS = [
|
|
|
92
90
|
index_default$2,
|
|
93
91
|
Carousel,
|
|
94
92
|
TableKit,
|
|
95
|
-
CodeBlockLowlightBase,
|
|
93
|
+
// CodeBlockLowlightBase,
|
|
96
94
|
];
|
|
97
95
|
/**
|
|
98
96
|
* Default configurations for editor extensions.
|
|
@@ -167,7 +165,6 @@ const EDITOR_EXTENSIONS = [
|
|
|
167
165
|
TableActionsExtension,
|
|
168
166
|
TableSelectionOverlay,
|
|
169
167
|
TableHoverExtension,
|
|
170
|
-
CodeBlockLowlight, // overrides CodeBlockLowlightBase from CORE_EXTENSIONS via unionBy
|
|
171
168
|
];
|
|
172
169
|
const configureExtension = (extension) => {
|
|
173
170
|
const { options } = extension;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { __awaiter } from '../../../node_modules/tslib/tslib.es6.js';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
-
import { useRef
|
|
4
|
+
import { useRef } from 'react';
|
|
5
5
|
import { useEditor, EditorContent } from '../../../node_modules/@tiptap/react/dist/index.js';
|
|
6
6
|
import index_default from '../../../node_modules/@tiptap/extension-placeholder/dist/index.js';
|
|
7
7
|
import index_default$1 from '../../../node_modules/@tiptap/extension-character-count/dist/index.js';
|
|
@@ -9,6 +9,7 @@ import './extensions/carousel/extension.js';
|
|
|
9
9
|
import { CarouselEditor } from './extensions/carousel/editor.js';
|
|
10
10
|
import '../carousel/carousel.js';
|
|
11
11
|
import '../../forms/file-upload/file-upload.js';
|
|
12
|
+
import { CodeBlockLowlight } from './extensions/code-block-lowlight.js';
|
|
12
13
|
import { getEditorExtensions } from './extensions.js';
|
|
13
14
|
import { TableFloatingControls } from './extensions/table/table-floating-controls.js';
|
|
14
15
|
import { Toolbar } from './toolbar.js';
|
|
@@ -22,22 +23,20 @@ const defaultOnFileUpload = (files) => __awaiter(void 0, void 0, void 0, functio
|
|
|
22
23
|
alt: file.name.replace(/\.[^/.]+$/, ""),
|
|
23
24
|
}));
|
|
24
25
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*/
|
|
32
|
-
function RichEditor({ value, outputFormat = "html", onChange, editable = true, placeholder = "Start typing…", maxChars, className, editorContentClassName, showToolbar = true, showBubbleMenu = true, showFooter = true, toolbarActions, onFileUpload = defaultOnFileUpload, }) {
|
|
33
|
-
const lastContent = useRef(value);
|
|
26
|
+
function RichEditor({ initialValue, outputFormat, onChange, editable = true, placeholder = "Start typing…", maxChars, className, editorContentClassName, showToolbar = true, showBubbleMenu = true, showFooter = true, toolbarActions, onFileUpload = defaultOnFileUpload, }) {
|
|
27
|
+
const format = outputFormat !== null && outputFormat !== void 0 ? outputFormat : "html";
|
|
28
|
+
const onChangeRef = useRef(onChange);
|
|
29
|
+
onChangeRef.current = onChange;
|
|
30
|
+
const onFileUploadRef = useRef(onFileUpload);
|
|
31
|
+
onFileUploadRef.current = onFileUpload;
|
|
34
32
|
const editor = useEditor({
|
|
35
33
|
editable,
|
|
36
|
-
content:
|
|
34
|
+
content: initialValue || "",
|
|
37
35
|
extensions: getEditorExtensions([
|
|
36
|
+
CodeBlockLowlight,
|
|
38
37
|
index_default.configure({ placeholder }),
|
|
39
38
|
CarouselEditor.configure({
|
|
40
|
-
onUploadFiles:
|
|
39
|
+
onUploadFiles: (files) => onFileUploadRef.current(files),
|
|
41
40
|
}),
|
|
42
41
|
index_default$1.configure({ limit: maxChars !== null && maxChars !== void 0 ? maxChars : 0 }),
|
|
43
42
|
]),
|
|
@@ -71,8 +70,9 @@ function RichEditor({ value, outputFormat = "html", onChange, editable = true, p
|
|
|
71
70
|
},
|
|
72
71
|
},
|
|
73
72
|
onUpdate: ({ editor }) => {
|
|
73
|
+
var _a;
|
|
74
74
|
let content;
|
|
75
|
-
switch (
|
|
75
|
+
switch (format) {
|
|
76
76
|
case "json":
|
|
77
77
|
content = editor.getJSON();
|
|
78
78
|
break;
|
|
@@ -84,29 +84,14 @@ function RichEditor({ value, outputFormat = "html", onChange, editable = true, p
|
|
|
84
84
|
content = editor.getHTML();
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
const currentSerialized = typeof content === "object" ? JSON.stringify(content) : content;
|
|
89
|
-
const lastSerialized = typeof lastContent.current === "object" ? JSON.stringify(lastContent.current) : lastContent.current;
|
|
90
|
-
if (currentSerialized !== lastSerialized) {
|
|
91
|
-
lastContent.current = content;
|
|
92
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(content);
|
|
93
|
-
}
|
|
87
|
+
(_a = onChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onChangeRef, content);
|
|
94
88
|
},
|
|
95
89
|
immediatelyRender: false,
|
|
96
|
-
}, [editable, placeholder, maxChars,
|
|
97
|
-
useEffect(() => {
|
|
98
|
-
if (!editor)
|
|
99
|
-
return;
|
|
100
|
-
if (typeof value === "string" && value !== lastContent.current) {
|
|
101
|
-
// external update (e.g., form reset)
|
|
102
|
-
lastContent.current = value;
|
|
103
|
-
editor.commands.setContent(value);
|
|
104
|
-
}
|
|
105
|
-
}, [value, editor]);
|
|
90
|
+
}, [editable, placeholder, maxChars, outputFormat]);
|
|
106
91
|
if (!editor)
|
|
107
92
|
return null;
|
|
108
93
|
const isLimit = maxChars && editor.storage.characterCount.characters() >= (maxChars !== null && maxChars !== void 0 ? maxChars : 0);
|
|
109
|
-
return (jsx(TooltipProvider, { children: jsxs("div", { className: "w-full rounded-2xl border bg-background shadow-sm " + (className !== null && className !== void 0 ? className : ""), children: [showToolbar && jsx(Toolbar, { editor: editor, actions: toolbarActions, onFileUpload:
|
|
94
|
+
return (jsx(TooltipProvider, { children: jsxs("div", { className: "w-full rounded-2xl border bg-background shadow-sm " + (className !== null && className !== void 0 ? className : ""), children: [showToolbar && (jsx(Toolbar, { editor: editor, actions: toolbarActions, onFileUpload: (files) => onFileUploadRef.current(files) })), jsxs("div", { className: "relative px-4", children: [showBubbleMenu && jsx(FloatingBubbleControls, { editor: editor }), jsx(EditorContent, { editor: editor, className: ["min-h-[220px] py-4", editorContentClassName].filter(Boolean).join(" ") }), jsx(TableFloatingControls, { editor: editor })] }), showFooter && jsx(Footer, { editor: editor, maxChars: maxChars, isLimit: !!isLimit })] }) }));
|
|
110
95
|
}
|
|
111
96
|
// ---------- Footer ----------
|
|
112
97
|
function Footer({ editor, maxChars, isLimit }) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../../ckeditor5-core/dist/index.js';
|
|
2
2
|
import { keyCodes } from '../../ckeditor5-utils/dist/index.js';
|
|
3
|
-
import '../../../../_virtual/index5.js';
|
|
4
3
|
import '../../../../_virtual/index6.js';
|
|
4
|
+
import '../../../../_virtual/index7.js';
|
|
5
5
|
import '../../ckeditor5-engine/dist/index.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin, Command } from '../../ckeditor5-core/dist/index.js';
|
|
2
2
|
import { first } from '../../ckeditor5-utils/dist/index.js';
|
|
3
|
-
import '../../../../_virtual/index5.js';
|
|
4
3
|
import '../../../../_virtual/index6.js';
|
|
4
|
+
import '../../../../_virtual/index7.js';
|
|
5
5
|
import '../../ckeditor5-engine/dist/index.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getEnvKeystrokeText, uid, env, delay, createElement, KeystrokeHandler, FocusTracker, toUnit, global, Rect, DomEmitterMixin, ObservableMixin, Collection, isIterable, CKEditorError, getOptimalPosition, logWarning, isVisible, EmitterMixin, isNode, priorities, isText, ResizeObserver, first, verifyLicense, isRange, toArray } from '../../ckeditor5-utils/dist/index.js';
|
|
2
2
|
import { Plugin, icons, ContextPlugin } from '../../ckeditor5-core/dist/index.js';
|
|
3
3
|
import parse from '../../../color-parse/index.js';
|
|
4
|
-
import * as index from '../../../../_virtual/
|
|
4
|
+
import * as index from '../../../../_virtual/index7.js';
|
|
5
5
|
import { HexBase } from '../../../vanilla-colorful/lib/entrypoints/hex.js';
|
|
6
6
|
import '../../ckeditor5-engine/dist/index.js';
|
|
7
7
|
import assignIn from '../../../lodash-es/assignIn.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { createRef, memo, createContext, createElement, version, useContext, useRef, useState, useDebugValue, useEffect, forwardRef, useLayoutEffect } from 'react';
|
|
2
2
|
import ReactDOM__default, { flushSync } from 'react-dom';
|
|
3
|
-
import { s as shimExports } from '../../../../_virtual/
|
|
3
|
+
import { s as shimExports } from '../../../../_virtual/index2.js';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { NodeView, getRenderedAttributes, Editor } from '../../core/dist/index.js';
|
|
6
6
|
export { CommandManager, Extendable, Extension, InputRule, MappablePosition, Mark, Node, NodePos, PasteRule, ResizableNodeView, callOrReturn, canInsertNode, combineTransactionSteps, commands, createAtomBlockMarkdownSpec, createBlockMarkdownSpec, createChainableState, createDocument, createInlineMarkdownSpec, createMappablePosition, createNodeFromContent, createStyleTag, defaultBlockAt, deleteProps, elementFromString, extensions, findChildren, findChildrenInRange, findDuplicates, findParentNode, findParentNodeClosestToPos, flattenExtensions, fromString, getAttributes, getAttributesFromExtensions, getChangedRanges, getExtensionField, getHTMLFromFragment, getMarkAttributes, getMarkRange, getMarkType, getMarksBetween, getNodeAtPosition, getNodeAttributes, getNodeType, getSchema, getSchemaByResolvedExtensions, getSchemaTypeByName, getSchemaTypeNameByName, getSplittedAttributes, getText, getTextBetween, getTextContentFromNodes, getTextSerializersFromSchema, getUpdatedPosition, injectExtensionAttributesToParseRule, inputRulesPlugin, isActive, isAndroid, isAtEndOfNode, isAtStartOfNode, isEmptyObject, isExtensionRulesEnabled, isFunction, isList, isMacOS, isMarkActive, isNodeActive, isNodeEmpty, isNodeSelection, isNumber, isPlainObject, isRegExp, isSafari, isTextSelection, isiOS, markInputRule, markPasteRule, markdown, mergeAttributes, mergeDeep, minMax, nodeInputRule, nodePasteRule, objectIncludes, parseAttributes, parseIndentedBlocks, pasteRulesPlugin, posToDOMRect, removeDuplicates, renderNestedMarkdownContent, resolveExtensions, resolveFocusPosition, selectionToInsertionEnd, serializeAttributes, sortExtensions, splitExtensions, textblockTypeInputRule, updateMarkViewAttributes, wrappingInputRule } from '../../core/dist/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __assign } from '../../../tslib/tslib.es6.js';
|
|
2
|
-
import pako from '../../../../_virtual/
|
|
2
|
+
import pako from '../../../../_virtual/index9.js';
|
|
3
3
|
import PDFHeader from './document/PDFHeader.js';
|
|
4
4
|
import { UnexpectedObjectTypeError } from './errors.js';
|
|
5
5
|
import PDFArray from './objects/PDFArray.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __extends } from '../../../../tslib/tslib.es6.js';
|
|
2
|
-
import pako from '../../../../../_virtual/
|
|
2
|
+
import pako from '../../../../../_virtual/index9.js';
|
|
3
3
|
import { MethodNotImplementedError } from '../errors.js';
|
|
4
4
|
import PDFName from '../objects/PDFName.js';
|
|
5
5
|
import PDFStream from '../objects/PDFStream.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as propTypes } from '../../_virtual/
|
|
1
|
+
import { __module as propTypes } from '../../_virtual/index5.js';
|
|
2
2
|
import { __require as requireReactIs } from './node_modules/react-is/index.js';
|
|
3
3
|
import { __require as requireFactoryWithTypeCheckers } from './factoryWithTypeCheckers.js';
|
|
4
4
|
import { __require as requireFactoryWithThrowingShims } from './factoryWithThrowingShims.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default, { useMemo, useRef, useReducer, useEffect, useCallback, forwardRef, useImperativeHandle, Fragment } from 'react';
|
|
2
|
-
import PropTypes from '../../../../_virtual/
|
|
2
|
+
import PropTypes from '../../../../_virtual/index.js';
|
|
3
3
|
import { fromEvent } from '../../../file-selector/dist/es2015/file-selector.js';
|
|
4
4
|
import { acceptPropAsAcceptAttr, pickerOptionsFromAccept, canUseFileSystemAccessAPI, onDocumentDragOver, isEvtWithFiles, isPropagationStopped, allFilesAccepted, fileAccepted, fileMatchSize, TOO_MANY_FILES_REJECTION, isAbort, isSecurityError, isIeOrEdge, composeEventHandlers } from './utils/index.js';
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _accepts from '../../../../../_virtual/
|
|
1
|
+
import _accepts from '../../../../../_virtual/index3.js';
|
|
2
2
|
|
|
3
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as shim } from '../../../_virtual/
|
|
1
|
+
import { __module as shim } from '../../../_virtual/index4.js';
|
|
2
2
|
import { __require as requireUseSyncExternalStoreShim_production } from '../cjs/use-sync-external-store-shim.production.js';
|
|
3
3
|
import { __require as requireUseSyncExternalStoreShim_development } from '../cjs/use-sync-external-store-shim.development.js';
|
|
4
4
|
|
package/dist/types/index.d.ts
CHANGED
|
@@ -182,7 +182,7 @@ type SeparatorProps = ComponentProps<typeof Root>;
|
|
|
182
182
|
declare const Separator: FC<SeparatorProps>;
|
|
183
183
|
|
|
184
184
|
declare const buttonGroupVariants: (props?: ({
|
|
185
|
-
orientation?: "
|
|
185
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
186
186
|
groupGap?: "default" | "none" | null | undefined;
|
|
187
187
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
188
188
|
declare function ButtonGroup({ className, orientation, groupGap, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): react_jsx_runtime.JSX.Element;
|
|
@@ -312,7 +312,7 @@ declare function FieldLegend({ className, variant, ...props }: React.ComponentPr
|
|
|
312
312
|
}): react_jsx_runtime.JSX.Element;
|
|
313
313
|
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
314
314
|
declare const fieldVariants: (props?: ({
|
|
315
|
-
orientation?: "
|
|
315
|
+
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
316
316
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
317
317
|
declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): react_jsx_runtime.JSX.Element;
|
|
318
318
|
declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
@@ -611,7 +611,7 @@ declare const SheetTrigger: FC<SheetTriggerProps>;
|
|
|
611
611
|
type SheetCloseProps = ComponentProps<typeof Close>;
|
|
612
612
|
declare const SheetClose: FC<SheetCloseProps>;
|
|
613
613
|
declare const contentVariants: (props?: ({
|
|
614
|
-
side?: "
|
|
614
|
+
side?: "top" | "right" | "bottom" | "left" | null | undefined;
|
|
615
615
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
616
616
|
type SheetContentProps = ComponentProps<typeof Content$2> & VariantProps<typeof contentVariants>;
|
|
617
617
|
declare const SheetContent: FC<SheetContentProps>;
|
|
@@ -638,9 +638,9 @@ declare const ToastDescription: React$1.ForwardRefExoticComponent<Omit<_radix_ui
|
|
|
638
638
|
type ToastActionElement = ReactElement<typeof ToastAction>;
|
|
639
639
|
|
|
640
640
|
declare const textVariants: (props?: ({
|
|
641
|
-
size?:
|
|
642
|
-
weight?: "bold" | "light" | "
|
|
643
|
-
align?: "center" | "
|
|
641
|
+
size?: 2 | 1 | 3 | 4 | 8 | 9 | 7 | 6 | 5 | null | undefined;
|
|
642
|
+
weight?: "bold" | "light" | "regular" | "medium" | null | undefined;
|
|
643
|
+
align?: "center" | "right" | "left" | null | undefined;
|
|
644
644
|
color?: "default" | "destructive" | "secondary" | "muted" | "primary" | "accent" | null | undefined;
|
|
645
645
|
truncate?: boolean | null | undefined;
|
|
646
646
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
@@ -650,9 +650,9 @@ type TextProps = {
|
|
|
650
650
|
declare const Text: React$1.ForwardRefExoticComponent<{
|
|
651
651
|
asChild?: boolean;
|
|
652
652
|
} & Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & VariantProps<(props?: ({
|
|
653
|
-
size?:
|
|
654
|
-
weight?: "bold" | "light" | "
|
|
655
|
-
align?: "center" | "
|
|
653
|
+
size?: 2 | 1 | 3 | 4 | 8 | 9 | 7 | 6 | 5 | null | undefined;
|
|
654
|
+
weight?: "bold" | "light" | "regular" | "medium" | null | undefined;
|
|
655
|
+
align?: "center" | "right" | "left" | null | undefined;
|
|
656
656
|
color?: "default" | "destructive" | "secondary" | "muted" | "primary" | "accent" | null | undefined;
|
|
657
657
|
truncate?: boolean | null | undefined;
|
|
658
658
|
} & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
@@ -662,9 +662,9 @@ declare const Heading: React$1.ForwardRefExoticComponent<{
|
|
|
662
662
|
level?: HeadingLevel;
|
|
663
663
|
asChild?: boolean;
|
|
664
664
|
} & Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & VariantProps<(props?: ({
|
|
665
|
-
size?:
|
|
666
|
-
weight?: "bold" | "light" | "
|
|
667
|
-
align?: "center" | "
|
|
665
|
+
size?: 2 | 1 | 3 | 4 | 8 | 9 | 7 | 6 | 5 | null | undefined;
|
|
666
|
+
weight?: "bold" | "light" | "regular" | "medium" | null | undefined;
|
|
667
|
+
align?: "center" | "right" | "left" | null | undefined;
|
|
668
668
|
color?: "default" | "destructive" | "secondary" | "muted" | "primary" | "accent" | null | undefined;
|
|
669
669
|
truncate?: boolean | null | undefined;
|
|
670
670
|
} & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -736,7 +736,7 @@ type CarouselProps = {
|
|
|
736
736
|
declare const Carousel: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & CarouselProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
737
737
|
declare const CarouselContent: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
738
738
|
layout?: "single" | "peek" | "multi" | null | undefined;
|
|
739
|
-
orientation?: "
|
|
739
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
740
740
|
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
741
741
|
itemsPerView?: number;
|
|
742
742
|
peekAmount?: string;
|
|
@@ -1169,7 +1169,7 @@ declare const ContextMenuShortcut: {
|
|
|
1169
1169
|
};
|
|
1170
1170
|
|
|
1171
1171
|
declare const dataListVariants: (props?: ({
|
|
1172
|
-
orientation?: "
|
|
1172
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
1173
1173
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
1174
1174
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1175
1175
|
interface DataListProps extends ComponentPropsWithoutRef<"dl">, VariantProps<typeof dataListVariants> {
|
|
@@ -1188,8 +1188,8 @@ interface DataListValueProps extends ComponentPropsWithoutRef<"dd">, Pick<TextPr
|
|
|
1188
1188
|
declare const DataListValue: FC<DataListValueProps>;
|
|
1189
1189
|
|
|
1190
1190
|
declare const cellVariants$1: (props?: ({
|
|
1191
|
-
align?: "center" | "
|
|
1192
|
-
sticky?: "
|
|
1191
|
+
align?: "center" | "right" | "left" | null | undefined;
|
|
1192
|
+
sticky?: "right" | "left" | null | undefined;
|
|
1193
1193
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1194
1194
|
type TableCellProps = ComponentProps<"td"> & VariantProps<typeof cellVariants$1>;
|
|
1195
1195
|
declare const TableCell: FC<TableCellProps>;
|
|
@@ -1201,8 +1201,8 @@ type TableRowProps = ComponentProps<"tr"> & VariantProps<typeof rowVariants>;
|
|
|
1201
1201
|
declare const TableRow: FC<TableRowProps>;
|
|
1202
1202
|
|
|
1203
1203
|
declare const cellVariants: (props?: ({
|
|
1204
|
-
align?: "center" | "
|
|
1205
|
-
sticky?: "
|
|
1204
|
+
align?: "center" | "right" | "left" | null | undefined;
|
|
1205
|
+
sticky?: "right" | "left" | null | undefined;
|
|
1206
1206
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1207
1207
|
type TableHeadProps = ComponentProps<"th"> & VariantProps<typeof cellVariants>;
|
|
1208
1208
|
declare const TableHead: FC<TableHeadProps>;
|
|
@@ -1737,16 +1737,22 @@ declare module "@tiptap/core" {
|
|
|
1737
1737
|
type ToolbarAction = "history" | "heading" | "fontFamily" | "fontSize" | "lineHeight" | "bold" | "italic" | "underline" | "strike" | "subscript" | "superscript" | "code" | "link" | "codeBlock" | "textColor" | "backgroundColor" | "highlight" | "clearFormatting" | "indent" | "alignment" | "bulletList" | "orderedList" | "blockquote" | "table" | "insert";
|
|
1738
1738
|
|
|
1739
1739
|
type OutputFormat = "html" | "json" | "text";
|
|
1740
|
-
type
|
|
1741
|
-
|
|
1740
|
+
type OutputFormatContentMap = {
|
|
1741
|
+
html: string;
|
|
1742
|
+
json: JSONContent;
|
|
1743
|
+
text: string;
|
|
1744
|
+
};
|
|
1745
|
+
type RichEditorProps<F extends OutputFormat = "html"> = {
|
|
1746
|
+
/** Initial content. Accepts an HTML string or a Tiptap JSONContent object. */
|
|
1747
|
+
initialValue?: string | JSONContent;
|
|
1742
1748
|
/** Output format for the editor content. Defaults to 'html' */
|
|
1743
|
-
outputFormat?:
|
|
1749
|
+
outputFormat?: F;
|
|
1744
1750
|
/** Called when content changes. The type depends on outputFormat:
|
|
1745
1751
|
* - 'html': string (HTML)
|
|
1746
1752
|
* - 'json': JSONContent (Tiptap JSON)
|
|
1747
1753
|
* - 'text': string (plain text)
|
|
1748
1754
|
*/
|
|
1749
|
-
onChange?: (content:
|
|
1755
|
+
onChange?: (content: OutputFormatContentMap[F]) => void;
|
|
1750
1756
|
editable?: boolean;
|
|
1751
1757
|
placeholder?: string;
|
|
1752
1758
|
maxChars?: number;
|
|
@@ -1760,14 +1766,7 @@ type RichEditorProps = {
|
|
|
1760
1766
|
/** Generic file upload handler. Receives selected files and should return uploaded image data. */
|
|
1761
1767
|
onFileUpload?: (files: File[]) => Promise<UploadedImage[]>;
|
|
1762
1768
|
};
|
|
1763
|
-
|
|
1764
|
-
* Drop-in rich editor built with Tiptap + shadcn/ui.
|
|
1765
|
-
* - Configurable toolbar (Headings, lists, quote, code, link, image, align, marks)
|
|
1766
|
-
* - BubbleMenu on text select
|
|
1767
|
-
* - CodeBlock w/ Lowlight highlighting
|
|
1768
|
-
* - Character counter & max length (optional)
|
|
1769
|
-
*/
|
|
1770
|
-
declare function RichEditor({ value, outputFormat, onChange, editable, placeholder, maxChars, className, editorContentClassName, showToolbar, showBubbleMenu, showFooter, toolbarActions, onFileUpload, }: RichEditorProps): react_jsx_runtime.JSX.Element | null;
|
|
1769
|
+
declare function RichEditor<F extends OutputFormat = "html">({ initialValue, outputFormat, onChange, editable, placeholder, maxChars, className, editorContentClassName, showToolbar, showBubbleMenu, showFooter, toolbarActions, onFileUpload, }: RichEditorProps<F>): react_jsx_runtime.JSX.Element | null;
|
|
1771
1770
|
|
|
1772
1771
|
type RichContentRendererProps = {
|
|
1773
1772
|
doc?: JSONContent;
|