@cgboiler/biz-basic 1.0.13 → 1.0.14
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 +1 -1
- package/es/rich-text-editor/index.css +1 -1
- package/es/rich-text-editor/index.less +14 -0
- package/es/rich-text-editor/useExtensions.d.ts +2 -1
- package/es/rich-text-editor/useExtensions.js +40 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/rich-text-editor/RichTextEditor.d.ts +1 -1
- package/lib/rich-text-editor/index.css +1 -1
- package/lib/rich-text-editor/index.less +14 -0
- package/lib/rich-text-editor/useExtensions.d.ts +2 -1
- package/lib/rich-text-editor/useExtensions.js +40 -0
- package/package.json +4 -2
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -11,7 +11,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
11
11
|
onMentionTriggered: {
|
|
12
12
|
type: FunctionConstructor;
|
|
13
13
|
};
|
|
14
|
-
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
14
|
+
}>, () => 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
15
|
modelValue: {
|
|
16
16
|
type: StringConstructor;
|
|
17
17
|
default: string;
|
|
@@ -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 code{background-color:#ffe5e8;border-radius:.4rem;color:var(--black);font-size:.85rem;padding:.25em .3em}.ProseMirror pre{background:var(--black);border-radius:.5rem;color:var(--white);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)}}
|
|
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{background:var(--black);border-radius:.5rem;color:var(--white);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)}}
|
|
@@ -88,6 +88,20 @@
|
|
|
88
88
|
font-size: 1rem;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/* Link styles */
|
|
92
|
+
a,
|
|
93
|
+
.editor-link {
|
|
94
|
+
color: var(--purple);
|
|
95
|
+
text-decoration: underline;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
transition: color 0.2s ease;
|
|
98
|
+
|
|
99
|
+
&:hover {
|
|
100
|
+
color: var(--purple-contrast);
|
|
101
|
+
text-decoration: underline;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
91
105
|
/* Code and preformatted text styles */
|
|
92
106
|
code {
|
|
93
107
|
background-color: #ffe5e8;
|
|
@@ -1 +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>)[];
|
|
@@ -5,6 +5,9 @@ import Image from "@tiptap/extension-image";
|
|
|
5
5
|
import Mention from "@tiptap/extension-mention";
|
|
6
6
|
import { TextStyle } from "@tiptap/extension-text-style";
|
|
7
7
|
import { Color } from "@tiptap/extension-color";
|
|
8
|
+
import { Markdown } from "tiptap-markdown";
|
|
9
|
+
import { Extension } from "@tiptap/core";
|
|
10
|
+
import { InputRule } from "@tiptap/core";
|
|
8
11
|
import { Placeholder } from "@tiptap/extensions";
|
|
9
12
|
function useExtensions({ props, emit }) {
|
|
10
13
|
const extensions = [
|
|
@@ -17,6 +20,43 @@ function useExtensions({ props, emit }) {
|
|
|
17
20
|
Color.configure({
|
|
18
21
|
// types: ['textStyle'] 默认就是这个,一般不需要改
|
|
19
22
|
}),
|
|
23
|
+
Markdown.configure({
|
|
24
|
+
html: true,
|
|
25
|
+
tightLists: true,
|
|
26
|
+
tightListClass: "tight",
|
|
27
|
+
bulletListMarker: "-",
|
|
28
|
+
linkify: true,
|
|
29
|
+
breaks: false,
|
|
30
|
+
transformPastedText: true,
|
|
31
|
+
transformCopiedText: true
|
|
32
|
+
}),
|
|
33
|
+
// 自定义扩展来支持 Markdown 链接语法
|
|
34
|
+
Extension.create({
|
|
35
|
+
name: "markdownLinkInputRule",
|
|
36
|
+
addInputRules() {
|
|
37
|
+
return [
|
|
38
|
+
new InputRule({
|
|
39
|
+
find: /\[([^\]]+)\]\(([^\)]+)\)\s/,
|
|
40
|
+
handler: ({ state, range, match, commands }) => {
|
|
41
|
+
const [, text, href] = match;
|
|
42
|
+
const start = range.from;
|
|
43
|
+
const end = range.to;
|
|
44
|
+
commands.deleteRange({ from: start, to: end });
|
|
45
|
+
commands.insertContent({
|
|
46
|
+
type: "text",
|
|
47
|
+
text,
|
|
48
|
+
marks: [
|
|
49
|
+
{
|
|
50
|
+
type: "link",
|
|
51
|
+
attrs: { href }
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
}),
|
|
20
60
|
Image,
|
|
21
61
|
TableKit.configure({
|
|
22
62
|
table: { resizable: true }
|
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.13";
|
|
40
40
|
function install(app) {
|
|
41
41
|
const components = [
|
|
42
42
|
import_rich_text_editor.default
|
|
@@ -11,7 +11,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
11
11
|
onMentionTriggered: {
|
|
12
12
|
type: FunctionConstructor;
|
|
13
13
|
};
|
|
14
|
-
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
14
|
+
}>, () => 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
15
|
modelValue: {
|
|
16
16
|
type: StringConstructor;
|
|
17
17
|
default: string;
|
|
@@ -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 code{background-color:#ffe5e8;border-radius:.4rem;color:var(--black);font-size:.85rem;padding:.25em .3em}.ProseMirror pre{background:var(--black);border-radius:.5rem;color:var(--white);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)}}
|
|
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{background:var(--black);border-radius:.5rem;color:var(--white);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)}}
|
|
@@ -88,6 +88,20 @@
|
|
|
88
88
|
font-size: 1rem;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/* Link styles */
|
|
92
|
+
a,
|
|
93
|
+
.editor-link {
|
|
94
|
+
color: var(--purple);
|
|
95
|
+
text-decoration: underline;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
transition: color 0.2s ease;
|
|
98
|
+
|
|
99
|
+
&:hover {
|
|
100
|
+
color: var(--purple-contrast);
|
|
101
|
+
text-decoration: underline;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
91
105
|
/* Code and preformatted text styles */
|
|
92
106
|
code {
|
|
93
107
|
background-color: #ffe5e8;
|
|
@@ -1 +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>)[];
|
|
@@ -37,6 +37,9 @@ var import_extension_image = __toESM(require("@tiptap/extension-image"));
|
|
|
37
37
|
var import_extension_mention = __toESM(require("@tiptap/extension-mention"));
|
|
38
38
|
var import_extension_text_style = require("@tiptap/extension-text-style");
|
|
39
39
|
var import_extension_color = require("@tiptap/extension-color");
|
|
40
|
+
var import_tiptap_markdown = require("tiptap-markdown");
|
|
41
|
+
var import_core = require("@tiptap/core");
|
|
42
|
+
var import_core2 = require("@tiptap/core");
|
|
40
43
|
var import_extensions = require("@tiptap/extensions");
|
|
41
44
|
function useExtensions({ props, emit }) {
|
|
42
45
|
const extensions = [
|
|
@@ -49,6 +52,43 @@ function useExtensions({ props, emit }) {
|
|
|
49
52
|
import_extension_color.Color.configure({
|
|
50
53
|
// types: ['textStyle'] 默认就是这个,一般不需要改
|
|
51
54
|
}),
|
|
55
|
+
import_tiptap_markdown.Markdown.configure({
|
|
56
|
+
html: true,
|
|
57
|
+
tightLists: true,
|
|
58
|
+
tightListClass: "tight",
|
|
59
|
+
bulletListMarker: "-",
|
|
60
|
+
linkify: true,
|
|
61
|
+
breaks: false,
|
|
62
|
+
transformPastedText: true,
|
|
63
|
+
transformCopiedText: true
|
|
64
|
+
}),
|
|
65
|
+
// 自定义扩展来支持 Markdown 链接语法
|
|
66
|
+
import_core.Extension.create({
|
|
67
|
+
name: "markdownLinkInputRule",
|
|
68
|
+
addInputRules() {
|
|
69
|
+
return [
|
|
70
|
+
new import_core2.InputRule({
|
|
71
|
+
find: /\[([^\]]+)\]\(([^\)]+)\)\s/,
|
|
72
|
+
handler: ({ state, range, match, commands }) => {
|
|
73
|
+
const [, text, href] = match;
|
|
74
|
+
const start = range.from;
|
|
75
|
+
const end = range.to;
|
|
76
|
+
commands.deleteRange({ from: start, to: end });
|
|
77
|
+
commands.insertContent({
|
|
78
|
+
type: "text",
|
|
79
|
+
text,
|
|
80
|
+
marks: [
|
|
81
|
+
{
|
|
82
|
+
type: "link",
|
|
83
|
+
attrs: { href }
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
52
92
|
import_extension_image.default,
|
|
53
93
|
import_extension_table.TableKit.configure({
|
|
54
94
|
table: { resizable: true }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cgboiler/biz-basic",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@tiptap/extension-collaboration": "3.3.0",
|
|
43
43
|
"@tiptap/extension-color": "^3.3.0",
|
|
44
44
|
"@tiptap/extension-image": "^3.0.7",
|
|
45
|
+
"@tiptap/extension-link": "^3.3.0",
|
|
45
46
|
"@tiptap/extension-list": "^3.0.7",
|
|
46
47
|
"@tiptap/extension-mention": "^3.0.7",
|
|
47
48
|
"@tiptap/extension-table": "3.3.0",
|
|
@@ -49,7 +50,8 @@
|
|
|
49
50
|
"@tiptap/extensions": "3.3.0",
|
|
50
51
|
"@tiptap/pm": "3.3.0",
|
|
51
52
|
"@tiptap/starter-kit": "3.3.0",
|
|
52
|
-
"@tiptap/vue-3": "3.3.0"
|
|
53
|
+
"@tiptap/vue-3": "3.3.0",
|
|
54
|
+
"tiptap-markdown": "^0.8.10"
|
|
53
55
|
},
|
|
54
56
|
"browserslist": [
|
|
55
57
|
"Chrome >= 51",
|