@cgboiler/biz-basic 1.0.3 → 1.0.4

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.2";
8
+ export const version: "1.0.3";
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.2";
2
+ const version = "1.0.3";
3
3
  function install(app) {
4
4
  const components = [
5
5
  RichTextEditor
@@ -27,7 +27,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
27
27
  "onMention-triggered"?: ((...args: any[]) => any) | undefined;
28
28
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
29
29
  }>, {
30
- placeholder: string;
31
30
  modelValue: string;
31
+ placeholder: string;
32
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
33
33
  export default _default;
@@ -10,7 +10,8 @@ var stdin_default = defineComponent({
10
10
  props: richTextEditorProps,
11
11
  emits: ["update:modelValue", "mention-triggered"],
12
12
  setup(props, {
13
- emit
13
+ emit,
14
+ expose
14
15
  }) {
15
16
  const editor = ref();
16
17
  const extensions = useExtensions({
@@ -33,6 +34,18 @@ var stdin_default = defineComponent({
33
34
  }
34
35
  });
35
36
  };
37
+ const insertMention = (data) => {
38
+ editor.value.commands.insertContent({
39
+ type: "mention",
40
+ attrs: {
41
+ id: data.userId,
42
+ label: data.name
43
+ }
44
+ });
45
+ };
46
+ expose({
47
+ insertMention
48
+ });
36
49
  watch(() => props.modelValue, (newValue) => {
37
50
  var _a, _b;
38
51
  if (((_a = editor.value) == null ? void 0 : _a.getHTML()) !== newValue) {
@@ -1,5 +1 @@
1
- export interface MentionData {
2
- name: string;
3
- userId: string;
4
- }
5
1
  export declare function useExtensions({ props, emit }: any): (import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-image").ImageOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-table").TableKitOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extensions").PlaceholderOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-list").ListKitOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-mention").MentionOptions<any, import("@tiptap/extension-mention").MentionNodeAttrs>, any>)[];
@@ -12,7 +12,9 @@ function useExtensions({ props, emit }) {
12
12
  table: { resizable: true }
13
13
  }),
14
14
  Placeholder.configure({
15
- placeholder: props.placeholder
15
+ placeholder: () => {
16
+ return props.placeholder;
17
+ }
16
18
  }),
17
19
  ListKit.extend({
18
20
  addKeyboardShortcuts() {
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.2";
8
+ export const version: "1.0.3";
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.2";
39
+ const version = "1.0.3";
40
40
  function install(app) {
41
41
  const components = [
42
42
  import_rich_text_editor.default
@@ -27,7 +27,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
27
27
  "onMention-triggered"?: ((...args: any[]) => any) | undefined;
28
28
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
29
29
  }>, {
30
- placeholder: string;
31
30
  modelValue: string;
31
+ placeholder: string;
32
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
33
33
  export default _default;
@@ -32,7 +32,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
32
32
  props: import_types.richTextEditorProps,
33
33
  emits: ["update:modelValue", "mention-triggered"],
34
34
  setup(props, {
35
- emit
35
+ emit,
36
+ expose
36
37
  }) {
37
38
  const editor = (0, import_vue2.ref)();
38
39
  const extensions = (0, import_useExtensions.useExtensions)({
@@ -55,6 +56,18 @@ var stdin_default = (0, import_vue2.defineComponent)({
55
56
  }
56
57
  });
57
58
  };
59
+ const insertMention = (data) => {
60
+ editor.value.commands.insertContent({
61
+ type: "mention",
62
+ attrs: {
63
+ id: data.userId,
64
+ label: data.name
65
+ }
66
+ });
67
+ };
68
+ expose({
69
+ insertMention
70
+ });
58
71
  (0, import_vue2.watch)(() => props.modelValue, (newValue) => {
59
72
  var _a, _b;
60
73
  if (((_a = editor.value) == null ? void 0 : _a.getHTML()) !== newValue) {
@@ -1,5 +1 @@
1
- export interface MentionData {
2
- name: string;
3
- userId: string;
4
- }
5
1
  export declare function useExtensions({ props, emit }: any): (import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-image").ImageOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-table").TableKitOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extensions").PlaceholderOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-list").ListKitOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-mention").MentionOptions<any, import("@tiptap/extension-mention").MentionNodeAttrs>, any>)[];
@@ -44,7 +44,9 @@ function useExtensions({ props, emit }) {
44
44
  table: { resizable: true }
45
45
  }),
46
46
  import_extensions.Placeholder.configure({
47
- placeholder: props.placeholder
47
+ placeholder: () => {
48
+ return props.placeholder;
49
+ }
48
50
  }),
49
51
  import_extension_list.ListKit.extend({
50
52
  addKeyboardShortcuts() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgboiler/biz-basic",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",