oasis-editor 0.0.52 → 0.0.54

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, e as createEditorStyledRun, f as getParagraphText, h as getActiveZone, i as getActiveSectionIndex, p as positionToParagraphOffset, j as paragraphOffsetToPosition, k as clampPosition, l as findParagraphIndex, m as createCollapsedSelection, o as isSelectionCollapsed, E as EMU_PER_PX, q as createEditorParagraph, r as getBlockParagraphs, s as createEditorFootnote, t as createFootnoteReferenceRun, u as renumberFootnotes, v as iterateFootnoteReferenceRuns, w as getFootnoteDisplayMarker, x as findParagraphTableLocation, y as buildTableCellLayout, z as createSignal, A as createEffect, B as onCleanup, C as buildCanvasLayoutSnapshot, D as on, F as onMount, G as debounce, H as unwrap, I as getDocumentParagraphs, P as PT_PER_PX, J as createEditorTableCell, K as createEditorTableRow, L as createEditorTable, M as getDocumentSectionsCanonical, N as createEditorDocument, O as getPageContentWidth, Q as getDocumentPageSettings, R as getTableCellContentWidthForParagraph, S as resolveResizedDimensions, T as resolveImageSrc, U as resolveTextBoxRenderHeight, V as TWIPS_PER_POINT, W as PX_PER_INCH, X as TWIPS_PER_INCH, Y as resolveEffectiveParagraphStyle, Z as resolveEffectiveTextStyleForParagraph, _ as EMU_PER_PT, $ as iterateEndnoteReferenceRuns, a0 as imageContentTypeDefaults, a1 as JSZip, a2 as imageExtensionFromMime, a3 as pxToPt$1, a4 as resolveFloatingObjectRect, a5 as getTextBoxFloatingGeometry, a6 as getPresetPathSegments, a7 as projectBlocksLayout, a8 as buildListLabels, a9 as textStyleToFontSizePt, aa as PX_PER_POINT, ab as DEFAULT_FONT_SIZE_PX, ac as isDoubleUnderlineStyle, ad as isWavyUnderlineStyle, ae as underlineStyleLineWidthPx, af as underlineStyleDashArray, ag as resolveListLabel, ah as getListLabelInset, ai as getAlignedListLabelInset, aj as getParagraphBorderInsets, ak as buildSegmentTable, al as buildCanvasTableLayout, am as normalizeFamily, an as ROBOTO_FONT_FILES, ao as loadFontAsset, ap as OFFICE_COMPAT_FONT_FAMILIES, aq as buildSfnt, ar as defaultFontDecoderRegistry, as as SfntFontProgram, at as collectPdfFontFamilies, au as projectDocumentLayout, av as getPageHeaderZoneTop, aw as getPageBodyTop, ax as getPageColumnRects, ay as findFootnoteReference, az as FOOTNOTE_MARKER_GUTTER_PX, aA as resolveImporterForFile, aB as createEditorStateFromDocument, aC as getDocumentParagraphsCanonical, aD as getToolbarStyleState, aE as STANDARD_FONT_SIZES_PT, aF as fontSizePxToPt, aG as probeLocalFontFamilies, aH as createInitialEditorState, aI as parseFontSizePtToPx, aJ as formatFontSizePt, aK as underlineStyleToCssDecorationStyle, aL as listKindForTag, aM as isParagraphTag, aN as collectInlineRuns, aO as parseParagraphStyle, aP as getCachedCanvasImage, aQ as getHeadingLevel, aR as preciseFontModeVersion, aS as isPreciseFontModeEnabled, aT as togglePreciseFontMode, aU as nextFontSizePt, aV as previousFontSizePt, aW as fontSizePtToPx, aX as createDefaultToolbarPreset, aY as MenuRegistry, aZ as createToolbarRegistry, a_ as Editor, a$ as resolveCommandRef, b0 as commandRefName, b1 as InlineShell, b2 as BalloonShell, b3 as DocumentShell, b4 as createMemo, b5 as getCaretRectFromSnapshot, b6 as getParagraphRectFromSnapshot, b7 as createComponent, b8 as CaretOverlay, b9 as Show, ba as createRenderEffect, bb as style, bc as setAttribute, bd as setStyleProperty, be as memo, bf as template, bg as useI18n, bh as insert, bi as use, bj as addEventListener, bk as Dialog, bl as delegateEvents, bm as className, bn as For, bo as UNDERLINE_STYLE_OPTIONS, bp as Tabs, bq as measureParagraphMinContentWidthPx, br as getEditableBlocksForZone, bs as findParagraphLocation, bt as createSectionBoundaryParagraph, bu as normalizePageSettings, bv as DEFAULT_EDITOR_PAGE_SETTINGS, bw as markStart, bx as markEnd, by as getParagraphEntries, bz as getParagraphById, bA as PluginUiHost, bB as OasisEditorEditor, bC as perfTimer, bD as OasisBrandMark, bE as setPreciseFontPreference, bF as setWelcomeSeen, bG as enablePreciseFontMode, bH as createOasisEditorClient, bI as createEditorZoom, bJ as startLongTaskObserver, bK as installGlobalReport, bL as applyStoredPreciseFontPreference, bM as getWelcomeSeen, bN as isLocalFontAccessSupported, bO as EDITOR_SCROLL_PADDING_PX, bP as Toolbar, bQ as OasisEditorLoading, bR as I18nProvider, bS as createEditorLogger, bT as createTranslator, bU as registerDomStatsSurface } from "./index-BMJs8egS.js";
4
+ import { n as normalizeSelection, g as getParagraphs, c as createEditorParagraphFromRuns, a as getParagraphLength, b as createEditorRun, d as getDocumentSections, e as createEditorStyledRun, f as getParagraphText, h as getActiveZone, i as getActiveSectionIndex, p as positionToParagraphOffset, j as paragraphOffsetToPosition, k as clampPosition, l as findParagraphIndex, m as createCollapsedSelection, o as isSelectionCollapsed, E as EMU_PER_PX, q as createEditorParagraph, r as getBlockParagraphs, s as createEditorFootnote, t as createFootnoteReferenceRun, u as renumberFootnotes, v as iterateFootnoteReferenceRuns, w as getFootnoteDisplayMarker, x as findParagraphTableLocation, y as buildTableCellLayout, z as createSignal, A as createEffect, B as onCleanup, C as buildCanvasLayoutSnapshot, D as on, F as onMount, G as debounce, H as unwrap, I as getDocumentParagraphs, P as PT_PER_PX, J as createEditorTableCell, K as createEditorTableRow, L as createEditorTable, M as getDocumentSectionsCanonical, N as createEditorDocument, O as getPageContentWidth, Q as getDocumentPageSettings, R as getTableCellContentWidthForParagraph, S as resolveResizedDimensions, T as resolveImageSrc, U as resolveTextBoxRenderHeight, V as TWIPS_PER_POINT, W as PX_PER_INCH, X as TWIPS_PER_INCH, Y as resolveEffectiveParagraphStyle, Z as resolveEffectiveTextStyleForParagraph, _ as EMU_PER_PT, $ as iterateEndnoteReferenceRuns, a0 as imageContentTypeDefaults, a1 as JSZip, a2 as imageExtensionFromMime, a3 as pxToPt$1, a4 as resolveFloatingObjectRect, a5 as getTextBoxFloatingGeometry, a6 as getPresetPathSegments, a7 as projectBlocksLayout, a8 as buildListLabels, a9 as textStyleToFontSizePt, aa as PX_PER_POINT, ab as DEFAULT_FONT_SIZE_PX, ac as isDoubleUnderlineStyle, ad as isWavyUnderlineStyle, ae as underlineStyleLineWidthPx, af as underlineStyleDashArray, ag as resolveListLabel, ah as getListLabelInset, ai as getAlignedListLabelInset, aj as getParagraphBorderInsets, ak as buildSegmentTable, al as buildCanvasTableLayout, am as normalizeFamily, an as ROBOTO_FONT_FILES, ao as loadFontAsset, ap as OFFICE_COMPAT_FONT_FAMILIES, aq as buildSfnt, ar as defaultFontDecoderRegistry, as as SfntFontProgram, at as collectPdfFontFamilies, au as projectDocumentLayout, av as getPageHeaderZoneTop, aw as getPageBodyTop, ax as getPageColumnRects, ay as findFootnoteReference, az as FOOTNOTE_MARKER_GUTTER_PX, aA as resolveImporterForFile, aB as createEditorStateFromDocument, aC as getDocumentParagraphsCanonical, aD as getToolbarStyleState, aE as STANDARD_FONT_SIZES_PT, aF as fontSizePxToPt, aG as probeLocalFontFamilies, aH as createInitialEditorState, aI as parseFontSizePtToPx, aJ as formatFontSizePt, aK as underlineStyleToCssDecorationStyle, aL as listKindForTag, aM as isParagraphTag, aN as collectInlineRuns, aO as parseParagraphStyle, aP as getCachedCanvasImage, aQ as getHeadingLevel, aR as preciseFontModeVersion, aS as isPreciseFontModeEnabled, aT as togglePreciseFontMode, aU as nextFontSizePt, aV as previousFontSizePt, aW as fontSizePtToPx, aX as createDefaultToolbarPreset, aY as MenuRegistry, aZ as createToolbarRegistry, a_ as Editor, a$ as resolveCommandRef, b0 as commandRefName, b1 as InlineShell, b2 as BalloonShell, b3 as DocumentShell, b4 as createMemo, b5 as getCaretRectFromSnapshot, b6 as getParagraphRectFromSnapshot, b7 as createComponent, b8 as CaretOverlay, b9 as Show, ba as createRenderEffect, bb as style, bc as setAttribute, bd as setStyleProperty, be as memo, bf as template, bg as useI18n, bh as insert, bi as use, bj as addEventListener, bk as Dialog, bl as delegateEvents, bm as className, bn as For, bo as UNDERLINE_STYLE_OPTIONS, bp as Tabs, bq as measureParagraphMinContentWidthPx, br as getEditableBlocksForZone, bs as findParagraphLocation, bt as createSectionBoundaryParagraph, bu as normalizePageSettings, bv as DEFAULT_EDITOR_PAGE_SETTINGS, bw as markStart, bx as markEnd, by as getParagraphEntries, bz as getParagraphById, bA as PluginUiHost, bB as OasisEditorEditor, bC as perfTimer, bD as OasisBrandMark, bE as setPreciseFontPreference, bF as setWelcomeSeen, bG as enablePreciseFontMode, bH as createOasisEditorClient, bI as createEditorZoom, bJ as startLongTaskObserver, bK as installGlobalReport, bL as applyStoredPreciseFontPreference, bM as getWelcomeSeen, bN as isLocalFontAccessSupported, bO as EDITOR_SCROLL_PADDING_PX, bP as Toolbar, bQ as OasisEditorLoading, bR as I18nProvider, bS as createEditorLogger, bT as createTranslator, bU as registerDomStatsSurface } from "./index-BAj76FrB.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) {
@@ -9240,6 +9240,26 @@ function serializeSectionPropertiesWithReferences(pageSettings, references) {
9240
9240
  }
