@backmatter/studio 0.0.4 → 0.0.6

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/dashboard.js CHANGED
@@ -1,5 +1,5 @@
1
- import { A as a, i as s } from "./chunks/dashboard-upmiawx5.js";
2
- import { c as t, I as f } from "./chunks/status-bar-action-DiXhfcj3.js";
1
+ import { A as a, i as s } from "./chunks/dashboard-6aSS8oyj.js";
2
+ import { w as t, Q as f } from "./chunks/status-bar-action-RNBujSgk.js";
3
3
  export {
4
4
  a as DashboardApp,
5
5
  t as configureStudio,
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { jsx as r, jsxs as l } from "react/jsx-runtime";
2
2
  import { useLayoutEffect as I, useEffect as u, useRef as C, useState as S } from "react";
3
- import { k as L, T, E as N, C as M, b as D, d as z, u as O, D as g, f as x, i as b, j as _, F as A, G as B, H as F, c as P, I as w, J as j, K as G, n as q, R as H, L as m, N as v } from "./chunks/status-bar-action-DiXhfcj3.js";
4
- import { M as Se } from "./chunks/status-bar-action-DiXhfcj3.js";
5
- import { f as V, s as K, g as $, R as W, h as J, i as X, L as Y, w as Q, T as E, r as Z } from "./chunks/WorkspaceRoutes-CTFTWu3L.js";
3
+ import { i as L, T, E as N, C as M, z, A as D, D as O, F as g, H as x, I as v, L as _, M as A, N as B, O as F, w as P, Q as w, R as V, U as j, f as q, V as G, W as m, X as b } from "./chunks/status-bar-action-RNBujSgk.js";
4
+ import { Y as Se } from "./chunks/status-bar-action-RNBujSgk.js";
5
+ import { f as H, s as W, g as $, R as K, h as X, i as Y, L as Q, w as J, T as E, r as Z } from "./chunks/WorkspaceRoutes-CPvkgvxe.js";
6
6
  import { u as ee, S as te } from "./chunks/define-studio-BYtYDGLX.js";
7
7
  import { d as Pe } from "./chunks/define-studio-BYtYDGLX.js";
8
- import { E as ne } from "./chunks/EmbedPublishPage-hx1xoAhI.js";
8
+ import { E as ne } from "./chunks/EmbedPublishPage-DazYJLaD.js";
9
9
  const p = {
10
10
  accent: "var(--x11n7hvk)",
11
11
  accentHover: "var(--x1vnpaut)",
@@ -29,11 +29,11 @@ function ie() {
29
29
  }, [e]), null;
30
30
  }
