@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 CHANGED
@@ -5,6 +5,6 @@ declare namespace _default {
5
5
  }
6
6
  export default _default;
7
7
  export function install(app: any): void;
8
- export const version: "1.0.50";
8
+ export const version: "1.0.51";
9
9
  import RichTextEditor from './rich-text-editor';
10
10
  export { RichTextEditor };
package/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import RichTextEditor from "./rich-text-editor";
2
- const version = "1.0.50";
2
+ const version = "1.0.51";
3
3
  function install(app) {
4
4
  const components = [
5
5
  RichTextEditor
@@ -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 hashTag = tagEl.getAttribute("data-hash-tag") || "#";
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
- type: hashTag
181
+ trigger,
182
+ type: tagType
180
183
  });
181
184
  event.stopPropagation();
182
185
  event.preventDefault();
@@ -25,6 +25,7 @@ export interface MentionData {
25
25
  export interface HashTagData {
26
26
  hashTagId: string;
27
27
  name: string;
28
+ type?: string;
28
29
  }
29
30
  /**
30
31
  * CustomContentData
@@ -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
@@ -5,6 +5,6 @@ declare namespace _default {
5
5
  }
6
6
  export default _default;
7
7
  export function install(app: any): void;
8
- export const version: "1.0.50";
8
+ export const version: "1.0.51";
9
9
  import RichTextEditor from './rich-text-editor';
10
10
  export { RichTextEditor };
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.50";
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 hashTag = tagEl.getAttribute("data-hash-tag") || "#";
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
- type: hashTag
213
+ trigger,
214
+ type: tagType
212
215
  });
213
216
  event.stopPropagation();
214
217
  event.preventDefault();
@@ -25,6 +25,7 @@ export interface MentionData {
25
25
  export interface HashTagData {
26
26
  hashTagId: string;
27
27
  name: string;
28
+ type?: string;
28
29
  }
29
30
  /**
30
31
  * CustomContentData
@@ -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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgboiler/biz-basic",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",