art-bd-ui 1.0.31 → 1.0.32
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 +3 -7
- package/dist/cjs/_virtual/index2.js +7 -3
- package/dist/cjs/_virtual/index3.js +2 -8
- package/dist/cjs/_virtual/index4.js +8 -2
- package/dist/cjs/_virtual/index8.js +8 -2
- package/dist/cjs/_virtual/index9.js +2 -8
- package/dist/cjs/components/ui/rich-editor/extensions/code-block-lowlight-base.js +108 -0
- package/dist/cjs/components/ui/rich-editor/extensions/code-block-lowlight.js +18 -108
- package/dist/cjs/components/ui/rich-editor/extensions.js +3 -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/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/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 +3 -5
- package/dist/esm/_virtual/index2.js +5 -3
- package/dist/esm/_virtual/index3.js +2 -6
- package/dist/esm/_virtual/index4.js +6 -2
- package/dist/esm/_virtual/index8.js +6 -2
- package/dist/esm/_virtual/index9.js +2 -6
- package/dist/esm/components/ui/rich-editor/extensions/code-block-lowlight-base.js +106 -0
- package/dist/esm/components/ui/rich-editor/extensions/code-block-lowlight.js +6 -107
- package/dist/esm/components/ui/rich-editor/extensions.js +3 -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/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/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 +11 -11
- package/package.json +1 -1
|
@@ -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,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,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,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,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;
|
|
@@ -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;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('../../../../node_modules/tslib/tslib.es6.js');
|
|
4
|
+
var index = require('../../../../node_modules/@tiptap/extension-code-block-lowlight/dist/index.js');
|
|
5
|
+
var index$1 = require('../../../../node_modules/prosemirror-state/dist/index.js');
|
|
6
|
+
var codeBlockUtils = require('./code-block-utils.js');
|
|
7
|
+
|
|
8
|
+
const CodeBlockLowlightBase = index.default.extend({
|
|
9
|
+
addAttributes() {
|
|
10
|
+
var _a;
|
|
11
|
+
return Object.assign(Object.assign({}, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)), { theme: {
|
|
12
|
+
default: codeBlockUtils.DEFAULT_CODE_BLOCK_THEME,
|
|
13
|
+
parseHTML: (element) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const rawTheme = (_a = element === null || element === void 0 ? void 0 : element.getAttribute) === null || _a === void 0 ? void 0 : _a.call(element, "data-theme");
|
|
16
|
+
return codeBlockUtils.resolveCodeBlockTheme(rawTheme);
|
|
17
|
+
},
|
|
18
|
+
renderHTML: (attributes) => {
|
|
19
|
+
const theme = codeBlockUtils.resolveCodeBlockTheme(attributes.theme);
|
|
20
|
+
return {
|
|
21
|
+
"data-theme": theme,
|
|
22
|
+
class: codeBlockUtils.codeBlockThemeClassName(theme),
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
} });
|
|
26
|
+
},
|
|
27
|
+
addCommands() {
|
|
28
|
+
var _a;
|
|
29
|
+
return Object.assign(Object.assign({}, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)), { formatCodeBlock: () => ({ state }) => {
|
|
30
|
+
const currentCodeBlock = findCodeBlockAtSelection(state);
|
|
31
|
+
if (!currentCodeBlock) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
const code = currentCodeBlock.node.textContent || "";
|
|
35
|
+
const language = currentCodeBlock.node.attrs.language;
|
|
36
|
+
if (!code.trim()) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
if (!codeBlockUtils.canPrettifyCodeLanguage(language)) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
const codeBlockPos = currentCodeBlock.pos;
|
|
43
|
+
void (() => tslib_es6.__awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
try {
|
|
45
|
+
const formattedCode = yield codeBlockUtils.prettifyCode(code, language);
|
|
46
|
+
if (!formattedCode || formattedCode === code || this.editor.isDestroyed) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const currentSelection = this.editor.state.selection;
|
|
50
|
+
const relativePos = Math.max(0, currentSelection.from - codeBlockPos - 1);
|
|
51
|
+
const from = codeBlockPos;
|
|
52
|
+
const to = from + currentCodeBlock.node.nodeSize;
|
|
53
|
+
const newTr = this.editor.state.tr;
|
|
54
|
+
newTr.replaceRangeWith(from, to, this.editor.state.schema.nodes.codeBlock.create(currentCodeBlock.node.attrs, this.editor.state.schema.text(formattedCode)));
|
|
55
|
+
const newCursorPos = from + 1 + Math.min(relativePos, formattedCode.length);
|
|
56
|
+
newTr.setSelection(index$1.TextSelection.near(newTr.doc.resolve(newCursorPos)));
|
|
57
|
+
this.editor.view.dispatch(newTr);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
console.error("Format error:", error);
|
|
61
|
+
}
|
|
62
|
+
}))();
|
|
63
|
+
return true;
|
|
64
|
+
} });
|
|
65
|
+
},
|
|
66
|
+
addKeyboardShortcuts() {
|
|
67
|
+
var _a;
|
|
68
|
+
return Object.assign(Object.assign({}, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)), { "Mod-s": () => {
|
|
69
|
+
const currentCodeBlock = findCodeBlockAtSelection(this.editor.state);
|
|
70
|
+
const language = currentCodeBlock === null || currentCodeBlock === void 0 ? void 0 : currentCodeBlock.node.attrs.language;
|
|
71
|
+
if (!currentCodeBlock || !codeBlockUtils.canPrettifyCodeLanguage(language)) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
return this.editor.commands.formatCodeBlock();
|
|
75
|
+
} });
|
|
76
|
+
},
|
|
77
|
+
}).configure({
|
|
78
|
+
lowlight: codeBlockUtils.codeBlockLowlight,
|
|
79
|
+
enableTabIndentation: true,
|
|
80
|
+
HTMLAttributes: {
|
|
81
|
+
class: `${codeBlockUtils.GITHUB_CODE_BLOCK_CLASS} ${codeBlockUtils.codeBlockThemeClassName(codeBlockUtils.DEFAULT_CODE_BLOCK_THEME)} not-prose my-4 overflow-x-auto rounded-lg border px-4 py-3 font-mono text-[13px] leading-6`,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
function findCodeBlockAtSelection(state) {
|
|
85
|
+
const codeBlockNodeType = state.schema.nodes.codeBlock;
|
|
86
|
+
if (!codeBlockNodeType)
|
|
87
|
+
return null;
|
|
88
|
+
const selectedNode = state.selection.node;
|
|
89
|
+
if ((selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.type) === codeBlockNodeType) {
|
|
90
|
+
return {
|
|
91
|
+
node: selectedNode,
|
|
92
|
+
pos: state.selection.from,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const { $from } = state.selection;
|
|
96
|
+
for (let depth = $from.depth; depth > 0; depth -= 1) {
|
|
97
|
+
const node = $from.node(depth);
|
|
98
|
+
if (node.type === codeBlockNodeType) {
|
|
99
|
+
return {
|
|
100
|
+
node,
|
|
101
|
+
pos: $from.before(depth),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
exports.CodeBlockLowlightBase = CodeBlockLowlightBase;
|
|
@@ -1,117 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var index$2 = require('../../../../node_modules/prosemirror-state/dist/index.js');
|
|
6
|
-
var index$1 = require('../../../../node_modules/@tiptap/react/dist/index.js');
|
|
7
|
-
var codeBlockUtils = require('./code-block-utils.js');
|
|
3
|
+
var index = require('../../../../node_modules/@tiptap/react/dist/index.js');
|
|
4
|
+
var codeBlockLowlightBase = require('./code-block-lowlight-base.js');
|
|
8
5
|
var codeBlockNodeView = require('../views/code-block-node-view.js');
|
|
6
|
+
var codeBlockUtils = require('./code-block-utils.js');
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return Object.assign(Object.assign({}, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)), { lowlight: codeBlockUtils.codeBlockLowlight, languages: codeBlockUtils.CODE_BLOCK_LANGUAGE_OPTIONS });
|
|
14
|
-
},
|
|
15
|
-
addAttributes() {
|
|
16
|
-
var _a;
|
|
17
|
-
return Object.assign(Object.assign({}, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)), { theme: {
|
|
18
|
-
default: codeBlockUtils.DEFAULT_CODE_BLOCK_THEME,
|
|
19
|
-
parseHTML: (element) => {
|
|
20
|
-
var _a;
|
|
21
|
-
const rawTheme = (_a = element === null || element === void 0 ? void 0 : element.getAttribute) === null || _a === void 0 ? void 0 : _a.call(element, "data-theme");
|
|
22
|
-
return codeBlockUtils.resolveCodeBlockTheme(rawTheme);
|
|
23
|
-
},
|
|
24
|
-
renderHTML: (attributes) => {
|
|
25
|
-
const theme = codeBlockUtils.resolveCodeBlockTheme(attributes.theme);
|
|
26
|
-
return {
|
|
27
|
-
"data-theme": theme,
|
|
28
|
-
class: codeBlockUtils.codeBlockThemeClassName(theme),
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
} });
|
|
32
|
-
},
|
|
33
|
-
addCommands() {
|
|
34
|
-
var _a;
|
|
35
|
-
return Object.assign(Object.assign({}, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)), { formatCodeBlock: () => ({ state }) => {
|
|
36
|
-
const currentCodeBlock = findCodeBlockAtSelection(state);
|
|
37
|
-
if (!currentCodeBlock) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
const code = currentCodeBlock.node.textContent || "";
|
|
41
|
-
const language = currentCodeBlock.node.attrs.language;
|
|
42
|
-
if (!code.trim()) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
if (!codeBlockUtils.canPrettifyCodeLanguage(language)) {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
const codeBlockPos = currentCodeBlock.pos;
|
|
49
|
-
void (() => tslib_es6.__awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
try {
|
|
51
|
-
const formattedCode = yield codeBlockUtils.prettifyCode(code, language);
|
|
52
|
-
if (!formattedCode || formattedCode === code || this.editor.isDestroyed) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
const currentSelection = this.editor.state.selection;
|
|
56
|
-
const relativePos = Math.max(0, currentSelection.from - codeBlockPos - 1);
|
|
57
|
-
const from = codeBlockPos;
|
|
58
|
-
const to = from + currentCodeBlock.node.nodeSize;
|
|
59
|
-
const newTr = this.editor.state.tr;
|
|
60
|
-
newTr.replaceRangeWith(from, to, this.editor.state.schema.nodes.codeBlock.create(currentCodeBlock.node.attrs, this.editor.state.schema.text(formattedCode)));
|
|
61
|
-
const newCursorPos = from + 1 + Math.min(relativePos, formattedCode.length);
|
|
62
|
-
newTr.setSelection(index$2.TextSelection.near(newTr.doc.resolve(newCursorPos)));
|
|
63
|
-
this.editor.view.dispatch(newTr);
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
console.error("Format error:", error);
|
|
67
|
-
}
|
|
68
|
-
}))();
|
|
69
|
-
return true;
|
|
70
|
-
} });
|
|
71
|
-
},
|
|
72
|
-
addKeyboardShortcuts() {
|
|
73
|
-
var _a;
|
|
74
|
-
return Object.assign(Object.assign({}, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)), { "Mod-s": () => {
|
|
75
|
-
const currentCodeBlock = findCodeBlockAtSelection(this.editor.state);
|
|
76
|
-
const language = currentCodeBlock === null || currentCodeBlock === void 0 ? void 0 : currentCodeBlock.node.attrs.language;
|
|
77
|
-
if (!currentCodeBlock || !codeBlockUtils.canPrettifyCodeLanguage(language)) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
return this.editor.commands.formatCodeBlock();
|
|
81
|
-
} });
|
|
82
|
-
},
|
|
8
|
+
// Full editor extension — adds the React node view on top of the SSR-safe base.
|
|
9
|
+
// Only import this in editor contexts (client-side), not in getRendererExtensions().
|
|
10
|
+
const CodeBlockLowlight = codeBlockLowlightBase.CodeBlockLowlightBase.extend({
|
|
83
11
|
addNodeView() {
|
|
84
|
-
return index
|
|
85
|
-
},
|
|
86
|
-
}).configure({
|
|
87
|
-
lowlight: codeBlockUtils.codeBlockLowlight,
|
|
88
|
-
enableTabIndentation: true,
|
|
89
|
-
HTMLAttributes: {
|
|
90
|
-
class: `${codeBlockUtils.GITHUB_CODE_BLOCK_CLASS} ${codeBlockUtils.codeBlockThemeClassName(codeBlockUtils.DEFAULT_CODE_BLOCK_THEME)} not-prose my-4 overflow-x-auto rounded-lg border px-4 py-3 font-mono text-[13px] leading-6`,
|
|
12
|
+
return index.ReactNodeViewRenderer(codeBlockNodeView.CodeBlockNodeView);
|
|
91
13
|
},
|
|
92
14
|
});
|
|
93
|
-
function findCodeBlockAtSelection(state) {
|
|
94
|
-
const codeBlockNodeType = state.schema.nodes.codeBlock;
|
|
95
|
-
if (!codeBlockNodeType)
|
|
96
|
-
return null;
|
|
97
|
-
const selectedNode = state.selection.node;
|
|
98
|
-
if ((selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.type) === codeBlockNodeType) {
|
|
99
|
-
return {
|
|
100
|
-
node: selectedNode,
|
|
101
|
-
pos: state.selection.from,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
const { $from } = state.selection;
|
|
105
|
-
for (let depth = $from.depth; depth > 0; depth -= 1) {
|
|
106
|
-
const node = $from.node(depth);
|
|
107
|
-
if (node.type === codeBlockNodeType) {
|
|
108
|
-
return {
|
|
109
|
-
node,
|
|
110
|
-
pos: $from.before(depth),
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
15
|
|
|
16
|
+
exports.CodeBlockLowlightBase = codeBlockLowlightBase.CodeBlockLowlightBase;
|
|
17
|
+
exports.CODE_BLOCK_LANGUAGE_OPTIONS = codeBlockUtils.CODE_BLOCK_LANGUAGE_OPTIONS;
|
|
18
|
+
exports.CODE_BLOCK_THEME_OPTIONS = codeBlockUtils.CODE_BLOCK_THEME_OPTIONS;
|
|
19
|
+
exports.DEFAULT_CODE_BLOCK_THEME = codeBlockUtils.DEFAULT_CODE_BLOCK_THEME;
|
|
20
|
+
exports.GITHUB_CODE_BLOCK_CLASS = codeBlockUtils.GITHUB_CODE_BLOCK_CLASS;
|
|
21
|
+
exports.canPrettifyCodeLanguage = codeBlockUtils.canPrettifyCodeLanguage;
|
|
22
|
+
exports.codeBlockLowlight = codeBlockUtils.codeBlockLowlight;
|
|
23
|
+
exports.codeBlockThemeClassName = codeBlockUtils.codeBlockThemeClassName;
|
|
24
|
+
exports.prettifyCode = codeBlockUtils.prettifyCode;
|
|
25
|
+
exports.resolveCodeBlockLanguage = codeBlockUtils.resolveCodeBlockLanguage;
|
|
26
|
+
exports.resolveCodeBlockTheme = codeBlockUtils.resolveCodeBlockTheme;
|
|
117
27
|
exports.CodeBlockLowlight = CodeBlockLowlight;
|
|
@@ -48,6 +48,7 @@ require('../carousel/carousel.js');
|
|
|
48
48
|
require('../../../node_modules/tslib/tslib.es6.js');
|
|
49
49
|
require('../../forms/file-upload/file-upload.js');
|
|
50
50
|
var columns = require('./extensions/columns.js');
|
|
51
|
+
var codeBlockLowlightBase = require('./extensions/code-block-lowlight-base.js');
|
|
51
52
|
|
|
52
53
|
/**
|
|
53
54
|
* Core content and formatting extensions used by both editor and renderer.
|
|
@@ -93,7 +94,7 @@ const CORE_EXTENSIONS = [
|
|
|
93
94
|
index$2.default,
|
|
94
95
|
extension.Carousel,
|
|
95
96
|
tableKit.TableKit,
|
|
96
|
-
|
|
97
|
+
codeBlockLowlightBase.CodeBlockLowlightBase,
|
|
97
98
|
];
|
|
98
99
|
/**
|
|
99
100
|
* Default configurations for editor extensions.
|
|
@@ -168,6 +169,7 @@ const EDITOR_EXTENSIONS = [
|
|
|
168
169
|
tableActionsExtension.TableActionsExtension,
|
|
169
170
|
tableSelectionOverlay.TableSelectionOverlay,
|
|
170
171
|
tableHoverExtension.TableHoverExtension,
|
|
172
|
+
codeBlockLowlight.CodeBlockLowlight, // overrides CodeBlockLowlightBase from CORE_EXTENSIONS via unionBy
|
|
171
173
|
];
|
|
172
174
|
const configureExtension = (extension) => {
|
|
173
175
|
const { options } = extension;
|
|
@@ -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/index.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/index8.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/index8.js');
|
|
7
7
|
var errors = require('../errors.js');
|
|
8
8
|
var PDFName = require('../objects/PDFName.js');
|
|
9
9
|
var PDFStream = require('../objects/PDFStream.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/index2.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/index4.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/index3.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,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,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,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,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,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 };
|
|
@@ -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 };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { __awaiter } from '../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import index_default from '../../../../node_modules/@tiptap/extension-code-block-lowlight/dist/index.js';
|
|
3
|
+
import { TextSelection } from '../../../../node_modules/prosemirror-state/dist/index.js';
|
|
4
|
+
import { canPrettifyCodeLanguage, prettifyCode, DEFAULT_CODE_BLOCK_THEME, resolveCodeBlockTheme, codeBlockThemeClassName, GITHUB_CODE_BLOCK_CLASS, codeBlockLowlight } from './code-block-utils.js';
|
|
5
|
+
|
|
6
|
+
const CodeBlockLowlightBase = index_default.extend({
|
|
7
|
+
addAttributes() {
|
|
8
|
+
var _a;
|
|
9
|
+
return Object.assign(Object.assign({}, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)), { theme: {
|
|
10
|
+
default: DEFAULT_CODE_BLOCK_THEME,
|
|
11
|
+
parseHTML: (element) => {
|
|
12
|
+
var _a;
|
|
13
|
+
const rawTheme = (_a = element === null || element === void 0 ? void 0 : element.getAttribute) === null || _a === void 0 ? void 0 : _a.call(element, "data-theme");
|
|
14
|
+
return resolveCodeBlockTheme(rawTheme);
|
|
15
|
+
},
|
|
16
|
+
renderHTML: (attributes) => {
|
|
17
|
+
const theme = resolveCodeBlockTheme(attributes.theme);
|
|
18
|
+
return {
|
|
19
|
+
"data-theme": theme,
|
|
20
|
+
class: codeBlockThemeClassName(theme),
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
} });
|
|
24
|
+
},
|
|
25
|
+
addCommands() {
|
|
26
|
+
var _a;
|
|
27
|
+
return Object.assign(Object.assign({}, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)), { formatCodeBlock: () => ({ state }) => {
|
|
28
|
+
const currentCodeBlock = findCodeBlockAtSelection(state);
|
|
29
|
+
if (!currentCodeBlock) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
const code = currentCodeBlock.node.textContent || "";
|
|
33
|
+
const language = currentCodeBlock.node.attrs.language;
|
|
34
|
+
if (!code.trim()) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
if (!canPrettifyCodeLanguage(language)) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
const codeBlockPos = currentCodeBlock.pos;
|
|
41
|
+
void (() => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
try {
|
|
43
|
+
const formattedCode = yield prettifyCode(code, language);
|
|
44
|
+
if (!formattedCode || formattedCode === code || this.editor.isDestroyed) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const currentSelection = this.editor.state.selection;
|
|
48
|
+
const relativePos = Math.max(0, currentSelection.from - codeBlockPos - 1);
|
|
49
|
+
const from = codeBlockPos;
|
|
50
|
+
const to = from + currentCodeBlock.node.nodeSize;
|
|
51
|
+
const newTr = this.editor.state.tr;
|
|
52
|
+
newTr.replaceRangeWith(from, to, this.editor.state.schema.nodes.codeBlock.create(currentCodeBlock.node.attrs, this.editor.state.schema.text(formattedCode)));
|
|
53
|
+
const newCursorPos = from + 1 + Math.min(relativePos, formattedCode.length);
|
|
54
|
+
newTr.setSelection(TextSelection.near(newTr.doc.resolve(newCursorPos)));
|
|
55
|
+
this.editor.view.dispatch(newTr);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
console.error("Format error:", error);
|
|
59
|
+
}
|
|
60
|
+
}))();
|
|
61
|
+
return true;
|
|
62
|
+
} });
|
|
63
|
+
},
|
|
64
|
+
addKeyboardShortcuts() {
|
|
65
|
+
var _a;
|
|
66
|
+
return Object.assign(Object.assign({}, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)), { "Mod-s": () => {
|
|
67
|
+
const currentCodeBlock = findCodeBlockAtSelection(this.editor.state);
|
|
68
|
+
const language = currentCodeBlock === null || currentCodeBlock === void 0 ? void 0 : currentCodeBlock.node.attrs.language;
|
|
69
|
+
if (!currentCodeBlock || !canPrettifyCodeLanguage(language)) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
return this.editor.commands.formatCodeBlock();
|
|
73
|
+
} });
|
|
74
|
+
},
|
|
75
|
+
}).configure({
|
|
76
|
+
lowlight: codeBlockLowlight,
|
|
77
|
+
enableTabIndentation: true,
|
|
78
|
+
HTMLAttributes: {
|
|
79
|
+
class: `${GITHUB_CODE_BLOCK_CLASS} ${codeBlockThemeClassName(DEFAULT_CODE_BLOCK_THEME)} not-prose my-4 overflow-x-auto rounded-lg border px-4 py-3 font-mono text-[13px] leading-6`,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
function findCodeBlockAtSelection(state) {
|
|
83
|
+
const codeBlockNodeType = state.schema.nodes.codeBlock;
|
|
84
|
+
if (!codeBlockNodeType)
|
|
85
|
+
return null;
|
|
86
|
+
const selectedNode = state.selection.node;
|
|
87
|
+
if ((selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.type) === codeBlockNodeType) {
|
|
88
|
+
return {
|
|
89
|
+
node: selectedNode,
|
|
90
|
+
pos: state.selection.from,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const { $from } = state.selection;
|
|
94
|
+
for (let depth = $from.depth; depth > 0; depth -= 1) {
|
|
95
|
+
const node = $from.node(depth);
|
|
96
|
+
if (node.type === codeBlockNodeType) {
|
|
97
|
+
return {
|
|
98
|
+
node,
|
|
99
|
+
pos: $from.before(depth),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { CodeBlockLowlightBase };
|
|
@@ -1,115 +1,14 @@
|
|
|
1
|
-
import { __awaiter } from '../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import index_default from '../../../../node_modules/@tiptap/extension-code-block-lowlight/dist/index.js';
|
|
3
|
-
import { TextSelection } from '../../../../node_modules/prosemirror-state/dist/index.js';
|
|
4
1
|
import { ReactNodeViewRenderer } from '../../../../node_modules/@tiptap/react/dist/index.js';
|
|
5
|
-
import {
|
|
2
|
+
import { CodeBlockLowlightBase } from './code-block-lowlight-base.js';
|
|
6
3
|
import { CodeBlockNodeView } from '../views/code-block-node-view.js';
|
|
4
|
+
export { CODE_BLOCK_LANGUAGE_OPTIONS, CODE_BLOCK_THEME_OPTIONS, DEFAULT_CODE_BLOCK_THEME, GITHUB_CODE_BLOCK_CLASS, canPrettifyCodeLanguage, codeBlockLowlight, codeBlockThemeClassName, prettifyCode, resolveCodeBlockLanguage, resolveCodeBlockTheme } from './code-block-utils.js';
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return Object.assign(Object.assign({}, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)), { lowlight: codeBlockLowlight, languages: CODE_BLOCK_LANGUAGE_OPTIONS });
|
|
12
|
-
},
|
|
13
|
-
addAttributes() {
|
|
14
|
-
var _a;
|
|
15
|
-
return Object.assign(Object.assign({}, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)), { theme: {
|
|
16
|
-
default: DEFAULT_CODE_BLOCK_THEME,
|
|
17
|
-
parseHTML: (element) => {
|
|
18
|
-
var _a;
|
|
19
|
-
const rawTheme = (_a = element === null || element === void 0 ? void 0 : element.getAttribute) === null || _a === void 0 ? void 0 : _a.call(element, "data-theme");
|
|
20
|
-
return resolveCodeBlockTheme(rawTheme);
|
|
21
|
-
},
|
|
22
|
-
renderHTML: (attributes) => {
|
|
23
|
-
const theme = resolveCodeBlockTheme(attributes.theme);
|
|
24
|
-
return {
|
|
25
|
-
"data-theme": theme,
|
|
26
|
-
class: codeBlockThemeClassName(theme),
|
|
27
|
-
};
|
|
28
|
-
},
|
|
29
|
-
} });
|
|
30
|
-
},
|
|
31
|
-
addCommands() {
|
|
32
|
-
var _a;
|
|
33
|
-
return Object.assign(Object.assign({}, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)), { formatCodeBlock: () => ({ state }) => {
|
|
34
|
-
const currentCodeBlock = findCodeBlockAtSelection(state);
|
|
35
|
-
if (!currentCodeBlock) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
const code = currentCodeBlock.node.textContent || "";
|
|
39
|
-
const language = currentCodeBlock.node.attrs.language;
|
|
40
|
-
if (!code.trim()) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
if (!canPrettifyCodeLanguage(language)) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
const codeBlockPos = currentCodeBlock.pos;
|
|
47
|
-
void (() => __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
try {
|
|
49
|
-
const formattedCode = yield prettifyCode(code, language);
|
|
50
|
-
if (!formattedCode || formattedCode === code || this.editor.isDestroyed) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const currentSelection = this.editor.state.selection;
|
|
54
|
-
const relativePos = Math.max(0, currentSelection.from - codeBlockPos - 1);
|
|
55
|
-
const from = codeBlockPos;
|
|
56
|
-
const to = from + currentCodeBlock.node.nodeSize;
|
|
57
|
-
const newTr = this.editor.state.tr;
|
|
58
|
-
newTr.replaceRangeWith(from, to, this.editor.state.schema.nodes.codeBlock.create(currentCodeBlock.node.attrs, this.editor.state.schema.text(formattedCode)));
|
|
59
|
-
const newCursorPos = from + 1 + Math.min(relativePos, formattedCode.length);
|
|
60
|
-
newTr.setSelection(TextSelection.near(newTr.doc.resolve(newCursorPos)));
|
|
61
|
-
this.editor.view.dispatch(newTr);
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
console.error("Format error:", error);
|
|
65
|
-
}
|
|
66
|
-
}))();
|
|
67
|
-
return true;
|
|
68
|
-
} });
|
|
69
|
-
},
|
|
70
|
-
addKeyboardShortcuts() {
|
|
71
|
-
var _a;
|
|
72
|
-
return Object.assign(Object.assign({}, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)), { "Mod-s": () => {
|
|
73
|
-
const currentCodeBlock = findCodeBlockAtSelection(this.editor.state);
|
|
74
|
-
const language = currentCodeBlock === null || currentCodeBlock === void 0 ? void 0 : currentCodeBlock.node.attrs.language;
|
|
75
|
-
if (!currentCodeBlock || !canPrettifyCodeLanguage(language)) {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
return this.editor.commands.formatCodeBlock();
|
|
79
|
-
} });
|
|
80
|
-
},
|
|
6
|
+
// Full editor extension — adds the React node view on top of the SSR-safe base.
|
|
7
|
+
// Only import this in editor contexts (client-side), not in getRendererExtensions().
|
|
8
|
+
const CodeBlockLowlight = CodeBlockLowlightBase.extend({
|
|
81
9
|
addNodeView() {
|
|
82
10
|
return ReactNodeViewRenderer(CodeBlockNodeView);
|
|
83
11
|
},
|
|
84
|
-
}).configure({
|
|
85
|
-
lowlight: codeBlockLowlight,
|
|
86
|
-
enableTabIndentation: true,
|
|
87
|
-
HTMLAttributes: {
|
|
88
|
-
class: `${GITHUB_CODE_BLOCK_CLASS} ${codeBlockThemeClassName(DEFAULT_CODE_BLOCK_THEME)} not-prose my-4 overflow-x-auto rounded-lg border px-4 py-3 font-mono text-[13px] leading-6`,
|
|
89
|
-
},
|
|
90
12
|
});
|
|
91
|
-
function findCodeBlockAtSelection(state) {
|
|
92
|
-
const codeBlockNodeType = state.schema.nodes.codeBlock;
|
|
93
|
-
if (!codeBlockNodeType)
|
|
94
|
-
return null;
|
|
95
|
-
const selectedNode = state.selection.node;
|
|
96
|
-
if ((selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.type) === codeBlockNodeType) {
|
|
97
|
-
return {
|
|
98
|
-
node: selectedNode,
|
|
99
|
-
pos: state.selection.from,
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
const { $from } = state.selection;
|
|
103
|
-
for (let depth = $from.depth; depth > 0; depth -= 1) {
|
|
104
|
-
const node = $from.node(depth);
|
|
105
|
-
if (node.type === codeBlockNodeType) {
|
|
106
|
-
return {
|
|
107
|
-
node,
|
|
108
|
-
pos: $from.before(depth),
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
13
|
|
|
115
|
-
export { CodeBlockLowlight };
|
|
14
|
+
export { CodeBlockLowlight, CodeBlockLowlightBase };
|
|
@@ -46,6 +46,7 @@ import '../carousel/carousel.js';
|
|
|
46
46
|
import '../../../node_modules/tslib/tslib.es6.js';
|
|
47
47
|
import '../../forms/file-upload/file-upload.js';
|
|
48
48
|
import { Columns, Column } from './extensions/columns.js';
|
|
49
|
+
import { CodeBlockLowlightBase } from './extensions/code-block-lowlight-base.js';
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* Core content and formatting extensions used by both editor and renderer.
|
|
@@ -91,7 +92,7 @@ const CORE_EXTENSIONS = [
|
|
|
91
92
|
index_default$2,
|
|
92
93
|
Carousel,
|
|
93
94
|
TableKit,
|
|
94
|
-
|
|
95
|
+
CodeBlockLowlightBase,
|
|
95
96
|
];
|
|
96
97
|
/**
|
|
97
98
|
* Default configurations for editor extensions.
|
|
@@ -166,6 +167,7 @@ const EDITOR_EXTENSIONS = [
|
|
|
166
167
|
TableActionsExtension,
|
|
167
168
|
TableSelectionOverlay,
|
|
168
169
|
TableHoverExtension,
|
|
170
|
+
CodeBlockLowlight, // overrides CodeBlockLowlightBase from CORE_EXTENSIONS via unionBy
|
|
169
171
|
];
|
|
170
172
|
const configureExtension = (extension) => {
|
|
171
173
|
const { options } = extension;
|
|
@@ -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/index.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/index8.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/index8.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,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/index2.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/index4.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/index3.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
|
@@ -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?: "left" | "right" | "top" | "bottom" | 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?:
|
|
641
|
+
size?: 1 | 2 | 3 | 4 | 8 | 9 | 7 | 6 | 5 | null | undefined;
|
|
642
642
|
weight?: "bold" | "light" | "medium" | "regular" | null | undefined;
|
|
643
|
-
align?: "center" | "
|
|
643
|
+
align?: "center" | "left" | "right" | 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?:
|
|
653
|
+
size?: 1 | 2 | 3 | 4 | 8 | 9 | 7 | 6 | 5 | null | undefined;
|
|
654
654
|
weight?: "bold" | "light" | "medium" | "regular" | null | undefined;
|
|
655
|
-
align?: "center" | "
|
|
655
|
+
align?: "center" | "left" | "right" | 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?:
|
|
665
|
+
size?: 1 | 2 | 3 | 4 | 8 | 9 | 7 | 6 | 5 | null | undefined;
|
|
666
666
|
weight?: "bold" | "light" | "medium" | "regular" | null | undefined;
|
|
667
|
-
align?: "center" | "
|
|
667
|
+
align?: "center" | "left" | "right" | 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>>;
|
|
@@ -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" | "left" | "right" | null | undefined;
|
|
1192
|
+
sticky?: "left" | "right" | 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" | "left" | "right" | null | undefined;
|
|
1205
|
+
sticky?: "left" | "right" | 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>;
|