@cgboiler/biz-basic 1.0.51 → 1.0.52
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.js +6 -3
- package/es/rich-text-editor/types.d.ts +1 -0
- package/es/rich-text-editor/useExtensions.js +36 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/rich-text-editor/RichTextEditor.js +6 -3
- package/lib/rich-text-editor/types.d.ts +1 -0
- package/lib/rich-text-editor/useExtensions.js +36 -3
- package/package.json +1 -1
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -95,7 +95,8 @@ var stdin_default = defineComponent({
|
|
|
95
95
|
type: "hashTag",
|
|
96
96
|
attrs: {
|
|
97
97
|
id: data.hashTagId,
|
|
98
|
-
label: data.name
|
|
98
|
+
label: data.name,
|
|
99
|
+
type: data.type
|
|
99
100
|
}
|
|
100
101
|
});
|
|
101
102
|
};
|
|
@@ -172,11 +173,13 @@ var stdin_default = defineComponent({
|
|
|
172
173
|
if (tagEl) {
|
|
173
174
|
const id = tagEl.getAttribute("data-id") || "";
|
|
174
175
|
const label = tagEl.getAttribute("data-label") || tagEl.textContent || "";
|
|
175
|
-
const
|
|
176
|
+
const trigger = tagEl.getAttribute("data-hash-tag") || "#";
|
|
177
|
+
const tagType = tagEl.getAttribute("data-tag-type") || "";
|
|
176
178
|
emit("hashTag-clicked", {
|
|
177
179
|
hashTagId: id,
|
|
178
180
|
name: label,
|
|
179
|
-
|
|
181
|
+
trigger,
|
|
182
|
+
type: tagType
|
|
180
183
|
});
|
|
181
184
|
event.stopPropagation();
|
|
182
185
|
event.preventDefault();
|
|
@@ -59,10 +59,42 @@ function useExtensions({ props, emit }) {
|
|
|
59
59
|
parseHTML() {
|
|
60
60
|
return [{ tag: 'span[data-type="hashTag"]' }];
|
|
61
61
|
},
|
|
62
|
+
addAttributes() {
|
|
63
|
+
return {
|
|
64
|
+
id: {
|
|
65
|
+
default: null,
|
|
66
|
+
parseHTML: (element) => element.getAttribute("data-id"),
|
|
67
|
+
renderHTML: (attributes) => {
|
|
68
|
+
if (!attributes.id)
|
|
69
|
+
return {};
|
|
70
|
+
return { "data-id": attributes.id };
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
label: {
|
|
74
|
+
default: null,
|
|
75
|
+
parseHTML: (element) => element.getAttribute("data-label"),
|
|
76
|
+
renderHTML: (attributes) => {
|
|
77
|
+
if (!attributes.label)
|
|
78
|
+
return {};
|
|
79
|
+
return { "data-label": attributes.label };
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
type: {
|
|
83
|
+
default: null,
|
|
84
|
+
parseHTML: (element) => element.getAttribute("data-tag-type"),
|
|
85
|
+
renderHTML: (attributes) => {
|
|
86
|
+
if (!attributes.type)
|
|
87
|
+
return {};
|
|
88
|
+
return { "data-tag-type": attributes.type };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
},
|
|
62
93
|
renderHTML({ node }) {
|
|
63
|
-
var _a, _b, _c, _d;
|
|
94
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64
95
|
const id = (_b = (_a = node == null ? void 0 : node.attrs) == null ? void 0 : _a.id) != null ? _b : "";
|
|
65
96
|
const label = (_d = (_c = node == null ? void 0 : node.attrs) == null ? void 0 : _c.label) != null ? _d : "";
|
|
97
|
+
const type = (_f = (_e = node == null ? void 0 : node.attrs) == null ? void 0 : _e.type) != null ? _f : "";
|
|
66
98
|
return [
|
|
67
99
|
"span",
|
|
68
100
|
{
|
|
@@ -70,6 +102,7 @@ function useExtensions({ props, emit }) {
|
|
|
70
102
|
"data-type": "hashTag",
|
|
71
103
|
"data-id": id,
|
|
72
104
|
"data-label": label,
|
|
105
|
+
"data-tag-type": type,
|
|
73
106
|
"data-hash-tag": "#",
|
|
74
107
|
contenteditable: "false"
|
|
75
108
|
},
|
|
@@ -102,10 +135,10 @@ function useExtensions({ props, emit }) {
|
|
|
102
135
|
try {
|
|
103
136
|
(activeEditor || editor).chain().focus().deleteRange(activeRange || range).insertContentAt((activeRange || range).from, {
|
|
104
137
|
type: "hashTag",
|
|
105
|
-
attrs: { id: data.hashTagId, label: data.name }
|
|
138
|
+
attrs: { id: data.hashTagId, label: data.name, type: data.type }
|
|
106
139
|
}).setTextSelection((activeRange || range).from + 1).insertContent(" ").run();
|
|
107
140
|
} catch (e) {
|
|
108
|
-
command({ id: data.hashTagId, label: data.name });
|
|
141
|
+
command({ id: data.hashTagId, label: data.name, type: data.type });
|
|
109
142
|
(activeEditor || editor).chain().focus().insertContent(" ").run();
|
|
110
143
|
}
|
|
111
144
|
});
|
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.51";
|
|
40
40
|
function install(app) {
|
|
41
41
|
const components = [
|
|
42
42
|
import_rich_text_editor.default
|
|
@@ -127,7 +127,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
127
127
|
type: "hashTag",
|
|
128
128
|
attrs: {
|
|
129
129
|
id: data.hashTagId,
|
|
130
|
-
label: data.name
|
|
130
|
+
label: data.name,
|
|
131
|
+
type: data.type
|
|
131
132
|
}
|
|
132
133
|
});
|
|
133
134
|
};
|
|
@@ -204,11 +205,13 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
204
205
|
if (tagEl) {
|
|
205
206
|
const id = tagEl.getAttribute("data-id") || "";
|
|
206
207
|
const label = tagEl.getAttribute("data-label") || tagEl.textContent || "";
|
|
207
|
-
const
|
|
208
|
+
const trigger = tagEl.getAttribute("data-hash-tag") || "#";
|
|
209
|
+
const tagType = tagEl.getAttribute("data-tag-type") || "";
|
|
208
210
|
emit("hashTag-clicked", {
|
|
209
211
|
hashTagId: id,
|
|
210
212
|
name: label,
|
|
211
|
-
|
|
213
|
+
trigger,
|
|
214
|
+
type: tagType
|
|
212
215
|
});
|
|
213
216
|
event.stopPropagation();
|
|
214
217
|
event.preventDefault();
|
|
@@ -91,10 +91,42 @@ function useExtensions({ props, emit }) {
|
|
|
91
91
|
parseHTML() {
|
|
92
92
|
return [{ tag: 'span[data-type="hashTag"]' }];
|
|
93
93
|
},
|
|
94
|
+
addAttributes() {
|
|
95
|
+
return {
|
|
96
|
+
id: {
|
|
97
|
+
default: null,
|
|
98
|
+
parseHTML: (element) => element.getAttribute("data-id"),
|
|
99
|
+
renderHTML: (attributes) => {
|
|
100
|
+
if (!attributes.id)
|
|
101
|
+
return {};
|
|
102
|
+
return { "data-id": attributes.id };
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
label: {
|
|
106
|
+
default: null,
|
|
107
|
+
parseHTML: (element) => element.getAttribute("data-label"),
|
|
108
|
+
renderHTML: (attributes) => {
|
|
109
|
+
if (!attributes.label)
|
|
110
|
+
return {};
|
|
111
|
+
return { "data-label": attributes.label };
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
type: {
|
|
115
|
+
default: null,
|
|
116
|
+
parseHTML: (element) => element.getAttribute("data-tag-type"),
|
|
117
|
+
renderHTML: (attributes) => {
|
|
118
|
+
if (!attributes.type)
|
|
119
|
+
return {};
|
|
120
|
+
return { "data-tag-type": attributes.type };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
},
|
|
94
125
|
renderHTML({ node }) {
|
|
95
|
-
var _a, _b, _c, _d;
|
|
126
|
+
var _a, _b, _c, _d, _e, _f;
|
|
96
127
|
const id = (_b = (_a = node == null ? void 0 : node.attrs) == null ? void 0 : _a.id) != null ? _b : "";
|
|
97
128
|
const label = (_d = (_c = node == null ? void 0 : node.attrs) == null ? void 0 : _c.label) != null ? _d : "";
|
|
129
|
+
const type = (_f = (_e = node == null ? void 0 : node.attrs) == null ? void 0 : _e.type) != null ? _f : "";
|
|
98
130
|
return [
|
|
99
131
|
"span",
|
|
100
132
|
{
|
|
@@ -102,6 +134,7 @@ function useExtensions({ props, emit }) {
|
|
|
102
134
|
"data-type": "hashTag",
|
|
103
135
|
"data-id": id,
|
|
104
136
|
"data-label": label,
|
|
137
|
+
"data-tag-type": type,
|
|
105
138
|
"data-hash-tag": "#",
|
|
106
139
|
contenteditable: "false"
|
|
107
140
|
},
|
|
@@ -134,10 +167,10 @@ function useExtensions({ props, emit }) {
|
|
|
134
167
|
try {
|
|
135
168
|
(activeEditor || editor).chain().focus().deleteRange(activeRange || range).insertContentAt((activeRange || range).from, {
|
|
136
169
|
type: "hashTag",
|
|
137
|
-
attrs: { id: data.hashTagId, label: data.name }
|
|
170
|
+
attrs: { id: data.hashTagId, label: data.name, type: data.type }
|
|
138
171
|
}).setTextSelection((activeRange || range).from + 1).insertContent(" ").run();
|
|
139
172
|
} catch (e) {
|
|
140
|
-
command({ id: data.hashTagId, label: data.name });
|
|
173
|
+
command({ id: data.hashTagId, label: data.name, type: data.type });
|
|
141
174
|
(activeEditor || editor).chain().focus().insertContent(" ").run();
|
|
142
175
|
}
|
|
143
176
|
});
|