@loopr-ai/craft 0.4.1 → 0.5.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.
@@ -1,78 +1,54 @@
1
1
  import { jsx as f } from "react/jsx-runtime";
2
- import { getColorToHex as O } from "../../../global/colors.js";
3
- import { fontCustomizations as j } from "../../../global/theme.js";
4
- import { a as b, _ as p, b as W, i as M, g as _, c as d, P as r } from "../../../createTheme-f511f0cd.js";
5
- import * as $ from "react";
6
- import { g as N, s as R, a as U, c as A, b as E } from "../../../styled-9f5c49f8.js";
7
- const k = ["sx"], z = (o) => {
8
- var t, a;
9
- const n = {
10
- systemProps: {},
11
- otherProps: {}
12
- }, s = (t = o == null || (a = o.theme) == null ? void 0 : a.unstable_sxConfig) != null ? t : W;
13
- return Object.keys(o).forEach((e) => {
14
- s[e] ? n.systemProps[e] = o[e] : n.otherProps[e] = o[e];
15
- }), n;
16
- };
17
- function D(o) {
18
- const {
19
- sx: t
20
- } = o, a = b(o, k), {
21
- systemProps: n,
22
- otherProps: s
23
- } = z(a);
24
- let e;
25
- return Array.isArray(t) ? e = [n, ...t] : typeof t == "function" ? e = (...l) => {
26
- const i = t(...l);
27
- return M(i) ? p({}, n, i) : n;
28
- } : e = p({}, n, t), p({}, s, {
29
- sx: e
30
- });
31
- }
32
- function L(o) {
33
- return _("MuiTypography", o);
2
+ import { getColorToHex as W } from "../../../global/colors.js";
3
+ import { fontCustomizations as M } from "../../../global/theme.js";
4
+ import { g as O, c as b, a as p, _ as j, P as t } from "../../../createTheme-a4db2989.js";
5
+ import * as P from "react";
6
+ import { g as N, s as R, a as _, c as U, b as $ } from "../../../styled-d4863b7f.js";
7
+ import { e as z } from "../../../extendSxProp-db8b9da5.js";
8
+ function D(r) {
9
+ return O("MuiTypography", r);
34
10
  }
35
11
  N("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
36
- const V = ["align", "className", "component", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"], H = (o) => {
12
+ const E = ["align", "className", "component", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"], L = (r) => {
37
13
  const {
38
- align: t,
14
+ align: o,
39
15
  gutterBottom: a,
40
- noWrap: n,
41
- paragraph: s,
42
- variant: e,
43
- classes: l
44
- } = o, i = {
45
- root: ["root", e, o.align !== "inherit" && `align${d(t)}`, a && "gutterBottom", n && "noWrap", s && "paragraph"]
16
+ noWrap: e,
17
+ paragraph: i,
18
+ variant: n,
19
+ classes: h
20
+ } = r, s = {
21
+ root: ["root", n, r.align !== "inherit" && `align${b(o)}`, a && "gutterBottom", e && "noWrap", i && "paragraph"]
46
22
  };
47
- return E(i, L, l);
48
- }, J = R("span", {
23
+ return $(s, D, h);
24
+ }, V = R("span", {
49
25
  name: "MuiTypography",
50
26
  slot: "Root",
51
- overridesResolver: (o, t) => {
27
+ overridesResolver: (r, o) => {
52
28
  const {
53
29
  ownerState: a
54
- } = o;
55
- return [t.root, a.variant && t[a.variant], a.align !== "inherit" && t[`align${d(a.align)}`], a.noWrap && t.noWrap, a.gutterBottom && t.gutterBottom, a.paragraph && t.paragraph];
30
+ } = r;
31
+ return [o.root, a.variant && o[a.variant], a.align !== "inherit" && o[`align${b(a.align)}`], a.noWrap && o.noWrap, a.gutterBottom && o.gutterBottom, a.paragraph && o.paragraph];
56
32
  }
57
33
  })(({
58
- theme: o,
59
- ownerState: t
34
+ theme: r,
35
+ ownerState: o
60
36
  }) => p({
61
37
  margin: 0
62
- }, t.variant === "inherit" && {
38
+ }, o.variant === "inherit" && {
63
39
  // Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
64
40
  font: "inherit"
65
- }, t.variant !== "inherit" && o.typography[t.variant], t.align !== "inherit" && {
66
- textAlign: t.align
67
- }, t.noWrap && {
41
+ }, o.variant !== "inherit" && r.typography[o.variant], o.align !== "inherit" && {
42
+ textAlign: o.align
43
+ }, o.noWrap && {
68
44
  overflow: "hidden",
69
45
  textOverflow: "ellipsis",
70
46
  whiteSpace: "nowrap"
71
- }, t.gutterBottom && {
47
+ }, o.gutterBottom && {
72
48
  marginBottom: "0.35em"
73
- }, t.paragraph && {
49
+ }, o.paragraph && {
74
50
  marginBottom: 16
75
- })), y = {
51
+ })), u = {
76
52
  h1: "h1",
77
53
  h2: "h2",
78
54
  h3: "h3",
@@ -84,46 +60,46 @@ const V = ["align", "className", "component", "gutterBottom", "noWrap", "paragra
84
60
  body1: "p",
85
61
  body2: "p",
86
62
  inherit: "p"
87
- }, S = {
63
+ }, k = {
88
64
  primary: "primary.main",
89
65
  textPrimary: "text.primary",
90
66
  secondary: "secondary.main",
91
67
  textSecondary: "text.secondary",
92
68
  error: "error.main"
93
- }, q = (o) => S[o] || o, x = /* @__PURE__ */ $.forwardRef(function(t, a) {
94
- const n = U({
95
- props: t,
69
+ }, A = (r) => k[r] || r, d = /* @__PURE__ */ P.forwardRef(function(o, a) {
70
+ const e = _({
71
+ props: o,
96
72
  name: "MuiTypography"
97
- }), s = q(n.color), e = D(p({}, n, {
98
- color: s
73
+ }), i = A(e.color), n = z(p({}, e, {
74
+ color: i
99
75
  })), {
100
- align: l = "inherit",
101
- className: i,
102
- component: h,
76
+ align: h = "inherit",
77
+ className: s,
78
+ component: c,
103
79
  gutterBottom: v = !1,
104
80
  noWrap: T = !1,
105
81
  paragraph: g = !1,
106
- variant: c = "body1",
107
- variantMapping: m = y
108
- } = e, P = b(e, V), u = p({}, e, {
109
- align: l,
110
- color: s,
111
- className: i,
112
- component: h,
82
+ variant: l = "body1",
83
+ variantMapping: m = u
84
+ } = n, x = j(n, E), y = p({}, n, {
85
+ align: h,
86
+ color: i,
87
+ className: s,
88
+ component: c,
113
89
  gutterBottom: v,
114
90
  noWrap: T,
115
91
  paragraph: g,
116
- variant: c,
92
+ variant: l,
117
93
  variantMapping: m
118
- }), C = h || (g ? "p" : m[c] || y[c]) || "span", B = H(u);
119
- return /* @__PURE__ */ f(J, p({
120
- as: C,
94
+ }), B = c || (g ? "p" : m[l] || u[l]) || "span", C = L(y);
95
+ return /* @__PURE__ */ f(V, p({
96
+ as: B,
121
97
  ref: a,
122
- ownerState: u,
123
- className: A(B.root, i)
124
- }, P));
98
+ ownerState: y,
99
+ className: U(C.root, s)
100
+ }, x));
125
101
  });
126
- process.env.NODE_ENV !== "production" && (x.propTypes = {
102
+ process.env.NODE_ENV !== "production" && (d.propTypes = {
127
103
  // ----------------------------- Warning --------------------------------
128
104
  // | These PropTypes are generated from the TypeScript type definitions |
129
105
  // | To update them edit the d.ts file and run "yarn proptypes" |
@@ -132,29 +108,29 @@ process.env.NODE_ENV !== "production" && (x.propTypes = {
132
108
  * Set the text-align on the component.
133
109
  * @default 'inherit'
134
110
  */
135
- align: r.oneOf(["center", "inherit", "justify", "left", "right"]),
111
+ align: t.oneOf(["center", "inherit", "justify", "left", "right"]),
136
112
  /**
137
113
  * The content of the component.
138
114
  */
139
- children: r.node,
115
+ children: t.node,
140
116
  /**
141
117
  * Override or extend the styles applied to the component.
142
118
  */
143
- classes: r.object,
119
+ classes: t.object,
144
120
  /**
145
121
  * @ignore
146
122
  */
147
- className: r.string,
123
+ className: t.string,
148
124
  /**
149
125
  * The component used for the root node.
150
126
  * Either a string to use a HTML element or a component.
151
127
  */
152
- component: r.elementType,
128
+ component: t.elementType,
153
129
  /**
154
130
  * If `true`, the text will have a bottom margin.
155
131
  * @default false
156
132
  */
157
- gutterBottom: r.bool,
133
+ gutterBottom: t.bool,
158
134
  /**
159
135
  * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
160
136
  *
@@ -162,21 +138,21 @@ process.env.NODE_ENV !== "production" && (x.propTypes = {
162
138
  * (the element needs to have a width in order to overflow).
163
139
  * @default false
164
140
  */
165
- noWrap: r.bool,
141
+ noWrap: t.bool,
166
142
  /**
167
143
  * If `true`, the element will be a paragraph element.
168
144
  * @default false
169
145
  */
170
- paragraph: r.bool,
146
+ paragraph: t.bool,
171
147
  /**
172
148
  * The system prop that allows defining system overrides as well as additional CSS styles.
173
149
  */
174
- sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
150
+ sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
175
151
  /**
176
152
  * Applies the theme typography styles.
177
153
  * @default 'body1'
178
154
  */
179
- variant: r.oneOfType([r.oneOf(["body1", "body2", "button", "caption", "h1", "h2", "h3", "h4", "h5", "h6", "inherit", "overline", "subtitle1", "subtitle2"]), r.string]),
155
+ variant: t.oneOfType([t.oneOf(["body1", "body2", "button", "caption", "h1", "h2", "h3", "h4", "h5", "h6", "inherit", "overline", "subtitle1", "subtitle2"]), t.string]),
180
156
  /**
181
157
  * The component maps the variant prop to a range of different HTML element types.
182
158
  * For instance, subtitle1 to `<h6>`.
@@ -196,22 +172,22 @@ process.env.NODE_ENV !== "production" && (x.propTypes = {
196
172
  * inherit: 'p',
197
173
  * }
198
174
  */
199
- variantMapping: r.object
175
+ variantMapping: t.object
200
176
  });
201
- const w = x, X = ({
202
- type: o = "bodyText",
203
- textColor: t = "black",
177
+ const H = d, K = ({
178
+ type: r = "bodyText",
179
+ textColor: o = "black",
204
180
  children: a,
205
- sx: n,
206
- ...s
181
+ sx: e,
182
+ ...i
207
183
  }) => {
208
- const e = {
209
- ...j[o],
210
- color: O(t),
211
- ...n
184
+ const n = {
185
+ ...M[r],
186
+ color: W(o),
187
+ ...e
212
188
  };
213
- return /* @__PURE__ */ f(w, { sx: e, ...s, children: a });
189
+ return /* @__PURE__ */ f(H, { sx: n, ...i, children: a });
214
190
  };
215
191
  export {
216
- X as default
192
+ K as default
217
193
  };
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
2
- import { IconButtonOwnProps } from "@mui/material/IconButton";
3
1
  import { ContainerOwnProps } from "@mui/material/Container";
4
2
  import { DividerOwnProps } from "@mui/material/Divider";
3
+ import { IconButtonOwnProps } from "@mui/material/IconButton";
4
+ import React from "react";
5
5
  import { ReactZoomPanPinchProps } from "react-zoom-pan-pinch";
6
6
  import { CraftFC } from "../../../global/interfaces";
7
7
  interface ZoomControllerProps {
@@ -9,12 +9,17 @@ interface ZoomControllerProps {
9
9
  zoomInButtonProps?: IconButtonOwnProps;
10
10
  zoomOutButtonProps?: IconButtonOwnProps;
11
11
  resetTransformButtonProps?: IconButtonOwnProps;
12
+ rotateButtonProps?: IconButtonOwnProps;
12
13
  dividerProps?: DividerOwnProps;
14
+ rotate: boolean;
15
+ handleRotate: () => void;
13
16
  }
14
17
  interface ZoomControlWithDragProps extends ReactZoomPanPinchProps {
15
18
  children?: React.ReactNode;
16
19
  parentContainerProps?: ContainerOwnProps;
17
20
  zoomControllerProps?: ZoomControllerProps;
21
+ isRotatedByDefault?: boolean;
22
+ onRotate?: (newValue: boolean) => void;
18
23
  }
19
24
  declare const ZoomControlWithDrag: CraftFC<ZoomControlWithDragProps>;
20
25
  export default ZoomControlWithDrag;