@backmatter/studio 0.0.10 → 0.0.12

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 (37) hide show
  1. package/dist/chunks/{UiKitApp-BxvTwsko.js → UiKitApp-ZZXQt3zy.js} +29 -29
  2. package/dist/chunks/{WorkspaceRoutes-BKKEkAq7.js → WorkspaceRoutes-CCDPtLla.js} +22712 -22498
  3. package/dist/chunks/{dashboard-8rjkfEXl.js → dashboard-Dw0zfTXg.js} +35 -35
  4. package/dist/chunks/{index-laWAz5_p.js → index-DhZGCAru.js} +1 -1
  5. package/dist/dashboard.js +2 -2
  6. package/dist/index.js +199 -193
  7. package/dist/site-widget.css +9 -1
  8. package/dist/site-widget.js +6060 -5936
  9. package/dist/studio.css +5 -25
  10. package/package.json +5 -1
  11. package/src/api.ts +1 -1
  12. package/src/chat/ChatProvider.tsx +13 -2
  13. package/src/chat/Composer.tsx +2 -1
  14. package/src/chat/PointerChip.tsx +15 -2
  15. package/src/chat/chat-helpers.ts +6 -0
  16. package/src/chat/pointer-arm.ts +3 -0
  17. package/src/chrome/WorkspaceStatusBar.tsx +64 -25
  18. package/src/chrome/branch-head.ts +14 -0
  19. package/src/chrome/commit-error.ts +82 -0
  20. package/src/chrome/commit-failure.tsx +111 -0
  21. package/src/install-preview-pointer.ts +116 -0
  22. package/src/pages/BlocksList.tsx +17 -2
  23. package/src/pages/DocEditorPage.tsx +121 -23
  24. package/src/pages/EmbedPublishPage.tsx +27 -24
  25. package/src/pages/RenderedBody.tsx +141 -322
  26. package/src/pages/document-paint.ts +79 -0
  27. package/src/pages/editor-grab.ts +39 -0
  28. package/src/pages/html-to-markdown.ts +26 -0
  29. package/src/pages/preview-bridge.ts +8 -1
  30. package/src/pages/preview-url.ts +15 -0
  31. package/src/pages/selection-format.ts +5 -2
  32. package/src/preview-highlight.ts +16 -0
  33. package/src/preview-pointer-host.ts +30 -0
  34. package/src/shell-resets.css +13 -0
  35. package/src/site-changes.ts +46 -0
  36. package/src/site-pointer.ts +39 -6
  37. package/src/site-widget.tsx +66 -23
