@code0-tech/pictor 0.5.0 → 0.6.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.
- package/dist/assets/components/form/Input.style.css +1 -1
- package/dist/components/editor/Editor.d.ts +3 -1
- package/dist/components/editor/Editor.js +217 -229
- package/dist/components/form/InputMessage.js +10 -10
- package/dist/components/form/PasswordInput.d.ts +1 -0
- package/dist/components/form/PasswordInput.js +65 -16
- package/dist/components/form/index.js +10 -9
- package/dist/components/form/useForm.d.ts +1 -1
- package/dist/components/form/useForm.js +43 -42
- package/dist/index.js +107 -106
- package/dist/utils/reactiveArrayService.js +29 -39
- package/package.json +10 -10
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import a
|
|
2
|
-
import { View as
|
|
3
|
-
function
|
|
4
|
-
return (e =
|
|
1
|
+
import a from "react";
|
|
2
|
+
import { View as d } from "./view.js";
|
|
3
|
+
function h(t, e, r) {
|
|
4
|
+
return (e = p(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
var e =
|
|
6
|
+
function p(t) {
|
|
7
|
+
var e = y(t, "string");
|
|
8
8
|
return typeof e == "symbol" ? e : e + "";
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function y(t, e) {
|
|
11
11
|
if (typeof t != "object" || !t) return t;
|
|
12
12
|
var r = t[Symbol.toPrimitive];
|
|
13
13
|
if (r !== void 0) {
|
|
@@ -17,26 +17,20 @@ function m(t, e) {
|
|
|
17
17
|
}
|
|
18
18
|
return (e === "string" ? String : Number)(t);
|
|
19
19
|
}
|
|
20
|
-
class
|
|
20
|
+
class g {
|
|
21
21
|
constructor(e) {
|
|
22
|
-
|
|
22
|
+
h(this, "access", void 0), this.access = e;
|
|
23
23
|
}
|
|
24
24
|
delete(e) {
|
|
25
|
-
|
|
26
|
-
this.access.setState((r) => r.filter((s, c) => c !== e));
|
|
27
|
-
});
|
|
25
|
+
this.access.setState((r) => r.filter((s, c) => c !== e));
|
|
28
26
|
}
|
|
29
27
|
add(e) {
|
|
30
|
-
|
|
31
|
-
this.access.setState((r) => [...r, e]);
|
|
32
|
-
});
|
|
28
|
+
this.access.setState((r) => [...r, e]);
|
|
33
29
|
}
|
|
34
30
|
set(e, r) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return c[e] = r, c;
|
|
39
|
-
});
|
|
31
|
+
this.access.setState((s) => {
|
|
32
|
+
const c = s.slice();
|
|
33
|
+
return c[e] = r, c;
|
|
40
34
|
});
|
|
41
35
|
}
|
|
42
36
|
has(e) {
|
|
@@ -50,41 +44,37 @@ class w {
|
|
|
50
44
|
return this.access.getState().map((r) => r.payload);
|
|
51
45
|
}
|
|
52
46
|
update() {
|
|
53
|
-
|
|
54
|
-
this.access.setState((e) => [...e]);
|
|
55
|
-
});
|
|
47
|
+
this.access.setState((e) => [...e]);
|
|
56
48
|
}
|
|
57
49
|
clear() {
|
|
58
|
-
|
|
59
|
-
this.access.setState(() => []);
|
|
60
|
-
});
|
|
50
|
+
this.access.setState(() => []);
|
|
61
51
|
}
|
|
62
52
|
}
|
|
63
|
-
function
|
|
53
|
+
function w(t, e = []) {
|
|
64
54
|
const [r, s] = a.useState([]), c = a.useRef([]);
|
|
65
55
|
c.current = r;
|
|
66
|
-
const
|
|
56
|
+
const o = a.useCallback(() => c.current, []), i = a.useMemo(() => {
|
|
67
57
|
const n = {
|
|
68
|
-
getState:
|
|
58
|
+
getState: o,
|
|
69
59
|
setState: s
|
|
70
|
-
},
|
|
71
|
-
construct: () =>
|
|
60
|
+
}, l = {
|
|
61
|
+
construct: () => l
|
|
72
62
|
};
|
|
73
|
-
return ((
|
|
63
|
+
return ((v) => {
|
|
74
64
|
try {
|
|
75
|
-
return !!new new Proxy(
|
|
65
|
+
return !!new new Proxy(v, l)();
|
|
76
66
|
} catch {
|
|
77
67
|
return !1;
|
|
78
68
|
}
|
|
79
69
|
})(t) ? new t(n) : t(n);
|
|
80
|
-
}, [t,
|
|
70
|
+
}, [t, o]), u = a.useCallback((n) => new d(n), []), f = a.useRef(!1);
|
|
81
71
|
return a.useEffect(() => {
|
|
82
|
-
|
|
83
|
-
|
|
72
|
+
f.current || (f.current = !0, i.clear(), e.forEach((n) => {
|
|
73
|
+
i.add(u(n));
|
|
84
74
|
}));
|
|
85
|
-
}, [
|
|
75
|
+
}, [i, e, u]), [r, i];
|
|
86
76
|
}
|
|
87
77
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
78
|
+
g as ReactiveArrayService,
|
|
79
|
+
w as useReactiveArrayService
|
|
90
80
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code0-tech/pictor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A simple template for a custom React component library",
|
|
6
6
|
"scripts": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@codemirror/language": "^6.12.3",
|
|
25
25
|
"@codemirror/lint": "^6.9.5",
|
|
26
26
|
"@codemirror/state": "^6.6.0",
|
|
27
|
-
"@codemirror/view": "^6.
|
|
27
|
+
"@codemirror/view": "^6.41.0",
|
|
28
28
|
"@dagrejs/dagre": "^2.0.4",
|
|
29
29
|
"@lezer/common": "^1.5.1",
|
|
30
30
|
"@mdx-js/react": "^3.1.1",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"@types/react": "^19.2.14",
|
|
57
57
|
"@types/react-dom": "^19.2.3",
|
|
58
58
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
59
|
-
"@uiw/codemirror-themes": "^4.25.
|
|
59
|
+
"@uiw/codemirror-themes": "^4.25.9",
|
|
60
60
|
"@uiw/react-codemirror": "^4.25.8",
|
|
61
|
-
"@vitejs/plugin-react": "^5.
|
|
62
|
-
"@vitest/browser-playwright": "^4.
|
|
63
|
-
"@vitest/coverage-v8": "^4.
|
|
61
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
62
|
+
"@vitest/browser-playwright": "^4.1.2",
|
|
63
|
+
"@vitest/coverage-v8": "^4.1.2",
|
|
64
64
|
"@xyflow/react": "^12.10.1",
|
|
65
65
|
"axe-playwright": "^2.2.2",
|
|
66
66
|
"babel-loader": "^10.1.1",
|
|
@@ -76,21 +76,21 @@
|
|
|
76
76
|
"playwright": "1.58.1",
|
|
77
77
|
"react": "^19.2.4",
|
|
78
78
|
"react-dom": "^19.2.4",
|
|
79
|
-
"react-resizable-panels": "^4.
|
|
79
|
+
"react-resizable-panels": "^4.9.0",
|
|
80
80
|
"react-zoom-pan-pinch": "^3.7.0",
|
|
81
81
|
"rimraf": "^6.1.3",
|
|
82
|
-
"sass": "^1.
|
|
82
|
+
"sass": "^1.99.0",
|
|
83
83
|
"sass-loader": "^16.0.7",
|
|
84
84
|
"sonner": "^2.0.7",
|
|
85
85
|
"storybook": "^10.3.3",
|
|
86
86
|
"style-loader": "^4.0.0",
|
|
87
|
-
"ts-jest": "^29.4.
|
|
87
|
+
"ts-jest": "^29.4.9",
|
|
88
88
|
"ts-node": "^10.9.2",
|
|
89
89
|
"typescript": "^5.9.3",
|
|
90
90
|
"vite": "^7.3.1",
|
|
91
91
|
"vite-plugin-dts": "^4.5.4",
|
|
92
92
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
93
|
-
"vitest": "^4.
|
|
93
|
+
"vitest": "^4.1.2",
|
|
94
94
|
"avvvatars-react": "^0.4.2"
|
|
95
95
|
},
|
|
96
96
|
"main": "dist/index.js",
|