oasis-editor 0.0.85 → 0.0.87

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 { v as visitRun, a as assertNever, c as createSignal, b as createEditorStateFromDocument, d as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, f as fontSizePxToPt, p as probeLocalFontFamilies, e as createEditorParagraphFromRuns, i as isInlineObjectRun, g as createEditorStyledRun, h as getParagraphLength, j as getParagraphText, k as getActiveZone, l as getDocumentSections, m as getActiveSectionIndex, n as getParagraphs, o as normalizeSelection, q as positionToParagraphOffset, r as paragraphOffsetToPosition, s as clampPosition, t as findParagraphIndex, u as createCollapsedSelection, w as isSelectionCollapsed, x as parseFontSizePtToPx, y as formatFontSizePt, z as createEditorParagraph, A as getBlockParagraphs, B as findParagraphTableLocation, C as buildTableCellLayout, P as PT_PER_PX, D as createEditorTableCell, E as createEditorTableRow, F as createEditorTable, G as underlineStyleToCssDecorationStyle, H as resolveImageSrc, I as listKindForTag, J as isParagraphTag, K as collectInlineRuns, L as parseParagraphStyle, M as getRunImage, N as InlineShell, O as BalloonShell, Q as DocumentShell, R as createMemo, T as buildCanvasLayoutSnapshot, U as getCaretRectFromSnapshot, V as getParagraphRectFromSnapshot, W as createComponent, X as CaretOverlay, Y as Show, Z as createRenderEffect, _ as style, $ as setAttribute, a0 as setStyleProperty, a1 as memo, a2 as template, a3 as useI18n, a4 as createEffect, a5 as insert, a6 as use, a7 as addEventListener, a8 as Dialog, a9 as delegateEvents, aa as className, ab as For, ac as UNDERLINE_STYLE_OPTIONS, ad as Tabs, ae as onMount, af as onCleanup, ag as PluginUiHost, ah as OasisEditorEditor, ai as OasisBrandMark, aj as setPreciseFontPreference, ak as setWelcomeSeen, al as enablePreciseFontMode, am as TWIPS_PER_POINT, an as PX_PER_INCH, ao as TWIPS_PER_INCH, ap as resolveEffectiveParagraphStyle, aq as resolveEffectiveTextStyleForParagraph, ar as EMU_PER_PX, as as EMU_PER_PT, at as getRunFootnoteReference, au as getRunEndnoteReference, av as iterateFootnoteReferenceRuns, aw as iterateEndnoteReferenceRuns, ax as imageContentTypeDefaults, ay as getRunFieldChar, az as getRunFieldInstruction, aA as createEditorRun, aB as JSZip, aC as imageExtensionFromMime, aD as pxToPt$1, aE as resolveFloatingObjectRect, aF as getTextBoxFloatingGeometry, aG as getPresetPathSegments, aH as projectBlocksLayout, aI as buildListLabels, aJ as textStyleToFontSizePt, aK as PX_PER_POINT, aL as DEFAULT_FONT_SIZE_PX, aM as isDoubleUnderlineStyle, aN as isWavyUnderlineStyle, aO as underlineStyleLineWidthPx, aP as underlineStyleDashArray, aQ as resolveListLabel, aR as getListLabelInset, aS as getAlignedListLabelInset, aT as getParagraphBorderInsets, aU as buildSegmentTable, aV as buildCanvasTableLayout, aW as normalizeFamily, aX as ROBOTO_FONT_FILES, aY as loadFontAsset, aZ as OFFICE_COMPAT_FONT_FAMILIES, a_ as buildSfnt, a$ as defaultFontDecoderRegistry, b0 as SfntFontProgram, b1 as collectPdfFontFamilies, b2 as projectDocumentLayout, b3 as getPageContentWidth, b4 as getPageHeaderZoneTop, b5 as getPageBodyTop, b6 as getPageColumnRects, b7 as findFootnoteReference, b8 as FOOTNOTE_MARKER_GUTTER_PX, b9 as resolveImporterForFile, ba as getDocumentSectionsCanonical, bb as getDocumentParagraphsCanonical, bc as getDocumentParagraphs, bd as getDocumentPageSettings, be as getTableCellContentWidthForParagraph, bf as on, bg as debounce, bh as unwrap, bi as perfTimer, bj as getRunTextBox, bk as createEditorDocument, bl as resolveResizedDimensions, bm as resolveTextBoxRenderHeight, bn as getToolbarStyleState, bo as getCachedCanvasImage, bp as measureParagraphMinContentWidthPx, bq as getEditableBlocksForZone, br as findParagraphLocation, bs as createSectionBoundaryParagraph, bt as normalizePageSettings, bu as DEFAULT_EDITOR_PAGE_SETTINGS, bv as markStart, bw as markEnd, bx as getParagraphEntries, by as getParagraphById, bz as createEditorFootnote, bA as createFootnoteReferenceRun, bB as renumberFootnotes, bC as getFootnoteDisplayMarker, bD as getHeadingLevel, bE as preciseFontModeVersion, bF as isPreciseFontModeEnabled, bG as togglePreciseFontMode, bH as nextFontSizePt, bI as previousFontSizePt, bJ as fontSizePtToPx, bK as createDefaultToolbarPreset, bL as MenuRegistry, bM as createToolbarRegistry, bN as Editor, bO as resolveCommandRef, bP as commandRefName, bQ as createOasisEditorClient, bR as createEditorZoom, bS as startLongTaskObserver, bT as installGlobalReport, bU as applyStoredPreciseFontPreference, bV as getWelcomeSeen, bW as isLocalFontAccessSupported, bX as EDITOR_SCROLL_PADDING_PX, bY as Toolbar, bZ as OasisEditorLoading, b_ as I18nProvider, b$ as createTranslator, c0 as createEditorLogger, c1 as registerDomStatsSurface } from "./index-CHcJlpsx.js";
4
+ import { v as visitRun, a as assertNever, c as createSignal, b as createEditorStateFromDocument, d as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, f as fontSizePxToPt, p as probeLocalFontFamilies, e as createEditorParagraphFromRuns, i as isInlineObjectRun, g as createEditorStyledRun, h as getParagraphLength, j as getParagraphText, k as getActiveZone, l as getDocumentSections, m as getActiveSectionIndex, n as getParagraphs, o as normalizeSelection, q as positionToParagraphOffset, r as paragraphOffsetToPosition, s as clampPosition, t as findParagraphIndex, u as createCollapsedSelection, w as isSelectionCollapsed, x as parseFontSizePtToPx, y as formatFontSizePt, z as createEditorParagraph, A as getBlockParagraphs, B as findParagraphTableLocation, C as buildTableCellLayout, P as PT_PER_PX, D as createEditorTableCell, E as createEditorTableRow, F as createEditorTable, G as underlineStyleToCssDecorationStyle, H as resolveImageSrc, I as listKindForTag, J as isParagraphTag, K as collectInlineRuns, L as parseParagraphStyle, M as getRunImage, N as InlineShell, O as BalloonShell, Q as DocumentShell, R as createMemo, T as buildCanvasLayoutSnapshot, U as getCaretRectFromSnapshot, V as getParagraphRectFromSnapshot, W as createComponent, X as CaretOverlay, Y as Show, Z as createRenderEffect, _ as style, $ as setAttribute, a0 as setStyleProperty, a1 as memo, a2 as template, a3 as useI18n, a4 as createEffect, a5 as insert, a6 as use, a7 as addEventListener, a8 as Dialog, a9 as delegateEvents, aa as className, ab as For, ac as UNDERLINE_STYLE_OPTIONS, ad as Tabs, ae as onMount, af as onCleanup, ag as PluginUiHost, ah as OasisEditorEditor, ai as OasisBrandMark, aj as setPreciseFontPreference, ak as setWelcomeSeen, al as enablePreciseFontMode, am as TWIPS_PER_POINT, an as PX_PER_INCH, ao as TWIPS_PER_INCH, ap as resolveEffectiveParagraphStyle, aq as resolveEffectiveTextStyleForParagraph, ar as EMU_PER_PX, as as EMU_PER_PT, at as getRunFootnoteReference, au as getRunEndnoteReference, av as iterateFootnoteReferenceRuns, aw as iterateEndnoteReferenceRuns, ax as imageContentTypeDefaults, ay as getRunFieldChar, az as getRunFieldInstruction, aA as createEditorRun, aB as JSZip, aC as imageExtensionFromMime, aD as pxToPt$1, aE as resolveFloatingObjectRect, aF as getTextBoxFloatingGeometry, aG as getPresetPathSegments, aH as projectBlocksLayout, aI as buildListLabels, aJ as textStyleToFontSizePt, aK as PX_PER_POINT, aL as DEFAULT_FONT_SIZE_PX, aM as isDoubleUnderlineStyle, aN as isWavyUnderlineStyle, aO as underlineStyleLineWidthPx, aP as underlineStyleDashArray, aQ as resolveListLabel, aR as getListLabelInset, aS as getAlignedListLabelInset, aT as getParagraphBorderInsets, aU as buildSegmentTable, aV as buildCanvasTableLayout, aW as normalizeFamily, aX as ROBOTO_FONT_FILES, aY as loadFontAsset, aZ as OFFICE_COMPAT_FONT_FAMILIES, a_ as buildSfnt, a$ as defaultFontDecoderRegistry, b0 as SfntFontProgram, b1 as collectPdfFontFamilies, b2 as projectDocumentLayout, b3 as getPageContentWidth, b4 as getPageHeaderZoneTop, b5 as getPageBodyTop, b6 as getPageColumnRects, b7 as findFootnoteReference, b8 as FOOTNOTE_MARKER_GUTTER_PX, b9 as resolveImporterForFile, ba as getDocumentSectionsCanonical, bb as getDocumentParagraphsCanonical, bc as getDocumentParagraphs, bd as getDocumentPageSettings, be as getTableCellContentWidthForParagraph, bf as on, bg as debounce, bh as unwrap, bi as perfTimer, bj as getRunTextBox, bk as createEditorDocument, bl as resolveResizedDimensions, bm as resolveTextBoxRenderHeight, bn as getToolbarStyleState, bo as getCachedCanvasImage, bp as measureParagraphMinContentWidthPx, bq as getEditableBlocksForZone, br as findParagraphLocation, bs as createSectionBoundaryParagraph, bt as normalizePageSettings, bu as DEFAULT_EDITOR_PAGE_SETTINGS, bv as markStart, bw as markEnd, bx as getParagraphEntries, by as getParagraphById, bz as createEditorFootnote, bA as createFootnoteReferenceRun, bB as renumberFootnotes, bC as getFootnoteDisplayMarker, bD as getHeadingLevel, bE as preciseFontModeVersion, bF as isPreciseFontModeEnabled, bG as togglePreciseFontMode, bH as nextFontSizePt, bI as previousFontSizePt, bJ as fontSizePtToPx, bK as createDefaultToolbarPreset, bL as MenuRegistry, bM as createToolbarRegistry, bN as Editor, bO as resolveCommandRef, bP as commandRefName, bQ as createOasisEditorClient, bR as createEditorZoom, bS as startLongTaskObserver, bT as installGlobalReport, bU as applyStoredPreciseFontPreference, bV as getWelcomeSeen, bW as isLocalFontAccessSupported, bX as EDITOR_SCROLL_PADDING_PX, bY as Toolbar, bZ as OasisEditorLoading, b_ as I18nProvider, b$ as createTranslator, c0 as createEditorLogger, c1 as registerDomStatsSurface } from "./index-DFKc0jbc.js";
5
5
  function cloneStyle(style2) {
6
6
  return style2 ? { ...style2 } : void 0;
7
7
  }
