@cgboiler/biz-basic 1.0.38 → 1.0.40

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.37";
8
+ export const version: "1.0.39";
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.37";
2
+ const version = "1.0.39";
3
3
  function install(app) {
4
4
  const components = [
5
5
  RichTextEditor
@@ -16,7 +16,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
16
16
  type: BooleanConstructor;
17
17
  default: boolean;
18
18
  };
19
- }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "focus" | "hashTag-triggered" | "hashTag-input" | "hashTag-exit" | "mention-triggered" | "update:modelValue" | "hashTag-clicked")[], "blur" | "focus" | "hashTag-triggered" | "hashTag-input" | "hashTag-exit" | "mention-triggered" | "update:modelValue" | "hashTag-clicked", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "focus" | "hashTag-triggered" | "hashTag-input" | "hashTag-exit" | "mention-triggered" | "update:modelValue" | "mention-clicked" | "hashTag-clicked")[], "blur" | "focus" | "hashTag-triggered" | "hashTag-input" | "hashTag-exit" | "mention-triggered" | "update:modelValue" | "mention-clicked" | "hashTag-clicked", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
20
20
  modelValue: {
21
21
  type: StringConstructor;
22
22
  default: string;
@@ -40,6 +40,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
40
40
  "onHashTag-exit"?: ((...args: any[]) => any) | undefined;
41
41
  "onMention-triggered"?: ((...args: any[]) => any) | undefined;
42
42
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
43
+ "onMention-clicked"?: ((...args: any[]) => any) | undefined;
43
44
  "onHashTag-clicked"?: ((...args: any[]) => any) | undefined;
44
45
  }>, {
45
46
  modelValue: string;
@@ -31,7 +31,7 @@ import "./index.css";
31
31
  var stdin_default = defineComponent({
32
32
  name: "RichTextEditor",
33
33
  props: richTextEditorProps,
34
- emits: ["update:modelValue", "mention-triggered", "hashTag-triggered", "hashTag-input", "hashTag-exit", "hashTag-clicked", "blur", "focus"],
34
+ emits: ["update:modelValue", "mention-triggered", "mention-clicked", "hashTag-triggered", "hashTag-input", "hashTag-exit", "hashTag-clicked", "blur", "focus"],
35
35
  setup(props, {
36
36
  emit,
37
37
  expose
@@ -99,14 +99,10 @@ var stdin_default = defineComponent({
99
99
  }
100
100
  });
101
101
  };
102
- const focus = () => {
103
- editor.value.commands.focus();
104
- };
105
102
  expose({
106
103
  getEditor: () => editor.value,
107
104
  insertMention,
108
- insertHashTag,
109
- focus
105
+ insertHashTag
110
106
  });
111
107
  watch(() => props.modelValue, (newValue) => {
112
108
  var _a, _b;
@@ -170,6 +166,21 @@ var stdin_default = defineComponent({
170
166
  return;
171
167
  }
172
168
  };
169
+ const mentionClickHandler = (event) => {
170
+ const target = event.target;
171
+ const tagEl = target.closest(".mention") || null;
172
+ if (tagEl) {
173
+ const id = tagEl.getAttribute("data-id") || "";
174
+ const label = tagEl.getAttribute("data-label") || tagEl.textContent || "";
175
+ emit("mention-clicked", {
176
+ userId: id,
177
+ name: label
178
+ });
179
+ event.stopPropagation();
180
+ event.preventDefault();
181
+ return;
182
+ }
183
+ };
173
184
  const HISTORY_METADATA_KEY = "rich_text_editor_history_metadata";
174
185
  const MAX_HISTORY_ITEMS = 10;
175
186
  let saveTimeoutId = null;
@@ -222,6 +233,7 @@ var stdin_default = defineComponent({
222
233
  if (editorElement) {
223
234
  editorElement.addEventListener("click", imageClickHandler);
224
235
  editorElement.addEventListener("click", hashTagClickHandler);
236
+ editorElement.addEventListener("click", mentionClickHandler);
225
237
  }
226
238
  });
227
239
  });
@@ -234,6 +246,7 @@ var stdin_default = defineComponent({
234
246
  if (editorElement) {
235
247
  editorElement.removeEventListener("click", imageClickHandler);
236
248
  editorElement.removeEventListener("click", hashTagClickHandler);
249
+ editorElement.removeEventListener("click", mentionClickHandler);
237
250
  }
238
251
  (_c = editor.value) == null ? void 0 : _c.destroy();
239
252
  });
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.37";
8
+ export const version: "1.0.39";
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.37";
39
+ const version = "1.0.39";
40
40
  function install(app) {
41
41
  const components = [
42
42
  import_rich_text_editor.default
@@ -16,7 +16,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
16
16
  type: BooleanConstructor;
17
17
  default: boolean;
18
18
  };
19
- }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "focus" | "hashTag-triggered" | "hashTag-input" | "hashTag-exit" | "mention-triggered" | "update:modelValue" | "hashTag-clicked")[], "blur" | "focus" | "hashTag-triggered" | "hashTag-input" | "hashTag-exit" | "mention-triggered" | "update:modelValue" | "hashTag-clicked", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "focus" | "hashTag-triggered" | "hashTag-input" | "hashTag-exit" | "mention-triggered" | "update:modelValue" | "mention-clicked" | "hashTag-clicked")[], "blur" | "focus" | "hashTag-triggered" | "hashTag-input" | "hashTag-exit" | "mention-triggered" | "update:modelValue" | "mention-clicked" | "hashTag-clicked", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
20
20
  modelValue: {
21
21
  type: StringConstructor;
22
22
  default: string;
@@ -40,6 +40,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
40
40
  "onHashTag-exit"?: ((...args: any[]) => any) | undefined;
41
41
  "onMention-triggered"?: ((...args: any[]) => any) | undefined;
42
42
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
43
+ "onMention-clicked"?: ((...args: any[]) => any) | undefined;
43
44
  "onHashTag-clicked"?: ((...args: any[]) => any) | undefined;
44
45
  }>, {
45
46
  modelValue: string;
@@ -63,7 +63,7 @@ var import_index = require("./index.css");
63
63
  var stdin_default = (0, import_vue2.defineComponent)({
64
64
  name: "RichTextEditor",
65
65
  props: import_types.richTextEditorProps,
66
- emits: ["update:modelValue", "mention-triggered", "hashTag-triggered", "hashTag-input", "hashTag-exit", "hashTag-clicked", "blur", "focus"],
66
+ emits: ["update:modelValue", "mention-triggered", "mention-clicked", "hashTag-triggered", "hashTag-input", "hashTag-exit", "hashTag-clicked", "blur", "focus"],
67
67
  setup(props, {
68
68
  emit,
69
69
  expose
@@ -131,14 +131,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
131
131
  }
132
132
  });
133
133
  };
134
- const focus = () => {
135
- editor.value.commands.focus();
136
- };
137
134
  expose({
138
135
  getEditor: () => editor.value,
139
136
  insertMention,
140
- insertHashTag,
141
- focus
137
+ insertHashTag
142
138
  });
143
139
  (0, import_vue2.watch)(() => props.modelValue, (newValue) => {
144
140
  var _a, _b;
@@ -202,6 +198,21 @@ var stdin_default = (0, import_vue2.defineComponent)({
202
198
  return;
203
199
  }
204
200
  };
201
+ const mentionClickHandler = (event) => {
202
+ const target = event.target;
203
+ const tagEl = target.closest(".mention") || null;
204
+ if (tagEl) {
205
+ const id = tagEl.getAttribute("data-id") || "";
206
+ const label = tagEl.getAttribute("data-label") || tagEl.textContent || "";
207
+ emit("mention-clicked", {
208
+ userId: id,
209
+ name: label
210
+ });
211
+ event.stopPropagation();
212
+ event.preventDefault();
213
+ return;
214
+ }
215
+ };
205
216
  const HISTORY_METADATA_KEY = "rich_text_editor_history_metadata";
206
217
  const MAX_HISTORY_ITEMS = 10;
207
218
  let saveTimeoutId = null;
@@ -254,6 +265,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
254
265
  if (editorElement) {
255
266
  editorElement.addEventListener("click", imageClickHandler);
256
267
  editorElement.addEventListener("click", hashTagClickHandler);
268
+ editorElement.addEventListener("click", mentionClickHandler);
257
269
  }
258
270
  });
259
271
  });
@@ -266,6 +278,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
266
278
  if (editorElement) {
267
279
  editorElement.removeEventListener("click", imageClickHandler);
268
280
  editorElement.removeEventListener("click", hashTagClickHandler);
281
+ editorElement.removeEventListener("click", mentionClickHandler);
269
282
  }
270
283
  (_c = editor.value) == null ? void 0 : _c.destroy();
271
284
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgboiler/biz-basic",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",