oasis-editor 0.0.72 → 0.0.74

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, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { n as normalizeSelection, g as getParagraphs, a as assertNever, c as createEditorParagraphFromRuns, b as getParagraphLength, d as createEditorRun, e as getDocumentSections, i as isInlineObjectRun, f as createEditorStyledRun, h as getParagraphText, j as getActiveZone, k as getActiveSectionIndex, p as positionToParagraphOffset, l as paragraphOffsetToPosition, m as clampPosition, o as findParagraphIndex, q as createCollapsedSelection, r as isSelectionCollapsed, E as EMU_PER_PX, s as createEditorParagraph, t as getBlockParagraphs, u as createEditorFootnote, v as createFootnoteReferenceRun, w as renumberFootnotes, x as iterateFootnoteReferenceRuns, y as getFootnoteDisplayMarker, z as findParagraphTableLocation, A as buildTableCellLayout, B as createSignal, C as createEffect, D as onCleanup, F as buildCanvasLayoutSnapshot, G as on, H as onMount, I as debounce, J as unwrap, K as getDocumentParagraphs, P as PT_PER_PX, L as createEditorTableCell, M as createEditorTableRow, N as createEditorTable, O as getDocumentSectionsCanonical, Q as createEditorDocument, R as getPageContentWidth, S as getDocumentPageSettings, T as getTableCellContentWidthForParagraph, U as resolveResizedDimensions, V as resolveImageSrc, W as resolveTextBoxRenderHeight, X as TWIPS_PER_POINT, Y as PX_PER_INCH, Z as TWIPS_PER_INCH, _ as resolveEffectiveParagraphStyle, $ as resolveEffectiveTextStyleForParagraph, a0 as EMU_PER_PT, a1 as iterateEndnoteReferenceRuns, a2 as imageContentTypeDefaults, a3 as JSZip, a4 as imageExtensionFromMime, a5 as pxToPt$1, a6 as resolveFloatingObjectRect, a7 as getTextBoxFloatingGeometry, a8 as getPresetPathSegments, a9 as projectBlocksLayout, aa as buildListLabels, ab as textStyleToFontSizePt, ac as PX_PER_POINT, ad as DEFAULT_FONT_SIZE_PX, ae as isDoubleUnderlineStyle, af as isWavyUnderlineStyle, ag as underlineStyleLineWidthPx, ah as underlineStyleDashArray, ai as resolveListLabel, aj as getListLabelInset, ak as getAlignedListLabelInset, al as getParagraphBorderInsets, am as buildSegmentTable, an as buildCanvasTableLayout, ao as normalizeFamily, ap as ROBOTO_FONT_FILES, aq as loadFontAsset, ar as OFFICE_COMPAT_FONT_FAMILIES, as as buildSfnt, at as defaultFontDecoderRegistry, au as SfntFontProgram, av as collectPdfFontFamilies, aw as projectDocumentLayout, ax as getPageHeaderZoneTop, ay as getPageBodyTop, az as getPageColumnRects, aA as findFootnoteReference, aB as FOOTNOTE_MARKER_GUTTER_PX, aC as resolveImporterForFile, aD as createEditorStateFromDocument, aE as getDocumentParagraphsCanonical, aF as getToolbarStyleState, aG as STANDARD_FONT_SIZES_PT, aH as fontSizePxToPt, aI as probeLocalFontFamilies, aJ as createInitialEditorState, aK as parseFontSizePtToPx, aL as formatFontSizePt, aM as underlineStyleToCssDecorationStyle, aN as listKindForTag, aO as isParagraphTag, aP as collectInlineRuns, aQ as parseParagraphStyle, aR as getCachedCanvasImage, aS as getHeadingLevel, aT as preciseFontModeVersion, aU as isPreciseFontModeEnabled, aV as togglePreciseFontMode, aW as nextFontSizePt, aX as previousFontSizePt, aY as fontSizePtToPx, aZ as createDefaultToolbarPreset, a_ as MenuRegistry, a$ as createToolbarRegistry, b0 as Editor, b1 as resolveCommandRef, b2 as commandRefName, b3 as InlineShell, b4 as BalloonShell, b5 as DocumentShell, b6 as createMemo, b7 as getCaretRectFromSnapshot, b8 as getParagraphRectFromSnapshot, b9 as createComponent, ba as CaretOverlay, bb as Show, bc as createRenderEffect, bd as style, be as setAttribute, bf as setStyleProperty, bg as memo, bh as template, bi as useI18n, bj as insert, bk as use, bl as addEventListener, bm as Dialog, bn as delegateEvents, bo as className, bp as For, bq as UNDERLINE_STYLE_OPTIONS, br as Tabs, bs as measureParagraphMinContentWidthPx, bt as getEditableBlocksForZone, bu as findParagraphLocation, bv as createSectionBoundaryParagraph, bw as normalizePageSettings, bx as DEFAULT_EDITOR_PAGE_SETTINGS, by as markStart, bz as markEnd, bA as getParagraphEntries, bB as getParagraphById, bC as PluginUiHost, bD as OasisEditorEditor, bE as perfTimer, bF as OasisBrandMark, bG as setPreciseFontPreference, bH as setWelcomeSeen, bI as enablePreciseFontMode, bJ as createOasisEditorClient, bK as createEditorZoom, bL as startLongTaskObserver, bM as installGlobalReport, bN as applyStoredPreciseFontPreference, bO as getWelcomeSeen, bP as isLocalFontAccessSupported, bQ as EDITOR_SCROLL_PADDING_PX, bR as Toolbar, bS as OasisEditorLoading, bT as I18nProvider, bU as createEditorLogger, bV as createTranslator, bW as registerDomStatsSurface } from "./index-Ybd6l30Z.js";
4
+ import { n as normalizeSelection, g as getParagraphs, a as assertNever, c as createEditorParagraphFromRuns, b as getParagraphLength, d as createEditorRun, e as getDocumentSections, i as isInlineObjectRun, f as createEditorStyledRun, h as getParagraphText, j as getActiveZone, k as getActiveSectionIndex, p as positionToParagraphOffset, l as paragraphOffsetToPosition, m as clampPosition, o as findParagraphIndex, q as createCollapsedSelection, r as isSelectionCollapsed, E as EMU_PER_PX, s as createEditorParagraph, t as getBlockParagraphs, u as createEditorFootnote, v as createFootnoteReferenceRun, w as renumberFootnotes, x as iterateFootnoteReferenceRuns, y as getFootnoteDisplayMarker, z as findParagraphTableLocation, A as buildTableCellLayout, B as createSignal, C as createEffect, D as onCleanup, F as buildCanvasLayoutSnapshot, G as on, H as onMount, I as debounce, J as unwrap, K as getDocumentParagraphs, P as PT_PER_PX, L as createEditorTableCell, M as createEditorTableRow, N as createEditorTable, O as getDocumentSectionsCanonical, Q as createEditorDocument, R as getPageContentWidth, S as getDocumentPageSettings, T as getTableCellContentWidthForParagraph, U as resolveResizedDimensions, V as resolveImageSrc, W as resolveTextBoxRenderHeight, X as TWIPS_PER_POINT, Y as PX_PER_INCH, Z as TWIPS_PER_INCH, _ as resolveEffectiveParagraphStyle, $ as resolveEffectiveTextStyleForParagraph, a0 as EMU_PER_PT, a1 as iterateEndnoteReferenceRuns, a2 as imageContentTypeDefaults, a3 as JSZip, a4 as imageExtensionFromMime, a5 as pxToPt$1, a6 as resolveFloatingObjectRect, a7 as getTextBoxFloatingGeometry, a8 as getPresetPathSegments, a9 as projectBlocksLayout, aa as buildListLabels, ab as textStyleToFontSizePt, ac as PX_PER_POINT, ad as DEFAULT_FONT_SIZE_PX, ae as isDoubleUnderlineStyle, af as isWavyUnderlineStyle, ag as underlineStyleLineWidthPx, ah as underlineStyleDashArray, ai as resolveListLabel, aj as getListLabelInset, ak as getAlignedListLabelInset, al as getParagraphBorderInsets, am as buildSegmentTable, an as buildCanvasTableLayout, ao as normalizeFamily, ap as ROBOTO_FONT_FILES, aq as loadFontAsset, ar as OFFICE_COMPAT_FONT_FAMILIES, as as buildSfnt, at as defaultFontDecoderRegistry, au as SfntFontProgram, av as collectPdfFontFamilies, aw as projectDocumentLayout, ax as getPageHeaderZoneTop, ay as getPageBodyTop, az as getPageColumnRects, aA as findFootnoteReference, aB as FOOTNOTE_MARKER_GUTTER_PX, aC as resolveImporterForFile, aD as createEditorStateFromDocument, aE as getDocumentParagraphsCanonical, aF as getToolbarStyleState, aG as STANDARD_FONT_SIZES_PT, aH as fontSizePxToPt, aI as probeLocalFontFamilies, aJ as createInitialEditorState, aK as parseFontSizePtToPx, aL as formatFontSizePt, aM as underlineStyleToCssDecorationStyle, aN as listKindForTag, aO as isParagraphTag, aP as collectInlineRuns, aQ as parseParagraphStyle, aR as getCachedCanvasImage, aS as getHeadingLevel, aT as preciseFontModeVersion, aU as isPreciseFontModeEnabled, aV as togglePreciseFontMode, aW as nextFontSizePt, aX as previousFontSizePt, aY as fontSizePtToPx, aZ as createDefaultToolbarPreset, a_ as MenuRegistry, a$ as createToolbarRegistry, b0 as Editor, b1 as resolveCommandRef, b2 as commandRefName, b3 as InlineShell, b4 as BalloonShell, b5 as DocumentShell, b6 as createMemo, b7 as getCaretRectFromSnapshot, b8 as getParagraphRectFromSnapshot, b9 as createComponent, ba as CaretOverlay, bb as Show, bc as createRenderEffect, bd as style, be as setAttribute, bf as setStyleProperty, bg as memo, bh as template, bi as useI18n, bj as insert, bk as use, bl as addEventListener, bm as Dialog, bn as delegateEvents, bo as className, bp as For, bq as UNDERLINE_STYLE_OPTIONS, br as Tabs, bs as measureParagraphMinContentWidthPx, bt as getEditableBlocksForZone, bu as findParagraphLocation, bv as createSectionBoundaryParagraph, bw as normalizePageSettings, bx as DEFAULT_EDITOR_PAGE_SETTINGS, by as markStart, bz as markEnd, bA as getParagraphEntries, bB as getParagraphById, bC as PluginUiHost, bD as OasisEditorEditor, bE as perfTimer, bF as OasisBrandMark, bG as setPreciseFontPreference, bH as setWelcomeSeen, bI as enablePreciseFontMode, bJ as createOasisEditorClient, bK as createEditorZoom, bL as startLongTaskObserver, bM as installGlobalReport, bN as applyStoredPreciseFontPreference, bO as getWelcomeSeen, bP as isLocalFontAccessSupported, bQ as EDITOR_SCROLL_PADDING_PX, bR as Toolbar, bS as OasisEditorLoading, bT as I18nProvider, bU as createEditorLogger, bV as createTranslator, bW as registerDomStatsSurface } from "./index-ByZZP8TQ.js";
5
5
  function getSelectedObjectRun(state, predicate) {
6
6
  const normalized = normalizeSelection(state);
7
7
  if (normalized.isCollapsed || normalized.startIndex !== normalized.endIndex || normalized.endParagraphOffset - normalized.startParagraphOffset !== 1) {
@@ -9676,32 +9676,39 @@ async function drawTextBoxContent(writer, textBox, ctx, xPx, yPx, widthPx, heigh
9676
9676
  );
9677
9677
  let cursorY = innerY;
9678
9678
  for (const block of blocks) {
9679
- if (block.sourceBlock.type === "paragraph" && block.layout) {
9680
- await drawers.drawParagraph(
9681
- writer,
9682
- ctx.pageIndex,
9683
- block.sourceBlock,
9684
- block.layout.lines,
9685
- ctx.document,
9686
- innerX,
9687
- cursorY,
9688
- ctx.fontRegistry,
9689
- listOrdinals,
9690
- drawers
9691
- );
9692
- } else if (block.sourceBlock.type === "table") {
9693
- await drawers.drawTableBlock(
9694
- writer,
9695
- ctx.pageIndex,
9696
- block,
9697
- ctx.document,
9698
- innerX,
9699
- cursorY,
9700
- innerWidth,
9701
- ctx.fontRegistry,
9702
- listOrdinals,
9703
- drawers
9704
- );
9679
+ switch (block.sourceBlock.type) {
9680
+ case "paragraph":
9681
+ if (block.layout) {
9682
+ await drawers.drawParagraph(
9683
+ writer,
9684
+ ctx.pageIndex,
9685
+ block.sourceBlock,
9686
+ block.layout.lines,
9687
+ ctx.document,
9688
+ innerX,
9689
+ cursorY,
9690
+ ctx.fontRegistry,
9691
+ listOrdinals,
9692
+ drawers
9693
+ );
9694
+ }
9695
+ break;
9696
+ case "table":
9697
+ await drawers.drawTableBlock(
9698
+ writer,
9699
+ ctx.pageIndex,
9700
+ block,
9701
+ ctx.document,
9702
+ innerX,
9703
+ cursorY,
9704
+ innerWidth,
9705
+ ctx.fontRegistry,
9706
+ listOrdinals,
9707
+ drawers
9708
+ );
9709
+ break;
9710
+ default:
9711
+ assertNever(block.sourceBlock, "block");
9705
9712
  }
9706
9713
  cursorY += Math.max(0, block.estimatedHeight);
9707
9714
  }