@code0-tech/pictor 0.10.6 → 0.10.7
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import e from "react";
|
|
3
|
-
import { InputWrapper as
|
|
4
|
-
import
|
|
3
|
+
import { InputWrapper as N } from "./InputWrapper.js";
|
|
4
|
+
import x from "@uiw/react-codemirror";
|
|
5
5
|
import { createTheme as p } from "@uiw/codemirror-themes";
|
|
6
6
|
import { tags as t } from "../../node_modules/@lezer/highlight/dist/index.js";
|
|
7
7
|
import "../../utils/contextStore.js";
|
|
8
|
-
import { mergeComponentProps as
|
|
8
|
+
import { mergeComponentProps as B } from "../../utils/component.js";
|
|
9
9
|
import { hashToColor as r } from "../../utils/color.js";
|
|
10
10
|
import '../../assets/components/form/EditorInput.style.css';/* empty css */
|
|
11
11
|
const A = [], L = [], P = {
|
|
@@ -21,6 +21,9 @@ const A = [], L = [], P = {
|
|
|
21
21
|
selection: "rgba(112,179,255,0.25)",
|
|
22
22
|
selectionMatch: "rgba(112,179,255,0.1)",
|
|
23
23
|
fontSize: "0.8rem",
|
|
24
|
+
fontFamily: '"Inter", sans-serif',
|
|
25
|
+
letterSpacing: "-0.5px",
|
|
26
|
+
fontWeight: "400",
|
|
24
27
|
gutterBackground: "transparent",
|
|
25
28
|
gutterForeground: "rgba(255,255,255, 0.5)",
|
|
26
29
|
gutterBorder: "transparent",
|
|
@@ -41,35 +44,35 @@ const A = [], L = [], P = {
|
|
|
41
44
|
}, {
|
|
42
45
|
tag: t.number,
|
|
43
46
|
color: r("Number")
|
|
44
|
-
}],
|
|
47
|
+
}], F = p({
|
|
45
48
|
theme: "light",
|
|
46
49
|
settings: u,
|
|
47
50
|
styles: h
|
|
48
|
-
}),
|
|
51
|
+
}), Y = e.memo((f) => {
|
|
49
52
|
const {
|
|
50
|
-
title:
|
|
51
|
-
right:
|
|
52
|
-
left:
|
|
53
|
-
rightType:
|
|
53
|
+
title: d,
|
|
54
|
+
right: T,
|
|
55
|
+
left: b,
|
|
56
|
+
rightType: E,
|
|
54
57
|
leftType: S,
|
|
55
58
|
language: o,
|
|
56
59
|
description: _,
|
|
57
60
|
extensions: n = A,
|
|
58
61
|
tokenStyles: a = L,
|
|
59
|
-
formValidation:
|
|
60
|
-
onChange:
|
|
62
|
+
formValidation: i,
|
|
63
|
+
onChange: g,
|
|
61
64
|
wrapperComponent: k,
|
|
62
|
-
...
|
|
63
|
-
} =
|
|
65
|
+
...l
|
|
66
|
+
} = f, y = e.useMemo(() => [...o ? [...n, o] : n], [n, o]), C = e.useMemo(() => a.length === 0 ? F : p({
|
|
64
67
|
theme: "light",
|
|
65
68
|
settings: u,
|
|
66
69
|
styles: [...h, ...a]
|
|
67
|
-
}), [a]), m =
|
|
68
|
-
m?.(
|
|
69
|
-
}, [m,
|
|
70
|
-
return /* @__PURE__ */ c(
|
|
70
|
+
}), [a]), m = i?.setValue, M = e.useCallback((s) => {
|
|
71
|
+
m?.(s), g?.(s);
|
|
72
|
+
}, [m, g]), I = e.useMemo(() => B("editor-input", l), [l]);
|
|
73
|
+
return /* @__PURE__ */ c(N, { title: d, description: _, right: T, left: b, rightType: E, leftType: S, formValidation: i, wrapperComponent: k, children: /* @__PURE__ */ c(x, { extensions: y, onChange: M, theme: C, indentWithTab: !1, ...I, basicSetup: P }) });
|
|
71
74
|
});
|
|
72
|
-
|
|
75
|
+
Y.displayName = "EditorInput";
|
|
73
76
|
export {
|
|
74
|
-
|
|
77
|
+
Y as EditorInput
|
|
75
78
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import
|
|
4
|
-
import { IconChevronRight as
|
|
1
|
+
import { jsx as l, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
+
import { c as T } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import u from "@uiw/react-json-view";
|
|
4
|
+
import { IconChevronRight as C, IconCheck as N, IconCopy as k } from "@tabler/icons-react";
|
|
5
5
|
import "../../utils/contextStore.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import { mergeComponentProps as
|
|
7
|
+
import { mergeComponentProps as z } from "../../utils/component.js";
|
|
8
8
|
import { hashToColor as r } from "../../utils/color.js";
|
|
9
9
|
import '../../assets/components/json-view/JsonView.style.css';/* empty css */
|
|
10
|
+
import { Text as I } from "../text/Text.js";
|
|
10
11
|
import { AnimatePresence as S } from "../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
|
|
11
|
-
import { motion as
|
|
12
|
+
import { motion as E } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
12
13
|
const q = {
|
|
13
14
|
"--w-rjv-font-family": '"Inter", sans-serif',
|
|
14
15
|
"--w-rjv-font-size": "0.8rem",
|
|
@@ -36,54 +37,58 @@ const q = {
|
|
|
36
37
|
"--w-rjv-type-null-color": r("Null"),
|
|
37
38
|
"--w-rjv-type-nan-color": r("Number"),
|
|
38
39
|
"--w-rjv-type-undefined-color": r("Null")
|
|
39
|
-
}, K = (
|
|
40
|
-
const e =
|
|
41
|
-
let o, i,
|
|
42
|
-
if (e[0] !==
|
|
40
|
+
}, K = (n) => {
|
|
41
|
+
const e = T.c(24);
|
|
42
|
+
let o, i, s, p, w, t;
|
|
43
|
+
if (e[0] !== n) {
|
|
43
44
|
const {
|
|
44
|
-
displayObjectSize:
|
|
45
|
-
displayDataTypes:
|
|
46
|
-
enableClipboard:
|
|
47
|
-
indentWidth:
|
|
48
|
-
value:
|
|
49
|
-
...
|
|
50
|
-
} =
|
|
51
|
-
t =
|
|
45
|
+
displayObjectSize: a,
|
|
46
|
+
displayDataTypes: f,
|
|
47
|
+
enableClipboard: c,
|
|
48
|
+
indentWidth: g,
|
|
49
|
+
value: h,
|
|
50
|
+
...x
|
|
51
|
+
} = n;
|
|
52
|
+
t = h, i = a === void 0 ? !1 : a, o = f === void 0 ? !1 : f, s = c === void 0 ? !0 : c, p = g === void 0 ? 12.8 : g, w = z("json-view", x), e[0] = n, e[1] = o, e[2] = i, e[3] = s, e[4] = p, e[5] = w, e[6] = t;
|
|
52
53
|
} else
|
|
53
|
-
o = e[1], i = e[2],
|
|
54
|
-
const
|
|
54
|
+
o = e[1], i = e[2], s = e[3], p = e[4], w = e[5], t = e[6];
|
|
55
|
+
const d = w;
|
|
56
|
+
if (t == null || typeof t != "object") {
|
|
57
|
+
let a;
|
|
58
|
+
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = r("Text"), e[7] = a) : a = e[7];
|
|
59
|
+
const f = String(t);
|
|
60
|
+
let c;
|
|
61
|
+
return e[8] !== f ? (c = /* @__PURE__ */ l(I, { c: a, children: f }), e[8] = f, e[9] = c) : c = e[9], c;
|
|
62
|
+
}
|
|
63
|
+
let m;
|
|
64
|
+
e[10] !== d.style ? (m = d.style ?? {}, e[10] = d.style, e[11] = m) : m = e[11];
|
|
55
65
|
let v;
|
|
56
|
-
e[
|
|
57
|
-
const y = v;
|
|
58
|
-
let p;
|
|
59
|
-
e[9] !== s.style ? (p = s.style ?? {}, e[9] = s.style, e[10] = p) : p = e[10];
|
|
60
|
-
let d;
|
|
61
|
-
e[11] !== p ? (d = {
|
|
66
|
+
e[12] !== m ? (v = {
|
|
62
67
|
...q,
|
|
63
|
-
...
|
|
64
|
-
}, e[
|
|
65
|
-
let
|
|
66
|
-
e[
|
|
67
|
-
let
|
|
68
|
-
return e[
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
] }), e[
|
|
68
|
+
...m
|
|
69
|
+
}, e[12] = m, e[13] = v) : v = e[13];
|
|
70
|
+
let j, y;
|
|
71
|
+
e[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ l(u.Arrow, { render: B }), y = /* @__PURE__ */ l(u.Copied, { render: J }), e[14] = j, e[15] = y) : (j = e[14], y = e[15]);
|
|
72
|
+
let b;
|
|
73
|
+
return e[16] !== o || e[17] !== i || e[18] !== s || e[19] !== p || e[20] !== d || e[21] !== v || e[22] !== t ? (b = /* @__PURE__ */ _(u, { displayObjectSize: i, displayDataTypes: o, enableClipboard: s, indentWidth: p, ...d, value: t, style: v, children: [
|
|
74
|
+
j,
|
|
75
|
+
y
|
|
76
|
+
] }), e[16] = o, e[17] = i, e[18] = s, e[19] = p, e[20] = d, e[21] = v, e[22] = t, e[23] = b) : b = e[23], b;
|
|
72
77
|
};
|
|
73
|
-
function B(
|
|
78
|
+
function B(n) {
|
|
74
79
|
const {
|
|
75
80
|
"data-expanded": e,
|
|
76
81
|
...o
|
|
77
|
-
} =
|
|
78
|
-
return /* @__PURE__ */ l("span", { ...o, className: "json-view__arrow", "data-expanded": e, children: /* @__PURE__ */ l(
|
|
82
|
+
} = n;
|
|
83
|
+
return /* @__PURE__ */ l("span", { ...o, className: "json-view__arrow", "data-expanded": e, children: /* @__PURE__ */ l(C, { size: 13 }) });
|
|
79
84
|
}
|
|
80
|
-
function J(
|
|
85
|
+
function J(n) {
|
|
81
86
|
const {
|
|
82
87
|
"data-copied": e,
|
|
83
88
|
onClick: o,
|
|
84
89
|
...i
|
|
85
|
-
} =
|
|
86
|
-
return /* @__PURE__ */ l("span", { ...i, onClick: o, className: "json-view__copy", "data-copied": e, children: /* @__PURE__ */ l(S, { mode: "wait", initial: !1, children: /* @__PURE__ */ l(
|
|
90
|
+
} = n;
|
|
91
|
+
return /* @__PURE__ */ l("span", { ...i, onClick: o, className: "json-view__copy", "data-copied": e, children: /* @__PURE__ */ l(S, { mode: "wait", initial: !1, children: /* @__PURE__ */ l(E.span, { initial: {
|
|
87
92
|
opacity: 0,
|
|
88
93
|
scale: 0.5,
|
|
89
94
|
filter: "blur(0.35rem)"
|
|
@@ -100,7 +105,7 @@ function J(a) {
|
|
|
100
105
|
ease: "easeIn"
|
|
101
106
|
}, style: {
|
|
102
107
|
display: "inline-flex"
|
|
103
|
-
}, children: e ? /* @__PURE__ */ l(
|
|
108
|
+
}, children: e ? /* @__PURE__ */ l(N, { size: 13 }) : /* @__PURE__ */ l(k, { size: 13 }) }, e ? "check" : "copy") }) });
|
|
104
109
|
}
|
|
105
110
|
export {
|
|
106
111
|
K as JsonView
|