oasis-editor 0.0.110 → 0.0.112

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 { d as domTextMeasurer, g as getProjectedParagraphBlockHeight, e as estimateTableBlockHeight, p as projectParagraphLayout, a as getPageContentWidth, b as getPageBodyTop, c as getPageBodyBottom, l as listReferencedEndnotes, f as getFootnoteDisplayMarker, s as setActiveHyphenation, h as getDocumentSections, i as buildFootnoteReservations, M as MAX_FOOTNOTE_LAYOUT_ITERATIONS, r as reservationSignature, j as applyFootnotesToPages, k as getRunField, m as projectBlocksLayout, v as visitRun, n as assertNever, o as createSignal, q as createEditorStateFromDocument, t as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, u as fontSizePxToPt, w as probeLocalFontFamilies, x as createEditorParagraphFromRuns, y as isInlineObjectRun, z as createEditorStyledRun, A as getParagraphLength, B as getParagraphText, C as getActiveZone, D as getActiveSectionIndex, E as getParagraphs, F as normalizeSelection, G as positionToParagraphOffset, H as paragraphOffsetToPosition, I as clampPosition, J as findParagraphIndex, K as createCollapsedSelection, L as isSelectionCollapsed, N as parseFontSizePtToPx, O as formatFontSizePt, P as createEditorParagraph, Q as getBlockParagraphs, R as findParagraphTableLocation, T as buildTableCellLayout, U as PT_PER_PX, V as createEditorTableCell, W as createEditorTableRow, X as createEditorTable, Y as underlineStyleToCssDecorationStyle, Z as resolveImageSrc, _ as listKindForTag, $ as isParagraphTag, a0 as collectInlineRuns, a1 as parseParagraphStyle, a2 as getRunImage, a3 as InlineShell, a4 as BalloonShell, a5 as DocumentShell, a6 as createMemo, a7 as getCaretRectFromSnapshot, a8 as getParagraphRectFromSnapshot, a9 as createComponent, aa as CaretOverlay, ab as Show, ac as createRenderEffect, ad as style, ae as setAttribute, af as setStyleProperty, ag as memo, ah as template, ai as useI18n, aj as createEffect, ak as insert, al as use, am as addEventListener, an as Dialog, ao as delegateEvents, ap as className, aq as For, ar as UNDERLINE_STYLE_OPTIONS, as as Tabs, at as onMount, au as onCleanup, av as PluginUiHost, aw as OasisEditorEditor, ax as OasisBrandMark, ay as setPreciseFontPreference, az as setWelcomeSeen, aA as enablePreciseFontMode, aB as TWIPS_PER_POINT, aC as PX_PER_INCH, aD as TWIPS_PER_INCH, aE as normalizeHex6, aF as resolveEffectiveParagraphStyle, aG as resolveEffectiveTextStyleForParagraph, aH as EMU_PER_PT, aI as OOXML_ROTATION_UNITS, aJ as OOXML_PERCENT_DENOMINATOR, aK as parseHexColorToRgb255, aL as EMU_PER_PX, aM as getRunFootnoteReference, aN as getRunEndnoteReference, aO as iterateFootnoteReferenceRuns, aP as iterateEndnoteReferenceRuns, aQ as imageContentTypeDefaults, aR as getRunFieldChar, aS as getRunFieldInstruction, aT as createEditorRun, aU as JSZip, aV as imageExtensionFromMime, aW as pxToPt$1, aX as resolveFloatingObjectRect, aY as getTextBoxFloatingGeometry, aZ as getPresetPathSegments, a_ as buildListLabels, a$ as getImageFloatingGeometry, b0 as textStyleToFontSizePt, b1 as PX_PER_POINT, b2 as DEFAULT_FONT_SIZE_PX, b3 as resolveOpenTypeFeatureTags, b4 as rgb255ToHex, b5 as isDoubleUnderlineStyle, b6 as isWavyUnderlineStyle, b7 as underlineStyleLineWidthPx, b8 as underlineStyleDashArray, b9 as resolveListLabel, ba as getListLabelInset, bb as getAlignedListLabelInset, bc as getParagraphBorderInsets, bd as buildSegmentTable, be as buildCanvasTableLayout, bf as resolveCanvasTableWidth, bg as resolveFloatingTableRect, bh as normalizeFamily, bi as ROBOTO_FONT_FILES, bj as loadFontAsset, bk as OFFICE_COMPAT_FONT_FAMILIES, bl as BinaryReader, bm as buildSfnt, bn as defaultFontDecoderRegistry, bo as SfntFontProgram, bp as collectPdfFontFamilies, bq as outlineFrom, br as getPageHeaderZoneTop, bs as getPageColumnRects, bt as findFootnoteReference, bu as FOOTNOTE_MARKER_GUTTER_PX, bv as resolveImporterForFile, bw as getDocumentSectionsCanonical, bx as getDocumentParagraphsCanonical, by as getDocumentParagraphs, bz as getDocumentPageSettings, bA as getTableCellContentWidthForParagraph, bB as layoutMetricsEpoch, bC as bumpLayoutMetricsEpoch, bD as createCanvasLayoutSnapshotProvider, bE as on, bF as debounce, bG as unwrap, bH as perfTimer, bI as getRunTextBox, bJ as createEditorDocument, bK as resolveResizedDimensions, bL as resolveTextBoxRenderHeight, bM as getToolbarStyleState, bN as getCachedCanvasImage, bO as measureParagraphMinContentWidthPx, bP as getEditableBlocksForZone, bQ as findParagraphLocation, bR as createSectionBoundaryParagraph, bS as normalizePageSettings, bT as DEFAULT_EDITOR_PAGE_SETTINGS, bU as markStart, bV as markEnd, bW as getParagraphEntries, bX as getParagraphById, bY as createEditorFootnote, bZ as createFootnoteReferenceRun, b_ as renumberFootnotes, b$ as getHeadingLevel, c0 as preciseFontModeVersion, c1 as isPreciseFontModeEnabled, c2 as resolveNamedTextStyle, c3 as togglePreciseFontMode, c4 as nextFontSizePt, c5 as previousFontSizePt, c6 as fontSizePtToPx, c7 as createDefaultToolbarPreset, c8 as MenuRegistry, c9 as createToolbarRegistry, ca as Editor, cb as resolveCommandRef, cc as commandRefName, cd as createOasisEditorClient, ce as createEditorZoom, cf as startLongTaskObserver, cg as installGlobalReport, ch as applyStoredPreciseFontPreference, ci as getWelcomeSeen, cj as isLocalFontAccessSupported, ck as EDITOR_SCROLL_PADDING_PX, cl as Toolbar, cm as OasisEditorLoading, cn as I18nProvider, co as createTranslator, cp as createEditorLogger, cq as registerDomStatsSurface } from "./index-DezzFA4l.js";
4
+ import { d as domTextMeasurer, g as getProjectedParagraphBlockHeight, e as estimateTableBlockHeight, p as projectParagraphLayout, a as getPageContentWidth, b as getPageBodyTop, c as getPageBodyBottom, l as listReferencedEndnotes, f as getFootnoteDisplayMarker, s as setActiveHyphenation, h as getDocumentSections, i as buildFootnoteReservations, M as MAX_FOOTNOTE_LAYOUT_ITERATIONS, r as reservationSignature, j as applyFootnotesToPages, k as getRunField, m as projectBlocksLayout, v as visitRun, n as assertNever, o as createSignal, q as createEditorStateFromDocument, t as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, u as fontSizePxToPt, w as probeLocalFontFamilies, x as createEditorParagraphFromRuns, y as isInlineObjectRun, z as createEditorStyledRun, A as getParagraphLength, B as getParagraphText, C as getActiveZone, D as getActiveSectionIndex, E as getParagraphs, F as normalizeSelection, G as positionToParagraphOffset, H as paragraphOffsetToPosition, I as clampPosition, J as findParagraphIndex, K as createCollapsedSelection, L as isSelectionCollapsed, N as parseFontSizePtToPx, O as formatFontSizePt, P as createEditorParagraph, Q as getBlockParagraphs, R as findParagraphTableLocation, T as buildTableCellLayout, U as PT_PER_PX, V as createEditorTableCell, W as createEditorTableRow, X as createEditorTable, Y as underlineStyleToCssDecorationStyle, Z as resolveImageSrc, _ as listKindForTag, $ as isParagraphTag, a0 as collectInlineRuns, a1 as parseParagraphStyle, a2 as getRunImage, a3 as InlineShell, a4 as BalloonShell, a5 as DocumentShell, a6 as createMemo, a7 as getCaretRectFromSnapshot, a8 as getParagraphRectFromSnapshot, a9 as createComponent, aa as CaretOverlay, ab as Show, ac as createRenderEffect, ad as style, ae as setAttribute, af as setStyleProperty, ag as memo, ah as template, ai as useI18n, aj as createEffect, ak as insert, al as use, am as addEventListener, an as Dialog, ao as delegateEvents, ap as className, aq as For, ar as UNDERLINE_STYLE_OPTIONS, as as Tabs, at as onMount, au as onCleanup, av as PluginUiHost, aw as OasisEditorEditor, ax as OasisBrandMark, ay as setPreciseFontPreference, az as setWelcomeSeen, aA as enablePreciseFontMode, aB as TWIPS_PER_POINT, aC as PX_PER_INCH, aD as TWIPS_PER_INCH, aE as normalizeHex6, aF as TABLE_CONDITIONAL_FLAG_ATTRIBUTES, aG as TABLE_BORDER_EDGE_KEYS, aH as resolveEffectiveParagraphStyle, aI as resolveEffectiveTextStyleForParagraph, aJ as EMU_PER_PT, aK as OOXML_ROTATION_UNITS, aL as OOXML_PERCENT_DENOMINATOR, aM as parseHexColorToRgb255, aN as EMU_PER_PX, aO as getRunFootnoteReference, aP as getRunEndnoteReference, aQ as iterateFootnoteReferenceRuns, aR as iterateEndnoteReferenceRuns, aS as imageContentTypeDefaults, aT as getRunFieldChar, aU as getRunFieldInstruction, aV as createEditorRun, aW as JSZip, aX as imageExtensionFromMime, aY as pxToPt$1, aZ as resolveFloatingObjectRect, a_ as getTextBoxFloatingGeometry, a$ as getPresetPathSegments, b0 as buildListLabels, b1 as getImageFloatingGeometry, b2 as textStyleToFontSizePt, b3 as PX_PER_POINT, b4 as DEFAULT_FONT_SIZE_PX, b5 as resolveOpenTypeFeatureTags, b6 as rgb255ToHex, b7 as isDoubleUnderlineStyle, b8 as isWavyUnderlineStyle, b9 as underlineStyleLineWidthPx, ba as underlineStyleDashArray, bb as resolveListLabel, bc as getListLabelInset, bd as getAlignedListLabelInset, be as getParagraphBorderInsets, bf as buildSegmentTable, bg as buildCanvasTableLayout, bh as resolveCanvasTableWidth, bi as resolveFloatingTableRect, bj as normalizeFamily, bk as ROBOTO_FONT_FILES, bl as loadFontAsset, bm as OFFICE_COMPAT_FONT_FAMILIES, bn as BinaryReader, bo as buildSfnt, bp as defaultFontDecoderRegistry, bq as SfntFontProgram, br as collectPdfFontFamilies, bs as outlineFrom, bt as getPageHeaderZoneTop, bu as getPageColumnRects, bv as findFootnoteReference, bw as FOOTNOTE_MARKER_GUTTER_PX, bx as resolveImporterForFile, by as getDocumentSectionsCanonical, bz as getDocumentParagraphsCanonical, bA as getDocumentParagraphs, bB as getDocumentPageSettings, bC as getTableCellContentWidthForParagraph, bD as layoutMetricsEpoch, bE as bumpLayoutMetricsEpoch, bF as createCanvasLayoutSnapshotProvider, bG as on, bH as debounce, bI as unwrap, bJ as perfTimer, bK as getRunTextBox, bL as createEditorDocument, bM as resolveResizedDimensions, bN as resolveTextBoxRenderHeight, bO as getToolbarStyleState, bP as getCachedCanvasImage, 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, b_ as createEditorFootnote, b$ as createFootnoteReferenceRun, c0 as renumberFootnotes, c1 as getHeadingLevel, c2 as preciseFontModeVersion, c3 as isPreciseFontModeEnabled, c4 as resolveNamedTextStyle, c5 as togglePreciseFontMode, c6 as nextFontSizePt, c7 as previousFontSizePt, c8 as fontSizePtToPx, c9 as createDefaultToolbarPreset, ca as MenuRegistry, cb as createToolbarRegistry, cc as Editor, cd as resolveCommandRef, ce as commandRefName, cf as createOasisEditorClient, cg as createEditorZoom, ch as startLongTaskObserver, ci as installGlobalReport, cj as applyStoredPreciseFontPreference, ck as getWelcomeSeen, cl as isLocalFontAccessSupported, cm as EDITOR_SCROLL_PADDING_PX, cn as Toolbar, co as OasisEditorLoading, cp as I18nProvider, cq as createTranslator, cr as createEditorLogger, cs as registerDomStatsSurface } from "./index-AX7m_SeX.js";
5
5
  function projectHeaderFooterBlocksWithDependencies(blocks, deps, context = {}) {
6
6
  const {
7
7
  pageIndex,
@@ -33729,21 +33729,9 @@ function serializeRevisionAttrs(revision) {
33729
33729
  }
33730
33730
  function serializeConditionalFlags(flags) {
33731
33731
  if (!flags || Object.keys(flags).length === 0) return "";
33732
- const attributes = [
33733
- ["firstRow", "firstRow"],
33734
- ["lastRow", "lastRow"],
33735
- ["firstColumn", "firstCol"],
33736
- ["lastColumn", "lastCol"],
33737
- ["oddVBand", "band1Vert"],
33738
- ["evenVBand", "band2Vert"],
33739
- ["oddHBand", "band1Horz"],
33740
- ["evenHBand", "band2Horz"],
33741
- ["firstRowFirstColumn", "nwCell"],
33742
- ["firstRowLastColumn", "neCell"],
33743
- ["lastRowFirstColumn", "swCell"],
33744
- ["lastRowLastColumn", "seCell"]
33745
- ];
33746
- const xml = attributes.filter(([, key]) => flags[key] !== void 0).map(([name, key]) => `w:${name}="${flags[key] ? "1" : "0"}"`).join(" ");
33732
+ const xml = TABLE_CONDITIONAL_FLAG_ATTRIBUTES.filter(
33733
+ ([, key]) => flags[key] !== void 0
33734
+ ).map(([name, key]) => `w:${name}="${flags[key] ? "1" : "0"}"`).join(" ");
33747
33735
  return xml ? `<w:cnfStyle ${xml}/>` : "";
33748
33736
  }
33749
33737
  function serializeOnOffElement(tag, value) {
@@ -34048,15 +34036,10 @@ function serializeFloatingTableProperties(floating) {
34048
34036
  function serializeTableBorders(style2) {
34049
34037
  const borders = style2 == null ? void 0 : style2.borders;
34050
34038
  if (!borders) return "";
34051
- const edges = [
34052
- ["top", borders.borderTop],
34053
- ["left", borders.borderLeft],
34054
- ["bottom", borders.borderBottom],
34055
- ["right", borders.borderRight],
34056
- ["insideH", borders.borderInsideH],
34057
- ["insideV", borders.borderInsideV]
34058
- ];
34059
- const xml = edges.filter((entry) => !!entry[1]).map(([name, border]) => `<w:${name} ${serializeDocxBorderAttrs(border)}`).join("");
34039
+ const xml = TABLE_BORDER_EDGE_KEYS.map(([name, key]) => [
34040
+ name,
34041
+ borders[key]
34042
+ ]).filter((entry) => !!entry[1]).map(([name, border]) => `<w:${name} ${serializeDocxBorderAttrs(border)}`).join("");
34060
34043
  return xml ? `<w:tblBorders>${xml}</w:tblBorders>` : "";
34061
34044
  }
34062
34045
  function serializeTableProperties(table) {
@@ -35529,18 +35512,11 @@ function serializeTableStyleProperties(style2) {
35529
35512
  if (margins) parts.push(`<w:tblCellMar>${margins}</w:tblCellMar>`);
35530
35513
  }
35531
35514
  if (style2.borders) {
35532
- const edges = [
35533
- ["top", style2.borders.borderTop],
35534
- ["left", style2.borders.borderLeft],
35535
- ["bottom", style2.borders.borderBottom],
35536
- ["right", style2.borders.borderRight],
35537
- ["insideH", style2.borders.borderInsideH],
35538
- ["insideV", style2.borders.borderInsideV]
35539
- ];
35540
- const borders = edges.filter(
35541
- (entry) => !!entry[1]
35542
- ).map(([name, border]) => `<w:${name} ${serializeDocxBorderAttrs(border)}`).join("");
35543
- if (borders) parts.push(`<w:tblBorders>${borders}</w:tblBorders>`);
35515
+ const { borders } = style2;
35516
+ const xml = TABLE_BORDER_EDGE_KEYS.filter(([, key]) => !!borders[key]).map(
35517
+ ([name, key]) => `<w:${name} ${serializeDocxBorderAttrs(borders[key])}`
35518
+ ).join("");
35519
+ if (xml) parts.push(`<w:tblBorders>${xml}</w:tblBorders>`);
35544
35520
  }
35545
35521
  return parts.length > 0 ? `<w:tblPr>${parts.join("")}</w:tblPr>` : "";
35546
35522
  }
@@ -41456,38 +41432,11 @@ function insertImageAtSelection(state, image) {
41456
41432
  );
41457
41433
  }
41458
41434
  function resizeSelectedImage(state, width, height) {
41459
- const selectedImage = getSelectedImageRun(state);
41460
- if (!selectedImage) {
41461
- return state;
41462
- }
41463
- const paragraphs = getParagraphs(state);
41464
- const { paragraphIndex, run: targetRun } = selectedImage;
41465
- const nextParagraphs = paragraphs.map((candidate, candidateIndex) => {
41466
- if (candidateIndex !== paragraphIndex) {
41467
- return cloneParagraph(candidate);
41468
- }
41469
- return {
41470
- ...cloneParagraph(candidate),
41471
- runs: candidate.runs.map(
41472
- (run) => run.id === targetRun.id && run.kind === "image" ? {
41473
- ...run,
41474
- image: {
41475
- ...run.image,
41476
- width: Math.max(24, Math.round(width)),
41477
- height: Math.max(24, Math.round(height))
41478
- }
41479
- } : cloneRun(run)
41480
- )
41481
- };
41482
- });
41483
- return cloneStateWithParagraphs(
41484
- state,
41485
- nextParagraphs,
41486
- preserveSelectionByParagraphOffsets(
41487
- nextParagraphs,
41488
- normalizeSelection(state)
41489
- )
41490
- );
41435
+ return patchSelectedImage(state, (image) => ({
41436
+ ...image,
41437
+ width: Math.max(24, Math.round(width)),
41438
+ height: Math.max(24, Math.round(height))
41439
+ }));
41491
41440
  }
41492
41441
  function normalizeRotation$1(rotation) {
41493
41442
  if (!Number.isFinite(rotation)) {
@@ -41497,38 +41446,11 @@ function normalizeRotation$1(rotation) {
41497
41446
  return normalized === 0 ? void 0 : normalized;
41498
41447
  }
41499
41448
  function rotateSelectedImage(state, rotation) {
41500
- const selectedImage = getSelectedImageRun(state);
41501
- if (!selectedImage) {
41502
- return state;
41503
- }
41504
41449
  const nextRotation = normalizeRotation$1(rotation);
41505
- const paragraphs = getParagraphs(state);
41506
- const { paragraphIndex, run: targetRun } = selectedImage;
41507
- const nextParagraphs = paragraphs.map((candidate, candidateIndex) => {
41508
- if (candidateIndex !== paragraphIndex) {
41509
- return cloneParagraph(candidate);
41510
- }
41511
- return {
41512
- ...cloneParagraph(candidate),
41513
- runs: candidate.runs.map(
41514
- (run) => run.id === targetRun.id && run.kind === "image" ? {
41515
- ...run,
41516
- image: {
41517
- ...run.image,
41518
- rotation: nextRotation
41519
- }
41520
- } : cloneRun(run)
41521
- )
41522
- };
41523
- });
41524
- return cloneStateWithParagraphs(
41525
- state,
41526
- nextParagraphs,
41527
- preserveSelectionByParagraphOffsets(
41528
- nextParagraphs,
41529
- normalizeSelection(state)
41530
- )
41531
- );
41450
+ return patchSelectedImage(state, (image) => ({
41451
+ ...image,
41452
+ rotation: nextRotation
41453
+ }));
41532
41454
  }
41533
41455
  function getSelectedImageWrapPreset(state) {
41534
41456
  const selectedImage = getSelectedImageRun(state);
@@ -41543,7 +41465,7 @@ function isSelectedImageFixedPosition(state) {
41543
41465
  const image = selectedImage && getRunImage(selectedImage.run);
41544
41466
  return isFloatingFixedPosition(image == null ? void 0 : image.floating);
41545
41467
  }
41546
- function patchSelectedImageFloating(state, next) {
41468
+ function patchSelectedImage(state, updater) {
41547
41469
  const selectedImage = getSelectedImageRun(state);
41548
41470
  if (!selectedImage || !getRunImage(selectedImage.run)) {
41549
41471
  return state;
@@ -41556,30 +41478,25 @@ function patchSelectedImageFloating(state, next) {
41556
41478
  }
41557
41479
  return {
41558
41480
  ...cloneParagraph(candidate),
41559
- runs: candidate.runs.map((run) => {
41560
- if (run.id !== targetRun.id || run.kind !== "image") {
41561
- return cloneRun(run);
41562
- }
41563
- const floating = next(run.image.floating);
41564
- const image = { ...run.image };
41565
- if (floating) {
41566
- image.floating = floating;
41567
- } else {
41568
- delete image.floating;
41569
- }
41570
- return { ...run, image };
41571
- })
41481
+ runs: candidate.runs.map(
41482
+ (run) => run.id === targetRun.id && run.kind === "image" ? { ...run, image: updater(run.image) } : cloneRun(run)
41483
+ )
41572
41484
  };
41573
41485
  });
41574
41486
  return cloneStateWithParagraphs(
41575
41487
  state,
41576
41488
  nextParagraphs,
41577
- preserveSelectionByParagraphOffsets(
41578
- nextParagraphs,
41579
- normalizeSelection(state)
41580
- )
41489
+ preserveSelectionByParagraphOffsets(nextParagraphs, normalizeSelection(state))
41581
41490
  );
41582
41491
  }
41492
+ function patchSelectedImageFloating(state, next) {
41493
+ return patchSelectedImage(state, (image) => {
41494
+ const floating = next(image.floating);
41495
+ if (floating) return { ...image, floating };
41496
+ const { floating: _removed, ...rest } = image;
41497
+ return rest;
41498
+ });
41499
+ }
41583
41500
  function setSelectedImageWrapPreset(state, preset) {
41584
41501
  return patchSelectedImageFloating(
41585
41502
  state,
@@ -41629,36 +41546,10 @@ function setImageWrapPolygon(state, runId, polygon) {
41629
41546
  );
41630
41547
  }
41631
41548
  function setSelectedImageAlt(state, alt) {
41632
- const selectedImage = getSelectedImageRun(state);
41633
- if (!selectedImage || !getRunImage(selectedImage.run)) {
41634
- return state;
41635
- }
41636
- const paragraphs = getParagraphs(state);
41637
- const nextParagraphs = paragraphs.map((candidate, candidateIndex) => {
41638
- if (candidateIndex !== selectedImage.paragraphIndex) {
41639
- return cloneParagraph(candidate);
41640
- }
41641
- return {
41642
- ...cloneParagraph(candidate),
41643
- runs: candidate.runs.map(
41644
- (run) => run.id === selectedImage.run.id && run.kind === "image" ? {
41645
- ...run,
41646
- image: {
41647
- ...run.image,
41648
- alt: alt ?? void 0
41649
- }
41650
- } : cloneRun(run)
41651
- )
41652
- };
41653
- });
41654
- return cloneStateWithParagraphs(
41655
- state,
41656
- nextParagraphs,
41657
- preserveSelectionByParagraphOffsets(
41658
- nextParagraphs,
41659
- normalizeSelection(state)
41660
- )
41661
- );
41549
+ return patchSelectedImage(state, (image) => ({
41550
+ ...image,
41551
+ alt: alt ?? void 0
41552
+ }));
41662
41553
  }
41663
41554
  function getSelectedImageCaption(state) {
41664
41555
  const selectedImage = getSelectedImageRun(state);