@cgboiler/biz-basic 1.0.25 → 1.0.26
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/useExtensions.d.ts +1 -1
- package/es/rich-text-editor/useExtensions.js +44 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/rich-text-editor/useExtensions.d.ts +1 -1
- package/lib/rich-text-editor/useExtensions.js +44 -2
- package/package.json +1 -1
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
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> |
|
|
2
|
+
export declare function useExtensions({ props, emit }: any): (import("@tiptap/core").Node<any, any> | Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | Extension<any, 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> | 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>)[];
|
|
@@ -6,14 +6,56 @@ import Mention from "@tiptap/extension-mention";
|
|
|
6
6
|
import { TextStyle } from "@tiptap/extension-text-style";
|
|
7
7
|
import { Color } from "@tiptap/extension-color";
|
|
8
8
|
import { Markdown } from "tiptap-markdown";
|
|
9
|
-
import { Extension } from "@tiptap/core";
|
|
10
|
-
import { InputRule } from "@tiptap/core";
|
|
9
|
+
import { Extension, InputRule } from "@tiptap/core";
|
|
11
10
|
import HtmlBlock from "./extensions/HtmlBlock";
|
|
12
11
|
import { Placeholder } from "@tiptap/extensions";
|
|
13
12
|
function useExtensions({ props, emit }) {
|
|
14
13
|
const extensions = [
|
|
15
14
|
StarterKit,
|
|
16
15
|
HtmlBlock,
|
|
16
|
+
// Video input rule extension for !video(url) syntax
|
|
17
|
+
Extension.create({
|
|
18
|
+
name: "videoInputRule",
|
|
19
|
+
addInputRules() {
|
|
20
|
+
return [
|
|
21
|
+
new InputRule({
|
|
22
|
+
find: /!video\(([^)]+)\)\s/,
|
|
23
|
+
handler: ({ state, range, match, commands }) => {
|
|
24
|
+
const [, url] = match;
|
|
25
|
+
if (url) {
|
|
26
|
+
const html = `<video src="${url}" autoplay="" loop="" muted="" controls="" playsinline=""></video>`;
|
|
27
|
+
commands.deleteRange(range);
|
|
28
|
+
commands.insertContent({
|
|
29
|
+
type: "htmlBlock",
|
|
30
|
+
attrs: { html }
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
}),
|
|
38
|
+
Extension.create({
|
|
39
|
+
name: "audioInputRule",
|
|
40
|
+
addInputRules() {
|
|
41
|
+
return [
|
|
42
|
+
new InputRule({
|
|
43
|
+
find: /!audio\(([^)]+)\)\s/,
|
|
44
|
+
handler: ({ state, range, match, commands }) => {
|
|
45
|
+
const [, url] = match;
|
|
46
|
+
if (url) {
|
|
47
|
+
const html = `<audio src="${url}" controls="" playsinline=""></audio>`;
|
|
48
|
+
commands.deleteRange(range);
|
|
49
|
+
commands.insertContent({
|
|
50
|
+
type: "htmlBlock",
|
|
51
|
+
attrs: { html }
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
}),
|
|
17
59
|
// TextStyle 是 Color 的依赖,必须添加
|
|
18
60
|
TextStyle.configure({
|
|
19
61
|
// 如果你还想支持其他 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.25";
|
|
40
40
|
function install(app) {
|
|
41
41
|
const components = [
|
|
42
42
|
import_rich_text_editor.default
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
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> |
|
|
2
|
+
export declare function useExtensions({ props, emit }: any): (import("@tiptap/core").Node<any, any> | Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | Extension<any, 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> | 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>)[];
|
|
@@ -39,13 +39,55 @@ var import_extension_text_style = require("@tiptap/extension-text-style");
|
|
|
39
39
|
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
|
-
var import_core2 = require("@tiptap/core");
|
|
43
42
|
var import_HtmlBlock = __toESM(require("./extensions/HtmlBlock"));
|
|
44
43
|
var import_extensions = require("@tiptap/extensions");
|
|
45
44
|
function useExtensions({ props, emit }) {
|
|
46
45
|
const extensions = [
|
|
47
46
|
import_starter_kit.default,
|
|
48
47
|
import_HtmlBlock.default,
|
|
48
|
+
// Video input rule extension for !video(url) syntax
|
|
49
|
+
import_core.Extension.create({
|
|
50
|
+
name: "videoInputRule",
|
|
51
|
+
addInputRules() {
|
|
52
|
+
return [
|
|
53
|
+
new import_core.InputRule({
|
|
54
|
+
find: /!video\(([^)]+)\)\s/,
|
|
55
|
+
handler: ({ state, range, match, commands }) => {
|
|
56
|
+
const [, url] = match;
|
|
57
|
+
if (url) {
|
|
58
|
+
const html = `<video src="${url}" autoplay="" loop="" muted="" controls="" playsinline=""></video>`;
|
|
59
|
+
commands.deleteRange(range);
|
|
60
|
+
commands.insertContent({
|
|
61
|
+
type: "htmlBlock",
|
|
62
|
+
attrs: { html }
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
}),
|
|
70
|
+
import_core.Extension.create({
|
|
71
|
+
name: "audioInputRule",
|
|
72
|
+
addInputRules() {
|
|
73
|
+
return [
|
|
74
|
+
new import_core.InputRule({
|
|
75
|
+
find: /!audio\(([^)]+)\)\s/,
|
|
76
|
+
handler: ({ state, range, match, commands }) => {
|
|
77
|
+
const [, url] = match;
|
|
78
|
+
if (url) {
|
|
79
|
+
const html = `<audio src="${url}" controls="" playsinline=""></audio>`;
|
|
80
|
+
commands.deleteRange(range);
|
|
81
|
+
commands.insertContent({
|
|
82
|
+
type: "htmlBlock",
|
|
83
|
+
attrs: { html }
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
}),
|
|
49
91
|
// TextStyle 是 Color 的依赖,必须添加
|
|
50
92
|
import_extension_text_style.TextStyle.configure({
|
|
51
93
|
// 如果你还想支持其他 style 属性,可以在这里配置
|
|
@@ -69,7 +111,7 @@ function useExtensions({ props, emit }) {
|
|
|
69
111
|
name: "markdownLinkInputRule",
|
|
70
112
|
addInputRules() {
|
|
71
113
|
return [
|
|
72
|
-
new
|
|
114
|
+
new import_core.InputRule({
|
|
73
115
|
find: /\[([^\]]+)\]\(([^\)]+)\)\s/,
|
|
74
116
|
handler: ({ state, range, match, commands }) => {
|
|
75
117
|
const [, text, href] = match;
|