31
31
  function ae({ workspaceId: e }) {
32
- return u(() => L(), []), /* @__PURE__ */ r(T, { children: /* @__PURE__ */ r(N, { children: /* @__PURE__ */ r(M, { workspaceId: e, startOpen: !0, pointer: !0, children: /* @__PURE__ */ l(D, { children: [
32
+ return u(() => L(), []), /* @__PURE__ */ r(T, { children: /* @__PURE__ */ r(N, { children: /* @__PURE__ */ r(M, { workspaceId: e, startOpen: !0, pointer: !0, children: /* @__PURE__ */ l(z, { children: [
33
33
  /* @__PURE__ */ r(se, {}),
34
34
  /* @__PURE__ */ r(ce, {}),
35
35
  /* @__PURE__ */ r(de, {}),
36
- /* @__PURE__ */ r(z, { fill: !0 })
36
+ /* @__PURE__ */ r(D, { fill: !0 })
37
37
  ] }) }) }) });
38
38
  }
39
39
  function f() {
@@ -92,8 +92,8 @@ function de() {
92
92
  return u(() => {
93
93
  const n = f();
94
94
  if (!n || window.parent === window) return;
95
- const o = b(a.current);
96
- a.current = i, o && !b(i) && window.parent.postMessage({ type: "backmatter:chat-closed" }, n);
95
+ const o = v(a.current);
96
+ a.current = i, o && !v(i) && window.parent.postMessage({ type: "backmatter:chat-closed" }, n);
97
97
  }, [i]), u(() => {
98
98
  const n = f();
99
99
  function o(c) {
@@ -114,7 +114,7 @@ function R(e, t) {
114
114
  type: F
115
115
  }, window.location.origin), !0;
116
116
  const a = Number(window.sessionStorage.getItem(k) ?? 0);
117
- return Date.now() - a < ue ? !1 : (window.sessionStorage.setItem(k, String(Date.now())), window.location.assign(K(t, {
117
+ return Date.now() - a < ue ? !1 : (window.sessionStorage.setItem(k, String(Date.now())), window.location.assign(W(t, {
118
118
  workspaceId: e,
119
119
  returnUrl: window.location.href
120
120
  })), !0);
@@ -137,13 +137,13 @@ function le(e) {
137
137
  }
138
138
  function Ee(e) {
139
139
  const t = e.basePath ?? "/backmatter", [i] = S(() => le(e));
140
- return /* @__PURE__ */ r(te, { definition: e.studio, children: /* @__PURE__ */ l(V, { children: [
140
+ return /* @__PURE__ */ r(te, { definition: e.studio, children: /* @__PURE__ */ l(H, { children: [
141
141
  /* @__PURE__ */ r(ie, {}),
142
142
  /* @__PURE__ */ r(A, { basename: t, children: /* @__PURE__ */ r(fe, { ...e }) })
143
143
  ] }) });
144
144
  }
145
145
  function fe(e) {
146
- const t = j(), i = e.dashboardUrl ?? "https://dash.backmatter.app", [a, n] = S("loading");
146
+ const t = V(), i = e.dashboardUrl ?? "https://dash.backmatter.app", [a, n] = S("loading");
147
147
  if (u(() => {
148
148
  let d = !1;
149
149
  const h = w().onUnauthorized;
@@ -152,7 +152,7 @@ function fe(e) {
152
152
  onUnauthorized: (s) => {
153
153
  s.status === 426 ? n("outdated") : h == null || h(s);
154
154
  }
155
- }), G().then(async (s) => {
155
+ }), j().then(async (s) => {
156
156
  if (d) return;
157
157
  if (!(s != null && s.user)) {
158
158
  R(e.workspaceId, i) || n("unauthorized");
@@ -192,13 +192,13 @@ function fe(e) {
192
192
  if (o != null && o[1])
193
193
  return /* @__PURE__ */ r(ae, { workspaceId: decodeURIComponent(o[1]) });
194
194
  const c = t.pathname.match(/^\/embed\/publish\/([^/]+)\/?$/);
195
- return c != null && c[1] ? /* @__PURE__ */ r(ne, { workspaceId: decodeURIComponent(c[1]) }) : /* @__PURE__ */ r(W, { user: a.user, children: /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(X, { userId: a.user.id, email: a.user.email, onLogout: () => {
195
+ return c != null && c[1] ? /* @__PURE__ */ r(ne, { workspaceId: decodeURIComponent(c[1]) }) : /* @__PURE__ */ r(K, { user: a.user, children: /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(Y, { userId: a.user.id, email: a.user.email, onLogout: () => {
196
196
  he(e.previewEntryPath ?? "/api/backmatter/preview", i);
197
- }, children: /* @__PURE__ */ l(H, { children: [
198
- /* @__PURE__ */ r(m, { path: "/", element: /* @__PURE__ */ r(v, { to: `/${a.slug}`, replace: !0 }) }),
199
- /* @__PURE__ */ r(m, { path: "/workspaces/:workspaceId/*", element: /* @__PURE__ */ r(Y, {}) }),
200
- Q(),
201
- /* @__PURE__ */ r(m, { path: "*", element: /* @__PURE__ */ r(v, { to: "/", replace: !0 }) })
197
+ }, children: /* @__PURE__ */ l(G, { children: [
198
+ /* @__PURE__ */ r(m, { path: "/", element: /* @__PURE__ */ r(b, { to: `/${a.slug}`, replace: !0 }) }),
199
+ /* @__PURE__ */ r(m, { path: "/workspaces/:workspaceId/*", element: /* @__PURE__ */ r(Q, {}) }),
200
+ J(),
201
+ /* @__PURE__ */ r(m, { path: "*", element: /* @__PURE__ */ r(b, { to: "/", replace: !0 }) })
202
202
  ] }) }) }) });
203
203
  }
204
204
  async function he(e, t) {