@springmicro/rte 0.7.12 → 0.7.13

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.
Files changed (2) hide show
  1. package/dist/index.js +29 -17
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -46283,27 +46283,37 @@ const VT = Pe.createContext({
46283
46283
  };
46284
46284
  function gY({
46285
46285
  springMicroSuiteUrl: e = "",
46286
- authToken: t,
46287
- children: r
46286
+ dbInterfaceUrl: t = "",
46287
+ authToken: r,
46288
+ repoName: n,
46289
+ children: a
46288
46290
  }) {
46289
- const n = () => `${e}/api/files`, i = {
46290
- uploadFile: async (s) => {
46291
- var d;
46292
- const l = `rte/${pY()}/`, f = new FormData();
46293
- f.set("filepath", l), f.set("file", s);
46294
- const u = n(), c = (d = (await (await fetch(u, {
46295
- method: "POST",
46296
- body: f,
46297
- headers: {
46298
- Authorization: `Bearer ${t}`
46299
- }
46300
- })).json()).data) == null ? void 0 : d.proxy_url;
46301
- if (!c)
46291
+ const i = () => {
46292
+ const f = sessionStorage.getItem("useInterface");
46293
+ return f == null || !JSON.parse(f) ? `${e}/api/files` : `${t}/customer/files`;
46294
+ }, s = async (f) => {
46295
+ var m;
46296
+ const u = (n ?? `rte/${pY()}`) + "/", o = new FormData();
46297
+ o.set("filepath", u), o.set("file", f);
46298
+ const c = i(), d = await fetch(c, {
46299
+ method: "POST",
46300
+ body: o,
46301
+ headers: {
46302
+ Authorization: `Bearer ${r}`
46303
+ }
46304
+ });
46305
+ if (d.status == 400)
46306
+ return sessionStorage.setItem("useInterface", "true"), await s(f);
46307
+ {
46308
+ const p = (m = (await d.json()).data) == null ? void 0 : m.proxy_url;
46309
+ if (!p)
46302
46310
  throw new Error("File URL not returned in the response.");
46303
- return c;
46311
+ return p;
46304
46312
  }
46313
+ }, l = {
46314
+ uploadFile: s
46305
46315
  };
46306
- return /* @__PURE__ */ oe.jsx(VT.Provider, { value: i, children: r });
46316
+ return /* @__PURE__ */ oe.jsx(VT.Provider, { value: l, children: a });
46307
46317
  }
46308
46318
  function bY({ value: e, handleChange: t }) {
46309
46319
  return /* @__PURE__ */ oe.jsx(
@@ -46875,7 +46885,9 @@ function AY(e) {
46875
46885
  gY,
46876
46886
  {
46877
46887
  springMicroSuiteUrl: e.springMicroSuiteUrl,
46888
+ dbInterfaceUrl: e.dbInterfaceUrl,
46878
46889
  authToken: e.authToken,
46890
+ repoName: e.repoName,
46879
46891
  children: /* @__PURE__ */ oe.jsxs(
46880
46892
  t_,
46881
46893
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@springmicro/rte",
3
- "version": "0.7.12",
3
+ "version": "0.7.13",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@emotion/css": "^11.11.2",
30
- "@springmicro/utils": "^0.7.12",
30
+ "@springmicro/utils": "^0.7.13",
31
31
  "@uiw/react-textarea-code-editor": "^3.0.2",
32
32
  "domhandler": "^5.0.3",
33
33
  "escape-html": "^1.0.3",
@@ -54,5 +54,5 @@
54
54
  "vite": "^5.2.0",
55
55
  "vite-plugin-dts": "^3.9.0"
56
56
  },
57
- "gitHead": "fd84f6ddb8ef2f0e9ec15c7078bfd8a4d65e864b"
57
+ "gitHead": "0f3da8c5a1c587c6457114172bb297adefdf3e08"
58
58
  }