@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/chunks/{EmbedPublishPage-hx1xoAhI.js → EmbedPublishPage-DazYJLaD.js} +13 -13
- package/dist/chunks/{UiKitPage-BOunq6mr.js → UiKitPage-DyVyBp0I.js} +9 -9
- package/dist/chunks/{WorkspaceRoutes-CTFTWu3L.js → WorkspaceRoutes-CPvkgvxe.js} +10869 -10957
- package/dist/chunks/{dashboard-upmiawx5.js → dashboard-6aSS8oyj.js} +194 -194
- package/dist/chunks/{index-CBvevwfT.js → index-DgTNL4t3.js} +2 -2
- package/dist/chunks/{status-bar-action-DiXhfcj3.js → status-bar-action-RNBujSgk.js} +5655 -5427
- package/dist/dashboard.js +2 -2
- package/dist/index.js +18 -18
- package/dist/site-widget.js +790 -234
- package/dist/studio.css +4 -4
- package/package.json +2 -2
- package/src/WorkspaceRoutes.tsx +2 -0
- package/src/api.ts +24 -0
- package/src/chat/ChatPanel.tsx +1 -1
- package/src/chrome/icons.tsx +13 -0
- package/src/pages/SettingsLayout.tsx +7 -1
- package/src/pages/SettingsUsagePage.tsx +168 -0
- package/src/preview-frame.tsx +78 -0
- package/src/site-bar.tsx +769 -0
- package/src/site-widget.tsx +38 -163
package/dist/dashboard.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as a, i as s } from "./chunks/dashboard-
|
|
2
|
-
import {
|
|
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 {
|
|
4
|
-
import {
|
|
5
|
-
import { f as
|
|
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-
|
|
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(
|
|
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(
|
|
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 =
|
|
96
|
-
a.current = i, o && !
|
|
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(
|
|
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(
|
|
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 =
|
|
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
|
-
}),
|
|
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(
|
|
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(
|
|
198
|
-
/* @__PURE__ */ r(m, { path: "/", element: /* @__PURE__ */ r(
|
|
199
|
-
/* @__PURE__ */ r(m, { path: "/workspaces/:workspaceId/*", element: /* @__PURE__ */ r(
|
|
200
|
-
|
|
201
|
-
/* @__PURE__ */ r(m, { path: "*", element: /* @__PURE__ */ r(
|
|
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) {
|