@chaibuilder/pages 0.4.8 → 0.4.9

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,32 +1,32 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { memo as T, useState as p, useEffect as y, useMemo as s, useCallback as I } from "react";
3
- import S from "react-filerobot-image-editor";
4
- import { Dialog as w, DialogContent as E } from "@chaibuilder/sdk/ui";
5
- import { debounce as O } from "lodash-es";
6
- import { Save as k, Copy as A } from "lucide-react";
7
- const R = T(
8
- ({ imageUrl: n, onSave: d, onClose: i, defaultSavedImageName: g, isEditing: m = !1 }) => {
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { Dialog as T, DialogContent as y } from "@chaibuilder/sdk/ui";
3
+ import { debounce as S } from "lodash-es";
4
+ import { Save as w, Copy as E } from "lucide-react";
5
+ import { memo as O, useState as p, useEffect as k, useMemo as s, useCallback as I } from "react";
6
+ import A from "react-filerobot-image-editor";
7
+ const R = O(
8
+ ({ imageUrl: n, onSave: i, onClose: l, defaultSavedImageName: g, isEditing: m = !1 }) => {
9
9
  const [b, c] = p(!0), [h, C] = p(!1);
10
- y(() => {
10
+ k(() => {
11
11
  const e = new Image();
12
12
  return e.src = n, e.onload = () => C(!0), () => {
13
13
  e.onload = null;
14
14
  };
15
15
  }, [n]);
16
16
  const f = s(
17
- () => O((e, o = !1) => {
17
+ () => S((e, o = !1) => {
18
18
  const t = e.imageBase64;
19
- d(t, o), c(!1);
19
+ i(t, o), c(!1);
20
20
  }, 300),
21
- [d]
21
+ [i]
22
22
  ), a = I(
23
23
  (e, o = !1) => {
24
24
  f(e, o);
25
25
  },
26
26
  [f]
27
27
  ), u = I(() => {
28
- c(!1), i();
29
- }, [i]), r = s(
28
+ c(!1), l();
29
+ }, [l]), r = s(
30
30
  () => ({
31
31
  tabsIds: [
32
32
  "Adjust",
@@ -56,25 +56,25 @@ const R = T(
56
56
  onClick: (e, o) => o((...t) => {
57
57
  a(t[0], !1);
58
58
  }),
59
- icon: k
59
+ icon: w
60
60
  },
61
61
  {
62
62
  label: "Save as new file",
63
63
  onClick: (e, o) => o((...t) => {
64
64
  a(t[0], !0);
65
65
  }),
66
- icon: A
66
+ icon: E
67
67
  }
68
68
  ] : [],
69
69
  [m, a]
70
70
  );
71
- return /* @__PURE__ */ l(w, { open: !0, onOpenChange: (e) => !e && u(), children: /* @__PURE__ */ l(
72
- E,
71
+ return /* @__PURE__ */ d(T, { open: !0, onOpenChange: (e) => !e && u(), children: /* @__PURE__ */ d(
72
+ y,
73
73
  {
74
74
  id: "chai-image-editor-container",
75
75
  className: "flex-1 overflow-hidden p-4 min-w-[1280px]",
76
- children: b && h && /* @__PURE__ */ l(
77
- S,
76
+ children: b && h && /* @__PURE__ */ d(
77
+ A,
78
78
  {
79
79
  theme: v,
80
80
  source: n,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),t=require("react"),T=require("react-filerobot-image-editor"),I=require("@chaibuilder/sdk/ui"),y=require("lodash-es"),p=require("lucide-react"),b=t.memo(({imageUrl:n,onSave:r,onClose:d,defaultSavedImageName:g,isEditing:u=!1})=>{const[h,c]=t.useState(!0),[x,C]=t.useState(!1);t.useEffect(()=>{const e=new Image;return e.src=n,e.onload=()=>C(!0),()=>{e.onload=null}},[n]);const m=t.useMemo(()=>y.debounce((e,o=!1)=>{const a=e.imageBase64;r(a,o),c(!1)},300),[r]),s=t.useCallback((e,o=!1)=>{m(e,o)},[m]),f=t.useCallback(()=>{c(!1),d()},[d]),l=t.useMemo(()=>({tabsIds:["Adjust","Annotate","Watermark","Finetune","Resize","Filters"],defaultTabId:"Adjust",defaultToolId:"Crop"}),[]),v=t.useMemo(()=>({colors:{primary:"#000000",secondary:"#000000",tertiary:"#000000"}}),[]),S=t.useMemo(()=>u?[{label:"Update this file",onClick:(e,o)=>o((...a)=>{s(a[0],!1)}),icon:p.Save},{label:"Save as new file",onClick:(e,o)=>o((...a)=>{s(a[0],!0)}),icon:p.Copy}]:[],[u,s]);return i.jsx(I.Dialog,{open:!0,onOpenChange:e=>!e&&f(),children:i.jsx(I.DialogContent,{id:"chai-image-editor-container",className:"flex-1 overflow-hidden p-4 min-w-[1280px]",children:h&&x&&i.jsx(T,{theme:v,source:n,onSave:s,onClose:f,Text:{text:"Add text here"},Rotate:{angle:90,componentType:"slider"},tabsIds:l.tabsIds,defaultTabId:l.defaultTabId,defaultToolId:l.defaultToolId,savingPixelRatio:2,previewPixelRatio:1,defaultSavedImageName:g,moreSaveOptions:S,useZoomPresetsMenu:!0})})})});b.displayName="ImageEditor";exports.default=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),I=require("@chaibuilder/sdk/ui"),T=require("lodash-es"),p=require("lucide-react"),t=require("react"),y=require("react-filerobot-image-editor"),b=t.memo(({imageUrl:n,onSave:d,onClose:r,defaultSavedImageName:g,isEditing:u=!1})=>{const[h,c]=t.useState(!0),[x,C]=t.useState(!1);t.useEffect(()=>{const e=new Image;return e.src=n,e.onload=()=>C(!0),()=>{e.onload=null}},[n]);const m=t.useMemo(()=>T.debounce((e,o=!1)=>{const a=e.imageBase64;d(a,o),c(!1)},300),[d]),s=t.useCallback((e,o=!1)=>{m(e,o)},[m]),f=t.useCallback(()=>{c(!1),r()},[r]),l=t.useMemo(()=>({tabsIds:["Adjust","Annotate","Watermark","Finetune","Resize","Filters"],defaultTabId:"Adjust",defaultToolId:"Crop"}),[]),v=t.useMemo(()=>({colors:{primary:"#000000",secondary:"#000000",tertiary:"#000000"}}),[]),S=t.useMemo(()=>u?[{label:"Update this file",onClick:(e,o)=>o((...a)=>{s(a[0],!1)}),icon:p.Save},{label:"Save as new file",onClick:(e,o)=>o((...a)=>{s(a[0],!0)}),icon:p.Copy}]:[],[u,s]);return i.jsx(I.Dialog,{open:!0,onOpenChange:e=>!e&&f(),children:i.jsx(I.DialogContent,{id:"chai-image-editor-container",className:"flex-1 overflow-hidden p-4 min-w-[1280px]",children:h&&x&&i.jsx(y,{theme:v,source:n,onSave:s,onClose:f,Text:{text:"Add text here"},Rotate:{angle:90,componentType:"slider"},tabsIds:l.tabsIds,defaultTabId:l.defaultTabId,defaultToolId:l.defaultToolId,savingPixelRatio:2,previewPixelRatio:1,defaultSavedImageName:g,moreSaveOptions:S,useZoomPresetsMenu:!0})})})});b.displayName="ImageEditor";exports.default=b;
@@ -7422,7 +7422,7 @@ var Ed = (e, t = !1) => {
7422
7422
  const t = oa(() => {
7423
7423
  const n = this, [s] = R(this, yt), [a] = R(this, vt), [i] = R(this, Et), [l] = R(this, bt), [o] = R(this, gt);
7424
7424
  let c;
7425
- return R(this, wt) ? c = R(this, wt) : (c = ia(() => import("./HO4MOOFI-DgTndXY6.js")), te(this, wt, c)), Ca(R(this, Yt), R(this, pt)), ra(c, aa({
7425
+ return R(this, wt) ? c = R(this, wt) : (c = ia(() => import("./HO4MOOFI-D1WZ0Hg3.js")), te(this, wt, c)), Ca(R(this, Yt), R(this, pt)), ra(c, aa({
7426
7426
  get queryFlavor() {
7427
7427
  return R(n, zt);
7428
7428
  },
@@ -7516,7 +7516,7 @@ var Ed = (e, t = !1) => {
7516
7516
  const t = oa(() => {
7517
7517
  const n = this, [s] = R(this, At), [a] = R(this, xt), [i] = R(this, Tt), [l] = R(this, Ct), [o] = R(this, St), [c] = R(this, Pt);
7518
7518
  let h;
7519
- return R(this, _t) ? h = R(this, _t) : (h = ia(() => import("./HUY7CZI3-B-83eNUU.js")), te(this, _t, h)), Ca(R(this, en), R(this, Nt)), ra(h, aa({
7519
+ return R(this, _t) ? h = R(this, _t) : (h = ia(() => import("./HUY7CZI3-DABOTt0o.js")), te(this, _t, h)), Ca(R(this, en), R(this, Nt)), ra(h, aa({
7520
7520
  get queryFlavor() {
7521
7521
  return R(n, Zt);
7522
7522
  },
@@ -7634,7 +7634,7 @@ var Iu = process.env.NODE_ENV !== "development" ? function() {
7634
7634
  } : Pu;
7635
7635
  process.env.NODE_ENV;
7636
7636
  const ku = Qa(
7637
- () => import("./digital-asset-manager-cGBJUg2A.js")
7637
+ () => import("./digital-asset-manager-ty2MhSyj.js")
7638
7638
  );
7639
7639
  ul();
7640
7640
  ec();