@juit/vue-tiny-editor 1.0.26 → 1.0.28

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/README.md CHANGED
@@ -26,7 +26,8 @@ can be used to inject the initial text to be edited.
26
26
 
27
27
  * `mention`: The `string` of the mention being typed (for example `@x`).
28
28
  * `submit`: When the send button is clicked, the `string` parameter will contain
29
- the HTML contents of the editor.
29
+ the HTML contents of the editor. When this emit is not listened to
30
+ the _send_ button is not displayed.
30
31
 
31
32
  #### HTML format
32
33
 
package/dist/index.d.ts CHANGED
@@ -30,12 +30,22 @@ type: PropType<Record<string, string> | null>;
30
30
  required: false;
31
31
  default: () => {};
32
32
  };
33
+ /** Used as `@mention="..."`, notify the current mention text (`@abc...`) */
34
+ onMention: {
35
+ type: PropType<((text: string) => any) | undefined>;
36
+ required: false;
37
+ default: undefined;
38
+ };
39
+ /** Used as `@submit="..."`, will display the send button and emit HTML */
40
+ onSubmit: {
41
+ type: PropType<((html: string) => any) | undefined>;
42
+ required: false;
43
+ default: undefined;
44
+ };
33
45
  modelValue: {
34
46
  type: PropType<string>;
35
47
  };
36
48
  }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
37
- mention: (args_0: string) => any;
38
- submit: (args_0: string) => any;
39
49
  "update:modelValue": (value: string) => any;
40
50
  }, string, PublicProps, Readonly<ExtractPropTypes< {
41
51
  /** A flag indicating if content can be edited (default: `true`) */
@@ -62,18 +72,30 @@ type: PropType<Record<string, string> | null>;
62
72
  required: false;
63
73
  default: () => {};
64
74
  };
75
+ /** Used as `@mention="..."`, notify the current mention text (`@abc...`) */
76
+ onMention: {
77
+ type: PropType<((text: string) => any) | undefined>;
78
+ required: false;
79
+ default: undefined;
80
+ };
81
+ /** Used as `@submit="..."`, will display the send button and emit HTML */
82
+ onSubmit: {
83
+ type: PropType<((html: string) => any) | undefined>;
84
+ required: false;
85
+ default: undefined;
86
+ };
65
87
  modelValue: {
66
88
  type: PropType<string>;
67
89
  };
68
90
  }>> & Readonly<{
69
- onMention?: ((args_0: string) => any) | undefined;
70
- onSubmit?: ((args_0: string) => any) | undefined;
71
91
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
72
92
  }>, {
73
93
  editable: boolean;
74
94
  dark: boolean;
75
95
  placeholder: string;
76
96
  mentions: Record<string, string> | null;
97
+ onMention: ((text: string) => any) | undefined;
98
+ onSubmit: ((html: string) => any) | undefined;
77
99
  }, {}, {}, {}, string, ComponentProvideOptions, true, {
78
100
  rootRef: HTMLDivElement;
79
101
  mentionsPopupRef: HTMLDivElement;