@code0-tech/pictor 0.10.5 → 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,15 +1,16 @@
1
- import { jsx as t, jsxs as h } from "react/jsx-runtime";
2
- import { c as x } from "../../_virtual/compiler-runtime.js";
3
- import j from "@uiw/react-json-view";
4
- import { IconChevronRight as _, IconCheck as C, IconCopy as N } 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 k } 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 { AnimatePresence as T } from "../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
11
- import { motion as z } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
12
- const I = {
10
+ import { Text as I } from "../text/Text.js";
11
+ import { AnimatePresence as S } from "../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
12
+ import { motion as E } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
13
+ const q = {
13
14
  "--w-rjv-font-family": '"Inter", sans-serif',
14
15
  "--w-rjv-font-size": "0.8rem",
15
16
  "--w-rjv-color": "rgba(255, 255, 255, 0.75)",
@@ -36,50 +37,58 @@ const I = {
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
- }, H = (l) => {
40
- const e = x.c(19);
41
- let o, i, a, n, d;
42
- if (e[0] !== l) {
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: y,
45
- displayDataTypes: b,
46
- enableClipboard: f,
47
- indentWidth: u,
48
- ...g
49
- } = l;
50
- i = y === void 0 ? !1 : y, o = b === void 0 ? !1 : b, a = f === void 0 ? !0 : f, n = u === void 0 ? 12.8 : u, d = k("json-view", g), e[0] = l, e[1] = o, e[2] = i, e[3] = a, e[4] = n, e[5] = d;
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;
51
53
  } else
52
- o = e[1], i = e[2], a = e[3], n = e[4], d = e[5];
53
- const c = d;
54
- let s;
55
- e[6] !== c.style ? (s = c.style ?? {}, e[6] = c.style, e[7] = s) : s = e[7];
56
- let p;
57
- e[8] !== s ? (p = {
58
- ...I,
59
- ...s
60
- }, e[8] = s, e[9] = p) : p = e[9];
61
- let m, w;
62
- e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ t(j.Arrow, { render: E }), w = /* @__PURE__ */ t(j.Copied, { render: S }), e[10] = m, e[11] = w) : (m = e[10], w = e[11]);
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];
63
65
  let v;
64
- return e[12] !== o || e[13] !== i || e[14] !== a || e[15] !== n || e[16] !== c || e[17] !== p ? (v = /* @__PURE__ */ h(j, { displayObjectSize: i, displayDataTypes: o, enableClipboard: a, indentWidth: n, ...c, style: p, children: [
65
- m,
66
- w
67
- ] }), e[12] = o, e[13] = i, e[14] = a, e[15] = n, e[16] = c, e[17] = p, e[18] = v) : v = e[18], v;
66
+ e[12] !== m ? (v = {
67
+ ...q,
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;
68
77
  };
69
- function E(l) {
78
+ function B(n) {
70
79
  const {
71
80
  "data-expanded": e,
72
81
  ...o
73
- } = l;
74
- return /* @__PURE__ */ t("span", { ...o, className: "json-view__arrow", "data-expanded": e, children: /* @__PURE__ */ t(_, { size: 13 }) });
82
+ } = n;
83
+ return /* @__PURE__ */ l("span", { ...o, className: "json-view__arrow", "data-expanded": e, children: /* @__PURE__ */ l(C, { size: 13 }) });
75
84
  }
76
- function S(l) {
85
+ function J(n) {
77
86
  const {
78
87
  "data-copied": e,
79
88
  onClick: o,
80
89
  ...i
81
- } = l;
82
- return /* @__PURE__ */ t("span", { ...i, onClick: o, className: "json-view__copy", "data-copied": e, children: /* @__PURE__ */ t(T, { mode: "wait", initial: !1, children: /* @__PURE__ */ t(z.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: {
83
92
  opacity: 0,
84
93
  scale: 0.5,
85
94
  filter: "blur(0.35rem)"
@@ -96,8 +105,8 @@ function S(l) {
96
105
  ease: "easeIn"
97
106
  }, style: {
98
107
  display: "inline-flex"
99
- }, children: e ? /* @__PURE__ */ t(C, { size: 13 }) : /* @__PURE__ */ t(N, { size: 13 }) }, e ? "check" : "copy") }) });
108
+ }, children: e ? /* @__PURE__ */ l(N, { size: 13 }) : /* @__PURE__ */ l(k, { size: 13 }) }, e ? "check" : "copy") }) });
100
109
  }
101
110
  export {
102
- H as JsonView
111
+ K as JsonView
103
112
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "0.10.5",
3
+ "version": "0.10.7",
4
4
  "type": "module",
5
5
  "description": "A simple template for a custom React component library",
6
6
  "scripts": {