@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as l, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as k, useState as u, useRef as H, useMemo as O } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { i as P, f as U, c as K, d as F, p as g, a as b, b as q, r as V, n as J, s as Q, e as X, g as Y, h as Z } from "./status-bar-action-RNBujSgk.js";
|
|
4
4
|
const I = 8e3;
|
|
5
5
|
function T() {
|
|
6
6
|
if (!document.referrer) return "";
|
|
@@ -27,10 +27,10 @@ const te = {
|
|
|
27
27
|
function ae({
|
|
28
28
|
workspaceId: t,
|
|
29
29
|
onStatus: o,
|
|
30
|
-
onPublished:
|
|
30
|
+
onPublished: y
|
|
31
31
|
}) {
|
|
32
32
|
k(() => P(), []);
|
|
33
|
-
const [r, v] = u(null), [G, A] = u("viewer"), [z, C] = u(""), [x, c] = u(null), [d, N] = u(!1), [
|
|
33
|
+
const [r, v] = u(null), [G, A] = u("viewer"), [z, C] = u(""), [x, c] = u(null), [d, N] = u(!1), [f, j] = u(null);
|
|
34
34
|
k(() => {
|
|
35
35
|
let e = !1;
|
|
36
36
|
return U(t).then((n) => {
|
|
@@ -41,8 +41,8 @@ function ae({
|
|
|
41
41
|
e = !0;
|
|
42
42
|
};
|
|
43
43
|
}, [t]);
|
|
44
|
-
const
|
|
45
|
-
|
|
44
|
+
const p = H(o);
|
|
45
|
+
p.current = o, k(() => {
|
|
46
46
|
let e = !1;
|
|
47
47
|
const n = () => {
|
|
48
48
|
q(t).then((a) => {
|
|
@@ -50,7 +50,7 @@ function ae({
|
|
|
50
50
|
if (e) return;
|
|
51
51
|
v(a);
|
|
52
52
|
const L = a.changes.length, M = K(a);
|
|
53
|
-
(_ =
|
|
53
|
+
(_ = p.current) == null || _.call(p, {
|
|
54
54
|
changeCount: L,
|
|
55
55
|
conflictCount: M
|
|
56
56
|
});
|
|
@@ -95,7 +95,7 @@ function ae({
|
|
|
95
95
|
N(!0), c(null);
|
|
96
96
|
try {
|
|
97
97
|
const n = await X(t, z);
|
|
98
|
-
C(""), Y(t, n.files),
|
|
98
|
+
C(""), Y(t, n.files), y == null || y();
|
|
99
99
|
const m = T();
|
|
100
100
|
m && window.parent !== window && window.parent.postMessage({
|
|
101
101
|
type: "backmatter:published"
|
|
@@ -109,7 +109,7 @@ function ae({
|
|
|
109
109
|
}
|
|
110
110
|
const D = (r == null ? void 0 : r.currentBranch) ?? "main";
|
|
111
111
|
return E.length > 0 ? /* @__PURE__ */ l("div", { className: "x78zum5 xdt5ytf xmqd7ac x1hb2obb xqjzbou", children: [
|
|
112
|
-
/* @__PURE__ */ i("p", { ...g(
|
|
112
|
+
/* @__PURE__ */ i("p", { ...g(b.groupLabel), children: "Resolve conflicts" }),
|
|
113
113
|
/* @__PURE__ */ i("p", { className: "x1ghz6dp x173sf5p xq98a72 x10qp4ay x37zpob x111yfic", children: "Pick a side for each file. Commit stays blocked until every conflict is resolved." }),
|
|
114
114
|
x ? /* @__PURE__ */ i("p", { className: "x1ghz6dp x173sf5p xq98a72 x10qp4ay x1trrqm4", children: x }) : null,
|
|
115
115
|
/* @__PURE__ */ i("ul", { className: "x1ghz6dp x1717udv xe8uvvx x1odjw0f x1kbliiw xq3t0pi", children: E.map((e) => {
|
|
@@ -121,22 +121,22 @@ function ae({
|
|
|
121
121
|
e.slug
|
|
122
122
|
] }),
|
|
123
123
|
/* @__PURE__ */ l("div", { className: "x78zum5 xpw8yq9", children: [
|
|
124
|
-
/* @__PURE__ */ i("button", { type: "button", disabled:
|
|
125
|
-
/* @__PURE__ */ i("button", { type: "button", disabled:
|
|
124
|
+
/* @__PURE__ */ i("button", { type: "button", disabled: f !== null, onClick: () => void $(e, "mine"), className: "xxk0z11 x1l8q8zy xmkeg23 x1y0btm7 x1j0qoeq x13oidi x1hb2obb xqjzbou x10qp4ay x1ypdohk xk0mbs4 x1s07b3s x784prv x9v5kkp x1yxvn1h x13iak60", children: f === `${n}:mine` ? "Keeping…" : "Keep mine" }),
|
|
125
|
+
/* @__PURE__ */ i("button", { type: "button", disabled: f !== null, onClick: () => void $(e, "theirs"), className: "xxk0z11 x1l8q8zy xmkeg23 x1y0btm7 x13oidi x1hb2obb x10qp4ay x1ypdohk xk0mbs4 x1s07b3s x784prv x9v5kkp x1yxvn1h x13iak60 x1nf6o4h x1trrqm4", children: f === `${n}:theirs` ? "Taking…" : "Take theirs" })
|
|
126
126
|
] })
|
|
127
127
|
] }, n);
|
|
128
128
|
}) })
|
|
129
129
|
] }) : /* @__PURE__ */ l("form", { className: "x78zum5 xdt5ytf xmqd7ac x1hb2obb xqjzbou", onSubmit: (e) => void W(e), children: [
|
|
130
|
-
/* @__PURE__ */ i("p", { ...g(
|
|
130
|
+
/* @__PURE__ */ i("p", { ...g(b.groupLabel), children: s.length === 0 ? "Nothing to publish" : `${s.length} ${s.length === 1 ? "file" : "files"} → ${D}` }),
|
|
131
131
|
s.length > 0 ? /* @__PURE__ */ i("ul", { className: "x1ghz6dp x1717udv xe8uvvx xctk3hg x1odjw0f x1kbliiw", children: s.map((e) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ l("div", { className: "x78zum5 x6s0dn4 x3smv4v x1rz828m x1ghz6dp x1obou79 x1l8q8zy x1om5956 x1ar5oo6 x10qp4ay x111yfic", children: [
|
|
132
132
|
/* @__PURE__ */ l("span", { className: "xeuugli x98rzlu xb3r6kr xlyipyv xuxw1ft", children: [
|
|
133
133
|
e.type,
|
|
134
134
|
"/",
|
|
135
135
|
e.slug
|
|
136
136
|
] }),
|
|
137
|
-
/* @__PURE__ */ i("span", { ...g(
|
|
137
|
+
/* @__PURE__ */ i("span", { ...g(b.itemMeta), children: te[e.status] })
|
|
138
138
|
] }) }, w(e))) }) : null,
|
|
139
|
-
s.length > 0 ? /* @__PURE__ */ i("div", { ...g(
|
|
139
|
+
s.length > 0 ? /* @__PURE__ */ i("div", { ...g(b.separator) }) : null,
|
|
140
140
|
s.length > 0 ? /* @__PURE__ */ l("div", { className: "x78zum5 xdt5ytf x1qjc9v5 x1ndbd79 x173sf5p x1l7y7l0 xreod0t", children: [
|
|
141
141
|
/* @__PURE__ */ i("input", { value: z, onChange: (e) => C(e.target.value), placeholder: S, "aria-label": "Commit message", autoComplete: "off", spellCheck: !1, "data-no-ring": !0, "data-1p-ignore": !0, "data-lpignore": !0, disabled: d || h !== "commit", className: "xh8yej3 x9f619 xe0p6wg x1l8q8zy x1om5956 xmkeg23 x1y0btm7 x1j0qoeq x13oidi xawfm1v xqjzbou x1vrk1b5 x1a2a7pz x1uvtmcs x1t8xw5s xk2swo9 xk0mbs4 x9ecp23" }),
|
|
142
142
|
x ? /* @__PURE__ */ i("p", { className: "x1ghz6dp x10qp4ay x1trrqm4 xnjsko4 x18d9i69", children: x }) : null,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as y } from "react";
|
|
3
|
-
import { B as c,
|
|
4
|
-
import { u as N, T as l, B as p, S as m, P as o, F as x, I as b, a as w, b as $, c as L, d as g, e as h } from "./WorkspaceRoutes-
|
|
5
|
-
import { L as
|
|
6
|
-
const
|
|
7
|
-
function
|
|
3
|
+
import { B as c, j as S, p as z } from "./status-bar-action-RNBujSgk.js";
|
|
4
|
+
import { u as N, T as l, B as p, S as m, P as o, F as x, I as b, a as w, b as $, c as L, d as g, e as h } from "./WorkspaceRoutes-CPvkgvxe.js";
|
|
5
|
+
import { L as j, a as k } from "./dashboard-6aSS8oyj.js";
|
|
6
|
+
const q = ["primary", "secondary", "ghost", "danger"];
|
|
7
|
+
function A() {
|
|
8
8
|
const {
|
|
9
9
|
preference: s,
|
|
10
10
|
resolved: r,
|
|
@@ -34,7 +34,7 @@ function V() {
|
|
|
34
34
|
/* @__PURE__ */ i(m, { gap: "lg", children: [
|
|
35
35
|
/* @__PURE__ */ i("section", { className: "x78zum5 xdt5ytf x3smv4v", children: [
|
|
36
36
|
/* @__PURE__ */ e(n, { children: "Buttons" }),
|
|
37
|
-
/* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(m, { gap: "md", children:
|
|
37
|
+
/* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(m, { gap: "md", children: q.map((a) => /* @__PURE__ */ i(B, { label: a, children: [
|
|
38
38
|
/* @__PURE__ */ e(c, { variant: a, children: a }),
|
|
39
39
|
/* @__PURE__ */ e(c, { variant: a, disabled: !0, children: "disabled" }),
|
|
40
40
|
/* @__PURE__ */ e(S, { variant: a, to: "/__ui", children: "link" })
|
|
@@ -77,7 +77,7 @@ Paragraph.` }) })
|
|
|
77
77
|
/* @__PURE__ */ e(n, { children: "List + page chrome" }),
|
|
78
78
|
/* @__PURE__ */ i(o, { children: [
|
|
79
79
|
/* @__PURE__ */ e(L, { kicker: /* @__PURE__ */ e(p, { to: "/__ui", children: "← Kit" }), title: "Documents", description: "Sample page header with action.", action: /* @__PURE__ */ e(c, { children: "New" }) }),
|
|
80
|
-
/* @__PURE__ */ i(
|
|
80
|
+
/* @__PURE__ */ i(j, { children: [
|
|
81
81
|
/* @__PURE__ */ e(k, { to: "/__ui", title: "hello-world", meta: "en", trailing: "modified" }),
|
|
82
82
|
/* @__PURE__ */ e(k, { to: "/__ui", title: "about", meta: "da", trailing: "new" })
|
|
83
83
|
] })
|
|
@@ -116,7 +116,7 @@ function n({
|
|
|
116
116
|
}) {
|
|
117
117
|
return /* @__PURE__ */ e(l, { as: "h2", size: "xs", tone: "muted", weight: "semibold", children: s });
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function B({
|
|
120
120
|
label: s,
|
|
121
121
|
children: r
|
|
122
122
|
}) {
|
|
@@ -169,5 +169,5 @@ const d = {
|
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
171
|
export {
|
|
172
|
-
|
|
172
|
+
A as UiKitPage
|
|
173
173
|
};
|