@@ -2483,7 +2483,7 @@ function OasisEditorAppLazy(props = {}) {
2483
2483
  onCleanup(() => {
2484
2484
  cancelled = true;
2485
2485
  });
2486
- import("./OasisEditorApp-D_hjBUA1.js").then((m) => {
2486
+ import("./OasisEditorApp-CE15GH_N.js").then((m) => {
2487
2487
  cancelled = true;
2488
2488
  setProgress(1);
2489
2489
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -5201,14 +5201,16 @@ function projectFootnoteBlocksForPage(document2, footnoteReferenceIds, page, tot
5201
5201
  if (!footnote) continue;
5202
5202
  const projected = projectBlocks(
5203
5203
  footnote.blocks,
5204
- page.index,
5205
- totalPages,
5206
- measuredHeights,
5207
- measuredParagraphLayouts,
5208
- document2.styles,
5209
- contentWidth,
5210
- measurer,
5211
- (_c = document2.settings) == null ? void 0 : _c.defaultTabStop
5204
+ {
5205
+ pageIndex: page.index,
5206
+ totalPages,
5207
+ measuredHeights,
5208
+ measuredParagraphLayouts,
5209
+ styles: document2.styles,
5210
+ contentWidth,
5211
+ measurer,
5212
+ defaultTabStop: (_c = document2.settings) == null ? void 0 : _c.defaultTabStop
5213
+ }
5212
5214
  );
5213
5215
  for (const block of projected) {
5214
5216
  blocks.push({
@@ -12773,7 +12775,16 @@ function estimateTableBlockHeight(table, styles, contentWidth, measurer = domTex
12773
12775
  defaultTabStop
12774
12776
  );
12775
12777
  }
12776
- function projectHeaderFooterBlocksWithDependencies(blocks, deps, pageIndex, totalPages, measuredHeights, _measuredParagraphLayouts, styles, contentWidth, measurer, defaultTabStop) {
12778
+ function projectHeaderFooterBlocksWithDependencies(blocks, deps, context2 = {}) {
12779
+ const {
12780
+ pageIndex,
12781
+ totalPages,
12782
+ measuredHeights,
12783
+ styles,
12784
+ contentWidth,
12785
+ measurer,
12786
+ defaultTabStop
12787
+ } = context2;
12777
12788
  return blocks.map((block, index) => {
12778
12789
  if (block.type === "paragraph") {
12779
12790
  const layout = deps.projectParagraphLayout(
@@ -12812,7 +12823,7 @@ function projectHeaderFooterBlocksWithDependencies(blocks, deps, pageIndex, tota
12812
12823
  };
12813
12824
  });
12814
12825
  }
12815
- function projectHeaderFooterBlocks(blocks, pageIndex, totalPages, measuredHeights, measuredParagraphLayouts, styles, contentWidth, measurer = domTextMeasurer, defaultTabStop) {
12826
+ function projectHeaderFooterBlocks(blocks, context2 = {}) {
12816
12827
  return projectHeaderFooterBlocksWithDependencies(
12817
12828
  blocks,
12818
12829
  {
@@ -12820,14 +12831,10 @@ function projectHeaderFooterBlocks(blocks, pageIndex, totalPages, measuredHeight
12820
12831
  estimateTableBlockHeight,
12821
12832
  getProjectedParagraphBlockHeight
12822
12833
  },
12823
- pageIndex,
12824
- totalPages,
12825
- measuredHeights,
12826
- measuredParagraphLayouts,
12827
- styles,
12828
- contentWidth,
12829
- measurer,
12830
- defaultTabStop
12834
+ {
12835
+ ...context2,
12836
+ measurer: context2.measurer ?? domTextMeasurer
12837
+ }
12831
12838
  );
12832
12839
  }
12833
12840
  const MAX_COLUMN_BALANCE_ITERATIONS = 100;
@@ -13827,14 +13834,16 @@ function resolveEffectiveVerticalMetrics(pageSettings, headerBlocks, footerBlock
13827
13834
  function createHeaderFooterVariantProjector(context2) {
13828
13835
  return (blocks, contentWidth, pageIndex, totalPageCount) => blocks ? context2.projectHeaderFooterBlocks(
13829
13836
  blocks,
13830
- pageIndex,
13831
- totalPageCount,
13832
- context2.measuredHeights,
13833
- context2.measuredParagraphLayouts,
13834
- context2.documentStyles,
13835
- contentWidth,
13836
- context2.measurer,
13837
- context2.defaultTabStop
13837
+ {
13838
+ pageIndex,
13839
+ totalPages: totalPageCount,
13840
+ measuredHeights: context2.measuredHeights,
13841
+ measuredParagraphLayouts: context2.measuredParagraphLayouts,
13842
+ styles: context2.documentStyles,
13843
+ contentWidth,
13844
+ measurer: context2.measurer,
13845
+ defaultTabStop: context2.defaultTabStop
13846
+ }
13838
13847
  ) : void 0;
13839
13848
  }
13840
13849
  function projectTallestHeaderVariant(section, contentWidth, projectHeaderFooterVariant) {
@@ -1,11 +1,11 @@
1
- import { EditorBlockNode, EditorDocument, EditorLayoutBlock, EditorLayoutPage, EditorLayoutParagraph } from '../core/model.js';
1
+ import { EditorDocument, EditorLayoutPage, EditorLayoutParagraph } from '../core/model.js';
2
2
  import { ITextMeasurer } from '../core/engine.js';
3
+ import { HeaderFooterBlockProjector } from './headerFooterLayoutContext.js';
3
4
 
4
5
  export declare const FOOTNOTE_SEPARATOR_HEIGHT = 10;
5
6
  export declare const FOOTNOTE_BLOCK_GAP = 2;
6
7
  export declare const FOOTNOTE_MARKER_GUTTER_PX = 24;
7
8
  export declare const MAX_FOOTNOTE_LAYOUT_ITERATIONS = 4;
8
- export type HeaderFooterBlockProjector = (blocks: EditorBlockNode[], pageIndex?: number, totalPages?: number, measuredHeights?: Record<string, number>, measuredParagraphLayouts?: Record<string, EditorLayoutParagraph>, styles?: EditorDocument["styles"], contentWidth?: number, measurer?: ITextMeasurer, defaultTabStop?: number) => EditorLayoutBlock[];
9
9
  export declare function collectPageFootnoteReferenceIds(page: EditorLayoutPage): string[];
10
10
  export interface FootnotePaginationContext {
11
11
  document: EditorDocument;
@@ -1,4 +1,4 @@
1
- import { EditorBlockNode, EditorLayoutBlock, EditorLayoutParagraph, EditorNamedStyle } from '../core/model.js';
2
- import { ITextMeasurer } from '../core/engine.js';
1
+ import { EditorBlockNode, EditorLayoutBlock } from '../core/model.js';
2
+ import { HeaderFooterLayoutContext } from './headerFooterLayoutContext.js';
3
3
 
4
- export declare function projectHeaderFooterBlocks(blocks: EditorBlockNode[], pageIndex?: number, totalPages?: number, measuredHeights?: Record<string, number>, measuredParagraphLayouts?: Record<string, EditorLayoutParagraph>, styles?: Record<string, EditorNamedStyle>, contentWidth?: number, measurer?: ITextMeasurer, defaultTabStop?: number): EditorLayoutBlock[];
4
+ export declare function projectHeaderFooterBlocks(blocks: EditorBlockNode[], context?: HeaderFooterLayoutContext): EditorLayoutBlock[];
@@ -0,0 +1,14 @@
1
+ import { EditorBlockNode, EditorLayoutBlock, EditorLayoutParagraph, EditorNamedStyle } from '../core/model.js';
2
+ import { ITextMeasurer } from '../core/engine.js';
3
+
4
+ export interface HeaderFooterLayoutContext {
5
+ pageIndex?: number;
6
+ totalPages?: number;
7
+ measuredHeights?: Record<string, number>;
8
+ measuredParagraphLayouts?: Record<string, EditorLayoutParagraph>;
9
+ styles?: Record<string, EditorNamedStyle>;
10
+ contentWidth?: number;
11
+ measurer?: ITextMeasurer;
12
+ defaultTabStop?: number;
13
+ }
14
+ export type HeaderFooterBlockProjector = (blocks: EditorBlockNode[], context?: HeaderFooterLayoutContext) => EditorLayoutBlock[];
@@ -1,5 +1,6 @@
1
1
  import { EditorBlockNode, EditorLayoutBlock, EditorLayoutParagraph, EditorNamedStyle, EditorParagraphNode } from '../core/model.js';
2
2
  import { ITextMeasurer } from '../core/engine.js';
3
+ import { HeaderFooterLayoutContext } from './headerFooterLayoutContext.js';
3
4
 
4
5
  type ProjectParagraphLayoutFn = (paragraph: EditorParagraphNode, pageIndex?: number, totalPages?: number, styles?: Record<string, EditorNamedStyle>, contentWidth?: number, measurer?: ITextMeasurer, defaultTabStop?: number) => EditorLayoutParagraph;
5
6
  type EstimateTableBlockHeightFn = (block: Extract<EditorBlockNode, {
@@ -10,5 +11,5 @@ export declare function projectHeaderFooterBlocksWithDependencies(blocks: Editor
10
11
  projectParagraphLayout: ProjectParagraphLayoutFn;
11
12
  estimateTableBlockHeight: EstimateTableBlockHeightFn;
12
13
  getProjectedParagraphBlockHeight: GetProjectedParagraphBlockHeightFn;
13
- }, pageIndex?: number, totalPages?: number, measuredHeights?: Record<string, number>, _measuredParagraphLayouts?: Record<string, EditorLayoutParagraph>, styles?: Record<string, EditorNamedStyle>, contentWidth?: number, measurer?: ITextMeasurer, defaultTabStop?: number): EditorLayoutBlock[];
14
+ }, context?: HeaderFooterLayoutContext): EditorLayoutBlock[];
14
15
  export {};
@@ -1,5 +1,6 @@
1
- import { EditorBlockNode, EditorDocument, EditorLayoutBlock, EditorLayoutPage, EditorLayoutParagraph, EditorNamedStyle, EditorSection } from '../core/model.js';
1
+ import { EditorBlockNode, EditorDocument, EditorLayoutPage, EditorLayoutParagraph, EditorNamedStyle, EditorSection } from '../core/model.js';
2
2
  import { ITextMeasurer } from '../core/engine.js';
3
+ import { HeaderFooterBlockProjector } from './headerFooterLayoutContext.js';
3
4
 
4
5
  export type BlocksLayoutProjector = (context: {
5
6
  blocks: EditorBlockNode[];
@@ -16,7 +17,6 @@ export type BlocksLayoutProjector = (context: {
16
17
  reservedHeightByPageIndex?: Map<number, number>;
17
18
  defaultTabStop?: number;
18
19
  }) => EditorLayoutPage[];
19
- export type HeaderFooterBlockProjector = (blocks: EditorBlockNode[], pageIndex?: number, totalPages?: number, measuredHeights?: Record<string, number>, measuredParagraphLayouts?: Record<string, EditorLayoutParagraph>, styles?: Record<string, EditorNamedStyle>, contentWidth?: number, measurer?: ITextMeasurer, defaultTabStop?: number) => EditorLayoutBlock[];
20
20
  export interface SectionPaginationContext {
21
21
  sections: EditorSection[];
22
22
  documentStyles?: EditorDocument["styles"];
@@ -1,4 +1,4 @@
1
- import { O, c2, c3, c4, c5, c6, a8, c7, Q, bN, c8, c9, ca, N, cb, bL, cc, cd, ce, cf, cg, bZ, ch, ci, cj, ck, cl, cm, cn, co, cp, cq, cr, ad, cs, bY, ct, c4 as c42, c9 as c92, cb as cb2, ck as ck2, cm as cm2, cr as cr2, cu, bP, bK, cv, cw, cx, bM, cy, cz, bO } from "./index-CHcJlpsx.js";
1
+ import { O, c2, c3, c4, c5, c6, a8, c7, Q, bN, c8, c9, ca, N, cb, bL, cc, cd, ce, cf, cg, bZ, ch, ci, cj, ck, cl, cm, cn, co, cp, cq, cr, ad, cs, bY, ct, c4 as c42, c9 as c92, cb as cb2, ck as ck2, cm as cm2, cr as cr2, cu, bP, bK, cv, cw, cx, bM, cy, cz, bO } from "./index-DFKc0jbc.js";
2
2
  export {
3
3
  O as BalloonShell,
4
4
  c2 as Button,