@code0-tech/pictor 0.18.2 → 1.0.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/button/Button.style.css +1 -1
- package/dist/assets/components/command/Command.style.css +1 -1
- package/dist/assets/components/context-menu/ContextMenu.style.css +1 -1
- package/dist/assets/components/dialog/Dialog.style.css +1 -1
- package/dist/assets/components/form/Input.style.css +1 -1
- package/dist/assets/components/form/SelectInput.style.css +1 -1
- package/dist/assets/components/menu/Menu.style.css +1 -1
- package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -1
- package/dist/assets/components/tab/Tab.style.css +1 -1
- package/dist/assets/components/tooltip/Tooltip.style.css +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +9 -8
- package/dist/components/context-menu/ContextMenu.d.ts +1 -1
- package/dist/components/context-menu/ContextMenu.js +89 -102
- package/dist/components/data-table/DataTable.js +11 -10
- package/dist/components/dialog/Dialog.js +75 -80
- package/dist/components/editor/Editor.js +3 -2
- package/dist/components/form/EditorInput.js +490 -460
- package/dist/components/form/Input.js +18 -17
- package/dist/components/form/NumberInput.js +4 -4
- package/dist/components/form/PasswordInput.js +15 -15
- package/dist/components/form/TextInput.js +7 -7
- package/dist/components/gantt/GanttGroup.js +40 -39
- package/dist/components/json-view/JsonView.js +3 -3
- package/dist/components/menu/Menu.js +104 -117
- package/dist/components/progress/ProgressCircle.js +7 -6
- package/dist/components/progress/ProgressLinear.js +6 -5
- package/dist/components/segmented-control/SegmentedControl.d.ts +2 -2
- package/dist/components/segmented-control/SegmentedControl.js +44 -20
- package/dist/components/tab/Tab.js +58 -32
- package/dist/components/toast/Toast.d.ts +1 -1
- package/dist/components/toast/Toast.js +64 -65
- package/dist/components/tooltip/Tooltip.js +46 -51
- package/dist/index.js +181 -170
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +12 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +25 -14
- package/dist/utils/motion.d.ts +55 -0
- package/dist/utils/motion.js +115 -0
- package/package.json +8 -8
|
@@ -1,103 +1,98 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l, jsxs as g } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "../../_virtual/compiler-runtime.js";
|
|
3
3
|
import * as s from "@radix-ui/react-dialog";
|
|
4
4
|
import "../../utils/contextStore.js";
|
|
5
|
-
import "react";
|
|
5
|
+
import f from "react";
|
|
6
6
|
import { mergeComponentProps as r } from "../../utils/component.js";
|
|
7
|
+
import { useObservedOpen as C, useSurfaceMotion as D, useScrimMotion as v } from "../../utils/motion.js";
|
|
7
8
|
import "js-md5";
|
|
8
|
-
import { IconX as
|
|
9
|
+
import { IconX as x } from "@tabler/icons-react";
|
|
9
10
|
import '../../assets/components/dialog/Dialog.style.css';/* empty css */
|
|
10
|
-
import { Button as
|
|
11
|
-
import { Flex as
|
|
12
|
-
import { Text as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
t
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
let
|
|
23
|
-
t[
|
|
24
|
-
|
|
25
|
-
let e;
|
|
26
|
-
return t[2] !== o ? (e = /* @__PURE__ */ n(s.Trigger, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
|
|
27
|
-
}, F = (i) => {
|
|
11
|
+
import { Button as O } from "../button/Button.js";
|
|
12
|
+
import { Flex as y } from "../flex/Flex.js";
|
|
13
|
+
import { Text as P } from "../text/Text.js";
|
|
14
|
+
import { AnimatePresence as _ } from "../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
|
|
15
|
+
import { motion as h } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
16
|
+
const d = f.createContext(!1), X = (o) => {
|
|
17
|
+
const t = c.c(8), [e, i] = C(o.open, o.defaultOpen, o.onOpenChange);
|
|
18
|
+
let n;
|
|
19
|
+
t[0] !== o ? (n = r("dialog", o), t[0] = o, t[1] = n) : n = t[1];
|
|
20
|
+
const u = n;
|
|
21
|
+
let a;
|
|
22
|
+
t[2] !== i || t[3] !== u ? (a = /* @__PURE__ */ l(s.Root, { ...u, onOpenChange: i }), t[2] = i, t[3] = u, t[4] = a) : a = t[4];
|
|
23
|
+
let m;
|
|
24
|
+
return t[5] !== e || t[6] !== a ? (m = /* @__PURE__ */ l(d.Provider, { value: e, children: a }), t[5] = e, t[6] = a, t[7] = m) : m = t[7], m;
|
|
25
|
+
}, k = (o) => {
|
|
28
26
|
const t = c.c(4);
|
|
29
|
-
let l;
|
|
30
|
-
t[0] !== i ? (l = r("dialog__portal", i), t[0] = i, t[1] = l) : l = t[1];
|
|
31
|
-
const o = l;
|
|
32
27
|
let e;
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
t[0] !== o ? (e = r("dialog__trigger", o), t[0] = o, t[1] = e) : e = t[1];
|
|
29
|
+
const i = e;
|
|
30
|
+
let n;
|
|
31
|
+
return t[2] !== i ? (n = /* @__PURE__ */ l(s.Trigger, { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
|
|
32
|
+
}, q = (o) => {
|
|
35
33
|
const t = c.c(4);
|
|
36
|
-
let l;
|
|
37
|
-
t[0] !== i ? (l = r("dialog__close", i), t[0] = i, t[1] = l) : l = t[1];
|
|
38
|
-
const o = l;
|
|
39
34
|
let e;
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
t[0] !== o ? (e = r("dialog__portal", o), t[0] = o, t[1] = e) : e = t[1];
|
|
36
|
+
const i = e;
|
|
37
|
+
let n;
|
|
38
|
+
return t[2] !== i ? (n = /* @__PURE__ */ l(s.Portal, { forceMount: !0, ...i }), t[2] = i, t[3] = n) : n = t[3], n;
|
|
39
|
+
}, $ = (o) => {
|
|
42
40
|
const t = c.c(4);
|
|
43
|
-
let l;
|
|
44
|
-
t[0] !== i ? (l = r("dialog__overlay", i), t[0] = i, t[1] = l) : l = t[1];
|
|
45
|
-
const o = l;
|
|
46
|
-
let e;
|
|
47
|
-
return t[2] !== o ? (e = /* @__PURE__ */ n(s.Overlay, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
|
|
48
|
-
}, R = (i) => {
|
|
49
|
-
const t = c.c(9);
|
|
50
|
-
let l;
|
|
51
|
-
t[0] !== i ? (l = r("dialog__content", i), t[0] = i, t[1] = l) : l = t[1];
|
|
52
|
-
const o = l;
|
|
53
41
|
let e;
|
|
54
|
-
t[
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
42
|
+
t[0] !== o ? (e = r("dialog__close", o), t[0] = o, t[1] = e) : e = t[1];
|
|
43
|
+
const i = e;
|
|
44
|
+
let n;
|
|
45
|
+
return t[2] !== i ? (n = /* @__PURE__ */ l(s.Close, { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
|
|
46
|
+
}, G = (o) => {
|
|
47
|
+
const t = f.useContext(d), e = f.useRef(t), i = v();
|
|
48
|
+
return /* @__PURE__ */ l(_, { initial: !e.current, children: t && /* @__PURE__ */ l(s.Overlay, { forceMount: !0, asChild: !0, ...r("dialog__overlay", o), children: /* @__PURE__ */ l(h.div, { ...i }) }, "dialog__overlay") });
|
|
49
|
+
}, J = (o) => {
|
|
50
|
+
const t = f.useContext(d), e = f.useRef(t), i = D();
|
|
51
|
+
return /* @__PURE__ */ l(_, { initial: !e.current, children: t && /* @__PURE__ */ l(s.Content, { forceMount: !0, asChild: !0, ...r("dialog__content", o), children: /* @__PURE__ */ g(h.div, { ...i, children: [
|
|
52
|
+
o.showCloseButton && /* @__PURE__ */ g(y, { align: "center", justify: "space-between", children: [
|
|
53
|
+
/* @__PURE__ */ l(P, { hierarchy: "primary", size: "xl", children: o.title }),
|
|
54
|
+
/* @__PURE__ */ l($, { asChild: !0, children: /* @__PURE__ */ l(O, { variant: "none", color: "tertiary", children: /* @__PURE__ */ l(x, { size: 16 }) }) })
|
|
55
|
+
] }),
|
|
56
|
+
o.children
|
|
57
|
+
] }) }, "dialog__content") });
|
|
58
|
+
}, K = (o) => {
|
|
64
59
|
const t = c.c(4);
|
|
65
|
-
let l;
|
|
66
|
-
t[0] !== i ? (l = r("dialog__title", i), t[0] = i, t[1] = l) : l = t[1];
|
|
67
|
-
const o = l;
|
|
68
60
|
let e;
|
|
69
|
-
|
|
70
|
-
|
|
61
|
+
t[0] !== o ? (e = r("dialog__title", o), t[0] = o, t[1] = e) : e = t[1];
|
|
62
|
+
const i = e;
|
|
63
|
+
let n;
|
|
64
|
+
return t[2] !== i ? (n = /* @__PURE__ */ l(s.Title, { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
|
|
65
|
+
}, L = (o) => {
|
|
71
66
|
const t = c.c(4);
|
|
72
|
-
let l;
|
|
73
|
-
t[0] !== i ? (l = r("dialog__description", i), t[0] = i, t[1] = l) : l = t[1];
|
|
74
|
-
const o = l;
|
|
75
67
|
let e;
|
|
76
|
-
|
|
77
|
-
|
|
68
|
+
t[0] !== o ? (e = r("dialog__description", o), t[0] = o, t[1] = e) : e = t[1];
|
|
69
|
+
const i = e;
|
|
70
|
+
let n;
|
|
71
|
+
return t[2] !== i ? (n = /* @__PURE__ */ l(s.Description, { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
|
|
72
|
+
}, N = (o) => {
|
|
78
73
|
const t = c.c(4);
|
|
79
|
-
let l;
|
|
80
|
-
t[0] !== i ? (l = r("dialog__header", i), t[0] = i, t[1] = l) : l = t[1];
|
|
81
|
-
const o = l;
|
|
82
74
|
let e;
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
t[0] !== o ? (e = r("dialog__header", o), t[0] = o, t[1] = e) : e = t[1];
|
|
76
|
+
const i = e;
|
|
77
|
+
let n;
|
|
78
|
+
return t[2] !== i ? (n = /* @__PURE__ */ l("div", { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
|
|
79
|
+
}, Q = (o) => {
|
|
85
80
|
const t = c.c(4);
|
|
86
|
-
let l;
|
|
87
|
-
t[0] !== i ? (l = r("dialog__footer", i), t[0] = i, t[1] = l) : l = t[1];
|
|
88
|
-
const o = l;
|
|
89
81
|
let e;
|
|
90
|
-
|
|
82
|
+
t[0] !== o ? (e = r("dialog__footer", o), t[0] = o, t[1] = e) : e = t[1];
|
|
83
|
+
const i = e;
|
|
84
|
+
let n;
|
|
85
|
+
return t[2] !== i ? (n = /* @__PURE__ */ l("div", { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
|
|
91
86
|
};
|
|
92
87
|
export {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
88
|
+
X as Dialog,
|
|
89
|
+
$ as DialogClose,
|
|
90
|
+
J as DialogContent,
|
|
91
|
+
L as DialogDescription,
|
|
92
|
+
Q as DialogFooter,
|
|
93
|
+
N as DialogHeader,
|
|
94
|
+
G as DialogOverlay,
|
|
95
|
+
q as DialogPortal,
|
|
96
|
+
K as DialogTitle,
|
|
97
|
+
k as DialogTrigger
|
|
103
98
|
};
|
|
@@ -3,6 +3,7 @@ import m, { isValidElement as me } from "react";
|
|
|
3
3
|
import { createPortal as H } from "react-dom";
|
|
4
4
|
import "../../utils/contextStore.js";
|
|
5
5
|
import { mergeComponentProps as he } from "../../utils/component.js";
|
|
6
|
+
import "../../_virtual/compiler-runtime.js";
|
|
6
7
|
import { hashToColor as w } from "../../utils/color.js";
|
|
7
8
|
import fe, { Prec as K, keymap as J, ViewPlugin as ge, RangeSetBuilder as pe, Decoration as F, EditorView as ye, WidgetType as be } from "@uiw/react-codemirror";
|
|
8
9
|
import { json as ve, jsonParseLinter as Se } from "@codemirror/lang-json";
|
|
@@ -53,7 +54,7 @@ class X extends be {
|
|
|
53
54
|
return t.type === this.type && t.rawValue === this.rawValue;
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
|
-
const _e = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array.isArray(i),
|
|
57
|
+
const _e = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array.isArray(i), mr = (i) => {
|
|
57
58
|
const {
|
|
58
59
|
language: t,
|
|
59
60
|
tokenizer: f,
|
|
@@ -322,5 +323,5 @@ const _e = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
|
|
|
322
323
|
] });
|
|
323
324
|
};
|
|
324
325
|
export {
|
|
325
|
-
|
|
326
|
+
mr as Editor
|
|
326
327
|
};
|