9241
9241
  return `<w:sectPr>${referencesXml}${titlePageXml}<w:pgSz w:w="${width}" w:h="${height}"${orientationAttr}/><w:pgMar w:top="${pxToTwips(margins.top, 1440)}" w:right="${pxToTwips(margins.right, 1440)}" w:bottom="${pxToTwips(margins.bottom, 1440)}" w:left="${pxToTwips(margins.left, 1440)}" w:header="${pxToTwips(margins.header, 720)}" w:footer="${pxToTwips(margins.footer, 720)}" w:gutter="${pxToTwips(margins.gutter, 0)}"/>${columnsXml}</w:sectPr>`;
9242
9242
  }
9243
+ function buildDocumentXml(document2, context, sectionReferences) {
9244
+ const sections = getDocumentSections(document2);
9245
+ const sectionsXml = sections.map((section, sectionIndex) => {
9246
+ const blocksXml = serializeBlocksXml(
9247
+ section.blocks,
9248
+ context,
9249
+ document2.styles
9250
+ );
9251
+ const sectionPr = serializeSectionPropertiesWithReferences(
9252
+ section.pageSettings,
9253
+ sectionReferences[sectionIndex]
9254
+ );
9255
+ return blocksXml + sectionPr;
9256
+ }).join("");
9257
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document ${DOCUMENT_XMLNS}><w:body>${sectionsXml}</w:body></w:document>`;
9258
+ }
9259
+ function buildHeaderFooterXml(kind, blocks, context, styles) {
9260
+ const tag = kind === "header" ? "hdr" : "ftr";
9261
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:${tag} ${DOCUMENT_XMLNS}>${serializeBlocksXml(blocks, context, styles)}</w:${tag}>`;
9262
+ }
9243
9263
  function buildPartContext(blocks, numberingContext, state, document2) {
9244
9264
  const images = [];
9245
9265
  const imageMap = /* @__PURE__ */ new Map();
@@ -9319,26 +9339,6 @@ function buildPartContext(blocks, numberingContext, state, document2) {
9319
9339
  hyperlinkMap
9320
9340
  };
9321
9341
  }
