@teamflojo/floimg-studio-ui 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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { jsxs as m, jsx as e, Fragment as j } from "react/jsx-runtime";
1
+ import { jsxs as m, jsx as e, Fragment as P } from "react/jsx-runtime";
2
2
  import { memo as T, useRef as ge, useCallback as C, useState as N, useEffect as $, useMemo as X } from "react";
3
3
  import pe, { Handle as I, Position as L, applyNodeChanges as he, applyEdgeChanges as fe, MarkerType as be, Background as xe, Controls as ke, MiniMap as we, ReactFlowProvider as ve } from "reactflow";
4
4
  import { create as oe } from "zustand";
@@ -252,9 +252,9 @@ const Z = "http://localhost:11434", ee = "http://localhost:1234", A = oe()(
252
252
  }
253
253
  )
254
254
  );
255
- let Pe = 0;
255
+ let je = 0;
256
256
  function te() {
257
- return `node_${++Pe}`;
257
+ return `node_${++je}`;
258
258
  }
259
259
  function re() {
260
260
  const r = Date.now(), s = Math.random().toString(36).substring(2, 8);
@@ -653,7 +653,7 @@ function H({ nodeId: r, color: s }) {
653
653
  }
654
654
  );
655
655
  }
656
- const je = T(function({
656
+ const Pe = T(function({
657
657
  id: s,
658
658
  data: t,
659
659
  selected: o
@@ -671,7 +671,7 @@ const je = T(function({
671
671
  /* @__PURE__ */ e("span", { className: "font-semibold text-sm text-blue-700 dark:text-blue-400", children: t.generatorName }),
672
672
  /* @__PURE__ */ e(H, { nodeId: s, color: "text-blue-500 dark:text-blue-400" })
673
673
  ] }),
674
- /* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: Object.entries(t.params).slice(0, 2).map(([u, d]) => /* @__PURE__ */ m("div", { className: "truncate", children: [
674
+ /* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: Object.entries(t.params).filter(([, u]) => typeof u != "object" || u === null).slice(0, 2).map(([u, d]) => /* @__PURE__ */ m("div", { className: "truncate", children: [
675
675
  u,
676
676
  ": ",
677
677
  String(d).slice(0, 20)
@@ -700,7 +700,7 @@ const je = T(function({
700
700
  /* @__PURE__ */ e("span", { className: "font-semibold text-sm text-teal-700 dark:text-teal-400", children: t.operation }),
701
701
  /* @__PURE__ */ e(H, { nodeId: s, color: "text-teal-500 dark:text-teal-400" })
702
702
  ] }),
703
- /* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: Object.entries(t.params).slice(0, 2).map(([u, d]) => /* @__PURE__ */ m("div", { className: "truncate", children: [
703
+ /* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: Object.entries(t.params).filter(([, u]) => typeof u != "object" || u === null).slice(0, 2).map(([u, d]) => /* @__PURE__ */ m("div", { className: "truncate", children: [
704
704
  u,
705
705
  ": ",
706
706
  String(d).slice(0, 20)
@@ -883,7 +883,7 @@ const je = T(function({
883
883
  }
884
884
  );
885
885
  }), Be = {
886
- generator: je,
886
+ generator: Pe,
887
887
  transform: Te,
888
888
  save: Me,
889
889
  input: Ue,
@@ -948,6 +948,9 @@ function Ge() {
948
948
  nodeTypes: Be,
949
949
  defaultEdgeOptions: Re,
950
950
  isValidConnection: l,
951
+ nodesDraggable: !0,
952
+ nodesConnectable: !0,
953
+ elementsSelectable: !0,
951
954
  proOptions: { hideAttribution: !0 },
952
955
  fitView: !0,
953
956
  snapToGrid: !0,
@@ -1500,8 +1503,8 @@ function Ye({
1500
1503
  v && v !== d && x(v), F(!1);
1501
1504
  };
1502
1505
  $(() => {
1503
- function v(P) {
1504
- (P.metaKey || P.ctrlKey) && P.key === "s" && (P.preventDefault(), K());
1506
+ function v(j) {
1507
+ (j.metaKey || j.ctrlKey) && j.key === "s" && (j.preventDefault(), K());
1505
1508
  }
1506
1509
  return document.addEventListener("keydown", v), () => document.removeEventListener("keydown", v);
1507
1510
  }, [K]);
@@ -1510,13 +1513,13 @@ function Ye({
1510
1513
  }, me = async () => {
1511
1514
  const v = await l();
1512
1515
  W(v);
1513
- const P = Qe(a, c);
1514
- ie(P), w(!0);
1516
+ const j = Qe(a, c);
1517
+ ie(j), w(!0);
1515
1518
  }, ue = () => {
1516
1519
  const v = k === "yaml" ? z : O;
1517
1520
  navigator.clipboard.writeText(v);
1518
1521
  };
1519
- return /* @__PURE__ */ m(j, { children: [
1522
+ return /* @__PURE__ */ m(P, { children: [
1520
1523
  /* @__PURE__ */ m("div", { className: "h-14 bg-white dark:bg-zinc-800 border-b border-gray-200 dark:border-zinc-700 flex items-center justify-between px-4", children: [
1521
1524
  /* @__PURE__ */ m("div", { className: "flex items-center gap-4", children: [
1522
1525
  /* @__PURE__ */ e(
@@ -1645,7 +1648,7 @@ function Ye({
1645
1648
  onClick: ce,
1646
1649
  disabled: a.length === 0 || n.status === "running",
1647
1650
  className: "px-4 py-2 text-sm font-medium text-white bg-teal-600 rounded-md hover:bg-teal-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",
1648
- children: n.status === "running" ? /* @__PURE__ */ m(j, { children: [
1651
+ children: n.status === "running" ? /* @__PURE__ */ m(P, { children: [
1649
1652
  /* @__PURE__ */ m("svg", { className: "animate-spin h-4 w-4", viewBox: "0 0 24 24", fill: "none", children: [
1650
1653
  /* @__PURE__ */ e(
1651
1654
  "circle",
@@ -1668,7 +1671,7 @@ function Ye({
1668
1671
  )
1669
1672
  ] }),
1670
1673
  "Running..."
1671
- ] }) : /* @__PURE__ */ m(j, { children: [
1674
+ ] }) : /* @__PURE__ */ m(P, { children: [
1672
1675
  /* @__PURE__ */ m("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: [
1673
1676
  /* @__PURE__ */ e(
1674
1677
  "path",
@@ -2555,7 +2558,7 @@ function ut({
2555
2558
  children: /* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e("path", { d: "M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" }) })
2556
2559
  }
2557
2560
  ),
2558
- d && /* @__PURE__ */ m(j, { children: [
2561
+ d && /* @__PURE__ */ m(P, { children: [
2559
2562
  /* @__PURE__ */ e("div", { className: "fixed inset-0 z-10", onClick: () => p(!1) }),
2560
2563
  /* @__PURE__ */ m("div", { className: "absolute right-0 top-full mt-1 w-36 bg-white dark:bg-zinc-800 rounded-lg shadow-lg border border-zinc-200 dark:border-zinc-700 py-1 z-20", children: [
2561
2564
  /* @__PURE__ */ e(
@@ -2601,7 +2604,7 @@ function gt() {
2601
2604
  const r = f((d) => d.showLibrary), s = f((d) => d.toggleLibrary), t = f((d) => d.savedWorkflows), o = f((d) => d.activeWorkflowId), n = f((d) => d.loadWorkflow), i = f((d) => d.deleteWorkflow), l = f((d) => d.renameWorkflow), a = f((d) => d.duplicateWorkflow), c = f((d) => d.newWorkflow);
2602
2605
  if (!r) return null;
2603
2606
  const u = [...t].sort((d, p) => p.updatedAt - d.updatedAt);
2604
- return /* @__PURE__ */ m(j, { children: [
2607
+ return /* @__PURE__ */ m(P, { children: [
2605
2608
  /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/20 dark:bg-black/40 z-40", onClick: s }),
2606
2609
  /* @__PURE__ */ m("div", { className: "fixed left-0 top-0 bottom-0 w-80 bg-zinc-50 dark:bg-zinc-900 border-r border-zinc-200 dark:border-zinc-700 z-50 flex flex-col shadow-xl", children: [
2607
2610
  /* @__PURE__ */ m("div", { className: "flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700", children: [
@@ -3014,7 +3017,7 @@ function St() {
3014
3017
  )
3015
3018
  ] }) }),
3016
3019
  /* @__PURE__ */ m("div", { className: "flex-1 flex overflow-hidden", children: [
3017
- r === "editor" && /* @__PURE__ */ m(j, { children: [
3020
+ r === "editor" && /* @__PURE__ */ m(P, { children: [
3018
3021
  /* @__PURE__ */ e(Ve, {}),
3019
3022
  /* @__PURE__ */ e("div", { className: "flex-1", onDrop: i, onDragOver: l, children: /* @__PURE__ */ e(Ge, {}) }),
3020
3023
  /* @__PURE__ */ e(Ke, {})