oasis-editor 0.0.190 → 0.0.192

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, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
3
3
  var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
4
- import { E as EMPTY_PROJECTION_CONTEXT, d as domTextMeasurer, g as getProjectedParagraphBlockHeight, e as estimateTableBlockHeight, p as projectParagraphLayout, a as getPageBodyBottom, b as getPageBodyTop, c as getPageContentWidth, F as FOOTNOTE_MARKER_GUTTER_PX, f as getParagraphText, h as getBlockParagraphs, i as getRunFootnoteReference, l as listReferencedEndnotes, j as getFootnoteDisplayMarker, k as createProjectionContext, m as getDocumentSections, n as getRunField, o as projectBlocksLayout, q as createSignal, r as cloneEditorState, s as createEditorStateFromDocument, t as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, u as fontSizePxToPt, v as probeLocalFontFamilies, w as createEditorParagraphFromRuns, x as isInlineObjectRun, y as stylesEqual, z as cloneStyle, A as createEditorStyledRun, B as cloneParagraphList, C as cloneParagraph, D as getParagraphLength, G as cloneRun, H as getActiveZone, I as getActiveSectionIndex, J as getParagraphs, K as normalizeSelection, L as positionToParagraphOffset, M as cloneParagraphs, N as paragraphOffsetToPosition, O as findParagraphIndex, P as createCollapsedSelection, Q as isSelectionCollapsed, R as MATH_OBJECT_REPLACEMENT, T as setValueStyle, U as setBooleanStyle, V as parseFontSizePtToPx, W as formatFontSizePt, X as setParagraphStyleValue, Y as createEditorParagraph, Z as cloneBlocks, _ as resolveDefaultParagraphStyleId, $ as findParagraphTablePathLocation, a0 as findParagraphLocation, a1 as resolveTablePath, a2 as buildTableCellLayout, a3 as PT_PER_PX, a4 as createEditorTableCell, a5 as createEditorTableRow, a6 as createEditorTable, a7 as clampPosition, a8 as PX_PER_POINT, a9 as underlineStyleToCssDecorationStyle, aa as resolveImageSrc, ab as listKindForTag, ac as isParagraphTag, ad as collectInlineRuns, ae as parseParagraphStyle, af as getRunImage, ag as InlineShell, ah as BalloonShell, ai as DocumentShell, aj as findParagraphTableLocation, ak as createMemo, al as getCaretRectFromSnapshot, am as getParagraphRectFromSnapshot, an as createComponent, ao as CaretOverlay, ap as Show, aq as createRenderEffect, ar as style, as as setStyleProperty, at as setAttribute, au as memo, av as template, aw as Button, ax as useI18n, ay as createEffect, az as TextField, aA as Dialog, aB as insert, aC as className, aD as Grid, aE as SelectField, aF as StatusText, aG as ColorField, aH as UNDERLINE_STYLE_OPTIONS, aI as Stack, aJ as For, aK as ToggleChip, aL as FormField, aM as Checkbox, aN as FieldGroup, aO as Tabs, aP as NumberField, aQ as parseNumber, aR as createStore, aS as reconcile, aT as RadioGroup, aU as Radio$1, aV as TextAreaField, aW as COMMON_SYMBOLS, aX as getRecentSymbols, aY as SYMBOL_CATEGORIES, aZ as rememberSymbol, a_ as delegateEvents, a$ as EMPTY_EDITOR_MATH_EXPRESSION, b0 as serializeLinearMath, b1 as parseLinearMath, b2 as Text, b3 as SurfaceButton, b4 as onMount, b5 as onCleanup, b6 as CheckIcon, b7 as use, b8 as PluginUiHost, b9 as OasisEditorEditor, ba as OasisBrandMark, bb as setPreciseFontPreference, bc as setWelcomeSeen, bd as enablePreciseFontMode, be as WORD_NS$6, bf as XMLSerializer, bg as DOMParser, bh as WORD14_NS, bi as mergeNestedExtensionMarkup, bj as resolveOpcRelationships, bk as parseOpcRelationships, bl as JSZip, bm as normalizeOpcPartPath, bn as OPC_CONTENT_TYPES_PATH, bo as getOpcRelationshipOwnerPath, bp as serializeOpcRelationships, bq as OPC_ROOT_RELATIONSHIPS_PATH, br as hashDocxPartBytes, bs as parseOpcContentTypes, bt as serializeOpcContentTypes, bu as mergeParagraphPropertiesXmlSource, bv as setEditorRunOoxmlSource, bw as mergeRunOoxmlSourceIntoGeneratedXml, bx as mergeTableCellPropertiesXmlSource, by as mergeTableRowPropertiesXmlSource, bz as mergeTablePropertiesXmlSource, bA as getDocumentSectionsCanonical, bB as exportEditorDocumentToDocxBlob, bC as exportEditorDocumentToDocx, bD as pxToPt$1, bE as resolveFloatingObjectRect, bF as getTextBoxFloatingGeometry, bG as getPresetPathSegments, bH as buildListLabels, bI as assertNever, bJ as lineDashPatternPt, bK as DEFAULT_FONT_SIZE_PX, bL as resolveGradientAxis, bM as isDoubleUnderlineStyle, bN as isWavyUnderlineStyle, bO as underlineStyleLineWidthPx, bP as WAVY_UNDERLINE_WAVELENGTH_PX, bQ as WAVY_UNDERLINE_AMPLITUDE_PX, bR as DOUBLE_UNDERLINE_OFFSET_PX, bS as underlineStyleDashArray, bT as resolveEffectiveParagraphStyle, bU as EMPHASIS_GLYPH, bV as parseHexColorToRgb255, bW as rgb255ToHex, bX as getImageFloatingGeometry, bY as resolveEffectiveTextStyleForParagraph, bZ as textStyleToFontSizePt, b_ as mathDisplayText, b$ as TEXT_BASELINE_RATIO, c0 as resolveTextAlignmentBaselineOffset, c1 as resolveRenderedTextChar, c2 as resolveOpenTypeFeatureTags, c3 as isLowercaseSmallCapsChar, c4 as resolveDecorationLineY, c5 as DOUBLE_STRIKE_OFFSET_PX, c6 as resolveListLabel, c7 as getListLabelInset, c8 as getAlignedListLabelInset, c9 as getParagraphBorderInsets, ca as buildSegmentTable, cb as buildCanvasTableLayout, cc as resolveCanvasTableWidth, cd as resolveFloatingTableRect, ce as paragraphBetweenBorderMatches, cf as normalizeFamily, cg as ROBOTO_FONT_FILES, ch as loadFontAsset, ci as getRemotePdfFontFaces, cj as OFFICE_COMPAT_FONT_FAMILIES, ck as BinaryReader, cl as buildSfnt, cm as defaultFontDecoderRegistry, cn as SfntFontProgram, co as zlibSync, cp as renumberImageCaptionsInDocument, cq as collectPdfFontFamilies, cr as outlineFrom, cs as getPageHeaderZoneTop, ct as getPageColumnRects, cu as findFootnoteReference, cv as resolveImporterForFile, cw as roundTo, cx as getDocumentParagraphsCanonical, cy as getDocumentParagraphs, cz as getImageCaptionText, cA as isImageCaptionParagraph, cB as updateImageCaptionParagraph, cC as createImageCaptionParagraph, cD as renumberImageCaptionParagraphs, cE as getCaptionSelectionOffset, cF as PX_PER_CM, cG as getDocumentPageSettings, cH as getTableCellContentWidthForParagraph, cI as layoutMetricsEpoch, cJ as bumpLayoutMetricsEpoch, cK as createCanvasLayoutSnapshotProvider, cL as on, cM as debounce, cN as unwrap, cO as cloneSection, cP as perfTimer, cQ as prepareDocumentFonts, cR as getRunTextBox, cS as EMU_PER_PX, cT as createEditorDocument, cU as cloneBlock, cV as resolveResizedDimensions, cW as axisSignForDirection, cX as clamp$1, cY as MIN_RESIZE_SIZE_PX, cZ as resolveTextBoxRenderHeight, c_ as getToolbarStyleState, c$ as VERTICAL_HIT_WEIGHT, d0 as getCachedCanvasImage, d1 as measureParagraphMinContentWidthPx, d2 as createSectionBoundaryParagraph, d3 as normalizePageSettings, d4 as DEFAULT_EDITOR_PAGE_SETTINGS, d5 as markStart, d6 as markEnd, d7 as getParagraphEntries, d8 as getParagraphById, d9 as createEditorFootnote, da as createFootnoteReferenceRun, db as renumberFootnotes, dc as iterateFootnoteReferenceRuns, dd as preciseFontModeVersion, de as isPreciseFontModeEnabled, df as getRunFieldChar, dg as getRunFieldInstruction, dh as getHeadingLevel, di as createEditorRun, dj as TWIPS_PER_INCH, dk as PX_PER_INCH, dl as togglePreciseFontMode, dm as nextFontSizePt, dn as previousFontSizePt, dp as fontSizePtToPx, dq as resolveNamedTextStyle, dr as resolveNamedTableStyle, ds as resolveEffectiveTableStyle, dt as createDefaultToolbarPreset, du as MenuRegistry, dv as createToolbarRegistry, dw as Editor, dx as resolveCommandRef, dy as commandRefName, dz as createOasisEditorClient, dA as createEditorZoom, dB as startLongTaskObserver, dC as installGlobalReport, dD as applyStoredPreciseFontPreference, dE as getWelcomeSeen, dF as isLocalFontAccessSupported, dG as EDITOR_SCROLL_PADDING_PX, dH as Toolbar, dI as OasisEditorLoading, dJ as I18nProvider, dK as createTranslator, dL as registerDomStatsSurface, dM as createEditorLogger } from "./index-DfpqJDWD.js";
4
+ import { E as EMPTY_PROJECTION_CONTEXT, d as domTextMeasurer, g as getProjectedParagraphBlockHeight, e as estimateTableBlockHeight, p as projectParagraphLayout, a as getPageBodyBottom, b as getPageBodyTop, c as getPageContentWidth, F as FOOTNOTE_MARKER_GUTTER_PX, f as getParagraphText, h as getBlockParagraphs, i as getRunFootnoteReference, l as listReferencedEndnotes, j as getFootnoteDisplayMarker, k as createProjectionContext, m as getDocumentSections, n as getRunField, o as projectBlocksLayout, q as createSignal, r as cloneEditorState, s as createEditorStateFromDocument, t as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, u as fontSizePxToPt, v as probeLocalFontFamilies, w as createEditorParagraphFromRuns, x as isInlineObjectRun, y as stylesEqual, z as cloneStyle, A as createEditorStyledRun, B as cloneParagraphList, C as cloneParagraph, D as getParagraphLength, G as cloneRun, H as getActiveZone, I as getActiveSectionIndex, J as getParagraphs, K as normalizeSelection, L as positionToParagraphOffset, M as cloneParagraphs, N as paragraphOffsetToPosition, O as findParagraphIndex, P as createCollapsedSelection, Q as isSelectionCollapsed, R as MATH_OBJECT_REPLACEMENT, T as setValueStyle, U as setBooleanStyle, V as parseFontSizePtToPx, W as formatFontSizePt, X as setParagraphStyleValue, Y as createEditorParagraph, Z as cloneBlocks, _ as resolveDefaultParagraphStyleId, $ as findParagraphTablePathLocation, a0 as findParagraphLocation, a1 as resolveTablePath, a2 as buildTableCellLayout, a3 as PT_PER_PX, a4 as createEditorTableCell, a5 as createEditorTableRow, a6 as createEditorTable, a7 as clampPosition, a8 as PX_PER_POINT, a9 as underlineStyleToCssDecorationStyle, aa as resolveImageSrc, ab as listKindForTag, ac as isParagraphTag, ad as collectInlineRuns, ae as parseParagraphStyle, af as getRunImage, ag as InlineShell, ah as BalloonShell, ai as DocumentShell, aj as findParagraphTableLocation, ak as createMemo, al as getCaretRectFromSnapshot, am as getParagraphRectFromSnapshot, an as createComponent, ao as CaretOverlay, ap as Show, aq as createRenderEffect, ar as style, as as setStyleProperty, at as setAttribute, au as memo, av as template, aw as Button, ax as useI18n, ay as createEffect, az as TextField, aA as Dialog, aB as insert, aC as className, aD as Grid, aE as SelectField, aF as StatusText, aG as ColorField, aH as UNDERLINE_STYLE_OPTIONS, aI as Stack, aJ as For, aK as ToggleChip, aL as FormField, aM as Checkbox, aN as FieldGroup, aO as Tabs, aP as NumberField, aQ as parseNumber, aR as createStore, aS as reconcile, aT as RadioGroup, aU as Radio$1, aV as TextAreaField, aW as COMMON_SYMBOLS, aX as getRecentSymbols, aY as SYMBOL_CATEGORIES, aZ as rememberSymbol, a_ as delegateEvents, a$ as EMPTY_EDITOR_MATH_EXPRESSION, b0 as serializeLinearMath, b1 as parseLinearMath, b2 as Text, b3 as SurfaceButton, b4 as onMount, b5 as onCleanup, b6 as CheckIcon, b7 as use, b8 as PluginUiHost, b9 as OasisEditorEditor, ba as OasisBrandMark, bb as setPreciseFontPreference, bc as setWelcomeSeen, bd as enablePreciseFontMode, be as WORD_NS$6, bf as XMLSerializer, bg as DOMParser, bh as WORD14_NS, bi as mergeNestedExtensionMarkup, bj as resolveOpcRelationships, bk as parseOpcRelationships, bl as JSZip, bm as normalizeOpcPartPath, bn as OPC_CONTENT_TYPES_PATH, bo as getOpcRelationshipOwnerPath, bp as serializeOpcRelationships, bq as OPC_ROOT_RELATIONSHIPS_PATH, br as hashDocxPartBytes, bs as parseOpcContentTypes, bt as serializeOpcContentTypes, bu as mergeParagraphPropertiesXmlSource, bv as setEditorRunOoxmlSource, bw as mergeRunOoxmlSourceIntoGeneratedXml, bx as mergeTableCellPropertiesXmlSource, by as mergeTableRowPropertiesXmlSource, bz as mergeTablePropertiesXmlSource, bA as getDocumentSectionsCanonical, bB as exportEditorDocumentToDocxBlob, bC as exportEditorDocumentToDocx, bD as pxToPt$1, bE as resolveFloatingObjectRect, bF as getTextBoxFloatingGeometry, bG as getPresetPathSegments, bH as buildListLabels, bI as assertNever, bJ as lineDashPatternPt, bK as DEFAULT_FONT_SIZE_PX, bL as resolveGradientAxis, bM as isDoubleUnderlineStyle, bN as isWavyUnderlineStyle, bO as underlineStyleLineWidthPx, bP as WAVY_UNDERLINE_WAVELENGTH_PX, bQ as WAVY_UNDERLINE_AMPLITUDE_PX, bR as DOUBLE_UNDERLINE_OFFSET_PX, bS as underlineStyleDashArray, bT as resolveEffectiveParagraphStyle, bU as EMPHASIS_GLYPH, bV as parseHexColorToRgb255, bW as rgb255ToHex, bX as getImageFloatingGeometry, bY as resolveEffectiveTextStyleForParagraph, bZ as textStyleToFontSizePt, b_ as mathDisplayText, b$ as TEXT_BASELINE_RATIO, c0 as resolveTextAlignmentBaselineOffset, c1 as resolveRenderedTextChar, c2 as resolveOpenTypeFeatureTags, c3 as isLowercaseSmallCapsChar, c4 as resolveDecorationLineY, c5 as DOUBLE_STRIKE_OFFSET_PX, c6 as resolveListLabel, c7 as getListLabelInset, c8 as getAlignedListLabelInset, c9 as getParagraphBorderInsets, ca as buildSegmentTable, cb as buildCanvasTableLayout, cc as resolveCanvasTableWidth, cd as resolveFloatingTableRect, ce as paragraphBetweenBorderMatches, cf as normalizeFamily, cg as ROBOTO_FONT_FILES, ch as loadFontAsset, ci as getRemotePdfFontFaces, cj as OFFICE_COMPAT_FONT_FAMILIES, ck as BinaryReader, cl as buildSfnt, cm as defaultFontDecoderRegistry, cn as SfntFontProgram, co as zlibSync, cp as renumberImageCaptionsInDocument, cq as collectPdfFontFamilies, cr as outlineFrom, cs as getPageHeaderZoneTop, ct as getPageColumnRects, cu as findFootnoteReference, cv as resolveImporterForFile, cw as roundTo, cx as getDocumentParagraphsCanonical, cy as getDocumentParagraphs, cz as getImageCaptionText, cA as isImageCaptionParagraph, cB as updateImageCaptionParagraph, cC as createImageCaptionParagraph, cD as renumberImageCaptionParagraphs, cE as getCaptionSelectionOffset, cF as PX_PER_CM, cG as getDocumentPageSettings, cH as getTableCellContentWidthForParagraph, cI as layoutMetricsEpoch, cJ as bumpLayoutMetricsEpoch, cK as createCanvasLayoutSnapshotProvider, cL as on, cM as debounce, cN as unwrap, cO as cloneSection, cP as perfTimer, cQ as prepareDocumentFonts, cR as getRunTextBox, cS as EMU_PER_PX, cT as createEditorDocument, cU as cloneBlock, cV as resolveResizedDimensions, cW as axisSignForDirection, cX as clamp$1, cY as MIN_RESIZE_SIZE_PX, cZ as resolveTextBoxRenderHeight, c_ as getToolbarStyleState, c$ as VERTICAL_HIT_WEIGHT, d0 as getCachedCanvasImage, d1 as measureParagraphMinContentWidthPx, d2 as createSectionBoundaryParagraph, d3 as normalizePageSettings, d4 as DEFAULT_EDITOR_PAGE_SETTINGS, d5 as markStart, d6 as markEnd, d7 as getParagraphEntries, d8 as getParagraphById, d9 as createEditorFootnote, da as createFootnoteReferenceRun, db as renumberFootnotes, dc as iterateFootnoteReferenceRuns, dd as preciseFontModeVersion, de as isPreciseFontModeEnabled, df as getRunFieldChar, dg as getRunFieldInstruction, dh as getHeadingLevel, di as createEditorRun, dj as TWIPS_PER_INCH, dk as PX_PER_INCH, dl as togglePreciseFontMode, dm as nextFontSizePt, dn as previousFontSizePt, dp as fontSizePtToPx, dq as resolveNamedTextStyle, dr as resolveNamedTableStyle, ds as resolveEffectiveTableStyle, dt as createDefaultToolbarPreset, du as MenuRegistry, dv as createToolbarRegistry, dw as Editor, dx as resolveCommandRef, dy as commandRefName, dz as createOasisEditorClient, dA as createEditorZoom, dB as startLongTaskObserver, dC as installGlobalReport, dD as applyStoredPreciseFontPreference, dE as getWelcomeSeen, dF as isLocalFontAccessSupported, dG as EDITOR_SCROLL_PADDING_PX, dH as Toolbar, dI as OasisEditorLoading, dJ as I18nProvider, dK as createTranslator, dL as registerDomStatsSurface, dM as createEditorLogger } from "./index-K-7FcXvb.js";
5
5
  function projectHeaderFooterBlocksWithDependencies(blocks, deps, context = {}) {
6
6
  const {
7
7
  pageIndex,
@@ -45423,8 +45423,59 @@ function downloadBlob(blob, filename) {
45423
45423
  anchor.click();
45424
45424
  URL.revokeObjectURL(url);
45425
45425
  }
45426
+ function printBlob(blob) {
45427
+ return new Promise((resolve) => {
45428
+ const url = URL.createObjectURL(blob);
45429
+ const iframe = document.createElement("iframe");
45430
+ iframe.setAttribute("aria-hidden", "true");
45431
+ iframe.style.position = "fixed";
45432
+ iframe.style.right = "0";
45433
+ iframe.style.bottom = "0";
45434
+ iframe.style.width = "0";
45435
+ iframe.style.height = "0";
45436
+ iframe.style.border = "0";
45437
+ let settled = false;
45438
+ const cleanup = () => {
45439
+ if (settled) return;
45440
+ settled = true;
45441
+ iframe.remove();
45442
+ URL.revokeObjectURL(url);
45443
+ resolve();
45444
+ };
45445
+ const fallback = () => {
45446
+ if (settled) return;
45447
+ const popup = window.open(url, "_blank");
45448
+ if (!popup) {
45449
+ const anchor = document.createElement("a");
45450
+ anchor.href = url;
45451
+ anchor.download = "oasis-editor.pdf";
45452
+ anchor.click();
45453
+ }
45454
+ cleanup();
45455
+ };
45456
+ iframe.addEventListener("load", () => {
45457
+ try {
45458
+ const contentWindow = iframe.contentWindow;
45459
+ if (!contentWindow) {
45460
+ fallback();
45461
+ return;
45462
+ }
45463
+ contentWindow.addEventListener("afterprint", cleanup);
45464
+ globalThis.setTimeout(cleanup, 6e4);
45465
+ contentWindow.focus();
45466
+ contentWindow.print();
45467
+ } catch {
45468
+ fallback();
45469
+ }
45470
+ });
45471
+ iframe.src = url;
45472
+ document.body.appendChild(iframe);
45473
+ });
45474
+ }
45426
45475
  function createDocumentExporter(deps) {
45427
45476
  const download = deps.download ?? downloadBlob;
45477
+ const print = deps.print ?? printBlob;
45478
+ let printInFlight = false;
45428
45479
  const handleExportDocx = async () => {
45429
45480
  const blob = await exportEditorDocumentToDocxBlobPreservingSource(
45430
45481
  deps.document()
@@ -45441,9 +45492,23 @@ function createDocumentExporter(deps) {
45441
45492
  };
45442
45493
  const exportDocxBlob = () => exportEditorDocumentToDocxBlobPreservingSource(deps.document());
45443
45494
  const exportPdfBlob = () => exportEditorDocumentToPdfBlob(deps.document());
45495
+ const handlePrint = async () => {
45496
+ const blob = await exportEditorDocumentToPdfBlob(deps.document());
45497
+ if (!printInFlight) {
45498
+ printInFlight = true;
45499
+ try {
45500
+ await print(blob);
45501
+ } finally {
45502
+ printInFlight = false;
45503
+ }
45504
+ }
45505
+ deps.focusInput();
45506
+ return blob;
45507
+ };
45444
45508
  return {
45445
45509
  handleExportDocx,
45446
45510
  handleExportPdf,
45511
+ handlePrint,
45447
45512
  exportDocxBlob,
45448
45513
  exportPdfBlob
45449
45514
  };
@@ -46357,11 +46422,15 @@ function createEditorDocumentIOImpl(deps) {
46357
46422
  const handleExportPdf = async () => {
46358
46423
  return exporter.handleExportPdf();
46359
46424
  };
46425
+ const handlePrint = async () => {
46426
+ return exporter.handlePrint();
46427
+ };
46360
46428
  return {
46361
46429
  importProgress,
46362
46430
  handleImportFile,
46363
46431
  handleExportDocx,
46364
46432
  handleExportPdf,
46433
+ handlePrint,
46365
46434
  exportDocxBlob: exporter.exportDocxBlob,
46366
46435
  exportPdfBlob: exporter.exportPdfBlob,
46367
46436
  insertImageFromFile,
@@ -55203,6 +55272,13 @@ const defaultEditorKeyBindings = [
55203
55272
  ctrlOrMeta: true,
55204
55273
  execute: () => true
55205
55274
  },
55275
+ {
55276
+ id: "print",
55277
+ command: "print",
55278
+ key: "p",
55279
+ ctrlOrMeta: true,
55280
+ execute: () => true
55281
+ },
55206
55282
  {
55207
55283
  id: "selectAll",
55208
55284
  command: "selectAll",
@@ -56355,7 +56431,7 @@ function buildDocumentAndBrowserCommands({
56355
56431
  ),
56356
56432
  print: actionCommand(
56357
56433
  "print",
56358
- () => browser.print(),
56434
+ () => document2.printDocument(),
56359
56435
  () => ({ isEnabled: true })
56360
56436
  ),
56361
56437
  copy: actionCommand(
@@ -57443,6 +57519,7 @@ function buildEssentialsDocument(options) {
57443
57519
  openEquationDialog: () => options.openEquationDialog(),
57444
57520
  exportDocx: () => void options.docIO.handleExportDocx(),
57445
57521
  exportPdf: () => void options.docIO.handleExportPdf(),
57522
+ printDocument: () => void options.docIO.handlePrint(),
57446
57523
  importDocument: () => {
57447
57524
  var _a;
57448
57525
  return (_a = options.importInputRef()) == null ? void 0 : _a.click();
@@ -57488,7 +57565,6 @@ function buildEssentialsImage(options) {
57488
57565
  }
57489
57566
  function buildEssentialsBrowser() {
57490
57567
  return {
57491
- print: () => window.print(),
57492
57568
  copy: () => {
57493
57569
  document.execCommand("copy");
57494
57570
  }
@@ -5,15 +5,18 @@ export interface DocumentExporterDeps {
5
5
  document: () => EditorDocument;
6
6
  focusInput: () => void;
7
7
  download?: (blob: Blob, filename: string) => void;
8
+ print?: (blob: Blob) => Promise<void> | void;
8
9
  }
9
10
  /**
10
- * Creates a document exporter with support for .docx and .pdf output.
11
+ * Creates a document exporter with support for .docx and .pdf output, plus
12
+ * printing the document via the same PDF pipeline.
11
13
  * @param deps - The dependencies required for exporting.
12
- * @returns An object with export methods.
14
+ * @returns An object with export/print methods.
13
15
  */
14
16
  export declare function createDocumentExporter(deps: DocumentExporterDeps): {
15
17
  handleExportDocx: () => Promise<Blob>;
16
18
  handleExportPdf: () => Promise<Blob>;
19
+ handlePrint: () => Promise<Blob>;
17
20
  exportDocxBlob: () => Promise<Blob>;
18
21
  exportPdfBlob: () => Promise<Blob>;
19
22
  };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Prints a PDF blob using a hidden iframe so the browser's native print
3
+ * dialog renders the document itself (not the editor chrome around it).
4
+ */
5
+ export declare function printBlob(blob: Blob): Promise<void>;
@@ -25,6 +25,7 @@ declare function createEditorDocumentIOImpl(deps: UseEditorDocumentIOProps): {
25
25
  handleImportFile: (file: File | null) => Promise<void>;
26
26
  handleExportDocx: () => Promise<Blob>;
27
27
  handleExportPdf: () => Promise<Blob>;
28
+ handlePrint: () => Promise<Blob>;
28
29
  exportDocxBlob: () => Promise<Blob>;
29
30
  exportPdfBlob: () => Promise<Blob>;
30
31
  insertImageFromFile: (file: File, position?: EditorPosition | null) => Promise<void>;
@@ -486,6 +486,7 @@ export declare const en: {
486
486
  "image.borderDash.lgDashDotDot": string;
487
487
  "toolbar.exportDocx": string;
488
488
  "toolbar.exportPdf": string;
489
+ "toolbar.print": string;
489
490
  "underline.style.single": string;
490
491
  "underline.style.double": string;
491
492
  "underline.style.thick": string;
@@ -486,6 +486,7 @@ export declare const ptBR: {
486
486
  "image.borderDash.lgDashDotDot": string;
487
487
  "toolbar.exportDocx": string;
488
488
  "toolbar.exportPdf": string;
489
+ "toolbar.print": string;
489
490
  "underline.style.single": string;
490
491
  "underline.style.double": string;
491
492
  "underline.style.thick": string;
@@ -1940,6 +1940,7 @@ const en = {
1940
1940
  // Export
1941
1941
  "toolbar.exportDocx": "Export DOCX",
1942
1942
  "toolbar.exportPdf": "Export PDF",
1943
+ "toolbar.print": "Print",
1943
1944
  "underline.style.single": "Single",
1944
1945
  "underline.style.double": "Double",
1945
1946
  "underline.style.thick": "Thick",
@@ -2588,6 +2589,7 @@ const ptBR = {
2588
2589
  // Export
2589
2590
  "toolbar.exportDocx": "Exportar DOCX",
2590
2591
  "toolbar.exportPdf": "Exportar PDF",
2592
+ "toolbar.print": "Imprimir",
2591
2593
  "underline.style.single": "Simples",
2592
2594
  "underline.style.double": "Duplo",
2593
2595
  "underline.style.thick": "Espesso",
@@ -2863,7 +2865,7 @@ function OasisEditorAppLazy(props = {}) {
2863
2865
  onCleanup(() => {
2864
2866
  cancelled = true;
2865
2867
  });
2866
- import("./OasisEditorApp-CJAWBsvO.js").then((m) => {
2868
+ import("./OasisEditorApp-CQRNpkya.js").then((m) => {
2867
2869
  cancelled = true;
2868
2870
  setProgress(1);
2869
2871
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -55908,6 +55910,7 @@ const RIBBON_PLACEMENTS = {
55908
55910
  "editor-toolbar-new-document": { tab: "file", group: "document", row: 1 },
55909
55911
  "editor-toolbar-export-docx": { tab: "file", group: "document", row: 1 },
55910
55912
  "editor-toolbar-export-pdf": { tab: "file", group: "document", row: 1 },
55913
+ "editor-toolbar-print": { tab: "file", group: "document", row: 1 },
55911
55914
  "editor-toolbar-import-document": { tab: "file", group: "document", row: 1 },
55912
55915
  "editor-toolbar-undo": { tab: "home", group: "clipboard", row: 1 },
55913
55916
  "editor-toolbar-redo": { tab: "home", group: "clipboard", row: 2 },
@@ -56462,6 +56465,16 @@ function createDefaultToolbarPreset(t) {
56462
56465
  command: "exportPdf",
56463
56466
  ribbonSize: "large"
56464
56467
  });
56468
+ items.push({
56469
+ type: "button",
56470
+ id: "editor-toolbar-print",
56471
+ testId: "editor-toolbar-print",
56472
+ iconName: "printer",
56473
+ labelKey: "toolbar.print",
56474
+ tooltipKey: "toolbar.print",
56475
+ command: "print",
56476
+ ribbonSize: "large"
56477
+ });
56465
56478
  items.push({
56466
56479
  type: "button",
56467
56480
  id: "editor-toolbar-undo",
@@ -57002,6 +57015,7 @@ const OASIS_TOOLBAR_ITEMS = {
57002
57015
  importDocument: "editor-toolbar-import-document",
57003
57016
  exportDocx: "editor-toolbar-export-docx",
57004
57017
  exportPdf: "editor-toolbar-export-pdf",
57018
+ print: "editor-toolbar-print",
57005
57019
  undo: "editor-toolbar-undo",
57006
57020
  redo: "editor-toolbar-redo",
57007
57021
  style: "editor-toolbar-style",
@@ -1,4 +1,4 @@
1
- import { dN, ah, aw, aM, aG, dO, dP, dQ, aA, dR, ai, dS, dw, aN, dT, dU, aL, aD, dV, dW, dX, ag, dY, du, aP, dZ, d_, d$, e0, e1, dI, e2, e3, e4, aU, aT, e5, aE, e6, e7, e8, e9, ea, eb, aI, aF, ec, b3, aO, b2, aV, az, aK, dH, ed, dO as dO2, dV as dV2, dY as dY2, e5 as e52, e6 as e62, eb as eb2, ee, ef, dy, dt, eg, eh, ei, ej, ek, el, em, dv, en, eo, ep, eq, er, dx, es, et } from "./index-DfpqJDWD.js";
1
+ import { dN, ah, aw, aM, aG, dO, dP, dQ, aA, dR, ai, dS, dw, aN, dT, dU, aL, aD, dV, dW, dX, ag, dY, du, aP, dZ, d_, d$, e0, e1, dI, e2, e3, e4, aU, aT, e5, aE, e6, e7, e8, e9, ea, eb, aI, aF, ec, b3, aO, b2, aV, az, aK, dH, ed, dO as dO2, dV as dV2, dY as dY2, e5 as e52, e6 as e62, eb as eb2, ee, ef, dy, dt, eg, eh, ei, ej, ek, el, em, dv, en, eo, ep, eq, er, dx, es, et } from "./index-K-7FcXvb.js";
2
2
  export {
3
3
  dN as ActionRow,
4
4
  ah as BalloonShell,