9322
- function buildDocumentXml(document2, context, sectionReferences) {
9323
- const sections = getDocumentSections(document2);
9324
- const sectionsXml = sections.map((section, sectionIndex) => {
9325
- const blocksXml = serializeBlocksXml(
9326
- section.blocks,
9327
- context,
9328
- document2.styles
9329
- );
9330
- const sectionPr = serializeSectionPropertiesWithReferences(
9331
- section.pageSettings,
9332
- sectionReferences[sectionIndex]
9333
- );
9334
- return blocksXml + sectionPr;
9335
- }).join("");
9336
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document ${DOCUMENT_XMLNS}><w:body>${sectionsXml}</w:body></w:document>`;
9337
- }
9338
- function buildHeaderFooterXml(kind, blocks, context, styles) {
9339
- const tag = kind === "header" ? "hdr" : "ftr";
9340
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:${tag} ${DOCUMENT_XMLNS}>${serializeBlocksXml(blocks, context, styles)}</w:${tag}>`;
9341
- }
9342
9342
  async function exportEditorDocumentToDocx(document2) {
9343
9343
  var _a, _b, _c, _d, _e, _f;
9344
9344
  document2 = renumberImageCaptionsInDocument(document2);
@@ -0,0 +1,5 @@
1
+ import { EditorBlockNode, EditorDocument, EditorNamedStyle } from '../../core/model.js';
2
+ import { DocContext, SectionReferenceDefinition } from './docxTypes.js';
3
+
4
+ export declare function buildDocumentXml(document: EditorDocument, context: DocContext, sectionReferences: SectionReferenceDefinition[]): string;
5
+ export declare function buildHeaderFooterXml(kind: "header" | "footer", blocks: EditorBlockNode[], context: DocContext, styles: Record<string, EditorNamedStyle> | undefined): string;
@@ -2483,7 +2483,7 @@ function OasisEditorAppLazy(props = {}) {
2483
2483
  onCleanup(() => {
2484
2484
  cancelled = true;
2485
2485
  });
2486
- import("./OasisEditorApp-2ji5OaBy.js").then((m) => {
2486
+ import("./OasisEditorApp-D9nFlW8O.js").then((m) => {
2487
2487
  cancelled = true;
2488
2488
  setProgress(1);
2489
2489
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -1,4 +1,4 @@
1
- import { b2, bV, bW, bX, bY, bZ, bk, b_, b3, a_, b$, c0, c1, b1, c2, aY, c3, c4, c5, c6, c7, bQ, c8, c9, ca, cb, cc, cd, ce, cf, cg, ch, ci, bp, cj, bP, ck, bX as bX2, c0 as c02, c2 as c22, cb as cb2, cd as cd2, ci as ci2, cl, b0, aX, cm, cn, co, aZ, cp, cq, a$ } from "./index-BMJs8egS.js";
1
+ import { b2, bV, bW, bX, bY, bZ, bk, b_, b3, a_, b$, c0, c1, b1, c2, aY, c3, c4, c5, c6, c7, bQ, c8, c9, ca, cb, cc, cd, ce, cf, cg, ch, ci, bp, cj, bP, ck, bX as bX2, c0 as c02, c2 as c22, cb as cb2, cd as cd2, ci as ci2, cl, b0, aX, cm, cn, co, aZ, cp, cq, a$ } from "./index-BAj76FrB.js";
2
2
  export {
3
3
  b2 as BalloonShell,
4
4
  bV as Button,