oasis-editor 0.0.69 → 0.0.70

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, c as createEditorParagraphFromRuns, a as getParagraphLength, b as createEditorRun, d as getDocumentSections, i as isInlineObjectRun, e as createEditorStyledRun, f as getParagraphText, h as getActiveZone, j as getActiveSectionIndex, p as positionToParagraphOffset, k as paragraphOffsetToPosition, l as clampPosition, m as findParagraphIndex, o as createCollapsedSelection, q as isSelectionCollapsed, E as EMU_PER_PX, r as assertNever, 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-DI2lEJPZ.js";
4
+ import { n as normalizeSelection, g as getParagraphs, c as createEditorParagraphFromRuns, a as getParagraphLength, b as createEditorRun, d as getDocumentSections, i as isInlineObjectRun, e as createEditorStyledRun, f as getParagraphText, h as getActiveZone, j as getActiveSectionIndex, p as positionToParagraphOffset, k as paragraphOffsetToPosition, l as clampPosition, m as findParagraphIndex, o as createCollapsedSelection, q as isSelectionCollapsed, E as EMU_PER_PX, r as assertNever, 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-BBQr5P8i.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) {
@@ -10573,63 +10573,72 @@ async function drawBlockList(writer, pageIndex, blocks, document2, originX, orig
10573
10573
  const contentTop = originY;
10574
10574
  let cursorY = originY;
10575
10575
  for (const block of blocks) {
10576
- if (block.sourceBlock.type === "paragraph" && block.layout) {
10577
- const paragraphStyle = resolveEffectiveParagraphStyle(
10578
- block.sourceBlock.style,
10579
- document2.styles
10580
- );
10581
- const spacingBefore = block.layout.startOffset === 0 && cursorY > originY ? paragraphStyle.spacingBefore ?? 0 : 0;
10582
- const boxTop = cursorY + spacingBefore;
10583
- const textTop = boxTop + getParagraphBorderInsets(paragraphStyle).top;
10584
- drawParagraphDecorations(
10585
- writer,
10586
- pageIndex,
10587
- paragraphStyle,
10588
- block.layout.lines,
10589
- originX,
10590
- boxTop,
10591
- contentWidth
10592
- );
10593
- await drawParagraph(
10594
- writer,
10595
- pageIndex,
10596
- block.sourceBlock,
10597
- block.layout.lines,
10598
- document2,
10599
- originX,
10600
- textTop,
10601
- fontRegistry,
10602
- listOrdinals,
10603
- blockDrawers
10604
- );
10605
- if (pageSettings) {
10606
- await drawFloatingTextBoxesForParagraph({
10576
+ switch (block.sourceBlock.type) {
10577
+ case "paragraph": {
10578
+ if (!block.layout) {
10579
+ break;
10580
+ }
10581
+ const paragraphStyle = resolveEffectiveParagraphStyle(
10582
+ block.sourceBlock.style,
10583
+ document2.styles
10584
+ );
10585
+ const spacingBefore = block.layout.startOffset === 0 && cursorY > originY ? paragraphStyle.spacingBefore ?? 0 : 0;
10586
+ const boxTop = cursorY + spacingBefore;
10587
+ const textTop = boxTop + getParagraphBorderInsets(paragraphStyle).top;
10588
+ drawParagraphDecorations(
10607
10589
  writer,
10608
- document: document2,
10590
+ pageIndex,
10591
+ paragraphStyle,
10592
+ block.layout.lines,
10593
+ originX,
10594
+ boxTop,
10595
+ contentWidth
10596
+ );
10597
+ await drawParagraph(
10598
+ writer,
10599
+ pageIndex,
10600
+ block.sourceBlock,
10601
+ block.layout.lines,
10602
+ document2,
10603
+ originX,
10604
+ textTop,
10609
10605
  fontRegistry,
10606
+ listOrdinals,
10607
+ blockDrawers
10608
+ );
10609
+ if (pageSettings) {
10610
+ await drawFloatingTextBoxesForParagraph({
10611
+ writer,
10612
+ document: document2,
10613
+ fontRegistry,
10614
+ pageIndex,
10615
+ lines: block.layout.lines,
10616
+ pageSettings,
10617
+ contentLeft: originX,
10618
+ contentTop,
10619
+ contentWidth,
10620
+ paragraphTop: boxTop,
10621
+ drawers: blockDrawers
10622
+ });
10623
+ }
10624
+ break;
10625
+ }
10626
+ case "table":
10627
+ await drawTableBlock(
10628
+ writer,
10610
10629
  pageIndex,
10611
- lines: block.layout.lines,
10612
- pageSettings,
10613
- contentLeft: originX,
10614
- contentTop,
10630
+ block,
10631
+ document2,
10632
+ originX,
10633
+ cursorY,
10615
10634
  contentWidth,
10616
- paragraphTop: boxTop,
10617
- drawers: blockDrawers
10618
- });
10619
- }
10620
- } else if (block.sourceBlock.type === "table") {
10621
- await drawTableBlock(
10622
- writer,
10623
- pageIndex,
10624
- block,
10625
- document2,
10626
- originX,
10627
- cursorY,
10628
- contentWidth,
10629
- fontRegistry,
10630
- listOrdinals,
10631
- blockDrawers
10632
- );
10635
+ fontRegistry,
10636
+ listOrdinals,
10637
+ blockDrawers
10638
+ );
10639
+ break;
10640
+ default:
10641
+ assertNever(block.sourceBlock, "block");
10633
10642
  }
10634
10643
  cursorY += Math.max(0, block.estimatedHeight);
10635
10644
  }
@@ -2483,7 +2483,7 @@ function OasisEditorAppLazy(props = {}) {
2483
2483
  onCleanup(() => {
2484
2484
  cancelled = true;
2485
2485
  });
2486
- import("./OasisEditorApp-BHqexGv8.js").then((m) => {
2486
+ import("./OasisEditorApp-Cy7UGzeb.js").then((m) => {
2487
2487
  cancelled = true;
2488
2488
  setProgress(1);
2489
2489
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -1,4 +1,4 @@
1
- import { b4, bX, bY, bZ, b_, b$, bm, c0, b5, b0, c1, c2, c3, b3, c4, a_, c5, c6, c7, c8, c9, bS, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, br, cl, bR, cm, bZ as bZ2, c2 as c22, c4 as c42, cd as cd2, cf as cf2, ck as ck2, cn, b2, aZ, co, cp, cq, a$, cr, cs, b1 } from "./index-DI2lEJPZ.js";
1
+ import { b4, bX, bY, bZ, b_, b$, bm, c0, b5, b0, c1, c2, c3, b3, c4, a_, c5, c6, c7, c8, c9, bS, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, br, cl, bR, cm, bZ as bZ2, c2 as c22, c4 as c42, cd as cd2, cf as cf2, ck as ck2, cn, b2, aZ, co, cp, cq, a$, cr, cs, b1 } from "./index-BBQr5P8i.js";
2
2
  export {
3
3
  b4 as BalloonShell,
4
4
  bX as Button,