@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.
- package/dist/{B4MFY5CR-BZLbrbU9.js → B4MFY5CR-C-y1qMcz.js} +1 -1
- package/dist/{B4MFY5CR-CrFfLRY2.cjs → B4MFY5CR-CZIhZc_v.cjs} +1 -1
- package/dist/{HO4MOOFI-DgTndXY6.js → HO4MOOFI-D1WZ0Hg3.js} +2 -2
- package/dist/{HO4MOOFI-CpUW02ii.cjs → HO4MOOFI-iH74XHta.cjs} +1 -1
- package/dist/{HUY7CZI3-COZlEkVr.cjs → HUY7CZI3-Bf9J-1mq.cjs} +1 -1
- package/dist/{HUY7CZI3-B-83eNUU.js → HUY7CZI3-DABOTt0o.js} +2 -2
- package/dist/{asset-metadata-editor-r5vYHUfm.js → asset-metadata-editor-CyTBhS-V.js} +9 -9
- package/dist/{asset-metadata-editor-zw9u1BB9.cjs → asset-metadata-editor-IRTgc3or.cjs} +1 -1
- package/dist/digital-asset-manager-CI-fxUjE.cjs +1 -0
- package/dist/{digital-asset-manager-cGBJUg2A.js → digital-asset-manager-ty2MhSyj.js} +188 -176
- package/dist/{image-editor-CwVua57o.js → image-editor-By8RDHso.js} +20 -20
- package/dist/{image-editor-D8wu5UNM.cjs → image-editor-DHmv5L8S.cjs} +1 -1
- package/dist/{index-CCLkatX6.js → index-B9yYtFHS.js} +3 -3
- package/dist/{index-B3cE059x.cjs → index-D6MzyrPC.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +6 -4
- package/dist/server.js +108 -90
- package/package.json +3 -3
- package/dist/digital-asset-manager-DZTV3jDX.cjs +0 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import S from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
const R =
|
|
8
|
-
({ imageUrl: n, onSave:
|
|
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
|
-
|
|
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
|
-
() =>
|
|
17
|
+
() => S((e, o = !1) => {
|
|
18
18
|
const t = e.imageBase64;
|
|
19
|
-
|
|
19
|
+
i(t, o), c(!1);
|
|
20
20
|
}, 300),
|
|
21
|
-
[
|
|
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),
|
|
29
|
-
}, [
|
|
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:
|
|
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:
|
|
66
|
+
icon: E
|
|
67
67
|
}
|
|
68
68
|
] : [],
|
|
69
69
|
[m, a]
|
|
70
70
|
);
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
|
|
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__ */
|
|
77
|
-
|
|
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"),
|
|
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-
|
|
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-
|
|
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-
|
|
7637
|
+
() => import("./digital-asset-manager-ty2MhSyj.js")
|
|
7638
7638
|
);
|
|
7639
7639
|
ul();
|
|
7640
7640
|
ec();
|