oasis-editor 0.0.146 → 0.0.148

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,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
3
3
  var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
4
- import { E as EMPTY_PROJECTION_CONTEXT, d as domTextMeasurer, g as getProjectedParagraphBlockHeight, e as estimateTableBlockHeight, p as projectParagraphLayout, a as getPageBodyBottom, b as getPageBodyTop, c as getPageContentWidth, F as FOOTNOTE_MARKER_GUTTER_PX, f as getParagraphText, h as getBlockParagraphs, i as getRunFootnoteReference, l as listReferencedEndnotes, j as getFootnoteDisplayMarker, k as createProjectionContext, m as getDocumentSections, n as getRunField, o as projectBlocksLayout, q as assertNever, r as cloneRun, s as createSignal, t as createEditorStateFromDocument, u as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, v as fontSizePxToPt, w as probeLocalFontFamilies, x as createEditorParagraphFromRuns, y as isInlineObjectRun, z as stylesEqual, A as cloneStyle, B as createEditorStyledRun, C as cloneParagraphList, D as cloneParagraph, G as getParagraphLength, H as getActiveZone, I as getActiveSectionIndex, J as getParagraphs, K as normalizeSelection, L as positionToParagraphOffset, M as cloneParagraphs, N as paragraphOffsetToPosition, O as findParagraphIndex, P as createCollapsedSelection, Q as isSelectionCollapsed, R as setValueStyle, T as setBooleanStyle, U as parseFontSizePtToPx, V as formatFontSizePt, W as setParagraphStyleValue, X as createEditorParagraph, Y as cloneBlocks, Z as resolveDefaultParagraphStyleId, _ as findParagraphTablePathLocation, $ as findParagraphLocation, a0 as resolveTablePath, a1 as buildTableCellLayout, a2 as PT_PER_PX, a3 as createEditorTableCell, a4 as createEditorTableRow, a5 as createEditorTable, a6 as clampPosition, a7 as PX_PER_POINT, a8 as underlineStyleToCssDecorationStyle, a9 as resolveImageSrc, aa as listKindForTag, ab as isParagraphTag, ac as collectInlineRuns, ad as parseParagraphStyle, ae as getRunImage, af as InlineShell, ag as BalloonShell, ah as DocumentShell, ai as findParagraphTableLocation, aj as createMemo, ak as getCaretRectFromSnapshot, al as getParagraphRectFromSnapshot, am as createComponent, an as CaretOverlay, ao as Show, ap as createRenderEffect, aq as style, ar as setStyleProperty, as as setAttribute, at as memo, au as template, av as Button, aw as useI18n, ax as createEffect, ay as TextField, az as Dialog, aA as insert, aB as className, aC as Grid, aD as SelectField, aE as StatusText, aF as ColorField, aG as UNDERLINE_STYLE_OPTIONS, aH as Stack, aI as For, aJ as ToggleChip, aK as FormField, aL as Checkbox, aM as FieldGroup, aN as Tabs, aO as NumberField, aP as parseNumber, aQ as createStore, aR as reconcile, aS as RadioGroup, aT as Radio$1, aU as TextAreaField, aV as Text, aW as SurfaceButton, aX as delegateEvents, aY as onMount, aZ as onCleanup, a_ as CheckIcon, a$ as use, b0 as PluginUiHost, b1 as OasisEditorEditor, b2 as OasisBrandMark, b3 as setPreciseFontPreference, b4 as setWelcomeSeen, b5 as enablePreciseFontMode, b6 as WORD_NS$6, b7 as XMLSerializer, b8 as DOMParser, b9 as WORD14_NS, ba as mergeNestedExtensionMarkup, bb as resolveOpcRelationships, bc as parseOpcRelationships, bd as JSZip, be as normalizeOpcPartPath, bf as OPC_CONTENT_TYPES_PATH, bg as getOpcRelationshipOwnerPath, bh as serializeOpcRelationships, bi as OPC_ROOT_RELATIONSHIPS_PATH, bj as hashDocxPartBytes, bk as parseOpcContentTypes, bl as serializeOpcContentTypes, bm as mergeParagraphPropertiesXmlSource, bn as setEditorRunOoxmlSource, bo as mergeRunOoxmlSourceIntoGeneratedXml, bp as mergeTableCellPropertiesXmlSource, bq as mergeTableRowPropertiesXmlSource, br as mergeTablePropertiesXmlSource, bs as exportEditorDocumentToDocxBlob, bt as exportEditorDocumentToDocx, bu as pxToPt$1, bv as resolveFloatingObjectRect, bw as getTextBoxFloatingGeometry, bx as getPresetPathSegments, by as buildListLabels, bz as lineDashPatternPt, bA as DEFAULT_FONT_SIZE_PX, bB as resolveGradientAxis, bC as isDoubleUnderlineStyle, bD as isWavyUnderlineStyle, bE as underlineStyleLineWidthPx, bF as WAVY_UNDERLINE_WAVELENGTH_PX, bG as WAVY_UNDERLINE_AMPLITUDE_PX, bH as DOUBLE_UNDERLINE_OFFSET_PX, bI as underlineStyleDashArray, bJ as resolveEffectiveParagraphStyle, bK as EMPHASIS_GLYPH, bL as parseHexColorToRgb255, bM as rgb255ToHex, bN as getImageFloatingGeometry, bO as resolveEffectiveTextStyleForParagraph, bP as textStyleToFontSizePt, bQ as resolveTextAlignmentBaselineOffset, bR as TEXT_BASELINE_RATIO, bS as resolveRenderedTextChar, bT as resolveOpenTypeFeatureTags, bU as isLowercaseSmallCapsChar, bV as resolveDecorationLineY, bW as DOUBLE_STRIKE_OFFSET_PX, bX as resolveListLabel, bY as getListLabelInset, bZ as getAlignedListLabelInset, b_ as getParagraphBorderInsets, b$ as buildSegmentTable, c0 as buildCanvasTableLayout, c1 as resolveCanvasTableWidth, c2 as resolveFloatingTableRect, c3 as paragraphBetweenBorderMatches, c4 as normalizeFamily, c5 as ROBOTO_FONT_FILES, c6 as loadFontAsset, c7 as getRemotePdfFontFaces, c8 as OFFICE_COMPAT_FONT_FAMILIES, c9 as BinaryReader, ca as buildSfnt, cb as defaultFontDecoderRegistry, cc as SfntFontProgram, cd as zlibSync, ce as renumberImageCaptionsInDocument, cf as collectPdfFontFamilies, cg as outlineFrom, ch as getPageHeaderZoneTop, ci as getPageColumnRects, cj as findFootnoteReference, ck as resolveImporterForFile, cl as roundTo, cm as getDocumentSectionsCanonical, cn as getDocumentParagraphsCanonical, co as getDocumentParagraphs, cp as getImageCaptionText, cq as isImageCaptionParagraph, cr as updateImageCaptionParagraph, cs as createImageCaptionParagraph, ct as renumberImageCaptionParagraphs, cu as getCaptionSelectionOffset, cv as PX_PER_CM, cw as getDocumentPageSettings, cx as getTableCellContentWidthForParagraph, cy as layoutMetricsEpoch, cz as bumpLayoutMetricsEpoch, cA as createCanvasLayoutSnapshotProvider, cB as on, cC as debounce, cD as unwrap, cE as perfTimer, cF as prepareDocumentFonts, cG as getRunTextBox, cH as EMU_PER_PX, cI as createEditorDocument, cJ as resolveResizedDimensions, cK as axisSignForDirection, cL as clamp$1, cM as MIN_RESIZE_SIZE_PX, cN as resolveTextBoxRenderHeight, cO as getToolbarStyleState, cP as VERTICAL_HIT_WEIGHT, cQ as getCachedCanvasImage, cR as measureParagraphMinContentWidthPx, cS as createSectionBoundaryParagraph, cT as normalizePageSettings, cU as DEFAULT_EDITOR_PAGE_SETTINGS, cV as markStart, cW as markEnd, cX as getParagraphEntries, cY as getParagraphById, cZ as createEditorFootnote, c_ as createFootnoteReferenceRun, c$ as renumberFootnotes, d0 as iterateFootnoteReferenceRuns, d1 as preciseFontModeVersion, d2 as isPreciseFontModeEnabled, d3 as getRunFieldChar, d4 as getRunFieldInstruction, d5 as getHeadingLevel, d6 as createEditorRun, d7 as TWIPS_PER_INCH, d8 as PX_PER_INCH, d9 as togglePreciseFontMode, da as nextFontSizePt, db as previousFontSizePt, dc as fontSizePtToPx, dd as resolveNamedTextStyle, de as resolveNamedTableStyle, df as resolveEffectiveTableStyle, dg as createDefaultToolbarPreset, dh as MenuRegistry, di as createToolbarRegistry, dj as Editor, dk as resolveCommandRef, dl as commandRefName, dm as createOasisEditorClient, dn as createEditorZoom, dp as startLongTaskObserver, dq as installGlobalReport, dr as applyStoredPreciseFontPreference, ds as getWelcomeSeen, dt as isLocalFontAccessSupported, du as EDITOR_SCROLL_PADDING_PX, dv as Toolbar, dw as OasisEditorLoading, dx as I18nProvider, dy as createTranslator, dz as registerDomStatsSurface, dA as createEditorLogger } from "./index-CXKg4TC3.js";
4
+ import { E as EMPTY_PROJECTION_CONTEXT, d as domTextMeasurer, g as getProjectedParagraphBlockHeight, e as estimateTableBlockHeight, p as projectParagraphLayout, a as getPageBodyBottom, b as getPageBodyTop, c as getPageContentWidth, F as FOOTNOTE_MARKER_GUTTER_PX, f as getParagraphText, h as getBlockParagraphs, i as getRunFootnoteReference, l as listReferencedEndnotes, j as getFootnoteDisplayMarker, k as createProjectionContext, m as getDocumentSections, n as getRunField, o as projectBlocksLayout, q as assertNever, r as cloneRun, s as createSignal, t as createEditorStateFromDocument, u as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, v as fontSizePxToPt, w as probeLocalFontFamilies, x as createEditorParagraphFromRuns, y as isInlineObjectRun, z as stylesEqual, A as cloneStyle, B as createEditorStyledRun, C as cloneParagraphList, D as cloneParagraph, G as getParagraphLength, H as getActiveZone, I as getActiveSectionIndex, J as getParagraphs, K as normalizeSelection, L as positionToParagraphOffset, M as cloneParagraphs, N as paragraphOffsetToPosition, O as findParagraphIndex, P as createCollapsedSelection, Q as isSelectionCollapsed, R as setValueStyle, T as setBooleanStyle, U as parseFontSizePtToPx, V as formatFontSizePt, W as setParagraphStyleValue, X as createEditorParagraph, Y as cloneBlocks, Z as resolveDefaultParagraphStyleId, _ as findParagraphTablePathLocation, $ as findParagraphLocation, a0 as resolveTablePath, a1 as buildTableCellLayout, a2 as PT_PER_PX, a3 as createEditorTableCell, a4 as createEditorTableRow, a5 as createEditorTable, a6 as clampPosition, a7 as PX_PER_POINT, a8 as underlineStyleToCssDecorationStyle, a9 as resolveImageSrc, aa as listKindForTag, ab as isParagraphTag, ac as collectInlineRuns, ad as parseParagraphStyle, ae as getRunImage, af as InlineShell, ag as BalloonShell, ah as DocumentShell, ai as findParagraphTableLocation, aj as createMemo, ak as getCaretRectFromSnapshot, al as getParagraphRectFromSnapshot, am as createComponent, an as CaretOverlay, ao as Show, ap as createRenderEffect, aq as style, ar as setStyleProperty, as as setAttribute, at as memo, au as template, av as Button, aw as useI18n, ax as createEffect, ay as TextField, az as Dialog, aA as insert, aB as className, aC as Grid, aD as SelectField, aE as StatusText, aF as ColorField, aG as UNDERLINE_STYLE_OPTIONS, aH as Stack, aI as For, aJ as ToggleChip, aK as FormField, aL as Checkbox, aM as FieldGroup, aN as Tabs, aO as NumberField, aP as parseNumber, aQ as createStore, aR as reconcile, aS as RadioGroup, aT as Radio$1, aU as TextAreaField, aV as COMMON_SYMBOLS, aW as getRecentSymbols, aX as SYMBOL_CATEGORIES, aY as rememberSymbol, aZ as delegateEvents, a_ as Text, a$ as SurfaceButton, b0 as onMount, b1 as onCleanup, b2 as CheckIcon, b3 as use, b4 as PluginUiHost, b5 as OasisEditorEditor, b6 as OasisBrandMark, b7 as setPreciseFontPreference, b8 as setWelcomeSeen, b9 as enablePreciseFontMode, ba as WORD_NS$6, bb as XMLSerializer, bc as DOMParser, bd as WORD14_NS, be as mergeNestedExtensionMarkup, bf as resolveOpcRelationships, bg as parseOpcRelationships, bh as JSZip, bi as normalizeOpcPartPath, bj as OPC_CONTENT_TYPES_PATH, bk as getOpcRelationshipOwnerPath, bl as serializeOpcRelationships, bm as OPC_ROOT_RELATIONSHIPS_PATH, bn as hashDocxPartBytes, bo as parseOpcContentTypes, bp as serializeOpcContentTypes, bq as mergeParagraphPropertiesXmlSource, br as setEditorRunOoxmlSource, bs as mergeRunOoxmlSourceIntoGeneratedXml, bt as mergeTableCellPropertiesXmlSource, bu as mergeTableRowPropertiesXmlSource, bv as mergeTablePropertiesXmlSource, bw as exportEditorDocumentToDocxBlob, bx as exportEditorDocumentToDocx, by as pxToPt$1, bz as resolveFloatingObjectRect, bA as getTextBoxFloatingGeometry, bB as getPresetPathSegments, bC as buildListLabels, bD as lineDashPatternPt, bE as DEFAULT_FONT_SIZE_PX, bF as resolveGradientAxis, bG as isDoubleUnderlineStyle, bH as isWavyUnderlineStyle, bI as underlineStyleLineWidthPx, bJ as WAVY_UNDERLINE_WAVELENGTH_PX, bK as WAVY_UNDERLINE_AMPLITUDE_PX, bL as DOUBLE_UNDERLINE_OFFSET_PX, bM as underlineStyleDashArray, bN as resolveEffectiveParagraphStyle, bO as EMPHASIS_GLYPH, bP as parseHexColorToRgb255, bQ as rgb255ToHex, bR as getImageFloatingGeometry, bS as resolveEffectiveTextStyleForParagraph, bT as textStyleToFontSizePt, bU as resolveTextAlignmentBaselineOffset, bV as TEXT_BASELINE_RATIO, bW as resolveRenderedTextChar, bX as resolveOpenTypeFeatureTags, bY as isLowercaseSmallCapsChar, bZ as resolveDecorationLineY, b_ as DOUBLE_STRIKE_OFFSET_PX, b$ as resolveListLabel, c0 as getListLabelInset, c1 as getAlignedListLabelInset, c2 as getParagraphBorderInsets, c3 as buildSegmentTable, c4 as buildCanvasTableLayout, c5 as resolveCanvasTableWidth, c6 as resolveFloatingTableRect, c7 as paragraphBetweenBorderMatches, c8 as normalizeFamily, c9 as ROBOTO_FONT_FILES, ca as loadFontAsset, cb as getRemotePdfFontFaces, cc as OFFICE_COMPAT_FONT_FAMILIES, cd as BinaryReader, ce as buildSfnt, cf as defaultFontDecoderRegistry, cg as SfntFontProgram, ch as zlibSync, ci as renumberImageCaptionsInDocument, cj as collectPdfFontFamilies, ck as outlineFrom, cl as getPageHeaderZoneTop, cm as getPageColumnRects, cn as findFootnoteReference, co as resolveImporterForFile, cp as roundTo, cq as getDocumentSectionsCanonical, cr as getDocumentParagraphsCanonical, cs as getDocumentParagraphs, ct as getImageCaptionText, cu as isImageCaptionParagraph, cv as updateImageCaptionParagraph, cw as createImageCaptionParagraph, cx as renumberImageCaptionParagraphs, cy as getCaptionSelectionOffset, cz as PX_PER_CM, cA as getDocumentPageSettings, cB as getTableCellContentWidthForParagraph, cC as layoutMetricsEpoch, cD as bumpLayoutMetricsEpoch, cE as createCanvasLayoutSnapshotProvider, cF as on, cG as debounce, cH as unwrap, cI as perfTimer, cJ as prepareDocumentFonts, cK as getRunTextBox, cL as EMU_PER_PX, cM as createEditorDocument, cN as resolveResizedDimensions, cO as axisSignForDirection, cP as clamp$1, cQ as MIN_RESIZE_SIZE_PX, cR as resolveTextBoxRenderHeight, cS as getToolbarStyleState, cT as VERTICAL_HIT_WEIGHT, cU as getCachedCanvasImage, cV as measureParagraphMinContentWidthPx, cW as createSectionBoundaryParagraph, cX as normalizePageSettings, cY as DEFAULT_EDITOR_PAGE_SETTINGS, cZ as markStart, c_ as markEnd, c$ as getParagraphEntries, d0 as getParagraphById, d1 as createEditorFootnote, d2 as createFootnoteReferenceRun, d3 as renumberFootnotes, d4 as iterateFootnoteReferenceRuns, d5 as preciseFontModeVersion, d6 as isPreciseFontModeEnabled, d7 as getRunFieldChar, d8 as getRunFieldInstruction, d9 as getHeadingLevel, da as createEditorRun, db as TWIPS_PER_INCH, dc as PX_PER_INCH, dd as togglePreciseFontMode, de as nextFontSizePt, df as previousFontSizePt, dg as fontSizePtToPx, dh as resolveNamedTextStyle, di as resolveNamedTableStyle, dj as resolveEffectiveTableStyle, dk as createDefaultToolbarPreset, dl as MenuRegistry, dm as createToolbarRegistry, dn as Editor, dp as resolveCommandRef, dq as commandRefName, dr as createOasisEditorClient, ds as createEditorZoom, dt as startLongTaskObserver, du as installGlobalReport, dv as applyStoredPreciseFontPreference, dw as getWelcomeSeen, dx as isLocalFontAccessSupported, dy as EDITOR_SCROLL_PADDING_PX, dz as Toolbar, dA as OasisEditorLoading, dB as I18nProvider, dC as createTranslator, dD as registerDomStatsSurface, dE as createEditorLogger } from "./index-CpZO1PF4.js";
5
5
  function projectHeaderFooterBlocksWithDependencies(blocks, deps, context = {}) {
6
6
  const {
7
7
  pageIndex,
@@ -26997,6 +26997,8 @@ function createEditorFocusController() {
26997
26997
  };
26998
26998
  }
26999
26999
  function createEditorDialogs() {
27000
+ const [newDocumentDialog, setNewDocumentDialog] = createSignal({ isOpen: false });
27001
+ const [symbolDialog, setSymbolDialog] = createSignal({ isOpen: false });
27000
27002
  const [linkDialog, setLinkDialog] = createSignal({
27001
27003
  isOpen: false,
27002
27004
  initialHref: ""
@@ -27126,6 +27128,10 @@ function createEditorDialogs() {
27126
27128
  }
27127
27129
  });
27128
27130
  return {
27131
+ newDocumentDialog,
27132
+ setNewDocumentDialog,
27133
+ symbolDialog,
27134
+ setSymbolDialog,
27129
27135
  linkDialog,
27130
27136
  setLinkDialog,
27131
27137
  imageAltDialog,
@@ -29393,7 +29399,10 @@ function updateSelectedSectionStory(section, loc, paragraphId, updateBlocks) {
29393
29399
  };
29394
29400
  }
29395
29401
  if (storyContainsParagraph$2(section.evenPageHeader, paragraphId)) {
29396
- return { ...section, evenPageHeader: updateBlocks(section.evenPageHeader) };
29402
+ return {
29403
+ ...section,
29404
+ evenPageHeader: updateBlocks(section.evenPageHeader)
29405
+ };
29397
29406
  }
29398
29407
  return {
29399
29408
  ...section,
@@ -29408,7 +29417,10 @@ function updateSelectedSectionStory(section, loc, paragraphId, updateBlocks) {
29408
29417
  };
29409
29418
  }
29410
29419
  if (storyContainsParagraph$2(section.evenPageFooter, paragraphId)) {
29411
- return { ...section, evenPageFooter: updateBlocks(section.evenPageFooter) };
29420
+ return {
29421
+ ...section,
29422
+ evenPageFooter: updateBlocks(section.evenPageFooter)
29423
+ };
29412
29424
  }
29413
29425
  return {
29414
29426
  ...section,
@@ -29424,7 +29436,10 @@ function updateActiveTableBlocks(state, updateTable) {
29424
29436
  const paragraphId = state.selection.focus.paragraphId;
29425
29437
  const updateBlocks = (blocks) => updateTableAtPath(blocks, loc.tablePath, updateTable);
29426
29438
  if (loc.zone === "footnote") {
29427
- const paragraphLocation = findParagraphLocation(state.document, paragraphId);
29439
+ const paragraphLocation = findParagraphLocation(
29440
+ state.document,
29441
+ paragraphId
29442
+ );
29428
29443
  const footnoteId = (paragraphLocation == null ? void 0 : paragraphLocation.footnoteId) ?? state.activeFootnoteId;
29429
29444
  const footnotes = state.document.footnotes;
29430
29445
  const footnote = footnoteId ? footnotes == null ? void 0 : footnotes.items[footnoteId] : void 0;
@@ -29437,7 +29452,10 @@ function updateActiveTableBlocks(state, updateTable) {
29437
29452
  ...footnotes,
29438
29453
  items: {
29439
29454
  ...footnotes.items,
29440
- [footnoteId]: { ...footnote, blocks: updateBlocks(footnote.blocks) }
29455
+ [footnoteId]: {
29456
+ ...footnote,
29457
+ blocks: updateBlocks(footnote.blocks)
29458
+ }
29441
29459
  }
29442
29460
  }
29443
29461
  }
@@ -30234,9 +30252,7 @@ function insertTableAtSelection(state, rows, cols) {
30234
30252
  ...state.document,
30235
30253
  sections: nextSections
30236
30254
  },
30237
- selection: withSelection(
30238
- paragraphOffsetToPosition(firstBlock, 0)
30239
- )
30255
+ selection: withSelection(paragraphOffsetToPosition(firstBlock, 0))
30240
30256
  };
30241
30257
  }
30242
30258
  const EMPTY_INITIAL = {
@@ -31741,14 +31757,14 @@ function DropCaret(props) {
31741
31757
  })
31742
31758
  });
