vibrant-tool 0.1.4 → 0.1.5

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.
@@ -99600,7 +99600,7 @@ function PreviewModal({ onClose }) {
99600
99600
  const currentSide = useHistoryStore.getState().currentPage || "front";
99601
99601
  const editorPages = useEditorStore.getState().pages || {};
99602
99602
  const historyPages = useHistoryStore.getState().pages || {};
99603
- const currentUrl = getWorkareaDataUrl(canvas2);
99603
+ const currentUrl = getWorkareaDataUrl(canvas2, 2);
99604
99604
  const opposingSide = currentSide === "front" ? "back" : "front";
99605
99605
  const opposingJson = editorPages[opposingSide] || historyPages[opposingSide]?.history?.at(-1) || null;
99606
99606
  let opposingUrl = "";
@@ -99638,6 +99638,10 @@ function PreviewModal({ onClose }) {
99638
99638
  setRotY((dragRef.current.rotY + (e3.clientX - dragRef.current.x) * 0.5) % 360);
99639
99639
  setRotX(Math.max(-60, Math.min(60, dragRef.current.rotX - (e3.clientY - dragRef.current.y) * 0.5)));
99640
99640
  };
99641
+ const workarea = canvas2 ? canvas2.getObjects().find((o2) => o2.name === "workarea") : null;
99642
+ const waW = (workarea?.width ?? 1050) * (workarea?.scaleX ?? 1);
99643
+ const waH = (workarea?.height ?? 600) * (workarea?.scaleY ?? 1);
99644
+ const cardAspectRatio = waW && waH ? waW / waH : 1.75;
99641
99645
  const currentProof = activeSide === "front" ? frontUrl : backUrl;
99642
99646
  return /* @__PURE__ */ jsx("div", { className: "fixed inset-0 z-[99999] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 select-none", children: /* @__PURE__ */ jsxs("div", { className: "relative w-full max-w-4xl bg-white border border-gray-200 rounded-2xl shadow-2xl overflow-hidden flex flex-col h-[85vh]", children: [
99643
99647
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-5 py-3 border-b border-gray-200 bg-gray-50/90", children: [
@@ -99683,7 +99687,7 @@ function PreviewModal({ onClose }) {
99683
99687
  onMouseUp: () => setIsDragging(false),
99684
99688
  onMouseLeave: () => setIsDragging(false),
99685
99689
  className: `flex-1 relative overflow-hidden flex items-center justify-center bg-gradient-to-b from-slate-50 to-slate-100 ${viewMode === "3d" ? "cursor-grab active:cursor-grabbing" : ""}`,
99686
- children: viewMode === "3d" ? /* @__PURE__ */ jsxs("div", { className: "relative w-full h-full flex items-center justify-center [perspective:1200px]", children: [
99690
+ children: viewMode === "3d" ? /* @__PURE__ */ jsxs("div", { className: "relative w-full h-full flex items-center justify-center [perspective:1200px] p-6", children: [
99687
99691
  /* @__PURE__ */ jsxs(
99688
99692
  "div",
99689
99693
  {
@@ -99691,10 +99695,13 @@ function PreviewModal({ onClose }) {
99691
99695
  transform: `rotateX(${rotX}deg) rotateY(${rotY}deg)`,
99692
99696
  transformStyle: "preserve-3d",
99693
99697
  transition: isDragging ? "none" : "transform 0.15s cubic-bezier(0.1, 0.9, 0.2, 1)",
99694
- width: "420px",
99695
- height: "260px"
99698
+ aspectRatio: cardAspectRatio,
99699
+ width: cardAspectRatio >= 1 ? "min(85%, 680px)" : "auto",
99700
+ height: cardAspectRatio < 1 ? "min(80%, 520px)" : "auto",
99701
+ maxHeight: "80%",
99702
+ maxWidth: "85%"
99696
99703
  },
99697
- className: "relative will-change-transform shadow-2xl",
99704
+ className: "relative will-change-transform shadow-2xl rounded-xl",
99698
99705
  children: [
99699
99706
  /* @__PURE__ */ jsxs(
99700
99707
  "div",
@@ -99702,12 +99709,12 @@ function PreviewModal({ onClose }) {
99702
99709
  style: { backfaceVisibility: "hidden" },
99703
99710
  className: "absolute inset-0 rounded-xl overflow-hidden bg-white shadow-xl border border-gray-200",
99704
99711
  children: [
99705
- frontUrl ? /* @__PURE__ */ jsx("img", { src: frontUrl, alt: "Front", className: "w-full h-full object-contain pointer-events-none" }) : /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-400", children: "Front Design" }),
99712
+ frontUrl ? /* @__PURE__ */ jsx("img", { src: frontUrl, alt: "Front", className: "w-full h-full object-fill pointer-events-none block" }) : /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-400", children: "Front Design" }),
99706
99713
  /* @__PURE__ */ jsx(
99707
99714
  "div",
99708
99715
  {
99709
99716
  style: {
99710
- background: `linear-gradient(${120 + rotY * 0.8}deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 100%)`
99717
+ background: `linear-gradient(${120 + rotY * 0.8}deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.08) 100%)`
99711
99718
  },
99712
99719
  className: "absolute inset-0 pointer-events-none mix-blend-overlay opacity-80"
99713
99720
  }
@@ -99721,7 +99728,7 @@ function PreviewModal({ onClose }) {
99721
99728
  style: { transform: "rotateY(180deg)", backfaceVisibility: "hidden" },
99722
99729
  className: "absolute inset-0 rounded-xl overflow-hidden bg-white shadow-xl border border-gray-200",
99723
99730
  children: [
99724
- isTwoSided ? backUrl ? /* @__PURE__ */ jsx("img", { src: backUrl, alt: "Back", className: "w-full h-full object-contain pointer-events-none" }) : /* @__PURE__ */ jsxs("div", { className: "w-full h-full flex flex-col items-center justify-center text-xs text-gray-400 p-4 text-center", children: [
99731
+ isTwoSided ? backUrl ? /* @__PURE__ */ jsx("img", { src: backUrl, alt: "Back", className: "w-full h-full object-fill pointer-events-none block" }) : /* @__PURE__ */ jsxs("div", { className: "w-full h-full flex flex-col items-center justify-center text-xs text-gray-400 p-4 text-center", children: [
99725
99732
  /* @__PURE__ */ jsx("span", { className: "font-semibold text-gray-600", children: "Back Side" }),
99726
99733
  /* @__PURE__ */ jsx("span", { className: "text-[10px] text-gray-400 mt-1", children: "Design added to Back tab will render here" })
99727
99734
  ] }) : /* @__PURE__ */ jsx("div", { className: "w-full h-full bg-slate-50 flex items-center justify-center text-xs text-gray-400", children: "Single-sided Product" }),
@@ -99729,37 +99736,29 @@ function PreviewModal({ onClose }) {
99729
99736
  "div",
99730
99737
  {
99731
99738
  style: {
99732
- background: `linear-gradient(${120 - rotY * 0.8}deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 100%)`
99739
+ background: `linear-gradient(${120 - rotY * 0.8}deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.08) 100%)`
99733
99740
  },
99734
99741
  className: "absolute inset-0 pointer-events-none mix-blend-overlay opacity-80"
99735
99742
  }
99736
99743
  )
99737
99744
  ]
99738
99745
  }
99739
- ),
99740
- /* @__PURE__ */ jsx("div", { style: { transform: "translateZ(-1px)" }, className: "absolute inset-0 rounded-xl bg-gray-300 -z-10 shadow-md" })
99746
+ )
99741
99747
  ]
99742
99748
  }
99743
99749
  ),
99744
- /* @__PURE__ */ jsx(
99745
- "div",
99746
- {
99747
- style: { transform: `rotateX(90deg) translateZ(-150px)` },
99748
- className: "absolute w-72 h-24 bg-black/20 blur-xl rounded-full pointer-events-none"
99749
- }
99750
- ),
99751
99750
  /* @__PURE__ */ jsxs("div", { className: "absolute top-4 left-4 bg-white/80 backdrop-blur-md px-3 py-1 rounded-full border border-gray-200 text-[11px] text-gray-600 pointer-events-none flex items-center gap-1.5 shadow-sm", children: [
99752
99751
  /* @__PURE__ */ jsx("span", { className: "w-2 h-2 rounded-full bg-[#02bc71] animate-ping" }),
99753
99752
  /* @__PURE__ */ jsx("span", { children: "Drag to Rotate 360°" })
99754
99753
  ] })
99755
- ] }) : /* @__PURE__ */ jsxs("div", { className: "p-6 flex flex-col items-center justify-center", children: [
99756
- isTwoSided && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-4 bg-gray-200 p-0.5 rounded-lg border border-gray-300 text-xs", children: [
99754
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "relative w-full h-full flex items-center justify-center p-6", children: [
99755
+ isTwoSided && /* @__PURE__ */ jsxs("div", { className: "absolute top-4 left-1/2 -translate-x-1/2 flex items-center gap-2 bg-gray-200/90 backdrop-blur-sm p-1 rounded-xl border border-gray-300 text-xs shadow-sm z-20", children: [
99757
99756
  /* @__PURE__ */ jsx(
99758
99757
  "button",
99759
99758
  {
99760
99759
  type: "button",
99761
99760
  onClick: () => setActiveSide("front"),
99762
- className: `px-3 py-1 rounded-md font-semibold cursor-pointer ${activeSide === "front" ? "bg-[#02bc71] text-white shadow-sm" : "text-gray-600 hover:text-gray-900"}`,
99761
+ className: `px-3 py-1 rounded-lg font-semibold cursor-pointer transition-all ${activeSide === "front" ? "bg-[#02bc71] text-white shadow-sm" : "text-gray-600 hover:text-gray-900"}`,
99763
99762
  children: "Front Proof"
99764
99763
  }
99765
99764
  ),
@@ -99768,12 +99767,32 @@ function PreviewModal({ onClose }) {
99768
99767
  {
99769
99768
  type: "button",
99770
99769
  onClick: () => setActiveSide("back"),
99771
- className: `px-3 py-1 rounded-md font-semibold cursor-pointer ${activeSide === "back" ? "bg-[#02bc71] text-white shadow-sm" : "text-gray-600 hover:text-gray-900"}`,
99770
+ className: `px-3 py-1 rounded-lg font-semibold cursor-pointer transition-all ${activeSide === "back" ? "bg-[#02bc71] text-white shadow-sm" : "text-gray-600 hover:text-gray-900"}`,
99772
99771
  children: "Back Proof"
99773
99772
  }
99774
99773
  )
99775
99774
  ] }),
99776
- currentProof ? /* @__PURE__ */ jsx("div", { className: "rounded-xl border border-gray-200 bg-white p-2 shadow-xl max-w-full", children: /* @__PURE__ */ jsx("img", { src: currentProof, alt: "2D Proof", className: "max-h-[50vh] w-auto object-contain rounded-lg" }) }) : /* @__PURE__ */ jsxs("div", { className: "p-8 text-center bg-gray-50 rounded-xl border border-gray-200 text-xs text-gray-400", children: [
99775
+ currentProof ? /* @__PURE__ */ jsx(
99776
+ "div",
99777
+ {
99778
+ style: {
99779
+ aspectRatio: cardAspectRatio,
99780
+ width: cardAspectRatio >= 1 ? "min(85%, 680px)" : "auto",
99781
+ height: cardAspectRatio < 1 ? "min(80%, 520px)" : "auto",
99782
+ maxHeight: "80%",
99783
+ maxWidth: "85%"
99784
+ },
99785
+ className: "relative rounded-xl overflow-hidden bg-white shadow-2xl border border-gray-200 flex items-center justify-center",
99786
+ children: /* @__PURE__ */ jsx(
99787
+ "img",
99788
+ {
99789
+ src: currentProof,
99790
+ alt: `${activeSide} 2D Proof`,
99791
+ className: "w-full h-full object-fill pointer-events-none block"
99792
+ }
99793
+ )
99794
+ }
99795
+ ) : /* @__PURE__ */ jsxs("div", { className: "p-8 text-center bg-gray-50 rounded-xl border border-gray-200 text-xs text-gray-400", children: [
99777
99796
  "No preview available for ",
99778
99797
  activeSide,
99779
99798
  " side."
@@ -100387,7 +100406,7 @@ function Panel({ panelName }) {
100387
100406
  onClick: () => setActivePanel(null)
100388
100407
  }
100389
100408
  ),
100390
- /* @__PURE__ */ jsxs("div", { className: `fixed md:relative bottom-0 left-0 right-0 md:bottom-auto md:left-auto z-50 transition-all duration-300 ease-in-out`, children: [
100409
+ /* @__PURE__ */ jsxs("div", { className: `fixed md:relative bottom-0 left-0 right-0 md:bottom-auto md:left-auto z-50 transition-all duration-300 ease-in-out md:h-full`, children: [
100391
100410
  /* @__PURE__ */ jsxs(
100392
100411
  "div",
100393
100412
  {
@@ -100407,7 +100426,7 @@ function Panel({ panelName }) {
100407
100426
  }
100408
100427
  )
100409
100428
  ] }),
100410
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto pt-4", children: panelName })
100429
+ /* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 overflow-y-auto pt-4 flex flex-col custom-scrollbar", children: panelName })
100411
100430
  ]
100412
100431
  }
100413
100432
  ),
@@ -100572,7 +100591,7 @@ function TemplatesPanel() {
100572
100591
  }
100573
100592
  )
100574
100593
  ] }),
100575
- /* @__PURE__ */ jsx("div", { ref: scrollRef, className: "h-[calc(100vh-125px)] overflow-auto", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 pb-12 mx-4", children: [
100594
+ /* @__PURE__ */ jsx("div", { ref: scrollRef, className: "h-[calc(100vh-125px)] overflow-auto custom-scrollbar", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 pb-12 mx-4", children: [
100576
100595
  templates.map((tpl) => /* @__PURE__ */ jsx(
100577
100596
  "button",
100578
100597
  {
@@ -101296,7 +101315,7 @@ function ElementsPanel() {
101296
101315
  ] })
101297
101316
  ] }),
101298
101317
  /* @__PURE__ */ jsx("hr", { className: "text-neutral-800 h-[0.5px]" }),
101299
- /* @__PURE__ */ jsxs("div", { className: "h-[calc(100dvh-180px)] overflow-auto", children: [
101318
+ /* @__PURE__ */ jsxs("div", { className: "h-[calc(100dvh-180px)] overflow-auto custom-scrollbar", children: [
101300
101319
  recentItems.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mx-4", children: [
101301
101320
  /* @__PURE__ */ jsxs("div", { className: "py-5", children: [
101302
101321
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
@@ -101553,7 +101572,7 @@ function TextPanel() {
101553
101572
  )
101554
101573
  ] }),
101555
101574
  /* @__PURE__ */ jsx("hr", { className: "text-neutral-800 h-[0.5px] my-4" }),
101556
- /* @__PURE__ */ jsx("div", { ref: scrollRef, className: "h-[calc(100vh-250px)] overflow-auto", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 pb-12 mx-4", children: [
101575
+ /* @__PURE__ */ jsx("div", { ref: scrollRef, className: "h-[calc(100vh-250px)] overflow-auto custom-scrollbar", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 pb-12 mx-4", children: [
101557
101576
  textElements.map((tpl, index) => /* @__PURE__ */ jsx(
101558
101577
  "button",
101559
101578
  {
@@ -101735,6 +101754,23 @@ function InstagramIcon() {
101735
101754
  );
101736
101755
  }
101737
101756
  const VibrantLogo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABGCAMAAAC+PCsEAAAC7lBMVEUAAAAyMjIzMzMwMDAzMzNtmZJxfnoyMjI1NTUwMDBvmpYaGhoaFx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GqFmVoWlgJQev7j64l3OOGZprgNBd9dCSMXtArzF9TYrYLleaOixHo+QkbsSBH8TzOC0hBoA7E9Fi4Qcp3bddDWjHbTg2CKerwhPcMUAZaMhZGvishf/8hXwDf/LQfNeBDzwAAAAASUVORK5CYII=";
101757
+ const VibrantImageService = {
101758
+ async getFolderData(params = {}) {
101759
+ const { item = "Small", page = 1, limit = 30, search = "" } = params;
101760
+ const query = new URLSearchParams();
101761
+ if (item) query.set("item", item);
101762
+ if (page) query.set("page", String(page));
101763
+ if (limit) query.set("limit", String(limit));
101764
+ if (search) query.set("search", search);
101765
+ const res = await apiUploadImage(
101766
+ `/folder-data?${query.toString()}`,
101767
+ {
101768
+ method: "GET"
101769
+ }
101770
+ );
101771
+ return res;
101772
+ }
101773
+ };
101738
101774
  function useSocialAuth({
101739
101775
  onImageSelect
101740
101776
  }) {
@@ -101892,10 +101928,12 @@ const imageOptions = [
101892
101928
  ];
101893
101929
  function PhotosPanel() {
101894
101930
  const { startLoading, stopLoading, isLoading } = useLoaderStore();
101931
+ const [source, setSource] = useState("external");
101895
101932
  const [socialImages, setSocialImages] = useState([]);
101896
101933
  const [page, setPage] = useState(1);
101897
101934
  const [hasMore, setHasMore] = useState(true);
101898
101935
  const [category, setCategory] = useState(imageOptions[0]);
101936
+ const [searchQuery, setSearchQuery] = useState("");
101899
101937
  const scrollRef = useRef(null);
101900
101938
  const {
101901
101939
  handleGoogleAuth,
@@ -101920,32 +101958,57 @@ function PhotosPanel() {
101920
101958
  }
101921
101959
  });
101922
101960
  const fetchImages = useCallback(
101923
- async (q2, pageNo) => {
101961
+ async (q2, pageNo, currentSource = source) => {
101924
101962
  startLoading();
101925
101963
  try {
101926
- const res = await ShapeService.getAllExternal({
101927
- page: pageNo,
101928
- limit: 30,
101929
- keyType: "all",
101930
- isVector: false,
101931
- query: q2
101932
- });
101933
- const newItems = res.items.filter(
101934
- (x2) => x2.status && x2.image
101935
- );
101936
- setSocialImages(
101937
- (prev) => pageNo === 1 ? newItems : [...prev, ...newItems]
101938
- );
101939
- if (newItems.length < 20) setHasMore(false);
101964
+ if (currentSource === "vibrant") {
101965
+ const res = await VibrantImageService.getFolderData({
101966
+ item: "Small",
101967
+ page: pageNo,
101968
+ limit: 30,
101969
+ search: q2 || void 0
101970
+ });
101971
+ const newItems = (res.files || []).map((f) => ({
101972
+ _id: f.key,
101973
+ status: true,
101974
+ category: "vibrant",
101975
+ image: f.smallUrl || f.url,
101976
+ largeImage: f.largeUrl || f.url,
101977
+ tags: [f.name]
101978
+ }));
101979
+ setSocialImages(
101980
+ (prev) => pageNo === 1 ? newItems : [...prev, ...newItems]
101981
+ );
101982
+ if (newItems.length < 20) setHasMore(false);
101983
+ else setHasMore(true);
101984
+ } else {
101985
+ const res = await ShapeService.getAllExternal({
101986
+ page: pageNo,
101987
+ limit: 30,
101988
+ keyType: "all",
101989
+ isVector: false,
101990
+ query: q2
101991
+ });
101992
+ const newItems = res.items.filter(
101993
+ (x2) => x2.status && x2.image
101994
+ );
101995
+ setSocialImages(
101996
+ (prev) => pageNo === 1 ? newItems : [...prev, ...newItems]
101997
+ );
101998
+ if (newItems.length < 20) setHasMore(false);
101999
+ else setHasMore(true);
102000
+ }
102001
+ } catch (err) {
102002
+ console.error("Failed to fetch images:", err);
101940
102003
  } finally {
101941
102004
  stopLoading();
101942
102005
  }
101943
102006
  },
101944
- [startLoading, stopLoading]
102007
+ [startLoading, stopLoading, source]
101945
102008
  );
101946
102009
  useEffect(() => {
101947
- fetchImages(category, 1);
101948
- }, []);
102010
+ fetchImages(searchQuery || (source === "vibrant" ? "" : category), 1, source);
102011
+ }, [source]);
101949
102012
  useEffect(() => {
101950
102013
  const el = scrollRef.current;
101951
102014
  if (!el) return;
@@ -101954,13 +102017,13 @@ function PhotosPanel() {
101954
102017
  if (el.scrollTop + el.clientHeight >= el.scrollHeight - 200) {
101955
102018
  const next = page + 1;
101956
102019
  setPage(next);
101957
- fetchImages(category, next);
102020
+ fetchImages(searchQuery || (source === "vibrant" ? "" : category), next, source);
101958
102021
  }
101959
102022
  };
101960
102023
  el.addEventListener("scroll", onScroll);
101961
102024
  return () => el.removeEventListener("scroll", onScroll);
101962
- }, [hasMore, isLoading]);
101963
- return /* @__PURE__ */ jsxs(Fragment, { children: [
102025
+ }, [hasMore, isLoading, page, searchQuery, category, source, fetchImages]);
102026
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-full min-h-0", children: [
101964
102027
  /* @__PURE__ */ jsx("script", { src: "https://apis.google.com/js/api.js" }),
101965
102028
  /* @__PURE__ */ jsx(
101966
102029
  "script",
@@ -101980,73 +102043,159 @@ function PhotosPanel() {
101980
102043
  });
101981
102044
  }
101982
102045
  } }),
101983
- /* @__PURE__ */ jsx("div", { className: "bg-neutral-800 px-3 py-2 rounded flex items-center gap-2 mb-4 mx-4", children: /* @__PURE__ */ jsx(
101984
- "input",
101985
- {
101986
- className: "bg-transparent outline-none text-sm text-gray-300 w-full",
101987
- onKeyDown: (e3) => {
101988
- e3.stopPropagation();
101989
- if (e3.key === "Enter") {
101990
- fetchImages(e3.target.value, 1);
102046
+ /* @__PURE__ */ jsxs("div", { className: "shrink-0 pt-4", children: [
102047
+ /* @__PURE__ */ jsx("div", { className: "bg-neutral-800 px-3 py-2 rounded flex items-center gap-2 mb-3 mx-4", children: /* @__PURE__ */ jsx(
102048
+ "input",
102049
+ {
102050
+ className: "bg-transparent outline-none text-sm text-gray-300 w-full",
102051
+ placeholder: source === "vibrant" ? "Search Vibrant Images..." : "Search Stock Photos...",
102052
+ value: searchQuery,
102053
+ onChange: (e3) => setSearchQuery(e3.target.value),
102054
+ onKeyDown: (e3) => {
102055
+ e3.stopPropagation();
102056
+ if (e3.key === "Enter") {
102057
+ setPage(1);
102058
+ fetchImages(searchQuery, 1, source);
102059
+ }
101991
102060
  }
101992
102061
  }
101993
- }
101994
- ) }),
101995
- /* @__PURE__ */ jsxs("div", { className: "m-4", children: [
101996
- /* @__PURE__ */ jsx("h2", { className: "text-md font-medium mb-3", children: "Upload From Other Media" }),
101997
- /* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
101998
- /* @__PURE__ */ jsx("button", { type: "button", className: "cursor-pointer", onClick: () => handleGoogleAuth("googledrives"), children: /* @__PURE__ */ jsx(GoogleDriveIcon, {}) }),
101999
- /* @__PURE__ */ jsx("button", { type: "button", className: "cursor-pointer", onClick: () => handleGoogleAuth("googlephotos"), children: /* @__PURE__ */ jsx(GooglePhotoIcon, {}) }),
102000
- /* @__PURE__ */ jsx("button", { type: "button", className: "cursor-pointer", onClick: handleDropboxAuth, children: /* @__PURE__ */ jsx(
102001
- "img",
102002
- {
102003
- src: "https://vibrantprintshopimage.s3.amazonaws.com/dropbox.svg",
102004
- alt: "dropbox",
102005
- height: 30,
102006
- width: 30,
102007
- className: "object-contain"
102008
- }
102009
- ) }),
102010
- /* @__PURE__ */ jsx("button", { type: "button", className: "cursor-pointer", onClick: handleFacebookAuth, children: /* @__PURE__ */ jsx(FacebookIcon, {}) }),
102011
- /* @__PURE__ */ jsx("button", { type: "button", className: "cursor-pointer", onClick: handleInstagramAuth, children: /* @__PURE__ */ jsx(InstagramIcon, {}) }),
102012
- /* @__PURE__ */ jsx("button", { type: "button", className: "cursor-pointer", children: /* @__PURE__ */ jsx(
102013
- "img",
102062
+ ) }),
102063
+ /* @__PURE__ */ jsxs("div", { className: "mx-4 mb-3", children: [
102064
+ /* @__PURE__ */ jsx("h2", { className: "text-md font-medium mb-2 text-gray-200", children: "Upload From Other Media" }),
102065
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
102066
+ /* @__PURE__ */ jsx(
102067
+ "button",
102068
+ {
102069
+ type: "button",
102070
+ className: "cursor-pointer p-1.5 rounded-lg hover:bg-white/10 transition-colors",
102071
+ onClick: () => handleGoogleAuth("googledrives"),
102072
+ title: "Google Drive",
102073
+ children: /* @__PURE__ */ jsx(GoogleDriveIcon, {})
102074
+ }
102075
+ ),
102076
+ /* @__PURE__ */ jsx(
102077
+ "button",
102078
+ {
102079
+ type: "button",
102080
+ className: "cursor-pointer p-1.5 rounded-lg hover:bg-white/10 transition-colors",
102081
+ onClick: () => handleGoogleAuth("googlephotos"),
102082
+ title: "Google Photos",
102083
+ children: /* @__PURE__ */ jsx(GooglePhotoIcon, {})
102084
+ }
102085
+ ),
102086
+ /* @__PURE__ */ jsx(
102087
+ "button",
102088
+ {
102089
+ type: "button",
102090
+ className: "cursor-pointer p-1.5 rounded-lg hover:bg-white/10 transition-colors",
102091
+ onClick: handleDropboxAuth,
102092
+ title: "Dropbox",
102093
+ children: /* @__PURE__ */ jsx(
102094
+ "img",
102095
+ {
102096
+ src: "https://vibrantprintshopimage.s3.amazonaws.com/dropbox.svg",
102097
+ alt: "dropbox",
102098
+ height: 26,
102099
+ width: 26,
102100
+ className: "object-contain"
102101
+ }
102102
+ )
102103
+ }
102104
+ ),
102105
+ /* @__PURE__ */ jsx(
102106
+ "button",
102107
+ {
102108
+ type: "button",
102109
+ className: "cursor-pointer p-1.5 rounded-lg hover:bg-white/10 transition-colors",
102110
+ onClick: handleFacebookAuth,
102111
+ title: "Facebook",
102112
+ children: /* @__PURE__ */ jsx(FacebookIcon, {})
102113
+ }
102114
+ ),
102115
+ /* @__PURE__ */ jsx(
102116
+ "button",
102117
+ {
102118
+ type: "button",
102119
+ className: "cursor-pointer p-1.5 rounded-lg hover:bg-white/10 transition-colors",
102120
+ onClick: handleInstagramAuth,
102121
+ title: "Instagram",
102122
+ children: /* @__PURE__ */ jsx(InstagramIcon, {})
102123
+ }
102124
+ ),
102125
+ /* @__PURE__ */ jsx(
102126
+ "button",
102127
+ {
102128
+ type: "button",
102129
+ onClick: () => {
102130
+ setSource("vibrant");
102131
+ setPage(1);
102132
+ setSearchQuery("");
102133
+ fetchImages("", 1, "vibrant");
102134
+ },
102135
+ title: "Vibrant Stock Images",
102136
+ className: "cursor-pointer",
102137
+ children: /* @__PURE__ */ jsx(
102138
+ "img",
102139
+ {
102140
+ src: VibrantLogo,
102141
+ alt: "vibrant",
102142
+ height: 64,
102143
+ width: 64,
102144
+ className: "object-contain"
102145
+ }
102146
+ )
102147
+ }
102148
+ )
102149
+ ] })
102150
+ ] }),
102151
+ /* @__PURE__ */ jsx("hr", { className: "text-neutral-800 h-[0.5px] my-3" }),
102152
+ source === "external" ? /* @__PURE__ */ jsx("div", { className: "mx-4 mb-3", children: /* @__PURE__ */ jsx("div", { className: "flex gap-2 overflow-auto scrollbar-none custom-scrollbar", children: imageOptions.map((item) => /* @__PURE__ */ jsx(
102153
+ "button",
102154
+ {
102155
+ className: `px-2 py-1 rounded-sm shrink-0 text-xs ${item === category ? "bg-[#02bc71] text-white" : "bg-[#8f99a826]"}`,
102156
+ onClick: () => {
102157
+ setCategory(item);
102158
+ setSocialImages([]);
102159
+ setPage(1);
102160
+ fetchImages(item.toLowerCase(), 1, "external");
102161
+ },
102162
+ children: item
102163
+ },
102164
+ item
102165
+ )) }) }) : /* @__PURE__ */ jsxs("div", { className: "mx-4 mb-3 flex items-center justify-between", children: [
102166
+ /* @__PURE__ */ jsxs("span", { className: "text-xs font-semibold text-[#02bc71] flex items-center gap-1.5", children: [
102167
+ /* @__PURE__ */ jsx("span", { className: "inline-block w-2 h-2 rounded-full bg-[#02bc71]" }),
102168
+ "Vibrant Cloud Images"
102169
+ ] }),
102170
+ /* @__PURE__ */ jsx(
102171
+ "button",
102014
102172
  {
102015
- src: VibrantLogo,
102016
- alt: "vibrant",
102017
- height: 60,
102018
- width: 60,
102019
- className: "object-contain"
102173
+ type: "button",
102174
+ onClick: () => {
102175
+ setSource("external");
102176
+ setPage(1);
102177
+ setSearchQuery("");
102178
+ fetchImages(category.toLowerCase(), 1, "external");
102179
+ },
102180
+ className: "text-[11px] text-gray-400 hover:text-white cursor-pointer underline",
102181
+ children: "Explore Stock Categories"
102020
102182
  }
102021
- ) })
102183
+ )
102022
102184
  ] })
102023
102185
  ] }),
102024
- /* @__PURE__ */ jsx("hr", { className: "text-neutral-800 h-[0.5px] my-4" }),
102025
- /* @__PURE__ */ jsx("div", { className: "m-4", children: /* @__PURE__ */ jsx("div", { className: "flex gap-2 overflow-auto", children: imageOptions.map((item) => /* @__PURE__ */ jsx(
102026
- "button",
102027
- {
102028
- className: `px-2 py-1 rounded-sm shrink-0 ${item === category ? "bg-[#02bc71] text-white" : "bg-[#8f99a826]"}`,
102029
- onClick: () => {
102030
- setCategory(item);
102031
- setSocialImages([]);
102032
- fetchImages(item.toLowerCase(), 1);
102033
- },
102034
- children: item
102035
- },
102036
- item
102037
- )) }) }),
102038
- /* @__PURE__ */ jsx("div", { className: "h-[calc(100vh-288px)] overflow-auto", ref: scrollRef, children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-4 md:grid-cols-3 gap-3 mx-4 pb-5", children: socialImages.length > 0 && socialImages.map((item, i) => {
102186
+ /* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 overflow-y-auto pb-8 custom-scrollbar", ref: scrollRef, children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-4 md:grid-cols-3 gap-3 mx-4 pb-5", children: socialImages.length > 0 ? socialImages.map((item, i) => {
102039
102187
  return /* @__PURE__ */ jsx(
102040
102188
  "button",
102041
102189
  {
102042
- className: "relative aspect-square rounded overflow-hidden group cursor-pointer",
102190
+ className: "relative aspect-square rounded overflow-hidden group cursor-pointer bg-neutral-900 transition-all",
102043
102191
  onClick: async () => {
102044
102192
  try {
102045
102193
  startLoading();
102046
- const image = await ShapeService.convertImages(item.largeImage);
102047
- const imageUrl = image?.success ? image?.url : null;
102048
- if (!imageUrl) return;
102049
- addImageToCanvas(imageUrl);
102194
+ const targetUrl = item.largeImage || item.image;
102195
+ if (!targetUrl) return;
102196
+ const image = await ShapeService.convertImages(targetUrl);
102197
+ const imageUrl = image?.success ? image?.url : targetUrl;
102198
+ if (imageUrl) addImageToCanvas(imageUrl);
102050
102199
  if (window.innerWidth < 768) {
102051
102200
  useSidePanelStore.getState().setActivePanel(null);
102052
102201
  }
@@ -102062,14 +102211,14 @@ function PhotosPanel() {
102062
102211
  src: item.image,
102063
102212
  height: 300,
102064
102213
  width: 300,
102065
- alt: "stock",
102214
+ alt: item.tags?.[0] || "stock",
102066
102215
  className: "object-cover w-full h-full group-hover:scale-105 transition-transform"
102067
102216
  }
102068
102217
  )
102069
102218
  },
102070
102219
  i
102071
102220
  );
102072
- }) }) })
102221
+ }) : !isLoading ? /* @__PURE__ */ jsx("div", { className: "col-span-full py-8 text-center text-xs text-gray-500", children: "No images found" }) : null }) })
102073
102222
  ] });
102074
102223
  }
102075
102224
  async function addBackgroundImage(url) {
@@ -102084,7 +102233,7 @@ async function addBackgroundImage(url) {
102084
102233
  const bounds = workarea.getBoundingRect();
102085
102234
  const centerX = bounds.left + bounds.width / 2;
102086
102235
  const centerY = bounds.top + bounds.height / 2;
102087
- oa.fromURL(url, { crossOrigin: "anonymous" }).then((img) => {
102236
+ oa.fromURL(url + "?t=vb", { crossOrigin: "anonymous" }).then((img) => {
102088
102237
  img.set({
102089
102238
  left: centerX,
102090
102239
  top: centerY,
@@ -102153,6 +102302,13 @@ function extractAllTargetColors(targets) {
102153
102302
  if (obj.type === "image" && obj.name !== "qr" && obj.name !== "barcode" && !obj._objects) {
102154
102303
  return;
102155
102304
  }
102305
+ if (obj.type === "textbox" || obj.type === "i-text" || obj.type === "text") {
102306
+ const fill22 = obj.get?.("fill") ?? obj.fill;
102307
+ if (typeof fill22 === "string" && fill22 !== "none" && fill22 !== "transparent" && fill22 !== "") {
102308
+ addColor(fill22);
102309
+ }
102310
+ return;
102311
+ }
102156
102312
  if (obj.type === "group" && obj.name === "qr") {
102157
102313
  if (obj.__qrDark) addColor(obj.__qrDark);
102158
102314
  if (obj.__qrLight) addColor(obj.__qrLight);
@@ -102583,8 +102739,9 @@ function CMYKColorPicker({ value, onChange, className = "" } = {}) {
102583
102739
  "div",
102584
102740
  {
102585
102741
  ref: popoverRef,
102742
+ "data-cmyk-popover": "true",
102586
102743
  style: { position: "fixed", top: `${coords.top}px`, left: `${coords.left}px`, zIndex: 999999 },
102587
- className: "bg-white rounded-2xl shadow-2xl p-3.5 w-[270px] text-gray-800 border border-gray-100 select-none font-sans",
102744
+ className: "cmyk-picker-popover bg-white rounded-2xl shadow-2xl p-3.5 w-[270px] text-gray-800 border border-gray-100 select-none font-sans",
102588
102745
  children: [
102589
102746
  /* @__PURE__ */ jsx(
102590
102747
  "div",
@@ -102875,7 +103032,7 @@ function BackgroundPanel() {
102875
103032
  hex
102876
103033
  ))
102877
103034
  ] }),
102878
- /* @__PURE__ */ jsx("div", { className: "h-[calc(100vh-165px)] overflow-auto", ref: scrollRef, children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-3 mx-4 pb-5", children: backgroundImages.map((item, i) => /* @__PURE__ */ jsx(
103035
+ /* @__PURE__ */ jsx("div", { className: "h-[calc(100vh-165px)] overflow-auto custom-scrollbar", ref: scrollRef, children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-3 mx-4 pb-5", children: backgroundImages.map((item, i) => /* @__PURE__ */ jsx(
102879
103036
  "button",
102880
103037
  {
102881
103038
  className: "relative aspect-square rounded overflow-hidden group cursor-pointer",
@@ -105462,7 +105619,7 @@ END:VCARD`;
105462
105619
  ]
105463
105620
  }
105464
105621
  ) }),
105465
- /* @__PURE__ */ jsxs("div", { className: "h-[calc(100vh-200px)] overflow-auto", children: [
105622
+ /* @__PURE__ */ jsxs("div", { className: "h-[calc(100vh-200px)] overflow-auto custom-scrollbar", children: [
105466
105623
  type === "url" && /* @__PURE__ */ jsx(FormField$1, { label: "Website URL", error: errors.url, children: /* @__PURE__ */ jsx(
105467
105624
  "input",
105468
105625
  {
@@ -106772,7 +106929,7 @@ function EffectsPanel() {
106772
106929
  { id: "natural", label: "Natural" },
106773
106930
  { id: "warm", label: "Warm" }
106774
106931
  ];
106775
- return /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto custom-scrollbar overflow-x-hidden px-4", children: [
106932
+ return /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto custom-scrollbar overflow-x-hidden px-4 custom-scrollbar", children: [
106776
106933
  /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-3 mb-6", children: PRESETS.map((p2) => /* @__PURE__ */ jsx(
106777
106934
  "button",
106778
106935
  {
@@ -107358,7 +107515,7 @@ function MaskPanel() {
107358
107515
  saveState();
107359
107516
  setActivePanel(null);
107360
107517
  };
107361
- return /* @__PURE__ */ jsxs("aside", { className: "bg-neutral-900 border-r border-neutral-800 p-4 text-white h-full overflow-y-auto", children: [
107518
+ return /* @__PURE__ */ jsxs("aside", { className: "bg-neutral-900 border-r border-neutral-800 p-4 text-white h-full overflow-y-auto custom-scrollbar", children: [
107362
107519
  /* @__PURE__ */ jsx("div", { onClick: () => setActivePanel(null), className: "cursor-pointer mb-2", children: "← Back" }),
107363
107520
  /* @__PURE__ */ jsx("div", { className: "flex justify-between items-center mb-4", children: /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold ", children: "Mask image" }) }),
107364
107521
  /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-3", children: mask.map((m2, index) => /* @__PURE__ */ jsx(
@@ -107532,7 +107689,7 @@ function FontPanel() {
107532
107689
  )
107533
107690
  ] }),
107534
107691
  /* @__PURE__ */ jsx("hr", { className: "text-neutral-800 h-[0.5px]" }),
107535
- /* @__PURE__ */ jsx("div", { className: "h-[calc(100vh-126px)] overflow-auto", ref: scrollRef, children: /* @__PURE__ */ jsx("div", { className: "mx-4 py-5", children: fontData.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-gray-400 text-sm text-center", children: "No results found" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
107692
+ /* @__PURE__ */ jsx("div", { className: "h-[calc(100vh-126px)] overflow-auto custom-scrollbar", ref: scrollRef, children: /* @__PURE__ */ jsx("div", { className: "mx-4 py-5", children: fontData.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-gray-400 text-sm text-center", children: "No results found" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
107536
107693
  /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-4", children: fontData.map((item, i) => /* @__PURE__ */ jsx(
107537
107694
  "button",
107538
107695
  {
@@ -152844,7 +153001,7 @@ function BarcodePanel() {
152844
153001
  }
152845
153002
  };
152846
153003
  const stopPropagation = (e3) => e3.stopPropagation();
152847
- return /* @__PURE__ */ jsx("div", { className: "flex flex-col h-full mx-4", children: /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto space-y-5 pr-2", children: [
153004
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col h-full mx-4", children: /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto space-y-5 pr-2 custom-scrollbar", children: [
152848
153005
  /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-white", children: "Bar Code" }),
152849
153006
  /* @__PURE__ */ jsx(FormField, { label: "Select Bar Code Type", children: /* @__PURE__ */ jsx(
152850
153007
  "select",
@@ -152978,7 +153135,7 @@ function QuotesPanel() {
152978
153135
  "div",
152979
153136
  {
152980
153137
  ref: scrollRef,
152981
- className: "flex-1 min-h-0 overflow-y-auto flex flex-col gap-3 px-4 py-2",
153138
+ className: "flex-1 min-h-0 overflow-y-auto flex flex-col gap-3 px-4 py-2 custom-scrollbar",
152982
153139
  children: [
152983
153140
  quotes.map((q2, i) => /* @__PURE__ */ jsxs(
152984
153141
  "button",
@@ -153030,7 +153187,7 @@ const ColorService = {
153030
153187
  if (params?.status !== void 0) searchParams.append("status", String(params.status));
153031
153188
  searchParams.append("limit", String(params?.limit || 100));
153032
153189
  if (params?.page) searchParams.append("page", String(params.page));
153033
- const res = await apiFetch(`/colors?${searchParams.toString()}`, {
153190
+ const res = await apiFetch(`/api/colors?${searchParams.toString()}`, {
153034
153191
  method: "GET"
153035
153192
  });
153036
153193
  if (Array.isArray(res)) return res;
@@ -153246,8 +153403,8 @@ function ColorPanel() {
153246
153403
  }
153247
153404
  )
153248
153405
  ] }) }),
153249
- /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto space-y-5 p-4 pr-3", children: [
153250
- objectColors.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
153406
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto space-y-5 p-4 pr-3 custom-scrollbar", children: [
153407
+ objectColors.length > 1 && /* @__PURE__ */ jsxs("div", { children: [
153251
153408
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
153252
153409
  /* @__PURE__ */ jsxs("span", { className: "text-[11px] font-bold text-neutral-400 uppercase tracking-wider", children: [
153253
153410
  "Object Colors (",
@@ -153893,6 +154050,36 @@ function TextToolbar() {
153893
154050
  const [strokeColor, setStrokeColor] = useState("#000000");
153894
154051
  const [strokeSize, setStrokeSize] = useState(0);
153895
154052
  const [strokeStyle, setStrokeStyle] = useState("Line");
154053
+ const strokeControlsRef = useRef(null);
154054
+ const textPopupRef = useRef(null);
154055
+ const textPopupButtonRef = useRef(null);
154056
+ useEffect(() => {
154057
+ if (!showStrokeControls) return;
154058
+ const handleClickOutside = (e3) => {
154059
+ const target = e3.target;
154060
+ if (!target) return;
154061
+ if (strokeControlsRef.current?.contains(target)) return;
154062
+ if (target.closest?.('[data-cmyk-popover="true"], .cmyk-picker-popover')) return;
154063
+ setShowStrokeControls(false);
154064
+ };
154065
+ document.addEventListener("mousedown", handleClickOutside);
154066
+ return () => {
154067
+ document.removeEventListener("mousedown", handleClickOutside);
154068
+ };
154069
+ }, [showStrokeControls]);
154070
+ useEffect(() => {
154071
+ if (!showTextPopup) return;
154072
+ const handleClickOutside = (e3) => {
154073
+ const target = e3.target;
154074
+ if (!target) return;
154075
+ if (textPopupRef.current?.contains(target) || textPopupButtonRef.current?.contains(target)) return;
154076
+ setShowTextPopup(false);
154077
+ };
154078
+ document.addEventListener("mousedown", handleClickOutside);
154079
+ return () => {
154080
+ document.removeEventListener("mousedown", handleClickOutside);
154081
+ };
154082
+ }, [showTextPopup]);
153896
154083
  const text = useMemo(() => {
153897
154084
  if (type !== "textbox") return null;
153898
154085
  return isTextbox(objects[0]) ? objects[0] : null;
@@ -154019,6 +154206,7 @@ function TextToolbar() {
154019
154206
  /* @__PURE__ */ jsx(
154020
154207
  "button",
154021
154208
  {
154209
+ ref: textPopupButtonRef,
154022
154210
  type: "button",
154023
154211
  "aria-expanded": showTextPopup,
154024
154212
  className: `cursor-pointer rounded p-1 transition-colors duration-150 ${showTextPopup ? "bg-neutral-700 text-white ring-1 ring-neutral-600 shadow-sm" : "hover:bg-neutral-700"}`,
@@ -154040,6 +154228,7 @@ function TextToolbar() {
154040
154228
  showTextPopup && /* @__PURE__ */ jsxs(
154041
154229
  "div",
154042
154230
  {
154231
+ ref: textPopupRef,
154043
154232
  className: "fixed md:absolute z-[9999] md:z-50 bg-[#1d1d1d] text-white shadow-[0_12px_30px_rgba(0,0,0,0.35)] rounded-lg p-4 top-[112px] md:top-[40px] left-1/2 md:left-auto md:right-0 -translate-x-1/2 md:-translate-x-0 border border-neutral-700",
154044
154233
  style: {
154045
154234
  width: "230px"
@@ -154132,7 +154321,7 @@ function TextToolbar() {
154132
154321
  children: "Aa"
154133
154322
  }
154134
154323
  ),
154135
- /* @__PURE__ */ jsxs("div", { className: "relative", children: [
154324
+ /* @__PURE__ */ jsxs("div", { className: "relative", ref: strokeControlsRef, children: [
154136
154325
  /* @__PURE__ */ jsx(
154137
154326
  "button",
154138
154327
  {
@@ -154143,20 +154332,17 @@ function TextToolbar() {
154143
154332
  }
154144
154333
  ),
154145
154334
  showStrokeControls && /* @__PURE__ */ jsxs("div", { className: "absolute left-0 top-full z-50 mt-2 flex items-center gap-3 rounded-md border border-neutral-700 bg-[#1d1d1d] px-3 py-2 text-white shadow-[0_12px_30px_rgba(0,0,0,0.35)]", children: [
154146
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-[13px] font-medium text-white", children: [
154335
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-[13px] font-medium text-white", children: [
154147
154336
  /* @__PURE__ */ jsx("span", { children: "Color" }),
154148
154337
  /* @__PURE__ */ jsx(
154149
- "input",
154338
+ CMYKColorPicker,
154150
154339
  {
154151
- type: "color",
154152
154340
  value: strokeColor,
154153
- onChange: (e3) => {
154154
- const nextColor = e3.target.value;
154341
+ onChange: (hex) => {
154342
+ const nextColor = typeof hex === "string" ? hex : "#000000";
154155
154343
  setStrokeColor(nextColor);
154156
154344
  applyTextStroke(nextColor, strokeSize, strokeStyle);
154157
- },
154158
- className: "h-8 w-10 cursor-pointer rounded border border-neutral-600 bg-transparent p-0",
154159
- "aria-label": "Text stroke color"
154345
+ }
154160
154346
  }
154161
154347
  )
154162
154348
  ] }),