@backmatter/studio 0.0.5 → 0.0.7
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-88VsmOhi.js} +13 -13
- package/dist/chunks/{UiKitPage-BOunq6mr.js → UiKitPage-X4hkFL2d.js} +9 -9
- package/dist/chunks/{WorkspaceRoutes-CTFTWu3L.js → WorkspaceRoutes-DXzdWqN3.js} +20334 -18542
- package/dist/chunks/{dashboard-upmiawx5.js → dashboard-DCHRI0WD.js} +422 -400
- package/dist/chunks/{index-CBvevwfT.js → index-BS0-Bvbk.js} +2 -2
- package/dist/chunks/{status-bar-action-DiXhfcj3.js → status-bar-action-wj1KZ51m.js} +6925 -6567
- package/dist/dashboard.js +2 -2
- package/dist/index.js +18 -18
- package/dist/site-widget.js +788 -234
- package/dist/studio.css +454 -66
- package/package.json +3 -2
- package/src/App.tsx +2 -0
- package/src/WorkspaceRoutes.tsx +4 -0
- package/src/api.ts +104 -0
- package/src/chat/ChatMessage.tsx +10 -3
- package/src/chat/ChatPanel.tsx +1 -1
- package/src/chat/Composer.tsx +18 -18
- package/src/chat/chat-helpers.ts +58 -1
- package/src/chrome/AppSidebar.tsx +31 -156
- package/src/chrome/CommandPalette.tsx +211 -74
- package/src/chrome/ContentExplorerSidebar.tsx +1174 -0
- package/src/chrome/UserMenu.tsx +18 -3
- package/src/chrome/WorkspaceNavContext.tsx +1 -0
- package/src/chrome/command-palette-icons.tsx +152 -0
- package/src/chrome/content-path-tree.ts +95 -0
- package/src/chrome/content-repo-path.ts +52 -0
- package/src/chrome/explorer-icons.tsx +89 -0
- package/src/chrome/folder-create-context.ts +147 -0
- package/src/chrome/icons.tsx +13 -0
- package/src/pages/BlockSettingsDialog.tsx +4 -0
- package/src/pages/CliAuthorizePage.tsx +43 -0
- package/src/pages/DocEditorPage.tsx +33 -4
- package/src/pages/MediaFieldInput.tsx +139 -0
- package/src/pages/MediaGalleryPage.tsx +752 -0
- package/src/pages/MediaLightbox.tsx +460 -0
- package/src/pages/SettingsLayout.tsx +7 -1
- package/src/pages/SettingsUsagePage.tsx +187 -0
- package/src/pages/TypeDocsPage.tsx +2 -210
- package/src/pages/WorkspaceLayout.tsx +6 -1
- package/src/pages/media-grid.ts +190 -0
- package/src/pages/preview-url.ts +13 -2
- package/src/preview-frame.tsx +78 -0
- package/src/replica/useReplica.ts +9 -0
- package/src/site-bar.tsx +769 -0
- package/src/site-widget.tsx +33 -162
- package/src/ui/ConfirmDialog.tsx +1 -1
- package/src/workspace/permissions.ts +9 -0
- package/src/workspace-path.ts +13 -0
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-DCHRI0WD.js";
|
|
2
|
+
import { w as t, Q as f } from "./chunks/status-bar-action-wj1KZ51m.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-wj1KZ51m.js";
|
|
4
|
+
import { Y as Se } from "./chunks/status-bar-action-wj1KZ51m.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-DXzdWqN3.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-88VsmOhi.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) {
|