@@ -3,7 +3,7 @@ var Xe = (e, t, n) => t in e ? Ke(e, t, { enumerable: !0, configurable: !0, writ
3
3
  var D = (e, t, n) => Xe(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { jsxs as k, jsx as o, Fragment as be } from "react/jsx-runtime";
5
5
  import { useRef as Ye, useCallback as Qe, useSyncExternalStore as Ze, useState as w, useEffect as V, lazy as et, Suspense as tt } from "react";
6
- import { O as nt, ag as ye, ah as rt, K as _, ai as st, p as it, aj as at, ak as Ne, al as Ce, am as Ie, an as ot, ao as lt, N as qe, ap as ct, aq as ie, aa as J, Q as ze, ar as ut, as as Fe, ab as dt, ad as re, a4 as Q, a5 as Z, P as ae, at as ft, M as z, au as ht, z as ve, av as ee, ac as pt, aw as gt, ax as mt, ay as xt, f as yt, az as vt, a0 as bt, aA as wt, aB as kt, q as St, B as Et, y as Rt, aC as _t, aD as Ot, aE as Tt, A as Pt, aF as Lt, R as At, F as jt, G as Ut, H as Nt, I as F, L as Ct, J as It } from "./WorkspaceRoutes-BKKEkAq7.js";
6
+ import { U as nt, aj as ye, ak as rt, P as _, al as st, p as it, am as at, an as Ne, ao as Ce, ap as Ie, aq as ot, ar as lt, N as qe, as as ct, at as ie, ad as J, W as ze, au as ut, av as Fe, ae as dt, ag as re, a7 as Q, a8 as Z, V as ae, aw as ft, Q as z, ax as ht, G as ve, ay as ee, af as pt, az as gt, aA as mt, aB as xt, f as yt, aC as vt, a3 as bt, aD as wt, aE as kt, w as St, B as Et, F as Rt, aF as _t, aG as Ot, aH as Tt, H as Pt, aI as Lt, R as jt, I as At, J as Ut, K as Nt, L as F, M as Ct, O as It } from "./WorkspaceRoutes-CCDPtLla.js";
7
7
  const te = /* @__PURE__ */ Object.create(null), W = (e) => {
8
8
  var t, n;
9
9
  return ((t = globalThis.process) == null ? void 0 : t.env) || ((n = globalThis.Deno) == null ? void 0 : n.env.toObject()) || globalThis.__env__ || (e ? te : globalThis);
@@ -154,23 +154,23 @@ const Xt = {
154
154
  }
155
155
  } }
156
156
  };
157
- let j = [], $ = 0;
157
+ let A = [], $ = 0;
158
158
  const ge = 4, Yt = globalThis.nanostoresGlobal || (globalThis.nanostoresGlobal = { epoch: 0 });
159
159
  let Qt = () => {
160
160
  let e, t;
161
- for (; $ < j.length; ) {
161
+ for (; $ < A.length; ) {
162
162
  t = $, $ += ge;
163
163
  try {
164
- j[t](
165
- j[t + 1].value,
166
- j[t + 2],
167
- j[t + 3]
164
+ A[t](
165
+ A[t + 1].value,
166
+ A[t + 2],
167
+ A[t + 3]
168
168
  );
169
169
  } catch (n) {
170
170
  e = n;
171
171
  }
172
172
  }
173
- if (j.length = $ = 0, e) throw e;
173
+ if (A.length = $ = 0, e) throw e;
174
174
  };
175
175
  const ke = /* @__NO_SIDE_EFFECTS__ */ (e) => {
176
176
  let t = [], n = {
@@ -183,17 +183,17 @@ const ke = /* @__NO_SIDE_EFFECTS__ */ (e) => {
183
183
  lc: 0,
184
184
  listen(r) {
185
185
  return n.lc = t.push(r), () => {
186
- for (let i = $; i < j.length; )
187
- j[i] === r ? j.splice(i, ge) : i += ge;
186
+ for (let i = $; i < A.length; )
187
+ A[i] === r ? A.splice(i, ge) : i += ge;
188
188
  let s = t.indexOf(r);
189
189
  ~s && (t.splice(s, 1), --n.lc || n.off());
190
190
  };
191
191
  },
192
192
  notify(r, s) {
193
193
  Yt.epoch++;
194
- let i = !j.length && !0;
194
+ let i = !A.length && !0;
195
195
  for (let l of t)
196
- j.push(
196
+ A.push(
197
197
  l,
198
198
  n,
199
199
  r,
@@ -638,7 +638,7 @@ function vn(e) {
638
638
  );
639
639
  }
640
640
  const bn = vn();
641
- var wn = Object.defineProperty, kn = Object.defineProperties, Sn = Object.getOwnPropertyDescriptors, Te = Object.getOwnPropertySymbols, En = Object.prototype.hasOwnProperty, Rn = Object.prototype.propertyIsEnumerable, Pe = (e, t, n) => t in e ? wn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, A = (e, t) => {
641
+ var wn = Object.defineProperty, kn = Object.defineProperties, Sn = Object.getOwnPropertyDescriptors, Te = Object.getOwnPropertySymbols, En = Object.prototype.hasOwnProperty, Rn = Object.prototype.propertyIsEnumerable, Pe = (e, t, n) => t in e ? wn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, j = (e, t) => {
642
642
  for (var n in t || (t = {}))
643
643
  En.call(t, n) && Pe(e, n, t[n]);
644
644
  if (Te)
@@ -750,8 +750,8 @@ var Ln = async (e) => {
750
750
  }
751
751
  }
752
752
  return t;
753
- }, An = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;
754
- function jn(e) {
753
+ }, jn = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;
754
+ function An(e) {
755
755
  const t = e.headers.get("content-type"), n = /* @__PURE__ */ new Set([
756
756
  "image/svg",
757
757
  "application/xml",
@@ -761,7 +761,7 @@ function jn(e) {
761
761
  if (!t)
762
762
  return "json";
763
763
  const r = t.split(";").shift() || "";
764
- return An.test(r) ? "json" : n.has(r) || r.startsWith("text/") ? "text" : "blob";
764
+ return jn.test(r) ? "json" : n.has(r) || r.startsWith("text/") ? "text" : "blob";
765
765
  }
766
766
  function Un(e) {
767
767
  try {
@@ -776,22 +776,22 @@ function We(e) {
776
776
  const t = typeof e;
777
777
  return t === "string" || t === "number" || t === "boolean" || t === null ? !0 : t !== "object" ? !1 : Array.isArray(e) ? !0 : e.buffer ? !1 : e.constructor && e.constructor.name === "Object" || typeof e.toJSON == "function";
778
778
  }
779
- function Ae(e) {
779
+ function je(e) {
780
780
  try {
781
781
  return JSON.parse(e);
782
782
  } catch {
783
783
  return e;
784
784
  }
785
785
  }
786
- function je(e) {
786
+ function Ae(e) {
787
787
  return typeof e == "function";
788
788
  }
789
789
  function Nn(e) {
790
790
  if (e != null && e.customFetchImpl)
791
791
  return e.customFetchImpl;
792
- if (typeof globalThis < "u" && je(globalThis.fetch))
792
+ if (typeof globalThis < "u" && Ae(globalThis.fetch))
793
793
  return globalThis.fetch;
794
- if (typeof window < "u" && je(window.fetch))
794
+ if (typeof window < "u" && Ae(window.fetch))
795
795
  return window.fetch;
796
796
  throw new Error("No fetch implementation found");
797
797
  }
@@ -896,12 +896,12 @@ var Je = ["get", "post", "put", "patch", "delete"], Dn = (e) => ({
896
896
  y[v.toLowerCase()] = x;
897
897
  c = y;
898
898
  }
899
- let m = N(A({}, n), {
899
+ let m = N(j({}, n), {
900
900
  method: u.method,
901
901
  output: u.output,
902
902
  headers: c
903
903
  });
904
- return n != null && n.disableValidation || (m = N(A({}, m), {
904
+ return n != null && n.disableValidation || (m = N(j({}, m), {
905
905
  body: u.input ? await G(u.input, n == null ? void 0 : n.body) : n == null ? void 0 : n.body,
906
906
  params: u.params ? await G(u.params, n == null ? void 0 : n.params) : n == null ? void 0 : n.params,
907
907
  query: u.query ? await G(u.query, n == null ? void 0 : n.query) : n == null ? void 0 : n.query
@@ -918,7 +918,7 @@ var Je = ["get", "post", "put", "patch", "delete"], Dn = (e) => ({
918
918
  }
919
919
  }), Hn = (e) => {
920
920
  async function t(n, r) {
921
- const s = N(A(A({}, e), r), {
921
+ const s = N(j(j({}, e), r), {
922
922
  headers: $e(e == null ? void 0 : e.headers, r == null ? void 0 : r.headers),
923
923
  plugins: [...(e == null ? void 0 : e.plugins) || [], Dn(e || {}), ...(r == null ? void 0 : r.plugins) || []]
924
924
  });
@@ -996,7 +996,7 @@ var xe = async (e, t) => {
996
996
  hooks: c,
997
997
  url: m,
998
998
  options: p
999
- } = await On(e, t), g = Nn(p), y = new AbortController(), v = (n = p.signal) != null ? n : y.signal, x = Gn(m, p), S = await Cn(p), E = zn(p, S), O = Fn(m, p), b = N(A({}, p), {
999
+ } = await On(e, t), g = Nn(p), y = new AbortController(), v = (n = p.signal) != null ? n : y.signal, x = Gn(m, p), S = await Cn(p), E = zn(p, S), O = Fn(m, p), b = N(j({}, p), {
1000
1000
  url: x,
1001
1001
  headers: S,
1002
1002
  body: E,
@@ -1018,7 +1018,7 @@ var xe = async (e, t) => {
1018
1018
  };
1019
1019
  for (const P of c.onResponse)
1020
1020
  if (P) {
1021
- const h = await P(N(A({}, R), {
1021
+ const h = await P(N(j({}, R), {
1022
1022
  response: (s = t == null ? void 0 : t.hookOptions) != null && s.cloneResponse ? f.clone() : f
1023
1023
  }));
1024
1024
  h instanceof Response ? f = h : typeof h == "object" && h !== null && (f = h.response);
@@ -1029,13 +1029,13 @@ var xe = async (e, t) => {
1029
1029
  data: "",
1030
1030
  error: null
1031
1031
  };
1032
- const h = jn(f), L = {
1032
+ const h = An(f), L = {
1033
1033
  data: null,
1034
1034
  response: f,
1035
1035
  request: b
1036
1036
  };
1037
1037
  if (h === "json" || h === "text") {
1038
- const I = await f.text(), Ve = (i = b.jsonParser) != null ? i : Ae;
1038
+ const I = await f.text(), Ve = (i = b.jsonParser) != null ? i : je;
1039
1039
  L.data = await Ve(I);
1040
1040
  } else
1041
1041
  L.data = await f[h]();
@@ -1044,7 +1044,7 @@ var xe = async (e, t) => {
1044
1044
  L.data
1045
1045
  ));
1046
1046
  for (const I of c.onSuccess)
1047
- I && await I(N(A({}, L), {
1047
+ I && await I(N(j({}, L), {
1048
1048
  response: (l = t == null ? void 0 : t.hookOptions) != null && l.cloneResponse ? f.clone() : f
1049
1049
  }));
1050
1050
  return t != null && t.throw ? L.data : {
@@ -1052,17 +1052,17 @@ var xe = async (e, t) => {
1052
1052
  error: null
1053
1053
  };
1054
1054
  }
1055
- const U = (d = t == null ? void 0 : t.jsonParser) != null ? d : Ae, C = await f.text(), H = Un(C), M = H ? await U(C) : null, K = {
1055
+ const U = (d = t == null ? void 0 : t.jsonParser) != null ? d : je, C = await f.text(), H = Un(C), M = H ? await U(C) : null, K = {
1056
1056
  response: f,
1057
1057
  responseText: C,
1058
1058
  request: b,
1059
- error: N(A({}, M), {
1059
+ error: N(j({}, M), {
1060
1060
  status: f.status,
1061
1061
  statusText: f.statusText
1062
1062
  })
1063
1063
  };
1064
1064
  for (const P of c.onError)
1065
- P && await P(N(A({}, K), {
1065
+ P && await P(N(j({}, K), {
1066
1066
  response: (a = t == null ? void 0 : t.hookOptions) != null && a.cloneResponse ? f.clone() : f
1067
1067
  }));
1068
1068
  if (t != null && t.retry) {
@@ -1071,7 +1071,7 @@ var xe = async (e, t) => {
1071
1071
  for (const I of c.onRetry)
1072
1072
  I && await I(R);
1073
1073
  const L = P.getDelay(h);
1074
- return await new Promise((I) => setTimeout(I, L)), await xe(e, N(A({}, t), {
1074
+ return await new Promise((I) => setTimeout(I, L)), await xe(e, N(j({}, t), {
1075
1075
  retryAttempt: h + 1
1076
1076
  }));
1077
1077
  }
@@ -1084,7 +1084,7 @@ var xe = async (e, t) => {
1084
1084
  );
1085
1085
  return {
1086
1086
  data: null,
1087
- error: N(A({}, M), {
1087
+ error: N(j({}, M), {
1088
1088
  status: f.status,
1089
1089
  statusText: f.statusText
1090
1090
  })
@@ -1701,7 +1701,7 @@ function kr(e) {
1701
1701
  const t = e.replace(/\/$/, "") || "/";
1702
1702
  return t === "/__ui" || /^\/__ui\/[^/]+$/.test(t);
1703
1703
  }
1704
- const Sr = et(() => import("./UiKitApp-BxvTwsko.js").then((e) => ({
1704
+ const Sr = et(() => import("./UiKitApp-ZZXQt3zy.js").then((e) => ({
1705
1705
  default: e.UiKitApp
1706
1706
  })));
1707
1707
  function Pr() {
@@ -1732,7 +1732,7 @@ function Er() {
1732
1732
  }).catch(() => {
1733
1733
  ee(), z.wipe(), n(null);
1734
1734
  });
1735
- }, []), kr(e.pathname) ? /* @__PURE__ */ o(tt, { fallback: /* @__PURE__ */ o("div", { className: "x1y5dg2c", children: /* @__PURE__ */ o(_, { tone: "muted", children: "Loading kit…" }) }), children: /* @__PURE__ */ o(Sr, {}) }) : t === "loading" ? /* @__PURE__ */ o(Pt, {}) : t ? e.pathname.replace(/\/$/, "") === "/enter" ? /* @__PURE__ */ o(wr, { userId: t.user.id }) : Lt(e.pathname) ? /* @__PURE__ */ o(br, { email: t.user.email }) : /* @__PURE__ */ o(At, { user: t.user, children: /* @__PURE__ */ o(jt, { children: /* @__PURE__ */ o(Ut, { userId: t.user.id, email: t.user.email, onLogout: () => {
1735
+ }, []), kr(e.pathname) ? /* @__PURE__ */ o(tt, { fallback: /* @__PURE__ */ o("div", { className: "x1y5dg2c", children: /* @__PURE__ */ o(_, { tone: "muted", children: "Loading kit…" }) }), children: /* @__PURE__ */ o(Sr, {}) }) : t === "loading" ? /* @__PURE__ */ o(Pt, {}) : t ? e.pathname.replace(/\/$/, "") === "/enter" ? /* @__PURE__ */ o(wr, { userId: t.user.id }) : Lt(e.pathname) ? /* @__PURE__ */ o(br, { email: t.user.email }) : /* @__PURE__ */ o(jt, { user: t.user, children: /* @__PURE__ */ o(At, { children: /* @__PURE__ */ o(Ut, { userId: t.user.id, email: t.user.email, onLogout: () => {
1736
1736
  ee(), z.wipe(), B().signOut().then(() => {
1737
1737
  n(null);
1738
1738
  }).catch(() => {
@@ -1,7 +1,7 @@
1
1
  var Rs = Object.defineProperty;
2
2
  var Es = (r, e, t) => e in r ? Rs(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var M = (r, e, t) => Es(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { aG as Bt, aH as Bs, aI as a0, aJ as ct, aK as xt, aL as ea, aM as Gn, aN as Is, aO as Ls, aP as Ds, aQ as La, aR as Ps, aS as Os, aT as Le, aU as qs } from "./WorkspaceRoutes-BKKEkAq7.js";
4
+ import { aJ as Bt, aK as Bs, aL as a0, aM as ct, aN as xt, aO as ea, aP as Gn, aQ as Is, aR as Ls, aS as Ds, aT as La, aU as Ps, aV as Os, aW as Le, aX as qs } from "./WorkspaceRoutes-CCDPtLla.js";
5
5
  function Fs() {
6
6
  return {
7
7
  enter: {
package/dist/dashboard.js CHANGED
@@ -1,5 +1,5 @@
1
- import { A as a, i as s } from "./chunks/dashboard-8rjkfEXl.js";
2
- import { w as t, x as f } from "./chunks/WorkspaceRoutes-BKKEkAq7.js";
1
+ import { A as a, i as s } from "./chunks/dashboard-Dw0zfTXg.js";
2
+ import { z as t, A as f } from "./chunks/WorkspaceRoutes-CCDPtLla.js";
3
3
  export {
4
4
  a as DashboardApp,
5
5
  t as configureStudio,