@cgboiler/biz-basic 1.0.30 → 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/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/rich-text-editor/RichTextEditor.d.ts +4 -1
- package/es/rich-text-editor/RichTextEditor.js +12 -2
- package/es/rich-text-editor/index.css +1 -1
- package/es/rich-text-editor/index.less +243 -243
- package/es/rich-text-editor/types.d.ts +4 -0
- package/es/rich-text-editor/useExtensions.d.ts +1 -1
- package/es/rich-text-editor/useExtensions.js +50 -1
- package/es/vue-sfc-shim.d.ts +6 -6
- package/es/vue-tsx-shim.d.ts +24 -24
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/rich-text-editor/RichTextEditor.d.ts +4 -1
- package/lib/rich-text-editor/RichTextEditor.js +12 -2
- package/lib/rich-text-editor/index.css +1 -1
- package/lib/rich-text-editor/index.less +243 -243
- package/lib/rich-text-editor/types.d.ts +4 -0
- package/lib/rich-text-editor/useExtensions.d.ts +1 -1
- package/lib/rich-text-editor/useExtensions.js +50 -1
- package/lib/vue-sfc-shim.d.ts +6 -6
- package/lib/vue-tsx-shim.d.ts +24 -24
- package/package.json +1 -1
|
@@ -42,6 +42,53 @@ var import_core = require("@tiptap/core");
|
|
|
42
42
|
var import_HtmlBlock = __toESM(require("./extensions/HtmlBlock"));
|
|
43
43
|
var import_extensions = require("@tiptap/extensions");
|
|
44
44
|
function useExtensions({ props, emit }) {
|
|
45
|
+
const HashTag = import_extension_mention.default.extend({
|
|
46
|
+
/**
|
|
47
|
+
* 类级说明:重命名节点为 'hashTag',使其与 '@' 的 'mention' 节点并存。
|
|
48
|
+
*/
|
|
49
|
+
name: "hashTag"
|
|
50
|
+
}).configure({
|
|
51
|
+
HTMLAttributes: {
|
|
52
|
+
class: "hash-tag"
|
|
53
|
+
},
|
|
54
|
+
deleteTriggerWithBackspace: true,
|
|
55
|
+
suggestion: {
|
|
56
|
+
char: "#",
|
|
57
|
+
allowedPrefixes: null,
|
|
58
|
+
render() {
|
|
59
|
+
let activeRange = null;
|
|
60
|
+
let activeEditor = null;
|
|
61
|
+
return {
|
|
62
|
+
onStart({ editor, range, command, query }) {
|
|
63
|
+
activeRange = range;
|
|
64
|
+
activeEditor = editor;
|
|
65
|
+
emit("hashTag-triggered", (data) => {
|
|
66
|
+
try {
|
|
67
|
+
(activeEditor || editor).chain().focus().deleteRange(activeRange || range).insertContentAt((activeRange || range).from, {
|
|
68
|
+
type: "hashTag",
|
|
69
|
+
attrs: { id: data.hashTagId, label: data.name }
|
|
70
|
+
}).setTextSelection((activeRange || range).from + 1).insertContent(" ").run();
|
|
71
|
+
} catch (e) {
|
|
72
|
+
command({ id: data.hashTagId, label: data.name });
|
|
73
|
+
(activeEditor || editor).chain().focus().insertContent(" ").run();
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
emit("hashTag-input", query != null ? query : "");
|
|
77
|
+
},
|
|
78
|
+
onUpdate({ query, range, editor }) {
|
|
79
|
+
activeRange = range || activeRange;
|
|
80
|
+
activeEditor = editor || activeEditor;
|
|
81
|
+
emit("hashTag-input", query != null ? query : "");
|
|
82
|
+
},
|
|
83
|
+
onExit() {
|
|
84
|
+
activeRange = null;
|
|
85
|
+
activeEditor = null;
|
|
86
|
+
emit("hashTag-exit");
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
45
92
|
const extensions = [
|
|
46
93
|
import_starter_kit.default,
|
|
47
94
|
import_HtmlBlock.default,
|
|
@@ -186,7 +233,9 @@ function useExtensions({ props, emit }) {
|
|
|
186
233
|
};
|
|
187
234
|
}
|
|
188
235
|
}
|
|
189
|
-
})
|
|
236
|
+
}),
|
|
237
|
+
// HashTag 扩展:支持 # 触发、实时输入同步、完成后插入为 “#+文字”
|
|
238
|
+
HashTag
|
|
190
239
|
];
|
|
191
240
|
return extensions;
|
|
192
241
|
}
|
package/lib/vue-sfc-shim.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare module '*.vue' {
|
|
2
|
-
// eslint-disable-next-line
|
|
3
|
-
import { DefineComponent } from 'vue'
|
|
4
|
-
const Component: DefineComponent
|
|
5
|
-
export default Component
|
|
6
|
-
}
|
|
1
|
+
declare module '*.vue' {
|
|
2
|
+
// eslint-disable-next-line
|
|
3
|
+
import { DefineComponent } from 'vue'
|
|
4
|
+
const Component: DefineComponent
|
|
5
|
+
export default Component
|
|
6
|
+
}
|
package/lib/vue-tsx-shim.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import 'vue';
|
|
2
|
-
|
|
3
|
-
type EventHandler = (...args: any[]) => void;
|
|
4
|
-
|
|
5
|
-
declare module 'vue' {
|
|
6
|
-
interface ComponentCustomProps {
|
|
7
|
-
id?: string;
|
|
8
|
-
role?: string;
|
|
9
|
-
tabindex?: number;
|
|
10
|
-
onClick?: EventHandler;
|
|
11
|
-
onTouchend?: EventHandler;
|
|
12
|
-
onTouchmove?: EventHandler;
|
|
13
|
-
onTouchstart?: EventHandler;
|
|
14
|
-
onTouchcancel?: EventHandler;
|
|
15
|
-
onTouchmovePassive?: EventHandler;
|
|
16
|
-
onTouchstartPassive?: EventHandler;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface HTMLAttributes {
|
|
20
|
-
onTouchmovePassive?: EventHandler;
|
|
21
|
-
onTouchstartPassive?: EventHandler;
|
|
22
|
-
onClickCapture?: EventHandler;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
import 'vue';
|
|
2
|
+
|
|
3
|
+
type EventHandler = (...args: any[]) => void;
|
|
4
|
+
|
|
5
|
+
declare module 'vue' {
|
|
6
|
+
interface ComponentCustomProps {
|
|
7
|
+
id?: string;
|
|
8
|
+
role?: string;
|
|
9
|
+
tabindex?: number;
|
|
10
|
+
onClick?: EventHandler;
|
|
11
|
+
onTouchend?: EventHandler;
|
|
12
|
+
onTouchmove?: EventHandler;
|
|
13
|
+
onTouchstart?: EventHandler;
|
|
14
|
+
onTouchcancel?: EventHandler;
|
|
15
|
+
onTouchmovePassive?: EventHandler;
|
|
16
|
+
onTouchstartPassive?: EventHandler;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface HTMLAttributes {
|
|
20
|
+
onTouchmovePassive?: EventHandler;
|
|
21
|
+
onTouchstartPassive?: EventHandler;
|
|
22
|
+
onClickCapture?: EventHandler;
|
|
23
|
+
}
|
|
24
|
+
}
|