@vkzstudio/muza-ui 1.0.35 → 1.0.37
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/dist/components/DataTable/DataTable.d.ts +6 -1
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.js +92 -79
- package/dist/components/DataTable/DataTable.stories.d.ts +1 -0
- package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -1
- package/dist/components/FileUpload/FileItem.d.ts.map +1 -1
- package/dist/components/FileUpload/FileItem.js +1 -1
- package/dist/components/Input/Input.d.ts +9 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +23 -22
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +83 -62
- package/dist/components/MuzaUIProvider/theme/colorShades.js +11 -10
- package/dist/components/Reorderable/Reorderable.d.ts +5 -0
- package/dist/components/Reorderable/Reorderable.d.ts.map +1 -1
- package/dist/components/Reorderable/Reorderable.js +166 -164
- package/dist/components/ReorderableTable/ReorderableTable.d.ts +6 -0
- package/dist/components/ReorderableTable/ReorderableTable.d.ts.map +1 -1
- package/dist/components/ReorderableTable/ReorderableTable.js +91 -80
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts +1 -0
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts.map +1 -1
- package/dist/components/TextEditor/TextEditor.d.ts +4 -0
- package/dist/components/TextEditor/TextEditor.d.ts.map +1 -1
- package/dist/components/TextEditor/TextEditor.js +128 -97
- package/dist/components/TextEditor/TextEditor.stories.d.ts +1 -0
- package/dist/components/TextEditor/TextEditor.stories.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +1 -1
- package/dist/muza-ui.css +1 -1
- package/dist/node_modules/@tiptap/extension-character-count/dist/index.js +73 -0
- package/package.json +3 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Extension as l } from "../../core/dist/index.js";
|
|
2
|
+
import { Plugin as h, PluginKey as f } from "../../../prosemirror-state/dist/index.js";
|
|
3
|
+
const x = l.create({
|
|
4
|
+
name: "characterCount",
|
|
5
|
+
addOptions() {
|
|
6
|
+
return {
|
|
7
|
+
limit: null,
|
|
8
|
+
mode: "textSize",
|
|
9
|
+
textCounter: (e) => e.length,
|
|
10
|
+
wordCounter: (e) => e.split(" ").filter((t) => t !== "").length
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
addStorage() {
|
|
14
|
+
return {
|
|
15
|
+
characters: () => 0,
|
|
16
|
+
words: () => 0
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
onBeforeCreate() {
|
|
20
|
+
this.storage.characters = (e) => {
|
|
21
|
+
const t = (e == null ? void 0 : e.node) || this.editor.state.doc;
|
|
22
|
+
if (((e == null ? void 0 : e.mode) || this.options.mode) === "textSize") {
|
|
23
|
+
const r = t.textBetween(0, t.content.size, void 0, " ");
|
|
24
|
+
return this.options.textCounter(r);
|
|
25
|
+
}
|
|
26
|
+
return t.nodeSize;
|
|
27
|
+
}, this.storage.words = (e) => {
|
|
28
|
+
const t = (e == null ? void 0 : e.node) || this.editor.state.doc, i = t.textBetween(0, t.content.size, " ", " ");
|
|
29
|
+
return this.options.wordCounter(i);
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
addProseMirrorPlugins() {
|
|
33
|
+
let e = !1;
|
|
34
|
+
return [
|
|
35
|
+
new h({
|
|
36
|
+
key: new f("characterCount"),
|
|
37
|
+
appendTransaction: (t, i, r) => {
|
|
38
|
+
if (e)
|
|
39
|
+
return;
|
|
40
|
+
const n = this.options.limit;
|
|
41
|
+
if (n == null || n === 0) {
|
|
42
|
+
e = !0;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const o = this.storage.characters({ node: r.doc });
|
|
46
|
+
if (o > n) {
|
|
47
|
+
const c = o - n, s = 0, a = c;
|
|
48
|
+
console.warn(`[CharacterCount] Initial content exceeded limit of ${n} characters. Content was automatically trimmed.`);
|
|
49
|
+
const d = r.tr.deleteRange(s, a);
|
|
50
|
+
return e = !0, d;
|
|
51
|
+
}
|
|
52
|
+
e = !0;
|
|
53
|
+
},
|
|
54
|
+
filterTransaction: (t, i) => {
|
|
55
|
+
const r = this.options.limit;
|
|
56
|
+
if (!t.docChanged || r === 0 || r === null || r === void 0)
|
|
57
|
+
return !0;
|
|
58
|
+
const n = this.storage.characters({ node: i.doc }), o = this.storage.characters({ node: t.doc });
|
|
59
|
+
if (o <= r || n > r && o > r && o <= n)
|
|
60
|
+
return !0;
|
|
61
|
+
if (n > r && o > r && o > n || !t.getMeta("paste"))
|
|
62
|
+
return !1;
|
|
63
|
+
const s = t.selection.$head.pos, a = o - r, d = s - a, u = s;
|
|
64
|
+
return t.deleteRange(d, u), !(this.storage.characters({ node: t.doc }) > r);
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
x as CharacterCount,
|
|
72
|
+
x as default
|
|
73
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkzstudio/muza-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.37",
|
|
4
4
|
"description": "React component library built with Vite, shadcn/ui, and Tailwind CSS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"@react-three/fiber": "^8.18.0",
|
|
73
73
|
"@solar-icons/react-perf": "^1.0.0",
|
|
74
74
|
"@storybook/addon-designs": "^10.0.2",
|
|
75
|
+
"@tiptap/extension-character-count": "^2.22.0",
|
|
75
76
|
"@tiptap/extension-link": "^2.22.0",
|
|
76
77
|
"@tiptap/extension-mention": "^2.22.0",
|
|
77
78
|
"@tiptap/extension-placeholder": "^2.22.0",
|
|
@@ -115,6 +116,7 @@
|
|
|
115
116
|
"@storybook/react-vite": "^9.1.8",
|
|
116
117
|
"@storybook/testing-library": "^0.2.2",
|
|
117
118
|
"@tailwindcss/vite": "^4.1.11",
|
|
119
|
+
"@tiptap/extension-character-count": "^2.27.2",
|
|
118
120
|
"@tiptap/extension-mention": "^2.27.2",
|
|
119
121
|
"@tiptap/suggestion": "^2.27.2",
|
|
120
122
|
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
|