@cgboiler/biz-basic 1.0.39 → 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.38";
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.38";
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
@@ -166,6 +166,21 @@ var stdin_default = defineComponent({
166
166
  return;
167
167
  }
168
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
+ };
169
184
  const HISTORY_METADATA_KEY = "rich_text_editor_history_metadata";
170
185
  const MAX_HISTORY_ITEMS = 10;
171
186
  let saveTimeoutId = null;
@@ -218,6 +233,7 @@ var stdin_default = defineComponent({
218
233
  if (editorElement) {
219
234
  editorElement.addEventListener("click", imageClickHandler);
220
235
  editorElement.addEventListener("click", hashTagClickHandler);
236
+ editorElement.addEventListener("click", mentionClickHandler);
221
237
  }
222
238
  });
223
239
  });
@@ -230,6 +246,7 @@ var stdin_default = defineComponent({
230
246
  if (editorElement) {
231
247
  editorElement.removeEventListener("click", imageClickHandler);
232
248
  editorElement.removeEventListener("click", hashTagClickHandler);
249
+ editorElement.removeEventListener("click", mentionClickHandler);
233
250
  }
234
251
  (_c = editor.value) == null ? void 0 : _c.destroy();
235
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.38";
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.38";
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
@@ -198,6 +198,21 @@ var stdin_default = (0, import_vue2.defineComponent)({
198
198
  return;
199
199
  }
200
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
+ };
201
216
  const HISTORY_METADATA_KEY = "rich_text_editor_history_metadata";
202
217
  const MAX_HISTORY_ITEMS = 10;
203
218
  let saveTimeoutId = null;
@@ -250,6 +265,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
250
265
  if (editorElement) {
251
266
  editorElement.addEventListener("click", imageClickHandler);
252
267
  editorElement.addEventListener("click", hashTagClickHandler);
268
+ editorElement.addEventListener("click", mentionClickHandler);
253
269
  }
254
270
  });
255
271
  });
@@ -262,6 +278,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
262
278
  if (editorElement) {
263
279
  editorElement.removeEventListener("click", imageClickHandler);
264
280
  editorElement.removeEventListener("click", hashTagClickHandler);
281
+ editorElement.removeEventListener("click", mentionClickHandler);
265
282
  }
266
283
  (_c = editor.value) == null ? void 0 : _c.destroy();
267
284
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgboiler/biz-basic",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",