@spaceandtimelabs/makeinfinite-ui 0.29.0 → 0.30.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.
package/dist/index.d.ts CHANGED
@@ -98,6 +98,8 @@ export declare const RGPreviewLayout: (props: {
98
98
  layout: any;
99
99
  }) => JSX_2.Element;
100
100
 
101
+ export declare const setTailwindTheme: (theme: object) => void;
102
+
101
103
  export declare const syncAndRetry: (projectName: string, projectRepository: string) => Promise<void>;
102
104
 
103
105
  export declare const useAPI: () => APIContextType;
@@ -14512,16 +14512,26 @@ const G_ = (e) => {
14512
14512
  layout: r
14513
14513
  };
14514
14514
  }, X_ = async (e, t) => {
14515
- var l;
14515
+ var u;
14516
14516
  const r = {
14517
14517
  jpg: "image/jpeg",
14518
14518
  jpeg: "image/jpeg",
14519
14519
  png: "image/png",
14520
14520
  gif: "image/gif",
14521
14521
  webp: "image/webp"
14522
- }, n = `${window.miDir}/${e}/src/assets/images/${t}`, i = await window.pfs.readFile(n), a = Buffer.from(i).toString("base64"), o = ((l = t.split(".").pop()) == null ? void 0 : l.toLowerCase()) || "";
14523
- return `data:${r[o] ?? "image/jpeg"};base64,${a}`;
14524
- }, nE = (e, t) => {
14522
+ }, i = (await window.pfs.readdir(window.miDir)).find(
14523
+ (d) => d.toLowerCase() === e.toLowerCase()
14524
+ );
14525
+ if (!i)
14526
+ throw new Error(`Project "${e}" not found`);
14527
+ const a = `${window.miDir}/${i}/src/assets/images/${t}`, o = await window.pfs.readFile(a), s = Buffer.from(o).toString("base64"), l = ((u = t.split(".").pop()) == null ? void 0 : u.toLowerCase()) || "";
14528
+ return `data:${r[l] ?? "image/jpeg"};base64,${s}`;
14529
+ }, nE = (e) => {
14530
+ if (window.tailwind)
14531
+ window.tailwind.config = e;
14532
+ else
14533
+ throw new Error("Could not load tailwind theme: missing tailwind global.");
14534
+ }, iE = (e, t) => {
14525
14535
  const [r, n] = Ne.useState("");
14526
14536
  return Ne.useEffect(() => {
14527
14537
  (async () => {
@@ -18407,7 +18417,6 @@ const dh = /* @__PURE__ */ Ot(dc), $x = dc.WidthProvider(dh), Tx = yr.div`
18407
18417
 
18408
18418
  justify-content: center;
18409
18419
  align-items: center;
18410
-
18411
18420
  }
18412
18421
 
18413
18422
  .grid-item {
@@ -18463,7 +18472,7 @@ const dh = /* @__PURE__ */ Ot(dc), $x = dc.WidthProvider(dh), Tx = yr.div`
18463
18472
  flex-grow: 1;
18464
18473
  overflow: auto;
18465
18474
  }
18466
- `, oE = () => {
18475
+ `, sE = () => {
18467
18476
  const [e, t] = ht([]), [r, n] = ht([]), [i, a] = ht(!1), { projectMetadata: o } = Ed(), s = async () => {
18468
18477
  a(!0), await Ob(o.projectName, o.projectURL), a(!1), await Cb(o.projectName, o.projectURL), await Eb(o.projectName);
18469
18478
  const l = await Z_(
@@ -18477,7 +18486,7 @@ const dh = /* @__PURE__ */ Ot(dc), $x = dc.WidthProvider(dh), Tx = yr.div`
18477
18486
  /* @__PURE__ */ ge.jsx(_d, { isVisible: i }),
18478
18487
  /* @__PURE__ */ ge.jsx("div", { className: "mi-container", children: /* @__PURE__ */ ge.jsx("div", { className: "mi-workspace", style: { backgroundColor: "#6f4d80" }, children: /* @__PURE__ */ ge.jsx(Ax, { components: e, layout: r }) }) })
18479
18488
  ] }) });
18480
- }, sE = Ne.forwardRef(
18489
+ }, cE = Ne.forwardRef(
18481
18490
  ({
18482
18491
  style: e,
18483
18492
  className: t,
@@ -18509,7 +18518,7 @@ const dh = /* @__PURE__ */ Ot(dc), $x = dc.WidthProvider(dh), Tx = yr.div`
18509
18518
  );
18510
18519
  }
18511
18520
  );
18512
- class cE extends Ne.Component {
18521
+ class lE extends Ne.Component {
18513
18522
  constructor(t) {
18514
18523
  super(t), this.state = {
18515
18524
  hasError: !1,
@@ -18533,7 +18542,7 @@ class cE extends Ne.Component {
18533
18542
  };
18534
18543
  }
18535
18544
  }
18536
- const lE = (e) => /* @__PURE__ */ ge.jsx(ge.Fragment, { children: /* @__PURE__ */ ge.jsx(
18545
+ const uE = (e) => /* @__PURE__ */ ge.jsx(ge.Fragment, { children: /* @__PURE__ */ ge.jsx(
18537
18546
  "div",
18538
18547
  {
18539
18548
  className: "droppable-element",
@@ -18628,7 +18637,7 @@ const lE = (e) => /* @__PURE__ */ ge.jsx(ge.Fragment, { children: /* @__PURE__ *
18628
18637
  .react-grid-drag-handle {
18629
18638
  cursor: move;
18630
18639
  }
18631
- `, uE = (e) => /* @__PURE__ */ ge.jsx(ge.Fragment, { children: /* @__PURE__ */ ge.jsx(Bx, { children: /* @__PURE__ */ ge.jsx(jx, { children: /* @__PURE__ */ ge.jsx(
18640
+ `, fE = (e) => /* @__PURE__ */ ge.jsx(ge.Fragment, { children: /* @__PURE__ */ ge.jsx(Bx, { children: /* @__PURE__ */ ge.jsx(jx, { children: /* @__PURE__ */ ge.jsx(
18632
18641
  Ix,
18633
18642
  {
18634
18643
  className: "layout",
@@ -18646,27 +18655,28 @@ const lE = (e) => /* @__PURE__ */ ge.jsx(ge.Fragment, { children: /* @__PURE__ *
18646
18655
  draggableHandle: ".react-grid-drag-handle",
18647
18656
  children: e.components
18648
18657
  }
18649
- ) }) }) }), fE = () => {
18658
+ ) }) }) }), dE = () => {
18650
18659
  typeof window < "u" && (window.Buffer = ms.Buffer, window.fs = new lp("fs"), window.pfs = window.fs.promises, window.miDir = "/mi");
18651
18660
  };
18652
18661
  export {
18653
- oE as MiniApp,
18662
+ sE as MiniApp,
18654
18663
  tE as ProjectProvider,
18655
- sE as RGComponent,
18656
- cE as RGComponentErrorBoundary,
18657
- lE as RGDroppable,
18658
- uE as RGEditLayout,
18664
+ cE as RGComponent,
18665
+ lE as RGComponentErrorBoundary,
18666
+ uE as RGDroppable,
18667
+ fE as RGEditLayout,
18659
18668
  Ax as RGPreviewLayout,
18660
18669
  Jx as getHeadCommit,
18661
18670
  eE as getRedoTargetCommitForFile,
18662
18671
  Cb as getTags,
18663
18672
  Qx as getUndoTargetCommitForFile,
18664
- fE as initializeMakeInfinite,
18673
+ dE as initializeMakeInfinite,
18665
18674
  bb as listDir,
18666
18675
  rE as loadLibraryComponents,
18667
18676
  Z_ as loadProjectComponents,
18677
+ nE as setTailwindTheme,
18668
18678
  Ob as syncAndRetry,
18669
18679
  N_ as useAPI,
18670
- nE as useB64UrlForProjectImage,
18680
+ iE as useB64UrlForProjectImage,
18671
18681
  Ed as useProject
18672
18682
  };