@onereach/ui-components 21.0.0 → 21.1.0-beta.5337.0
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.
|
@@ -109,6 +109,7 @@ import '@tiptap/extension-ordered-list';
|
|
|
109
109
|
import '@tiptap/extension-paragraph';
|
|
110
110
|
import '@tiptap/extension-placeholder';
|
|
111
111
|
import '@tiptap/extension-underline';
|
|
112
|
+
import '@tiptap/extension-character-count';
|
|
112
113
|
import '@tiptap/starter-kit';
|
|
113
114
|
import '@vueuse/integrations/useFocusTrap';
|
|
114
115
|
import 'prosemirror-state';
|
|
@@ -43,6 +43,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
43
43
|
type: BooleanConstructor;
|
|
44
44
|
default: boolean;
|
|
45
45
|
};
|
|
46
|
+
maxLength: {
|
|
47
|
+
type: NumberConstructor;
|
|
48
|
+
required: false;
|
|
49
|
+
default: undefined;
|
|
50
|
+
};
|
|
46
51
|
}, {
|
|
47
52
|
root: import("vue").Ref<HTMLElement | undefined>;
|
|
48
53
|
rootStyles: import("vue").ComputedRef<string[]>;
|
|
@@ -123,6 +128,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
123
128
|
type: BooleanConstructor;
|
|
124
129
|
default: boolean;
|
|
125
130
|
};
|
|
131
|
+
maxLength: {
|
|
132
|
+
type: NumberConstructor;
|
|
133
|
+
required: false;
|
|
134
|
+
default: undefined;
|
|
135
|
+
};
|
|
126
136
|
}>> & {
|
|
127
137
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
128
138
|
onInput?: ((...args: any[]) => any) | undefined;
|
|
@@ -140,5 +150,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
140
150
|
error: string | boolean;
|
|
141
151
|
required: boolean;
|
|
142
152
|
disabled: boolean;
|
|
153
|
+
maxLength: number;
|
|
143
154
|
}, {}>;
|
|
144
155
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, shallowRef, ref, onMounted, onBeforeUnmount, computed, watch, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, createElementVNode, Fragment, renderList, withDirectives, vShow, vModelText } from 'vue';
|
|
1
|
+
import { defineComponent, shallowRef, ref, onMounted, onBeforeUnmount, computed, watch, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, createElementVNode, Fragment, renderList, withDirectives, vShow, vModelText, createSlots } from 'vue';
|
|
2
2
|
import { s as styleInject } from '../OrInlineInputV3-4e69972f.js';
|
|
3
3
|
import { Node, Editor, mergeAttributes } from '@tiptap/core';
|
|
4
4
|
import Blockquote from '@tiptap/extension-blockquote';
|
|
@@ -10,6 +10,7 @@ import OrderedList from '@tiptap/extension-ordered-list';
|
|
|
10
10
|
import Paragraph from '@tiptap/extension-paragraph';
|
|
11
11
|
import Placeholder from '@tiptap/extension-placeholder';
|
|
12
12
|
import Underline from '@tiptap/extension-underline';
|
|
13
|
+
import CharacterCount from '@tiptap/extension-character-count';
|
|
13
14
|
import StarterKit from '@tiptap/starter-kit';
|
|
14
15
|
import { useResizeObserver, useDebounceFn, onClickOutside } from '@vueuse/core';
|
|
15
16
|
import { useFocusTrap } from '@vueuse/integrations/useFocusTrap';
|
|
@@ -643,6 +644,11 @@ var script = defineComponent({
|
|
|
643
644
|
disabled: {
|
|
644
645
|
type: Boolean,
|
|
645
646
|
default: false
|
|
647
|
+
},
|
|
648
|
+
maxLength: {
|
|
649
|
+
type: Number,
|
|
650
|
+
required: false,
|
|
651
|
+
default: undefined
|
|
646
652
|
}
|
|
647
653
|
},
|
|
648
654
|
emits: ['update:modelValue', 'input', 'file-upload', 'focus', 'blur'],
|
|
@@ -761,6 +767,8 @@ var script = defineComponent({
|
|
|
761
767
|
HTMLAttributes: {
|
|
762
768
|
class: 'my-sm mx-lg px-lg border-l-2 border-outline'
|
|
763
769
|
}
|
|
770
|
+
}), CharacterCount.configure({
|
|
771
|
+
limit: props.maxLength
|
|
764
772
|
}), Heading.configure({
|
|
765
773
|
levels: headingLevels
|
|
766
774
|
}).extend({
|
|
@@ -1156,18 +1164,26 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1156
1164
|
class: normalizeClass(_ctx.controlStyles)
|
|
1157
1165
|
}, null, 2 /* CLASS */), [[vShow, !_ctx.disableMarkdown]]), renderSlot(_ctx.$slots, "files")])]),
|
|
1158
1166
|
_: 3 /* FORWARDED */
|
|
1159
|
-
}, 8 /* PROPS */, ["invalid", "disabled"]), _ctx.$slots.hint || _ctx.hint ? withDirectives((openBlock(), createBlock(_component_OrHint, {
|
|
1167
|
+
}, 8 /* PROPS */, ["invalid", "disabled"]), _ctx.$slots.hint || _ctx.hint || _ctx.maxLength ? withDirectives((openBlock(), createBlock(_component_OrHint, {
|
|
1160
1168
|
key: 1,
|
|
1161
1169
|
disabled: _ctx.disabled
|
|
1162
|
-
}, {
|
|
1170
|
+
}, createSlots({
|
|
1163
1171
|
default: withCtx(() => [renderSlot(_ctx.$slots, "hint", {}, () => [createTextVNode(toDisplayString(_ctx.hint), 1 /* TEXT */)])]),
|
|
1164
|
-
_:
|
|
1165
|
-
},
|
|
1172
|
+
_: 2 /* DYNAMIC */
|
|
1173
|
+
}, [_ctx.maxLength && _ctx.editor ? {
|
|
1174
|
+
name: "addon",
|
|
1175
|
+
fn: withCtx(() => [createTextVNode(toDisplayString(_ctx.editor.storage.characterCount.characters()) + " / " + toDisplayString(_ctx.maxLength), 1 /* TEXT */)]),
|
|
1176
|
+
key: "0"
|
|
1177
|
+
} : undefined]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["disabled"])), [[vShow, !_ctx.error]]) : createCommentVNode("v-if", true), withDirectives(createVNode(_component_OrError, {
|
|
1166
1178
|
disabled: _ctx.disabled
|
|
1167
|
-
}, {
|
|
1168
|
-
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.error), 1 /* TEXT */)]),
|
|
1169
|
-
_:
|
|
1170
|
-
},
|
|
1179
|
+
}, createSlots({
|
|
1180
|
+
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.error) + " ", 1 /* TEXT */)]),
|
|
1181
|
+
_: 2 /* DYNAMIC */
|
|
1182
|
+
}, [_ctx.maxLength && _ctx.editor ? {
|
|
1183
|
+
name: "addon",
|
|
1184
|
+
fn: withCtx(() => [createTextVNode(toDisplayString(_ctx.editor.storage.characterCount.characters()) + " / " + toDisplayString(_ctx.maxLength), 1 /* TEXT */)]),
|
|
1185
|
+
key: "0"
|
|
1186
|
+
} : undefined]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["disabled"]), [[vShow, typeof _ctx.error === 'string' && _ctx.error.length > 0]]), _ctx.moreButtonRef ? (openBlock(), createBlock(_component_OrPopover, {
|
|
1171
1187
|
key: 2,
|
|
1172
1188
|
ref: 'moreRef',
|
|
1173
1189
|
trigger: _ctx.moreButtonRef && _ctx.moreButtonRef.root,
|
package/dist/esm/index.js
CHANGED
|
@@ -109,6 +109,7 @@ import '@tiptap/extension-ordered-list';
|
|
|
109
109
|
import '@tiptap/extension-paragraph';
|
|
110
110
|
import '@tiptap/extension-placeholder';
|
|
111
111
|
import '@tiptap/extension-underline';
|
|
112
|
+
import '@tiptap/extension-character-count';
|
|
112
113
|
import '@tiptap/starter-kit';
|
|
113
114
|
import '@vueuse/integrations/useFocusTrap';
|
|
114
115
|
import 'prosemirror-state';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/ui-components",
|
|
3
|
-
"version": "21.0.0",
|
|
3
|
+
"version": "21.1.0-beta.5337.0",
|
|
4
4
|
"description": "Vue components library for v3",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"exports": {
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"@tiptap/extension-blockquote": "2.0.3",
|
|
52
52
|
"@tiptap/extension-bold": "2.0.3",
|
|
53
53
|
"@tiptap/extension-bullet-list": "2.0.3",
|
|
54
|
+
"@tiptap/extension-character-count": "2.0.3",
|
|
54
55
|
"@tiptap/extension-code-block": "2.0.3",
|
|
55
56
|
"@tiptap/extension-hard-break": "2.0.3",
|
|
56
57
|
"@tiptap/extension-heading": "2.0.3",
|
|
@@ -101,6 +102,5 @@
|
|
|
101
102
|
"publishConfig": {
|
|
102
103
|
"access": "public"
|
|
103
104
|
},
|
|
104
|
-
"npmUnpacked": "4.15.2"
|
|
105
|
-
"gitHead": "1b0b3229bd78b1c713901758e3bab1567d899cd6"
|
|
105
|
+
"npmUnpacked": "4.15.2"
|
|
106
106
|
}
|