@pretextbook/web-editor 0.8.0 → 0.8.1

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/index.es.js CHANGED
@@ -97643,18 +97643,18 @@ function m8(e) {
97643
97643
  body: t
97644
97644
  };
97645
97645
  }
97646
- function h8(e, t, n) {
97647
- let r = n === "book" ? "book" : "article";
97646
+ function h8(e, t, n, r) {
97647
+ let i = n === "book" ? "book" : "article";
97648
97648
  return e.map((e) => {
97649
97649
  if (e.sourceFormat !== "pretext") return e;
97650
97650
  let n = L6(e.content);
97651
97651
  if (e.xmlId === t && !(n && i8.has(n.type))) {
97652
- let { title: t, body: n } = m8(e.content), i = e.title || t || "Untitled";
97652
+ let { title: t, body: n } = m8(e.content), a = e.title || t || r || "Untitled";
97653
97653
  return {
97654
97654
  ...e,
97655
- type: r,
97656
- title: i,
97657
- content: `<${r} xml:id="${e.xmlId}">\n<title>${i}</title>\n\n${n}\n</${r}>`
97655
+ type: i,
97656
+ title: a,
97657
+ content: `<${i} xml:id="${e.xmlId}">\n<title>${a}</title>\n\n${n}\n</${i}>`
97658
97658
  };
97659
97659
  }
97660
97660
  return !e.title && n?.title ? {
@@ -97691,25 +97691,24 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
97691
97691
  a,
97692
97692
  o,
97693
97693
  _
97694
- ]);
97694
+ ]), Oe = y(De);
97695
97695
  if (m(() => {
97696
+ Oe.current = De;
97697
+ }), m(() => {
97698
+ r && Oe.current();
97699
+ }, [r]), m(() => {
97696
97700
  if (!r) return;
97697
- De();
97698
97701
  let e = (e) => {
97699
97702
  e.key === "Escape" && i();
97700
97703
  };
97701
97704
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
97702
- }, [
97703
- r,
97704
- i,
97705
- De
97706
- ]), !r) return null;
97707
- let Oe = v8(h), B = (e) => {
97705
+ }, [r, i]), !r) return null;
97706
+ let B = v8(h), ke = (e) => {
97708
97707
  s(e), i();
97709
- }, ke = (e, t) => {
97708
+ }, Ae = (e, t) => {
97710
97709
  let n = `${e}:${t}`;
97711
97710
  navigator.clipboard.writeText(`<plus:${e} ref="${t}"/>`).catch(() => {}), Ee(n), setTimeout(() => Ee((e) => e === n ? null : e), 2e3);
97712
- }, Ae = async (e) => {
97711
+ }, je = async (e) => {
97713
97712
  if (!j.has(e.id) && c) {
97714
97713
  oe(e.id);
97715
97714
  try {
@@ -97718,17 +97717,17 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
97718
97717
  oe(null);
97719
97718
  }
97720
97719
  }
97721
- B(e);
97722
- }, je = async (e) => {
97720
+ ke(e);
97721
+ }, Me = async (e) => {
97723
97722
  if (l) {
97724
97723
  I(null), le(!0);
97725
97724
  try {
97726
- B(await l(e));
97725
+ ke(await l(e));
97727
97726
  } catch (e) {
97728
97727
  I(e instanceof Error ? e.message : "Upload failed."), le(!1);
97729
97728
  }
97730
97729
  }
97731
- }, Me = async () => {
97730
+ }, Ne = async () => {
97732
97731
  let e = fe.trim();
97733
97732
  if (!e) return;
97734
97733
  let t = me.trim();
@@ -97736,33 +97735,33 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
97736
97735
  ve(null), ge(!0);
97737
97736
  try {
97738
97737
  let n = await u(e);
97739
- B(await l(t ? new File([n], t, { type: n.type }) : n));
97738
+ ke(await l(t ? new File([n], t, { type: n.type }) : n));
97740
97739
  } catch (e) {
97741
97740
  ve(e instanceof Error ? e.message : "Failed to add URL."), ge(!1);
97742
97741
  }
97743
- } else B({
97742
+ } else ke({
97744
97743
  id: `url-${Date.now()}`,
97745
97744
  name: t || e,
97746
97745
  ref: e.split("/").pop() ?? "image",
97747
97746
  kind: "image",
97748
97747
  url: e
97749
97748
  });
97750
- }, Ne = async () => {
97749
+ }, Pe = async () => {
97751
97750
  let e = ye.trim(), t = xe.trim();
97752
97751
  if (!(!e || !t)) if (f) {
97753
97752
  Te(null), Ce(!0);
97754
97753
  try {
97755
- B(await f(e, t));
97754
+ ke(await f(e, t));
97756
97755
  } catch (e) {
97757
97756
  Te(e instanceof Error ? e.message : "Failed to create activity."), Ce(!1);
97758
97757
  }
97759
- } else B({
97758
+ } else ke({
97760
97759
  id: `doenet-${Date.now()}`,
97761
97760
  name: e,
97762
97761
  ref: t,
97763
97762
  kind: "doenet"
97764
97763
  });
97765
- }, Pe = (e) => {
97764
+ }, Fe = (e) => {
97766
97765
  let r = A.filter((t) => t.kind === e);
97767
97766
  return /* @__PURE__ */ n("div", {
97768
97767
  className: "pretext-plus-editor__am-library",
@@ -97795,7 +97794,7 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
97795
97794
  return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n("button", {
97796
97795
  type: "button",
97797
97796
  className: ["pretext-plus-editor__am-lib-row", r ? "pretext-plus-editor__am-lib-row--in-project" : ""].filter(Boolean).join(" "),
97798
- onClick: () => Ae(e),
97797
+ onClick: () => je(e),
97799
97798
  disabled: i || !e.ref,
97800
97799
  title: e.ref ? r ? `Insert "${e.ref}"` : `Add to project & insert "${e.ref}"` : "Asset has no reference — cannot insert",
97801
97800
  children: [/* @__PURE__ */ n("div", {
@@ -97844,9 +97843,9 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
97844
97843
  type: "button",
97845
97844
  className: `pretext-plus-editor__dialog-tab${M === "in-document" ? " pretext-plus-editor__dialog-tab--active" : ""}`,
97846
97845
  onClick: () => ee("in-document"),
97847
- children: ["In Document", Oe.length > 0 && /* @__PURE__ */ t("span", {
97846
+ children: ["In Document", B.length > 0 && /* @__PURE__ */ t("span", {
97848
97847
  className: "pretext-plus-editor__asset-tab-count",
97849
- children: Oe.length
97848
+ children: B.length
97850
97849
  })]
97851
97850
  }), /* @__PURE__ */ t("button", {
97852
97851
  type: "button",
@@ -97860,7 +97859,7 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
97860
97859
  /* @__PURE__ */ t("div", {
97861
97860
  className: "pretext-plus-editor__dialog-content pretext-plus-editor__dialog-content--single",
97862
97861
  children: M === "in-document" ? (() => {
97863
- if (Oe.length === 0) return /* @__PURE__ */ n("div", {
97862
+ if (B.length === 0) return /* @__PURE__ */ n("div", {
97864
97863
  className: "pretext-plus-editor__am-placeholder",
97865
97864
  children: [/* @__PURE__ */ t("p", { children: "No assets referenced in this document yet." }), /* @__PURE__ */ t("button", {
97866
97865
  type: "button",
@@ -97871,7 +97870,7 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
97871
97870
  children: "Add an asset"
97872
97871
  })]
97873
97872
  });
97874
- let e = _8.reduce((e, t) => (e[t] = Oe.filter((e) => e.kind === t).map((e) => ({
97873
+ let e = _8.reduce((e, t) => (e[t] = B.filter((e) => e.kind === t).map((e) => ({
97875
97874
  ref: e.ref,
97876
97875
  asset: k.find((t) => t.kind === e.kind && t.ref === e.ref)
97877
97876
  })), e), {
@@ -97916,7 +97915,7 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
97916
97915
  a && /* @__PURE__ */ t("button", {
97917
97916
  type: "button",
97918
97917
  className: "pretext-plus-editor__am-action-btn",
97919
- onClick: () => B(a),
97918
+ onClick: () => ke(a),
97920
97919
  title: `Insert <plus:${r} ref="${e}"/>`,
97921
97920
  children: "Insert"
97922
97921
  }),
@@ -97930,7 +97929,7 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
97930
97929
  /* @__PURE__ */ t("button", {
97931
97930
  type: "button",
97932
97931
  className: `pretext-plus-editor__am-action-btn${z === o ? " pretext-plus-editor__am-action-btn--done" : ""}`,
97933
- onClick: () => ke(r, e),
97932
+ onClick: () => Ae(r, e),
97934
97933
  title: `Copy <plus:${r} ref="${e}"/>`,
97935
97934
  children: z === o ? "Copied!" : "Copy"
97936
97935
  }),
@@ -98037,7 +98036,7 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
98037
98036
  /* @__PURE__ */ n("div", {
98038
98037
  className: "pretext-plus-editor__am-configure-body",
98039
98038
  children: [
98040
- P === "library" && Pe("image"),
98039
+ P === "library" && Fe("image"),
98041
98040
  P === "upload" && l && /* @__PURE__ */ n("div", {
98042
98041
  className: "pretext-plus-editor__am-upload",
98043
98042
  children: [/* @__PURE__ */ n("div", {
@@ -98053,7 +98052,7 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
98053
98052
  onDrop: (e) => {
98054
98053
  e.preventDefault(), se(!1);
98055
98054
  let t = e.dataTransfer.files[0];
98056
- t && je(t);
98055
+ t && Me(t);
98057
98056
  },
98058
98057
  onClick: () => !ce && de.current?.click(),
98059
98058
  role: "button",
@@ -98069,7 +98068,7 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
98069
98068
  className: "pretext-plus-editor__dialog-file-input",
98070
98069
  onChange: (e) => {
98071
98070
  let t = e.target.files?.[0];
98072
- t && je(t);
98071
+ t && Me(t);
98073
98072
  }
98074
98073
  }), ce ? /* @__PURE__ */ t("p", {
98075
98074
  className: "pretext-plus-editor__am-drop-text",
@@ -98144,7 +98143,7 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
98144
98143
  /* @__PURE__ */ t("button", {
98145
98144
  type: "button",
98146
98145
  className: "pretext-plus-editor__dialog-button",
98147
- onClick: Me,
98146
+ onClick: Ne,
98148
98147
  disabled: !fe.trim() || L,
98149
98148
  children: L ? "Adding…" : u && l ? "Add to Library & Insert" : "Insert"
98150
98149
  })
@@ -98178,7 +98177,7 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
98178
98177
  }),
98179
98178
  /* @__PURE__ */ n("div", {
98180
98179
  className: "pretext-plus-editor__am-configure-body",
98181
- children: [re === "library" && Pe("doenet"), re === "create" && /* @__PURE__ */ n("div", {
98180
+ children: [re === "library" && Fe("doenet"), re === "create" && /* @__PURE__ */ n("div", {
98182
98181
  className: "pretext-plus-editor__am-create-form",
98183
98182
  children: [
98184
98183
  /* @__PURE__ */ t("label", {
@@ -98221,7 +98220,7 @@ var y8 = ({ open: r, onClose: i, onLoadAssets: a, onLoadLibraryAssets: o, onInse
98221
98220
  /* @__PURE__ */ t("button", {
98222
98221
  type: "button",
98223
98222
  className: "pretext-plus-editor__dialog-button",
98224
- onClick: Ne,
98223
+ onClick: Pe,
98225
98224
  disabled: !ye.trim() || !xe.trim() || R,
98226
98225
  children: R ? "Creating…" : f ? "Create & Insert" : "Insert"
98227
98226
  })
@@ -99121,7 +99120,7 @@ function F8({ store: e, children: n }) {
99121
99120
  //#region src/components/Editors.tsx
99122
99121
  var I8 = (e, t) => e.find((e) => t ? e.xmlId === t : e.type === "book" || e.type === "article" || e.type === "slideshow") ?? e[0] ?? null, L8 = (e) => {
99123
99122
  let [n] = b(() => {
99124
- let t = I8(e.divisions, e.rootDivisionId), n = h8(e.divisions, t?.xmlId, e.projectType), r = n.find((e) => e.xmlId === t?.xmlId) ?? t, i = e.activeDivisionId ?? r?.xmlId ?? null, a = n.find((e) => e.xmlId === i) ?? r;
99123
+ let t = I8(e.divisions, e.rootDivisionId), n = h8(e.divisions, t?.xmlId, e.projectType, e.title), r = n.find((e) => e.xmlId === t?.xmlId) ?? t, i = e.activeDivisionId ?? r?.xmlId ?? null, a = n.find((e) => e.xmlId === i) ?? r;
99125
99124
  return P8({
99126
99125
  source: a?.content ?? "",
99127
99126
  sourceFormat: a?.sourceFormat ?? "pretext",
@@ -99254,7 +99253,7 @@ var I8 = (e, t) => e.find((e) => t ? e.xmlId === t : e.type === "book" || e.type
99254
99253
  m(() => {
99255
99254
  let t = Ce.current, n = {}, r = !1;
99256
99255
  if (e.projectAssets !== void 0 && e.projectAssets !== t.projectAssets && (n.projectAssets = e.projectAssets, r = !0), e.divisions !== t.divisions) {
99257
- let t = I8(e.divisions, e.rootDivisionId), i = h8(e.divisions, t?.xmlId, e.projectType);
99256
+ let t = I8(e.divisions, e.rootDivisionId), i = h8(e.divisions, t?.xmlId, e.projectType, e.title);
99258
99257
  n.divisions = i;
99259
99258
  let a = i.find((e) => e.xmlId === t?.xmlId) ?? t;
99260
99259
  (A == null || !e.divisions.some((e) => e.xmlId === A)) && (n.activeDivisionId = a?.xmlId ?? null), !e.title && a?.title && (n.title = a.title), r = !0;
@@ -99269,12 +99268,28 @@ var I8 = (e, t) => e.find((e) => t ? e.xmlId === t : e.type === "book" || e.type
99269
99268
  activeDivisionId: e.activeDivisionId
99270
99269
  };
99271
99270
  });
99272
- let we = te ? ee : M, Te = ue ? I === "pretext" ? l8(k, ue.xmlId, w) : ge === void 0 ? void 0 : `<${ue.type} xml:id="${ue.xmlId}">\n<title>${ue.title}</title>\n\n${ge}\n</${ue.type}>` : void 0, z = ue && Te !== void 0 ? p8(ue.type, Te, we, ue.title) : void 0, Ee = () => se.current?.rebuild(), De = () => {
99271
+ let we = y(null);
99272
+ m(() => {
99273
+ if (we.current === e.divisions) return;
99274
+ we.current = e.divisions;
99275
+ let t = I8(e.divisions, e.rootDivisionId), n = h8(e.divisions, t?.xmlId, e.projectType, e.title);
99276
+ for (let t of n) {
99277
+ if (t.sourceFormat !== "pretext") continue;
99278
+ let n = e.divisions.find((e) => e.xmlId === t.xmlId);
99279
+ !n || t.content === n.content || e.onContentChange({
99280
+ xmlId: t.xmlId,
99281
+ sourceContent: t.content,
99282
+ sourceFormat: "pretext",
99283
+ pretextSource: t.content
99284
+ });
99285
+ }
99286
+ });
99287
+ let Te = te ? ee : M, z = ue ? I === "pretext" ? l8(k, ue.xmlId, w) : ge === void 0 ? void 0 : `<${ue.type} xml:id="${ue.xmlId}">\n<title>${ue.title}</title>\n\n${ge}\n</${ue.type}>` : void 0, Ee = ue && z !== void 0 ? p8(ue.type, z, Te, ue.title) : void 0, De = () => se.current?.rebuild(), Oe = () => {
99273
99288
  e.onSave?.(), se.current?.rebuild();
99274
- }, Oe = (t) => {
99289
+ }, B = (t) => {
99275
99290
  let n = t.ctrlKey || t.metaKey;
99276
- n && t.key === "Enter" && e.onPreviewRebuild ? (t.preventDefault(), Ee()) : n && t.key === "s" && (t.preventDefault(), De());
99277
- }, B = () => {
99291
+ n && t.key === "Enter" && e.onPreviewRebuild ? (t.preventDefault(), De()) : n && t.key === "s" && (t.preventDefault(), Oe());
99292
+ }, ke = () => {
99278
99293
  if (!ue || !ge) return;
99279
99294
  let e = x6(), t = $6(T6(ge, ue.type));
99280
99295
  me({
@@ -99285,22 +99300,22 @@ var I8 = (e, t) => e.find((e) => t ? e.xmlId === t : e.type === "book" || e.type
99285
99300
  sourceFormat: "pretext",
99286
99301
  content: t
99287
99302
  });
99288
- }, ke = /* @__PURE__ */ t(nc, {
99303
+ }, Ae = /* @__PURE__ */ t(nc, {
99289
99304
  ref: ce,
99290
99305
  content: de,
99291
99306
  sourceFormat: I,
99292
99307
  onChange: _e,
99293
- onRebuild: e.onPreviewRebuild ? Ee : void 0,
99294
- onSave: De,
99308
+ onRebuild: e.onPreviewRebuild ? De : void 0,
99309
+ onSave: Oe,
99295
99310
  onOpenLatexImport: () => x("isLatexDialogOpen"),
99296
99311
  onOpenDocinfoEditor: () => x("isDocinfoEditorOpen"),
99297
99312
  onOpenConvertToPretext: R && ge !== void 0 ? () => x("isConvertDialogOpen") : void 0,
99298
99313
  canConvertToPretext: ge !== void 0,
99299
99314
  onOpenAssets: e.projectAssets !== void 0 && I === "pretext" ? () => x("isAssetPickerOpen") : void 0
99300
- }), Ae;
99301
- Ae = i && e.onPreviewRebuild ? /* @__PURE__ */ t(xR, {
99315
+ }), je;
99316
+ je = i && e.onPreviewRebuild ? /* @__PURE__ */ t(xR, {
99302
99317
  ref: se,
99303
- content: z || "",
99318
+ content: Ee || "",
99304
99319
  title: j,
99305
99320
  onRebuild: e.onPreviewRebuild
99306
99321
  }) : /* @__PURE__ */ t(vR, {
@@ -99309,23 +99324,23 @@ var I8 = (e, t) => e.find((e) => t ? e.xmlId === t : e.type === "book" || e.type
99309
99324
  editDisabledReason: I === "markdown" ? "Visual editing is not available for Markdown documents." : I === "latex" ? "Visual editing is not available for LaTeX documents." : "",
99310
99325
  onChange: (e) => _e(e)
99311
99326
  });
99312
- let je = /* @__PURE__ */ t(j8, {
99327
+ let Me = /* @__PURE__ */ t(j8, {
99313
99328
  isCollapsed: l,
99314
99329
  onToggleCollapse: () => u((e) => !e),
99315
99330
  onOpenAssetPicker: e.projectAssets === void 0 ? void 0 : () => x("isAssetPickerOpen")
99316
- }), Me = "pretext-plus-tab-editor", Ne = "pretext-plus-tab-preview", Pe = "pretext-plus-tabpanel", Fe;
99317
- return Fe = a ? /* @__PURE__ */ n("div", {
99331
+ }), Ne = "pretext-plus-tab-editor", Pe = "pretext-plus-tab-preview", Fe = "pretext-plus-tabpanel", Ie;
99332
+ return Ie = a ? /* @__PURE__ */ n("div", {
99318
99333
  className: "pretext-plus-editor__tabs",
99319
- children: [je, /* @__PURE__ */ n("div", {
99334
+ children: [Me, /* @__PURE__ */ n("div", {
99320
99335
  className: "pretext-plus-editor__tabs-main",
99321
99336
  children: [/* @__PURE__ */ n("div", {
99322
99337
  className: "pretext-plus-editor__tab-list",
99323
99338
  role: "tablist",
99324
99339
  children: [/* @__PURE__ */ t("button", {
99325
99340
  type: "button",
99326
- id: Me,
99341
+ id: Ne,
99327
99342
  role: "tab",
99328
- "aria-controls": Pe,
99343
+ "aria-controls": Fe,
99329
99344
  "aria-selected": s === "editor",
99330
99345
  tabIndex: s === "editor" ? 0 : -1,
99331
99346
  className: `pretext-plus-editor__tab-button ${s === "editor" ? "is-active" : ""}`,
@@ -99333,9 +99348,9 @@ var I8 = (e, t) => e.find((e) => t ? e.xmlId === t : e.type === "book" || e.type
99333
99348
  children: "Editor"
99334
99349
  }), /* @__PURE__ */ t("button", {
99335
99350
  type: "button",
99336
- id: Ne,
99351
+ id: Pe,
99337
99352
  role: "tab",
99338
- "aria-controls": Pe,
99353
+ "aria-controls": Fe,
99339
99354
  "aria-selected": s === "preview",
99340
99355
  tabIndex: s === "preview" ? 0 : -1,
99341
99356
  className: `pretext-plus-editor__tab-button ${s === "preview" ? "is-active" : ""}`,
@@ -99343,25 +99358,25 @@ var I8 = (e, t) => e.find((e) => t ? e.xmlId === t : e.type === "book" || e.type
99343
99358
  children: "Preview"
99344
99359
  })]
99345
99360
  }), /* @__PURE__ */ t("div", {
99346
- id: Pe,
99361
+ id: Fe,
99347
99362
  className: "pretext-plus-editor__tab-panel",
99348
99363
  role: "tabpanel",
99349
- "aria-labelledby": s === "editor" ? Me : Ne,
99364
+ "aria-labelledby": s === "editor" ? Ne : Pe,
99350
99365
  children: /* @__PURE__ */ t("div", {
99351
99366
  style: { height: "100%" },
99352
- children: s === "editor" ? ke : Ae
99367
+ children: s === "editor" ? Ae : je
99353
99368
  })
99354
99369
  })]
99355
99370
  })]
99356
99371
  }) : /* @__PURE__ */ n("div", {
99357
99372
  className: "pretext-plus-editor__sectioned-layout",
99358
- children: [je, /* @__PURE__ */ n(Rt, {
99373
+ children: [Me, /* @__PURE__ */ n(Rt, {
99359
99374
  orientation: "horizontal",
99360
99375
  className: "pretext-plus-editor__splitter",
99361
99376
  children: [
99362
99377
  /* @__PURE__ */ t(Vt, {
99363
99378
  className: "pretext-plus-editor__editor-panel",
99364
- children: ke
99379
+ children: Ae
99365
99380
  }),
99366
99381
  /* @__PURE__ */ t(Wt, {
99367
99382
  className: "pretext-plus-editor__resize-handle",
@@ -99369,13 +99384,13 @@ var I8 = (e, t) => e.find((e) => t ? e.xmlId === t : e.type === "book" || e.type
99369
99384
  }),
99370
99385
  /* @__PURE__ */ t(Vt, {
99371
99386
  className: "pretext-plus-editor__preview-panel",
99372
- children: Ae
99387
+ children: je
99373
99388
  })
99374
99389
  ]
99375
99390
  })]
99376
99391
  }), /* @__PURE__ */ n("div", {
99377
99392
  className: "pretext-plus-editor",
99378
- onKeyDown: Oe,
99393
+ onKeyDown: B,
99379
99394
  children: [/* @__PURE__ */ t(C8, {
99380
99395
  onSaveButton: e.onSaveButton,
99381
99396
  saveButtonLabel: e.saveButtonLabel,
@@ -99387,14 +99402,14 @@ var I8 = (e, t) => e.find((e) => t ? e.xmlId === t : e.type === "book" || e.type
99387
99402
  children: [
99388
99403
  /* @__PURE__ */ t(M8, {
99389
99404
  resetKeys: [de, A],
99390
- children: Fe
99405
+ children: Ie
99391
99406
  }),
99392
99407
  d ? /* @__PURE__ */ t(k3, { onClose: () => S("isLatexDialogOpen") }) : null,
99393
99408
  f && ue && ge ? /* @__PURE__ */ t(N3, {
99394
99409
  sourceContent: de,
99395
99410
  sourceFormat: I,
99396
99411
  pretextSource: ge,
99397
- onConfirm: B,
99412
+ onConfirm: ke,
99398
99413
  onClose: () => S("isConvertDialogOpen")
99399
99414
  }) : null,
99400
99415
  p ? /* @__PURE__ */ t(G3, {