@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 B } from "./InputWrapper.js";
4
- import I from "@uiw/react-codemirror";
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 x } from "../../utils/component.js";
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
- }], Y = p({
47
+ }], F = p({
45
48
  theme: "light",
46
49
  settings: u,
47
50
  styles: h
48
- }), F = e.memo((d) => {
51
+ }), Y = e.memo((f) => {
49
52
  const {
50
- title: f,
51
- right: E,
52
- left: T,
53
- rightType: b,
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: s,
60
- onChange: i,
62
+ formValidation: i,
63
+ onChange: g,
61
64
  wrapperComponent: k,
62
- ...g
63
- } = d, C = e.useMemo(() => o ? [...n, o] : n, [n, o]), M = e.useMemo(() => a.length === 0 ? Y : p({
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 = s?.setValue, y = e.useCallback((l) => {
68
- m?.(l), i?.(l);
69
- }, [m, i]), N = e.useMemo(() => x("editor-input", g), [g]);
70
- return /* @__PURE__ */ c(B, { title: f, description: _, right: E, left: T, rightType: b, leftType: S, formValidation: s, wrapperComponent: k, children: /* @__PURE__ */ c(I, { extensions: C, onChange: y, theme: M, ...N, basicSetup: P }) });
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
- F.displayName = "EditorInput";
75
+ Y.displayName = "EditorInput";
73
76
  export {
74
- F as EditorInput
77
+ Y as EditorInput
75
78
  };
@@ -1,14 +1,15 @@
1
- import { jsx as l, jsxs as N } from "react/jsx-runtime";
2
- import { c as k } from "../../_virtual/compiler-runtime.js";
3
- import b from "@uiw/react-json-view";
4
- import { IconChevronRight as T, IconCheck as z, IconCopy as I } from "@tabler/icons-react";
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 E } from "../../utils/component.js";
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 V } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
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 = (a) => {
40
- const e = k.c(23);
41
- let o, i, n, c, m, t;
42
- if (e[0] !== a) {
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: u,
45
- displayDataTypes: g,
46
- enableClipboard: h,
47
- indentWidth: x,
48
- value: _,
49
- ...C
50
- } = a;
51
- t = _, i = u === void 0 ? !1 : u, o = g === void 0 ? !1 : g, n = h === void 0 ? !0 : h, c = x === void 0 ? 12.8 : x, m = E("json-view", C), e[0] = a, e[1] = o, e[2] = i, e[3] = n, e[4] = c, e[5] = m, e[6] = 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], n = e[3], c = e[4], m = e[5], t = e[6];
54
- const s = m;
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[7] !== t ? (v = t == null || typeof t != "object" ? [t] : t, e[7] = t, e[8] = v) : v = e[8];
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
- ...p
64
- }, e[11] = p, e[12] = d) : d = e[12];
65
- let w, j;
66
- e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ l(b.Arrow, { render: B }), j = /* @__PURE__ */ l(b.Copied, { render: J }), e[13] = w, e[14] = j) : (w = e[13], j = e[14]);
67
- let f;
68
- return e[15] !== o || e[16] !== i || e[17] !== n || e[18] !== c || e[19] !== s || e[20] !== y || e[21] !== d ? (f = /* @__PURE__ */ N(b, { displayObjectSize: i, displayDataTypes: o, enableClipboard: n, indentWidth: c, ...s, value: y, style: d, children: [
69
- w,
70
- j
71
- ] }), e[15] = o, e[16] = i, e[17] = n, e[18] = c, e[19] = s, e[20] = y, e[21] = d, e[22] = f) : f = e[22], f;
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(a) {
78
+ function B(n) {
74
79
  const {
75
80
  "data-expanded": e,
76
81
  ...o
77
- } = a;
78
- return /* @__PURE__ */ l("span", { ...o, className: "json-view__arrow", "data-expanded": e, children: /* @__PURE__ */ l(T, { size: 13 }) });
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(a) {
85
+ function J(n) {
81
86
  const {
82
87
  "data-copied": e,
83
88
  onClick: o,
84
89
  ...i
85
- } = a;
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(V.span, { initial: {
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(z, { size: 13 }) : /* @__PURE__ */ l(I, { size: 13 }) }, e ? "check" : "copy") }) });
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "0.10.6",
3
+ "version": "0.10.7",
4
4
  "type": "module",
5
5
  "description": "A simple template for a custom React component library",
6
6
  "scripts": {