31743
31759
  }
31744
- var _tmpl$$f = /* @__PURE__ */ template(`<div class=oasis-editor-table-resize-guide>`), _tmpl$2$5 = /* @__PURE__ */ template(`<div class=oasis-editor-table-resize-outline>`), _tmpl$3$2 = /* @__PURE__ */ template(`<img class=oasis-editor-image-ghost>`), _tmpl$4$1 = /* @__PURE__ */ template(`<div class=oasis-editor-table-ghost>`);
31760
+ var _tmpl$$h = /* @__PURE__ */ template(`<div class=oasis-editor-table-resize-guide>`), _tmpl$2$6 = /* @__PURE__ */ template(`<div class=oasis-editor-table-resize-outline>`), _tmpl$3$3 = /* @__PURE__ */ template(`<img class=oasis-editor-image-ghost>`), _tmpl$4$2 = /* @__PURE__ */ template(`<div class=oasis-editor-table-ghost>`);
31745
31761
  function EditorDragLayers(props) {
31746
31762
  return [createComponent(Show, {
31747
31763
  get when() {
31748
31764
  return props.tableResize.resizing();
31749
31765
  },
31750
31766
  children: (resizing) => (() => {
31751
- var _el$ = _tmpl$$f();
31767
+ var _el$ = _tmpl$$h();
31752
31768
  createRenderEffect((_p$) => {
31753
31769
  var _v$ = !!(resizing().type === "column"), _v$2 = !!(resizing().type === "row"), _v$3 = {
31754
31770
  ...resizing().type === "column" ? {
@@ -31779,7 +31795,7 @@ function EditorDragLayers(props) {
31779
31795
  return props.tableCornerResize.previewRect();
31780
31796
  },
31781
31797
  children: (rect) => (() => {
31782
- var _el$2 = _tmpl$2$5();
31798
+ var _el$2 = _tmpl$2$6();
31783
31799
  createRenderEffect((_p$) => {
31784
31800
  var _v$4 = `${rect().left}px`, _v$5 = `${rect().top}px`, _v$6 = `${rect().width}px`, _v$7 = `${rect().height}px`;
31785
31801
  _v$4 !== _p$.e && setStyleProperty(_el$2, "left", _p$.e = _v$4);
@@ -31800,7 +31816,7 @@ function EditorDragLayers(props) {
31800
31816
  return memo(() => !!props.imageOps.dragging())() && props.imageOps.draggedImageInfo();
31801
31817
  },
31802
31818
  children: (info) => (() => {
31803
- var _el$3 = _tmpl$3$2();
31819
+ var _el$3 = _tmpl$3$3();
31804
31820
  createRenderEffect((_p$) => {
31805
31821
  var _v$8 = info().src, _v$9 = `${info().width}px`, _v$0 = `${info().height}px`, _v$1 = `${props.imageOps.mousePos().x - info().offsetX}px`, _v$10 = `${props.imageOps.mousePos().y - info().offsetY}px`;
31806
31822
  _v$8 !== _p$.e && setAttribute(_el$3, "src", _p$.e = _v$8);
@@ -31823,7 +31839,7 @@ function EditorDragLayers(props) {
31823
31839
  return memo(() => !!props.tableDrag.dragging())() && props.tableDrag.draggedTableInfo();
31824
31840
  },
31825
31841
  children: (info) => (() => {
31826
- var _el$4 = _tmpl$4$1();
31842
+ var _el$4 = _tmpl$4$2();
31827
31843
  createRenderEffect((_p$) => {
31828
31844
  var _v$11 = `${info().width}px`, _v$12 = `${info().height}px`, _v$13 = `${props.tableDrag.mousePos().x - info().offsetX}px`, _v$14 = `${props.tableDrag.mousePos().y - info().offsetY}px`;
31829
31845
  _v$11 !== _p$.e && setStyleProperty(_el$4, "width", _p$.e = _v$11);
@@ -32419,11 +32435,11 @@ function useFontDialogController(props) {
32419
32435
  handleApply
32420
32436
  };
32421
32437
  }
32422
- var _tmpl$$e = /* @__PURE__ */ template(`<div>`);
32438
+ var _tmpl$$g = /* @__PURE__ */ template(`<div>`);
32423
32439
  function FontPreview(props) {
32424
32440
  const t = useI18n();
32425
32441
  return (() => {
32426
- var _el$ = _tmpl$$e();
32442
+ var _el$ = _tmpl$$g();
32427
32443
  insert(_el$, () => t("dialog.font.previewText"));
32428
32444
  createRenderEffect((_p$) => {
32429
32445
  var _v$ = props.class ?? "oasis-editor-dialog-preview", _v$2 = props.testId, _v$3 = props.style;
@@ -32439,7 +32455,7 @@ function FontPreview(props) {
32439
32455
  return _el$;
32440
32456
  })();
32441
32457
  }
32442
- var _tmpl$$d = /* @__PURE__ */ template(`<div class="oasis-editor-font-dialog-panel oasis-editor-font-dialog-font-panel">`);
32458
+ var _tmpl$$f = /* @__PURE__ */ template(`<div class="oasis-editor-font-dialog-panel oasis-editor-font-dialog-font-panel">`);
32443
32459
  function FontTab(props) {
32444
32460
  const t = useI18n();
32445
32461
  const {
@@ -32529,7 +32545,7 @@ function FontTab(props) {
32529
32545
  onChange: (checked) => ctrl.updateFontTab("hidden", checked)
32530
32546
  }];
32531
32547
  return (() => {
32532
- var _el$ = _tmpl$$d();
32548
+ var _el$ = _tmpl$$f();
32533
32549
  insert(_el$, createComponent(Grid, {
32534
32550
  container: true,
32535
32551
  spacing: 1.5,
@@ -32863,14 +32879,14 @@ function FontTab(props) {
32863
32879
  return _el$;
32864
32880
  })();
32865
32881
  }
32866
- var _tmpl$$c = /* @__PURE__ */ template(`<div class=oasis-editor-font-dialog-kerning-line>`), _tmpl$2$4 = /* @__PURE__ */ template(`<div class="oasis-editor-font-dialog-panel oasis-editor-font-dialog-advanced-panel">`);
32882
+ var _tmpl$$e = /* @__PURE__ */ template(`<div class=oasis-editor-font-dialog-kerning-line>`), _tmpl$2$5 = /* @__PURE__ */ template(`<div class="oasis-editor-font-dialog-panel oasis-editor-font-dialog-advanced-panel">`);
32867
32883
  function AdvancedFontTab(props) {
32868
32884
  const t = useI18n();
32869
32885
  const {
32870
32886
  ctrl
32871
32887
  } = props;
32872
32888
  return (() => {
32873
- var _el$ = _tmpl$2$4();
32889
+ var _el$ = _tmpl$2$5();
32874
32890
  insert(_el$, createComponent(FieldGroup, {
32875
32891
  "class": "oasis-editor-font-dialog-fieldset",
32876
32892
  get legend() {
@@ -33021,7 +33037,7 @@ function AdvancedFontTab(props) {
33021
33037
  }), createComponent(Grid, {
33022
33038
  size: 12,
33023
33039
  get children() {
33024
- var _el$2 = _tmpl$$c();
33040
+ var _el$2 = _tmpl$$e();
33025
33041
  insert(_el$2, createComponent(Checkbox, {
33026
33042
  "class": "oasis-editor-font-dialog-kerning-toggle",
33027
33043
  get label() {
@@ -33301,7 +33317,7 @@ function FontDialog(props) {
33301
33317
  }
33302
33318
  });
33303
33319
  }
33304
- var _tmpl$$b = /* @__PURE__ */ template(`<div class=oasis-editor-tab-stops><div class=oasis-editor-tab-stops-actions>`), _tmpl$2$3 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-footer-split><div class=oasis-editor-dialog-footer-start></div><div class=oasis-editor-dialog-footer-end>`);
33320
+ var _tmpl$$d = /* @__PURE__ */ template(`<div class=oasis-editor-tab-stops><div class=oasis-editor-tab-stops-actions>`), _tmpl$2$4 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-footer-split><div class=oasis-editor-dialog-footer-start></div><div class=oasis-editor-dialog-footer-end>`);
33305
33321
  function toDraft(stop) {
33306
33322
  return {
33307
33323
  position: stop.position,
@@ -33385,7 +33401,7 @@ function TabStopsDialog(props) {
33385
33401
  },
33386
33402
  get footer() {
33387
33403
  return (() => {
33388
- var _el$3 = _tmpl$2$3(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling;
33404
+ var _el$3 = _tmpl$2$4(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling;
33389
33405
  insert(_el$4, createComponent(Button, {
33390
33406
  variant: "secondary",
33391
33407
  onClick: () => {
@@ -33418,7 +33434,7 @@ function TabStopsDialog(props) {
33418
33434
  })();
33419
33435
  },
33420
33436
  get children() {
33421
- var _el$ = _tmpl$$b(), _el$2 = _el$.firstChild;
33437
+ var _el$ = _tmpl$$d(), _el$2 = _el$.firstChild;
33422
33438
  insert(_el$, createComponent(For, {
33423
33439
  get each() {
33424
33440
  return stops();
@@ -33772,7 +33788,7 @@ function useParagraphDialogController(props) {
33772
33788
  handleSetDefault
33773
33789
  };
33774
33790
  }
33775
- var _tmpl$$a = /* @__PURE__ */ template(`<div class=oasis-editor-paragraph-dialog-panel>`), _tmpl$2$2 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-preview data-testid=editor-paragraph-dialog-preview>`), _tmpl$3$1 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-footer-split><div class=oasis-editor-dialog-footer-start></div><div class=oasis-editor-dialog-footer-end>`);
33791
+ var _tmpl$$c = /* @__PURE__ */ template(`<div class=oasis-editor-paragraph-dialog-panel>`), _tmpl$2$3 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-preview data-testid=editor-paragraph-dialog-preview>`), _tmpl$3$2 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-footer-split><div class=oasis-editor-dialog-footer-start></div><div class=oasis-editor-dialog-footer-end>`);
33776
33792
  function ParagraphDialog(props) {
33777
33793
  const t = useI18n();
33778
33794
  const [tabsDialogOpen, setTabsDialogOpen] = createSignal(false);
@@ -33879,7 +33895,7 @@ function ParagraphDialog(props) {
33879
33895
  }
33880
33896
  });
33881
33897
  const indentsAndSpacingPanel = (() => {
33882
- var _el$ = _tmpl$$a();
33898
+ var _el$ = _tmpl$$c();
33883
33899
  insert(_el$, createComponent(FieldGroup, {
33884
33900
  "class": "oasis-editor-dialog-fieldset",
33885
33901
  get legend() {
@@ -34349,7 +34365,7 @@ function ParagraphDialog(props) {
34349
34365
  return _el$;
34350
34366
  })();
34351
34367
  const lineAndPageBreaksPanel = (() => {
34352
- var _el$2 = _tmpl$$a();
34368
+ var _el$2 = _tmpl$$c();
34353
34369
  insert(_el$2, createComponent(FieldGroup, {
34354
34370
  "class": "oasis-editor-dialog-fieldset",
34355
34371
  get legend() {
@@ -34416,7 +34432,7 @@ function ParagraphDialog(props) {
34416
34432
  size: "lg",
34417
34433
  get footer() {
34418
34434
  return (() => {
34419
- var _el$4 = _tmpl$3$1(), _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling;
34435
+ var _el$4 = _tmpl$3$2(), _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling;
34420
34436
  insert(_el$5, createComponent(Button, {
34421
34437
  variant: "secondary",
34422
34438
  onClick: () => {
@@ -34479,7 +34495,7 @@ function ParagraphDialog(props) {
34479
34495
  return t("paragraph.preview");
34480
34496
  },
34481
34497
  get children() {
34482
- var _el$3 = _tmpl$2$2();
34498
+ var _el$3 = _tmpl$2$3();
34483
34499
  insert(_el$3, () => t("paragraph.previewText"));
34484
34500
  createRenderEffect((_$p) => style(_el$3, previewStyle(), _$p));
34485
34501
  return _el$3;
@@ -34702,13 +34718,13 @@ function NumField(label, value, setter, testId, disabled = false, allowNegative
34702
34718
  "data-testid": testId
34703
34719
  });
34704
34720
  }
34705
- var _tmpl$$9 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel>`);
34721
+ var _tmpl$$b = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel>`);
34706
34722
  function TableTabPanel(props) {
34707
34723
  const t = useI18n();
34708
34724
  const form = () => props.ctrl.form;
34709
34725
  const set = props.ctrl.set;
34710
34726
  return (() => {
34711
- var _el$ = _tmpl$$9();
34727
+ var _el$ = _tmpl$$b();
34712
34728
  insert(_el$, createComponent(FieldGroup, {
34713
34729
  "class": "oasis-editor-font-dialog-fieldset",
34714
34730
  get legend() {
@@ -35014,13 +35030,13 @@ function TableTabPanel(props) {
35014
35030
  return _el$;
35015
35031
  })();
35016
35032
  }
35017
- var _tmpl$$8 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel>`);
35033
+ var _tmpl$$a = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel>`);
35018
35034
  function RowTabPanel(props) {
35019
35035
  const t = useI18n();
35020
35036
  const form = () => props.ctrl.form;
35021
35037
  const set = props.ctrl.set;
35022
35038
  return (() => {
35023
- var _el$ = _tmpl$$8();
35039
+ var _el$ = _tmpl$$a();
35024
35040
  insert(_el$, createComponent(Grid, {
35025
35041
  container: true,
35026
35042
  spacing: 1.5,
@@ -35103,13 +35119,13 @@ function RowTabPanel(props) {
35103
35119
  return _el$;
35104
35120
  })();
35105
35121
  }
35106
- var _tmpl$$7 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel>`);
35122
+ var _tmpl$$9 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel>`);
35107
35123
  function ColumnTabPanel(props) {
35108
35124
  const t = useI18n();
35109
35125
  const form = () => props.ctrl.form;
35110
35126
  const set = props.ctrl.set;
35111
35127
  return (() => {
35112
- var _el$ = _tmpl$$7();
35128
+ var _el$ = _tmpl$$9();
35113
35129
  insert(_el$, createComponent(Grid, {
35114
35130
  container: true,
35115
35131
  spacing: 1.5,
@@ -35128,7 +35144,7 @@ function ColumnTabPanel(props) {
35128
35144
  return _el$;
35129
35145
  })();
35130
35146
  }
35131
- var _tmpl$$6 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-cell-preview data-testid=editor-table-properties-cell-preview>`), _tmpl$2$1 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel>`);
35147
+ var _tmpl$$8 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-cell-preview data-testid=editor-table-properties-cell-preview>`), _tmpl$2$2 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel>`);
35132
35148
  function CellTabPanel(props) {
35133
35149
  const t = useI18n();
35134
35150
  const form = () => props.ctrl.form;
@@ -35146,7 +35162,7 @@ function CellTabPanel(props) {
35146
35162
  });
35147
35163
  const borderDisabled = () => form().borderStyle === "none";
35148
35164
  return (() => {
35149
- var _el$ = _tmpl$2$1();
35165
+ var _el$ = _tmpl$2$2();
35150
35166
  insert(_el$, createComponent(Grid, {
35151
35167
  container: true,
35152
35168
  spacing: 1.5,
@@ -35533,7 +35549,7 @@ function CellTabPanel(props) {
35533
35549
  })];
35534
35550
  }
35535
35551
  }), (() => {
35536
- var _el$2 = _tmpl$$6();
35552
+ var _el$2 = _tmpl$$8();
35537
35553
  createRenderEffect((_$p) => style(_el$2, borderPreview(), _$p));
35538
35554
  return _el$2;
35539
35555
  })()];
@@ -35542,13 +35558,13 @@ function CellTabPanel(props) {
35542
35558
  return _el$;
35543
35559
  })();
35544
35560
  }
35545
- var _tmpl$$5 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel>`);
35561
+ var _tmpl$$7 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel>`);
35546
35562
  function AltTextTabPanel(props) {
35547
35563
  const t = useI18n();
35548
35564
  const form = () => props.ctrl.form;
35549
35565
  const set = props.ctrl.set;
35550
35566
  return (() => {
35551
- var _el$ = _tmpl$$5();
35567
+ var _el$ = _tmpl$$7();
35552
35568
  insert(_el$, createComponent(TextField, {
35553
35569
  get label() {
35554
35570
  return t("table.altTitle");
@@ -35660,6 +35676,232 @@ function TablePropertiesDialog(props) {
35660
35676
  }
35661
35677
  });
35662
35678
  }
35679
+ var _tmpl$$6 = /* @__PURE__ */ template(`<p data-testid=editor-new-document-message>`);
35680
+ function NewDocumentConfirmationDialog(props) {
35681
+ const t = useI18n();
35682
+ return createComponent(Dialog, {
35683
+ get isOpen() {
35684
+ return props.isOpen;
35685
+ },
35686
+ get title() {
35687
+ return t("dialog.newDocument.title");
35688
+ },
35689
+ get onClose() {
35690
+ return props.onClose;
35691
+ },
35692
+ closeOnOverlayClick: false,
35693
+ size: "sm",
35694
+ get footer() {
35695
+ return createComponent(DialogFooter, {
35696
+ get onCancel() {
35697
+ return props.onClose;
35698
+ },
35699
+ get onConfirm() {
35700
+ return props.onConfirm;
35701
+ },
35702
+ get cancelLabel() {
35703
+ return t("generic.cancel");
35704
+ },
35705
+ get confirmLabel() {
35706
+ return t("dialog.newDocument.discard");
35707
+ },
35708
+ cancelTestId: "editor-new-document-cancel",
35709
+ confirmTestId: "editor-new-document-discard"
35710
+ });
35711
+ },
35712
+ get children() {
35713
+ var _el$ = _tmpl$$6();
35714
+ insert(_el$, () => t("dialog.newDocument.message"));
35715
+ return _el$;
35716
+ }
35717
+ });
35718
+ }
35719
+ var _tmpl$$5 = /* @__PURE__ */ template(`<div class=oasis-editor-symbol-dialog-controls><label class=oasis-editor-symbol-dialog-field><span></span><select data-testid=editor-symbol-dialog-font></select></label><label class=oasis-editor-symbol-dialog-field><span></span><select data-testid=editor-symbol-dialog-category><option value=all>`), _tmpl$2$1 = /* @__PURE__ */ template(`<div class=oasis-editor-symbol-dialog-recent><span></span><div class=oasis-editor-symbol-dialog-recent-list>`), _tmpl$3$1 = /* @__PURE__ */ template(`<div class=oasis-editor-symbol-dialog-layout><div class=oasis-editor-symbol-dialog-grid role=grid></div><aside class=oasis-editor-symbol-dialog-preview><span class=oasis-editor-symbol-dialog-preview-label></span><span class=oasis-editor-symbol-dialog-preview-character data-testid=editor-symbol-dialog-preview></span><label class=oasis-editor-symbol-dialog-field><span></span><input data-testid=editor-symbol-dialog-code></label><p class=oasis-editor-symbol-dialog-help>`), _tmpl$4$1 = /* @__PURE__ */ template(`<option>`), _tmpl$5$1 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-symbol-dialog-tile>`), _tmpl$6$1 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-symbol-dialog-tile role=gridcell>`);
35720
+ const FONT_OPTIONS = ["Segoe UI Symbol", "Arial Unicode MS", "Cambria Math", "Times New Roman"];
35721
+ function SymbolDialog(props) {
35722
+ const t = useI18n();
35723
+ const [category, setCategory] = createSignal("common");
35724
+ const [selected, setSelected] = createSignal(COMMON_SYMBOLS[0]);
35725
+ const [font, setFont] = createSignal(FONT_OPTIONS[0]);
35726
+ const [codeInput, setCodeInput] = createSignal(COMMON_SYMBOLS[0].codePoint);
35727
+ const recentSymbols = createMemo(() => {
35728
+ props.isOpen;
35729
+ return getRecentSymbols();
35730
+ });
35731
+ const visibleEntries = createMemo(() => {
35732
+ var _a;
35733
+ if (category() === "all") {
35734
+ return SYMBOL_CATEGORIES.flatMap((symbolCategory) => symbolCategory.entries);
35735
+ }
35736
+ return ((_a = SYMBOL_CATEGORIES.find((symbolCategory) => symbolCategory.id === category())) == null ? void 0 : _a.entries) ?? COMMON_SYMBOLS;
35737
+ });
35738
+ const selectEntry = (entry) => {
35739
+ setSelected(entry);
35740
+ setCodeInput(entry.codePoint);
35741
+ };
35742
+ const selectCodePoint = (value) => {
35743
+ setCodeInput(value);
35744
+ const normalized = value.trim().toUpperCase().replace(/^U\+/, "");
35745
+ const parsed = Number.parseInt(normalized, 16);
35746
+ if (!Number.isFinite(parsed) || parsed < 0 || parsed > 1114111) return;
35747
+ const character = String.fromCodePoint(parsed);
35748
+ setSelected({
35749
+ character,
35750
+ codePoint: `U+${parsed.toString(16).toUpperCase().padStart(4, "0")}`
35751
+ });
35752
+ };
35753
+ const insertSelected = () => {
35754
+ const character = selected().character;
35755
+ if (!character) return;
35756
+ rememberSymbol(character);
35757
+ props.onInsert(character, font());
35758
+ props.onClose();
35759
+ };
35760
+ return createComponent(Dialog, {
35761
+ get isOpen() {
35762
+ return props.isOpen;
35763
+ },
35764
+ get title() {
35765
+ return t("dialog.symbol.title");
35766
+ },
35767
+ get onClose() {
35768
+ return props.onClose;
35769
+ },
35770
+ "class": "oasis-editor-symbol-dialog",
35771
+ bodyClass: "oasis-editor-symbol-dialog-body",
35772
+ size: "lg",
35773
+ closeOnOverlayClick: false,
35774
+ get footer() {
35775
+ return [createComponent(Button, {
35776
+ variant: "secondary",
35777
+ get onClick() {
35778
+ return props.onClose;
35779
+ },
35780
+ "data-testid": "editor-symbol-dialog-cancel",
35781
+ get children() {
35782
+ return t("generic.cancel");
35783
+ }
35784
+ }), createComponent(Button, {
35785
+ variant: "primary",
35786
+ onClick: insertSelected,
35787
+ "data-testid": "editor-symbol-dialog-insert",
35788
+ get children() {
35789
+ return t("dialog.symbol.insert");
35790
+ }
35791
+ })];
35792
+ },
35793
+ get children() {
35794
+ return [(() => {
35795
+ var _el$ = _tmpl$$5(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$8 = _el$7.firstChild;
35796
+ insert(_el$3, () => t("dialog.symbol.font"));
35797
+ _el$4.addEventListener("change", (event) => {
35798
+ setFont(event.currentTarget.value);
35799
+ });
35800
+ insert(_el$4, createComponent(For, {
35801
+ each: FONT_OPTIONS,
35802
+ children: (option) => (() => {
35803
+ var _el$19 = _tmpl$4$1();
35804
+ _el$19.value = option;
35805
+ insert(_el$19, option);
35806
+ return _el$19;
35807
+ })()
35808
+ }));
35809
+ insert(_el$6, () => t("dialog.symbol.subset"));
35810
+ _el$7.addEventListener("change", (event) => {
35811
+ setCategory(event.currentTarget.value);
35812
+ });
35813
+ insert(_el$8, () => t("symbols.category.all"));
35814
+ insert(_el$7, createComponent(For, {
35815
+ each: SYMBOL_CATEGORIES,
35816
+ children: (symbolCategory) => (() => {
35817
+ var _el$20 = _tmpl$4$1();
35818
+ insert(_el$20, () => t(symbolCategory.labelKey));
35819
+ createRenderEffect(() => _el$20.value = symbolCategory.id);
35820
+ return _el$20;
35821
+ })()
35822
+ }), null);
35823
+ createRenderEffect(() => _el$4.value = font());
35824
+ createRenderEffect(() => _el$7.value = category());
35825
+ return _el$;
35826
+ })(), (() => {
35827
+ var _el$9 = _tmpl$3$1(), _el$0 = _el$9.firstChild, _el$12 = _el$0.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling, _el$18 = _el$15.nextSibling;
35828
+ insert(_el$0, createComponent(Show, {
35829
+ get when() {
35830
+ return recentSymbols().length > 0;
35831
+ },
35832
+ get children() {
35833
+ var _el$1 = _tmpl$2$1(), _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
35834
+ insert(_el$10, () => t("dialog.symbol.recent"));
35835
+ insert(_el$11, createComponent(For, {
35836
+ get each() {
35837
+ return recentSymbols();
35838
+ },
35839
+ children: (entry) => (() => {
35840
+ var _el$21 = _tmpl$5$1();
35841
+ _el$21.$$click = () => selectEntry(entry);
35842
+ insert(_el$21, () => entry.character);
35843
+ createRenderEffect((_p$) => {
35844
+ var _v$3 = `${entry.character} (${entry.codePoint})`, _v$4 = `${entry.character} (${entry.codePoint})`;
35845
+ _v$3 !== _p$.e && setAttribute(_el$21, "title", _p$.e = _v$3);
35846
+ _v$4 !== _p$.t && setAttribute(_el$21, "aria-label", _p$.t = _v$4);
35847
+ return _p$;
35848
+ }, {
35849
+ e: void 0,
35850
+ t: void 0
35851
+ });
35852
+ return _el$21;
35853
+ })()
35854
+ }));
35855
+ return _el$1;
35856
+ }
35857
+ }), null);
35858
+ insert(_el$0, createComponent(For, {
35859
+ get each() {
35860
+ return visibleEntries();
35861
+ },
35862
+ children: (entry) => (() => {
35863
+ var _el$22 = _tmpl$6$1();
35864
+ _el$22.$$dblclick = insertSelected;
35865
+ _el$22.$$click = () => selectEntry(entry);
35866
+ insert(_el$22, () => entry.character);
35867
+ createRenderEffect((_p$) => {
35868
+ var _v$5 = !!(selected().character === entry.character), _v$6 = `${entry.character} (${entry.codePoint})`, _v$7 = `${entry.character} (${entry.codePoint})`, _v$8 = `editor-symbol-dialog-${entry.codePoint.replace(/[^A-Z0-9]/g, "-")}`;
35869
+ _v$5 !== _p$.e && _el$22.classList.toggle("oasis-editor-symbol-dialog-tile-active", _p$.e = _v$5);
35870
+ _v$6 !== _p$.t && setAttribute(_el$22, "title", _p$.t = _v$6);
35871
+ _v$7 !== _p$.a && setAttribute(_el$22, "aria-label", _p$.a = _v$7);
35872
+ _v$8 !== _p$.o && setAttribute(_el$22, "data-testid", _p$.o = _v$8);
35873
+ return _p$;
35874
+ }, {
35875
+ e: void 0,
35876
+ t: void 0,
35877
+ a: void 0,
35878
+ o: void 0
35879
+ });
35880
+ return _el$22;
35881
+ })()
35882
+ }), null);
35883
+ insert(_el$13, () => t("dialog.symbol.preview"));
35884
+ insert(_el$14, () => selected().character);
35885
+ insert(_el$16, () => t("dialog.symbol.code"));
35886
+ _el$17.$$input = (event) => selectCodePoint(event.currentTarget.value);
35887
+ setAttribute(_el$17, "spellcheck", false);
35888
+ insert(_el$18, () => t("dialog.symbol.doubleClickHelp"));
35889
+ createRenderEffect((_p$) => {
35890
+ var _v$ = t("dialog.symbol.title"), _v$2 = font();
35891
+ _v$ !== _p$.e && setAttribute(_el$0, "aria-label", _p$.e = _v$);
35892
+ _v$2 !== _p$.t && setStyleProperty(_el$14, "font-family", _p$.t = _v$2);
35893
+ return _p$;
35894
+ }, {
35895
+ e: void 0,
35896
+ t: void 0
35897
+ });
35898
+ createRenderEffect(() => _el$17.value = codeInput());
35899
+ return _el$9;
35900
+ })()];
35901
+ }
35902
+ });
35903
+ }
35904
+ delegateEvents(["input", "click", "dblclick"]);
35663
35905
  var _tmpl$$4 = /* @__PURE__ */ template(`<div class=oasis-editor-find-replace-dialog><div class=oasis-editor-fr-header></div><div class=oasis-editor-fr-body><div class=oasis-editor-fr-input-group><div class=oasis-editor-fr-input-wrapper></div></div><div class=oasis-editor-fr-input-group>`);
35664
35906
  function FindReplaceDialog(props) {
35665
35907
  const t = useI18n();
@@ -35974,9 +36216,45 @@ function EditorDialogsLayer(props) {
35974
36216
  paragraphDialog,
35975
36217
  setParagraphDialog,
35976
36218
  tablePropertiesDialog,
35977
- setTablePropertiesDialog
36219
+ setTablePropertiesDialog,
36220
+ newDocumentDialog,
36221
+ setNewDocumentDialog,
36222
+ symbolDialog,
36223
+ setSymbolDialog
35978
36224
  } = props.dialogs;
35979
- return [createComponent(LinkDialog, {
36225
+ return [createComponent(NewDocumentConfirmationDialog, {
36226
+ get isOpen() {
36227
+ return newDocumentDialog().isOpen;
36228
+ },
36229
+ onClose: () => {
36230
+ setNewDocumentDialog({
36231
+ isOpen: false
36232
+ });
36233
+ props.focusInput();
36234
+ },
36235
+ onConfirm: () => {
36236
+ setNewDocumentDialog({
36237
+ isOpen: false
36238
+ });
36239
+ props.confirmNewDocument();
36240
+ }
36241
+ }), createComponent(SymbolDialog, {
36242
+ get isOpen() {
36243
+ return symbolDialog().isOpen;
36244
+ },
36245
+ onClose: () => {
36246
+ setSymbolDialog({
36247
+ isOpen: false
36248
+ });
36249
+ props.focusInput();
36250
+ },
36251
+ onInsert: (symbol, fontFamily) => {
36252
+ setSymbolDialog({
36253
+ isOpen: false
36254
+ });
36255
+ props.insertSymbol(symbol, fontFamily);
36256
+ }
36257
+ }), createComponent(LinkDialog, {
35980
36258
  get isOpen() {
35981
36259
  return linkDialog().isOpen;
35982
36260
  },
@@ -36397,7 +36675,8 @@ function children$1(node) {
36397
36675
  const result = [];
36398
36676
  for (let index = 0; index < node.childNodes.length; index += 1) {
36399
36677
  const child = node.childNodes[index];
36400
- if ((child == null ? void 0 : child.nodeType) === child.ELEMENT_NODE) result.push(child);
36678
+ if ((child == null ? void 0 : child.nodeType) === child.ELEMENT_NODE)
36679
+ result.push(child);
36401
36680
  }
36402
36681
  return result;
36403
36682
  }
@@ -36419,7 +36698,11 @@ function copyMissingAttributes$8(source, target) {
36419
36698
  const exists = attribute.namespaceURI ? target.hasAttributeNS(attribute.namespaceURI, localName2) : target.hasAttribute(attribute.name);
36420
36699
  if (exists) continue;
36421
36700
  if (attribute.namespaceURI) {
36422
- target.setAttributeNS(attribute.namespaceURI, attribute.name, attribute.value);
36701
+ target.setAttributeNS(
36702
+ attribute.namespaceURI,
36703
+ attribute.name,
36704
+ attribute.value
36705
+ );
36423
36706
  } else {
36424
36707
  target.setAttribute(attribute.name, attribute.value);
36425
36708
  }
@@ -36468,7 +36751,10 @@ function sourceCommentsXml(sourcePackage) {
36468
36751
  return (part == null ? void 0 : part.kind) === "xml" ? part.data : void 0;
36469
36752
  }
36470
36753
  function replaceBodyChildren(source, target) {
36471
- const generatedParaId = attr$2(commentParagraphs(target)[0] ?? target, "paraId");
36754
+ const generatedParaId = attr$2(
36755
+ commentParagraphs(target)[0] ?? target,
36756
+ "paraId"
36757
+ );
36472
36758
  while (target.firstChild) target.removeChild(target.firstChild);
36473
36759
  for (let index = 0; index < source.childNodes.length; index += 1) {
36474
36760
  const child = source.childNodes[index];
@@ -36490,7 +36776,9 @@ function mergeChangedBodyExtensions(source, target) {
36490
36776
  mergeNestedExtensionMarkup(sourceParagraphs[0], targetParagraphs[0]);
36491
36777
  }
36492
36778
  const targetExtensionKeys = new Set(
36493
- children$1(target).filter((child) => child.namespaceURI !== WORD_NS$6).map((child) => `${child.namespaceURI ?? ""}\0${name$1(child)}`)
36779
+ children$1(target).filter((child) => child.namespaceURI !== WORD_NS$6).map(
36780
+ (child) => `${child.namespaceURI ?? ""}\0${name$1(child)}`
36781
+ )
36494
36782
  );
36495
36783
  for (const child of children$1(source)) {
36496
36784
  if (child.namespaceURI === WORD_NS$6) continue;
@@ -36513,7 +36801,8 @@ function mergeCommentEntriesOoxmlSource(sourceXml, rebuiltXml) {
36513
36801
  }
36514
36802
  let changed = false;
36515
36803
  for (const sourceEntry of children$1(sourceRoot)) {
36516
- if (sourceEntry.namespaceURI !== WORD_NS$6 || name$1(sourceEntry) !== "comment") continue;
36804
+ if (sourceEntry.namespaceURI !== WORD_NS$6 || name$1(sourceEntry) !== "comment")
36805
+ continue;
36517
36806
  const id = attr$2(sourceEntry, "id");
36518
36807
  const target = id !== void 0 ? targetById.get(id) : void 0;
36519
36808
  if (!target) continue;
@@ -36524,7 +36813,8 @@ function mergeCommentEntriesOoxmlSource(sourceXml, rebuiltXml) {
36524
36813
  } else {
36525
36814
  mergeChangedBodyExtensions(sourceEntry, target);
36526
36815
  }
36527
- if (new XMLSerializer().serializeToString(target) !== before) changed = true;
36816
+ if (new XMLSerializer().serializeToString(target) !== before)
36817
+ changed = true;
36528
36818
  }
36529
36819
  return changed ? new XMLSerializer().serializeToString(rebuiltRoot.ownerDocument) : rebuiltXml;
36530
36820
  }
@@ -36760,7 +37050,11 @@ function copyMissingAttributes$6(source, target) {
36760
37050
  continue;
36761
37051
  }
36762
37052
  if (attribute.namespaceURI) {
36763
- target.setAttributeNS(attribute.namespaceURI, attribute.name, attribute.value);
37053
+ target.setAttributeNS(
37054
+ attribute.namespaceURI,
37055
+ attribute.name,
37056
+ attribute.value
37057
+ );
36764
37058
  } else {
36765
37059
  target.setAttribute(attribute.name, attribute.value);
36766
37060
  }
@@ -36851,7 +37145,10 @@ function mergeWordPartRootExtensionsFromSource(sourceXml, rebuiltXml, expectedRo
36851
37145
  (rebuiltChild) => elementKey$5(rebuiltChild) === elementKey$5(candidate)
36852
37146
  )
36853
37147
  ).find((candidate) => Boolean(candidate));
36854
- rebuiltRoot.insertBefore(sourceChild.cloneNode(true), nextRebuiltAnchor ?? null);
37148
+ rebuiltRoot.insertBefore(
37149
+ sourceChild.cloneNode(true),
37150
+ nextRebuiltAnchor ?? null
37151
+ );
36855
37152
  });
36856
37153
  return new XMLSerializer().serializeToString(rebuiltDocument);
36857
37154
  }
@@ -36953,7 +37250,11 @@ function copyMissingAttributes$5(source, target) {
36953
37250
  continue;
36954
37251
  }
36955
37252
  if (attribute.namespaceURI) {
36956
- target.setAttributeNS(attribute.namespaceURI, attribute.name, attribute.value);
37253
+ target.setAttributeNS(
37254
+ attribute.namespaceURI,
37255
+ attribute.name,
37256
+ attribute.value
37257
+ );
36957
37258
  } else {
36958
37259
  target.setAttribute(attribute.name, attribute.value);
36959
37260
  }
@@ -36976,7 +37277,10 @@ function bodyAnchorIdentity(element) {
36976
37277
  }
36977
37278
  if (localName2 === "sdt") {
36978
37279
  const properties = directWordChild$4(element, "sdtPr");
36979
- const id = properties ? getAttributeByLocalName$6(directWordChild$4(properties, "id") ?? properties, "val") : void 0;
37280
+ const id = properties ? getAttributeByLocalName$6(
37281
+ directWordChild$4(properties, "id") ?? properties,
37282
+ "val"
37283
+ ) : void 0;
36980
37284
  return id ? `sdt:${id}` : void 0;
36981
37285
  }
36982
37286
  if (localName2 === "sectPr") {
@@ -37221,9 +37525,10 @@ async function patchRebuiltHeaderFooterRootsFromSource(sourcePackage, rebuilt) {
37221
37525
  const sourceReferences = collectReferences(sourceMainPart.data);
37222
37526
  const rebuiltReferences = collectReferences(rebuiltMainXml);
37223
37527
  const sourceReferenceByKey = new Map(
37224
- sourceReferences.map(
37225
- (reference) => [reference.key, reference]
37226
- )
37528
+ sourceReferences.map((reference) => [
37529
+ reference.key,
37530
+ reference
37531
+ ])
37227
37532
  );
37228
37533
  const sourceRelationships = relationshipById(
37229
37534
  sourceMainPart.relationships ?? []
@@ -37423,12 +37728,10 @@ function transformRebuiltRelationships(relationships, sourceRelationships, conve
37423
37728
  function mergeRelationships(source, rebuilt, relationshipPartPathValue) {
37424
37729
  const result = [...rebuilt];
37425
37730
  const rebuiltById = new Map(
37426
- rebuilt.map(
37427
- (relationship) => [
37428
- relationship.id,
37429
- relationship
37430
- ]
37431
- )
37731
+ rebuilt.map((relationship) => [
37732
+ relationship.id,
37733
+ relationship
37734
+ ])
37432
37735
  );
37433
37736
  for (const relationship of source) {
37434
37737
  const rebuiltWithSameId = rebuiltById.get(relationship.id);
@@ -37592,12 +37895,7 @@ async function patchRebuiltDocxWithSourcePackage(document2, rebuiltBuffer) {
37592
37895
  continue;
37593
37896
  }
37594
37897
  const rebuiltBytes = await entry.async("uint8array");
37595
- if (canKeepSourcePartUntouched(
37596
- sourcePackage,
37597
- path,
37598
- actualPath,
37599
- rebuiltBytes
37600
- )) {
37898
+ if (canKeepSourcePartUntouched(sourcePackage, path, actualPath, rebuiltBytes)) {
37601
37899
  continue;
37602
37900
  }
37603
37901
  output.file(actualPath, rebuiltBytes);
@@ -37690,7 +37988,10 @@ function replaceAttributeByLocalName(element, localName2, value) {
37690
37988
  function collectHeaderFooterReferences(xml) {
37691
37989
  const document2 = new DOMParser().parseFromString(xml, "application/xml");
37692
37990
  const references = [];
37693
- const sectionProperties = collectElementsByLocalName(document2, "sectPr").filter(
37991
+ const sectionProperties = collectElementsByLocalName(
37992
+ document2,
37993
+ "sectPr"
37994
+ ).filter(
37694
37995
  (element) => {
37695
37996
  var _a;
37696
37997
  return ((_a = element.parentNode) == null ? void 0 : _a.localName) !== "sectPrChange";
@@ -37880,7 +38181,9 @@ function transformRelationshipsForOwner(relationships, currentOwnerPath, actualO
37880
38181
  if (relationship.targetMode === "External") {
37881
38182
  return relationship;
37882
38183
  }
37883
- const resolved = (_a = resolveOpcRelationships(currentOwnerPath, [relationship])[0]) == null ? void 0 : _a.resolvedTarget;
38184
+ const resolved = (_a = resolveOpcRelationships(currentOwnerPath, [
38185
+ relationship
38186
+ ])[0]) == null ? void 0 : _a.resolvedTarget;
37884
38187
  if (!resolved) {
37885
38188
  return relationship;
37886
38189
  }
@@ -38102,10 +38405,7 @@ async function prepareContentTypes(rebuilt, plan) {
38102
38405
  delete contentTypes.overrides[match.current.partPath];
38103
38406
  }
38104
38407
  }
38105
- rebuilt.file(
38106
- OPC_CONTENT_TYPES_PATH,
38107
- serializeOpcContentTypes(contentTypes)
38108
- );
38408
+ rebuilt.file(OPC_CONTENT_TYPES_PATH, serializeOpcContentTypes(contentTypes));
38109
38409
  }
38110
38410
  function sourceDocumentWithoutDeletedHeaderFooterParts(document2, deletedPartPaths) {
38111
38411
  const sourcePackage = document2.sourcePackage;
@@ -38211,7 +38511,8 @@ function children(node) {
38211
38511
  const result = [];
38212
38512
  for (let index = 0; index < node.childNodes.length; index += 1) {
38213
38513
  const child = node.childNodes[index];
38214
- if ((child == null ? void 0 : child.nodeType) === child.ELEMENT_NODE) result.push(child);
38514
+ if ((child == null ? void 0 : child.nodeType) === child.ELEMENT_NODE)
38515
+ result.push(child);
38215
38516
  }
38216
38517
  return result;
38217
38518
  }
@@ -38236,7 +38537,11 @@ function copyMissingAttributes$4(source, target) {
38236
38537
  const exists = attribute.namespaceURI ? target.hasAttributeNS(attribute.namespaceURI, localName2) : target.hasAttribute(attribute.name);
38237
38538
  if (exists) continue;
38238
38539
  if (attribute.namespaceURI) {
38239
- target.setAttributeNS(attribute.namespaceURI, attribute.name, attribute.value);
38540
+ target.setAttributeNS(
38541
+ attribute.namespaceURI,
38542
+ attribute.name,
38543
+ attribute.value
38544
+ );
38240
38545
  } else {
38241
38546
  target.setAttribute(attribute.name, attribute.value);
38242
38547
  }
@@ -38265,14 +38570,17 @@ function isModeledBlock(element) {
38265
38570
  return element.namespaceURI === WORD_NS$6 && MODELED_BLOCK_NAMES.has(name(element));
38266
38571
  }
38267
38572
  function blockIdentity(element) {
38268
- if (element.namespaceURI !== WORD_NS$6 || name(element) !== "p") return void 0;
38573
+ if (element.namespaceURI !== WORD_NS$6 || name(element) !== "p")
38574
+ return void 0;
38269
38575
  const paraId = attr$1(element, "paraId");
38270
38576
  return paraId ? `p:${paraId}` : void 0;
38271
38577
  }
38272
38578
  function topologyStable(source, target) {
38273
38579
  const sourceBlocks = source.filter(isModeledBlock);
38274
38580
  const targetBlocks = target.filter(isModeledBlock);
38275
- return sourceBlocks.length === targetBlocks.length && sourceBlocks.every((block, index) => name(block) === name(targetBlocks[index]));
38581
+ return sourceBlocks.length === targetBlocks.length && sourceBlocks.every(
38582
+ (block, index) => name(block) === name(targetBlocks[index])
38583
+ );
38276
38584
  }
38277
38585
  function anchorForOpaqueChild(sourceChildren, sourceIndex, targetChildren, stable) {
38278
38586
  const nextSourceBlock = sourceChildren.slice(sourceIndex + 1).find(isModeledBlock);
@@ -38299,7 +38607,9 @@ function mergeRegularEntry(source, target) {
38299
38607
  const childKey = key$1(sourceChild);
38300
38608
  const occurrence = occurrences.get(childKey) ?? 0;
38301
38609
  occurrences.set(childKey, occurrence + 1);
38302
- if (children(target).filter((candidate) => key$1(candidate) === childKey)[occurrence]) {
38610
+ if (children(target).filter(
38611
+ (candidate) => key$1(candidate) === childKey
38612
+ )[occurrence]) {
38303
38613
  return;
38304
38614
  }
38305
38615
  const anchor = anchorForOpaqueChild(
@@ -38334,7 +38644,8 @@ function mergeNotePart(document2, sourceXml, rebuiltXml, spec) {
38334
38644
  );
38335
38645
  const targetByIdentity = /* @__PURE__ */ new Map();
38336
38646
  for (const entry of children(rebuiltRoot)) {
38337
- if (entry.namespaceURI !== WORD_NS$6 || name(entry) !== spec.entryName) continue;
38647
+ if (entry.namespaceURI !== WORD_NS$6 || name(entry) !== spec.entryName)
38648
+ continue;
38338
38649
  const identity = entryIdentity(entry);
38339
38650
  if (identity) targetByIdentity.set(identity, entry);
38340
38651
  }
@@ -38384,7 +38695,8 @@ function elementChildren$6(node) {
38384
38695
  const children2 = [];
38385
38696
  for (let index = 0; index < node.childNodes.length; index += 1) {
38386
38697
  const child = node.childNodes[index];
38387
- if ((child == null ? void 0 : child.nodeType) === child.ELEMENT_NODE) children2.push(child);
38698
+ if ((child == null ? void 0 : child.nodeType) === child.ELEMENT_NODE)
38699
+ children2.push(child);
38388
38700
  }
38389
38701
  return children2;
38390
38702
  }
@@ -38424,7 +38736,11 @@ function copyMissingAttributes$3(source, target) {
38424
38736
  const exists = attribute.namespaceURI ? target.hasAttributeNS(attribute.namespaceURI, localName2) : target.hasAttribute(attribute.name);
38425
38737
  if (exists) continue;
38426
38738
  if (attribute.namespaceURI) {
38427
- target.setAttributeNS(attribute.namespaceURI, attribute.name, attribute.value);
38739
+ target.setAttributeNS(
38740
+ attribute.namespaceURI,
38741
+ attribute.name,
38742
+ attribute.value
38743
+ );
38428
38744
  } else {
38429
38745
  target.setAttribute(attribute.name, attribute.value);
38430
38746
  }
@@ -38433,7 +38749,8 @@ function copyMissingAttributes$3(source, target) {
38433
38749
  function mergeExtensionChildrenOnly$1(source, target) {
38434
38750
  const targetKeys = new Set(elementChildren$6(target).map(elementKey$3));
38435
38751
  for (const child of elementChildren$6(source)) {
38436
- if (child.namespaceURI === WORD_NS$3 || targetKeys.has(elementKey$3(child))) continue;
38752
+ if (child.namespaceURI === WORD_NS$3 || targetKeys.has(elementKey$3(child)))
38753
+ continue;
38437
38754
  target.appendChild(child.cloneNode(true));
38438
38755
  }
38439
38756
  }
@@ -38442,8 +38759,14 @@ function insertSourceChildInOrder$1(sourceChildren, sourceIndex, sourceChild, ta
38442
38759
  target.insertBefore(sourceChild.cloneNode(true), anchor ?? null);
38443
38760
  }
38444
38761
  function parseNumberingRoots(sourceXml, rebuiltXml) {
38445
- const sourceRoot = new DOMParser().parseFromString(sourceXml, "application/xml").documentElement;
38446
- const rebuiltRoot = new DOMParser().parseFromString(rebuiltXml, "application/xml").documentElement;
38762
+ const sourceRoot = new DOMParser().parseFromString(
38763
+ sourceXml,
38764
+ "application/xml"
38765
+ ).documentElement;
38766
+ const rebuiltRoot = new DOMParser().parseFromString(
38767
+ rebuiltXml,
38768
+ "application/xml"
38769
+ ).documentElement;
38447
38770
  if (!sourceRoot || !rebuiltRoot || sourceRoot.namespaceURI !== WORD_NS$3 || rebuiltRoot.namespaceURI !== WORD_NS$3 || elementLocalName$6(sourceRoot) !== "numbering" || elementLocalName$6(rebuiltRoot) !== "numbering") {
38448
38771
  return void 0;
38449
38772
  }
@@ -38469,7 +38792,8 @@ function filteredSourceRunProperties(source) {
38469
38792
  const clone = source.cloneNode(false);
38470
38793
  let preserved = false;
38471
38794
  for (const child of elementChildren$6(source)) {
38472
- if (child.namespaceURI === WORD_NS$3 && elementLocalName$6(child) === "rFonts") continue;
38795
+ if (child.namespaceURI === WORD_NS$3 && elementLocalName$6(child) === "rFonts")
38796
+ continue;
38473
38797
  clone.appendChild(child.cloneNode(true));
38474
38798
  preserved = true;
38475
38799
  }
@@ -38479,7 +38803,10 @@ function mergeLevelRunProperties(source, target) {
38479
38803
  copyMissingAttributes$3(source, target);
38480
38804
  const sourceChildren = elementChildren$6(source);
38481
38805
  const targetByKey = new Map(
38482
- elementChildren$6(target).map((child) => [elementKey$3(child), child])
38806
+ elementChildren$6(target).map((child) => [
38807
+ elementKey$3(child),
38808
+ child
38809
+ ])
38483
38810
  );
38484
38811
  sourceChildren.forEach((sourceChild, sourceIndex) => {
38485
38812
  const childKey = elementKey$3(sourceChild);
@@ -38489,7 +38816,8 @@ function mergeLevelRunProperties(source, target) {
38489
38816
  mergeExtensionChildrenOnly$1(sourceChild, targetChild);
38490
38817
  return;
38491
38818
  }
38492
- if (sourceChild.namespaceURI === WORD_NS$3 && elementLocalName$6(sourceChild) === "rFonts") return;
38819
+ if (sourceChild.namespaceURI === WORD_NS$3 && elementLocalName$6(sourceChild) === "rFonts")
38820
+ return;
38493
38821
  insertSourceChildInOrder$1(
38494
38822
  sourceChildren,
38495
38823
  sourceIndex,
@@ -38503,7 +38831,10 @@ function mergeLevelElement(source, target) {
38503
38831
  copyMissingAttributes$3(source, target);
38504
38832
  const sourceChildren = elementChildren$6(source);
38505
38833
  const targetByKey = new Map(
38506
- elementChildren$6(target).map((child) => [elementKey$3(child), child])
38834
+ elementChildren$6(target).map((child) => [
38835
+ elementKey$3(child),
38836
+ child
38837
+ ])
38507
38838
  );
38508
38839
  sourceChildren.forEach((sourceChild, sourceIndex) => {
38509
38840
  const childKey = elementKey$3(sourceChild);
@@ -38518,7 +38849,8 @@ function mergeLevelElement(source, target) {
38518
38849
  }
38519
38850
  return;
38520
38851
  }
38521
- if (sourceChild.namespaceURI === WORD_NS$3 && MODELED_LEVEL_CHILDREN.has(localName2)) return;
38852
+ if (sourceChild.namespaceURI === WORD_NS$3 && MODELED_LEVEL_CHILDREN.has(localName2))
38853
+ return;
38522
38854
  if (sourceChild.namespaceURI === WORD_NS$3 && localName2 === "rPr") {
38523
38855
  const filtered = filteredSourceRunProperties(sourceChild);
38524
38856
  if (filtered) target.appendChild(filtered);
@@ -38540,9 +38872,10 @@ function mergeAbstractNumElement(source, target) {
38540
38872
  copyMissingAttributes$3(source, target);
38541
38873
  const sourceChildren = elementChildren$6(source);
38542
38874
  const targetByKey = new Map(
38543
- elementChildren$6(target).map(
38544
- (child) => [abstractChildKey(child), child]
38545
- )
38875
+ elementChildren$6(target).map((child) => [
38876
+ abstractChildKey(child),
38877
+ child
38878
+ ])
38546
38879
  );
38547
38880
  sourceChildren.forEach((sourceChild, sourceIndex) => {
38548
38881
  const childKey = abstractChildKey(sourceChild);
@@ -38608,7 +38941,9 @@ function canonicalizeLevelOverride(sourceOverride, effectiveLevel) {
38608
38941
  continue;
38609
38942
  }
38610
38943
  if (sourceChild.namespaceURI === WORD_NS$3 && localName2 === "lvl") {
38611
- result.appendChild(canonicalizeOverrideLevel(sourceChild, effectiveLevel));
38944
+ result.appendChild(
38945
+ canonicalizeOverrideLevel(sourceChild, effectiveLevel)
38946
+ );
38612
38947
  continue;
38613
38948
  }
38614
38949
  result.appendChild(sourceChild.cloneNode(true));
@@ -38621,7 +38956,10 @@ function mergeNumElement(source, target, numberingRoot) {
38621
38956
  const existingOverrides = /* @__PURE__ */ new Map();
38622
38957
  for (const child of elementChildren$6(target)) {
38623
38958
  if (child.namespaceURI === WORD_NS$3 && elementLocalName$6(child) === "lvlOverride") {
38624
- existingOverrides.set(getAttributeByLocalName$3(child, "ilvl") ?? "0", child);
38959
+ existingOverrides.set(
38960
+ getAttributeByLocalName$3(child, "ilvl") ?? "0",
38961
+ child
38962
+ );
38625
38963
  }
38626
38964
  }
38627
38965
  for (const sourceChild of elementChildren$6(source)) {
@@ -38635,7 +38973,11 @@ function mergeNumElement(source, target, numberingRoot) {
38635
38973
  }
38636
38974
  if (sourceChild.namespaceURI === WORD_NS$3 && localName2 === "lvlOverride") {
38637
38975
  const ilvl = getAttributeByLocalName$3(sourceChild, "ilvl") ?? "0";
38638
- const effectiveLevel = findAbstractLevelForNum(numberingRoot, target, ilvl);
38976
+ const effectiveLevel = findAbstractLevelForNum(
38977
+ numberingRoot,
38978
+ target,
38979
+ ilvl
38980
+ );
38639
38981
  const canonical = canonicalizeLevelOverride(sourceChild, effectiveLevel);
38640
38982
  const existing = existingOverrides.get(ilvl);
38641
38983
  if (existing) {
@@ -38671,9 +39013,10 @@ function mergeNumberingOoxmlSource(sourceXml, rebuiltXml) {
38671
39013
  copyMissingAttributes$3(sourceRoot, rebuiltRoot);
38672
39014
  const sourceChildren = elementChildren$6(sourceRoot);
38673
39015
  const targetByKey = new Map(
38674
- elementChildren$6(rebuiltRoot).map(
38675
- (child) => [rootChildKey(child), child]
38676
- )
39016
+ elementChildren$6(rebuiltRoot).map((child) => [
39017
+ rootChildKey(child),
39018
+ child
39019
+ ])
38677
39020
  );
38678
39021
  sourceChildren.forEach((sourceChild, sourceIndex) => {
38679
39022
  const childKey = rootChildKey(sourceChild);
@@ -38823,7 +39166,11 @@ function copyMissingAttributes$2(source, target) {
38823
39166
  continue;
38824
39167
  }
38825
39168
  if (attribute.namespaceURI) {
38826
- target.setAttributeNS(attribute.namespaceURI, attribute.name, attribute.value);
39169
+ target.setAttributeNS(
39170
+ attribute.namespaceURI,
39171
+ attribute.name,
39172
+ attribute.value
39173
+ );
38827
39174
  } else {
38828
39175
  target.setAttribute(attribute.name, attribute.value);
38829
39176
  }
@@ -38861,10 +39208,12 @@ function mergeSectionProperties(source, target) {
38861
39208
  if (isModeledSectionProperty(sourceChild)) {
38862
39209
  continue;
38863
39210
  }
38864
- const nextTargetAnchor = sourceChildren.slice(sourceIndex + 1).map((candidate) => {
38865
- var _a2;
38866
- return (_a2 = targetByKey.get(elementKey$2(candidate))) == null ? void 0 : _a2[0];
38867
- }).find((candidate) => Boolean(candidate));
39211
+ const nextTargetAnchor = sourceChildren.slice(sourceIndex + 1).map(
39212
+ (candidate) => {
39213
+ var _a2;
39214
+ return (_a2 = targetByKey.get(elementKey$2(candidate))) == null ? void 0 : _a2[0];
39215
+ }
39216
+ ).find((candidate) => Boolean(candidate));
38868
39217
  target.insertBefore(sourceChild.cloneNode(true), nextTargetAnchor ?? null);
38869
39218
  }
38870
39219
  }
@@ -39008,7 +39357,11 @@ async function filterSourceOnlyWordSingletons(rebuilt, originallyPresent) {
39008
39357
  ) || changed;
39009
39358
  }
39010
39359
  if (!originallyPresent.styles) {
39011
- changed = await filterSourceOnlyPart(rebuilt, "word/styles.xml", filterStylesXml) || changed;
39360
+ changed = await filterSourceOnlyPart(
39361
+ rebuilt,
39362
+ "word/styles.xml",
39363
+ filterStylesXml
39364
+ ) || changed;
39012
39365
  }
39013
39366
  if (!originallyPresent.fontTable) {
39014
39367
  changed = await filterSourceOnlyPart(
@@ -39083,9 +39436,10 @@ function insertParagraphPropertiesAtSourcePosition(sourceStyle, targetStyle, sou
39083
39436
  const sourceIndex = sourceChildren.indexOf(sourceProperties);
39084
39437
  const targetChildren = elementChildren$3(targetStyle);
39085
39438
  const targetByKey = new Map(
39086
- targetChildren.map(
39087
- (child) => [styleChildKey$1(child), child]
39088
- )
39439
+ targetChildren.map((child) => [
39440
+ styleChildKey$1(child),
39441
+ child
39442
+ ])
39089
39443
  );
39090
39444
  const anchor = sourceChildren.slice(sourceIndex + 1).map(
39091
39445
  (candidate) => targetByKey.get(styleChildKey$1(candidate))
@@ -39397,12 +39751,19 @@ async function patchRebuiltStyleRunPropertiesFromSource(sourcePackage, rebuilt)
39397
39751
  return true;
39398
39752
  }
39399
39753
  const REBUILT_STYLES_PATH = "word/styles.xml";
39400
- const CONDITIONAL_PROPERTY_NAMES = /* @__PURE__ */ new Set(["pPr", "rPr", "tblPr", "trPr", "tcPr"]);
39754
+ const CONDITIONAL_PROPERTY_NAMES = /* @__PURE__ */ new Set([
39755
+ "pPr",
39756
+ "rPr",
39757
+ "tblPr",
39758
+ "trPr",
39759
+ "tcPr"
39760
+ ]);
39401
39761
  function elementChildren$1(node) {
39402
39762
  const result = [];
39403
39763
  for (let index = 0; index < node.childNodes.length; index += 1) {
39404
39764
  const child = node.childNodes[index];
39405
- if ((child == null ? void 0 : child.nodeType) === child.ELEMENT_NODE) result.push(child);
39765
+ if ((child == null ? void 0 : child.nodeType) === child.ELEMENT_NODE)
39766
+ result.push(child);
39406
39767
  }
39407
39768
  return result;
39408
39769
  }
@@ -39427,7 +39788,11 @@ function copyMissingAttributes$1(source, target) {
39427
39788
  const exists = attribute.namespaceURI ? target.hasAttributeNS(attribute.namespaceURI, name2) : target.hasAttribute(attribute.name);
39428
39789
  if (exists) continue;
39429
39790
  if (attribute.namespaceURI) {
39430
- target.setAttributeNS(attribute.namespaceURI, attribute.name, attribute.value);
39791
+ target.setAttributeNS(
39792
+ attribute.namespaceURI,
39793
+ attribute.name,
39794
+ attribute.value
39795
+ );
39431
39796
  } else {
39432
39797
  target.setAttribute(attribute.name, attribute.value);
39433
39798
  }
@@ -39530,7 +39895,10 @@ function mergeConditionalContainer(source, target) {
39530
39895
  function filteredOpaqueConditional(source) {
39531
39896
  const document2 = source.ownerDocument;
39532
39897
  if (!document2) return void 0;
39533
- const result = document2.createElementNS(WORD_NS$6, "w:tblStylePr");
39898
+ const result = document2.createElementNS(
39899
+ WORD_NS$6,
39900
+ "w:tblStylePr"
39901
+ );
39534
39902
  copyMissingAttributes$1(source, result);
39535
39903
  let preserved = false;
39536
39904
  for (const sourceChild of elementChildren$1(source)) {
@@ -39611,7 +39979,8 @@ function mergeTableStylePropertiesOoxmlSource(sourceXml, rebuiltXml) {
39611
39979
  }
39612
39980
  let changed = false;
39613
39981
  for (const sourceStyle of elementChildren$1(sourceRoot)) {
39614
- if (sourceStyle.namespaceURI !== WORD_NS$6 || localName(sourceStyle) !== "style") continue;
39982
+ if (sourceStyle.namespaceURI !== WORD_NS$6 || localName(sourceStyle) !== "style")
39983
+ continue;
39615
39984
  if (attr(sourceStyle, "type") !== "table") continue;
39616
39985
  const id = attr(sourceStyle, "styleId");
39617
39986
  const target = id ? rebuiltStyles.get(id) : void 0;
@@ -39667,7 +40036,11 @@ function copyMissingAttributes(source, target) {
39667
40036
  continue;
39668
40037
  }
39669
40038
  if (attribute.namespaceURI) {
39670
- target.setAttributeNS(attribute.namespaceURI, attribute.name, attribute.value);
40039
+ target.setAttributeNS(
40040
+ attribute.namespaceURI,
40041
+ attribute.name,
40042
+ attribute.value
40043
+ );
39671
40044
  } else {
39672
40045
  target.setAttribute(attribute.name, attribute.value);
39673
40046
  }
@@ -39713,7 +40086,9 @@ const SETTINGS_MODELED_ROOT_NAMES = /* @__PURE__ */ new Set([
39713
40086
  function mergePartialSettingsContainer(source, target, modeledChildNames) {
39714
40087
  copyMissingAttributes(source, target);
39715
40088
  const targetChildren = elementChildren(target);
39716
- const targetByKey = new Map(targetChildren.map((child) => [elementKey(child), child]));
40089
+ const targetByKey = new Map(
40090
+ targetChildren.map((child) => [elementKey(child), child])
40091
+ );
39717
40092
  const sourceChildren = elementChildren(source);
39718
40093
  sourceChildren.forEach((sourceChild, sourceIndex) => {
39719
40094
  const key2 = elementKey(sourceChild);
@@ -39867,7 +40242,10 @@ function mergeStylesXml(sourceXml, rebuiltXml) {
39867
40242
  copyMissingAttributes(sourceRoot, rebuiltRoot);
39868
40243
  const sourceChildren = elementChildren(sourceRoot);
39869
40244
  const targetByKey = new Map(
39870
- elementChildren(rebuiltRoot).map((child) => [styleRootChildKey(child), child])
40245
+ elementChildren(rebuiltRoot).map((child) => [
40246
+ styleRootChildKey(child),
40247
+ child
40248
+ ])
39871
40249
  );
39872
40250
  sourceChildren.forEach((sourceChild, sourceIndex) => {
39873
40251
  const key2 = styleRootChildKey(sourceChild);
@@ -39939,7 +40317,10 @@ function mergeFontTableXml(sourceXml, rebuiltXml) {
39939
40317
  copyMissingAttributes(sourceRoot, rebuiltRoot);
39940
40318
  const sourceChildren = elementChildren(sourceRoot);
39941
40319
  const targetByKey = new Map(
39942
- elementChildren(rebuiltRoot).map((child) => [fontRootChildKey(child), child])
40320
+ elementChildren(rebuiltRoot).map((child) => [
40321
+ fontRootChildKey(child),
40322
+ child
40323
+ ])
39943
40324
  );
39944
40325
  sourceChildren.forEach((sourceChild, sourceIndex) => {
39945
40326
  const key2 = fontRootChildKey(sourceChild);
@@ -40050,18 +40431,34 @@ async function patchRebuiltDocxPreservingSource(document2, rebuiltBuffer) {
40050
40431
  styles: Boolean(rebuilt.file("word/styles.xml")),
40051
40432
  fontTable: Boolean(rebuilt.file("word/fontTable.xml"))
40052
40433
  };
40053
- let rebuiltChanged = await patchRebuiltWordSingletonsFromSource(sourcePackage, rebuilt);
40434
+ let rebuiltChanged = await patchRebuiltWordSingletonsFromSource(
40435
+ sourcePackage,
40436
+ rebuilt
40437
+ );
40054
40438
  if (numberingWasRebuilt) {
40055
40439
  rebuiltChanged = await patchRebuiltNumberingFromSource(sourcePackage, rebuilt) || rebuiltChanged;
40056
40440
  }
40057
40441
  if (originallyPresent.styles) {
40058
- rebuiltChanged = await patchRebuiltStyleParagraphPropertiesFromSource(sourcePackage, rebuilt) || rebuiltChanged;
40059
- rebuiltChanged = await patchRebuiltStyleRunPropertiesFromSource(sourcePackage, rebuilt) || rebuiltChanged;
40060
- rebuiltChanged = await patchRebuiltTableStylePropertiesFromSource(sourcePackage, rebuilt) || rebuiltChanged;
40442
+ rebuiltChanged = await patchRebuiltStyleParagraphPropertiesFromSource(
40443
+ sourcePackage,
40444
+ rebuilt
40445
+ ) || rebuiltChanged;
40446
+ rebuiltChanged = await patchRebuiltStyleRunPropertiesFromSource(
40447
+ sourcePackage,
40448
+ rebuilt
40449
+ ) || rebuiltChanged;
40450
+ rebuiltChanged = await patchRebuiltTableStylePropertiesFromSource(
40451
+ sourcePackage,
40452
+ rebuilt
40453
+ ) || rebuiltChanged;
40061
40454
  }
40062
40455
  rebuiltChanged = await filterSourceOnlyWordSingletons(rebuilt, originallyPresent) || rebuiltChanged;
40063
40456
  rebuiltChanged = await patchRebuiltRelatedStoryRootsFromSource(sourcePackage, rebuilt) || rebuiltChanged;
40064
- rebuiltChanged = await patchRebuiltNoteEntriesFromSource(document2, sourcePackage, rebuilt) || rebuiltChanged;
40457
+ rebuiltChanged = await patchRebuiltNoteEntriesFromSource(
40458
+ document2,
40459
+ sourcePackage,
40460
+ rebuilt
40461
+ ) || rebuiltChanged;
40065
40462
  rebuiltChanged = await patchRebuiltCommentEntriesFromSource(sourcePackage, rebuilt) || rebuiltChanged;
40066
40463
  rebuiltChanged = await patchRebuiltCommentsExtendedFromSource(sourcePackage, rebuilt) || rebuiltChanged;
40067
40464
  rebuiltChanged = await patchRebuiltHeaderFooterRootsFromSource(sourcePackage, rebuilt) || rebuiltChanged;
@@ -40080,7 +40477,10 @@ async function patchRebuiltDocxPreservingSource(document2, rebuiltBuffer) {
40080
40477
  rebuiltChanged = true;
40081
40478
  }
40082
40479
  const sourceAwareRebuiltBuffer = rebuiltChanged ? await rebuilt.generateAsync({ type: "arraybuffer" }) : rebuiltBuffer;
40083
- return patchRebuiltDocxWithHeaderFooterSourcePaths(document2, sourceAwareRebuiltBuffer);
40480
+ return patchRebuiltDocxWithHeaderFooterSourcePaths(
40481
+ document2,
40482
+ sourceAwareRebuiltBuffer
40483
+ );
40084
40484
  }
40085
40485
  async function exportEditorDocumentToDocxPreservingSource(document2) {
40086
40486
  if (!document2.sourcePackage) {
@@ -45465,10 +45865,7 @@ function computeCanvasSelectionGeometry(snapshot, state) {
45465
45865
  const focusTableCell = (_b = (snapshot.paragraphsById.get(state.selection.focus.paragraphId) ?? []).find((paragraph) => paragraph.tableCell)) == null ? void 0 : _b.tableCell;
45466
45866
  let isMultiCellSelection = false;
45467
45867
  if (anchorTableCell && focusTableCell && anchorTableCell.tableId === focusTableCell.tableId && (anchorTableCell.rowIndex !== focusTableCell.rowIndex || anchorTableCell.cellIndex !== focusTableCell.cellIndex)) {
45468
- const tableBlock = findTableById(
45469
- state.document,
45470
- anchorTableCell.tableId
45471
- );
45868
+ const tableBlock = findTableById(state.document, anchorTableCell.tableId);
45472
45869
  if (tableBlock) {
45473
45870
  const tableLayout = buildTableCellLayout(tableBlock);
45474
45871
  const anchorCell = tableLayout.find(
@@ -47142,11 +47539,7 @@ const applyTableAwareParagraphEdit = (current, getTargetBlocks, edit) => {
47142
47539
  if (!location || current.selection.anchor.paragraphId !== current.selection.focus.paragraphId) {
47143
47540
  return edit(current);
47144
47541
  }
47145
- const mutation = resolveTablePathMutation(
47146
- current,
47147
- getTargetBlocks,
47148
- location
47149
- );
47542
+ const mutation = resolveTablePathMutation(current, getTargetBlocks, location);
47150
47543
  if (!mutation) return edit(current);
47151
47544
  const tempState = {
47152
47545
  ...current,
@@ -47783,9 +48176,7 @@ function createTableCellSpanOperationsImpl(deps) {
47783
48176
  {
47784
48177
  ...cell,
47785
48178
  colSpan: void 0,
47786
- blocks: cell.blocks.map(
47787
- (block) => cloneBlock(block)
47788
- ),
48179
+ blocks: cell.blocks.map((block) => cloneBlock(block)),
47789
48180
  ...revision ? {
47790
48181
  style: {
47791
48182
  ...cell.style ?? {},
@@ -48277,18 +48668,14 @@ function createTableSelectionAwareCommandsImpl(deps) {
48277
48668
  const resultParagraphs = getParagraphs(tempResult);
48278
48669
  const lastSegment = tablePath[tablePath.length - 1];
48279
48670
  if (!lastSegment) return current;
48280
- const mutation = resolveTablePathMutation(
48281
- current,
48282
- deps.getTargetBlocks,
48283
- {
48284
- blockIndex,
48285
- rowIndex: lastSegment.rowIndex,
48286
- cellIndex: lastSegment.cellIndex,
48287
- paragraphIndex: 0,
48288
- tablePath,
48289
- zone
48290
- }
48291
- );
48671
+ const mutation = resolveTablePathMutation(current, deps.getTargetBlocks, {
48672
+ blockIndex,
48673
+ rowIndex: lastSegment.rowIndex,
48674
+ cellIndex: lastSegment.cellIndex,
48675
+ paragraphIndex: 0,
48676
+ tablePath,
48677
+ zone
48678
+ });
48292
48679
  if (!mutation) return current;
48293
48680
  let paragraphIndex = 0;
48294
48681
  for (let index = 0; index < cells.length; index += 1) {
@@ -48307,11 +48694,7 @@ function createTableSelectionAwareCommandsImpl(deps) {
48307
48694
  );
48308
48695
  }
48309
48696
  }
48310
- return updateBlocksInCurrentSection(
48311
- current,
48312
- mutation.targetBlocks,
48313
- zone
48314
- );
48697
+ return updateBlocksInCurrentSection(current, mutation.targetBlocks, zone);
48315
48698
  });
48316
48699
  };
48317
48700
  const applySelectionAwareTextCommand = (command) => {
@@ -50994,12 +51377,7 @@ function findTableInBlocks(blocks, tableId, nested, movableTopLevelStory) {
50994
51377
  }
50995
51378
  for (const row of block.rows) {
50996
51379
  for (const cell of row.cells) {
50997
- const found = findTableInBlocks(
50998
- cell.blocks,
50999
- tableId,
51000
- true,
51001
- false
51002
- );
51380
+ const found = findTableInBlocks(cell.blocks, tableId, true, false);
51003
51381
  if (found) return found;
51004
51382
  }
51005
51383
  }
@@ -53708,6 +54086,15 @@ function createAppCommandsControllerImpl(deps) {
53708
54086
  };
53709
54087
  return { commandsController, keyboardCommandsController };
53710
54088
  }
54089
+ function createNewDocumentAction(deps) {
54090
+ return () => {
54091
+ if (deps.isDirty()) {
54092
+ deps.requestConfirmation();
54093
+ return;
54094
+ }
54095
+ deps.resetDocument();
54096
+ };
54097
+ }
53711
54098
  class EditorCommandRegistry {
53712
54099
  constructor() {
53713
54100
  __publicField(this, "bindings", /* @__PURE__ */ new Map());
@@ -53746,6 +54133,13 @@ class EditorCommandRegistry {
53746
54133
  }
53747
54134
  }
53748
54135
  const defaultEditorKeyBindings = [
54136
+ {
54137
+ id: "newDocument",
54138
+ command: "newDocument",
54139
+ key: "n",
54140
+ ctrlOrMeta: true,
54141
+ execute: () => true
54142
+ },
53749
54143
  {
53750
54144
  id: "selectAll",
53751
54145
  command: "selectAll",
@@ -54445,6 +54839,13 @@ function buildCoreFormattingCommands({
54445
54839
  return {
54446
54840
  selectAll: command("selectAll", formatting.selectAll),
54447
54841
  insertFootnote: command("insertFootnote", formatting.insertFootnote),
54842
+ insertText: actionCommand("insertText", (p) => {
54843
+ const payload = typeof p === "object" && p !== null && "text" in p ? p : { text: p };
54844
+ formatting.insertText(
54845
+ String(payload.text ?? ""),
54846
+ typeof payload.fontFamily === "string" ? payload.fontFamily : null
54847
+ );
54848
+ }),
54448
54849
  pastePlainText: command("pastePlainText", formatting.pastePlainText),
54449
54850
  bold: command("bold", formatting.bold, () => ({
54450
54851
  isActive: Boolean(s().bold)
@@ -54650,6 +55051,10 @@ function buildDocumentAndBrowserCommands({
54650
55051
  () => browser.copy(),
54651
55052
  () => ({ isEnabled: true })
54652
55053
  ),
55054
+ newDocument: actionCommand(
55055
+ "newDocument",
55056
+ () => document2.newDocument()
55057
+ ),
54653
55058
  exportDocx: actionCommand("exportDocx", () => document2.exportDocx()),
54654
55059
  exportPdf: actionCommand("exportPdf", () => document2.exportPdf()),
54655
55060
  importDocument: actionCommand(
@@ -54664,6 +55069,10 @@ function buildDocumentAndBrowserCommands({
54664
55069
  "insertShape",
54665
55070
  (p) => document2.insertShape(String(p))
54666
55071
  ),
55072
+ openSymbolDialog: actionCommand(
55073
+ "openSymbolDialog",
55074
+ () => document2.openSymbolDialog()
55075
+ ),
54667
55076
  unlink: actionCommand(
54668
55077
  "unlink",
54669
55078
  () => link.remove(),
@@ -55137,7 +55546,10 @@ function createEssentialsPlugin(deps) {
55137
55546
  }
55138
55547
  function buildEssentialsGate(options) {
55139
55548
  return {
55140
- isCommandEnabled: (commandName) => !options.isReadOnly() && (commandName !== "insertFootnote" || options.commandsController.canInsertFootnoteCommand())
55549
+ isCommandEnabled: (commandName) => {
55550
+ if (commandName === "openSymbolDialog") return true;
55551
+ return !options.isReadOnly() && (commandName !== "insertFootnote" || options.commandsController.canInsertFootnoteCommand());
55552
+ }
55141
55553
  };
55142
55554
  }
55143
55555
  function buildEssentialsStyle(options) {
@@ -55385,6 +55797,18 @@ function buildEssentialsFormatting(options) {
55385
55797
  return true;
55386
55798
  },
55387
55799
  insertFootnote: () => (options.commandsController.applyInsertFootnoteCommand(), true),
55800
+ insertText: (text, fontFamily) => {
55801
+ if (text.length === 0) return false;
55802
+ const styleOverride = fontFamily ? { fontFamily } : void 0;
55803
+ options.applyTransactionalState(
55804
+ (current) => options.tableOps.applyTableAwareParagraphEdit(
55805
+ current,
55806
+ (temp) => insertTextAtSelection(temp, text, styleOverride)
55807
+ )
55808
+ );
55809
+ options.focusInput();
55810
+ return true;
55811
+ },
55388
55812
  insertTableOfContents: () => {
55389
55813
  options.applyTransactionalState(
55390
55814
  (current) => insertTableOfContents(current, buildTocPageResolver(current))
@@ -55567,6 +55991,8 @@ function buildEssentialsDocument(options) {
55567
55991
  };
55568
55992
  });
55569
55993
  },
55994
+ newDocument: () => options.newDocument(),
55995
+ openSymbolDialog: () => options.openSymbolDialog(),
55570
55996
  exportDocx: () => void options.docIO.handleExportDocx(),
55571
55997
  exportPdf: () => void options.docIO.handleExportPdf(),
55572
55998
  importDocument: () => {
@@ -56017,13 +56443,13 @@ const defaultMenuItems = [
56017
56443
  path: "File/New",
56018
56444
  labelKey: "menu.file.new",
56019
56445
  shortcut: "Ctrl+N",
56020
- hidden: true,
56446
+ command: "newDocument",
56021
56447
  icon: "file-plus"
56022
56448
  },
56023
56449
  {
56024
56450
  id: "file_import",
56025
56451
  path: "File/Import",
56026
- labelKey: "toolbar.import",
56452
+ labelKey: "toolbar.importDocx",
56027
56453
  shortcut: "Ctrl+O",
56028
56454
  command: "importDocument",
56029
56455
  icon: "upload"
@@ -56604,7 +57030,13 @@ function createEditorCommandRuntimeImpl(deps) {
56604
57030
  applyTransactionalState: doc.applyTransactionalState,
56605
57031
  findReplace: {
56606
57032
  setIsOpen: interaction.fr.setIsOpen
56607
- }
57033
+ },
57034
+ newDocument: createNewDocumentAction({
57035
+ isDirty: () => runtimeClient.isDirty(),
57036
+ resetDocument: () => runtimeClient.resetDocument(),
57037
+ requestConfirmation: () => deps.setNewDocumentDialog({ isOpen: true })
57038
+ }),
57039
+ openSymbolDialog: () => deps.setSymbolDialog({ isOpen: true })
56608
57040
  },
56609
57041
  externalPlugins: deps.runtimeOptions().plugins,
56610
57042
  t: deps.translator,
@@ -56778,7 +57210,11 @@ function OasisEditorApp(props = {}) {
56778
57210
  paragraphDialog,
56779
57211
  setParagraphDialog,
56780
57212
  tablePropertiesDialog,
56781
- setTablePropertiesDialog
57213
+ setTablePropertiesDialog,
57214
+ newDocumentDialog,
57215
+ setNewDocumentDialog,
57216
+ symbolDialog,
57217
+ setSymbolDialog
56782
57218
  } = createEditorDialogs();
56783
57219
  const [welcomeOpen, setWelcomeOpen] = createSignal(false);
56784
57220
  const viewportRef = () => focusController.viewportRef;
@@ -56898,7 +57334,9 @@ function OasisEditorApp(props = {}) {
56898
57334
  imageInputRef,
56899
57335
  setLinkDialog,
56900
57336
  setImageAltDialog,
56901
- setImageCaptionDialog
57337
+ setImageCaptionDialog,
57338
+ setNewDocumentDialog,
57339
+ setSymbolDialog
56902
57340
  });
56903
57341
  const {
56904
57342
  commandsController,
@@ -57064,7 +57502,11 @@ function OasisEditorApp(props = {}) {
57064
57502
  paragraphDialog,
57065
57503
  setParagraphDialog,
57066
57504
  tablePropertiesDialog,
57067
- setTablePropertiesDialog
57505
+ setTablePropertiesDialog,
57506
+ newDocumentDialog,
57507
+ setNewDocumentDialog,
57508
+ symbolDialog,
57509
+ setSymbolDialog
57068
57510
  },
57069
57511
  findReplace: fr,
57070
57512
  fontFamilyOptions: computeFontFamilyOptions2,
@@ -57084,6 +57526,14 @@ function OasisEditorApp(props = {}) {
57084
57526
  applyParagraphDialogValues,
57085
57527
  setParagraphDialogDefault,
57086
57528
  applyTablePropertiesDialogValues,
57529
+ confirmNewDocument: () => runtimeClient.resetDocument(),
57530
+ insertSymbol: (symbol, fontFamily) => {
57531
+ runtimeEditor().commands.execute("insertText", {
57532
+ text: symbol,
57533
+ fontFamily
57534
+ });
57535
+ focusInput();
57536
+ },
57087
57537
  closeContextMenu
57088
57538
  }), null);
57089
57539
  insert(_el$, createComponent(EditorWorkspace, {