@cgboiler/biz-basic 1.0.14 → 1.0.16
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/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/rich-text-editor/RichTextEditor.d.ts +9 -0
- package/es/rich-text-editor/RichTextEditor.js +1 -0
- package/es/rich-text-editor/extensions/HtmlBlock.d.ts +3 -0
- package/es/rich-text-editor/extensions/HtmlBlock.js +59 -0
- package/es/rich-text-editor/index.css +1 -1
- package/es/rich-text-editor/index.less +0 -2
- package/es/rich-text-editor/types.d.ts +4 -0
- package/es/rich-text-editor/types.js +4 -0
- package/es/rich-text-editor/useExtensions.d.ts +1 -1
- package/es/rich-text-editor/useExtensions.js +2 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/rich-text-editor/RichTextEditor.d.ts +9 -0
- package/lib/rich-text-editor/RichTextEditor.js +1 -0
- package/lib/rich-text-editor/extensions/HtmlBlock.d.ts +3 -0
- package/lib/rich-text-editor/extensions/HtmlBlock.js +78 -0
- package/lib/rich-text-editor/index.css +1 -1
- package/lib/rich-text-editor/index.less +0 -2
- package/lib/rich-text-editor/types.d.ts +4 -0
- package/lib/rich-text-editor/types.js +4 -0
- package/lib/rich-text-editor/useExtensions.d.ts +1 -1
- package/lib/rich-text-editor/useExtensions.js +2 -0
- package/package.json +1 -1
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -11,6 +11,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
11
11
|
onMentionTriggered: {
|
|
12
12
|
type: FunctionConstructor;
|
|
13
13
|
};
|
|
14
|
+
editable: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
14
18
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "focus" | "mention-triggered" | "update:modelValue")[], "blur" | "focus" | "mention-triggered" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
19
|
modelValue: {
|
|
16
20
|
type: StringConstructor;
|
|
@@ -23,6 +27,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
23
27
|
onMentionTriggered: {
|
|
24
28
|
type: FunctionConstructor;
|
|
25
29
|
};
|
|
30
|
+
editable: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
26
34
|
}>> & Readonly<{
|
|
27
35
|
onFocus?: ((...args: any[]) => any) | undefined;
|
|
28
36
|
onBlur?: ((...args: any[]) => any) | undefined;
|
|
@@ -31,5 +39,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
31
39
|
}>, {
|
|
32
40
|
modelValue: string;
|
|
33
41
|
placeholder: string;
|
|
42
|
+
editable: boolean;
|
|
34
43
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
35
44
|
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
import { mergeAttributes } from "@tiptap/vue-3";
|
|
3
|
+
var stdin_default = Node.create({
|
|
4
|
+
name: "htmlBlock",
|
|
5
|
+
// 给您的HTML块一个名字
|
|
6
|
+
group: "block",
|
|
7
|
+
// 作为一个块级元素
|
|
8
|
+
content: "",
|
|
9
|
+
// 这个节点本身不应该有可编辑的内容
|
|
10
|
+
inline: false,
|
|
11
|
+
// 确保它是一个块级元素
|
|
12
|
+
addAttributes() {
|
|
13
|
+
return {
|
|
14
|
+
html: {
|
|
15
|
+
default: ""
|
|
16
|
+
// 存储完整的HTML字符串
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
parseHTML() {
|
|
21
|
+
return [
|
|
22
|
+
{
|
|
23
|
+
tag: 'div[data-type="html-block"]',
|
|
24
|
+
getAttrs: (node) => {
|
|
25
|
+
return { html: node.innerHTML };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
},
|
|
30
|
+
renderHTML({ HTMLAttributes }) {
|
|
31
|
+
return ["div", mergeAttributes(HTMLAttributes, { "data-type": "html-block" })];
|
|
32
|
+
},
|
|
33
|
+
addNodeView() {
|
|
34
|
+
return ({ node, editor, getPos }) => {
|
|
35
|
+
const dom = document.createElement("div");
|
|
36
|
+
dom.classList.add("html-block-container");
|
|
37
|
+
dom.setAttribute("data-tiptap-node-view-wrapper", "");
|
|
38
|
+
dom.contentEditable = "false";
|
|
39
|
+
dom.innerHTML = node.attrs.html;
|
|
40
|
+
return {
|
|
41
|
+
dom,
|
|
42
|
+
update: (updatedNode) => {
|
|
43
|
+
if (updatedNode.type.name !== this.name) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (updatedNode.attrs.html !== node.attrs.html) {
|
|
47
|
+
dom.innerHTML = updatedNode.attrs.html;
|
|
48
|
+
}
|
|
49
|
+
return true;
|
|
50
|
+
},
|
|
51
|
+
destroy: () => {
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
export {
|
|
58
|
+
stdin_default as default
|
|
59
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ProseMirror{flex:1;overflow:auto;outline:none;line-height:1.6;font-size:var(--font-base);--white: #fff;--black: #2e2b29;--gray-1: rgba(61, 37, 20, .05);--gray-2: rgba(61, 37, 20, .08);--gray-3: rgba(61, 37, 20, .12);--gray-4: rgba(53, 38, 28, .3);--gray-5: rgba(28, 25, 23, .6);--green: #22c55e;--purple: #6a00f5;--purple-contrast: #5800cc;--purple-light: rgba(88, 5, 255, .05);--yellow-contrast: #facc15;--yellow: rgba(250, 204, 21, .4);--yellow-light: #fffae5;--red: #ff5c33;--red-light: #ffebe5;--shadow: 0px 12px 33px 0px rgba(0, 0, 0, .06), 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)}.ProseMirror :first-child{margin-top:0}.ProseMirror ol{list-style:auto}.ProseMirror ol ol,.ProseMirror ul{list-style:disc}.ProseMirror ol,.ProseMirror ul{padding-left:1.5em;margin:0 0 12px}.ProseMirror ol li p,.ProseMirror ul li p{margin-top:.25em;margin-bottom:.25em}.ProseMirror li::marker{text-align:start!important}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{line-height:1.1;margin-top:2.5rem;text-wrap:pretty}.ProseMirror h1,.ProseMirror h2{margin-top:1rem;margin-bottom:1rem}.ProseMirror h1{font-size:1.4rem}.ProseMirror h2{font-size:1.2rem}.ProseMirror h3{font-size:1.1rem}.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{font-size:1rem}.ProseMirror a,.ProseMirror .editor-link{color:var(--purple);text-decoration:underline;cursor:pointer;transition:color .2s ease}.ProseMirror a:hover,.ProseMirror .editor-link:hover{color:var(--purple-contrast);text-decoration:underline}.ProseMirror code{background-color:#ffe5e8;border-radius:.4rem;color:var(--black);font-size:.85rem;padding:.25em .3em}.ProseMirror pre{
|
|
1
|
+
.ProseMirror{flex:1;overflow:auto;outline:none;line-height:1.6;font-size:var(--font-base);--white: #fff;--black: #2e2b29;--gray-1: rgba(61, 37, 20, .05);--gray-2: rgba(61, 37, 20, .08);--gray-3: rgba(61, 37, 20, .12);--gray-4: rgba(53, 38, 28, .3);--gray-5: rgba(28, 25, 23, .6);--green: #22c55e;--purple: #6a00f5;--purple-contrast: #5800cc;--purple-light: rgba(88, 5, 255, .05);--yellow-contrast: #facc15;--yellow: rgba(250, 204, 21, .4);--yellow-light: #fffae5;--red: #ff5c33;--red-light: #ffebe5;--shadow: 0px 12px 33px 0px rgba(0, 0, 0, .06), 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)}.ProseMirror :first-child{margin-top:0}.ProseMirror ol{list-style:auto}.ProseMirror ol ol,.ProseMirror ul{list-style:disc}.ProseMirror ol,.ProseMirror ul{padding-left:1.5em;margin:0 0 12px}.ProseMirror ol li p,.ProseMirror ul li p{margin-top:.25em;margin-bottom:.25em}.ProseMirror li::marker{text-align:start!important}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{line-height:1.1;margin-top:2.5rem;text-wrap:pretty}.ProseMirror h1,.ProseMirror h2{margin-top:1rem;margin-bottom:1rem}.ProseMirror h1{font-size:1.4rem}.ProseMirror h2{font-size:1.2rem}.ProseMirror h3{font-size:1.1rem}.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{font-size:1rem}.ProseMirror a,.ProseMirror .editor-link{color:var(--purple);text-decoration:underline;cursor:pointer;transition:color .2s ease}.ProseMirror a:hover,.ProseMirror .editor-link:hover{color:var(--purple-contrast);text-decoration:underline}.ProseMirror code{background-color:#ffe5e8;border-radius:.4rem;color:var(--black);font-size:.85rem;padding:.25em .3em}.ProseMirror pre{border-radius:.5rem;font-family:JetBrainsMono,monospace;margin:1.5rem 0;padding:.75rem 1rem}.ProseMirror pre code{background:none;color:inherit;font-size:.8rem;padding:0}.ProseMirror blockquote{border-left:3px solid var(--gray-3);margin:1.5rem 0;padding-left:1rem}.ProseMirror hr{border:none;border-top:1px solid var(--gray-2);margin:2rem 0}.ProseMirror p.is-editor-empty:first-child:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror .is-empty:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed;width:100%}.ProseMirror table td,.ProseMirror table th{border:1px solid var(--gray-3);box-sizing:border-box;min-width:1em;padding:6px 8px;position:relative;vertical-align:top}.ProseMirror table td>*,.ProseMirror table th>*{margin-bottom:0}.ProseMirror table th{background-color:var(--gray-1);font-weight:700;text-align:left}.ProseMirror table .selectedCell:after{background:var(--gray-2);content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2}.ProseMirror table .column-resize-handle{background-color:var(--purple);bottom:-2px;pointer-events:none;position:absolute;right:-2px;top:0;width:4px}.ProseMirror .tableWrapper{margin:1.5rem 0;overflow-x:auto}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}.ProseMirror img{max-width:100%}.ProseMirror .mention{color:#c02537;padding:0 .3em}.animation-indent--right{animation:indent-right .5s cubic-bezier(.68,-.55,.27,1.55) 1 alternate-reverse}@keyframes indent-right{0%{transform:translate(0)}to{transform:translate(12px)}}
|
|
@@ -15,6 +15,10 @@ export declare const richTextEditorProps: {
|
|
|
15
15
|
onMentionTriggered: {
|
|
16
16
|
type: FunctionConstructor;
|
|
17
17
|
};
|
|
18
|
+
editable: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
18
22
|
};
|
|
19
23
|
export type RichTextEditorProps = ExtractPropTypes<typeof richTextEditorProps> & {
|
|
20
24
|
onMentionTriggered?: () => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
|
-
export declare function useExtensions({ props, emit }: any): (Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-text-style").TextStyleOptions, any> | Extension<import("@tiptap/extension-text-style").ColorOptions, any> | Extension<import("tiptap-markdown").MarkdownOptions, import("tiptap-markdown").MarkdownStorage> | Extension<any, any> | import("@tiptap/core").Node<import("@tiptap/extension-image").ImageOptions, any> | Extension<import("@tiptap/extension-table").TableKitOptions, any> | Extension<import("@tiptap/extensions").PlaceholderOptions, any> | Extension<import("@tiptap/extension-list").ListKitOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-mention").MentionOptions<any, import("@tiptap/extension-mention").MentionNodeAttrs>, any>)[];
|
|
2
|
+
export declare function useExtensions({ props, emit }: any): (import("@tiptap/core").Node<any, any> | Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-text-style").TextStyleOptions, any> | Extension<import("@tiptap/extension-text-style").ColorOptions, any> | Extension<import("tiptap-markdown").MarkdownOptions, import("tiptap-markdown").MarkdownStorage> | Extension<any, any> | import("@tiptap/core").Node<import("@tiptap/extension-image").ImageOptions, any> | Extension<import("@tiptap/extension-table").TableKitOptions, any> | Extension<import("@tiptap/extensions").PlaceholderOptions, any> | Extension<import("@tiptap/extension-list").ListKitOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-mention").MentionOptions<any, import("@tiptap/extension-mention").MentionNodeAttrs>, any>)[];
|
|
@@ -8,10 +8,12 @@ import { Color } from "@tiptap/extension-color";
|
|
|
8
8
|
import { Markdown } from "tiptap-markdown";
|
|
9
9
|
import { Extension } from "@tiptap/core";
|
|
10
10
|
import { InputRule } from "@tiptap/core";
|
|
11
|
+
import HtmlBlock from "./extensions/HtmlBlock";
|
|
11
12
|
import { Placeholder } from "@tiptap/extensions";
|
|
12
13
|
function useExtensions({ props, emit }) {
|
|
13
14
|
const extensions = [
|
|
14
15
|
StarterKit,
|
|
16
|
+
HtmlBlock,
|
|
15
17
|
// TextStyle 是 Color 的依赖,必须添加
|
|
16
18
|
TextStyle.configure({
|
|
17
19
|
// 如果你还想支持其他 style 属性,可以在这里配置
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -36,7 +36,7 @@ __export(stdin_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(stdin_exports);
|
|
37
37
|
var import_rich_text_editor = __toESM(require("./rich-text-editor"));
|
|
38
38
|
__reExport(stdin_exports, require("./rich-text-editor"), module.exports);
|
|
39
|
-
const version = "1.0.
|
|
39
|
+
const version = "1.0.15";
|
|
40
40
|
function install(app) {
|
|
41
41
|
const components = [
|
|
42
42
|
import_rich_text_editor.default
|
|
@@ -11,6 +11,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
11
11
|
onMentionTriggered: {
|
|
12
12
|
type: FunctionConstructor;
|
|
13
13
|
};
|
|
14
|
+
editable: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
14
18
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "focus" | "mention-triggered" | "update:modelValue")[], "blur" | "focus" | "mention-triggered" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
19
|
modelValue: {
|
|
16
20
|
type: StringConstructor;
|
|
@@ -23,6 +27,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
23
27
|
onMentionTriggered: {
|
|
24
28
|
type: FunctionConstructor;
|
|
25
29
|
};
|
|
30
|
+
editable: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
26
34
|
}>> & Readonly<{
|
|
27
35
|
onFocus?: ((...args: any[]) => any) | undefined;
|
|
28
36
|
onBlur?: ((...args: any[]) => any) | undefined;
|
|
@@ -31,5 +39,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
31
39
|
}>, {
|
|
32
40
|
modelValue: string;
|
|
33
41
|
placeholder: string;
|
|
42
|
+
editable: boolean;
|
|
34
43
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
35
44
|
export default _default;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
default: () => stdin_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_core = require("@tiptap/core");
|
|
24
|
+
var import_vue_3 = require("@tiptap/vue-3");
|
|
25
|
+
var stdin_default = import_core.Node.create({
|
|
26
|
+
name: "htmlBlock",
|
|
27
|
+
// 给您的HTML块一个名字
|
|
28
|
+
group: "block",
|
|
29
|
+
// 作为一个块级元素
|
|
30
|
+
content: "",
|
|
31
|
+
// 这个节点本身不应该有可编辑的内容
|
|
32
|
+
inline: false,
|
|
33
|
+
// 确保它是一个块级元素
|
|
34
|
+
addAttributes() {
|
|
35
|
+
return {
|
|
36
|
+
html: {
|
|
37
|
+
default: ""
|
|
38
|
+
// 存储完整的HTML字符串
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
parseHTML() {
|
|
43
|
+
return [
|
|
44
|
+
{
|
|
45
|
+
tag: 'div[data-type="html-block"]',
|
|
46
|
+
getAttrs: (node) => {
|
|
47
|
+
return { html: node.innerHTML };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
},
|
|
52
|
+
renderHTML({ HTMLAttributes }) {
|
|
53
|
+
return ["div", (0, import_vue_3.mergeAttributes)(HTMLAttributes, { "data-type": "html-block" })];
|
|
54
|
+
},
|
|
55
|
+
addNodeView() {
|
|
56
|
+
return ({ node, editor, getPos }) => {
|
|
57
|
+
const dom = document.createElement("div");
|
|
58
|
+
dom.classList.add("html-block-container");
|
|
59
|
+
dom.setAttribute("data-tiptap-node-view-wrapper", "");
|
|
60
|
+
dom.contentEditable = "false";
|
|
61
|
+
dom.innerHTML = node.attrs.html;
|
|
62
|
+
return {
|
|
63
|
+
dom,
|
|
64
|
+
update: (updatedNode) => {
|
|
65
|
+
if (updatedNode.type.name !== this.name) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
if (updatedNode.attrs.html !== node.attrs.html) {
|
|
69
|
+
dom.innerHTML = updatedNode.attrs.html;
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
},
|
|
73
|
+
destroy: () => {
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ProseMirror{flex:1;overflow:auto;outline:none;line-height:1.6;font-size:var(--font-base);--white: #fff;--black: #2e2b29;--gray-1: rgba(61, 37, 20, .05);--gray-2: rgba(61, 37, 20, .08);--gray-3: rgba(61, 37, 20, .12);--gray-4: rgba(53, 38, 28, .3);--gray-5: rgba(28, 25, 23, .6);--green: #22c55e;--purple: #6a00f5;--purple-contrast: #5800cc;--purple-light: rgba(88, 5, 255, .05);--yellow-contrast: #facc15;--yellow: rgba(250, 204, 21, .4);--yellow-light: #fffae5;--red: #ff5c33;--red-light: #ffebe5;--shadow: 0px 12px 33px 0px rgba(0, 0, 0, .06), 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)}.ProseMirror :first-child{margin-top:0}.ProseMirror ol{list-style:auto}.ProseMirror ol ol,.ProseMirror ul{list-style:disc}.ProseMirror ol,.ProseMirror ul{padding-left:1.5em;margin:0 0 12px}.ProseMirror ol li p,.ProseMirror ul li p{margin-top:.25em;margin-bottom:.25em}.ProseMirror li::marker{text-align:start!important}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{line-height:1.1;margin-top:2.5rem;text-wrap:pretty}.ProseMirror h1,.ProseMirror h2{margin-top:1rem;margin-bottom:1rem}.ProseMirror h1{font-size:1.4rem}.ProseMirror h2{font-size:1.2rem}.ProseMirror h3{font-size:1.1rem}.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{font-size:1rem}.ProseMirror a,.ProseMirror .editor-link{color:var(--purple);text-decoration:underline;cursor:pointer;transition:color .2s ease}.ProseMirror a:hover,.ProseMirror .editor-link:hover{color:var(--purple-contrast);text-decoration:underline}.ProseMirror code{background-color:#ffe5e8;border-radius:.4rem;color:var(--black);font-size:.85rem;padding:.25em .3em}.ProseMirror pre{
|
|
1
|
+
.ProseMirror{flex:1;overflow:auto;outline:none;line-height:1.6;font-size:var(--font-base);--white: #fff;--black: #2e2b29;--gray-1: rgba(61, 37, 20, .05);--gray-2: rgba(61, 37, 20, .08);--gray-3: rgba(61, 37, 20, .12);--gray-4: rgba(53, 38, 28, .3);--gray-5: rgba(28, 25, 23, .6);--green: #22c55e;--purple: #6a00f5;--purple-contrast: #5800cc;--purple-light: rgba(88, 5, 255, .05);--yellow-contrast: #facc15;--yellow: rgba(250, 204, 21, .4);--yellow-light: #fffae5;--red: #ff5c33;--red-light: #ffebe5;--shadow: 0px 12px 33px 0px rgba(0, 0, 0, .06), 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)}.ProseMirror :first-child{margin-top:0}.ProseMirror ol{list-style:auto}.ProseMirror ol ol,.ProseMirror ul{list-style:disc}.ProseMirror ol,.ProseMirror ul{padding-left:1.5em;margin:0 0 12px}.ProseMirror ol li p,.ProseMirror ul li p{margin-top:.25em;margin-bottom:.25em}.ProseMirror li::marker{text-align:start!important}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{line-height:1.1;margin-top:2.5rem;text-wrap:pretty}.ProseMirror h1,.ProseMirror h2{margin-top:1rem;margin-bottom:1rem}.ProseMirror h1{font-size:1.4rem}.ProseMirror h2{font-size:1.2rem}.ProseMirror h3{font-size:1.1rem}.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{font-size:1rem}.ProseMirror a,.ProseMirror .editor-link{color:var(--purple);text-decoration:underline;cursor:pointer;transition:color .2s ease}.ProseMirror a:hover,.ProseMirror .editor-link:hover{color:var(--purple-contrast);text-decoration:underline}.ProseMirror code{background-color:#ffe5e8;border-radius:.4rem;color:var(--black);font-size:.85rem;padding:.25em .3em}.ProseMirror pre{border-radius:.5rem;font-family:JetBrainsMono,monospace;margin:1.5rem 0;padding:.75rem 1rem}.ProseMirror pre code{background:none;color:inherit;font-size:.8rem;padding:0}.ProseMirror blockquote{border-left:3px solid var(--gray-3);margin:1.5rem 0;padding-left:1rem}.ProseMirror hr{border:none;border-top:1px solid var(--gray-2);margin:2rem 0}.ProseMirror p.is-editor-empty:first-child:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror .is-empty:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed;width:100%}.ProseMirror table td,.ProseMirror table th{border:1px solid var(--gray-3);box-sizing:border-box;min-width:1em;padding:6px 8px;position:relative;vertical-align:top}.ProseMirror table td>*,.ProseMirror table th>*{margin-bottom:0}.ProseMirror table th{background-color:var(--gray-1);font-weight:700;text-align:left}.ProseMirror table .selectedCell:after{background:var(--gray-2);content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2}.ProseMirror table .column-resize-handle{background-color:var(--purple);bottom:-2px;pointer-events:none;position:absolute;right:-2px;top:0;width:4px}.ProseMirror .tableWrapper{margin:1.5rem 0;overflow-x:auto}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}.ProseMirror img{max-width:100%}.ProseMirror .mention{color:#c02537;padding:0 .3em}.animation-indent--right{animation:indent-right .5s cubic-bezier(.68,-.55,.27,1.55) 1 alternate-reverse}@keyframes indent-right{0%{transform:translate(0)}to{transform:translate(12px)}}
|
|
@@ -15,6 +15,10 @@ export declare const richTextEditorProps: {
|
|
|
15
15
|
onMentionTriggered: {
|
|
16
16
|
type: FunctionConstructor;
|
|
17
17
|
};
|
|
18
|
+
editable: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
18
22
|
};
|
|
19
23
|
export type RichTextEditorProps = ExtractPropTypes<typeof richTextEditorProps> & {
|
|
20
24
|
onMentionTriggered?: () => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
|
-
export declare function useExtensions({ props, emit }: any): (Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-text-style").TextStyleOptions, any> | Extension<import("@tiptap/extension-text-style").ColorOptions, any> | Extension<import("tiptap-markdown").MarkdownOptions, import("tiptap-markdown").MarkdownStorage> | Extension<any, any> | import("@tiptap/core").Node<import("@tiptap/extension-image").ImageOptions, any> | Extension<import("@tiptap/extension-table").TableKitOptions, any> | Extension<import("@tiptap/extensions").PlaceholderOptions, any> | Extension<import("@tiptap/extension-list").ListKitOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-mention").MentionOptions<any, import("@tiptap/extension-mention").MentionNodeAttrs>, any>)[];
|
|
2
|
+
export declare function useExtensions({ props, emit }: any): (import("@tiptap/core").Node<any, any> | Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-text-style").TextStyleOptions, any> | Extension<import("@tiptap/extension-text-style").ColorOptions, any> | Extension<import("tiptap-markdown").MarkdownOptions, import("tiptap-markdown").MarkdownStorage> | Extension<any, any> | import("@tiptap/core").Node<import("@tiptap/extension-image").ImageOptions, any> | Extension<import("@tiptap/extension-table").TableKitOptions, any> | Extension<import("@tiptap/extensions").PlaceholderOptions, any> | Extension<import("@tiptap/extension-list").ListKitOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-mention").MentionOptions<any, import("@tiptap/extension-mention").MentionNodeAttrs>, any>)[];
|
|
@@ -40,10 +40,12 @@ var import_extension_color = require("@tiptap/extension-color");
|
|
|
40
40
|
var import_tiptap_markdown = require("tiptap-markdown");
|
|
41
41
|
var import_core = require("@tiptap/core");
|
|
42
42
|
var import_core2 = require("@tiptap/core");
|
|
43
|
+
var import_HtmlBlock = __toESM(require("./extensions/HtmlBlock"));
|
|
43
44
|
var import_extensions = require("@tiptap/extensions");
|
|
44
45
|
function useExtensions({ props, emit }) {
|
|
45
46
|
const extensions = [
|
|
46
47
|
import_starter_kit.default,
|
|
48
|
+
import_HtmlBlock.default,
|
|
47
49
|
// TextStyle 是 Color 的依赖,必须添加
|
|
48
50
|
import_extension_text_style.TextStyle.configure({
|
|
49
51
|
// 如果你还想支持其他 style 属性,可以在这里配置
|