@univerjs/core 0.2.11 → 0.2.13
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/lib/cjs/index.js +5 -5
- package/lib/es/index.js +458 -30
- package/lib/types/common/interceptor.d.ts +1 -0
- package/lib/types/docs/data-model/document-data-model.d.ts +4 -4
- package/lib/types/docs/data-model/index.d.ts +1 -0
- package/lib/types/docs/data-model/text-x/apply-utils/common.d.ts +1 -1
- package/lib/types/docs/data-model/text-x/build-utils/__test__/custom-range.spec.d.ts +16 -0
- package/lib/types/docs/data-model/text-x/build-utils/custom-range.d.ts +14 -0
- package/lib/types/docs/data-model/text-x/build-utils/index.d.ts +28 -0
- package/lib/types/docs/data-model/text-x/build-utils/selection.d.ts +29 -0
- package/lib/types/docs/data-model/text-x/build-utils/text-x-utils.d.ts +38 -0
- package/lib/types/docs/data-model/text-x/utils.d.ts +2 -1
- package/lib/types/services/__tests__/index.d.ts +6 -6
- package/lib/types/services/authz-io/type.d.ts +1 -1
- package/lib/types/services/command/command.service.d.ts +3 -3
- package/lib/types/services/config/config.service.d.ts +20 -7
- package/lib/types/services/context/context.service.d.ts +1 -1
- package/lib/types/services/instance/instance.service.d.ts +1 -1
- package/lib/types/services/local-storage/local-storage.service.d.ts +1 -1
- package/lib/types/services/log/log.service.d.ts +1 -1
- package/lib/types/services/permission/type.d.ts +1 -1
- package/lib/types/services/resource-loader/type.d.ts +1 -1
- package/lib/types/services/resource-manager/type.d.ts +1 -1
- package/lib/types/services/undoredo/undoredo.service.d.ts +1 -1
- package/lib/types/shared/common.d.ts +3 -2
- package/lib/types/shared/tools.d.ts +1 -2
- package/lib/types/sheets/row-manager.d.ts +2 -2
- package/lib/types/sheets/typedef.d.ts +25 -5
- package/lib/types/sheets/view-model.d.ts +1 -1
- package/lib/types/sheets/worksheet.d.ts +13 -7
- package/lib/types/slides/slide-model.d.ts +3 -3
- package/lib/types/types/const/const.d.ts +0 -4
- package/lib/types/types/enum/delete-direction.d.ts +19 -0
- package/lib/types/types/enum/index.d.ts +1 -0
- package/lib/types/types/interfaces/i-data-validation.d.ts +17 -2
- package/lib/types/types/interfaces/i-document-data.d.ts +24 -7
- package/lib/types/types/interfaces/i-need-check-disposable.d.ts +4 -0
- package/lib/types/types/interfaces/index.d.ts +1 -0
- package/lib/umd/index.js +5 -5
- package/package.json +5 -5
package/lib/es/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
|
|
5
5
|
import { Subject, BehaviorSubject, Observable, filter, merge, timer, map, distinctUntilChanged, skip, of, combineLatest } from "rxjs";
|
|
6
6
|
import { filter as filter$1, debounceTime, first, map as map$1 } from "rxjs/operators";
|
|
7
|
-
import { Tools as Tools$1, normalizeTextRuns as normalizeTextRuns$1 } from "@univerjs/core";
|
|
7
|
+
import { Tools as Tools$1, normalizeTextRuns as normalizeTextRuns$1, generateRandomId as generateRandomId$1, DataStreamTreeTokenType as DataStreamTreeTokenType$1 } from "@univerjs/core";
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import React__default, { useState, useEffect, useRef, useMemo, createContext, useCallback, useContext } from "react";
|
|
10
10
|
function _mergeNamespaces(n, m) {
|
|
@@ -110,7 +110,7 @@ function getReverseDirection(direction) {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
__name(getReverseDirection, "getReverseDirection");
|
|
113
|
-
var FormatType = /* @__PURE__ */ ((FormatType2) => (FormatType2[FormatType2.NUMBER_FORMAT_TYPE_UNSPECIFIED = 0] = "NUMBER_FORMAT_TYPE_UNSPECIFIED", FormatType2[FormatType2.TEXT = 1] = "TEXT", FormatType2[FormatType2.NUMBER = 2] = "NUMBER", FormatType2[FormatType2.PERCENT = 3] = "PERCENT", FormatType2[FormatType2.CURRENCY = 4] = "CURRENCY", FormatType2[FormatType2.DATE = 5] = "DATE", FormatType2[FormatType2.TIME = 6] = "TIME", FormatType2[FormatType2.DATE_TIME = 7] = "DATE_TIME", FormatType2[FormatType2.SCIENTIFIC = 8] = "SCIENTIFIC", FormatType2))(FormatType || {}), InterpolationPointType = /* @__PURE__ */ ((InterpolationPointType2) => (InterpolationPointType2[InterpolationPointType2.INTERPOLATION_POINT_TYPE_UNSPECIFIED = 0] = "INTERPOLATION_POINT_TYPE_UNSPECIFIED", InterpolationPointType2[InterpolationPointType2.MIN = 1] = "MIN", InterpolationPointType2[InterpolationPointType2.MAX = 2] = "MAX", InterpolationPointType2[InterpolationPointType2.NUMBER = 3] = "NUMBER", InterpolationPointType2[InterpolationPointType2.PERCENT = 4] = "PERCENT", InterpolationPointType2[InterpolationPointType2.PERCENTILE = 5] = "PERCENTILE", InterpolationPointType2))(InterpolationPointType || {}), LocaleType = /* @__PURE__ */ ((LocaleType2) => (LocaleType2.EN_US = "enUS", LocaleType2.ZH_CN = "zhCN", LocaleType2.RU_RU = "ruRU", LocaleType2.ZH_TW = "zhTW", LocaleType2.VI_VN = "viVN", LocaleType2))(LocaleType || {}), ProtectionType = /* @__PURE__ */ ((ProtectionType2) => (ProtectionType2[ProtectionType2.RANGE = 0] = "RANGE", ProtectionType2[ProtectionType2.SHEET = 1] = "SHEET", ProtectionType2))(ProtectionType || {}), RelativeDate = /* @__PURE__ */ ((RelativeDate2) => (RelativeDate2[RelativeDate2.RELATIVE_DATE_UNSPECIFIED = 0] = "RELATIVE_DATE_UNSPECIFIED", RelativeDate2[RelativeDate2.PAST_YEAR = 1] = "PAST_YEAR", RelativeDate2[RelativeDate2.PAST_MONTH = 2] = "PAST_MONTH", RelativeDate2[RelativeDate2.PAST_WEEK = 3] = "PAST_WEEK", RelativeDate2[RelativeDate2.YESTERDAY = 4] = "YESTERDAY", RelativeDate2[RelativeDate2.TODAY = 5] = "TODAY", RelativeDate2[RelativeDate2.TOMORROW = 6] = "TOMORROW", RelativeDate2))(RelativeDate || {}), SheetTypes = /* @__PURE__ */ ((SheetTypes2) => (SheetTypes2[SheetTypes2.GRID = 0] = "GRID", SheetTypes2[SheetTypes2.KANBAN = 1] = "KANBAN", SheetTypes2[SheetTypes2.GANTT = 2] = "GANTT", SheetTypes2))(SheetTypes || {}), TextDirection = /* @__PURE__ */ ((TextDirection2) => (TextDirection2[TextDirection2.UNSPECIFIED = 0] = "UNSPECIFIED", TextDirection2[TextDirection2.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", TextDirection2[TextDirection2.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", TextDirection2))(TextDirection || {}), TextDecoration = /* @__PURE__ */ ((TextDecoration2) => (TextDecoration2[TextDecoration2.DASH = 0] = "DASH", TextDecoration2[TextDecoration2.DASH_DOT_DOT_HEAVY = 1] = "DASH_DOT_DOT_HEAVY", TextDecoration2[TextDecoration2.DASH_DOT_HEAVY = 2] = "DASH_DOT_HEAVY", TextDecoration2[TextDecoration2.DASHED_HEAVY = 3] = "DASHED_HEAVY", TextDecoration2[TextDecoration2.DASH_LONG = 4] = "DASH_LONG", TextDecoration2[TextDecoration2.DASH_LONG_HEAVY = 5] = "DASH_LONG_HEAVY", TextDecoration2[TextDecoration2.DOT_DASH = 6] = "DOT_DASH", TextDecoration2[TextDecoration2.DOT_DOT_DASH = 7] = "DOT_DOT_DASH", TextDecoration2[TextDecoration2.DOTTED = 8] = "DOTTED", TextDecoration2[TextDecoration2.DOTTED_HEAVY = 9] = "DOTTED_HEAVY", TextDecoration2[TextDecoration2.DOUBLE = 10] = "DOUBLE", TextDecoration2[TextDecoration2.NONE = 11] = "NONE", TextDecoration2[TextDecoration2.SINGLE = 12] = "SINGLE", TextDecoration2[TextDecoration2.THICK = 13] = "THICK", TextDecoration2[TextDecoration2.WAVE = 14] = "WAVE", TextDecoration2[TextDecoration2.WAVY_DOUBLE = 15] = "WAVY_DOUBLE", TextDecoration2[TextDecoration2.WAVY_HEAVY = 16] = "WAVY_HEAVY", TextDecoration2[TextDecoration2.WORDS = 17] = "WORDS", TextDecoration2))(TextDecoration || {}), HorizontalAlign = /* @__PURE__ */ ((HorizontalAlign2) => (HorizontalAlign2[HorizontalAlign2.UNSPECIFIED = 0] = "UNSPECIFIED", HorizontalAlign2[HorizontalAlign2.LEFT = 1] = "LEFT", HorizontalAlign2[HorizontalAlign2.CENTER = 2] = "CENTER", HorizontalAlign2[HorizontalAlign2.RIGHT = 3] = "RIGHT", HorizontalAlign2[HorizontalAlign2.JUSTIFIED = 4] = "JUSTIFIED", HorizontalAlign2[HorizontalAlign2.BOTH = 5] = "BOTH", HorizontalAlign2[HorizontalAlign2.DISTRIBUTED = 6] = "DISTRIBUTED", HorizontalAlign2))(HorizontalAlign || {}), VerticalAlign = /* @__PURE__ */ ((VerticalAlign2) => (VerticalAlign2[VerticalAlign2.UNSPECIFIED = 0] = "UNSPECIFIED", VerticalAlign2[VerticalAlign2.TOP = 1] = "TOP", VerticalAlign2[VerticalAlign2.MIDDLE = 2] = "MIDDLE", VerticalAlign2[VerticalAlign2.BOTTOM = 3] = "BOTTOM", VerticalAlign2))(VerticalAlign || {}), WrapStrategy = /* @__PURE__ */ ((WrapStrategy2) => (WrapStrategy2[WrapStrategy2.UNSPECIFIED = 0] = "UNSPECIFIED", WrapStrategy2[WrapStrategy2.OVERFLOW = 1] = "OVERFLOW", WrapStrategy2[WrapStrategy2.CLIP = 2] = "CLIP", WrapStrategy2[WrapStrategy2.WRAP = 3] = "WRAP", WrapStrategy2))(WrapStrategy || {}), FontItalic = /* @__PURE__ */ ((FontItalic2) => (FontItalic2[FontItalic2.NORMAL = 0] = "NORMAL", FontItalic2[FontItalic2.ITALIC = 1] = "ITALIC", FontItalic2))(FontItalic || {}), FontWeight = /* @__PURE__ */ ((FontWeight2) => (FontWeight2[FontWeight2.NORMAL = 0] = "NORMAL", FontWeight2[FontWeight2.BOLD = 1] = "BOLD", FontWeight2))(FontWeight || {}), BaselineOffset = /* @__PURE__ */ ((BaselineOffset2) => (BaselineOffset2[BaselineOffset2.NORMAL = 1] = "NORMAL", BaselineOffset2[BaselineOffset2.SUBSCRIPT = 2] = "SUBSCRIPT", BaselineOffset2[BaselineOffset2.SUPERSCRIPT = 3] = "SUPERSCRIPT", BaselineOffset2))(BaselineOffset || {}), BooleanNumber = /* @__PURE__ */ ((BooleanNumber2) => (BooleanNumber2[BooleanNumber2.FALSE = 0] = "FALSE", BooleanNumber2[BooleanNumber2.TRUE = 1] = "TRUE", BooleanNumber2))(BooleanNumber || {}), CellValueType = /* @__PURE__ */ ((CellValueType2) => (CellValueType2[CellValueType2.STRING = 1] = "STRING", CellValueType2[CellValueType2.NUMBER = 2] = "NUMBER", CellValueType2[CellValueType2.BOOLEAN = 3] = "BOOLEAN", CellValueType2[CellValueType2.FORCE_STRING = 4] = "FORCE_STRING", CellValueType2))(CellValueType || {}), ThemeColorType = /* @__PURE__ */ ((ThemeColorType2) => (ThemeColorType2[ThemeColorType2.DARK1 = 0] = "DARK1", ThemeColorType2[ThemeColorType2.LIGHT1 = 1] = "LIGHT1", ThemeColorType2[ThemeColorType2.DARK2 = 2] = "DARK2", ThemeColorType2[ThemeColorType2.LIGHT2 = 3] = "LIGHT2", ThemeColorType2[ThemeColorType2.ACCENT1 = 4] = "ACCENT1", ThemeColorType2[ThemeColorType2.ACCENT2 = 5] = "ACCENT2", ThemeColorType2[ThemeColorType2.ACCENT3 = 6] = "ACCENT3", ThemeColorType2[ThemeColorType2.ACCENT4 = 7] = "ACCENT4", ThemeColorType2[ThemeColorType2.ACCENT5 = 8] = "ACCENT5", ThemeColorType2[ThemeColorType2.ACCENT6 = 9] = "ACCENT6", ThemeColorType2[ThemeColorType2.HYPERLINK = 10] = "HYPERLINK", ThemeColorType2[ThemeColorType2.FOLLOWED_HYPERLINK = 11] = "FOLLOWED_HYPERLINK", ThemeColorType2))(ThemeColorType || {}), ThemeColors = /* @__PURE__ */ ((ThemeColors2) => (ThemeColors2.OFFICE = "Office", ThemeColors2.OFFICE_2007_2010 = "Office 2007-2010", ThemeColors2.GRAYSCALE = "Grayscale", ThemeColors2.BLUE_WARM = "Blue Warm", ThemeColors2.BLUE = "Blue", ThemeColors2.BLUE_II = "Blue II", ThemeColors2.BLUE_GREEN = "Blue Green", ThemeColors2.GREEN = "Green", ThemeColors2.GREEN_YELLOW = "Green Yellow", ThemeColors2.YELLOW = "Yellow", ThemeColors2.YELLOW_ORANGE = "Yellow Orange", ThemeColors2.ORANGE = "Orange", ThemeColors2.ORANGE_RED = "Orange Red", ThemeColors2.RED_ORANGE = "Red Orange", ThemeColors2.RED = "Red", ThemeColors2.RED_VIOLET = "Red Violet", ThemeColors2.VIOLET = "Violet", ThemeColors2.VIOLET_II = "Violet II", ThemeColors2.MEDIAN = "Median", ThemeColors2.PAPER = "Paper", ThemeColors2.MARQUEE = "Marquee", ThemeColors2.SLIPSTREAM = "Slipstream", ThemeColors2.Aspect = "Aspect", ThemeColors2))(ThemeColors || {}), BasicShapes = /* @__PURE__ */ ((BasicShapes2) => (BasicShapes2.Line = "line", BasicShapes2.LineInv = "lineInv", BasicShapes2.Triangle = "triangle", BasicShapes2.RtTriangle = "rtTriangle", BasicShapes2.Rect = "rect", BasicShapes2.Diamond = "diamond", BasicShapes2.Parallelogram = "parallelogram", BasicShapes2.Trapezoid = "trapezoid", BasicShapes2.NonIsocelesTrapezoid = "nonIsocelesTrapezoid", BasicShapes2.Pentagon = "pentagon", BasicShapes2.Hexagon = "hexagon", BasicShapes2.Heptagon = "heptagon", BasicShapes2.Octagon = "octagon", BasicShapes2.Decagon = "decagon", BasicShapes2.Dodecagon = "dodecagon", BasicShapes2.Star4 = "star4", BasicShapes2.Star5 = "star5", BasicShapes2.Star6 = "star6", BasicShapes2.Star7 = "star7", BasicShapes2.Star8 = "star8", BasicShapes2.Star10 = "star10", BasicShapes2.Star12 = "star12", BasicShapes2.Star16 = "star16", BasicShapes2.Star24 = "star24", BasicShapes2.Star32 = "star32", BasicShapes2.RoundRect = "roundRect", BasicShapes2.Round1Rect = "round1Rect", BasicShapes2.Round2SameRect = "round2SameRect", BasicShapes2.Round2DiagRect = "round2DiagRect", BasicShapes2.Ellipse = "ellipse", BasicShapes2))(BasicShapes || {}), ArrowsAndMarkersShapes = /* @__PURE__ */ ((ArrowsAndMarkersShapes2) => (ArrowsAndMarkersShapes2.RightArrow = "rightArrow", ArrowsAndMarkersShapes2.LeftArrow = "leftArrow", ArrowsAndMarkersShapes2.UpArrow = "upArrow", ArrowsAndMarkersShapes2.DownArrow = "downArrow", ArrowsAndMarkersShapes2.LeftRightArrow = "leftRightArrow", ArrowsAndMarkersShapes2.UpDownArrow = "upDownArrow", ArrowsAndMarkersShapes2.QuadArrow = "quadArrow", ArrowsAndMarkersShapes2.LeftRightUpArrow = "leftRightUpArrow", ArrowsAndMarkersShapes2.BentArrow = "bentArrow", ArrowsAndMarkersShapes2.UturnArrow = "uturnArrow", ArrowsAndMarkersShapes2.CircularArrow = "circularArrow", ArrowsAndMarkersShapes2.NotchedRightArrow = "notchedRightArrow", ArrowsAndMarkersShapes2.HomePlate = "homePlate", ArrowsAndMarkersShapes2.Chevron = "chevron", ArrowsAndMarkersShapes2.LeftCircularArrow = "leftCircularArrow", ArrowsAndMarkersShapes2.LeftRightCircularArrow = "leftRightCircularArrow", ArrowsAndMarkersShapes2))(ArrowsAndMarkersShapes || {}), OtherShapes = /* @__PURE__ */ ((OtherShapes2) => (OtherShapes2.Plaque = "plaque", OtherShapes2.Can = "can", OtherShapes2.Cube = "cube", OtherShapes2.Bevel = "bevel", OtherShapes2.Donut = "donut", OtherShapes2.NoSmoking = "noSmoking", OtherShapes2.BlockArc = "blockArc", OtherShapes2.FoldedCorner = "foldedCorner", OtherShapes2))(OtherShapes || {}), SpecialShapes = /* @__PURE__ */ ((SpecialShapes2) => (SpecialShapes2.SmileyFace = "smileyFace", SpecialShapes2.Heart = "heart", SpecialShapes2.LightningBolt = "lightningBolt", SpecialShapes2.Sun = "sun", SpecialShapes2.Moon = "moon", SpecialShapes2.Cloud = "cloud", SpecialShapes2.Arc = "arc", SpecialShapes2.Backpack = "backpack", SpecialShapes2.Frame = "frame", SpecialShapes2.HalfFrame = "halfFrame", SpecialShapes2.Corner = "corner", SpecialShapes2.Chord = "chord", SpecialShapes2.Pie = "pie", SpecialShapes2.Teardrop = "teardrop", SpecialShapes2.WedgeRectCallout = "wedgeRectCallout", SpecialShapes2.WedgeRRectCallout = "wedgeRRectCallout", SpecialShapes2.WedgeEllipseCallout = "wedgeEllipseCallout", SpecialShapes2.CloudCallout = "cloudCallout", SpecialShapes2.BorderCallout1 = "borderCallout1", SpecialShapes2.BorderCallout2 = "borderCallout2", SpecialShapes2.BorderCallout3 = "borderCallout3", SpecialShapes2.AccentCallout1 = "accentCallout1", SpecialShapes2.AccentCallout2 = "accentCallout2", SpecialShapes2.AccentCallout3 = "accentCallout3", SpecialShapes2.Callout1 = "callout1", SpecialShapes2.Callout2 = "callout2", SpecialShapes2.Callout3 = "callout3", SpecialShapes2.ActionButtonBackPrevious = "actionButtonBackPrevious", SpecialShapes2.ActionButtonEnd = "actionButtonEnd", SpecialShapes2.ActionButtonForwardNext = "actionButtonForwardNext", SpecialShapes2.ActionButtonHelp = "actionButtonHelp", SpecialShapes2.ActionButtonHome = "actionButtonHome", SpecialShapes2.ActionButtonInformation = "actionButtonInformation", SpecialShapes2.ActionButtonMovie = "actionButtonMovie", SpecialShapes2.ActionButtonReturn = "actionButtonReturn", SpecialShapes2.ActionButtonSound = "actionButtonSound", SpecialShapes2))(SpecialShapes || {});
|
|
113
|
+
var FormatType = /* @__PURE__ */ ((FormatType2) => (FormatType2[FormatType2.NUMBER_FORMAT_TYPE_UNSPECIFIED = 0] = "NUMBER_FORMAT_TYPE_UNSPECIFIED", FormatType2[FormatType2.TEXT = 1] = "TEXT", FormatType2[FormatType2.NUMBER = 2] = "NUMBER", FormatType2[FormatType2.PERCENT = 3] = "PERCENT", FormatType2[FormatType2.CURRENCY = 4] = "CURRENCY", FormatType2[FormatType2.DATE = 5] = "DATE", FormatType2[FormatType2.TIME = 6] = "TIME", FormatType2[FormatType2.DATE_TIME = 7] = "DATE_TIME", FormatType2[FormatType2.SCIENTIFIC = 8] = "SCIENTIFIC", FormatType2))(FormatType || {}), InterpolationPointType = /* @__PURE__ */ ((InterpolationPointType2) => (InterpolationPointType2[InterpolationPointType2.INTERPOLATION_POINT_TYPE_UNSPECIFIED = 0] = "INTERPOLATION_POINT_TYPE_UNSPECIFIED", InterpolationPointType2[InterpolationPointType2.MIN = 1] = "MIN", InterpolationPointType2[InterpolationPointType2.MAX = 2] = "MAX", InterpolationPointType2[InterpolationPointType2.NUMBER = 3] = "NUMBER", InterpolationPointType2[InterpolationPointType2.PERCENT = 4] = "PERCENT", InterpolationPointType2[InterpolationPointType2.PERCENTILE = 5] = "PERCENTILE", InterpolationPointType2))(InterpolationPointType || {}), LocaleType = /* @__PURE__ */ ((LocaleType2) => (LocaleType2.EN_US = "enUS", LocaleType2.ZH_CN = "zhCN", LocaleType2.RU_RU = "ruRU", LocaleType2.ZH_TW = "zhTW", LocaleType2.VI_VN = "viVN", LocaleType2))(LocaleType || {}), ProtectionType = /* @__PURE__ */ ((ProtectionType2) => (ProtectionType2[ProtectionType2.RANGE = 0] = "RANGE", ProtectionType2[ProtectionType2.SHEET = 1] = "SHEET", ProtectionType2))(ProtectionType || {}), RelativeDate = /* @__PURE__ */ ((RelativeDate2) => (RelativeDate2[RelativeDate2.RELATIVE_DATE_UNSPECIFIED = 0] = "RELATIVE_DATE_UNSPECIFIED", RelativeDate2[RelativeDate2.PAST_YEAR = 1] = "PAST_YEAR", RelativeDate2[RelativeDate2.PAST_MONTH = 2] = "PAST_MONTH", RelativeDate2[RelativeDate2.PAST_WEEK = 3] = "PAST_WEEK", RelativeDate2[RelativeDate2.YESTERDAY = 4] = "YESTERDAY", RelativeDate2[RelativeDate2.TODAY = 5] = "TODAY", RelativeDate2[RelativeDate2.TOMORROW = 6] = "TOMORROW", RelativeDate2))(RelativeDate || {}), SheetTypes = /* @__PURE__ */ ((SheetTypes2) => (SheetTypes2[SheetTypes2.GRID = 0] = "GRID", SheetTypes2[SheetTypes2.KANBAN = 1] = "KANBAN", SheetTypes2[SheetTypes2.GANTT = 2] = "GANTT", SheetTypes2))(SheetTypes || {}), TextDirection = /* @__PURE__ */ ((TextDirection2) => (TextDirection2[TextDirection2.UNSPECIFIED = 0] = "UNSPECIFIED", TextDirection2[TextDirection2.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", TextDirection2[TextDirection2.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", TextDirection2))(TextDirection || {}), TextDecoration = /* @__PURE__ */ ((TextDecoration2) => (TextDecoration2[TextDecoration2.DASH = 0] = "DASH", TextDecoration2[TextDecoration2.DASH_DOT_DOT_HEAVY = 1] = "DASH_DOT_DOT_HEAVY", TextDecoration2[TextDecoration2.DASH_DOT_HEAVY = 2] = "DASH_DOT_HEAVY", TextDecoration2[TextDecoration2.DASHED_HEAVY = 3] = "DASHED_HEAVY", TextDecoration2[TextDecoration2.DASH_LONG = 4] = "DASH_LONG", TextDecoration2[TextDecoration2.DASH_LONG_HEAVY = 5] = "DASH_LONG_HEAVY", TextDecoration2[TextDecoration2.DOT_DASH = 6] = "DOT_DASH", TextDecoration2[TextDecoration2.DOT_DOT_DASH = 7] = "DOT_DOT_DASH", TextDecoration2[TextDecoration2.DOTTED = 8] = "DOTTED", TextDecoration2[TextDecoration2.DOTTED_HEAVY = 9] = "DOTTED_HEAVY", TextDecoration2[TextDecoration2.DOUBLE = 10] = "DOUBLE", TextDecoration2[TextDecoration2.NONE = 11] = "NONE", TextDecoration2[TextDecoration2.SINGLE = 12] = "SINGLE", TextDecoration2[TextDecoration2.THICK = 13] = "THICK", TextDecoration2[TextDecoration2.WAVE = 14] = "WAVE", TextDecoration2[TextDecoration2.WAVY_DOUBLE = 15] = "WAVY_DOUBLE", TextDecoration2[TextDecoration2.WAVY_HEAVY = 16] = "WAVY_HEAVY", TextDecoration2[TextDecoration2.WORDS = 17] = "WORDS", TextDecoration2))(TextDecoration || {}), HorizontalAlign = /* @__PURE__ */ ((HorizontalAlign2) => (HorizontalAlign2[HorizontalAlign2.UNSPECIFIED = 0] = "UNSPECIFIED", HorizontalAlign2[HorizontalAlign2.LEFT = 1] = "LEFT", HorizontalAlign2[HorizontalAlign2.CENTER = 2] = "CENTER", HorizontalAlign2[HorizontalAlign2.RIGHT = 3] = "RIGHT", HorizontalAlign2[HorizontalAlign2.JUSTIFIED = 4] = "JUSTIFIED", HorizontalAlign2[HorizontalAlign2.BOTH = 5] = "BOTH", HorizontalAlign2[HorizontalAlign2.DISTRIBUTED = 6] = "DISTRIBUTED", HorizontalAlign2))(HorizontalAlign || {}), VerticalAlign = /* @__PURE__ */ ((VerticalAlign2) => (VerticalAlign2[VerticalAlign2.UNSPECIFIED = 0] = "UNSPECIFIED", VerticalAlign2[VerticalAlign2.TOP = 1] = "TOP", VerticalAlign2[VerticalAlign2.MIDDLE = 2] = "MIDDLE", VerticalAlign2[VerticalAlign2.BOTTOM = 3] = "BOTTOM", VerticalAlign2))(VerticalAlign || {}), WrapStrategy = /* @__PURE__ */ ((WrapStrategy2) => (WrapStrategy2[WrapStrategy2.UNSPECIFIED = 0] = "UNSPECIFIED", WrapStrategy2[WrapStrategy2.OVERFLOW = 1] = "OVERFLOW", WrapStrategy2[WrapStrategy2.CLIP = 2] = "CLIP", WrapStrategy2[WrapStrategy2.WRAP = 3] = "WRAP", WrapStrategy2))(WrapStrategy || {}), FontItalic = /* @__PURE__ */ ((FontItalic2) => (FontItalic2[FontItalic2.NORMAL = 0] = "NORMAL", FontItalic2[FontItalic2.ITALIC = 1] = "ITALIC", FontItalic2))(FontItalic || {}), FontWeight = /* @__PURE__ */ ((FontWeight2) => (FontWeight2[FontWeight2.NORMAL = 0] = "NORMAL", FontWeight2[FontWeight2.BOLD = 1] = "BOLD", FontWeight2))(FontWeight || {}), BaselineOffset = /* @__PURE__ */ ((BaselineOffset2) => (BaselineOffset2[BaselineOffset2.NORMAL = 1] = "NORMAL", BaselineOffset2[BaselineOffset2.SUBSCRIPT = 2] = "SUBSCRIPT", BaselineOffset2[BaselineOffset2.SUPERSCRIPT = 3] = "SUPERSCRIPT", BaselineOffset2))(BaselineOffset || {}), BooleanNumber = /* @__PURE__ */ ((BooleanNumber2) => (BooleanNumber2[BooleanNumber2.FALSE = 0] = "FALSE", BooleanNumber2[BooleanNumber2.TRUE = 1] = "TRUE", BooleanNumber2))(BooleanNumber || {}), CellValueType = /* @__PURE__ */ ((CellValueType2) => (CellValueType2[CellValueType2.STRING = 1] = "STRING", CellValueType2[CellValueType2.NUMBER = 2] = "NUMBER", CellValueType2[CellValueType2.BOOLEAN = 3] = "BOOLEAN", CellValueType2[CellValueType2.FORCE_STRING = 4] = "FORCE_STRING", CellValueType2))(CellValueType || {}), ThemeColorType = /* @__PURE__ */ ((ThemeColorType2) => (ThemeColorType2[ThemeColorType2.DARK1 = 0] = "DARK1", ThemeColorType2[ThemeColorType2.LIGHT1 = 1] = "LIGHT1", ThemeColorType2[ThemeColorType2.DARK2 = 2] = "DARK2", ThemeColorType2[ThemeColorType2.LIGHT2 = 3] = "LIGHT2", ThemeColorType2[ThemeColorType2.ACCENT1 = 4] = "ACCENT1", ThemeColorType2[ThemeColorType2.ACCENT2 = 5] = "ACCENT2", ThemeColorType2[ThemeColorType2.ACCENT3 = 6] = "ACCENT3", ThemeColorType2[ThemeColorType2.ACCENT4 = 7] = "ACCENT4", ThemeColorType2[ThemeColorType2.ACCENT5 = 8] = "ACCENT5", ThemeColorType2[ThemeColorType2.ACCENT6 = 9] = "ACCENT6", ThemeColorType2[ThemeColorType2.HYPERLINK = 10] = "HYPERLINK", ThemeColorType2[ThemeColorType2.FOLLOWED_HYPERLINK = 11] = "FOLLOWED_HYPERLINK", ThemeColorType2))(ThemeColorType || {}), ThemeColors = /* @__PURE__ */ ((ThemeColors2) => (ThemeColors2.OFFICE = "Office", ThemeColors2.OFFICE_2007_2010 = "Office 2007-2010", ThemeColors2.GRAYSCALE = "Grayscale", ThemeColors2.BLUE_WARM = "Blue Warm", ThemeColors2.BLUE = "Blue", ThemeColors2.BLUE_II = "Blue II", ThemeColors2.BLUE_GREEN = "Blue Green", ThemeColors2.GREEN = "Green", ThemeColors2.GREEN_YELLOW = "Green Yellow", ThemeColors2.YELLOW = "Yellow", ThemeColors2.YELLOW_ORANGE = "Yellow Orange", ThemeColors2.ORANGE = "Orange", ThemeColors2.ORANGE_RED = "Orange Red", ThemeColors2.RED_ORANGE = "Red Orange", ThemeColors2.RED = "Red", ThemeColors2.RED_VIOLET = "Red Violet", ThemeColors2.VIOLET = "Violet", ThemeColors2.VIOLET_II = "Violet II", ThemeColors2.MEDIAN = "Median", ThemeColors2.PAPER = "Paper", ThemeColors2.MARQUEE = "Marquee", ThemeColors2.SLIPSTREAM = "Slipstream", ThemeColors2.Aspect = "Aspect", ThemeColors2))(ThemeColors || {}), BasicShapes = /* @__PURE__ */ ((BasicShapes2) => (BasicShapes2.Line = "line", BasicShapes2.LineInv = "lineInv", BasicShapes2.Triangle = "triangle", BasicShapes2.RtTriangle = "rtTriangle", BasicShapes2.Rect = "rect", BasicShapes2.Diamond = "diamond", BasicShapes2.Parallelogram = "parallelogram", BasicShapes2.Trapezoid = "trapezoid", BasicShapes2.NonIsocelesTrapezoid = "nonIsocelesTrapezoid", BasicShapes2.Pentagon = "pentagon", BasicShapes2.Hexagon = "hexagon", BasicShapes2.Heptagon = "heptagon", BasicShapes2.Octagon = "octagon", BasicShapes2.Decagon = "decagon", BasicShapes2.Dodecagon = "dodecagon", BasicShapes2.Star4 = "star4", BasicShapes2.Star5 = "star5", BasicShapes2.Star6 = "star6", BasicShapes2.Star7 = "star7", BasicShapes2.Star8 = "star8", BasicShapes2.Star10 = "star10", BasicShapes2.Star12 = "star12", BasicShapes2.Star16 = "star16", BasicShapes2.Star24 = "star24", BasicShapes2.Star32 = "star32", BasicShapes2.RoundRect = "roundRect", BasicShapes2.Round1Rect = "round1Rect", BasicShapes2.Round2SameRect = "round2SameRect", BasicShapes2.Round2DiagRect = "round2DiagRect", BasicShapes2.Ellipse = "ellipse", BasicShapes2))(BasicShapes || {}), ArrowsAndMarkersShapes = /* @__PURE__ */ ((ArrowsAndMarkersShapes2) => (ArrowsAndMarkersShapes2.RightArrow = "rightArrow", ArrowsAndMarkersShapes2.LeftArrow = "leftArrow", ArrowsAndMarkersShapes2.UpArrow = "upArrow", ArrowsAndMarkersShapes2.DownArrow = "downArrow", ArrowsAndMarkersShapes2.LeftRightArrow = "leftRightArrow", ArrowsAndMarkersShapes2.UpDownArrow = "upDownArrow", ArrowsAndMarkersShapes2.QuadArrow = "quadArrow", ArrowsAndMarkersShapes2.LeftRightUpArrow = "leftRightUpArrow", ArrowsAndMarkersShapes2.BentArrow = "bentArrow", ArrowsAndMarkersShapes2.UturnArrow = "uturnArrow", ArrowsAndMarkersShapes2.CircularArrow = "circularArrow", ArrowsAndMarkersShapes2.NotchedRightArrow = "notchedRightArrow", ArrowsAndMarkersShapes2.HomePlate = "homePlate", ArrowsAndMarkersShapes2.Chevron = "chevron", ArrowsAndMarkersShapes2.LeftCircularArrow = "leftCircularArrow", ArrowsAndMarkersShapes2.LeftRightCircularArrow = "leftRightCircularArrow", ArrowsAndMarkersShapes2))(ArrowsAndMarkersShapes || {}), OtherShapes = /* @__PURE__ */ ((OtherShapes2) => (OtherShapes2.Plaque = "plaque", OtherShapes2.Can = "can", OtherShapes2.Cube = "cube", OtherShapes2.Bevel = "bevel", OtherShapes2.Donut = "donut", OtherShapes2.NoSmoking = "noSmoking", OtherShapes2.BlockArc = "blockArc", OtherShapes2.FoldedCorner = "foldedCorner", OtherShapes2))(OtherShapes || {}), SpecialShapes = /* @__PURE__ */ ((SpecialShapes2) => (SpecialShapes2.SmileyFace = "smileyFace", SpecialShapes2.Heart = "heart", SpecialShapes2.LightningBolt = "lightningBolt", SpecialShapes2.Sun = "sun", SpecialShapes2.Moon = "moon", SpecialShapes2.Cloud = "cloud", SpecialShapes2.Arc = "arc", SpecialShapes2.Backpack = "backpack", SpecialShapes2.Frame = "frame", SpecialShapes2.HalfFrame = "halfFrame", SpecialShapes2.Corner = "corner", SpecialShapes2.Chord = "chord", SpecialShapes2.Pie = "pie", SpecialShapes2.Teardrop = "teardrop", SpecialShapes2.WedgeRectCallout = "wedgeRectCallout", SpecialShapes2.WedgeRRectCallout = "wedgeRRectCallout", SpecialShapes2.WedgeEllipseCallout = "wedgeEllipseCallout", SpecialShapes2.CloudCallout = "cloudCallout", SpecialShapes2.BorderCallout1 = "borderCallout1", SpecialShapes2.BorderCallout2 = "borderCallout2", SpecialShapes2.BorderCallout3 = "borderCallout3", SpecialShapes2.AccentCallout1 = "accentCallout1", SpecialShapes2.AccentCallout2 = "accentCallout2", SpecialShapes2.AccentCallout3 = "accentCallout3", SpecialShapes2.Callout1 = "callout1", SpecialShapes2.Callout2 = "callout2", SpecialShapes2.Callout3 = "callout3", SpecialShapes2.ActionButtonBackPrevious = "actionButtonBackPrevious", SpecialShapes2.ActionButtonEnd = "actionButtonEnd", SpecialShapes2.ActionButtonForwardNext = "actionButtonForwardNext", SpecialShapes2.ActionButtonHelp = "actionButtonHelp", SpecialShapes2.ActionButtonHome = "actionButtonHome", SpecialShapes2.ActionButtonInformation = "actionButtonInformation", SpecialShapes2.ActionButtonMovie = "actionButtonMovie", SpecialShapes2.ActionButtonReturn = "actionButtonReturn", SpecialShapes2.ActionButtonSound = "actionButtonSound", SpecialShapes2))(SpecialShapes || {}), DeleteDirection = /* @__PURE__ */ ((DeleteDirection2) => (DeleteDirection2[DeleteDirection2.LEFT = 0] = "LEFT", DeleteDirection2[DeleteDirection2.RIGHT = 1] = "RIGHT", DeleteDirection2))(DeleteDirection || {});
|
|
114
114
|
const THEME_COLORS = {
|
|
115
115
|
[ThemeColors.OFFICE]: {
|
|
116
116
|
[ThemeColorType.ACCENT1]: "#4472C4",
|
|
@@ -821,7 +821,7 @@ function isWhiteColor(color) {
|
|
|
821
821
|
__name(isWhiteColor, "isWhiteColor");
|
|
822
822
|
var UpdateDocsAttributeType = /* @__PURE__ */ ((UpdateDocsAttributeType2) => (UpdateDocsAttributeType2[UpdateDocsAttributeType2.COVER = 0] = "COVER", UpdateDocsAttributeType2[UpdateDocsAttributeType2.REPLACE = 1] = "REPLACE", UpdateDocsAttributeType2[UpdateDocsAttributeType2.INTERSECTION = 2] = "INTERSECTION", UpdateDocsAttributeType2))(UpdateDocsAttributeType || {});
|
|
823
823
|
function isICellData(value) {
|
|
824
|
-
return value && (value.s !== void 0 || value.p !== void 0 || value.v !== void 0 || value.t !== void 0 || value.f !== void 0 || value.si !== void 0);
|
|
824
|
+
return value && (value.s !== void 0 || value.p !== void 0 || value.v !== void 0 || value.t !== void 0 || value.f !== void 0 || value.si !== void 0 || value.custom !== void 0);
|
|
825
825
|
}
|
|
826
826
|
__name(isICellData, "isICellData");
|
|
827
827
|
function getCellValueType(cell) {
|
|
@@ -851,6 +851,7 @@ function selectionToArray(range) {
|
|
|
851
851
|
return [range.startRow, range.startColumn, range.endRow, range.endColumn];
|
|
852
852
|
}
|
|
853
853
|
__name(selectionToArray, "selectionToArray");
|
|
854
|
+
var RANGE_DIRECTION = /* @__PURE__ */ ((RANGE_DIRECTION2) => (RANGE_DIRECTION2.NONE = "none", RANGE_DIRECTION2.BACKWARD = "backward", RANGE_DIRECTION2.FORWARD = "forward", RANGE_DIRECTION2))(RANGE_DIRECTION || {}), DOC_RANGE_TYPE = /* @__PURE__ */ ((DOC_RANGE_TYPE2) => (DOC_RANGE_TYPE2.RECT = "RECT", DOC_RANGE_TYPE2.TEXT = "TEXT", DOC_RANGE_TYPE2))(DOC_RANGE_TYPE || {});
|
|
854
855
|
function getCellInfoInMergeData(row, column, mergeData) {
|
|
855
856
|
let isMerged = !1, isMergedMainCell = !1, newEndRow = row, newEndColumn = column, mergeRow = row, mergeColumn = column;
|
|
856
857
|
if (mergeData == null)
|
|
@@ -2197,9 +2198,10 @@ const rmsPrefix = /^-ms-/, rDashAlpha = /-([a-z])/g, alphabets = [
|
|
|
2197
2198
|
static clamp(value, min, max) {
|
|
2198
2199
|
return Math.max(min, Math.min(max, value));
|
|
2199
2200
|
}
|
|
2201
|
+
static now() {
|
|
2202
|
+
return performance && performance.now ? performance.now() : Date.now();
|
|
2203
|
+
}
|
|
2200
2204
|
/**
|
|
2201
|
-
*
|
|
2202
|
-
*
|
|
2203
2205
|
* @static
|
|
2204
2206
|
* @param {unknown} object Modify the property while leaving the reference unchanged.
|
|
2205
2207
|
* @param {unknown} source The source being merged in object.
|
|
@@ -2457,9 +2459,16 @@ function getDocsUpdateBody(model, segmentId) {
|
|
|
2457
2459
|
return body;
|
|
2458
2460
|
}
|
|
2459
2461
|
__name(getDocsUpdateBody, "getDocsUpdateBody");
|
|
2460
|
-
function isValidRange(range) {
|
|
2462
|
+
function isValidRange(range, worksheet) {
|
|
2461
2463
|
const { startRow, endRow, startColumn, endColumn, rangeType } = range;
|
|
2462
|
-
|
|
2464
|
+
if (startRow < 0 || startColumn < 0 || endRow < 0 || endColumn < 0 || !(Number.isNaN(startRow) && Number.isNaN(endRow)) && rangeType === RANGE_TYPE.COLUMN || !(Number.isNaN(startColumn) && Number.isNaN(endColumn)) && rangeType === RANGE_TYPE.ROW || rangeType !== RANGE_TYPE.ROW && rangeType !== RANGE_TYPE.COLUMN && (Number.isNaN(startColumn) || Number.isNaN(startRow) || Number.isNaN(endColumn) || Number.isNaN(endRow)))
|
|
2465
|
+
return !1;
|
|
2466
|
+
if (worksheet) {
|
|
2467
|
+
const rowCount = worksheet.getRowCount(), colCount = worksheet.getColumnCount();
|
|
2468
|
+
if (endRow >= rowCount || endColumn >= colCount)
|
|
2469
|
+
return !1;
|
|
2470
|
+
}
|
|
2471
|
+
return !0;
|
|
2463
2472
|
}
|
|
2464
2473
|
__name(isValidRange, "isValidRange");
|
|
2465
2474
|
function cellToRange(row, col) {
|
|
@@ -3303,7 +3312,7 @@ const _ObjectMatrix = class _ObjectMatrix {
|
|
|
3303
3312
|
toFullArray() {
|
|
3304
3313
|
const range = this.getRange(), { endColumn, endRow } = range, array = [];
|
|
3305
3314
|
for (let i = 0; i <= endRow; i++) {
|
|
3306
|
-
const subArr = Array(endColumn + 1).fill(void 0);
|
|
3315
|
+
const subArr = new Array(endColumn + 1).fill(void 0);
|
|
3307
3316
|
array.push(subArr);
|
|
3308
3317
|
}
|
|
3309
3318
|
return this.forValue((row, col, value) => {
|
|
@@ -4626,7 +4635,7 @@ const _numfmt = /* @__PURE__ */ getDefaultExportFromCjs(numfmt$1), numfmt = _num
|
|
|
4626
4635
|
width: 300,
|
|
4627
4636
|
height: 300
|
|
4628
4637
|
}
|
|
4629
|
-
}
|
|
4638
|
+
};
|
|
4630
4639
|
var EXTENSION_NAMES = /* @__PURE__ */ ((EXTENSION_NAMES2) => (EXTENSION_NAMES2.ARRAY_CONVERTOR = "ARRAY_CONVERTOR", EXTENSION_NAMES2.MATRIX_CONVERTOR = "MATRIX_CONVERTOR", EXTENSION_NAMES2))(EXTENSION_NAMES || {});
|
|
4631
4640
|
function isAllFormatInTextRuns(key, body) {
|
|
4632
4641
|
const { textRuns = [] } = body;
|
|
@@ -6647,7 +6656,7 @@ const orderListSymbolMap = {
|
|
|
6647
6656
|
hanging: { v: 21 },
|
|
6648
6657
|
indentStart: { v: 21 * (i + 1) }
|
|
6649
6658
|
}
|
|
6650
|
-
})), "orderListFactory"), checkListFactory = /* @__PURE__ */ __name((symbol, textStyle) => Array(9).fill(0).map((_, i) => ({
|
|
6659
|
+
})), "orderListFactory"), checkListFactory = /* @__PURE__ */ __name((symbol, textStyle) => new Array(9).fill(0).map((_, i) => ({
|
|
6651
6660
|
glyphFormat: ` %${i + 1}`,
|
|
6652
6661
|
glyphSymbol: symbol,
|
|
6653
6662
|
bulletAlignment: BulletAlignment.START,
|
|
@@ -9855,11 +9864,17 @@ const IConfigService = createIdentifier("univer.config-service"), _ConfigService
|
|
|
9855
9864
|
getConfig(id) {
|
|
9856
9865
|
return this._config.get(id);
|
|
9857
9866
|
}
|
|
9858
|
-
setConfig(id, value) {
|
|
9867
|
+
setConfig(id, value, options) {
|
|
9868
|
+
var _a13;
|
|
9869
|
+
const { merge: merge2 = !1 } = options || {}, existingValue = (_a13 = this._config.get(id)) != null ? _a13 : {};
|
|
9870
|
+
if (merge2) {
|
|
9871
|
+
this._config.set(id, Tools.deepMerge(existingValue, value));
|
|
9872
|
+
return;
|
|
9873
|
+
}
|
|
9859
9874
|
this._config.set(id, value);
|
|
9860
9875
|
}
|
|
9861
9876
|
deleteConfig(id) {
|
|
9862
|
-
this._config.delete(id);
|
|
9877
|
+
return this._config.delete(id);
|
|
9863
9878
|
}
|
|
9864
9879
|
};
|
|
9865
9880
|
__name(_ConfigService, "ConfigService");
|
|
@@ -9935,6 +9950,405 @@ const _Styles = class _Styles {
|
|
|
9935
9950
|
};
|
|
9936
9951
|
__name(_Styles, "Styles");
|
|
9937
9952
|
let Styles = _Styles;
|
|
9953
|
+
function isCustomRangeSplitSymbol(text) {
|
|
9954
|
+
return text === DataStreamTreeTokenType$1.CUSTOM_RANGE_END || text === DataStreamTreeTokenType$1.CUSTOM_RANGE_START;
|
|
9955
|
+
}
|
|
9956
|
+
__name(isCustomRangeSplitSymbol, "isCustomRangeSplitSymbol");
|
|
9957
|
+
function isIntersecting(line1Start, line1End, line2Start, line2End) {
|
|
9958
|
+
return line1Start <= line2Start && line1End >= line2Start || line1Start >= line2Start && line1Start <= line2End;
|
|
9959
|
+
}
|
|
9960
|
+
__name(isIntersecting, "isIntersecting");
|
|
9961
|
+
function shouldDeleteCustomRange(deleteStart, deleteLen, customRange, dataStream) {
|
|
9962
|
+
const dataStreamSlice = dataStream.slice(customRange.startIndex + 1, customRange.endIndex), start = Math.max(deleteStart - (customRange.startIndex + 1), 0), end = deleteStart + deleteLen - 1 - (customRange.startIndex + 1);
|
|
9963
|
+
if (end < 0)
|
|
9964
|
+
return !1;
|
|
9965
|
+
if (start === 0 && end >= dataStreamSlice.length)
|
|
9966
|
+
return !0;
|
|
9967
|
+
const result = dataStreamSlice.slice(0, start) + dataStreamSlice.slice(start + deleteLen);
|
|
9968
|
+
for (let i = 0, len = result.length; i < len; i++) {
|
|
9969
|
+
const letter = result[i];
|
|
9970
|
+
if (!isCustomRangeSplitSymbol(letter))
|
|
9971
|
+
return !1;
|
|
9972
|
+
}
|
|
9973
|
+
return !0;
|
|
9974
|
+
}
|
|
9975
|
+
__name(shouldDeleteCustomRange, "shouldDeleteCustomRange");
|
|
9976
|
+
function getCustomRangesInterestsWithRange(range, customRanges) {
|
|
9977
|
+
const result = [];
|
|
9978
|
+
for (let i = 0, len = customRanges.length; i < len; i++) {
|
|
9979
|
+
const customRange = customRanges[i];
|
|
9980
|
+
range.collapsed ? customRange.startIndex < range.startOffset && range.startOffset <= customRange.endIndex && result.push(customRange) : isIntersecting(range.startOffset, range.endOffset, customRange.startIndex, customRange.endIndex) && result.push(customRange);
|
|
9981
|
+
}
|
|
9982
|
+
return result;
|
|
9983
|
+
}
|
|
9984
|
+
__name(getCustomRangesInterestsWithRange, "getCustomRangesInterestsWithRange");
|
|
9985
|
+
function copyCustomRange(range) {
|
|
9986
|
+
return {
|
|
9987
|
+
...Tools$1.deepClone(range),
|
|
9988
|
+
rangeId: generateRandomId$1()
|
|
9989
|
+
};
|
|
9990
|
+
}
|
|
9991
|
+
__name(copyCustomRange, "copyCustomRange");
|
|
9992
|
+
function excludePointsFromRange(range, points) {
|
|
9993
|
+
const newRanges = [];
|
|
9994
|
+
let start = range[0];
|
|
9995
|
+
for (const point of points)
|
|
9996
|
+
point < range[0] || point > range[1] || (start < point && newRanges.push([start, point - 1]), start = point + 1);
|
|
9997
|
+
return start <= range[1] && newRanges.push([start, range[1]]), newRanges;
|
|
9998
|
+
}
|
|
9999
|
+
__name(excludePointsFromRange, "excludePointsFromRange");
|
|
10000
|
+
function makeSelection(startOffset, endOffset) {
|
|
10001
|
+
if (typeof endOffset > "u")
|
|
10002
|
+
return { startOffset, endOffset: startOffset, collapsed: !0 };
|
|
10003
|
+
if (endOffset < startOffset)
|
|
10004
|
+
throw new Error(`Cannot make a doc selection when endOffset ${endOffset} is less than startOffset ${startOffset}.`);
|
|
10005
|
+
return { startOffset, endOffset, collapsed: startOffset === endOffset };
|
|
10006
|
+
}
|
|
10007
|
+
__name(makeSelection, "makeSelection");
|
|
10008
|
+
function normalizeSelection(selection) {
|
|
10009
|
+
const { startOffset, endOffset, collapsed } = selection, start = Math.min(startOffset, endOffset), end = Math.max(startOffset, endOffset);
|
|
10010
|
+
return {
|
|
10011
|
+
startOffset: start,
|
|
10012
|
+
endOffset: end,
|
|
10013
|
+
collapsed
|
|
10014
|
+
};
|
|
10015
|
+
}
|
|
10016
|
+
__name(normalizeSelection, "normalizeSelection");
|
|
10017
|
+
function getSelectionWithSymbolMax(selection, body) {
|
|
10018
|
+
let { startOffset, endOffset } = normalizeSelection(selection);
|
|
10019
|
+
for (; body.dataStream[startOffset - 1] === DataStreamTreeTokenType.CUSTOM_RANGE_START; )
|
|
10020
|
+
startOffset -= 1;
|
|
10021
|
+
for (; body.dataStream[endOffset] === DataStreamTreeTokenType.CUSTOM_RANGE_END; )
|
|
10022
|
+
endOffset += 1;
|
|
10023
|
+
return {
|
|
10024
|
+
startOffset,
|
|
10025
|
+
endOffset
|
|
10026
|
+
};
|
|
10027
|
+
}
|
|
10028
|
+
__name(getSelectionWithSymbolMax, "getSelectionWithSymbolMax");
|
|
10029
|
+
function getSelectionWithNoSymbolSide(selection, body) {
|
|
10030
|
+
let { startOffset, endOffset } = normalizeSelection(selection);
|
|
10031
|
+
for (; isCustomRangeSplitSymbol(body.dataStream[startOffset]); )
|
|
10032
|
+
startOffset += 1;
|
|
10033
|
+
for (; isCustomRangeSplitSymbol(body.dataStream[endOffset - 1]); )
|
|
10034
|
+
endOffset -= 1;
|
|
10035
|
+
return {
|
|
10036
|
+
startOffset,
|
|
10037
|
+
endOffset
|
|
10038
|
+
};
|
|
10039
|
+
}
|
|
10040
|
+
__name(getSelectionWithNoSymbolSide, "getSelectionWithNoSymbolSide");
|
|
10041
|
+
function getDeleteSelection(selection, body, direction = DeleteDirection.LEFT) {
|
|
10042
|
+
var _a13;
|
|
10043
|
+
let { startOffset, endOffset, collapsed } = normalizeSelection(selection);
|
|
10044
|
+
if (collapsed)
|
|
10045
|
+
if (direction === DeleteDirection.LEFT)
|
|
10046
|
+
for (; isCustomRangeSplitSymbol(body.dataStream[startOffset - 1]); )
|
|
10047
|
+
endOffset -= 1, startOffset -= 1;
|
|
10048
|
+
else
|
|
10049
|
+
for (; isCustomRangeSplitSymbol(body.dataStream[startOffset]); )
|
|
10050
|
+
endOffset += 1, startOffset += 1;
|
|
10051
|
+
else {
|
|
10052
|
+
const selectionWithSymbolMax = getSelectionWithSymbolMax(selection, body);
|
|
10053
|
+
startOffset = selectionWithSymbolMax.startOffset, endOffset = selectionWithSymbolMax.endOffset;
|
|
10054
|
+
}
|
|
10055
|
+
collapsed = startOffset === endOffset;
|
|
10056
|
+
const customRanges = (_a13 = body.customRanges) == null ? void 0 : _a13.filter((range) => !range.wholeEntity || startOffset <= range.startIndex && endOffset > range.endIndex ? !1 : isSegmentIntersects(startOffset, collapsed ? endOffset : endOffset - 1, range.startIndex, range.endIndex));
|
|
10057
|
+
return customRanges != null && customRanges.length && customRanges.forEach((range) => {
|
|
10058
|
+
startOffset = Math.min(range.startIndex, startOffset), endOffset = Math.max(range.endIndex + 1, endOffset);
|
|
10059
|
+
}), {
|
|
10060
|
+
...selection,
|
|
10061
|
+
startOffset,
|
|
10062
|
+
endOffset,
|
|
10063
|
+
collapsed: startOffset === endOffset
|
|
10064
|
+
};
|
|
10065
|
+
}
|
|
10066
|
+
__name(getDeleteSelection, "getDeleteSelection");
|
|
10067
|
+
function getInsertSelection(selection, body) {
|
|
10068
|
+
let { startOffset, endOffset, collapsed } = normalizeSelection(selection);
|
|
10069
|
+
if (collapsed) {
|
|
10070
|
+
for (; body.dataStream[endOffset] === DataStreamTreeTokenType.CUSTOM_RANGE_END; )
|
|
10071
|
+
endOffset += 1, startOffset += 1;
|
|
10072
|
+
for (; body.dataStream[endOffset - 1] === DataStreamTreeTokenType.CUSTOM_RANGE_START; )
|
|
10073
|
+
endOffset -= 1, startOffset -= 1;
|
|
10074
|
+
return {
|
|
10075
|
+
...selection,
|
|
10076
|
+
startOffset,
|
|
10077
|
+
endOffset,
|
|
10078
|
+
collapsed
|
|
10079
|
+
};
|
|
10080
|
+
} else
|
|
10081
|
+
return {
|
|
10082
|
+
...selection,
|
|
10083
|
+
...getSelectionWithSymbolMax(selection, body),
|
|
10084
|
+
collapsed: !1
|
|
10085
|
+
};
|
|
10086
|
+
}
|
|
10087
|
+
__name(getInsertSelection, "getInsertSelection");
|
|
10088
|
+
function getSelectionForAddCustomRange(selection, body) {
|
|
10089
|
+
if (selection.startOffset === selection.endOffset)
|
|
10090
|
+
return null;
|
|
10091
|
+
const customRanges = body.customRanges;
|
|
10092
|
+
if (!customRanges)
|
|
10093
|
+
return normalizeSelection(selection);
|
|
10094
|
+
let { startOffset, endOffset } = getSelectionWithSymbolMax(selection, body);
|
|
10095
|
+
for (; isCustomRangeSplitSymbol(body.dataStream[startOffset]); ) {
|
|
10096
|
+
if (body.dataStream[startOffset] === DataStreamTreeTokenType.CUSTOM_RANGE_START) {
|
|
10097
|
+
const customRange = customRanges.find((range) => range.startIndex === startOffset);
|
|
10098
|
+
if (!customRange)
|
|
10099
|
+
throw new Error("No custom-range matched");
|
|
10100
|
+
if (customRange.endIndex === endOffset - 1)
|
|
10101
|
+
return {
|
|
10102
|
+
startOffset,
|
|
10103
|
+
endOffset,
|
|
10104
|
+
collapsed: !1
|
|
10105
|
+
};
|
|
10106
|
+
if (customRange.endIndex < endOffset - 1)
|
|
10107
|
+
break;
|
|
10108
|
+
}
|
|
10109
|
+
startOffset += 1;
|
|
10110
|
+
}
|
|
10111
|
+
for (; isCustomRangeSplitSymbol(body.dataStream[endOffset - 1]); ) {
|
|
10112
|
+
if (body.dataStream[startOffset] === DataStreamTreeTokenType.CUSTOM_RANGE_END) {
|
|
10113
|
+
const customRange = customRanges.find((range) => range.endIndex === endOffset - 1);
|
|
10114
|
+
if (!customRange)
|
|
10115
|
+
throw new Error("No custom-range matched");
|
|
10116
|
+
if (customRange.startIndex === startOffset)
|
|
10117
|
+
return {
|
|
10118
|
+
startOffset,
|
|
10119
|
+
endOffset,
|
|
10120
|
+
collapsed: !1
|
|
10121
|
+
};
|
|
10122
|
+
if (customRange.startIndex > startOffset)
|
|
10123
|
+
break;
|
|
10124
|
+
}
|
|
10125
|
+
endOffset -= 1;
|
|
10126
|
+
}
|
|
10127
|
+
return endOffset <= startOffset ? null : {
|
|
10128
|
+
startOffset,
|
|
10129
|
+
endOffset,
|
|
10130
|
+
collapsed: !1
|
|
10131
|
+
};
|
|
10132
|
+
}
|
|
10133
|
+
__name(getSelectionForAddCustomRange, "getSelectionForAddCustomRange");
|
|
10134
|
+
function isSegmentIntersects(start, end, start2, end2) {
|
|
10135
|
+
return Math.max(start, start2) <= Math.min(end, end2);
|
|
10136
|
+
}
|
|
10137
|
+
__name(isSegmentIntersects, "isSegmentIntersects");
|
|
10138
|
+
function getRetainAndDeleteFromReplace(range, segmentId = "", memoryCursor, body) {
|
|
10139
|
+
var _a13;
|
|
10140
|
+
const { startOffset, endOffset } = range, dos = [], textStart = startOffset - memoryCursor, textEnd = endOffset - memoryCursor, dataStream = body.dataStream, relativeCustomRanges = (_a13 = body.customRanges) == null ? void 0 : _a13.filter((customRange) => isIntersecting(customRange.startIndex, customRange.endIndex, startOffset, endOffset)), toDeleteRanges = new Set(relativeCustomRanges == null ? void 0 : relativeCustomRanges.filter((customRange) => shouldDeleteCustomRange(startOffset, endOffset - startOffset, customRange, dataStream))), retainPoints = /* @__PURE__ */ new Set();
|
|
10141
|
+
relativeCustomRanges == null || relativeCustomRanges.forEach((range2) => {
|
|
10142
|
+
toDeleteRanges.has(range2) || (range2.startIndex - memoryCursor >= textStart && range2.startIndex - memoryCursor <= textEnd && range2.endIndex - memoryCursor > textEnd && retainPoints.add(range2.startIndex), range2.endIndex - memoryCursor >= textStart && range2.endIndex - memoryCursor <= textEnd && range2.startIndex < textStart && retainPoints.add(range2.endIndex));
|
|
10143
|
+
}), textStart > 0 && dos.push({
|
|
10144
|
+
t: TextXActionType.RETAIN,
|
|
10145
|
+
len: textStart,
|
|
10146
|
+
segmentId
|
|
10147
|
+
});
|
|
10148
|
+
const sortedRetains = [...retainPoints].sort((pre, aft) => pre - aft);
|
|
10149
|
+
let cursor2 = textStart;
|
|
10150
|
+
return sortedRetains.forEach((pos) => {
|
|
10151
|
+
const len = pos - cursor2;
|
|
10152
|
+
len > 0 && dos.push({
|
|
10153
|
+
t: TextXActionType.DELETE,
|
|
10154
|
+
len,
|
|
10155
|
+
line: 0,
|
|
10156
|
+
segmentId
|
|
10157
|
+
}), dos.push({
|
|
10158
|
+
t: TextXActionType.RETAIN,
|
|
10159
|
+
len: 1,
|
|
10160
|
+
segmentId
|
|
10161
|
+
}), cursor2 = pos + 1;
|
|
10162
|
+
}), cursor2 < textEnd && (dos.push({
|
|
10163
|
+
t: TextXActionType.DELETE,
|
|
10164
|
+
len: textEnd - cursor2,
|
|
10165
|
+
line: 0,
|
|
10166
|
+
segmentId
|
|
10167
|
+
}), cursor2 = textEnd + 1), {
|
|
10168
|
+
dos,
|
|
10169
|
+
cursor: cursor2,
|
|
10170
|
+
retain: retainPoints.size
|
|
10171
|
+
};
|
|
10172
|
+
}
|
|
10173
|
+
__name(getRetainAndDeleteFromReplace, "getRetainAndDeleteFromReplace");
|
|
10174
|
+
function deleteCustomRangeTextX(accessor, params) {
|
|
10175
|
+
var _a13, _b2;
|
|
10176
|
+
const { rangeId, segmentId, documentDataModel, insert } = params, range = (_b2 = (_a13 = documentDataModel.getSelfOrHeaderFooterModel(segmentId).getBody()) == null ? void 0 : _a13.customRanges) == null ? void 0 : _b2.find((r) => r.rangeId === rangeId);
|
|
10177
|
+
if (!range)
|
|
10178
|
+
return !1;
|
|
10179
|
+
const { startIndex, endIndex } = range, textX = new TextX(), len = endIndex - startIndex + 1;
|
|
10180
|
+
return startIndex > 0 && textX.push({
|
|
10181
|
+
t: TextXActionType.RETAIN,
|
|
10182
|
+
len: startIndex,
|
|
10183
|
+
segmentId
|
|
10184
|
+
}), textX.push({
|
|
10185
|
+
t: TextXActionType.DELETE,
|
|
10186
|
+
len: 1,
|
|
10187
|
+
segmentId,
|
|
10188
|
+
line: 0
|
|
10189
|
+
}), len - 2 > 0 && textX.push({
|
|
10190
|
+
t: TextXActionType.RETAIN,
|
|
10191
|
+
len: len - 2,
|
|
10192
|
+
segmentId
|
|
10193
|
+
}), textX.push({
|
|
10194
|
+
t: TextXActionType.DELETE,
|
|
10195
|
+
len: 1,
|
|
10196
|
+
segmentId,
|
|
10197
|
+
line: 0
|
|
10198
|
+
}), insert && textX.push({
|
|
10199
|
+
body: insert,
|
|
10200
|
+
t: TextXActionType.INSERT,
|
|
10201
|
+
len: insert.dataStream.length,
|
|
10202
|
+
segmentId,
|
|
10203
|
+
line: 1
|
|
10204
|
+
}), textX;
|
|
10205
|
+
}
|
|
10206
|
+
__name(deleteCustomRangeTextX, "deleteCustomRangeTextX");
|
|
10207
|
+
function addCustomRangeTextX(param) {
|
|
10208
|
+
var _a13, _b2;
|
|
10209
|
+
const { range, rangeId, rangeType, segmentId, wholeEntity, properties, body } = param, actualRange = getSelectionForAddCustomRange(range, body);
|
|
10210
|
+
if (!actualRange || !body)
|
|
10211
|
+
return !1;
|
|
10212
|
+
const { startOffset, endOffset } = actualRange, customRanges = (_a13 = body.customRanges) != null ? _a13 : [];
|
|
10213
|
+
let cursor2 = 0;
|
|
10214
|
+
const textX = new TextX(), addCustomRange = /* @__PURE__ */ __name((startIndex, endIndex, index2) => {
|
|
10215
|
+
const relativeCustomRanges = [];
|
|
10216
|
+
for (let i = 0, len = customRanges.length; i < len; i++) {
|
|
10217
|
+
const customRange = customRanges[i];
|
|
10218
|
+
if (customRange.rangeType === rangeType && Math.max(customRange.startIndex, startIndex) <= Math.min(customRange.endIndex, endIndex) && relativeCustomRanges.push({ ...customRange }), customRange.startIndex > endIndex)
|
|
10219
|
+
break;
|
|
10220
|
+
}
|
|
10221
|
+
const deletes = relativeCustomRanges.map((i) => [i.startIndex, i.endIndex]).flat().sort((pre, aft) => pre - aft), range2 = deletes.length ? {
|
|
10222
|
+
startOffset: Math.min(deletes[0], startIndex),
|
|
10223
|
+
endOffset: Math.max(deletes[deletes.length - 1] + 1, endIndex + 1)
|
|
10224
|
+
} : {
|
|
10225
|
+
startOffset: startIndex,
|
|
10226
|
+
endOffset: endIndex + 1
|
|
10227
|
+
};
|
|
10228
|
+
range2.startOffset !== cursor2 && (textX.push({
|
|
10229
|
+
t: TextXActionType.RETAIN,
|
|
10230
|
+
len: range2.startOffset - cursor2,
|
|
10231
|
+
segmentId
|
|
10232
|
+
}), cursor2 = range2.startOffset), textX.push({
|
|
10233
|
+
t: TextXActionType.INSERT,
|
|
10234
|
+
body: {
|
|
10235
|
+
dataStream: DataStreamTreeTokenType.CUSTOM_RANGE_START
|
|
10236
|
+
},
|
|
10237
|
+
len: 1,
|
|
10238
|
+
line: 0,
|
|
10239
|
+
segmentId
|
|
10240
|
+
}), deletes.forEach((index22) => {
|
|
10241
|
+
index22 !== cursor2 && (textX.push({
|
|
10242
|
+
t: TextXActionType.RETAIN,
|
|
10243
|
+
len: index22 - cursor2,
|
|
10244
|
+
segmentId
|
|
10245
|
+
}), cursor2 = index22), textX.push({
|
|
10246
|
+
t: TextXActionType.DELETE,
|
|
10247
|
+
len: 1,
|
|
10248
|
+
line: 0,
|
|
10249
|
+
segmentId
|
|
10250
|
+
}), cursor2++;
|
|
10251
|
+
}), cursor2 !== range2.endOffset && (textX.push({
|
|
10252
|
+
t: TextXActionType.RETAIN,
|
|
10253
|
+
len: range2.endOffset - cursor2,
|
|
10254
|
+
segmentId
|
|
10255
|
+
}), cursor2 = range2.endOffset), textX.push({
|
|
10256
|
+
t: TextXActionType.INSERT,
|
|
10257
|
+
body: {
|
|
10258
|
+
dataStream: DataStreamTreeTokenType.CUSTOM_RANGE_END,
|
|
10259
|
+
customRanges: [
|
|
10260
|
+
{
|
|
10261
|
+
rangeId: index2 ? `${rangeId}-${index2}` : rangeId,
|
|
10262
|
+
rangeType,
|
|
10263
|
+
startIndex: -(range2.endOffset - range2.startOffset - deletes.length + 1),
|
|
10264
|
+
endIndex: 0,
|
|
10265
|
+
wholeEntity,
|
|
10266
|
+
properties: {
|
|
10267
|
+
...properties
|
|
10268
|
+
}
|
|
10269
|
+
}
|
|
10270
|
+
]
|
|
10271
|
+
},
|
|
10272
|
+
len: 1,
|
|
10273
|
+
line: 0,
|
|
10274
|
+
segmentId
|
|
10275
|
+
});
|
|
10276
|
+
}, "addCustomRange"), relativeParagraphs = ((_b2 = body.paragraphs) != null ? _b2 : []).filter((p) => p.startIndex < endOffset && p.startIndex > startOffset);
|
|
10277
|
+
return excludePointsFromRange([startOffset, endOffset - 1], relativeParagraphs.map((p) => p.startIndex)).forEach(([start, end], i) => addCustomRange(start, end, i)), textX;
|
|
10278
|
+
}
|
|
10279
|
+
__name(addCustomRangeTextX, "addCustomRangeTextX");
|
|
10280
|
+
function getRetainAndDeleteAndExcludeLineBreak(selection, body, segmentId = "", memoryCursor = 0, preserveLineBreak = !0) {
|
|
10281
|
+
var _a13;
|
|
10282
|
+
const { startOffset, endOffset } = getDeleteSelection(selection, body), dos = [], { paragraphs = [], dataStream } = body, textStart = startOffset - memoryCursor, textEnd = endOffset - memoryCursor, paragraphInRange = paragraphs == null ? void 0 : paragraphs.find(
|
|
10283
|
+
(p) => p.startIndex - memoryCursor >= textStart && p.startIndex - memoryCursor < textEnd
|
|
10284
|
+
), relativeCustomRanges = (_a13 = body.customRanges) == null ? void 0 : _a13.filter((customRange) => isIntersecting(customRange.startIndex, customRange.endIndex, startOffset, endOffset)), toDeleteRanges = new Set(relativeCustomRanges == null ? void 0 : relativeCustomRanges.filter((customRange) => shouldDeleteCustomRange(startOffset, endOffset - startOffset, customRange, dataStream))), retainPoints = /* @__PURE__ */ new Set();
|
|
10285
|
+
if (relativeCustomRanges == null || relativeCustomRanges.forEach((range) => {
|
|
10286
|
+
toDeleteRanges.has(range) || (range.startIndex - memoryCursor >= textStart && range.startIndex - memoryCursor <= textEnd && range.endIndex - memoryCursor > textEnd && retainPoints.add(range.startIndex), range.endIndex - memoryCursor >= textStart && range.endIndex - memoryCursor <= textEnd && range.startIndex < textStart && retainPoints.add(range.endIndex));
|
|
10287
|
+
}), textStart > 0 && dos.push({
|
|
10288
|
+
t: TextXActionType.RETAIN,
|
|
10289
|
+
len: textStart,
|
|
10290
|
+
segmentId
|
|
10291
|
+
}), preserveLineBreak && paragraphInRange && paragraphInRange.startIndex - memoryCursor > textStart) {
|
|
10292
|
+
const paragraphIndex = paragraphInRange.startIndex - memoryCursor;
|
|
10293
|
+
retainPoints.add(paragraphIndex);
|
|
10294
|
+
}
|
|
10295
|
+
const sortedRetains = [...retainPoints].sort((pre, aft) => pre - aft);
|
|
10296
|
+
let cursor2 = textStart;
|
|
10297
|
+
return sortedRetains.forEach((pos) => {
|
|
10298
|
+
const len = pos - cursor2;
|
|
10299
|
+
len > 0 && dos.push({
|
|
10300
|
+
t: TextXActionType.DELETE,
|
|
10301
|
+
len,
|
|
10302
|
+
line: 0,
|
|
10303
|
+
segmentId
|
|
10304
|
+
}), dos.push({
|
|
10305
|
+
t: TextXActionType.RETAIN,
|
|
10306
|
+
len: 1,
|
|
10307
|
+
segmentId
|
|
10308
|
+
}), cursor2 = pos + 1;
|
|
10309
|
+
}), cursor2 < textEnd && dos.push({
|
|
10310
|
+
t: TextXActionType.DELETE,
|
|
10311
|
+
len: textEnd - cursor2,
|
|
10312
|
+
line: 0,
|
|
10313
|
+
segmentId
|
|
10314
|
+
}), dos;
|
|
10315
|
+
}
|
|
10316
|
+
__name(getRetainAndDeleteAndExcludeLineBreak, "getRetainAndDeleteAndExcludeLineBreak");
|
|
10317
|
+
const replaceSelectionTextX = /* @__PURE__ */ __name((params) => {
|
|
10318
|
+
var _a13;
|
|
10319
|
+
const { selection, body: insertBody, doc } = params, segmentId = selection.segmentId, body = (_a13 = doc.getSelfOrHeaderFooterModel(segmentId)) == null ? void 0 : _a13.getBody();
|
|
10320
|
+
if (!body) return !1;
|
|
10321
|
+
const textX = new TextX(), deleteActions = getRetainAndDeleteAndExcludeLineBreak(selection, body, segmentId);
|
|
10322
|
+
return deleteActions.length && textX.push(...deleteActions), textX.push({
|
|
10323
|
+
t: TextXActionType.INSERT,
|
|
10324
|
+
body: insertBody,
|
|
10325
|
+
len: insertBody.dataStream.length,
|
|
10326
|
+
line: 0,
|
|
10327
|
+
segmentId
|
|
10328
|
+
}), textX;
|
|
10329
|
+
}, "replaceSelectionTextX"), _BuildTextUtils = class _BuildTextUtils {
|
|
10330
|
+
};
|
|
10331
|
+
__name(_BuildTextUtils, "BuildTextUtils"), __publicField(_BuildTextUtils, "customRange", {
|
|
10332
|
+
add: addCustomRangeTextX,
|
|
10333
|
+
delete: deleteCustomRangeTextX,
|
|
10334
|
+
copyCustomRange,
|
|
10335
|
+
getCustomRangesInterestsWithRange,
|
|
10336
|
+
shouldDeleteCustomRange,
|
|
10337
|
+
isIntersecting
|
|
10338
|
+
}), __publicField(_BuildTextUtils, "selection", {
|
|
10339
|
+
replace: replaceSelectionTextX,
|
|
10340
|
+
makeSelection,
|
|
10341
|
+
normalizeSelection,
|
|
10342
|
+
getSelectionWithSymbolMax,
|
|
10343
|
+
getSelectionWithNoSymbolSide,
|
|
10344
|
+
getDeleteSelection,
|
|
10345
|
+
getInsertSelection,
|
|
10346
|
+
getDeleteActions: getRetainAndDeleteFromReplace,
|
|
10347
|
+
getDeleteExculdeLastLineBreakActions: getRetainAndDeleteAndExcludeLineBreak
|
|
10348
|
+
}), __publicField(_BuildTextUtils, "range", {
|
|
10349
|
+
isIntersects: isSegmentIntersects
|
|
10350
|
+
});
|
|
10351
|
+
let BuildTextUtils = _BuildTextUtils;
|
|
9938
10352
|
const _ColumnManager = class _ColumnManager {
|
|
9939
10353
|
constructor(_config, data) {
|
|
9940
10354
|
__publicField(this, "_columnData", {});
|
|
@@ -10098,7 +10512,7 @@ const _RowManager = class _RowManager {
|
|
|
10098
10512
|
/**
|
|
10099
10513
|
* Get row data of given row
|
|
10100
10514
|
* @param rowPos row index
|
|
10101
|
-
* @returns
|
|
10515
|
+
* @returns {Nullable<Partial<IRowData>>} rowData
|
|
10102
10516
|
*/
|
|
10103
10517
|
getRow(rowPos) {
|
|
10104
10518
|
return this._rowData[rowPos];
|
|
@@ -10511,15 +10925,23 @@ const _Worksheet = class _Worksheet {
|
|
|
10511
10925
|
return this._viewModel.getRowFiltered(row) ? 0 : this.getRowManager().getRowHeight(row);
|
|
10512
10926
|
}
|
|
10513
10927
|
/**
|
|
10514
|
-
*
|
|
10928
|
+
* Row is filtered out, that means this row is invisible.
|
|
10929
|
+
* @param row
|
|
10930
|
+
* @returns {boolean} is row hidden by filter
|
|
10931
|
+
*/
|
|
10932
|
+
isRowFiltered(row) {
|
|
10933
|
+
return this._viewModel.getRowFiltered(row);
|
|
10934
|
+
}
|
|
10935
|
+
/**
|
|
10936
|
+
* Get if the row is visible. It may be affected by features like filter and view.
|
|
10515
10937
|
* @param row the row index
|
|
10516
|
-
* @returns if the row in visible to the user
|
|
10938
|
+
* @returns {boolean} if the row in visible to the user
|
|
10517
10939
|
*/
|
|
10518
10940
|
getRowVisible(row) {
|
|
10519
|
-
return this.
|
|
10941
|
+
return !this.isRowFiltered(row) && this.getRowRawVisible(row);
|
|
10520
10942
|
}
|
|
10521
10943
|
/**
|
|
10522
|
-
* Get if the row does not have `hidden` property.
|
|
10944
|
+
* Get if the row does not have `hidden` property. This value won't affected by features like filter and view.
|
|
10523
10945
|
* @param row the row index
|
|
10524
10946
|
* @returns if the row does not have `hidden` property
|
|
10525
10947
|
*/
|
|
@@ -10538,7 +10960,7 @@ const _Worksheet = class _Worksheet {
|
|
|
10538
10960
|
return ranges.forEach((range) => range.endRow = lastRow), ranges;
|
|
10539
10961
|
}
|
|
10540
10962
|
/**
|
|
10541
|
-
* Get all visible rows in the sheet.
|
|
10963
|
+
* Get all visible rows in the sheet.(not include filter & view, like getRawVisibleRows)
|
|
10542
10964
|
* @returns Visible rows range list
|
|
10543
10965
|
*/
|
|
10544
10966
|
getVisibleRows() {
|
|
@@ -10546,7 +10968,7 @@ const _Worksheet = class _Worksheet {
|
|
|
10546
10968
|
return this._rowManager.getVisibleRows(0, rowCount - 1);
|
|
10547
10969
|
}
|
|
10548
10970
|
/**
|
|
10549
|
-
* Get all visible columns in the sheet.
|
|
10971
|
+
* Get all visible columns in the sheet.(not include filter & view)
|
|
10550
10972
|
* @returns Visible columns range list
|
|
10551
10973
|
*/
|
|
10552
10974
|
getVisibleCols() {
|
|
@@ -10680,12 +11102,12 @@ function extractPureTextFromCell(cell) {
|
|
|
10680
11102
|
return "";
|
|
10681
11103
|
const richTextValue = (_b2 = (_a13 = cell.p) == null ? void 0 : _a13.body) == null ? void 0 : _b2.dataStream;
|
|
10682
11104
|
if (richTextValue)
|
|
10683
|
-
return richTextValue;
|
|
11105
|
+
return richTextValue.replaceAll(DataStreamTreeTokenType.CUSTOM_RANGE_START, "").replaceAll(DataStreamTreeTokenType.CUSTOM_RANGE_END, "");
|
|
10684
11106
|
const rawValue = cell.v;
|
|
10685
11107
|
return typeof rawValue == "string" ? cell.t === CellValueType.BOOLEAN ? rawValue.toUpperCase() : rawValue.replace(/[\r\n]/g, "") : typeof rawValue == "number" ? cell.t === CellValueType.BOOLEAN ? rawValue ? "TRUE" : "FALSE" : rawValue.toString() : typeof rawValue == "boolean" ? rawValue ? "TRUE" : "FALSE" : "";
|
|
10686
11108
|
}
|
|
10687
11109
|
__name(extractPureTextFromCell, "extractPureTextFromCell");
|
|
10688
|
-
const version = "0.2.
|
|
11110
|
+
const version = "0.2.13";
|
|
10689
11111
|
function getEmptySnapshot(unitID = "", locale = LocaleType.ZH_CN, name = "") {
|
|
10690
11112
|
return {
|
|
10691
11113
|
id: unitID,
|
|
@@ -11854,9 +12276,9 @@ let PluginService = (_a9 = class {
|
|
|
11854
12276
|
_assertPluginValid(ctor) {
|
|
11855
12277
|
const { type: type2, pluginName } = ctor;
|
|
11856
12278
|
if (type2 === I.UNRECOGNIZED)
|
|
11857
|
-
throw new Error(`[PluginService]: invalid plugin type for ${ctor}. Please assign a "type" to your plugin.`);
|
|
11858
|
-
if (pluginName
|
|
11859
|
-
throw new Error(`[PluginService]: no plugin name for ${ctor}. Please assign a "pluginName" to your plugin.`);
|
|
12279
|
+
throw new Error(`[PluginService]: invalid plugin type for ${ctor.name}. Please assign a "type" to your plugin.`);
|
|
12280
|
+
if (!pluginName)
|
|
12281
|
+
throw new Error(`[PluginService]: no plugin name for ${ctor.name}. Please assign a "pluginName" to your plugin.`);
|
|
11860
12282
|
if (this._seenPlugins.has(pluginName))
|
|
11861
12283
|
throw new Error(`[PluginService]: duplicated plugin name for "${pluginName}". Maybe a plugin that dependents on "${pluginName} has already registered it. In that case please register "${pluginName}" before the that plugin.`);
|
|
11862
12284
|
this._seenPlugins.add(ctor.pluginName);
|
|
@@ -11926,14 +12348,14 @@ let PluginHolder = (_a10 = class extends Disposable {
|
|
|
11926
12348
|
const NotRegistered = dependents.find((d) => !this._checkPluginRegistered(d));
|
|
11927
12349
|
return NotRegistered ? (this._logService.debug(
|
|
11928
12350
|
"[PluginService]",
|
|
11929
|
-
`
|
|
12351
|
+
`Plugin "${plugin.pluginName}" depends on "${NotRegistered.pluginName}" which is not registered. Univer will automatically register it with default configuration.`
|
|
11930
12352
|
), this._registerPlugin(NotRegistered, void 0), !0) : !1;
|
|
11931
12353
|
}, "exhaustUnregisteredDependents");
|
|
11932
12354
|
for (; exhaustUnregisteredDependents(); )
|
|
11933
12355
|
;
|
|
11934
12356
|
}
|
|
11935
12357
|
const pluginInstance = this._injector.createInstance(plugin, options);
|
|
11936
|
-
return this._pluginStore.addPlugin(pluginInstance), pluginInstance;
|
|
12358
|
+
return this._pluginStore.addPlugin(pluginInstance), this._logService.debug("[PluginService]", `Plugin "${pluginInstance.getPluginName()}" registered.`), pluginInstance;
|
|
11937
12359
|
}
|
|
11938
12360
|
// Here we should be careful with the sequence of which plugin should run first. We should manually add a queue here.
|
|
11939
12361
|
// Because lately registered plugins may get executed first.
|
|
@@ -12233,19 +12655,19 @@ const IAuthzIoService = createIdentifier("IAuthzIoIoService"), _Univer = class _
|
|
|
12233
12655
|
* @deprecated use `createUnit` instead
|
|
12234
12656
|
*/
|
|
12235
12657
|
createUniverSheet(data) {
|
|
12236
|
-
return this._univerInstanceService.createUnit(I.UNIVER_SHEET, data);
|
|
12658
|
+
return this._injector.get(ILogService).warn("[Univer]: Univer.createUniverSheet is deprecated, use createUnit instead"), this._univerInstanceService.createUnit(I.UNIVER_SHEET, data);
|
|
12237
12659
|
}
|
|
12238
12660
|
/**
|
|
12239
12661
|
* @deprecated use `createUnit` instead
|
|
12240
12662
|
*/
|
|
12241
12663
|
createUniverDoc(data) {
|
|
12242
|
-
return this._univerInstanceService.createUnit(I.UNIVER_DOC, data);
|
|
12664
|
+
return this._injector.get(ILogService).warn("[Univer]: Univer.createUniverDoc is deprecated, use createUnit instead"), this._univerInstanceService.createUnit(I.UNIVER_DOC, data);
|
|
12243
12665
|
}
|
|
12244
12666
|
/**
|
|
12245
12667
|
* @deprecated use `createUnit` instead
|
|
12246
12668
|
*/
|
|
12247
12669
|
createUniverSlide(data) {
|
|
12248
|
-
return this._univerInstanceService.createUnit(I.UNIVER_SLIDE, data);
|
|
12670
|
+
return this._injector.get(ILogService).warn("[Univer]: Univer.createUniverSlide is deprecated, use createUnit instead"), this._univerInstanceService.createUnit(I.UNIVER_SLIDE, data);
|
|
12249
12671
|
}
|
|
12250
12672
|
_init(injector) {
|
|
12251
12673
|
this._univerInstanceService.registerCtorForType(I.UNIVER_SHEET, Workbook), this._univerInstanceService.registerCtorForType(I.UNIVER_DOC, DocumentDataModel), this._univerInstanceService.registerCtorForType(I.UNIVER_SLIDE, SlideDataModel);
|
|
@@ -12507,6 +12929,9 @@ const composeInterceptors = /* @__PURE__ */ __name((interceptors) => function(in
|
|
|
12507
12929
|
getInterceptPoints() {
|
|
12508
12930
|
return this._interceptorPoints;
|
|
12509
12931
|
}
|
|
12932
|
+
dispose() {
|
|
12933
|
+
this._interceptorsByName.clear();
|
|
12934
|
+
}
|
|
12510
12935
|
};
|
|
12511
12936
|
__name(_InterceptorManager, "InterceptorManager");
|
|
12512
12937
|
let InterceptorManager = _InterceptorManager;
|
|
@@ -12542,6 +12967,7 @@ export {
|
|
|
12542
12967
|
BooleanNumber,
|
|
12543
12968
|
BorderStyleTypes,
|
|
12544
12969
|
BorderType,
|
|
12970
|
+
BuildTextUtils,
|
|
12545
12971
|
BulletAlignment,
|
|
12546
12972
|
COLORS,
|
|
12547
12973
|
CellValueType,
|
|
@@ -12583,6 +13009,7 @@ export {
|
|
|
12583
13009
|
DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,
|
|
12584
13010
|
DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
|
|
12585
13011
|
DOCS_ZEN_EDITOR_UNIT_ID_KEY,
|
|
13012
|
+
DOC_RANGE_TYPE,
|
|
12586
13013
|
DashStyleType,
|
|
12587
13014
|
DataStreamTreeNodeType,
|
|
12588
13015
|
DataStreamTreeTokenType,
|
|
@@ -12592,6 +13019,7 @@ export {
|
|
|
12592
13019
|
DataValidationRenderMode,
|
|
12593
13020
|
DataValidationStatus,
|
|
12594
13021
|
DataValidationType,
|
|
13022
|
+
DeleteDirection,
|
|
12595
13023
|
DependentOn,
|
|
12596
13024
|
DesktopLogService,
|
|
12597
13025
|
DeveloperMetadataVisibility,
|
|
@@ -12686,6 +13114,7 @@ export {
|
|
|
12686
13114
|
Quantity,
|
|
12687
13115
|
QuickListType,
|
|
12688
13116
|
QuickListTypeMap,
|
|
13117
|
+
RANGE_DIRECTION,
|
|
12689
13118
|
RANGE_TYPE,
|
|
12690
13119
|
RCDisposable,
|
|
12691
13120
|
RGBA_PAREN,
|
|
@@ -12734,7 +13163,6 @@ export {
|
|
|
12734
13163
|
ThemeColors,
|
|
12735
13164
|
ThemeService,
|
|
12736
13165
|
Tools,
|
|
12737
|
-
UNIVER_INTERNAL,
|
|
12738
13166
|
UndoCommand,
|
|
12739
13167
|
UndoCommandId,
|
|
12740
13168
|
UnitModel,
|