@pretextbook/web-editor 0.0.4 → 0.0.5

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.
@@ -1,5 +1,6 @@
1
1
  interface FullPreviewProps {
2
2
  content: string;
3
+ title?: string;
3
4
  }
4
- declare const FullPreview: ({ content }: FullPreviewProps) => import("react/jsx-runtime").JSX.Element;
5
+ declare const FullPreview: ({ content, title }: FullPreviewProps) => import("react/jsx-runtime").JSX.Element;
5
6
  export default FullPreview;
package/dist/index.es.js CHANGED
@@ -36307,20 +36307,20 @@ const jx = Me.create({
36307
36307
  /* @__PURE__ */ X.jsx("div", { className: (s ? "editable" : "read-only") + " ptx-page", children: /* @__PURE__ */ X.jsx(k7, { editor: n }) }),
36308
36308
  /* @__PURE__ */ X.jsx(Lx, { editor: n })
36309
36309
  ] });
36310
- }, Wx = ({ content: r }) => {
36311
- const e = (n, i, s) => {
36312
- const o = document.createElement("form");
36313
- o.method = "POST", o.action = n, o.target = s, o.style.display = "none";
36314
- for (const a in i)
36315
- if (Object.hasOwnProperty.call(i, a)) {
36316
- const l = document.createElement("input");
36317
- l.type = "hidden", l.name = a, l.value = i[a], o.appendChild(l);
36318
- }
36319
- document.body.appendChild(o), o.submit(), o.remove();
36320
- }, t = () => {
36321
- const n = r, i = "foobar";
36322
- let s = window.buildToken;
36323
- s === void 0 && (s = void 0), e("https://build.pretext.plus", { source: n, title: i, token: s }, "fullPreview");
36310
+ }, Wx = ({ content: r, title: e }) => {
36311
+ const t = (i, s, o) => {
36312
+ const a = document.createElement("form");
36313
+ a.method = "POST", a.action = i, a.target = o, a.style.display = "none";
36314
+ for (const l in s)
36315
+ if (Object.hasOwnProperty.call(s, l)) {
36316
+ const u = document.createElement("input");
36317
+ u.type = "hidden", u.name = l, u.value = s[l], a.appendChild(u);
36318
+ }
36319
+ document.body.appendChild(a), a.submit(), a.remove();
36320
+ }, n = () => {
36321
+ const i = r, s = e || "Document Title";
36322
+ let o = window.buildToken;
36323
+ o === void 0 && (o = void 0), t("https://build.pretext.plus", { source: i, title: s, token: o }, "fullPreview");
36324
36324
  };
36325
36325
  return /* @__PURE__ */ X.jsxs("div", { className: "editor-panel", children: [
36326
36326
  /* @__PURE__ */ X.jsxs("div", { className: "relative mb-2 flex items-center justify-center pt-2", children: [
@@ -36329,7 +36329,7 @@ const jx = Me.create({
36329
36329
  "button",
36330
36330
  {
36331
36331
  className: "absolute right-0 rounded-sm px-3 py-1.5 text-xs font-semibold text-white bg-emerald-600 hover:bg-emerald-700 shadow-sm transition-colors",
36332
- onClick: () => t(),
36332
+ onClick: () => n(),
36333
36333
  children: "Rebuild"
36334
36334
  }
36335
36335
  )
@@ -36494,7 +36494,7 @@ const jx = Me.create({
36494
36494
  `, Kx = Gx, Xx = (r) => {
36495
36495
  const [e, t] = Ct(r.content || Kx), [n, i] = Ct(r.title || "Document Title"), [s, o] = Ct(!1);
36496
36496
  let a;
36497
- return s ? a = /* @__PURE__ */ X.jsx(Wx, { content: e }) : a = /* @__PURE__ */ X.jsx(
36497
+ return s ? a = /* @__PURE__ */ X.jsx(Wx, { content: e, title: n }) : a = /* @__PURE__ */ X.jsx(
36498
36498
  _x,
36499
36499
  {
36500
36500
  content: e,