oasis-editor 0.0.182 → 0.0.183
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.
- package/dist/{OasisEditorApp-BAPDCzny.js → OasisEditorApp-5Ov72yrU.js} +55 -33
- package/dist/core/document/bookmarkAnchors.d.ts +0 -5
- package/dist/core/document/commentAnchors.d.ts +3 -0
- package/dist/core/document/rangeAnchors.d.ts +23 -0
- package/dist/core/model/types/documentComments.d.ts +2 -2
- package/dist/{index-BbOqOr2T.js → index-vDrr-EGA.js} +1 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/package.json +1 -1
|
@@ -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-
|
|
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-vDrr-EGA.js";
|
|
5
5
|
function projectHeaderFooterBlocksWithDependencies(blocks, deps, context = {}) {
|
|
6
6
|
const {
|
|
7
7
|
pageIndex,
|
|
@@ -27406,18 +27406,18 @@ function buildStream(paragraphs) {
|
|
|
27406
27406
|
return { text: parts.join("\n"), spans, baseById };
|
|
27407
27407
|
}
|
|
27408
27408
|
function commonPrefixLength(a, b, max) {
|
|
27409
|
-
let
|
|
27410
|
-
while (
|
|
27411
|
-
|
|
27409
|
+
let index = 0;
|
|
27410
|
+
while (index < max && a.charCodeAt(index) === b.charCodeAt(index)) {
|
|
27411
|
+
index += 1;
|
|
27412
27412
|
}
|
|
27413
|
-
return
|
|
27413
|
+
return index;
|
|
27414
27414
|
}
|
|
27415
27415
|
function commonSuffixLength(a, b, max) {
|
|
27416
|
-
let
|
|
27417
|
-
while (
|
|
27418
|
-
|
|
27416
|
+
let index = 0;
|
|
27417
|
+
while (index < max && a.charCodeAt(a.length - 1 - index) === b.charCodeAt(b.length - 1 - index)) {
|
|
27418
|
+
index += 1;
|
|
27419
27419
|
}
|
|
27420
|
-
return
|
|
27420
|
+
return index;
|
|
27421
27421
|
}
|
|
27422
27422
|
function clamp(value, min, max) {
|
|
27423
27423
|
return value < min ? min : value > max ? max : value;
|
|
@@ -27443,23 +27443,23 @@ function locate(globalOffset, spans) {
|
|
|
27443
27443
|
const last = spans[spans.length - 1];
|
|
27444
27444
|
return { paragraphId: last.id, offset: last.length };
|
|
27445
27445
|
}
|
|
27446
|
-
function
|
|
27446
|
+
function transformTextRangeRegistryAcrossParagraphEdit(registry, oldParagraphs, newParagraphs) {
|
|
27447
27447
|
const old = buildStream(oldParagraphs);
|
|
27448
27448
|
let relevant = false;
|
|
27449
|
-
for (const id of
|
|
27450
|
-
const
|
|
27451
|
-
if (!
|
|
27452
|
-
if (
|
|
27449
|
+
for (const id of registry.order) {
|
|
27450
|
+
const item = registry.items[id];
|
|
27451
|
+
if (!item) continue;
|
|
27452
|
+
if (item.start && old.baseById.has(item.start.paragraphId) || item.end && old.baseById.has(item.end.paragraphId)) {
|
|
27453
27453
|
relevant = true;
|
|
27454
27454
|
break;
|
|
27455
27455
|
}
|
|
27456
27456
|
}
|
|
27457
27457
|
if (!relevant) {
|
|
27458
|
-
return
|
|
27458
|
+
return registry;
|
|
27459
27459
|
}
|
|
27460
27460
|
const next = buildStream(newParagraphs);
|
|
27461
27461
|
if (old.text === next.text) {
|
|
27462
|
-
return
|
|
27462
|
+
return registry;
|
|
27463
27463
|
}
|
|
27464
27464
|
const oldLength = old.text.length;
|
|
27465
27465
|
const newLength = next.text.length;
|
|
@@ -27488,25 +27488,39 @@ function transformBookmarksAcrossParagraphEdit(bookmarks, oldParagraphs, newPara
|
|
|
27488
27488
|
};
|
|
27489
27489
|
};
|
|
27490
27490
|
let changed = false;
|
|
27491
|
-
const items = { ...
|
|
27492
|
-
for (const id of
|
|
27493
|
-
const
|
|
27494
|
-
if (!
|
|
27495
|
-
let updated =
|
|
27496
|
-
if (
|
|
27497
|
-
const start = remap(
|
|
27498
|
-
if (start !==
|
|
27499
|
-
}
|
|
27500
|
-
if (
|
|
27501
|
-
const end = remap(
|
|
27502
|
-
if (end !==
|
|
27503
|
-
}
|
|
27504
|
-
if (updated !==
|
|
27491
|
+
const items = { ...registry.items };
|
|
27492
|
+
for (const id of registry.order) {
|
|
27493
|
+
const item = registry.items[id];
|
|
27494
|
+
if (!item) continue;
|
|
27495
|
+
let updated = item;
|
|
27496
|
+
if (item.start && old.baseById.has(item.start.paragraphId)) {
|
|
27497
|
+
const start = remap(item.start);
|
|
27498
|
+
if (start !== item.start) updated = { ...updated, start };
|
|
27499
|
+
}
|
|
27500
|
+
if (item.end && old.baseById.has(item.end.paragraphId)) {
|
|
27501
|
+
const end = remap(item.end);
|
|
27502
|
+
if (end !== item.end) updated = { ...updated, end };
|
|
27503
|
+
}
|
|
27504
|
+
if (updated !== item) {
|
|
27505
27505
|
items[id] = updated;
|
|
27506
27506
|
changed = true;
|
|
27507
27507
|
}
|
|
27508
27508
|
}
|
|
27509
|
-
return changed ? { ...
|
|
27509
|
+
return changed ? { ...registry, items } : registry;
|
|
27510
|
+
}
|
|
27511
|
+
function transformBookmarksAcrossParagraphEdit(bookmarks, oldParagraphs, newParagraphs) {
|
|
27512
|
+
return transformTextRangeRegistryAcrossParagraphEdit(
|
|
27513
|
+
bookmarks,
|
|
27514
|
+
oldParagraphs,
|
|
27515
|
+
newParagraphs
|
|
27516
|
+
);
|
|
27517
|
+
}
|
|
27518
|
+
function transformCommentsAcrossParagraphEdit(comments, oldParagraphs, newParagraphs) {
|
|
27519
|
+
return transformTextRangeRegistryAcrossParagraphEdit(
|
|
27520
|
+
comments,
|
|
27521
|
+
oldParagraphs,
|
|
27522
|
+
newParagraphs
|
|
27523
|
+
);
|
|
27510
27524
|
}
|
|
27511
27525
|
function blocksContainTables(nodes) {
|
|
27512
27526
|
for (const node of nodes) {
|
|
@@ -27609,17 +27623,25 @@ function cloneStateWithParagraphs(state, paragraphs, selection) {
|
|
|
27609
27623
|
const updatedSections = [...sections];
|
|
27610
27624
|
updatedSections[sectionIndex] = updatedSection;
|
|
27611
27625
|
const bookmarks = state.document.bookmarks;
|
|
27626
|
+
const oldParagraphs = getParagraphs(state);
|
|
27612
27627
|
const nextBookmarks = bookmarks && bookmarks.order.length > 0 ? transformBookmarksAcrossParagraphEdit(
|
|
27613
27628
|
bookmarks,
|
|
27614
|
-
|
|
27629
|
+
oldParagraphs,
|
|
27615
27630
|
paragraphs
|
|
27616
27631
|
) : bookmarks;
|
|
27632
|
+
const comments = state.document.comments;
|
|
27633
|
+
const nextComments = comments && comments.order.length > 0 ? transformCommentsAcrossParagraphEdit(
|
|
27634
|
+
comments,
|
|
27635
|
+
oldParagraphs,
|
|
27636
|
+
paragraphs
|
|
27637
|
+
) : comments;
|
|
27617
27638
|
return {
|
|
27618
27639
|
...state,
|
|
27619
27640
|
document: {
|
|
27620
27641
|
...state.document,
|
|
27621
27642
|
sections: updatedSections,
|
|
27622
|
-
...nextBookmarks !== bookmarks ? { bookmarks: nextBookmarks } : {}
|
|
27643
|
+
...nextBookmarks !== bookmarks ? { bookmarks: nextBookmarks } : {},
|
|
27644
|
+
...nextComments !== comments ? { comments: nextComments } : {}
|
|
27623
27645
|
},
|
|
27624
27646
|
selection
|
|
27625
27647
|
};
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { EditorBookmarks, EditorParagraphNode } from '../model.js';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Remap every bookmark anchor that lives in `oldParagraphs` to its new position
|
|
5
|
-
* in `newParagraphs`. Anchors whose paragraph is not part of this zone are left
|
|
6
|
-
* untouched. Returns the same registry instance when nothing changed.
|
|
7
|
-
*/
|
|
8
3
|
export declare function transformBookmarksAcrossParagraphEdit(bookmarks: EditorBookmarks, oldParagraphs: EditorParagraphNode[], newParagraphs: EditorParagraphNode[]): EditorBookmarks;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EditorParagraphNode } from '../model.js';
|
|
2
|
+
|
|
3
|
+
interface TextRangeAnchor {
|
|
4
|
+
paragraphId: string;
|
|
5
|
+
offset: number;
|
|
6
|
+
seq?: number;
|
|
7
|
+
}
|
|
8
|
+
interface TextRangeItem {
|
|
9
|
+
start?: TextRangeAnchor;
|
|
10
|
+
end?: TextRangeAnchor;
|
|
11
|
+
}
|
|
12
|
+
interface TextRangeRegistry {
|
|
13
|
+
items: Record<string, TextRangeItem>;
|
|
14
|
+
order: string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Remap document-level text ranges across one paragraph edit. The edited zone
|
|
18
|
+
* is linearized with paragraph-break sentinels, so typing, deletion and
|
|
19
|
+
* split/merge operations share one exact mapping path. Registries/items that do
|
|
20
|
+
* not change retain identity for structural sharing.
|
|
21
|
+
*/
|
|
22
|
+
export declare function transformTextRangeRegistryAcrossParagraphEdit<Registry extends TextRangeRegistry>(registry: Registry, oldParagraphs: EditorParagraphNode[], newParagraphs: EditorParagraphNode[]): Registry;
|
|
23
|
+
export {};
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* `word/comments.xml` — modeled like footnotes/endnotes.
|
|
10
10
|
*
|
|
11
11
|
* This is the import/display/export representation: faithful round-trip plus a
|
|
12
|
-
* highlighted range and a hover/click popup.
|
|
13
|
-
*
|
|
12
|
+
* highlighted range and a hover/click popup. Range anchors stay live across
|
|
13
|
+
* paragraph edits; comment authoring commands remain a separate concern.
|
|
14
14
|
*/
|
|
15
15
|
export interface EditorCommentAnchor {
|
|
16
16
|
/** Id of the paragraph this anchor lives in (`EditorParagraphNode.id`). */
|
|
@@ -2863,7 +2863,7 @@ function OasisEditorAppLazy(props = {}) {
|
|
|
2863
2863
|
onCleanup(() => {
|
|
2864
2864
|
cancelled = true;
|
|
2865
2865
|
});
|
|
2866
|
-
import("./OasisEditorApp-
|
|
2866
|
+
import("./OasisEditorApp-5Ov72yrU.js").then((m) => {
|
|
2867
2867
|
cancelled = true;
|
|
2868
2868
|
setProgress(1);
|
|
2869
2869
|
setTimeout(() => setApp(() => m.OasisEditorApp), 180);
|
package/dist/oasis-editor.js
CHANGED
|
@@ -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-
|
|
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-vDrr-EGA.js";
|
|
2
2
|
export {
|
|
3
3
|
dN as ActionRow,
|
|
4
4
|
ah as BalloonShell,
|