oasis-editor 0.0.20 → 0.0.22

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, q as createEditorParagraph, r as getBlockParagraphs, s as findParagraphTableLocation, t as buildTableCellLayout, u as createEditorTableCell, v as createEditorTable, w as createEditorTableRow, x as underlineStyleToCssDecorationStyle, y as resolveImageSrc, z as createEditorFootnote, A as createFootnoteReferenceRun, B as renumberFootnotes, C as iterateFootnoteReferenceRuns, D as getFootnoteDisplayMarker, E as createSignal, F as createEffect, G as onCleanup, H as buildCanvasLayoutSnapshot, I as on, J as onMount, K as debounce, L as unwrap, M as getDocumentParagraphs, N as getDocumentSectionsCanonical, O as createEditorDocument, P as getPageContentWidth, Q as getDocumentPageSettings, R as getTableCellContentWidthForParagraph, S as resolveResizedDimensions, T as resolveTextBoxRenderHeight, U as resolveEffectiveParagraphStyle, V as resolveEffectiveTextStyleForParagraph, W as iterateEndnoteReferenceRuns, X as JSZip, Y as imageContentTypeDefaults, Z as imageExtensionFromMime, _ as pxToPt$1, $ as buildSegmentTable, a0 as buildCanvasTableLayout, a1 as resolveFloatingObjectRect, a2 as getTextBoxFloatingGeometry, a3 as getPresetPathSegments, a4 as projectBlocksLayout, a5 as textStyleToFontSizePt, a6 as PX_PER_POINT, a7 as DEFAULT_FONT_SIZE_PX, a8 as isDoubleUnderlineStyle, a9 as isWavyUnderlineStyle, aa as underlineStyleLineWidthPx, ab as underlineStyleDashArray, ac as getListLabelInset, ad as getParagraphBorderInsets, ae as normalizeFamily, af as ROBOTO_FONT_FILES, ag as loadFontAsset, ah as OFFICE_COMPAT_FONT_FAMILIES, ai as buildSfnt, aj as defaultFontDecoderRegistry, ak as SfntFontProgram, al as collectPdfFontFamilies, am as projectDocumentLayout, an as getPageHeaderZoneTop, ao as getPageBodyTop, ap as getPageColumnRects, aq as findFootnoteReference, ar as FOOTNOTE_MARKER_GUTTER_PX, as as resolveImporterForFile, at as createEditorStateFromDocument, au as getDocumentParagraphsCanonical, av as getToolbarStyleState, aw as STANDARD_FONT_SIZES_PT, ax as fontSizePxToPt, ay as probeLocalFontFamilies, az as createInitialEditorState, aA as parseFontSizePtToPx, aB as formatFontSizePt, aC as listKindForTag, aD as isParagraphTag, aE as collectInlineRuns, aF as parseParagraphStyle, aG as t, aH as preciseFontModeVersion, aI as isPreciseFontModeEnabled, aJ as togglePreciseFontMode, aK as nextFontSizePt, aL as previousFontSizePt, aM as fontSizePtToPx, aN as createDefaultToolbarPreset, aO as defaultMenuItems, aP as MenuRegistry, aQ as createToolbarRegistry, aR as Editor, aS as resolveCommandRef, aT as commandRefName, aU as InlineShell, aV as BalloonShell, aW as DocumentShell, aX as createMemo, aY as getCaretRectFromSnapshot, aZ as getParagraphRectFromSnapshot, a_ as createComponent, a$ as CaretOverlay, b0 as Show, b1 as createRenderEffect, b2 as style, b3 as setAttribute, b4 as setStyleProperty, b5 as memo, b6 as template, b7 as insert, b8 as use, b9 as addEventListener, ba as Dialog, bb as delegateEvents, bc as className, bd as For, be as UNDERLINE_STYLE_OPTIONS, bf as Tabs, bg as measureParagraphMinContentWidthPx, bh as getEditableBlocksForZone, bi as findParagraphLocation, bj as createSectionBoundaryParagraph, bk as normalizePageSettings, bl as DEFAULT_EDITOR_PAGE_SETTINGS, bm as markStart, bn as markEnd, bo as getParagraphEntries, bp as getParagraphById, bq as PluginUiHost, br as OasisEditorEditor, bs as perfTimer, bt as OasisBrandMark, bu as setPreciseFontPreference, bv as setWelcomeSeen, bw as enablePreciseFontMode, bx as createOasisEditorClient, by as setLocale, bz as startLongTaskObserver, bA as installGlobalReport, bB as applyStoredPreciseFontPreference, bC as getWelcomeSeen, bD as isLocalFontAccessSupported, bE as EDITOR_SCROLL_PADDING_PX, bF as Toolbar, bG as OasisEditorLoading, bH as createEditorLogger, bI as getCachedCanvasImage, bJ as registerDomStatsSurface } from "./index-CBXD1ygJ.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, q as createEditorParagraph, r as getBlockParagraphs, s as findParagraphTableLocation, t as buildTableCellLayout, u as createEditorTableCell, v as createEditorTable, w as createEditorTableRow, x as underlineStyleToCssDecorationStyle, y as resolveImageSrc, z as createEditorFootnote, A as createFootnoteReferenceRun, B as renumberFootnotes, C as iterateFootnoteReferenceRuns, D as getFootnoteDisplayMarker, E as createSignal, F as createEffect, G as onCleanup, H as buildCanvasLayoutSnapshot, I as on, J as onMount, K as debounce, L as unwrap, M as getDocumentParagraphs, N as getDocumentSectionsCanonical, O as createEditorDocument, P as getPageContentWidth, Q as getDocumentPageSettings, R as getTableCellContentWidthForParagraph, S as resolveResizedDimensions, T as resolveTextBoxRenderHeight, U as resolveEffectiveParagraphStyle, V as resolveEffectiveTextStyleForParagraph, W as iterateEndnoteReferenceRuns, X as JSZip, Y as imageContentTypeDefaults, Z as imageExtensionFromMime, _ as pxToPt$1, $ as buildSegmentTable, a0 as buildCanvasTableLayout, a1 as resolveFloatingObjectRect, a2 as getTextBoxFloatingGeometry, a3 as getPresetPathSegments, a4 as projectBlocksLayout, a5 as textStyleToFontSizePt, a6 as PX_PER_POINT, a7 as DEFAULT_FONT_SIZE_PX, a8 as isDoubleUnderlineStyle, a9 as isWavyUnderlineStyle, aa as underlineStyleLineWidthPx, ab as underlineStyleDashArray, ac as getListLabelInset, ad as getParagraphBorderInsets, ae as normalizeFamily, af as ROBOTO_FONT_FILES, ag as loadFontAsset, ah as OFFICE_COMPAT_FONT_FAMILIES, ai as buildSfnt, aj as defaultFontDecoderRegistry, ak as SfntFontProgram, al as collectPdfFontFamilies, am as projectDocumentLayout, an as getPageHeaderZoneTop, ao as getPageBodyTop, ap as getPageColumnRects, aq as findFootnoteReference, ar as FOOTNOTE_MARKER_GUTTER_PX, as as resolveImporterForFile, at as createEditorStateFromDocument, au as getDocumentParagraphsCanonical, av as getToolbarStyleState, aw as STANDARD_FONT_SIZES_PT, ax as fontSizePxToPt, ay as probeLocalFontFamilies, az as createInitialEditorState, aA as parseFontSizePtToPx, aB as formatFontSizePt, aC as listKindForTag, aD as isParagraphTag, aE as collectInlineRuns, aF as parseParagraphStyle, aG as t, aH as preciseFontModeVersion, aI as isPreciseFontModeEnabled, aJ as togglePreciseFontMode, aK as nextFontSizePt, aL as previousFontSizePt, aM as fontSizePtToPx, aN as createDefaultToolbarPreset, aO as defaultMenuItems, aP as MenuRegistry, aQ as createToolbarRegistry, aR as Editor, aS as resolveCommandRef, aT as commandRefName, aU as InlineShell, aV as BalloonShell, aW as DocumentShell, aX as createMemo, aY as getCaretRectFromSnapshot, aZ as getParagraphRectFromSnapshot, a_ as createComponent, a$ as CaretOverlay, b0 as Show, b1 as createRenderEffect, b2 as style, b3 as setAttribute, b4 as setStyleProperty, b5 as memo, b6 as template, b7 as insert, b8 as use, b9 as addEventListener, ba as Dialog, bb as delegateEvents, bc as className, bd as For, be as UNDERLINE_STYLE_OPTIONS, bf as Tabs, bg as measureParagraphMinContentWidthPx, bh as getEditableBlocksForZone, bi as findParagraphLocation, bj as createSectionBoundaryParagraph, bk as normalizePageSettings, bl as DEFAULT_EDITOR_PAGE_SETTINGS, bm as markStart, bn as markEnd, bo as getParagraphEntries, bp as getParagraphById, bq as PluginUiHost, br as OasisEditorEditor, bs as perfTimer, bt as OasisBrandMark, bu as setPreciseFontPreference, bv as setWelcomeSeen, bw as enablePreciseFontMode, bx as createOasisEditorClient, by as setLocale, bz as startLongTaskObserver, bA as installGlobalReport, bB as applyStoredPreciseFontPreference, bC as getWelcomeSeen, bD as isLocalFontAccessSupported, bE as EDITOR_SCROLL_PADDING_PX, bF as Toolbar, bG as OasisEditorLoading, bH as createEditorLogger, bI as getCachedCanvasImage, bJ as registerDomStatsSurface } from "./index-N6EX-tEW.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) {
@@ -8941,8 +8941,11 @@ function buildTextBoxGraphicXml(textBox, cx, cy, context, styles) {
8941
8941
  bodyAttrs.push(`anchor="${escapeXml((body == null ? void 0 : body.anchor) ?? "t")}"`);
8942
8942
  bodyAttrs.push('anchorCtr="0"');
8943
8943
  const autoFitXml = (body == null ? void 0 : body.autoFit) ? "<a:spAutoFit/>" : "";
8944
- const innerXml = serializeBlocksXml(textBox.blocks, context, styles);
8945
- return `<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"><wps:wsp><wps:cNvSpPr txBox="1"><a:spLocks noChangeArrowheads="1"/></wps:cNvSpPr><wps:spPr bwMode="auto"><a:xfrm${xfrmRotAttr}><a:off x="0" y="0"/><a:ext cx="${cx}" cy="${cy}"/></a:xfrm><a:prstGeom prst="${preset}"><a:avLst/></a:prstGeom>` + fillXml + lnXml + `</wps:spPr><wps:txbx><w:txbxContent>${innerXml}</w:txbxContent></wps:txbx><wps:bodyPr ${bodyAttrs.join(" ")}>${autoFitXml}</wps:bodyPr></wps:wsp></a:graphicData></a:graphic>`;
8944
+ const hasTextBoxContent = textBox.blocks.length > 0;
8945
+ const innerXml = hasTextBoxContent ? serializeBlocksXml(textBox.blocks, context, styles) : "";
8946
+ const cNvSpPrXml = hasTextBoxContent ? '<wps:cNvSpPr txBox="1"><a:spLocks noChangeArrowheads="1"/></wps:cNvSpPr>' : "<wps:cNvSpPr/>";
8947
+ const txbxXml = hasTextBoxContent ? `<wps:txbx><w:txbxContent>${innerXml}</w:txbxContent></wps:txbx>` : "";
8948
+ return '<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"><wps:wsp>' + cNvSpPrXml + `<wps:spPr bwMode="auto"><a:xfrm${xfrmRotAttr}><a:off x="0" y="0"/><a:ext cx="${cx}" cy="${cy}"/></a:xfrm><a:prstGeom prst="${preset}"><a:avLst/></a:prstGeom>` + fillXml + lnXml + "</wps:spPr>" + txbxXml + `<wps:bodyPr ${bodyAttrs.join(" ")}>${autoFitXml}</wps:bodyPr></wps:wsp></a:graphicData></a:graphic>`;
8946
8949
  }
8947
8950
  function serializeTextBoxRun(run, textBox, context, styles, rPrXml) {
8948
8951
  const cx = Math.round(textBox.width * EMU_PER_PX);
@@ -41841,6 +41844,7 @@ function useEditorRuntimePlugins(options) {
41841
41844
  tab: item.tab ?? "plugins",
41842
41845
  group: item.group ?? "general",
41843
41846
  row: item.row ?? 1,
41847
+ ribbonSize: item.ribbonSize,
41844
41848
  order: item.order
41845
41849
  };
41846
41850
  toolbarRegistry.register(contributed);