@univerjs/core 0.2.6 → 0.2.7
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 +7 -7
- package/lib/es/index.js +1181 -209
- package/lib/types/common/const.d.ts +1 -1
- package/lib/types/common/error.d.ts +18 -0
- package/lib/types/common/unit.d.ts +3 -0
- package/lib/types/docs/data-model/document-data-model.d.ts +4 -3
- package/lib/types/docs/data-model/json-x/json-x.d.ts +2 -1
- package/lib/types/docs/data-model/preset-list-type.d.ts +54 -4
- package/lib/types/docs/data-model/text-x/__tests__/transform-position.spec.d.ts +16 -0
- package/lib/types/docs/data-model/text-x/__tests__/transform.spec.d.ts +16 -0
- package/lib/types/docs/data-model/text-x/apply-utils/common.d.ts +2 -2
- package/lib/types/docs/data-model/text-x/text-x.d.ts +31 -1
- package/lib/types/docs/data-model/text-x/transform-utils.d.ts +3 -0
- package/lib/types/docs/data-model/types.d.ts +12 -10
- package/lib/types/index.d.ts +2 -1
- package/lib/types/services/context/context.d.ts +3 -1
- package/lib/types/services/instance/instance.service.d.ts +18 -6
- package/lib/types/services/resource-manager/resource-manager.service.d.ts +4 -6
- package/lib/types/services/resource-manager/type.d.ts +8 -4
- package/lib/types/services/snapshot/snapshot-transform.d.ts +3 -0
- package/lib/types/shared/shape.d.ts +6 -0
- package/lib/types/shared/tools.d.ts +11 -0
- package/lib/types/sheets/workbook.d.ts +1 -0
- package/lib/types/slides/slide-model.d.ts +18 -3
- package/lib/types/types/interfaces/i-document-data-interceptor.d.ts +5 -1
- package/lib/types/types/interfaces/i-document-data.d.ts +93 -46
- package/lib/types/types/interfaces/i-workbook-data.d.ts +6 -5
- package/lib/umd/index.js +7 -7
- package/package.json +8 -5
package/lib/es/index.js
CHANGED
|
@@ -4,6 +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
8
|
import * as React from "react";
|
|
8
9
|
import React__default, { useState, useEffect, useRef, useMemo, createContext, useCallback, useContext } from "react";
|
|
9
10
|
function _mergeNamespaces(n, m) {
|
|
@@ -845,7 +846,7 @@ function isCellV(cell) {
|
|
|
845
846
|
return cell != null && (typeof cell == "string" || typeof cell == "number" || typeof cell == "boolean");
|
|
846
847
|
}
|
|
847
848
|
__name(isCellV, "isCellV");
|
|
848
|
-
var DocStyleType = /* @__PURE__ */ ((DocStyleType2) => (DocStyleType2[DocStyleType2.character = 0] = "character", DocStyleType2[DocStyleType2.paragraph = 1] = "paragraph", DocStyleType2[DocStyleType2.table = 2] = "table", DocStyleType2[DocStyleType2.numbering = 3] = "numbering", DocStyleType2))(DocStyleType || {}), FollowNumberWithType = /* @__PURE__ */ ((FollowNumberWithType2) => (FollowNumberWithType2[FollowNumberWithType2.TAB = 0] = "TAB", FollowNumberWithType2[FollowNumberWithType2.SPACE = 1] = "SPACE", FollowNumberWithType2[FollowNumberWithType2.NOTHING = 2] = "NOTHING", FollowNumberWithType2))(FollowNumberWithType || {}), GlyphType = /* @__PURE__ */ ((GlyphType2) => (GlyphType2[GlyphType2.BULLET = 0] = "BULLET", GlyphType2[GlyphType2.NONE = 1] = "NONE", GlyphType2[GlyphType2.DECIMAL = 2] = "DECIMAL", GlyphType2[GlyphType2.DECIMAL_ZERO = 3] = "DECIMAL_ZERO", GlyphType2[GlyphType2.UPPER_LETTER = 4] = "UPPER_LETTER", GlyphType2[GlyphType2.LOWER_LETTER = 5] = "LOWER_LETTER", GlyphType2[GlyphType2.UPPER_ROMAN = 6] = "UPPER_ROMAN", GlyphType2[GlyphType2.LOWER_ROMAN = 7] = "LOWER_ROMAN", GlyphType2[GlyphType2.ORDINAL = 8] = "ORDINAL", GlyphType2[GlyphType2.CARDINAL_TEXT = 9] = "CARDINAL_TEXT", GlyphType2[GlyphType2.ORDINAL_TEXT = 10] = "ORDINAL_TEXT", GlyphType2[GlyphType2.HEX = 11] = "HEX", GlyphType2[GlyphType2.CHICAGO = 12] = "CHICAGO", GlyphType2[GlyphType2.IDEOGRAPH_DIGITAL = 13] = "IDEOGRAPH_DIGITAL", GlyphType2[GlyphType2.JAPANESE_COUNTING = 14] = "JAPANESE_COUNTING", GlyphType2[GlyphType2.AIUEO = 15] = "AIUEO", GlyphType2[GlyphType2.IROHA = 16] = "IROHA", GlyphType2[GlyphType2.DECIMAL_FULL_WIDTH = 17] = "DECIMAL_FULL_WIDTH", GlyphType2[GlyphType2.DECIMAL_HALF_WIDTH = 18] = "DECIMAL_HALF_WIDTH", GlyphType2[GlyphType2.JAPANESE_LEGAL = 19] = "JAPANESE_LEGAL", GlyphType2[GlyphType2.JAPANESE_DIGITAL_TEN_THOUSAND = 20] = "JAPANESE_DIGITAL_TEN_THOUSAND", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_CIRCLE = 21] = "DECIMAL_ENCLOSED_CIRCLE", GlyphType2[GlyphType2.DECIMAL_FULL_WIDTH2 = 22] = "DECIMAL_FULL_WIDTH2", GlyphType2[GlyphType2.AIUEO_FULL_WIDTH = 23] = "AIUEO_FULL_WIDTH", GlyphType2[GlyphType2.IROHA_FULL_WIDTH = 24] = "IROHA_FULL_WIDTH", GlyphType2[GlyphType2.GANADA = 25] = "GANADA", GlyphType2[GlyphType2.CHOSUNG = 26] = "CHOSUNG", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_FULLSTOP = 27] = "DECIMAL_ENCLOSED_FULLSTOP", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_PAREN = 28] = "DECIMAL_ENCLOSED_PAREN", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_CIRCLE_CHINESE = 29] = "DECIMAL_ENCLOSED_CIRCLE_CHINESE", GlyphType2[GlyphType2.IDEOGRAPH_ENCLOSED_CIRCLE = 30] = "IDEOGRAPH_ENCLOSED_CIRCLE", GlyphType2[GlyphType2.IDEOGRAPH_TRADITIONAL = 31] = "IDEOGRAPH_TRADITIONAL", GlyphType2[GlyphType2.IDEOGRAPH_ZODIAC = 32] = "IDEOGRAPH_ZODIAC", GlyphType2[GlyphType2.IDEOGRAPH_ZODIAC_TRADITIONAL = 33] = "IDEOGRAPH_ZODIAC_TRADITIONAL", GlyphType2[GlyphType2.TAIWANESE_COUNTING = 34] = "TAIWANESE_COUNTING", GlyphType2[GlyphType2.IDEOGRAPH_LEGAL_TRADITIONAL = 35] = "IDEOGRAPH_LEGAL_TRADITIONAL", GlyphType2[GlyphType2.TAIWANESE_COUNTING_THOUSAND = 36] = "TAIWANESE_COUNTING_THOUSAND", GlyphType2[GlyphType2.TAIWANESE_DIGITAL = 37] = "TAIWANESE_DIGITAL", GlyphType2[GlyphType2.CHINESE_COUNTING = 38] = "CHINESE_COUNTING", GlyphType2[GlyphType2.CHINESE_LEGAL_SIMPLIFIED = 39] = "CHINESE_LEGAL_SIMPLIFIED", GlyphType2[GlyphType2.CHINESE_COUNTING_THOUSAND = 40] = "CHINESE_COUNTING_THOUSAND", GlyphType2[GlyphType2.KOREAN_DIGITAL = 41] = "KOREAN_DIGITAL", GlyphType2[GlyphType2.KOREAN_COUNTING = 42] = "KOREAN_COUNTING", GlyphType2[GlyphType2.KOREAN_LEGAL = 43] = "KOREAN_LEGAL", GlyphType2[GlyphType2.KOREAN_DIGITAL2 = 44] = "KOREAN_DIGITAL2", GlyphType2[GlyphType2.VIETNAMESE_COUNTING = 45] = "VIETNAMESE_COUNTING", GlyphType2[GlyphType2.RUSSIAN_LOWER = 46] = "RUSSIAN_LOWER", GlyphType2[GlyphType2.RUSSIAN_UPPER = 47] = "RUSSIAN_UPPER", GlyphType2[GlyphType2.NUMBER_IN_DASH = 48] = "NUMBER_IN_DASH", GlyphType2[GlyphType2.HEBREW1 = 49] = "HEBREW1", GlyphType2[GlyphType2.HEBREW2 = 50] = "HEBREW2", GlyphType2[GlyphType2.ARABIC_ALPHA = 51] = "ARABIC_ALPHA", GlyphType2[GlyphType2.ARABIC_ABJAD = 52] = "ARABIC_ABJAD", GlyphType2[GlyphType2.HINDI_VOWELS = 53] = "HINDI_VOWELS", GlyphType2[GlyphType2.HINDI_CONSONANTS = 54] = "HINDI_CONSONANTS", GlyphType2[GlyphType2.HINDI_NUMBERS = 55] = "HINDI_NUMBERS", GlyphType2[GlyphType2.HINDI_COUNTING = 56] = "HINDI_COUNTING", GlyphType2[GlyphType2.THAI_LETTERS = 57] = "THAI_LETTERS", GlyphType2[GlyphType2.THAI_NUMBERS = 58] = "THAI_NUMBERS", GlyphType2[GlyphType2.THAI_COUNTING = 59] = "THAI_COUNTING", GlyphType2[GlyphType2.CUSTOM = 60] = "CUSTOM", GlyphType2))(GlyphType || {}), BulletAlignment = /* @__PURE__ */ ((BulletAlignment2) => (BulletAlignment2[BulletAlignment2.BULLET_ALIGNMENT_UNSPECIFIED = 0] = "BULLET_ALIGNMENT_UNSPECIFIED", BulletAlignment2[BulletAlignment2.START = 1] = "START", BulletAlignment2[BulletAlignment2.CENTER = 2] = "CENTER", BulletAlignment2[BulletAlignment2.END = 3] = "END", BulletAlignment2[BulletAlignment2.BOTH = 4] = "BOTH", BulletAlignment2))(BulletAlignment || {}), CustomRangeType = /* @__PURE__ */ ((CustomRangeType2) => (CustomRangeType2[CustomRangeType2.HYPERLINK = 0] = "HYPERLINK", CustomRangeType2[CustomRangeType2.FIELD = 1] = "FIELD", CustomRangeType2[CustomRangeType2.SDT = 2] = "SDT", CustomRangeType2[CustomRangeType2.BOOKMARK = 3] = "BOOKMARK", CustomRangeType2[CustomRangeType2.COMMENT = 4] = "COMMENT", CustomRangeType2[CustomRangeType2.CUSTOM = 5] = "CUSTOM", CustomRangeType2[CustomRangeType2.MENTION = 6] = "MENTION", CustomRangeType2[CustomRangeType2.UNI_FORMULA = 7] = "UNI_FORMULA", CustomRangeType2))(CustomRangeType || {}), CustomDecorationType = /* @__PURE__ */ ((CustomDecorationType2) => (CustomDecorationType2[CustomDecorationType2.COMMENT = 0] = "COMMENT", CustomDecorationType2))(CustomDecorationType || {}), BlockType = /* @__PURE__ */ ((BlockType2) => (BlockType2[BlockType2.DRAWING = 0] = "DRAWING", BlockType2[BlockType2.CUSTOM = 1] = "CUSTOM", BlockType2))(BlockType || {}), DocumentFlavor = /* @__PURE__ */ ((DocumentFlavor2) => (DocumentFlavor2[DocumentFlavor2.TRADITIONAL = 0] = "TRADITIONAL", DocumentFlavor2[DocumentFlavor2.MODERN = 1] = "MODERN", DocumentFlavor2))(DocumentFlavor || {}), GridType = /* @__PURE__ */ ((GridType2) => (GridType2[GridType2.DEFAULT = 0] = "DEFAULT", GridType2[GridType2.LINES = 1] = "LINES", GridType2[GridType2.LINES_AND_CHARS = 2] = "LINES_AND_CHARS", GridType2[GridType2.SNAP_TO_CHARS = 3] = "SNAP_TO_CHARS", GridType2))(GridType || {}), SectionType = /* @__PURE__ */ ((SectionType2) => (SectionType2[SectionType2.SECTION_TYPE_UNSPECIFIED = 0] = "SECTION_TYPE_UNSPECIFIED", SectionType2[SectionType2.CONTINUOUS = 1] = "CONTINUOUS", SectionType2[SectionType2.NEXT_PAGE = 2] = "NEXT_PAGE", SectionType2[SectionType2.EVEN_PAGE = 3] = "EVEN_PAGE", SectionType2[SectionType2.ODD_PAGE = 4] = "ODD_PAGE", SectionType2))(SectionType || {}), ColumnSeparatorType = /* @__PURE__ */ ((ColumnSeparatorType2) => (ColumnSeparatorType2[ColumnSeparatorType2.COLUMN_SEPARATOR_STYLE_UNSPECIFIED = 0] = "COLUMN_SEPARATOR_STYLE_UNSPECIFIED", ColumnSeparatorType2[ColumnSeparatorType2.NONE = 1] = "NONE", ColumnSeparatorType2[ColumnSeparatorType2.BETWEEN_EACH_COLUMN = 2] = "BETWEEN_EACH_COLUMN", ColumnSeparatorType2))(ColumnSeparatorType || {}), TextDirectionType = /* @__PURE__ */ ((TextDirectionType2) => (TextDirectionType2[TextDirectionType2.NORMAL = 0] = "NORMAL", TextDirectionType2[TextDirectionType2.TBRL = 1] = "TBRL", TextDirectionType2[TextDirectionType2.LRTBV = 2] = "LRTBV", TextDirectionType2))(TextDirectionType || {}), ParagraphElementType = /* @__PURE__ */ ((ParagraphElementType2) => (ParagraphElementType2[ParagraphElementType2.TEXT_RUN = 0] = "TEXT_RUN", ParagraphElementType2[ParagraphElementType2.AUTO_TEXT = 1] = "AUTO_TEXT", ParagraphElementType2[ParagraphElementType2.PAGE_BREAK = 2] = "PAGE_BREAK", ParagraphElementType2[ParagraphElementType2.COLUMN_BREAK = 3] = "COLUMN_BREAK", ParagraphElementType2[ParagraphElementType2.FOOT_NOTE_REFERENCE = 4] = "FOOT_NOTE_REFERENCE", ParagraphElementType2[ParagraphElementType2.HORIZONTAL_RULE = 5] = "HORIZONTAL_RULE", ParagraphElementType2[ParagraphElementType2.EQUATION = 6] = "EQUATION", ParagraphElementType2[ParagraphElementType2.DRAWING = 7] = "DRAWING", ParagraphElementType2[ParagraphElementType2.PERSON = 8] = "PERSON", ParagraphElementType2[ParagraphElementType2.RICH_LINK = 9] = "RICH_LINK", ParagraphElementType2))(ParagraphElementType || {}), WrapTextType = /* @__PURE__ */ ((WrapTextType2) => (WrapTextType2[WrapTextType2.BOTH_SIDES = 0] = "BOTH_SIDES", WrapTextType2[WrapTextType2.LEFT = 1] = "LEFT", WrapTextType2[WrapTextType2.RIGHT = 2] = "RIGHT", WrapTextType2[WrapTextType2.LARGEST = 3] = "LARGEST", WrapTextType2))(WrapTextType || {}), PositionedObjectLayoutType = /* @__PURE__ */ ((PositionedObjectLayoutType2) => (PositionedObjectLayoutType2[PositionedObjectLayoutType2.INLINE = 0] = "INLINE", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_NONE = 1] = "WRAP_NONE", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_POLYGON = 2] = "WRAP_POLYGON", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_SQUARE = 3] = "WRAP_SQUARE", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_THROUGH = 4] = "WRAP_THROUGH", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_TIGHT = 5] = "WRAP_TIGHT", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_TOP_AND_BOTTOM = 6] = "WRAP_TOP_AND_BOTTOM", PositionedObjectLayoutType2))(PositionedObjectLayoutType || {}), NamedStyleType = /* @__PURE__ */ ((NamedStyleType2) => (NamedStyleType2[NamedStyleType2.NAMED_STYLE_TYPE_UNSPECIFIED = 0] = "NAMED_STYLE_TYPE_UNSPECIFIED", NamedStyleType2[NamedStyleType2.NORMAL_TEXT = 1] = "NORMAL_TEXT", NamedStyleType2[NamedStyleType2.TITLE = 2] = "TITLE", NamedStyleType2[NamedStyleType2.SUBTITLE = 3] = "SUBTITLE", NamedStyleType2[NamedStyleType2.HEADING_1 = 4] = "HEADING_1", NamedStyleType2[NamedStyleType2.HEADING_2 = 5] = "HEADING_2", NamedStyleType2[NamedStyleType2.HEADING_3 = 6] = "HEADING_3", NamedStyleType2[NamedStyleType2.HEADING_4 = 7] = "HEADING_4", NamedStyleType2[NamedStyleType2.HEADING_5 = 8] = "HEADING_5", NamedStyleType2[NamedStyleType2.HEADING_6 = 9] = "HEADING_6", NamedStyleType2))(NamedStyleType || {}), SpacingRule = /* @__PURE__ */ ((SpacingRule2) => (SpacingRule2[SpacingRule2.AUTO = 0] = "AUTO", SpacingRule2[SpacingRule2.AT_LEAST = 1] = "AT_LEAST", SpacingRule2[SpacingRule2.EXACT = 2] = "EXACT", SpacingRule2))(SpacingRule || {}), DashStyleType = /* @__PURE__ */ ((DashStyleType2) => (DashStyleType2[DashStyleType2.DASH_STYLE_UNSPECIFIED = 0] = "DASH_STYLE_UNSPECIFIED", DashStyleType2[DashStyleType2.SOLID = 1] = "SOLID", DashStyleType2[DashStyleType2.DOT = 2] = "DOT", DashStyleType2[DashStyleType2.DASH = 3] = "DASH", DashStyleType2))(DashStyleType || {}), TabStopAlignment = /* @__PURE__ */ ((TabStopAlignment2) => (TabStopAlignment2[TabStopAlignment2.TAB_STOP_ALIGNMENT_UNSPECIFIED = 0] = "TAB_STOP_ALIGNMENT_UNSPECIFIED", TabStopAlignment2[TabStopAlignment2.START = 1] = "START", TabStopAlignment2[TabStopAlignment2.CENTER = 2] = "CENTER", TabStopAlignment2[TabStopAlignment2.END = 3] = "END", TabStopAlignment2))(TabStopAlignment || {}), WidthType = /* @__PURE__ */ ((WidthType2) => (WidthType2.EVENLY_DISTRIBUTED = "0", WidthType2.FIXED_WIDTH = "1", WidthType2))(WidthType || {}), ContentAlignment = /* @__PURE__ */ ((ContentAlignment2) => (ContentAlignment2[ContentAlignment2.CONTENT_ALIGNMENT_UNSPECIFIED = 0] = "CONTENT_ALIGNMENT_UNSPECIFIED", ContentAlignment2[ContentAlignment2.CONTENT_ALIGNMENT_UNSUPPORTED = 1] = "CONTENT_ALIGNMENT_UNSUPPORTED", ContentAlignment2[ContentAlignment2.TOP = 2] = "TOP", ContentAlignment2[ContentAlignment2.MIDDLE = 3] = "MIDDLE", ContentAlignment2[ContentAlignment2.BOTTOM = 4] = "BOTTOM", ContentAlignment2))(ContentAlignment || {}), FontStyleType = /* @__PURE__ */ ((FontStyleType2) => (FontStyleType2.NORMAL = "normal", FontStyleType2.BOLD = "bold", FontStyleType2.ITALIC = "italic", FontStyleType2))(FontStyleType || {}), ObjectRelativeFromH = /* @__PURE__ */ ((ObjectRelativeFromH2) => (ObjectRelativeFromH2[ObjectRelativeFromH2.PAGE = 0] = "PAGE", ObjectRelativeFromH2[ObjectRelativeFromH2.COLUMN = 1] = "COLUMN", ObjectRelativeFromH2[ObjectRelativeFromH2.CHARACTER = 2] = "CHARACTER", ObjectRelativeFromH2[ObjectRelativeFromH2.MARGIN = 3] = "MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.INSIDE_MARGIN = 4] = "INSIDE_MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.OUTSIDE_MARGIN = 5] = "OUTSIDE_MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.LEFT_MARGIN = 6] = "LEFT_MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.RIGHT_MARGIN = 7] = "RIGHT_MARGIN", ObjectRelativeFromH2))(ObjectRelativeFromH || {}), ObjectRelativeFromV = /* @__PURE__ */ ((ObjectRelativeFromV2) => (ObjectRelativeFromV2[ObjectRelativeFromV2.PAGE = 0] = "PAGE", ObjectRelativeFromV2[ObjectRelativeFromV2.PARAGRAPH = 1] = "PARAGRAPH", ObjectRelativeFromV2[ObjectRelativeFromV2.LINE = 2] = "LINE", ObjectRelativeFromV2[ObjectRelativeFromV2.MARGIN = 3] = "MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.TOP_MARGIN = 4] = "TOP_MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.BOTTOM_MARGIN = 5] = "BOTTOM_MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.INSIDE_MARGIN = 6] = "INSIDE_MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.OUTSIDE_MARGIN = 7] = "OUTSIDE_MARGIN", ObjectRelativeFromV2))(ObjectRelativeFromV || {}), NumberUnitType = /* @__PURE__ */ ((NumberUnitType2) => (NumberUnitType2[NumberUnitType2.POINT = 0] = "POINT", NumberUnitType2[NumberUnitType2.LINE = 1] = "LINE", NumberUnitType2[NumberUnitType2.CHARACTER = 2] = "CHARACTER", NumberUnitType2[NumberUnitType2.PIXEL = 3] = "PIXEL", NumberUnitType2))(NumberUnitType || {}), AlignTypeH = /* @__PURE__ */ ((AlignTypeH2) => (AlignTypeH2[AlignTypeH2.CENTER = 0] = "CENTER", AlignTypeH2[AlignTypeH2.INSIDE = 1] = "INSIDE", AlignTypeH2[AlignTypeH2.LEFT = 2] = "LEFT", AlignTypeH2[AlignTypeH2.OUTSIDE = 3] = "OUTSIDE", AlignTypeH2[AlignTypeH2.RIGHT = 4] = "RIGHT", AlignTypeH2[AlignTypeH2.BOTH = 5] = "BOTH", AlignTypeH2[AlignTypeH2.DISTRIBUTE = 6] = "DISTRIBUTE", AlignTypeH2))(AlignTypeH || {}), AlignTypeV = /* @__PURE__ */ ((AlignTypeV2) => (AlignTypeV2[AlignTypeV2.BOTTOM = 0] = "BOTTOM", AlignTypeV2[AlignTypeV2.CENTER = 1] = "CENTER", AlignTypeV2[AlignTypeV2.INSIDE = 2] = "INSIDE", AlignTypeV2[AlignTypeV2.OUTSIDE = 3] = "OUTSIDE", AlignTypeV2[AlignTypeV2.TOP = 4] = "TOP", AlignTypeV2))(AlignTypeV || {}), characterSpacingControlType = /* @__PURE__ */ ((characterSpacingControlType2) => (characterSpacingControlType2[characterSpacingControlType2.compressPunctuation = 0] = "compressPunctuation", characterSpacingControlType2[characterSpacingControlType2.compressPunctuationAndJapaneseKana = 1] = "compressPunctuationAndJapaneseKana", characterSpacingControlType2[characterSpacingControlType2.doNotCompress = 2] = "doNotCompress", characterSpacingControlType2))(characterSpacingControlType || {}), PageOrientType = /* @__PURE__ */ ((PageOrientType2) => (PageOrientType2[PageOrientType2.PORTRAIT = 0] = "PORTRAIT", PageOrientType2[PageOrientType2.LANDSCAPE = 1] = "LANDSCAPE", PageOrientType2))(PageOrientType || {}), ArrangeTypeEnum = /* @__PURE__ */ ((ArrangeTypeEnum2) => (ArrangeTypeEnum2[ArrangeTypeEnum2.forward = 0] = "forward", ArrangeTypeEnum2[ArrangeTypeEnum2.backward = 1] = "backward", ArrangeTypeEnum2[ArrangeTypeEnum2.front = 2] = "front", ArrangeTypeEnum2[ArrangeTypeEnum2.back = 3] = "back", ArrangeTypeEnum2))(ArrangeTypeEnum || {}), DrawingTypeEnum = /* @__PURE__ */ ((DrawingTypeEnum2) => (DrawingTypeEnum2[DrawingTypeEnum2.UNRECOGNIZED = -1] = "UNRECOGNIZED", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_IMAGE = 0] = "DRAWING_IMAGE", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_SHAPE = 1] = "DRAWING_SHAPE", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_CHART = 2] = "DRAWING_CHART", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_TABLE = 3] = "DRAWING_TABLE", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_SMART_ART = 4] = "DRAWING_SMART_ART", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_VIDEO = 5] = "DRAWING_VIDEO", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_GROUP = 6] = "DRAWING_GROUP", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_UNIT = 7] = "DRAWING_UNIT", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_DOM = 8] = "DRAWING_DOM", DrawingTypeEnum2))(DrawingTypeEnum || {}), RANGE_TYPE = /* @__PURE__ */ ((RANGE_TYPE2) => (RANGE_TYPE2[RANGE_TYPE2.NORMAL = 0] = "NORMAL", RANGE_TYPE2[RANGE_TYPE2.ROW = 1] = "ROW", RANGE_TYPE2[RANGE_TYPE2.COLUMN = 2] = "COLUMN", RANGE_TYPE2[RANGE_TYPE2.ALL = 3] = "ALL", RANGE_TYPE2))(RANGE_TYPE || {}), AbsoluteRefType = /* @__PURE__ */ ((AbsoluteRefType2) => (AbsoluteRefType2[AbsoluteRefType2.NONE = 0] = "NONE", AbsoluteRefType2[AbsoluteRefType2.ROW = 1] = "ROW", AbsoluteRefType2[AbsoluteRefType2.COLUMN = 2] = "COLUMN", AbsoluteRefType2[AbsoluteRefType2.ALL = 3] = "ALL", AbsoluteRefType2))(AbsoluteRefType || {});
|
|
849
|
+
var DocStyleType = /* @__PURE__ */ ((DocStyleType2) => (DocStyleType2[DocStyleType2.character = 0] = "character", DocStyleType2[DocStyleType2.paragraph = 1] = "paragraph", DocStyleType2[DocStyleType2.table = 2] = "table", DocStyleType2[DocStyleType2.numbering = 3] = "numbering", DocStyleType2))(DocStyleType || {}), FollowNumberWithType = /* @__PURE__ */ ((FollowNumberWithType2) => (FollowNumberWithType2[FollowNumberWithType2.TAB = 0] = "TAB", FollowNumberWithType2[FollowNumberWithType2.SPACE = 1] = "SPACE", FollowNumberWithType2[FollowNumberWithType2.NOTHING = 2] = "NOTHING", FollowNumberWithType2))(FollowNumberWithType || {}), GlyphType = /* @__PURE__ */ ((GlyphType2) => (GlyphType2[GlyphType2.BULLET = 0] = "BULLET", GlyphType2[GlyphType2.NONE = 1] = "NONE", GlyphType2[GlyphType2.DECIMAL = 2] = "DECIMAL", GlyphType2[GlyphType2.DECIMAL_ZERO = 3] = "DECIMAL_ZERO", GlyphType2[GlyphType2.UPPER_LETTER = 4] = "UPPER_LETTER", GlyphType2[GlyphType2.LOWER_LETTER = 5] = "LOWER_LETTER", GlyphType2[GlyphType2.UPPER_ROMAN = 6] = "UPPER_ROMAN", GlyphType2[GlyphType2.LOWER_ROMAN = 7] = "LOWER_ROMAN", GlyphType2[GlyphType2.ORDINAL = 8] = "ORDINAL", GlyphType2[GlyphType2.CARDINAL_TEXT = 9] = "CARDINAL_TEXT", GlyphType2[GlyphType2.ORDINAL_TEXT = 10] = "ORDINAL_TEXT", GlyphType2[GlyphType2.HEX = 11] = "HEX", GlyphType2[GlyphType2.CHICAGO = 12] = "CHICAGO", GlyphType2[GlyphType2.IDEOGRAPH_DIGITAL = 13] = "IDEOGRAPH_DIGITAL", GlyphType2[GlyphType2.JAPANESE_COUNTING = 14] = "JAPANESE_COUNTING", GlyphType2[GlyphType2.AIUEO = 15] = "AIUEO", GlyphType2[GlyphType2.IROHA = 16] = "IROHA", GlyphType2[GlyphType2.DECIMAL_FULL_WIDTH = 17] = "DECIMAL_FULL_WIDTH", GlyphType2[GlyphType2.DECIMAL_HALF_WIDTH = 18] = "DECIMAL_HALF_WIDTH", GlyphType2[GlyphType2.JAPANESE_LEGAL = 19] = "JAPANESE_LEGAL", GlyphType2[GlyphType2.JAPANESE_DIGITAL_TEN_THOUSAND = 20] = "JAPANESE_DIGITAL_TEN_THOUSAND", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_CIRCLE = 21] = "DECIMAL_ENCLOSED_CIRCLE", GlyphType2[GlyphType2.DECIMAL_FULL_WIDTH2 = 22] = "DECIMAL_FULL_WIDTH2", GlyphType2[GlyphType2.AIUEO_FULL_WIDTH = 23] = "AIUEO_FULL_WIDTH", GlyphType2[GlyphType2.IROHA_FULL_WIDTH = 24] = "IROHA_FULL_WIDTH", GlyphType2[GlyphType2.GANADA = 25] = "GANADA", GlyphType2[GlyphType2.CHOSUNG = 26] = "CHOSUNG", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_FULLSTOP = 27] = "DECIMAL_ENCLOSED_FULLSTOP", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_PAREN = 28] = "DECIMAL_ENCLOSED_PAREN", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_CIRCLE_CHINESE = 29] = "DECIMAL_ENCLOSED_CIRCLE_CHINESE", GlyphType2[GlyphType2.IDEOGRAPH_ENCLOSED_CIRCLE = 30] = "IDEOGRAPH_ENCLOSED_CIRCLE", GlyphType2[GlyphType2.IDEOGRAPH_TRADITIONAL = 31] = "IDEOGRAPH_TRADITIONAL", GlyphType2[GlyphType2.IDEOGRAPH_ZODIAC = 32] = "IDEOGRAPH_ZODIAC", GlyphType2[GlyphType2.IDEOGRAPH_ZODIAC_TRADITIONAL = 33] = "IDEOGRAPH_ZODIAC_TRADITIONAL", GlyphType2[GlyphType2.TAIWANESE_COUNTING = 34] = "TAIWANESE_COUNTING", GlyphType2[GlyphType2.IDEOGRAPH_LEGAL_TRADITIONAL = 35] = "IDEOGRAPH_LEGAL_TRADITIONAL", GlyphType2[GlyphType2.TAIWANESE_COUNTING_THOUSAND = 36] = "TAIWANESE_COUNTING_THOUSAND", GlyphType2[GlyphType2.TAIWANESE_DIGITAL = 37] = "TAIWANESE_DIGITAL", GlyphType2[GlyphType2.CHINESE_COUNTING = 38] = "CHINESE_COUNTING", GlyphType2[GlyphType2.CHINESE_LEGAL_SIMPLIFIED = 39] = "CHINESE_LEGAL_SIMPLIFIED", GlyphType2[GlyphType2.CHINESE_COUNTING_THOUSAND = 40] = "CHINESE_COUNTING_THOUSAND", GlyphType2[GlyphType2.KOREAN_DIGITAL = 41] = "KOREAN_DIGITAL", GlyphType2[GlyphType2.KOREAN_COUNTING = 42] = "KOREAN_COUNTING", GlyphType2[GlyphType2.KOREAN_LEGAL = 43] = "KOREAN_LEGAL", GlyphType2[GlyphType2.KOREAN_DIGITAL2 = 44] = "KOREAN_DIGITAL2", GlyphType2[GlyphType2.VIETNAMESE_COUNTING = 45] = "VIETNAMESE_COUNTING", GlyphType2[GlyphType2.RUSSIAN_LOWER = 46] = "RUSSIAN_LOWER", GlyphType2[GlyphType2.RUSSIAN_UPPER = 47] = "RUSSIAN_UPPER", GlyphType2[GlyphType2.NUMBER_IN_DASH = 48] = "NUMBER_IN_DASH", GlyphType2[GlyphType2.HEBREW1 = 49] = "HEBREW1", GlyphType2[GlyphType2.HEBREW2 = 50] = "HEBREW2", GlyphType2[GlyphType2.ARABIC_ALPHA = 51] = "ARABIC_ALPHA", GlyphType2[GlyphType2.ARABIC_ABJAD = 52] = "ARABIC_ABJAD", GlyphType2[GlyphType2.HINDI_VOWELS = 53] = "HINDI_VOWELS", GlyphType2[GlyphType2.HINDI_CONSONANTS = 54] = "HINDI_CONSONANTS", GlyphType2[GlyphType2.HINDI_NUMBERS = 55] = "HINDI_NUMBERS", GlyphType2[GlyphType2.HINDI_COUNTING = 56] = "HINDI_COUNTING", GlyphType2[GlyphType2.THAI_LETTERS = 57] = "THAI_LETTERS", GlyphType2[GlyphType2.THAI_NUMBERS = 58] = "THAI_NUMBERS", GlyphType2[GlyphType2.THAI_COUNTING = 59] = "THAI_COUNTING", GlyphType2[GlyphType2.CUSTOM = 60] = "CUSTOM", GlyphType2))(GlyphType || {}), BulletAlignment = /* @__PURE__ */ ((BulletAlignment2) => (BulletAlignment2[BulletAlignment2.BULLET_ALIGNMENT_UNSPECIFIED = 0] = "BULLET_ALIGNMENT_UNSPECIFIED", BulletAlignment2[BulletAlignment2.START = 1] = "START", BulletAlignment2[BulletAlignment2.CENTER = 2] = "CENTER", BulletAlignment2[BulletAlignment2.END = 3] = "END", BulletAlignment2[BulletAlignment2.BOTH = 4] = "BOTH", BulletAlignment2))(BulletAlignment || {}), CustomRangeType = /* @__PURE__ */ ((CustomRangeType2) => (CustomRangeType2[CustomRangeType2.HYPERLINK = 0] = "HYPERLINK", CustomRangeType2[CustomRangeType2.FIELD = 1] = "FIELD", CustomRangeType2[CustomRangeType2.SDT = 2] = "SDT", CustomRangeType2[CustomRangeType2.BOOKMARK = 3] = "BOOKMARK", CustomRangeType2[CustomRangeType2.COMMENT = 4] = "COMMENT", CustomRangeType2[CustomRangeType2.CUSTOM = 5] = "CUSTOM", CustomRangeType2[CustomRangeType2.MENTION = 6] = "MENTION", CustomRangeType2[CustomRangeType2.UNI_FORMULA = 7] = "UNI_FORMULA", CustomRangeType2))(CustomRangeType || {}), CustomDecorationType = /* @__PURE__ */ ((CustomDecorationType2) => (CustomDecorationType2[CustomDecorationType2.COMMENT = 0] = "COMMENT", CustomDecorationType2))(CustomDecorationType || {}), BlockType = /* @__PURE__ */ ((BlockType2) => (BlockType2[BlockType2.DRAWING = 0] = "DRAWING", BlockType2[BlockType2.CUSTOM = 1] = "CUSTOM", BlockType2))(BlockType || {}), DocumentFlavor = /* @__PURE__ */ ((DocumentFlavor2) => (DocumentFlavor2[DocumentFlavor2.TRADITIONAL = 0] = "TRADITIONAL", DocumentFlavor2[DocumentFlavor2.MODERN = 1] = "MODERN", DocumentFlavor2))(DocumentFlavor || {}), GridType = /* @__PURE__ */ ((GridType2) => (GridType2[GridType2.DEFAULT = 0] = "DEFAULT", GridType2[GridType2.LINES = 1] = "LINES", GridType2[GridType2.LINES_AND_CHARS = 2] = "LINES_AND_CHARS", GridType2[GridType2.SNAP_TO_CHARS = 3] = "SNAP_TO_CHARS", GridType2))(GridType || {}), SectionType = /* @__PURE__ */ ((SectionType2) => (SectionType2[SectionType2.SECTION_TYPE_UNSPECIFIED = 0] = "SECTION_TYPE_UNSPECIFIED", SectionType2[SectionType2.CONTINUOUS = 1] = "CONTINUOUS", SectionType2[SectionType2.NEXT_PAGE = 2] = "NEXT_PAGE", SectionType2[SectionType2.EVEN_PAGE = 3] = "EVEN_PAGE", SectionType2[SectionType2.ODD_PAGE = 4] = "ODD_PAGE", SectionType2))(SectionType || {}), ColumnSeparatorType = /* @__PURE__ */ ((ColumnSeparatorType2) => (ColumnSeparatorType2[ColumnSeparatorType2.COLUMN_SEPARATOR_STYLE_UNSPECIFIED = 0] = "COLUMN_SEPARATOR_STYLE_UNSPECIFIED", ColumnSeparatorType2[ColumnSeparatorType2.NONE = 1] = "NONE", ColumnSeparatorType2[ColumnSeparatorType2.BETWEEN_EACH_COLUMN = 2] = "BETWEEN_EACH_COLUMN", ColumnSeparatorType2))(ColumnSeparatorType || {}), TextDirectionType = /* @__PURE__ */ ((TextDirectionType2) => (TextDirectionType2[TextDirectionType2.NORMAL = 0] = "NORMAL", TextDirectionType2[TextDirectionType2.TBRL = 1] = "TBRL", TextDirectionType2[TextDirectionType2.LRTBV = 2] = "LRTBV", TextDirectionType2))(TextDirectionType || {}), ParagraphElementType = /* @__PURE__ */ ((ParagraphElementType2) => (ParagraphElementType2[ParagraphElementType2.TEXT_RUN = 0] = "TEXT_RUN", ParagraphElementType2[ParagraphElementType2.AUTO_TEXT = 1] = "AUTO_TEXT", ParagraphElementType2[ParagraphElementType2.PAGE_BREAK = 2] = "PAGE_BREAK", ParagraphElementType2[ParagraphElementType2.COLUMN_BREAK = 3] = "COLUMN_BREAK", ParagraphElementType2[ParagraphElementType2.FOOT_NOTE_REFERENCE = 4] = "FOOT_NOTE_REFERENCE", ParagraphElementType2[ParagraphElementType2.HORIZONTAL_RULE = 5] = "HORIZONTAL_RULE", ParagraphElementType2[ParagraphElementType2.EQUATION = 6] = "EQUATION", ParagraphElementType2[ParagraphElementType2.DRAWING = 7] = "DRAWING", ParagraphElementType2[ParagraphElementType2.PERSON = 8] = "PERSON", ParagraphElementType2[ParagraphElementType2.RICH_LINK = 9] = "RICH_LINK", ParagraphElementType2))(ParagraphElementType || {}), WrapTextType = /* @__PURE__ */ ((WrapTextType2) => (WrapTextType2[WrapTextType2.BOTH_SIDES = 0] = "BOTH_SIDES", WrapTextType2[WrapTextType2.LEFT = 1] = "LEFT", WrapTextType2[WrapTextType2.RIGHT = 2] = "RIGHT", WrapTextType2[WrapTextType2.LARGEST = 3] = "LARGEST", WrapTextType2))(WrapTextType || {}), PositionedObjectLayoutType = /* @__PURE__ */ ((PositionedObjectLayoutType2) => (PositionedObjectLayoutType2[PositionedObjectLayoutType2.INLINE = 0] = "INLINE", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_NONE = 1] = "WRAP_NONE", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_POLYGON = 2] = "WRAP_POLYGON", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_SQUARE = 3] = "WRAP_SQUARE", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_THROUGH = 4] = "WRAP_THROUGH", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_TIGHT = 5] = "WRAP_TIGHT", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_TOP_AND_BOTTOM = 6] = "WRAP_TOP_AND_BOTTOM", PositionedObjectLayoutType2))(PositionedObjectLayoutType || {}), NamedStyleType = /* @__PURE__ */ ((NamedStyleType2) => (NamedStyleType2[NamedStyleType2.NAMED_STYLE_TYPE_UNSPECIFIED = 0] = "NAMED_STYLE_TYPE_UNSPECIFIED", NamedStyleType2[NamedStyleType2.NORMAL_TEXT = 1] = "NORMAL_TEXT", NamedStyleType2[NamedStyleType2.TITLE = 2] = "TITLE", NamedStyleType2[NamedStyleType2.SUBTITLE = 3] = "SUBTITLE", NamedStyleType2[NamedStyleType2.HEADING_1 = 4] = "HEADING_1", NamedStyleType2[NamedStyleType2.HEADING_2 = 5] = "HEADING_2", NamedStyleType2[NamedStyleType2.HEADING_3 = 6] = "HEADING_3", NamedStyleType2[NamedStyleType2.HEADING_4 = 7] = "HEADING_4", NamedStyleType2[NamedStyleType2.HEADING_5 = 8] = "HEADING_5", NamedStyleType2[NamedStyleType2.HEADING_6 = 9] = "HEADING_6", NamedStyleType2))(NamedStyleType || {}), SpacingRule = /* @__PURE__ */ ((SpacingRule2) => (SpacingRule2[SpacingRule2.AUTO = 0] = "AUTO", SpacingRule2[SpacingRule2.AT_LEAST = 1] = "AT_LEAST", SpacingRule2[SpacingRule2.EXACT = 2] = "EXACT", SpacingRule2))(SpacingRule || {}), DashStyleType = /* @__PURE__ */ ((DashStyleType2) => (DashStyleType2[DashStyleType2.DASH_STYLE_UNSPECIFIED = 0] = "DASH_STYLE_UNSPECIFIED", DashStyleType2[DashStyleType2.SOLID = 1] = "SOLID", DashStyleType2[DashStyleType2.DOT = 2] = "DOT", DashStyleType2[DashStyleType2.DASH = 3] = "DASH", DashStyleType2))(DashStyleType || {}), TabStopAlignment = /* @__PURE__ */ ((TabStopAlignment2) => (TabStopAlignment2[TabStopAlignment2.TAB_STOP_ALIGNMENT_UNSPECIFIED = 0] = "TAB_STOP_ALIGNMENT_UNSPECIFIED", TabStopAlignment2[TabStopAlignment2.START = 1] = "START", TabStopAlignment2[TabStopAlignment2.CENTER = 2] = "CENTER", TabStopAlignment2[TabStopAlignment2.END = 3] = "END", TabStopAlignment2))(TabStopAlignment || {}), TableSizeType = /* @__PURE__ */ ((TableSizeType2) => (TableSizeType2[TableSizeType2.UNSPECIFIED = 0] = "UNSPECIFIED", TableSizeType2[TableSizeType2.SPECIFIED = 1] = "SPECIFIED", TableSizeType2))(TableSizeType || {}), TableAlignmentType = /* @__PURE__ */ ((TableAlignmentType2) => (TableAlignmentType2[TableAlignmentType2.START = 0] = "START", TableAlignmentType2[TableAlignmentType2.CENTER = 1] = "CENTER", TableAlignmentType2[TableAlignmentType2.END = 2] = "END", TableAlignmentType2))(TableAlignmentType || {}), TableLayoutType = /* @__PURE__ */ ((TableLayoutType2) => (TableLayoutType2[TableLayoutType2.AUTO_FIT = 0] = "AUTO_FIT", TableLayoutType2[TableLayoutType2.FIXED = 1] = "FIXED", TableLayoutType2))(TableLayoutType || {}), TableTextWrapType = /* @__PURE__ */ ((TableTextWrapType2) => (TableTextWrapType2[TableTextWrapType2.NONE = 0] = "NONE", TableTextWrapType2[TableTextWrapType2.WRAP = 1] = "WRAP", TableTextWrapType2))(TableTextWrapType || {}), TableCellHeightRule = /* @__PURE__ */ ((TableCellHeightRule2) => (TableCellHeightRule2[TableCellHeightRule2.AUTO = 0] = "AUTO", TableCellHeightRule2[TableCellHeightRule2.AT_LEAST = 1] = "AT_LEAST", TableCellHeightRule2[TableCellHeightRule2.EXACT = 2] = "EXACT", TableCellHeightRule2))(TableCellHeightRule || {}), VerticalAlignmentType = /* @__PURE__ */ ((VerticalAlignmentType2) => (VerticalAlignmentType2[VerticalAlignmentType2.CONTENT_ALIGNMENT_UNSPECIFIED = 0] = "CONTENT_ALIGNMENT_UNSPECIFIED", VerticalAlignmentType2[VerticalAlignmentType2.BOTH = 1] = "BOTH", VerticalAlignmentType2[VerticalAlignmentType2.TOP = 2] = "TOP", VerticalAlignmentType2[VerticalAlignmentType2.CENTER = 3] = "CENTER", VerticalAlignmentType2[VerticalAlignmentType2.BOTTOM = 4] = "BOTTOM", VerticalAlignmentType2))(VerticalAlignmentType || {}), FontStyleType = /* @__PURE__ */ ((FontStyleType2) => (FontStyleType2.NORMAL = "normal", FontStyleType2.BOLD = "bold", FontStyleType2.ITALIC = "italic", FontStyleType2))(FontStyleType || {}), ObjectRelativeFromH = /* @__PURE__ */ ((ObjectRelativeFromH2) => (ObjectRelativeFromH2[ObjectRelativeFromH2.PAGE = 0] = "PAGE", ObjectRelativeFromH2[ObjectRelativeFromH2.COLUMN = 1] = "COLUMN", ObjectRelativeFromH2[ObjectRelativeFromH2.CHARACTER = 2] = "CHARACTER", ObjectRelativeFromH2[ObjectRelativeFromH2.MARGIN = 3] = "MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.INSIDE_MARGIN = 4] = "INSIDE_MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.OUTSIDE_MARGIN = 5] = "OUTSIDE_MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.LEFT_MARGIN = 6] = "LEFT_MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.RIGHT_MARGIN = 7] = "RIGHT_MARGIN", ObjectRelativeFromH2))(ObjectRelativeFromH || {}), ObjectRelativeFromV = /* @__PURE__ */ ((ObjectRelativeFromV2) => (ObjectRelativeFromV2[ObjectRelativeFromV2.PAGE = 0] = "PAGE", ObjectRelativeFromV2[ObjectRelativeFromV2.PARAGRAPH = 1] = "PARAGRAPH", ObjectRelativeFromV2[ObjectRelativeFromV2.LINE = 2] = "LINE", ObjectRelativeFromV2[ObjectRelativeFromV2.MARGIN = 3] = "MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.TOP_MARGIN = 4] = "TOP_MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.BOTTOM_MARGIN = 5] = "BOTTOM_MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.INSIDE_MARGIN = 6] = "INSIDE_MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.OUTSIDE_MARGIN = 7] = "OUTSIDE_MARGIN", ObjectRelativeFromV2))(ObjectRelativeFromV || {}), NumberUnitType = /* @__PURE__ */ ((NumberUnitType2) => (NumberUnitType2[NumberUnitType2.POINT = 0] = "POINT", NumberUnitType2[NumberUnitType2.LINE = 1] = "LINE", NumberUnitType2[NumberUnitType2.CHARACTER = 2] = "CHARACTER", NumberUnitType2[NumberUnitType2.PIXEL = 3] = "PIXEL", NumberUnitType2[NumberUnitType2.PERCENT = 4] = "PERCENT", NumberUnitType2))(NumberUnitType || {}), AlignTypeH = /* @__PURE__ */ ((AlignTypeH2) => (AlignTypeH2[AlignTypeH2.CENTER = 0] = "CENTER", AlignTypeH2[AlignTypeH2.INSIDE = 1] = "INSIDE", AlignTypeH2[AlignTypeH2.LEFT = 2] = "LEFT", AlignTypeH2[AlignTypeH2.OUTSIDE = 3] = "OUTSIDE", AlignTypeH2[AlignTypeH2.RIGHT = 4] = "RIGHT", AlignTypeH2[AlignTypeH2.BOTH = 5] = "BOTH", AlignTypeH2[AlignTypeH2.DISTRIBUTE = 6] = "DISTRIBUTE", AlignTypeH2))(AlignTypeH || {}), AlignTypeV = /* @__PURE__ */ ((AlignTypeV2) => (AlignTypeV2[AlignTypeV2.BOTTOM = 0] = "BOTTOM", AlignTypeV2[AlignTypeV2.CENTER = 1] = "CENTER", AlignTypeV2[AlignTypeV2.INSIDE = 2] = "INSIDE", AlignTypeV2[AlignTypeV2.OUTSIDE = 3] = "OUTSIDE", AlignTypeV2[AlignTypeV2.TOP = 4] = "TOP", AlignTypeV2))(AlignTypeV || {}), characterSpacingControlType = /* @__PURE__ */ ((characterSpacingControlType2) => (characterSpacingControlType2[characterSpacingControlType2.compressPunctuation = 0] = "compressPunctuation", characterSpacingControlType2[characterSpacingControlType2.compressPunctuationAndJapaneseKana = 1] = "compressPunctuationAndJapaneseKana", characterSpacingControlType2[characterSpacingControlType2.doNotCompress = 2] = "doNotCompress", characterSpacingControlType2))(characterSpacingControlType || {}), PageOrientType = /* @__PURE__ */ ((PageOrientType2) => (PageOrientType2[PageOrientType2.PORTRAIT = 0] = "PORTRAIT", PageOrientType2[PageOrientType2.LANDSCAPE = 1] = "LANDSCAPE", PageOrientType2))(PageOrientType || {}), ArrangeTypeEnum = /* @__PURE__ */ ((ArrangeTypeEnum2) => (ArrangeTypeEnum2[ArrangeTypeEnum2.forward = 0] = "forward", ArrangeTypeEnum2[ArrangeTypeEnum2.backward = 1] = "backward", ArrangeTypeEnum2[ArrangeTypeEnum2.front = 2] = "front", ArrangeTypeEnum2[ArrangeTypeEnum2.back = 3] = "back", ArrangeTypeEnum2))(ArrangeTypeEnum || {}), DrawingTypeEnum = /* @__PURE__ */ ((DrawingTypeEnum2) => (DrawingTypeEnum2[DrawingTypeEnum2.UNRECOGNIZED = -1] = "UNRECOGNIZED", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_IMAGE = 0] = "DRAWING_IMAGE", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_SHAPE = 1] = "DRAWING_SHAPE", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_CHART = 2] = "DRAWING_CHART", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_TABLE = 3] = "DRAWING_TABLE", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_SMART_ART = 4] = "DRAWING_SMART_ART", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_VIDEO = 5] = "DRAWING_VIDEO", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_GROUP = 6] = "DRAWING_GROUP", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_UNIT = 7] = "DRAWING_UNIT", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_DOM = 8] = "DRAWING_DOM", DrawingTypeEnum2))(DrawingTypeEnum || {}), RANGE_TYPE = /* @__PURE__ */ ((RANGE_TYPE2) => (RANGE_TYPE2[RANGE_TYPE2.NORMAL = 0] = "NORMAL", RANGE_TYPE2[RANGE_TYPE2.ROW = 1] = "ROW", RANGE_TYPE2[RANGE_TYPE2.COLUMN = 2] = "COLUMN", RANGE_TYPE2[RANGE_TYPE2.ALL = 3] = "ALL", RANGE_TYPE2))(RANGE_TYPE || {}), AbsoluteRefType = /* @__PURE__ */ ((AbsoluteRefType2) => (AbsoluteRefType2[AbsoluteRefType2.NONE = 0] = "NONE", AbsoluteRefType2[AbsoluteRefType2.ROW = 1] = "ROW", AbsoluteRefType2[AbsoluteRefType2.COLUMN = 2] = "COLUMN", AbsoluteRefType2[AbsoluteRefType2.ALL = 3] = "ALL", AbsoluteRefType2))(AbsoluteRefType || {});
|
|
849
850
|
function selectionToArray(range) {
|
|
850
851
|
return [range.startRow, range.startColumn, range.endRow, range.endColumn];
|
|
851
852
|
}
|
|
@@ -909,7 +910,561 @@ let random = /* @__PURE__ */ __name((bytes) => crypto.getRandomValues(new Uint8A
|
|
|
909
910
|
id += urlAlphabet[bytes[size] & 63];
|
|
910
911
|
return id;
|
|
911
912
|
}, "nanoid");
|
|
912
|
-
|
|
913
|
+
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
914
|
+
function getDefaultExportFromCjs(x) {
|
|
915
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
|
|
916
|
+
}
|
|
917
|
+
__name(getDefaultExportFromCjs, "getDefaultExportFromCjs");
|
|
918
|
+
var lodash_mergewith = { exports: {} };
|
|
919
|
+
lodash_mergewith.exports;
|
|
920
|
+
(function(module, exports) {
|
|
921
|
+
var LARGE_ARRAY_SIZE = 200, HASH_UNDEFINED = "__lodash_hash_undefined__", HOT_COUNT = 800, HOT_SPAN = 16, MAX_SAFE_INTEGER = 9007199254740991, argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]", reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reIsHostCtor = /^\[object .+?Constructor\]$/, reIsUint = /^(?:0|[1-9]\d*)$/, typedArrayTags = {};
|
|
922
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = !0, typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = !1;
|
|
923
|
+
var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal, freeSelf = typeof self == "object" && self && self.Object === Object && self, root = freeGlobal || freeSelf || Function("return this")(), freeExports = exports && !exports.nodeType && exports, freeModule = freeExports && !0 && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports, freeProcess = moduleExports && freeGlobal.process, nodeUtil = function() {
|
|
924
|
+
try {
|
|
925
|
+
var types2 = freeModule && freeModule.require && freeModule.require("util").types;
|
|
926
|
+
return types2 || freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
927
|
+
} catch {
|
|
928
|
+
}
|
|
929
|
+
}(), nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
930
|
+
function apply(func, thisArg, args) {
|
|
931
|
+
switch (args.length) {
|
|
932
|
+
case 0:
|
|
933
|
+
return func.call(thisArg);
|
|
934
|
+
case 1:
|
|
935
|
+
return func.call(thisArg, args[0]);
|
|
936
|
+
case 2:
|
|
937
|
+
return func.call(thisArg, args[0], args[1]);
|
|
938
|
+
case 3:
|
|
939
|
+
return func.call(thisArg, args[0], args[1], args[2]);
|
|
940
|
+
}
|
|
941
|
+
return func.apply(thisArg, args);
|
|
942
|
+
}
|
|
943
|
+
__name(apply, "apply");
|
|
944
|
+
function baseTimes(n, iteratee) {
|
|
945
|
+
for (var index2 = -1, result = Array(n); ++index2 < n; )
|
|
946
|
+
result[index2] = iteratee(index2);
|
|
947
|
+
return result;
|
|
948
|
+
}
|
|
949
|
+
__name(baseTimes, "baseTimes");
|
|
950
|
+
function baseUnary(func) {
|
|
951
|
+
return function(value) {
|
|
952
|
+
return func(value);
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
__name(baseUnary, "baseUnary");
|
|
956
|
+
function getValue(object, key) {
|
|
957
|
+
return object == null ? void 0 : object[key];
|
|
958
|
+
}
|
|
959
|
+
__name(getValue, "getValue");
|
|
960
|
+
function overArg(func, transform) {
|
|
961
|
+
return function(arg) {
|
|
962
|
+
return func(transform(arg));
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
__name(overArg, "overArg");
|
|
966
|
+
var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype, coreJsData = root["__core-js_shared__"], funcToString = funcProto.toString, hasOwnProperty = objectProto.hasOwnProperty, maskSrcKey = function() {
|
|
967
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
968
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
969
|
+
}(), nativeObjectToString = objectProto.toString, objectCtorString = funcToString.call(Object), reIsNative = RegExp(
|
|
970
|
+
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
971
|
+
), Buffer2 = moduleExports ? root.Buffer : void 0, Symbol2 = root.Symbol, Uint8Array2 = root.Uint8Array;
|
|
972
|
+
Buffer2 && Buffer2.allocUnsafe;
|
|
973
|
+
var getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0, defineProperty = function() {
|
|
974
|
+
try {
|
|
975
|
+
var func = getNative(Object, "defineProperty");
|
|
976
|
+
return func({}, "", {}), func;
|
|
977
|
+
} catch {
|
|
978
|
+
}
|
|
979
|
+
}(), nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeMax = Math.max, nativeNow = Date.now, Map2 = getNative(root, "Map"), nativeCreate = getNative(Object, "create"), baseCreate = function() {
|
|
980
|
+
function object() {
|
|
981
|
+
}
|
|
982
|
+
return __name(object, "object"), function(proto) {
|
|
983
|
+
if (!isObject2(proto))
|
|
984
|
+
return {};
|
|
985
|
+
if (objectCreate)
|
|
986
|
+
return objectCreate(proto);
|
|
987
|
+
object.prototype = proto;
|
|
988
|
+
var result = new object();
|
|
989
|
+
return object.prototype = void 0, result;
|
|
990
|
+
};
|
|
991
|
+
}();
|
|
992
|
+
function Hash(entries) {
|
|
993
|
+
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
994
|
+
for (this.clear(); ++index2 < length; ) {
|
|
995
|
+
var entry = entries[index2];
|
|
996
|
+
this.set(entry[0], entry[1]);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
__name(Hash, "Hash");
|
|
1000
|
+
function hashClear() {
|
|
1001
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {}, this.size = 0;
|
|
1002
|
+
}
|
|
1003
|
+
__name(hashClear, "hashClear");
|
|
1004
|
+
function hashDelete(key) {
|
|
1005
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
1006
|
+
return this.size -= result ? 1 : 0, result;
|
|
1007
|
+
}
|
|
1008
|
+
__name(hashDelete, "hashDelete");
|
|
1009
|
+
function hashGet(key) {
|
|
1010
|
+
var data = this.__data__;
|
|
1011
|
+
if (nativeCreate) {
|
|
1012
|
+
var result = data[key];
|
|
1013
|
+
return result === HASH_UNDEFINED ? void 0 : result;
|
|
1014
|
+
}
|
|
1015
|
+
return hasOwnProperty.call(data, key) ? data[key] : void 0;
|
|
1016
|
+
}
|
|
1017
|
+
__name(hashGet, "hashGet");
|
|
1018
|
+
function hashHas(key) {
|
|
1019
|
+
var data = this.__data__;
|
|
1020
|
+
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
1021
|
+
}
|
|
1022
|
+
__name(hashHas, "hashHas");
|
|
1023
|
+
function hashSet(key, value) {
|
|
1024
|
+
var data = this.__data__;
|
|
1025
|
+
return this.size += this.has(key) ? 0 : 1, data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value, this;
|
|
1026
|
+
}
|
|
1027
|
+
__name(hashSet, "hashSet"), Hash.prototype.clear = hashClear, Hash.prototype.delete = hashDelete, Hash.prototype.get = hashGet, Hash.prototype.has = hashHas, Hash.prototype.set = hashSet;
|
|
1028
|
+
function ListCache(entries) {
|
|
1029
|
+
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
1030
|
+
for (this.clear(); ++index2 < length; ) {
|
|
1031
|
+
var entry = entries[index2];
|
|
1032
|
+
this.set(entry[0], entry[1]);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
__name(ListCache, "ListCache");
|
|
1036
|
+
function listCacheClear() {
|
|
1037
|
+
this.__data__ = [], this.size = 0;
|
|
1038
|
+
}
|
|
1039
|
+
__name(listCacheClear, "listCacheClear");
|
|
1040
|
+
function listCacheDelete(key) {
|
|
1041
|
+
var data = this.__data__, index2 = assocIndexOf(data, key);
|
|
1042
|
+
if (index2 < 0)
|
|
1043
|
+
return !1;
|
|
1044
|
+
var lastIndex = data.length - 1;
|
|
1045
|
+
return index2 == lastIndex ? data.pop() : splice.call(data, index2, 1), --this.size, !0;
|
|
1046
|
+
}
|
|
1047
|
+
__name(listCacheDelete, "listCacheDelete");
|
|
1048
|
+
function listCacheGet(key) {
|
|
1049
|
+
var data = this.__data__, index2 = assocIndexOf(data, key);
|
|
1050
|
+
return index2 < 0 ? void 0 : data[index2][1];
|
|
1051
|
+
}
|
|
1052
|
+
__name(listCacheGet, "listCacheGet");
|
|
1053
|
+
function listCacheHas(key) {
|
|
1054
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
1055
|
+
}
|
|
1056
|
+
__name(listCacheHas, "listCacheHas");
|
|
1057
|
+
function listCacheSet(key, value) {
|
|
1058
|
+
var data = this.__data__, index2 = assocIndexOf(data, key);
|
|
1059
|
+
return index2 < 0 ? (++this.size, data.push([key, value])) : data[index2][1] = value, this;
|
|
1060
|
+
}
|
|
1061
|
+
__name(listCacheSet, "listCacheSet"), ListCache.prototype.clear = listCacheClear, ListCache.prototype.delete = listCacheDelete, ListCache.prototype.get = listCacheGet, ListCache.prototype.has = listCacheHas, ListCache.prototype.set = listCacheSet;
|
|
1062
|
+
function MapCache(entries) {
|
|
1063
|
+
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
1064
|
+
for (this.clear(); ++index2 < length; ) {
|
|
1065
|
+
var entry = entries[index2];
|
|
1066
|
+
this.set(entry[0], entry[1]);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
__name(MapCache, "MapCache");
|
|
1070
|
+
function mapCacheClear() {
|
|
1071
|
+
this.size = 0, this.__data__ = {
|
|
1072
|
+
hash: new Hash(),
|
|
1073
|
+
map: new (Map2 || ListCache)(),
|
|
1074
|
+
string: new Hash()
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1077
|
+
__name(mapCacheClear, "mapCacheClear");
|
|
1078
|
+
function mapCacheDelete(key) {
|
|
1079
|
+
var result = getMapData(this, key).delete(key);
|
|
1080
|
+
return this.size -= result ? 1 : 0, result;
|
|
1081
|
+
}
|
|
1082
|
+
__name(mapCacheDelete, "mapCacheDelete");
|
|
1083
|
+
function mapCacheGet(key) {
|
|
1084
|
+
return getMapData(this, key).get(key);
|
|
1085
|
+
}
|
|
1086
|
+
__name(mapCacheGet, "mapCacheGet");
|
|
1087
|
+
function mapCacheHas(key) {
|
|
1088
|
+
return getMapData(this, key).has(key);
|
|
1089
|
+
}
|
|
1090
|
+
__name(mapCacheHas, "mapCacheHas");
|
|
1091
|
+
function mapCacheSet(key, value) {
|
|
1092
|
+
var data = getMapData(this, key), size = data.size;
|
|
1093
|
+
return data.set(key, value), this.size += data.size == size ? 0 : 1, this;
|
|
1094
|
+
}
|
|
1095
|
+
__name(mapCacheSet, "mapCacheSet"), MapCache.prototype.clear = mapCacheClear, MapCache.prototype.delete = mapCacheDelete, MapCache.prototype.get = mapCacheGet, MapCache.prototype.has = mapCacheHas, MapCache.prototype.set = mapCacheSet;
|
|
1096
|
+
function Stack(entries) {
|
|
1097
|
+
var data = this.__data__ = new ListCache(entries);
|
|
1098
|
+
this.size = data.size;
|
|
1099
|
+
}
|
|
1100
|
+
__name(Stack, "Stack");
|
|
1101
|
+
function stackClear() {
|
|
1102
|
+
this.__data__ = new ListCache(), this.size = 0;
|
|
1103
|
+
}
|
|
1104
|
+
__name(stackClear, "stackClear");
|
|
1105
|
+
function stackDelete(key) {
|
|
1106
|
+
var data = this.__data__, result = data.delete(key);
|
|
1107
|
+
return this.size = data.size, result;
|
|
1108
|
+
}
|
|
1109
|
+
__name(stackDelete, "stackDelete");
|
|
1110
|
+
function stackGet(key) {
|
|
1111
|
+
return this.__data__.get(key);
|
|
1112
|
+
}
|
|
1113
|
+
__name(stackGet, "stackGet");
|
|
1114
|
+
function stackHas(key) {
|
|
1115
|
+
return this.__data__.has(key);
|
|
1116
|
+
}
|
|
1117
|
+
__name(stackHas, "stackHas");
|
|
1118
|
+
function stackSet(key, value) {
|
|
1119
|
+
var data = this.__data__;
|
|
1120
|
+
if (data instanceof ListCache) {
|
|
1121
|
+
var pairs = data.__data__;
|
|
1122
|
+
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1)
|
|
1123
|
+
return pairs.push([key, value]), this.size = ++data.size, this;
|
|
1124
|
+
data = this.__data__ = new MapCache(pairs);
|
|
1125
|
+
}
|
|
1126
|
+
return data.set(key, value), this.size = data.size, this;
|
|
1127
|
+
}
|
|
1128
|
+
__name(stackSet, "stackSet"), Stack.prototype.clear = stackClear, Stack.prototype.delete = stackDelete, Stack.prototype.get = stackGet, Stack.prototype.has = stackHas, Stack.prototype.set = stackSet;
|
|
1129
|
+
function arrayLikeKeys(value, inherited) {
|
|
1130
|
+
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
1131
|
+
for (var key in value)
|
|
1132
|
+
skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1133
|
+
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1134
|
+
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1135
|
+
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
1136
|
+
isIndex(key, length)) || result.push(key);
|
|
1137
|
+
return result;
|
|
1138
|
+
}
|
|
1139
|
+
__name(arrayLikeKeys, "arrayLikeKeys");
|
|
1140
|
+
function assignMergeValue(object, key, value) {
|
|
1141
|
+
(value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) && baseAssignValue(object, key, value);
|
|
1142
|
+
}
|
|
1143
|
+
__name(assignMergeValue, "assignMergeValue");
|
|
1144
|
+
function assignValue(object, key, value) {
|
|
1145
|
+
var objValue = object[key];
|
|
1146
|
+
(!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) && baseAssignValue(object, key, value);
|
|
1147
|
+
}
|
|
1148
|
+
__name(assignValue, "assignValue");
|
|
1149
|
+
function assocIndexOf(array, key) {
|
|
1150
|
+
for (var length = array.length; length--; )
|
|
1151
|
+
if (eq(array[length][0], key))
|
|
1152
|
+
return length;
|
|
1153
|
+
return -1;
|
|
1154
|
+
}
|
|
1155
|
+
__name(assocIndexOf, "assocIndexOf");
|
|
1156
|
+
function baseAssignValue(object, key, value) {
|
|
1157
|
+
key == "__proto__" && defineProperty ? defineProperty(object, key, {
|
|
1158
|
+
configurable: !0,
|
|
1159
|
+
enumerable: !0,
|
|
1160
|
+
value,
|
|
1161
|
+
writable: !0
|
|
1162
|
+
}) : object[key] = value;
|
|
1163
|
+
}
|
|
1164
|
+
__name(baseAssignValue, "baseAssignValue");
|
|
1165
|
+
var baseFor = createBaseFor();
|
|
1166
|
+
function baseGetTag(value) {
|
|
1167
|
+
return value == null ? value === void 0 ? undefinedTag : nullTag : symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
1168
|
+
}
|
|
1169
|
+
__name(baseGetTag, "baseGetTag");
|
|
1170
|
+
function baseIsArguments(value) {
|
|
1171
|
+
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
1172
|
+
}
|
|
1173
|
+
__name(baseIsArguments, "baseIsArguments");
|
|
1174
|
+
function baseIsNative(value) {
|
|
1175
|
+
if (!isObject2(value) || isMasked(value))
|
|
1176
|
+
return !1;
|
|
1177
|
+
var pattern = isFunction2(value) ? reIsNative : reIsHostCtor;
|
|
1178
|
+
return pattern.test(toSource(value));
|
|
1179
|
+
}
|
|
1180
|
+
__name(baseIsNative, "baseIsNative");
|
|
1181
|
+
function baseIsTypedArray(value) {
|
|
1182
|
+
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
1183
|
+
}
|
|
1184
|
+
__name(baseIsTypedArray, "baseIsTypedArray");
|
|
1185
|
+
function baseKeysIn(object) {
|
|
1186
|
+
if (!isObject2(object))
|
|
1187
|
+
return nativeKeysIn(object);
|
|
1188
|
+
var isProto = isPrototype(object), result = [];
|
|
1189
|
+
for (var key in object)
|
|
1190
|
+
key == "constructor" && (isProto || !hasOwnProperty.call(object, key)) || result.push(key);
|
|
1191
|
+
return result;
|
|
1192
|
+
}
|
|
1193
|
+
__name(baseKeysIn, "baseKeysIn");
|
|
1194
|
+
function baseMerge(object, source, srcIndex, customizer, stack) {
|
|
1195
|
+
object !== source && baseFor(source, function(srcValue, key) {
|
|
1196
|
+
if (stack || (stack = new Stack()), isObject2(srcValue))
|
|
1197
|
+
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
|
1198
|
+
else {
|
|
1199
|
+
var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
|
|
1200
|
+
newValue === void 0 && (newValue = srcValue), assignMergeValue(object, key, newValue);
|
|
1201
|
+
}
|
|
1202
|
+
}, keysIn);
|
|
1203
|
+
}
|
|
1204
|
+
__name(baseMerge, "baseMerge");
|
|
1205
|
+
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
|
1206
|
+
var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
|
|
1207
|
+
if (stacked) {
|
|
1208
|
+
assignMergeValue(object, key, stacked);
|
|
1209
|
+
return;
|
|
1210
|
+
}
|
|
1211
|
+
var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0, isCommon = newValue === void 0;
|
|
1212
|
+
if (isCommon) {
|
|
1213
|
+
var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
|
1214
|
+
newValue = srcValue, isArr || isBuff || isTyped ? isArray(objValue) ? newValue = objValue : isArrayLikeObject(objValue) ? newValue = copyArray(objValue) : isBuff ? (isCommon = !1, newValue = cloneBuffer(srcValue)) : isTyped ? (isCommon = !1, newValue = cloneTypedArray(srcValue)) : newValue = [] : isPlainObject(srcValue) || isArguments(srcValue) ? (newValue = objValue, isArguments(objValue) ? newValue = toPlainObject(objValue) : (!isObject2(objValue) || isFunction2(objValue)) && (newValue = initCloneObject(srcValue))) : isCommon = !1;
|
|
1215
|
+
}
|
|
1216
|
+
isCommon && (stack.set(srcValue, newValue), mergeFunc(newValue, srcValue, srcIndex, customizer, stack), stack.delete(srcValue)), assignMergeValue(object, key, newValue);
|
|
1217
|
+
}
|
|
1218
|
+
__name(baseMergeDeep, "baseMergeDeep");
|
|
1219
|
+
function baseRest(func, start) {
|
|
1220
|
+
return setToString(overRest(func, start, identity), func + "");
|
|
1221
|
+
}
|
|
1222
|
+
__name(baseRest, "baseRest");
|
|
1223
|
+
var baseSetToString = defineProperty ? function(func, string) {
|
|
1224
|
+
return defineProperty(func, "toString", {
|
|
1225
|
+
configurable: !0,
|
|
1226
|
+
enumerable: !1,
|
|
1227
|
+
value: constant(string),
|
|
1228
|
+
writable: !0
|
|
1229
|
+
});
|
|
1230
|
+
} : identity;
|
|
1231
|
+
function cloneBuffer(buffer, isDeep) {
|
|
1232
|
+
return buffer.slice();
|
|
1233
|
+
}
|
|
1234
|
+
__name(cloneBuffer, "cloneBuffer");
|
|
1235
|
+
function cloneArrayBuffer(arrayBuffer) {
|
|
1236
|
+
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
1237
|
+
return new Uint8Array2(result).set(new Uint8Array2(arrayBuffer)), result;
|
|
1238
|
+
}
|
|
1239
|
+
__name(cloneArrayBuffer, "cloneArrayBuffer");
|
|
1240
|
+
function cloneTypedArray(typedArray, isDeep) {
|
|
1241
|
+
var buffer = cloneArrayBuffer(typedArray.buffer);
|
|
1242
|
+
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
1243
|
+
}
|
|
1244
|
+
__name(cloneTypedArray, "cloneTypedArray");
|
|
1245
|
+
function copyArray(source, array) {
|
|
1246
|
+
var index2 = -1, length = source.length;
|
|
1247
|
+
for (array || (array = Array(length)); ++index2 < length; )
|
|
1248
|
+
array[index2] = source[index2];
|
|
1249
|
+
return array;
|
|
1250
|
+
}
|
|
1251
|
+
__name(copyArray, "copyArray");
|
|
1252
|
+
function copyObject(source, props, object, customizer) {
|
|
1253
|
+
var isNew = !object;
|
|
1254
|
+
object || (object = {});
|
|
1255
|
+
for (var index2 = -1, length = props.length; ++index2 < length; ) {
|
|
1256
|
+
var key = props[index2], newValue = void 0;
|
|
1257
|
+
newValue === void 0 && (newValue = source[key]), isNew ? baseAssignValue(object, key, newValue) : assignValue(object, key, newValue);
|
|
1258
|
+
}
|
|
1259
|
+
return object;
|
|
1260
|
+
}
|
|
1261
|
+
__name(copyObject, "copyObject");
|
|
1262
|
+
function createAssigner(assigner) {
|
|
1263
|
+
return baseRest(function(object, sources) {
|
|
1264
|
+
var index2 = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
|
|
1265
|
+
for (customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0, guard && isIterateeCall(sources[0], sources[1], guard) && (customizer = length < 3 ? void 0 : customizer, length = 1), object = Object(object); ++index2 < length; ) {
|
|
1266
|
+
var source = sources[index2];
|
|
1267
|
+
source && assigner(object, source, index2, customizer);
|
|
1268
|
+
}
|
|
1269
|
+
return object;
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
__name(createAssigner, "createAssigner");
|
|
1273
|
+
function createBaseFor(fromRight) {
|
|
1274
|
+
return function(object, iteratee, keysFunc) {
|
|
1275
|
+
for (var index2 = -1, iterable = Object(object), props = keysFunc(object), length = props.length; length--; ) {
|
|
1276
|
+
var key = props[++index2];
|
|
1277
|
+
if (iteratee(iterable[key], key, iterable) === !1)
|
|
1278
|
+
break;
|
|
1279
|
+
}
|
|
1280
|
+
return object;
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
__name(createBaseFor, "createBaseFor");
|
|
1284
|
+
function getMapData(map2, key) {
|
|
1285
|
+
var data = map2.__data__;
|
|
1286
|
+
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
1287
|
+
}
|
|
1288
|
+
__name(getMapData, "getMapData");
|
|
1289
|
+
function getNative(object, key) {
|
|
1290
|
+
var value = getValue(object, key);
|
|
1291
|
+
return baseIsNative(value) ? value : void 0;
|
|
1292
|
+
}
|
|
1293
|
+
__name(getNative, "getNative");
|
|
1294
|
+
function getRawTag(value) {
|
|
1295
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
1296
|
+
try {
|
|
1297
|
+
value[symToStringTag] = void 0;
|
|
1298
|
+
var unmasked = !0;
|
|
1299
|
+
} catch {
|
|
1300
|
+
}
|
|
1301
|
+
var result = nativeObjectToString.call(value);
|
|
1302
|
+
return unmasked && (isOwn ? value[symToStringTag] = tag : delete value[symToStringTag]), result;
|
|
1303
|
+
}
|
|
1304
|
+
__name(getRawTag, "getRawTag");
|
|
1305
|
+
function initCloneObject(object) {
|
|
1306
|
+
return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
|
|
1307
|
+
}
|
|
1308
|
+
__name(initCloneObject, "initCloneObject");
|
|
1309
|
+
function isIndex(value, length) {
|
|
1310
|
+
var type2 = typeof value;
|
|
1311
|
+
return length = length == null ? MAX_SAFE_INTEGER : length, !!length && (type2 == "number" || type2 != "symbol" && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
|
|
1312
|
+
}
|
|
1313
|
+
__name(isIndex, "isIndex");
|
|
1314
|
+
function isIterateeCall(value, index2, object) {
|
|
1315
|
+
if (!isObject2(object))
|
|
1316
|
+
return !1;
|
|
1317
|
+
var type2 = typeof index2;
|
|
1318
|
+
return (type2 == "number" ? isArrayLike(object) && isIndex(index2, object.length) : type2 == "string" && index2 in object) ? eq(object[index2], value) : !1;
|
|
1319
|
+
}
|
|
1320
|
+
__name(isIterateeCall, "isIterateeCall");
|
|
1321
|
+
function isKeyable(value) {
|
|
1322
|
+
var type2 = typeof value;
|
|
1323
|
+
return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null;
|
|
1324
|
+
}
|
|
1325
|
+
__name(isKeyable, "isKeyable");
|
|
1326
|
+
function isMasked(func) {
|
|
1327
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
1328
|
+
}
|
|
1329
|
+
__name(isMasked, "isMasked");
|
|
1330
|
+
function isPrototype(value) {
|
|
1331
|
+
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
1332
|
+
return value === proto;
|
|
1333
|
+
}
|
|
1334
|
+
__name(isPrototype, "isPrototype");
|
|
1335
|
+
function nativeKeysIn(object) {
|
|
1336
|
+
var result = [];
|
|
1337
|
+
if (object != null)
|
|
1338
|
+
for (var key in Object(object))
|
|
1339
|
+
result.push(key);
|
|
1340
|
+
return result;
|
|
1341
|
+
}
|
|
1342
|
+
__name(nativeKeysIn, "nativeKeysIn");
|
|
1343
|
+
function objectToString(value) {
|
|
1344
|
+
return nativeObjectToString.call(value);
|
|
1345
|
+
}
|
|
1346
|
+
__name(objectToString, "objectToString");
|
|
1347
|
+
function overRest(func, start, transform) {
|
|
1348
|
+
return start = nativeMax(start === void 0 ? func.length - 1 : start, 0), function() {
|
|
1349
|
+
for (var args = arguments, index2 = -1, length = nativeMax(args.length - start, 0), array = Array(length); ++index2 < length; )
|
|
1350
|
+
array[index2] = args[start + index2];
|
|
1351
|
+
index2 = -1;
|
|
1352
|
+
for (var otherArgs = Array(start + 1); ++index2 < start; )
|
|
1353
|
+
otherArgs[index2] = args[index2];
|
|
1354
|
+
return otherArgs[start] = transform(array), apply(func, this, otherArgs);
|
|
1355
|
+
};
|
|
1356
|
+
}
|
|
1357
|
+
__name(overRest, "overRest");
|
|
1358
|
+
function safeGet(object, key) {
|
|
1359
|
+
if (!(key === "constructor" && typeof object[key] == "function") && key != "__proto__")
|
|
1360
|
+
return object[key];
|
|
1361
|
+
}
|
|
1362
|
+
__name(safeGet, "safeGet");
|
|
1363
|
+
var setToString = shortOut(baseSetToString);
|
|
1364
|
+
function shortOut(func) {
|
|
1365
|
+
var count = 0, lastCalled = 0;
|
|
1366
|
+
return function() {
|
|
1367
|
+
var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
|
|
1368
|
+
if (lastCalled = stamp, remaining > 0) {
|
|
1369
|
+
if (++count >= HOT_COUNT)
|
|
1370
|
+
return arguments[0];
|
|
1371
|
+
} else
|
|
1372
|
+
count = 0;
|
|
1373
|
+
return func.apply(void 0, arguments);
|
|
1374
|
+
};
|
|
1375
|
+
}
|
|
1376
|
+
__name(shortOut, "shortOut");
|
|
1377
|
+
function toSource(func) {
|
|
1378
|
+
if (func != null) {
|
|
1379
|
+
try {
|
|
1380
|
+
return funcToString.call(func);
|
|
1381
|
+
} catch {
|
|
1382
|
+
}
|
|
1383
|
+
try {
|
|
1384
|
+
return func + "";
|
|
1385
|
+
} catch {
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
return "";
|
|
1389
|
+
}
|
|
1390
|
+
__name(toSource, "toSource");
|
|
1391
|
+
function eq(value, other) {
|
|
1392
|
+
return value === other || value !== value && other !== other;
|
|
1393
|
+
}
|
|
1394
|
+
__name(eq, "eq");
|
|
1395
|
+
var isArguments = baseIsArguments(/* @__PURE__ */ function() {
|
|
1396
|
+
return arguments;
|
|
1397
|
+
}()) ? baseIsArguments : function(value) {
|
|
1398
|
+
return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
1399
|
+
}, isArray = Array.isArray;
|
|
1400
|
+
function isArrayLike(value) {
|
|
1401
|
+
return value != null && isLength(value.length) && !isFunction2(value);
|
|
1402
|
+
}
|
|
1403
|
+
__name(isArrayLike, "isArrayLike");
|
|
1404
|
+
function isArrayLikeObject(value) {
|
|
1405
|
+
return isObjectLike(value) && isArrayLike(value);
|
|
1406
|
+
}
|
|
1407
|
+
__name(isArrayLikeObject, "isArrayLikeObject");
|
|
1408
|
+
var isBuffer = nativeIsBuffer || stubFalse;
|
|
1409
|
+
function isFunction2(value) {
|
|
1410
|
+
if (!isObject2(value))
|
|
1411
|
+
return !1;
|
|
1412
|
+
var tag = baseGetTag(value);
|
|
1413
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
1414
|
+
}
|
|
1415
|
+
__name(isFunction2, "isFunction");
|
|
1416
|
+
function isLength(value) {
|
|
1417
|
+
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
1418
|
+
}
|
|
1419
|
+
__name(isLength, "isLength");
|
|
1420
|
+
function isObject2(value) {
|
|
1421
|
+
var type2 = typeof value;
|
|
1422
|
+
return value != null && (type2 == "object" || type2 == "function");
|
|
1423
|
+
}
|
|
1424
|
+
__name(isObject2, "isObject");
|
|
1425
|
+
function isObjectLike(value) {
|
|
1426
|
+
return value != null && typeof value == "object";
|
|
1427
|
+
}
|
|
1428
|
+
__name(isObjectLike, "isObjectLike");
|
|
1429
|
+
function isPlainObject(value) {
|
|
1430
|
+
if (!isObjectLike(value) || baseGetTag(value) != objectTag)
|
|
1431
|
+
return !1;
|
|
1432
|
+
var proto = getPrototype(value);
|
|
1433
|
+
if (proto === null)
|
|
1434
|
+
return !0;
|
|
1435
|
+
var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
1436
|
+
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
1437
|
+
}
|
|
1438
|
+
__name(isPlainObject, "isPlainObject");
|
|
1439
|
+
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
1440
|
+
function toPlainObject(value) {
|
|
1441
|
+
return copyObject(value, keysIn(value));
|
|
1442
|
+
}
|
|
1443
|
+
__name(toPlainObject, "toPlainObject");
|
|
1444
|
+
function keysIn(object) {
|
|
1445
|
+
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeysIn(object);
|
|
1446
|
+
}
|
|
1447
|
+
__name(keysIn, "keysIn");
|
|
1448
|
+
var mergeWith2 = createAssigner(function(object, source, srcIndex, customizer) {
|
|
1449
|
+
baseMerge(object, source, srcIndex, customizer);
|
|
1450
|
+
});
|
|
1451
|
+
function constant(value) {
|
|
1452
|
+
return function() {
|
|
1453
|
+
return value;
|
|
1454
|
+
};
|
|
1455
|
+
}
|
|
1456
|
+
__name(constant, "constant");
|
|
1457
|
+
function identity(value) {
|
|
1458
|
+
return value;
|
|
1459
|
+
}
|
|
1460
|
+
__name(identity, "identity");
|
|
1461
|
+
function stubFalse() {
|
|
1462
|
+
return !1;
|
|
1463
|
+
}
|
|
1464
|
+
__name(stubFalse, "stubFalse"), module.exports = mergeWith2;
|
|
1465
|
+
})(lodash_mergewith, lodash_mergewith.exports);
|
|
1466
|
+
var lodash_mergewithExports = lodash_mergewith.exports;
|
|
1467
|
+
const mergeWith = /* @__PURE__ */ getDefaultExportFromCjs(lodash_mergewithExports), topLevelDomainSet = /* @__PURE__ */ new Set([
|
|
913
1468
|
"ac",
|
|
914
1469
|
"ad",
|
|
915
1470
|
"ae",
|
|
@@ -1646,6 +2201,19 @@ const rmsPrefix = /^-ms-/, rDashAlpha = /-([a-z])/g, alphabets = [
|
|
|
1646
2201
|
static clamp(value, min, max) {
|
|
1647
2202
|
return Math.max(min, Math.min(max, value));
|
|
1648
2203
|
}
|
|
2204
|
+
/**
|
|
2205
|
+
*
|
|
2206
|
+
*
|
|
2207
|
+
* @static
|
|
2208
|
+
* @param {unknown} object Modify the property while leaving the reference unchanged.
|
|
2209
|
+
* @param {unknown} source The source being merged in object.
|
|
2210
|
+
* @param {(value: unknown, originValue: unknown, key: string, object: unknown, source: unknown, stack: string[]) => {}} [customizer]
|
|
2211
|
+
* @return {*}
|
|
2212
|
+
* @memberof Tools
|
|
2213
|
+
*/
|
|
2214
|
+
static mergeWith(object, source, customizer) {
|
|
2215
|
+
return mergeWith(object, source, customizer);
|
|
2216
|
+
}
|
|
1649
2217
|
};
|
|
1650
2218
|
__name(_Tools, "Tools");
|
|
1651
2219
|
let Tools = _Tools;
|
|
@@ -4962,6 +5530,13 @@ const ILogService = createIdentifier("univer.log"), _DesktopLogService = class _
|
|
|
4962
5530
|
};
|
|
4963
5531
|
__name(_DesktopLogService, "DesktopLogService");
|
|
4964
5532
|
let DesktopLogService = _DesktopLogService;
|
|
5533
|
+
const _CustomCommandExecutionError = class _CustomCommandExecutionError extends Error {
|
|
5534
|
+
constructor(message) {
|
|
5535
|
+
super(message), this.name = "CustomCommandExecutionError";
|
|
5536
|
+
}
|
|
5537
|
+
};
|
|
5538
|
+
__name(_CustomCommandExecutionError, "CustomCommandExecutionError");
|
|
5539
|
+
let CustomCommandExecutionError = _CustomCommandExecutionError;
|
|
4965
5540
|
var __defProp$8 = Object.defineProperty, __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor, __decorateClass$8 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
4966
5541
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
4967
5542
|
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
@@ -5052,32 +5627,38 @@ let CommandService = (_a2 = class extends Disposable {
|
|
|
5052
5627
|
}
|
|
5053
5628
|
throw new Error(`[CommandService]: command "${id}" is not registered.`);
|
|
5054
5629
|
} catch (error) {
|
|
5630
|
+
if (error instanceof CustomCommandExecutionError)
|
|
5631
|
+
return !1;
|
|
5055
5632
|
throw this._logService.error(error), error;
|
|
5056
5633
|
}
|
|
5057
5634
|
}
|
|
5058
5635
|
syncExecuteCommand(id, params, options) {
|
|
5059
5636
|
var _a13;
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5637
|
+
try {
|
|
5638
|
+
const item = this._commandRegistry.getCommand(id);
|
|
5639
|
+
if (item) {
|
|
5640
|
+
const [command] = item, commandInfo = {
|
|
5641
|
+
id: command.id,
|
|
5642
|
+
type: command.type,
|
|
5643
|
+
params
|
|
5644
|
+
};
|
|
5645
|
+
if (command.type === 2) {
|
|
5646
|
+
const triggerCommand = findLast(
|
|
5647
|
+
this._commandExecutionStack,
|
|
5648
|
+
(item2) => item2.type === 0
|
|
5649
|
+
/* COMMAND */
|
|
5650
|
+
);
|
|
5651
|
+
triggerCommand && (commandInfo.params = (_a13 = commandInfo.params) != null ? _a13 : {}, commandInfo.params.trigger = triggerCommand.id);
|
|
5652
|
+
}
|
|
5653
|
+
const stackItemDisposable = this._pushCommandExecutionStack(commandInfo);
|
|
5654
|
+
this._beforeCommandExecutionListeners.forEach((listener) => listener(commandInfo, options));
|
|
5655
|
+
const result = this._syncExecute(command, params, options);
|
|
5656
|
+
return this._commandExecutedListeners.forEach((listener) => listener(commandInfo, options)), stackItemDisposable.dispose(), result;
|
|
5074
5657
|
}
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
return this._commandExecutedListeners.forEach((listener) => listener(commandInfo, options)), stackItemDisposable.dispose(), result;
|
|
5658
|
+
throw new Error(`[CommandService]: command "${id}" is not registered.`);
|
|
5659
|
+
} catch (error) {
|
|
5660
|
+
throw this._logService.error(error), error;
|
|
5079
5661
|
}
|
|
5080
|
-
throw new Error(`[CommandService]: command "${id}" is not registered.`);
|
|
5081
5662
|
}
|
|
5082
5663
|
_pushCommandExecutionStack(stackItem) {
|
|
5083
5664
|
return this._commandExecutionStack.push(stackItem), toDisposable(() => remove(this._commandExecutionStack, stackItem));
|
|
@@ -5210,12 +5791,12 @@ const afterInitApply = /* @__PURE__ */ __name((commandService) => new Promise((r
|
|
|
5210
5791
|
res();
|
|
5211
5792
|
});
|
|
5212
5793
|
}), "afterInitApply");
|
|
5213
|
-
var N = /* @__PURE__ */ ((E) => (E[E.UNDEFINED = 0] = "UNDEFINED", E[E.OK = 1] = "OK", E[E.INTERNAL_ERROR = 2] = "INTERNAL_ERROR", E[E.PERMISSION_DENIED = 3] = "PERMISSION_DENIED", E[E.NOT_FOUND = 4] = "NOT_FOUND", E[E.UNAUTHENTICATED = 5] = "UNAUTHENTICATED", E[E.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", E[E.INVALID_ARGUMENT = 7] = "INVALID_ARGUMENT", E[E.TOO_MANY_REQUESTS = 8] = "TOO_MANY_REQUESTS", E[E.COMPLETION_FINISHED = 9] = "COMPLETION_FINISHED", E[E.CHANGESET_REVISION_CONFILICT = 5001] = "CHANGESET_REVISION_CONFILICT", E[E.SNAPSHOT_INVALID_SNAPSHOT = 6001] = "SNAPSHOT_INVALID_SNAPSHOT", E[E.SNAPSHOT_HAS_BEEN_REMOVED = 6002] = "SNAPSHOT_HAS_BEEN_REMOVED", E[E.APPLY_REJECT = 7001] = "APPLY_REJECT", E[E.APPLY_NON_SEQUENTIAL_REVISION = 7002] = "APPLY_NON_SEQUENTIAL_REVISION", E[E.APPLY_REVISION_CONFILICT = 7003] = "APPLY_REVISION_CONFILICT", E[E.APPLY_PERMISSION_DENIED = 7004] = "APPLY_PERMISSION_DENIED", E[E.CONNECTOR_DATA_TOO_LARGE = 8001] = "CONNECTOR_DATA_TOO_LARGE", E[E.LICENSE_MAX_UNITS_EXCEEDED = 9001] = "LICENSE_MAX_UNITS_EXCEEDED", E[E.LICENSE_MAX_MEMBERS_PER_UNIT_EXCEEDED = 9002] = "LICENSE_MAX_MEMBERS_PER_UNIT_EXCEEDED", E[E.LICENSE_IMPORT_SIZE_EXCEEDED = 9003] = "LICENSE_IMPORT_SIZE_EXCEEDED", E[E.LICENSE_EXPORT_SIZE_EXCEEDED = 9004] = "LICENSE_EXPORT_SIZE_EXCEEDED", E[E.LICENSE_DISTRO_REJECTED = 9005] = "LICENSE_DISTRO_REJECTED", E[E.YUUMI_UNABLE_LOAD_URL = 10001] = "YUUMI_UNABLE_LOAD_URL", E[E.YUUMI_URL_COL_OUT_OF_RANGE = 10002] = "YUUMI_URL_COL_OUT_OF_RANGE", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(N || {});
|
|
5214
|
-
function
|
|
5794
|
+
var N = /* @__PURE__ */ ((E) => (E[E.UNDEFINED = 0] = "UNDEFINED", E[E.OK = 1] = "OK", E[E.INTERNAL_ERROR = 2] = "INTERNAL_ERROR", E[E.PERMISSION_DENIED = 3] = "PERMISSION_DENIED", E[E.NOT_FOUND = 4] = "NOT_FOUND", E[E.UNAUTHENTICATED = 5] = "UNAUTHENTICATED", E[E.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", E[E.INVALID_ARGUMENT = 7] = "INVALID_ARGUMENT", E[E.TOO_MANY_REQUESTS = 8] = "TOO_MANY_REQUESTS", E[E.COMPLETION_FINISHED = 9] = "COMPLETION_FINISHED", E[E.CHANGESET_REVISION_CONFILICT = 5001] = "CHANGESET_REVISION_CONFILICT", E[E.SNAPSHOT_INVALID_SNAPSHOT = 6001] = "SNAPSHOT_INVALID_SNAPSHOT", E[E.SNAPSHOT_HAS_BEEN_REMOVED = 6002] = "SNAPSHOT_HAS_BEEN_REMOVED", E[E.APPLY_REJECT = 7001] = "APPLY_REJECT", E[E.APPLY_NON_SEQUENTIAL_REVISION = 7002] = "APPLY_NON_SEQUENTIAL_REVISION", E[E.APPLY_REVISION_CONFILICT = 7003] = "APPLY_REVISION_CONFILICT", E[E.APPLY_PERMISSION_DENIED = 7004] = "APPLY_PERMISSION_DENIED", E[E.CONNECTOR_DATA_TOO_LARGE = 8001] = "CONNECTOR_DATA_TOO_LARGE", E[E.LICENSE_MAX_UNITS_EXCEEDED = 9001] = "LICENSE_MAX_UNITS_EXCEEDED", E[E.LICENSE_MAX_MEMBERS_PER_UNIT_EXCEEDED = 9002] = "LICENSE_MAX_MEMBERS_PER_UNIT_EXCEEDED", E[E.LICENSE_IMPORT_SIZE_EXCEEDED = 9003] = "LICENSE_IMPORT_SIZE_EXCEEDED", E[E.LICENSE_EXPORT_SIZE_EXCEEDED = 9004] = "LICENSE_EXPORT_SIZE_EXCEEDED", E[E.LICENSE_DISTRO_REJECTED = 9005] = "LICENSE_DISTRO_REJECTED", E[E.YUUMI_UNABLE_LOAD_URL = 10001] = "YUUMI_UNABLE_LOAD_URL", E[E.YUUMI_URL_COL_OUT_OF_RANGE = 10002] = "YUUMI_URL_COL_OUT_OF_RANGE", E[E.YUUMI_RATE_OVER_LIMIT = 10003] = "YUUMI_RATE_OVER_LIMIT", E[E.YUUMI_SUBSCRIPTION_NOT_FOUND = 10004] = "YUUMI_SUBSCRIPTION_NOT_FOUND", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(N || {});
|
|
5795
|
+
function H(E) {
|
|
5215
5796
|
return !!(E && E.code && E.code !== N.OK && E.code !== "OK");
|
|
5216
5797
|
}
|
|
5217
|
-
__name(
|
|
5218
|
-
var I = /* @__PURE__ */ ((E) => (E[E.UNIVER_UNKNOWN = 0] = "UNIVER_UNKNOWN", E[E.UNIVER_DOC = 1] = "UNIVER_DOC", E[E.UNIVER_SHEET = 2] = "UNIVER_SHEET", E[E.UNIVER_SLIDE = 3] = "UNIVER_SLIDE", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(I || {}), L = /* @__PURE__ */ ((E) => (E[E.SomeCollaborator = 0] = "SomeCollaborator", E[E.AllCollaborator = 1] = "AllCollaborator", E[E.OneSelf = 2] = "OneSelf", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(L || {}),
|
|
5798
|
+
__name(H, "H");
|
|
5799
|
+
var I = /* @__PURE__ */ ((E) => (E[E.UNIVER_UNKNOWN = 0] = "UNIVER_UNKNOWN", E[E.UNIVER_DOC = 1] = "UNIVER_DOC", E[E.UNIVER_SHEET = 2] = "UNIVER_SHEET", E[E.UNIVER_SLIDE = 3] = "UNIVER_SLIDE", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(I || {}), L = /* @__PURE__ */ ((E) => (E[E.SomeCollaborator = 0] = "SomeCollaborator", E[E.AllCollaborator = 1] = "AllCollaborator", E[E.OneSelf = 2] = "OneSelf", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(L || {}), M = /* @__PURE__ */ ((E) => (E[E.Reader = 0] = "Reader", E[E.Editor = 1] = "Editor", E[E.Owner = 2] = "Owner", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(M || {}), l = /* @__PURE__ */ ((E) => (E[E.Unkonwn = 0] = "Unkonwn", E[E.Workbook = 1] = "Workbook", E[E.Worksheet = 2] = "Worksheet", E[E.SelectRange = 3] = "SelectRange", E[E.Document = 4] = "Document", E[E.Slide = 5] = "Slide", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(l || {});
|
|
5219
5800
|
const _UnitModel = class _UnitModel extends Disposable {
|
|
5220
5801
|
};
|
|
5221
5802
|
__name(_UnitModel, "UnitModel");
|
|
@@ -5259,97 +5840,220 @@ const _RegistryAsMap = class _RegistryAsMap {
|
|
|
5259
5840
|
};
|
|
5260
5841
|
__name(_RegistryAsMap, "RegistryAsMap");
|
|
5261
5842
|
let RegistryAsMap = _RegistryAsMap;
|
|
5262
|
-
var DataStreamTreeNodeType = /* @__PURE__ */ ((DataStreamTreeNodeType2) => (DataStreamTreeNodeType2
|
|
5263
|
-
`, DataStreamTreeTokenType2.TABLE_START = "", DataStreamTreeTokenType2.TABLE_ROW_START = "\x1B", DataStreamTreeTokenType2.TABLE_CELL_START = "", DataStreamTreeTokenType2.TABLE_CELL_END = "", DataStreamTreeTokenType2.TABLE_ROW_END = "", DataStreamTreeTokenType2.TABLE_END = "", DataStreamTreeTokenType2.CUSTOM_RANGE_START = "", DataStreamTreeTokenType2.CUSTOM_RANGE_END = "", DataStreamTreeTokenType2.COLUMN_BREAK = "\v", DataStreamTreeTokenType2.PAGE_BREAK = "\f", DataStreamTreeTokenType2.DOCS_END = "\0", DataStreamTreeTokenType2.TAB = " ", DataStreamTreeTokenType2.CUSTOM_BLOCK = "\b", DataStreamTreeTokenType2.LETTER = "", DataStreamTreeTokenType2.SPACE = " ", DataStreamTreeTokenType2))(DataStreamTreeTokenType || {})
|
|
5264
|
-
|
|
5843
|
+
var DataStreamTreeNodeType = /* @__PURE__ */ ((DataStreamTreeNodeType2) => (DataStreamTreeNodeType2.PARAGRAPH = "PARAGRAPH", DataStreamTreeNodeType2.SECTION_BREAK = "SECTION_BREAK", DataStreamTreeNodeType2.TABLE = "TABLE", DataStreamTreeNodeType2.TABLE_ROW = "TABLE_ROW", DataStreamTreeNodeType2.TABLE_CELL = "TABLE_CELL", DataStreamTreeNodeType2.CUSTOM_BLOCK = "CUSTOM_BLOCK", DataStreamTreeNodeType2))(DataStreamTreeNodeType || {}), DataStreamTreeTokenType = /* @__PURE__ */ ((DataStreamTreeTokenType2) => (DataStreamTreeTokenType2.PARAGRAPH = "\r", DataStreamTreeTokenType2.SECTION_BREAK = `
|
|
5844
|
+
`, DataStreamTreeTokenType2.TABLE_START = "", DataStreamTreeTokenType2.TABLE_ROW_START = "\x1B", DataStreamTreeTokenType2.TABLE_CELL_START = "", DataStreamTreeTokenType2.TABLE_CELL_END = "", DataStreamTreeTokenType2.TABLE_ROW_END = "", DataStreamTreeTokenType2.TABLE_END = "", DataStreamTreeTokenType2.CUSTOM_RANGE_START = "", DataStreamTreeTokenType2.CUSTOM_RANGE_END = "", DataStreamTreeTokenType2.COLUMN_BREAK = "\v", DataStreamTreeTokenType2.PAGE_BREAK = "\f", DataStreamTreeTokenType2.DOCS_END = "\0", DataStreamTreeTokenType2.TAB = " ", DataStreamTreeTokenType2.CUSTOM_BLOCK = "\b", DataStreamTreeTokenType2.LETTER = "", DataStreamTreeTokenType2.SPACE = " ", DataStreamTreeTokenType2))(DataStreamTreeTokenType || {});
|
|
5845
|
+
function makeCustomRangeStream(stream) {
|
|
5846
|
+
return `${stream}`;
|
|
5847
|
+
}
|
|
5848
|
+
__name(makeCustomRangeStream, "makeCustomRangeStream");
|
|
5849
|
+
var QuickListType = /* @__PURE__ */ ((QuickListType2) => (QuickListType2.ORDER_LIST_QUICK_1 = "1.", QuickListType2.ORDER_LIST_QUICK_2 = "a)", QuickListType2.ORDER_LIST_QUICK_3 = "a.", QuickListType2.ORDER_LIST_QUICK_4 = "i.", QuickListType2.ORDER_LIST_QUICK_5 = "A.", QuickListType2.ORDER_LIST_QUICK_6 = "I.", QuickListType2.ORDER_LIST_QUICK_7 = "01.", QuickListType2))(QuickListType || {}), PresetListType = /* @__PURE__ */ ((PresetListType2) => (PresetListType2.BULLET_LIST = "BULLET_LIST", PresetListType2.BULLET_LIST_1 = "BULLET_LIST_1", PresetListType2.BULLET_LIST_2 = "BULLET_LIST_2", PresetListType2.BULLET_LIST_3 = "BULLET_LIST_3", PresetListType2.BULLET_LIST_4 = "BULLET_LIST_4", PresetListType2.BULLET_LIST_5 = "BULLET_LIST_5", PresetListType2.ORDER_LIST = "ORDER_LIST", PresetListType2.ORDER_LIST_1 = "ORDER_LIST_1", PresetListType2.ORDER_LIST_2 = "ORDER_LIST_2", PresetListType2.ORDER_LIST_3 = "ORDER_LIST_3", PresetListType2.ORDER_LIST_4 = "ORDER_LIST_4", PresetListType2.ORDER_LIST_5 = "ORDER_LIST_5", PresetListType2.ORDER_LIST_QUICK_2 = "ORDER_LIST_QUICK_2", PresetListType2.ORDER_LIST_QUICK_3 = "ORDER_LIST_QUICK_3", PresetListType2.ORDER_LIST_QUICK_4 = "ORDER_LIST_QUICK_4", PresetListType2.ORDER_LIST_QUICK_5 = "ORDER_LIST_QUICK_5", PresetListType2.ORDER_LIST_QUICK_6 = "ORDER_LIST_QUICK_6", PresetListType2.CHECK_LIST = "CHECK_LIST", PresetListType2.CHECK_LIST_CHECKED = "CHECK_LIST_CHECKED", PresetListType2))(PresetListType || {});
|
|
5850
|
+
const orderListSymbolMap = {
|
|
5851
|
+
"a)": { glyphFormat: " %1)", glyphType: GlyphType.DECIMAL },
|
|
5852
|
+
"1.": { glyphFormat: " %1.", glyphType: GlyphType.DECIMAL },
|
|
5853
|
+
"a.": { glyphFormat: " %1.", glyphType: GlyphType.LOWER_LETTER },
|
|
5854
|
+
"A.": { glyphFormat: " %1.", glyphType: GlyphType.UPPER_LETTER },
|
|
5855
|
+
"i.": { glyphFormat: " %1.", glyphType: GlyphType.LOWER_ROMAN },
|
|
5856
|
+
"I.": { glyphFormat: " %1.", glyphType: GlyphType.UPPER_LETTER }
|
|
5857
|
+
}, bulletListFactory = /* @__PURE__ */ __name((symbols) => [
|
|
5858
|
+
...symbols,
|
|
5859
|
+
...symbols,
|
|
5860
|
+
...symbols
|
|
5861
|
+
].map((templateSymbol, i) => ({
|
|
5862
|
+
glyphFormat: ` %${i + 1}`,
|
|
5863
|
+
glyphSymbol: templateSymbol,
|
|
5864
|
+
bulletAlignment: BulletAlignment.START,
|
|
5865
|
+
textStyle: {
|
|
5866
|
+
fs: 12
|
|
5867
|
+
},
|
|
5868
|
+
startNumber: 0,
|
|
5869
|
+
paragraphProperties: {
|
|
5870
|
+
hanging: { v: 21 },
|
|
5871
|
+
indentStart: { v: 21 * (i + 1) }
|
|
5872
|
+
}
|
|
5873
|
+
})), "bulletListFactory"), orderListFactory = /* @__PURE__ */ __name((options) => options.map((format, i) => ({
|
|
5874
|
+
...format,
|
|
5875
|
+
bulletAlignment: BulletAlignment.START,
|
|
5876
|
+
textStyle: {
|
|
5877
|
+
fs: 12
|
|
5878
|
+
},
|
|
5879
|
+
startNumber: 0,
|
|
5880
|
+
paragraphProperties: {
|
|
5881
|
+
hanging: { v: 21 },
|
|
5882
|
+
indentStart: { v: 21 * (i + 1) }
|
|
5883
|
+
}
|
|
5884
|
+
})), "orderListFactory"), checkListFactory = /* @__PURE__ */ __name((symbol, textStyle) => Array(9).fill(0).map((_, i) => ({
|
|
5885
|
+
glyphFormat: ` %${i + 1}`,
|
|
5886
|
+
glyphSymbol: symbol,
|
|
5887
|
+
bulletAlignment: BulletAlignment.START,
|
|
5888
|
+
textStyle: {
|
|
5889
|
+
fs: 16
|
|
5890
|
+
},
|
|
5891
|
+
startNumber: 0,
|
|
5892
|
+
paragraphProperties: {
|
|
5893
|
+
hanging: { v: 21 },
|
|
5894
|
+
indentStart: { v: 21 * (i + 1) },
|
|
5895
|
+
textStyle
|
|
5896
|
+
}
|
|
5897
|
+
})), "checkListFactory"), PRESET_LIST_TYPE = {
|
|
5265
5898
|
BULLET_LIST: {
|
|
5266
5899
|
listType: "BULLET_LIST",
|
|
5267
|
-
nestingLevel: [
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
glyphSymbol: "■",
|
|
5289
|
-
paragraphProperties: {
|
|
5290
|
-
hanging: { v: 21 },
|
|
5291
|
-
indentStart: { v: 42 }
|
|
5292
|
-
}
|
|
5293
|
-
},
|
|
5294
|
-
{
|
|
5295
|
-
bulletAlignment: BulletAlignment.START,
|
|
5296
|
-
glyphFormat: " %1",
|
|
5297
|
-
textStyle: {
|
|
5298
|
-
fs: 12
|
|
5299
|
-
},
|
|
5300
|
-
startNumber: 0,
|
|
5301
|
-
glyphSymbol: "◆",
|
|
5302
|
-
paragraphProperties: {
|
|
5303
|
-
hanging: { v: 21 },
|
|
5304
|
-
indentStart: { v: 63 }
|
|
5305
|
-
}
|
|
5306
|
-
}
|
|
5307
|
-
]
|
|
5900
|
+
nestingLevel: bulletListFactory(["●", "○", "■"])
|
|
5901
|
+
},
|
|
5902
|
+
BULLET_LIST_1: {
|
|
5903
|
+
listType: "BULLET_LIST",
|
|
5904
|
+
nestingLevel: bulletListFactory(["❖", "➢", "■"])
|
|
5905
|
+
},
|
|
5906
|
+
BULLET_LIST_2: {
|
|
5907
|
+
listType: "BULLET_LIST",
|
|
5908
|
+
nestingLevel: bulletListFactory(["✔", "●", "◆"])
|
|
5909
|
+
},
|
|
5910
|
+
BULLET_LIST_3: {
|
|
5911
|
+
listType: "BULLET_LIST",
|
|
5912
|
+
nestingLevel: bulletListFactory(["■", "◆", "○"])
|
|
5913
|
+
},
|
|
5914
|
+
BULLET_LIST_4: {
|
|
5915
|
+
listType: "BULLET_LIST",
|
|
5916
|
+
nestingLevel: bulletListFactory(["✧", "○", "■"])
|
|
5917
|
+
},
|
|
5918
|
+
BULLET_LIST_5: {
|
|
5919
|
+
listType: "BULLET_LIST",
|
|
5920
|
+
nestingLevel: bulletListFactory(["➢", "○", "◆"])
|
|
5308
5921
|
},
|
|
5309
5922
|
ORDER_LIST: {
|
|
5310
5923
|
listType: "ORDER_LIST",
|
|
5311
|
-
nestingLevel: [
|
|
5312
|
-
{
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5924
|
+
nestingLevel: orderListFactory([
|
|
5925
|
+
{ glyphFormat: " %1.", glyphType: GlyphType.DECIMAL },
|
|
5926
|
+
{ glyphFormat: " %2.", glyphType: GlyphType.LOWER_LETTER },
|
|
5927
|
+
{ glyphFormat: " %3.", glyphType: GlyphType.LOWER_ROMAN },
|
|
5928
|
+
{ glyphFormat: " %4.", glyphType: GlyphType.DECIMAL },
|
|
5929
|
+
{ glyphFormat: " %5.", glyphType: GlyphType.LOWER_LETTER },
|
|
5930
|
+
{ glyphFormat: " %6.", glyphType: GlyphType.LOWER_ROMAN },
|
|
5931
|
+
{ glyphFormat: " %7.", glyphType: GlyphType.DECIMAL },
|
|
5932
|
+
{ glyphFormat: " %8.", glyphType: GlyphType.LOWER_LETTER },
|
|
5933
|
+
{ glyphFormat: " %9.", glyphType: GlyphType.LOWER_ROMAN }
|
|
5934
|
+
])
|
|
5935
|
+
},
|
|
5936
|
+
ORDER_LIST_1: {
|
|
5937
|
+
listType: "ORDER_LIST",
|
|
5938
|
+
nestingLevel: orderListFactory([
|
|
5939
|
+
{ glyphFormat: " %1)", glyphType: GlyphType.DECIMAL },
|
|
5940
|
+
{ glyphFormat: " %2)", glyphType: GlyphType.LOWER_LETTER },
|
|
5941
|
+
{ glyphFormat: " %3)", glyphType: GlyphType.LOWER_ROMAN },
|
|
5942
|
+
{ glyphFormat: " %4)", glyphType: GlyphType.DECIMAL },
|
|
5943
|
+
{ glyphFormat: " %5)", glyphType: GlyphType.LOWER_LETTER },
|
|
5944
|
+
{ glyphFormat: " %6)", glyphType: GlyphType.LOWER_ROMAN },
|
|
5945
|
+
{ glyphFormat: " %7)", glyphType: GlyphType.DECIMAL },
|
|
5946
|
+
{ glyphFormat: " %8)", glyphType: GlyphType.LOWER_LETTER },
|
|
5947
|
+
{ glyphFormat: " %9)", glyphType: GlyphType.LOWER_ROMAN }
|
|
5948
|
+
])
|
|
5949
|
+
},
|
|
5950
|
+
ORDER_LIST_2: {
|
|
5951
|
+
listType: "ORDER_LIST",
|
|
5952
|
+
nestingLevel: orderListFactory([
|
|
5953
|
+
" %1.",
|
|
5954
|
+
" %1.%2.",
|
|
5955
|
+
" %1.%2.%3.",
|
|
5956
|
+
" %1.%2.%3.%4.",
|
|
5957
|
+
" %1.%2.%3.%4.%5.",
|
|
5958
|
+
" %1.%2.%3.%4.%5.%6.",
|
|
5959
|
+
" %1.%2.%3.%4.%5.%6.%7."
|
|
5960
|
+
].map((format) => ({ glyphFormat: format, glyphType: GlyphType.DECIMAL })))
|
|
5961
|
+
},
|
|
5962
|
+
ORDER_LIST_3: {
|
|
5963
|
+
listType: "ORDER_LIST",
|
|
5964
|
+
nestingLevel: orderListFactory([
|
|
5965
|
+
{ glyphFormat: " %1.", glyphType: GlyphType.UPPER_LETTER },
|
|
5966
|
+
{ glyphFormat: " %2.", glyphType: GlyphType.LOWER_LETTER },
|
|
5967
|
+
{ glyphFormat: " %3.", glyphType: GlyphType.LOWER_ROMAN },
|
|
5968
|
+
{ glyphFormat: " %4.", glyphType: GlyphType.UPPER_LETTER },
|
|
5969
|
+
{ glyphFormat: " %5.", glyphType: GlyphType.LOWER_LETTER },
|
|
5970
|
+
{ glyphFormat: " %6.", glyphType: GlyphType.LOWER_ROMAN },
|
|
5971
|
+
{ glyphFormat: " %7.", glyphType: GlyphType.UPPER_LETTER },
|
|
5972
|
+
{ glyphFormat: " %8.", glyphType: GlyphType.LOWER_LETTER },
|
|
5973
|
+
{ glyphFormat: " %9.", glyphType: GlyphType.LOWER_ROMAN }
|
|
5974
|
+
])
|
|
5975
|
+
},
|
|
5976
|
+
ORDER_LIST_4: {
|
|
5977
|
+
listType: "ORDER_LIST",
|
|
5978
|
+
nestingLevel: orderListFactory([
|
|
5979
|
+
{ glyphFormat: " %1.", glyphType: GlyphType.UPPER_LETTER },
|
|
5980
|
+
{ glyphFormat: " %2.", glyphType: GlyphType.DECIMAL },
|
|
5981
|
+
{ glyphFormat: " %3.", glyphType: GlyphType.LOWER_ROMAN },
|
|
5982
|
+
{ glyphFormat: " %4.", glyphType: GlyphType.UPPER_LETTER },
|
|
5983
|
+
{ glyphFormat: " %5.", glyphType: GlyphType.DECIMAL },
|
|
5984
|
+
{ glyphFormat: " %6.", glyphType: GlyphType.LOWER_ROMAN },
|
|
5985
|
+
{ glyphFormat: " %7.", glyphType: GlyphType.UPPER_LETTER },
|
|
5986
|
+
{ glyphFormat: " %8.", glyphType: GlyphType.DECIMAL },
|
|
5987
|
+
{ glyphFormat: " %9.", glyphType: GlyphType.LOWER_ROMAN }
|
|
5988
|
+
])
|
|
5989
|
+
},
|
|
5990
|
+
ORDER_LIST_5: {
|
|
5991
|
+
listType: "ORDER_LIST",
|
|
5992
|
+
nestingLevel: orderListFactory([
|
|
5993
|
+
{ glyphFormat: " %1.", glyphType: GlyphType.DECIMAL_ZERO },
|
|
5994
|
+
{ glyphFormat: " %2.", glyphType: GlyphType.LOWER_LETTER },
|
|
5995
|
+
{ glyphFormat: " %3.", glyphType: GlyphType.LOWER_ROMAN },
|
|
5996
|
+
{ glyphFormat: " %4.", glyphType: GlyphType.DECIMAL_ZERO },
|
|
5997
|
+
{ glyphFormat: " %5.", glyphType: GlyphType.LOWER_LETTER },
|
|
5998
|
+
{ glyphFormat: " %6.", glyphType: GlyphType.LOWER_ROMAN },
|
|
5999
|
+
{ glyphFormat: " %7.", glyphType: GlyphType.DECIMAL_ZERO },
|
|
6000
|
+
{ glyphFormat: " %8.", glyphType: GlyphType.LOWER_LETTER },
|
|
6001
|
+
{ glyphFormat: " %9.", glyphType: GlyphType.LOWER_ROMAN }
|
|
6002
|
+
])
|
|
6003
|
+
},
|
|
6004
|
+
CHECK_LIST: {
|
|
6005
|
+
listType: "CHECK_LIST",
|
|
6006
|
+
nestingLevel: checkListFactory(
|
|
6007
|
+
"☐",
|
|
5325
6008
|
{
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
textStyle: {
|
|
5329
|
-
fs: 12
|
|
5330
|
-
},
|
|
5331
|
-
startNumber: 0,
|
|
5332
|
-
glyphType: GlyphType.DECIMAL,
|
|
5333
|
-
paragraphProperties: {
|
|
5334
|
-
hanging: { v: 21 },
|
|
5335
|
-
indentStart: { v: 42 }
|
|
6009
|
+
st: {
|
|
6010
|
+
s: BooleanNumber.FALSE
|
|
5336
6011
|
}
|
|
5337
|
-
}
|
|
6012
|
+
}
|
|
6013
|
+
)
|
|
6014
|
+
},
|
|
6015
|
+
CHECK_LIST_CHECKED: {
|
|
6016
|
+
listType: "CHECK_LIST_CHECKED",
|
|
6017
|
+
nestingLevel: checkListFactory(
|
|
6018
|
+
"☑",
|
|
5338
6019
|
{
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
textStyle: {
|
|
5342
|
-
fs: 12
|
|
5343
|
-
},
|
|
5344
|
-
startNumber: 0,
|
|
5345
|
-
glyphType: GlyphType.DECIMAL,
|
|
5346
|
-
paragraphProperties: {
|
|
5347
|
-
hanging: { v: 21 },
|
|
5348
|
-
indentStart: { v: 63 }
|
|
6020
|
+
st: {
|
|
6021
|
+
s: BooleanNumber.TRUE
|
|
5349
6022
|
}
|
|
5350
6023
|
}
|
|
5351
|
-
|
|
5352
|
-
}
|
|
6024
|
+
)
|
|
6025
|
+
}
|
|
6026
|
+
}, generateOrderList = /* @__PURE__ */ __name((opt) => {
|
|
6027
|
+
const { glyphFormat, glyphType } = opt, data = Tools.deepClone(PRESET_LIST_TYPE.ORDER_LIST);
|
|
6028
|
+
return data.nestingLevel[0].glyphFormat = glyphFormat, data.nestingLevel[0].glyphType = glyphType, data;
|
|
6029
|
+
}, "generateOrderList"), QUICK_LIST_TYPE = {
|
|
6030
|
+
ORDER_LIST_QUICK_2: generateOrderList(orderListSymbolMap[
|
|
6031
|
+
"a)"
|
|
6032
|
+
/* ORDER_LIST_QUICK_2 */
|
|
6033
|
+
]),
|
|
6034
|
+
ORDER_LIST_QUICK_3: generateOrderList(orderListSymbolMap[
|
|
6035
|
+
"a."
|
|
6036
|
+
/* ORDER_LIST_QUICK_3 */
|
|
6037
|
+
]),
|
|
6038
|
+
ORDER_LIST_QUICK_4: generateOrderList(orderListSymbolMap[
|
|
6039
|
+
"i."
|
|
6040
|
+
/* ORDER_LIST_QUICK_4 */
|
|
6041
|
+
]),
|
|
6042
|
+
ORDER_LIST_QUICK_6: generateOrderList(orderListSymbolMap[
|
|
6043
|
+
"I."
|
|
6044
|
+
/* ORDER_LIST_QUICK_6 */
|
|
6045
|
+
])
|
|
6046
|
+
};
|
|
6047
|
+
Object.assign(PRESET_LIST_TYPE, QUICK_LIST_TYPE);
|
|
6048
|
+
const QuickListTypeMap = {
|
|
6049
|
+
"1.": "ORDER_LIST",
|
|
6050
|
+
"a)": "ORDER_LIST_QUICK_2",
|
|
6051
|
+
"a.": "ORDER_LIST_QUICK_3",
|
|
6052
|
+
"i.": "ORDER_LIST_QUICK_4",
|
|
6053
|
+
"A.": "ORDER_LIST_3",
|
|
6054
|
+
"I.": "ORDER_LIST_QUICK_6",
|
|
6055
|
+
"01.": "ORDER_LIST_5"
|
|
6056
|
+
/* ORDER_LIST_5 */
|
|
5353
6057
|
};
|
|
5354
6058
|
function normalizeTextRuns(textRuns) {
|
|
5355
6059
|
const results = [];
|
|
@@ -5487,7 +6191,7 @@ function insertTables(body, insertBody, textLength, currentIndex) {
|
|
|
5487
6191
|
return;
|
|
5488
6192
|
for (let i = 0, len = tables.length; i < len; i++) {
|
|
5489
6193
|
const table = tables[i], { startIndex, endIndex } = table;
|
|
5490
|
-
startIndex > currentIndex ? (table.startIndex += textLength, table.endIndex += textLength) : endIndex
|
|
6194
|
+
startIndex > currentIndex ? (table.startIndex += textLength, table.endIndex += textLength) : endIndex > currentIndex && (table.endIndex += textLength);
|
|
5491
6195
|
}
|
|
5492
6196
|
const insertTables2 = insertBody.tables;
|
|
5493
6197
|
if (insertTables2) {
|
|
@@ -5515,8 +6219,12 @@ function insertCustomRanges(body, insertBody, textLength, currentIndex) {
|
|
|
5515
6219
|
for (let i = 0, len = insertBody.customRanges.length; i < len; i++) {
|
|
5516
6220
|
const customRange = insertBody.customRanges[i], oldCustomRange = customRangeMap[customRange.rangeId];
|
|
5517
6221
|
if (customRange.startIndex += currentIndex, customRange.endIndex += currentIndex, oldCustomRange) {
|
|
5518
|
-
if (oldCustomRange.startIndex <= customRange.startIndex && oldCustomRange.endIndex >= customRange.endIndex
|
|
6222
|
+
if (oldCustomRange.startIndex <= customRange.startIndex && oldCustomRange.endIndex >= customRange.endIndex)
|
|
6223
|
+
continue;
|
|
6224
|
+
if (body.dataStream[oldCustomRange.startIndex] === DataStreamTreeTokenType.CUSTOM_RANGE_START && body.dataStream[oldCustomRange.endIndex] === DataStreamTreeTokenType.CUSTOM_RANGE_END) {
|
|
6225
|
+
insertCustomRanges2.push(customRange);
|
|
5519
6226
|
continue;
|
|
6227
|
+
}
|
|
5520
6228
|
if (body.dataStream[oldCustomRange.startIndex] === DataStreamTreeTokenType.CUSTOM_RANGE_START) {
|
|
5521
6229
|
oldCustomRange.endIndex = customRange.endIndex;
|
|
5522
6230
|
continue;
|
|
@@ -5692,7 +6400,8 @@ function deleteTables(body, textLength, currentIndex) {
|
|
|
5692
6400
|
continue;
|
|
5693
6401
|
} else if (st <= startIndex && ed >= endIndex) {
|
|
5694
6402
|
const segments = horizontalLineSegmentsSubtraction(st, ed, startIndex, endIndex);
|
|
5695
|
-
table.startIndex = segments[0], table.endIndex = segments[1]
|
|
6403
|
+
if (table.startIndex = segments[0], table.endIndex = segments[1], table.startIndex === table.endIndex)
|
|
6404
|
+
continue;
|
|
5696
6405
|
} else endIndex < st && (table.startIndex -= textLength, table.endIndex -= textLength);
|
|
5697
6406
|
newTables.push(table);
|
|
5698
6407
|
}
|
|
@@ -5972,7 +6681,7 @@ function updateCustomDecorations(body, updateBody, textLength, currentIndex, cov
|
|
|
5972
6681
|
__name(updateCustomDecorations, "updateCustomDecorations");
|
|
5973
6682
|
var SliceBodyType = /* @__PURE__ */ ((SliceBodyType2) => (SliceBodyType2[SliceBodyType2.copy = 0] = "copy", SliceBodyType2[SliceBodyType2.cut = 1] = "cut", SliceBodyType2))(SliceBodyType || {});
|
|
5974
6683
|
function getBodySlice(body, startOffset, endOffset, returnEmptyTextRun = !1, type2 = 1) {
|
|
5975
|
-
const { dataStream, textRuns = [], paragraphs = [], customBlocks = [] } = body, docBody = {
|
|
6684
|
+
const { dataStream, textRuns = [], paragraphs = [], customBlocks = [], tables = [] } = body, docBody = {
|
|
5976
6685
|
dataStream: dataStream.slice(startOffset, endOffset)
|
|
5977
6686
|
}, newTextRuns = [];
|
|
5978
6687
|
for (const textRun of textRuns) {
|
|
@@ -5999,6 +6708,16 @@ function getBodySlice(body, startOffset, endOffset, returnEmptyTextRun = !1, typ
|
|
|
5999
6708
|
ed: endOffset - startOffset,
|
|
6000
6709
|
ts: {}
|
|
6001
6710
|
}]);
|
|
6711
|
+
const newTables = [];
|
|
6712
|
+
for (const table of tables) {
|
|
6713
|
+
const clonedTable = Tools.deepClone(table), { startIndex, endIndex } = clonedTable;
|
|
6714
|
+
startIndex >= startOffset && endIndex <= endOffset && newTables.push({
|
|
6715
|
+
...clonedTable,
|
|
6716
|
+
startIndex: startIndex - startOffset,
|
|
6717
|
+
endIndex: endIndex - startOffset
|
|
6718
|
+
});
|
|
6719
|
+
}
|
|
6720
|
+
newTables.length && (docBody.tables = newTables);
|
|
6002
6721
|
const newParagraphs = [];
|
|
6003
6722
|
for (const paragraph of paragraphs) {
|
|
6004
6723
|
const { startIndex } = paragraph;
|
|
@@ -6022,7 +6741,7 @@ function getBodySlice(body, startOffset, endOffset, returnEmptyTextRun = !1, typ
|
|
|
6022
6741
|
}
|
|
6023
6742
|
__name(getBodySlice, "getBodySlice");
|
|
6024
6743
|
function normalizeBody(body) {
|
|
6025
|
-
const { dataStream, textRuns, paragraphs, customRanges, customDecorations } = body;
|
|
6744
|
+
const { dataStream, textRuns, paragraphs, customRanges, customDecorations, tables } = body;
|
|
6026
6745
|
let leftOffset = 0, rightOffset = 0;
|
|
6027
6746
|
customRanges == null || customRanges.forEach((range) => {
|
|
6028
6747
|
range.startIndex < 0 && (leftOffset = Math.max(leftOffset, -range.startIndex)), range.endIndex > dataStream.length - 1 && (rightOffset = Math.max(rightOffset, range.endIndex - dataStream.length + 1));
|
|
@@ -6036,13 +6755,16 @@ function normalizeBody(body) {
|
|
|
6036
6755
|
range.startIndex += leftOffset, range.endIndex += leftOffset;
|
|
6037
6756
|
}), customDecorations == null || customDecorations.forEach((d) => {
|
|
6038
6757
|
d.startIndex += leftOffset, d.endIndex += rightOffset;
|
|
6758
|
+
}), tables == null || tables.forEach((table) => {
|
|
6759
|
+
table.startIndex += leftOffset, table.endIndex += rightOffset;
|
|
6039
6760
|
}), {
|
|
6040
6761
|
...body,
|
|
6041
6762
|
dataStream: newData,
|
|
6042
6763
|
textRuns,
|
|
6043
6764
|
paragraphs,
|
|
6044
6765
|
customRanges,
|
|
6045
|
-
customDecorations
|
|
6766
|
+
customDecorations,
|
|
6767
|
+
tables
|
|
6046
6768
|
};
|
|
6047
6769
|
}
|
|
6048
6770
|
__name(normalizeBody, "normalizeBody");
|
|
@@ -6163,11 +6885,6 @@ function getEmptySnapshot$1(unitID = Tools.generateRandomId(6), locale = LocaleT
|
|
|
6163
6885
|
};
|
|
6164
6886
|
}
|
|
6165
6887
|
__name(getEmptySnapshot$1, "getEmptySnapshot$1");
|
|
6166
|
-
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
6167
|
-
function getDefaultExportFromCjs(x) {
|
|
6168
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
|
|
6169
|
-
}
|
|
6170
|
-
__name(getDefaultExportFromCjs, "getDefaultExportFromCjs");
|
|
6171
6888
|
var dist$1 = {}, json1_release = {}, deepEqual$1 = {};
|
|
6172
6889
|
Object.defineProperty(deepEqual$1, "__esModule", { value: !0 });
|
|
6173
6890
|
function eqObj(a, b) {
|
|
@@ -7769,28 +8486,144 @@ __name(insertApply, "insertApply");
|
|
|
7769
8486
|
function textXApply(doc, actions) {
|
|
7770
8487
|
const memoryCursor = new MemoryCursor();
|
|
7771
8488
|
return memoryCursor.reset(), actions.forEach((action) => {
|
|
7772
|
-
|
|
8489
|
+
const clonedAction = Tools.deepClone(action);
|
|
8490
|
+
switch (clonedAction.t) {
|
|
7773
8491
|
case TextXActionType.RETAIN: {
|
|
7774
|
-
const { coverType, body, len } =
|
|
8492
|
+
const { coverType, body, len } = clonedAction;
|
|
7775
8493
|
body != null && updateApply(doc, body, len, memoryCursor.cursor, coverType), memoryCursor.moveCursor(len);
|
|
7776
8494
|
break;
|
|
7777
8495
|
}
|
|
7778
8496
|
case TextXActionType.INSERT: {
|
|
7779
|
-
const { body, len } =
|
|
8497
|
+
const { body, len } = clonedAction;
|
|
7780
8498
|
insertApply(doc, body, len, memoryCursor.cursor), memoryCursor.moveCursor(len);
|
|
7781
8499
|
break;
|
|
7782
8500
|
}
|
|
7783
8501
|
case TextXActionType.DELETE: {
|
|
7784
|
-
const { len } =
|
|
8502
|
+
const { len } = clonedAction;
|
|
7785
8503
|
deleteApply(doc, len, memoryCursor.cursor);
|
|
7786
8504
|
break;
|
|
7787
8505
|
}
|
|
7788
8506
|
default:
|
|
7789
|
-
throw new Error(`Unknown action type for action: ${
|
|
8507
|
+
throw new Error(`Unknown action type for action: ${clonedAction}.`);
|
|
7790
8508
|
}
|
|
7791
8509
|
}), doc;
|
|
7792
8510
|
}
|
|
7793
8511
|
__name(textXApply, "textXApply");
|
|
8512
|
+
function transformTextRuns(originTextRuns, targetTextRuns, transformType) {
|
|
8513
|
+
if (originTextRuns.length === 0)
|
|
8514
|
+
return targetTextRuns;
|
|
8515
|
+
targetTextRuns = Tools$1.deepClone(targetTextRuns), originTextRuns = Tools$1.deepClone(originTextRuns);
|
|
8516
|
+
const newUpdateTextRuns = [], updateLength = targetTextRuns.length, removeLength = originTextRuns.length;
|
|
8517
|
+
let updateIndex = 0, removeIndex = 0, pending = null;
|
|
8518
|
+
function pushPendingAndReturnStatus() {
|
|
8519
|
+
return pending ? (newUpdateTextRuns.push(pending), pending = null, !0) : !1;
|
|
8520
|
+
}
|
|
8521
|
+
for (__name(pushPendingAndReturnStatus, "pushPendingAndReturnStatus"); updateIndex < updateLength && removeIndex < removeLength; ) {
|
|
8522
|
+
const { st: updateSt, ed: updateEd, ts: targetStyle } = targetTextRuns[updateIndex], { st: removeSt, ed: removeEd, ts: originStyle, sId } = originTextRuns[removeIndex];
|
|
8523
|
+
let newTs = {};
|
|
8524
|
+
if (transformType === 0)
|
|
8525
|
+
newTs = { ...targetStyle };
|
|
8526
|
+
else if (newTs = { ...targetStyle }, originStyle) {
|
|
8527
|
+
const keys = Object.keys(originStyle);
|
|
8528
|
+
for (const key of keys)
|
|
8529
|
+
newTs[key] && delete newTs[key];
|
|
8530
|
+
}
|
|
8531
|
+
if (updateEd < removeSt)
|
|
8532
|
+
pushPendingAndReturnStatus() || newUpdateTextRuns.push(targetTextRuns[updateIndex]), updateIndex++;
|
|
8533
|
+
else if (removeEd < updateSt)
|
|
8534
|
+
pushPendingAndReturnStatus() || newUpdateTextRuns.push(originTextRuns[removeIndex]), removeIndex++;
|
|
8535
|
+
else {
|
|
8536
|
+
const newTextRun = {
|
|
8537
|
+
st: Math.min(updateSt, removeSt),
|
|
8538
|
+
ed: Math.max(updateSt, removeSt),
|
|
8539
|
+
ts: updateSt < removeSt ? { ...targetStyle } : { ...originStyle },
|
|
8540
|
+
sId: updateSt < removeSt ? void 0 : sId
|
|
8541
|
+
};
|
|
8542
|
+
newTextRun.ed > newTextRun.st && newUpdateTextRuns.push(), newUpdateTextRuns.push({
|
|
8543
|
+
st: Math.max(updateSt, removeSt),
|
|
8544
|
+
ed: Math.min(updateEd, removeEd),
|
|
8545
|
+
ts: newTs,
|
|
8546
|
+
sId
|
|
8547
|
+
}), updateEd < removeEd ? (updateIndex++, originTextRuns[removeIndex].st = updateEd, originTextRuns[removeIndex].st === originTextRuns[removeIndex].ed && removeIndex++) : (removeIndex++, targetTextRuns[updateIndex].st = removeEd, targetTextRuns[updateIndex].st === targetTextRuns[updateIndex].ed && updateIndex++);
|
|
8548
|
+
const pendingTextRun = {
|
|
8549
|
+
st: Math.min(updateEd, removeEd),
|
|
8550
|
+
ed: Math.max(updateEd, removeEd),
|
|
8551
|
+
ts: updateEd < removeEd ? { ...originStyle } : { ...targetStyle },
|
|
8552
|
+
sId: updateEd < removeEd ? sId : void 0
|
|
8553
|
+
};
|
|
8554
|
+
pending = pendingTextRun.ed > pendingTextRun.st ? pendingTextRun : null;
|
|
8555
|
+
}
|
|
8556
|
+
}
|
|
8557
|
+
pushPendingAndReturnStatus();
|
|
8558
|
+
const tempTopTextRun = newUpdateTextRuns[newUpdateTextRuns.length - 1], updateLastTextRun = targetTextRuns[updateLength - 1], removeLastTextRun = originTextRuns[removeLength - 1];
|
|
8559
|
+
return tempTopTextRun.ed !== Math.max(updateLastTextRun.ed, removeLastTextRun.ed) && (updateLastTextRun.ed > removeLastTextRun.ed ? newUpdateTextRuns.push(updateLastTextRun) : newUpdateTextRuns.push(removeLastTextRun)), normalizeTextRuns$1(newUpdateTextRuns);
|
|
8560
|
+
}
|
|
8561
|
+
__name(transformTextRuns, "transformTextRuns");
|
|
8562
|
+
function transformParagraph(originParagraph, targetParagraph, transformType) {
|
|
8563
|
+
const paragraph = {
|
|
8564
|
+
startIndex: targetParagraph.startIndex
|
|
8565
|
+
};
|
|
8566
|
+
if (targetParagraph.paragraphStyle) {
|
|
8567
|
+
if (originParagraph.paragraphStyle == null)
|
|
8568
|
+
paragraph.paragraphStyle = {
|
|
8569
|
+
...targetParagraph.paragraphStyle
|
|
8570
|
+
};
|
|
8571
|
+
else if (paragraph.paragraphStyle = {
|
|
8572
|
+
...targetParagraph.paragraphStyle
|
|
8573
|
+
}, transformType === 1) {
|
|
8574
|
+
const keys = Object.keys(originParagraph.paragraphStyle);
|
|
8575
|
+
for (const key of keys)
|
|
8576
|
+
paragraph.paragraphStyle[key] && delete paragraph.paragraphStyle[key];
|
|
8577
|
+
}
|
|
8578
|
+
}
|
|
8579
|
+
return targetParagraph.bullet && (originParagraph.bullet == null || transformType === 0) && (paragraph.bullet = {
|
|
8580
|
+
...targetParagraph.bullet
|
|
8581
|
+
}), paragraph;
|
|
8582
|
+
}
|
|
8583
|
+
__name(transformParagraph, "transformParagraph");
|
|
8584
|
+
function transformBody(thisAction, otherAction, priority = !1) {
|
|
8585
|
+
const { body: thisBody } = thisAction, { body: otherBody } = otherAction;
|
|
8586
|
+
if (thisBody == null || thisBody.dataStream !== "" || otherBody == null || otherBody.dataStream !== "")
|
|
8587
|
+
throw new Error("Data stream is not supported in transform.");
|
|
8588
|
+
const retBody = {
|
|
8589
|
+
dataStream: ""
|
|
8590
|
+
}, { textRuns: thisTextRuns = [], paragraphs: thisParagraphs = [] } = thisBody, { textRuns: otherTextRuns = [], paragraphs: otherParagraphs = [] } = otherBody;
|
|
8591
|
+
let textRuns = [];
|
|
8592
|
+
priority ? textRuns = transformTextRuns(
|
|
8593
|
+
thisTextRuns,
|
|
8594
|
+
otherTextRuns,
|
|
8595
|
+
1
|
|
8596
|
+
/* COVER_ONLY_NOT_EXISTED */
|
|
8597
|
+
) : textRuns = transformTextRuns(
|
|
8598
|
+
thisTextRuns,
|
|
8599
|
+
otherTextRuns,
|
|
8600
|
+
0
|
|
8601
|
+
/* COVER */
|
|
8602
|
+
), textRuns.length && (retBody.textRuns = textRuns);
|
|
8603
|
+
const paragraphs = [];
|
|
8604
|
+
let thisIndex = 0, otherIndex = 0;
|
|
8605
|
+
for (; thisIndex < thisParagraphs.length && otherIndex < otherParagraphs.length; ) {
|
|
8606
|
+
const thisParagraph = thisParagraphs[thisIndex], otherParagraph = otherParagraphs[otherIndex], { startIndex: thisStart } = thisParagraph, { startIndex: otherStart } = otherParagraph;
|
|
8607
|
+
if (thisStart === otherStart) {
|
|
8608
|
+
let paragraph = {
|
|
8609
|
+
startIndex: thisStart
|
|
8610
|
+
};
|
|
8611
|
+
priority ? paragraph = transformParagraph(
|
|
8612
|
+
thisParagraph,
|
|
8613
|
+
otherParagraph,
|
|
8614
|
+
1
|
|
8615
|
+
/* COVER_ONLY_NOT_EXISTED */
|
|
8616
|
+
) : paragraph = transformParagraph(
|
|
8617
|
+
thisParagraph,
|
|
8618
|
+
otherParagraph,
|
|
8619
|
+
0
|
|
8620
|
+
/* COVER */
|
|
8621
|
+
), paragraphs.push(paragraph), thisIndex++, otherIndex++;
|
|
8622
|
+
} else thisStart < otherStart ? thisIndex++ : (paragraphs.push(Tools$1.deepClone(otherParagraph)), otherIndex++);
|
|
8623
|
+
}
|
|
8624
|
+
return otherIndex < otherParagraphs.length && paragraphs.push(...otherParagraphs.slice(otherIndex)), paragraphs.length && (retBody.paragraphs = paragraphs), retBody;
|
|
8625
|
+
}
|
|
8626
|
+
__name(transformBody, "transformBody");
|
|
7794
8627
|
function onlyHasDataStream(body) {
|
|
7795
8628
|
return Object.keys(body).length === 1;
|
|
7796
8629
|
}
|
|
@@ -7821,9 +8654,74 @@ const _TextX = class _TextX {
|
|
|
7821
8654
|
}
|
|
7822
8655
|
return textX.trimEndUselessRetainAction(), textX.serialize();
|
|
7823
8656
|
}
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
8657
|
+
/**
|
|
8658
|
+
* |(this↓ \| other→) | **insert** | **retain** | **delete** |
|
|
8659
|
+
* | ---------------- | ---------- | ---------- | ---------- |
|
|
8660
|
+
* | **insert** | Case 1 | Case 2 | Case 2 |
|
|
8661
|
+
* | **retain** | Case 1 | Case 5 | Case 4 |
|
|
8662
|
+
* | **delete** | Case 1 | Case 3 | Case 3 |
|
|
8663
|
+
*
|
|
8664
|
+
* Case 1: When the other action type is an insert operation,
|
|
8665
|
+
* the insert operation is retained regardless of the type of action this action
|
|
8666
|
+
* Case 2: When this action type is an insert operation and the other action type is a
|
|
8667
|
+
* non-insert operation, you need to retain the length of this action insert
|
|
8668
|
+
* Case 3: When this action is a delete operation, there are two scenarios:
|
|
8669
|
+
* 1) When other is a delete operation, since it is a delete operation, this has
|
|
8670
|
+
* already been deleted, so the target does not need to be in delete, and it can
|
|
8671
|
+
* be continued directly
|
|
8672
|
+
* 2) When other is the retain operation, although this action delete occurs first,
|
|
8673
|
+
* the delete priority is higher, so the delete operation is retained, and the origin
|
|
8674
|
+
* delete has been applied, so it is directly continued
|
|
8675
|
+
* Case 4: other is the delete operation, this is the retain operation, and the target delete operation
|
|
8676
|
+
* is kept
|
|
8677
|
+
* Case 5: When both other and this are retain operations
|
|
8678
|
+
* 1) If the other body attribute does not exist, directly retain length
|
|
8679
|
+
* 2) If the other body property exists, then execute the TransformBody logic to override it
|
|
8680
|
+
*/
|
|
8681
|
+
// priority - if true, this actions takes priority over other, that is, this actions are considered to happen "first".
|
|
8682
|
+
static transform(thisActions, otherActions, priority = "right") {
|
|
8683
|
+
return this._transform(otherActions, thisActions, priority === "left" ? "right" : "left");
|
|
8684
|
+
}
|
|
8685
|
+
static _transform(thisActions, otherActions, priority = "right") {
|
|
8686
|
+
var _a13;
|
|
8687
|
+
const thisIter = new ActionIterator(thisActions), otherIter = new ActionIterator(otherActions), textX = new _TextX();
|
|
8688
|
+
for (; thisIter.hasNext() || otherIter.hasNext(); )
|
|
8689
|
+
if (thisIter.peekType() === TextXActionType.INSERT && (priority === "left" || otherIter.peekType() !== TextXActionType.INSERT)) {
|
|
8690
|
+
const thisAction = thisIter.next();
|
|
8691
|
+
textX.retain(thisAction.len, (_a13 = thisAction.segmentId) != null ? _a13 : "");
|
|
8692
|
+
} else if (otherIter.peekType() === TextXActionType.INSERT)
|
|
8693
|
+
textX.push(otherIter.next());
|
|
8694
|
+
else {
|
|
8695
|
+
const length = Math.min(thisIter.peekLength(), otherIter.peekLength()), thisAction = thisIter.next(length), otherAction = otherIter.next(length);
|
|
8696
|
+
if (thisAction.t === TextXActionType.DELETE)
|
|
8697
|
+
continue;
|
|
8698
|
+
if (otherAction.t === TextXActionType.DELETE) {
|
|
8699
|
+
textX.push(otherAction);
|
|
8700
|
+
continue;
|
|
8701
|
+
}
|
|
8702
|
+
thisAction.body == null || otherAction.body == null ? textX.push(otherAction) : textX.push({
|
|
8703
|
+
...otherAction,
|
|
8704
|
+
body: transformBody(thisAction, otherAction, priority === "left")
|
|
8705
|
+
});
|
|
8706
|
+
}
|
|
8707
|
+
return textX.trimEndUselessRetainAction(), textX.serialize();
|
|
8708
|
+
}
|
|
8709
|
+
/**
|
|
8710
|
+
* Used to transform selection. Why not named transformSelection?
|
|
8711
|
+
* Because Univer Doc supports multiple Selections in one document, user need to encapsulate transformSelections at the application layer.
|
|
8712
|
+
*/
|
|
8713
|
+
static transformPosition(thisActions, index2, priority = !1) {
|
|
8714
|
+
const thisIter = new ActionIterator(thisActions);
|
|
8715
|
+
let offset = 0;
|
|
8716
|
+
for (; thisIter.hasNext() && offset <= index2; ) {
|
|
8717
|
+
const length = thisIter.peekLength(), nextType = thisIter.peekType();
|
|
8718
|
+
if (thisIter.next(), nextType === TextXActionType.DELETE) {
|
|
8719
|
+
index2 -= Math.min(length, index2 - offset);
|
|
8720
|
+
continue;
|
|
8721
|
+
} else nextType === TextXActionType.INSERT && (offset < index2 || !priority) && (index2 += length);
|
|
8722
|
+
offset += length;
|
|
8723
|
+
}
|
|
8724
|
+
return index2;
|
|
7827
8725
|
}
|
|
7828
8726
|
static isNoop(actions) {
|
|
7829
8727
|
return actions.length === 0;
|
|
@@ -7959,7 +8857,7 @@ Object.defineProperty(TextX, "name", {
|
|
|
7959
8857
|
const _JSONX = class _JSONX {
|
|
7960
8858
|
static registerSubtype(subType) {
|
|
7961
8859
|
var _a13;
|
|
7962
|
-
this._subTypes.has(subType.name) && ((_a13 = this._subTypes.get(subType.name)) == null ? void 0 : _a13.id) !== TextX.id || (this._subTypes.set(subType.name, subType), dist$1.type.registerSubtype(subType));
|
|
8860
|
+
subType == null || this._subTypes.has(subType.name) && ((_a13 = this._subTypes.get(subType.name)) == null ? void 0 : _a13.id) !== TextX.id || (this._subTypes.set(subType.name, subType), dist$1.type.registerSubtype(subType));
|
|
7963
8861
|
}
|
|
7964
8862
|
static apply(doc, actions) {
|
|
7965
8863
|
if (!dist$1.type.isNoop(actions))
|
|
@@ -7968,9 +8866,12 @@ const _JSONX = class _JSONX {
|
|
|
7968
8866
|
static compose(thisActions, otherActions) {
|
|
7969
8867
|
return dist$1.type.compose(thisActions, otherActions);
|
|
7970
8868
|
}
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
8869
|
+
static transform(thisActions, otherActions, priority) {
|
|
8870
|
+
return dist$1.type.transform(thisActions, otherActions, priority);
|
|
8871
|
+
}
|
|
8872
|
+
// Use to transform cursor position, just call TextXPro.transformPosition.
|
|
8873
|
+
static transformPosition(thisActions, index2, priority = "right") {
|
|
8874
|
+
return thisActions && thisActions.length === 2 && thisActions[0] === "body" && thisActions[1].et === TextX.name ? TextX.transformPosition(thisActions[1].e, index2, priority === "left") : index2;
|
|
7974
8875
|
}
|
|
7975
8876
|
static invertWithDoc(actions, doc) {
|
|
7976
8877
|
return dist$1.type.invertWithDoc(actions, doc);
|
|
@@ -8009,14 +8910,20 @@ const DEFAULT_DOC = {
|
|
|
8009
8910
|
documentStyle: {}
|
|
8010
8911
|
}, _DocumentDataModelSimple = class _DocumentDataModelSimple extends UnitModel {
|
|
8011
8912
|
constructor(snapshot) {
|
|
8913
|
+
var _a13;
|
|
8012
8914
|
super();
|
|
8013
8915
|
__publicField(this, "type", I.UNIVER_DOC);
|
|
8916
|
+
__publicField(this, "_name$", new BehaviorSubject(""));
|
|
8917
|
+
__publicField(this, "name$", this._name$.asObservable());
|
|
8014
8918
|
__publicField(this, "snapshot");
|
|
8015
|
-
this.snapshot = { ...DEFAULT_DOC, ...snapshot };
|
|
8919
|
+
this.snapshot = { ...DEFAULT_DOC, ...snapshot }, this._name$.next((_a13 = this.snapshot.title) != null ? _a13 : "No Title");
|
|
8016
8920
|
}
|
|
8017
8921
|
getUnitId() {
|
|
8018
8922
|
throw new Error("Method not implemented.");
|
|
8019
8923
|
}
|
|
8924
|
+
setName(name) {
|
|
8925
|
+
this.snapshot.title = name, this._name$.next(name);
|
|
8926
|
+
}
|
|
8020
8927
|
get drawings() {
|
|
8021
8928
|
return this.snapshot.drawings;
|
|
8022
8929
|
}
|
|
@@ -8098,14 +9005,9 @@ const _DocumentDataModel = class _DocumentDataModel extends DocumentDataModelSim
|
|
|
8098
9005
|
__publicField(this, "_unitId");
|
|
8099
9006
|
__publicField(this, "headerModelMap", /* @__PURE__ */ new Map());
|
|
8100
9007
|
__publicField(this, "footerModelMap", /* @__PURE__ */ new Map());
|
|
8101
|
-
__publicField(this, "_name$", new BehaviorSubject(""));
|
|
8102
|
-
__publicField(this, "name$", this._name$.asObservable());
|
|
8103
9008
|
const UNIT_ID_LENGTH = 6;
|
|
8104
9009
|
this._unitId = (_a13 = this.snapshot.id) != null ? _a13 : Tools.generateRandomId(UNIT_ID_LENGTH), this._initializeHeaderFooterModel(), this._name$.next((_b2 = this.snapshot.title) != null ? _b2 : "");
|
|
8105
9010
|
}
|
|
8106
|
-
setName(name) {
|
|
8107
|
-
this.snapshot.title = name, this._name$.next(name);
|
|
8108
|
-
}
|
|
8109
9011
|
dispose() {
|
|
8110
9012
|
super.dispose(), this.headerModelMap.forEach((header) => {
|
|
8111
9013
|
header.dispose();
|
|
@@ -9011,7 +9913,7 @@ function extractPureTextFromCell(cell) {
|
|
|
9011
9913
|
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" : "";
|
|
9012
9914
|
}
|
|
9013
9915
|
__name(extractPureTextFromCell, "extractPureTextFromCell");
|
|
9014
|
-
const version = "0.2.
|
|
9916
|
+
const version = "0.2.7";
|
|
9015
9917
|
function getEmptySnapshot(unitID = "", locale = LocaleType.ZH_CN, name = "") {
|
|
9016
9918
|
return {
|
|
9017
9919
|
id: unitID,
|
|
@@ -9089,6 +9991,7 @@ let Workbook = (_a3 = class extends UnitModel {
|
|
|
9089
9991
|
getSnapshot() {
|
|
9090
9992
|
return this._snapshot;
|
|
9091
9993
|
}
|
|
9994
|
+
/** @deprecated use use name property instead */
|
|
9092
9995
|
getName() {
|
|
9093
9996
|
return this._snapshot.name;
|
|
9094
9997
|
}
|
|
@@ -9277,9 +10180,11 @@ const _SlideDataModel = class _SlideDataModel extends UnitModel {
|
|
|
9277
10180
|
__publicField(this, "type", I.UNIVER_SLIDE);
|
|
9278
10181
|
__publicField(this, "_activePage$", new BehaviorSubject(null));
|
|
9279
10182
|
__publicField(this, "activePage$", this._activePage$.asObservable());
|
|
10183
|
+
__publicField(this, "_name$");
|
|
10184
|
+
__publicField(this, "name$");
|
|
9280
10185
|
__publicField(this, "_snapshot");
|
|
9281
10186
|
__publicField(this, "_unitId");
|
|
9282
|
-
this._snapshot = { ...DEFAULT_SLIDE, ...snapshot }, this._unitId = (_a13 = this._snapshot.id) != null ? _a13 : Tools.generateRandomId(6);
|
|
10187
|
+
this._snapshot = { ...DEFAULT_SLIDE, ...snapshot }, this._unitId = (_a13 = this._snapshot.id) != null ? _a13 : Tools.generateRandomId(6), this._name$ = new BehaviorSubject(this._snapshot.title), this.name$ = this._name$.asObservable();
|
|
9283
10188
|
}
|
|
9284
10189
|
get _activePage() {
|
|
9285
10190
|
var _a13, _b2;
|
|
@@ -9290,6 +10195,10 @@ const _SlideDataModel = class _SlideDataModel extends UnitModel {
|
|
|
9290
10195
|
}
|
|
9291
10196
|
return activePage;
|
|
9292
10197
|
}
|
|
10198
|
+
setName(name) {
|
|
10199
|
+
var _a13;
|
|
10200
|
+
this._snapshot.title = name, this._name$.next(name), this._unitId = (_a13 = this._snapshot.id) != null ? _a13 : generateRandomId(6);
|
|
10201
|
+
}
|
|
9293
10202
|
getContainer() {
|
|
9294
10203
|
return this._snapshot.container;
|
|
9295
10204
|
}
|
|
@@ -9322,13 +10231,14 @@ const _SlideDataModel = class _SlideDataModel extends UnitModel {
|
|
|
9322
10231
|
getPageSize() {
|
|
9323
10232
|
return this._snapshot.pageSize;
|
|
9324
10233
|
}
|
|
9325
|
-
|
|
10234
|
+
getBlankPage() {
|
|
10235
|
+
const id = generateRandomId(6);
|
|
9326
10236
|
return {
|
|
9327
|
-
id
|
|
10237
|
+
id,
|
|
9328
10238
|
pageType: PageType.SLIDE,
|
|
9329
10239
|
zIndex: 10,
|
|
9330
|
-
title:
|
|
9331
|
-
description: "
|
|
10240
|
+
title: id,
|
|
10241
|
+
description: "",
|
|
9332
10242
|
pageBackgroundFill: {
|
|
9333
10243
|
rgb: "rgb(255,255,255)"
|
|
9334
10244
|
},
|
|
@@ -9344,10 +10254,17 @@ const _SlideDataModel = class _SlideDataModel extends UnitModel {
|
|
|
9344
10254
|
updatePage(pageId, page) {
|
|
9345
10255
|
this._snapshot.body && (this._snapshot.body.pages[pageId] = page);
|
|
9346
10256
|
}
|
|
10257
|
+
appendPage(page) {
|
|
10258
|
+
var _a13;
|
|
10259
|
+
if (!this._snapshot.body) return;
|
|
10260
|
+
this._snapshot.body.pages[page.id] = page;
|
|
10261
|
+
const activePage = this._activePage, index2 = this._snapshot.body.pageOrder.indexOf((_a13 = activePage == null ? void 0 : activePage.id) != null ? _a13 : "");
|
|
10262
|
+
this._snapshot.body.pageOrder.splice(index2 + 1, 0, page.id);
|
|
10263
|
+
}
|
|
9347
10264
|
};
|
|
9348
10265
|
__name(_SlideDataModel, "SlideDataModel");
|
|
9349
10266
|
let SlideDataModel = _SlideDataModel;
|
|
9350
|
-
const FOCUSING_SHEET = "FOCUSING_SHEET", FOCUSING_DOC = "FOCUSING_DOC", FOCUSING_SLIDE = "FOCUSING_SLIDE", FOCUSING_EDITOR_BUT_HIDDEN = "FOCUSING_EDITOR_BUT_HIDDEN", EDITOR_ACTIVATED = "EDITOR_ACTIVATED", FOCUSING_EDITOR_INPUT_FORMULA = "FOCUSING_EDITOR_INPUT_FORMULA",
|
|
10267
|
+
const FOCUSING_UNIT = "FOCUSING_UNIT", FOCUSING_SHEET = "FOCUSING_SHEET", FOCUSING_DOC = "FOCUSING_DOC", FOCUSING_SLIDE = "FOCUSING_SLIDE", FOCUSING_EDITOR_BUT_HIDDEN = "FOCUSING_EDITOR_BUT_HIDDEN", EDITOR_ACTIVATED = "EDITOR_ACTIVATED", FOCUSING_EDITOR_INPUT_FORMULA = "FOCUSING_EDITOR_INPUT_FORMULA", FOCUSING_FX_BAR_EDITOR = "FOCUSING_FX_BAR_EDITOR", FOCUSING_UNIVER_EDITOR = "FOCUSING_UNIVER_EDITOR", FOCUSING_EDITOR_STANDALONE = "FOCUSING_EDITOR_INPUT_FORMULA", FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE = "FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE", FOCUSING_COMMON_DRAWINGS = "FOCUSING_COMMON_DRAWINGS", FORMULA_EDITOR_ACTIVATED = "FORMULA_EDITOR_ACTIVATED";
|
|
9351
10268
|
var __defProp$6 = Object.defineProperty, __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor, __decorateClass$6 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
9352
10269
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9353
10270
|
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
@@ -9378,8 +10295,8 @@ let UniverInstanceService = (_a4 = class extends Disposable {
|
|
|
9378
10295
|
__setCreateHandler(handler) {
|
|
9379
10296
|
this._createHandler = handler;
|
|
9380
10297
|
}
|
|
9381
|
-
createUnit(type2, data) {
|
|
9382
|
-
return this._createHandler(type2, data, this._ctorByType.get(type2));
|
|
10298
|
+
createUnit(type2, data, options) {
|
|
10299
|
+
return this._createHandler(type2, data, this._ctorByType.get(type2), options);
|
|
9383
10300
|
}
|
|
9384
10301
|
registerCtorForType(type2, ctor) {
|
|
9385
10302
|
return this._ctorByType.set(type2, ctor), {
|
|
@@ -9402,9 +10319,6 @@ let UniverInstanceService = (_a4 = class extends Disposable {
|
|
|
9402
10319
|
if (!result) throw new Error(`[UniverInstanceService]: no document with unitId ${unitId}!`);
|
|
9403
10320
|
this._currentUnits.set(result[1], result[0]), this._currentUnits$.next(this._currentUnits);
|
|
9404
10321
|
}
|
|
9405
|
-
_removeCurrentUnitForType(type2) {
|
|
9406
|
-
this._currentUnits.set(type2, null), this._currentUnits$.next(this._currentUnits);
|
|
9407
|
-
}
|
|
9408
10322
|
getTypeOfUnitAdded$(type2) {
|
|
9409
10323
|
return this._unitAdded$.pipe(filter((unit) => unit.type === type2));
|
|
9410
10324
|
}
|
|
@@ -9415,9 +10329,14 @@ let UniverInstanceService = (_a4 = class extends Disposable {
|
|
|
9415
10329
|
*
|
|
9416
10330
|
* @param unit The unit to be added.
|
|
9417
10331
|
*/
|
|
9418
|
-
__addUnit(unit) {
|
|
10332
|
+
__addUnit(unit, options) {
|
|
10333
|
+
var _a13;
|
|
9419
10334
|
const type2 = unit.type;
|
|
9420
|
-
this._unitsByType.has(type2) || this._unitsByType.set(type2, [])
|
|
10335
|
+
this._unitsByType.has(type2) || this._unitsByType.set(type2, []);
|
|
10336
|
+
const units = this._unitsByType.get(type2), newUnitId = unit.getUnitId();
|
|
10337
|
+
if (units.findIndex((u) => u.getUnitId() === newUnitId) !== -1)
|
|
10338
|
+
throw new Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${newUnitId}.`);
|
|
10339
|
+
units.push(unit), this._unitAdded$.next(unit), ((_a13 = options == null ? void 0 : options.makeCurrent) == null || _a13) && this.setCurrentUnitForType(unit.getUnitId());
|
|
9421
10340
|
}
|
|
9422
10341
|
getTypeOfUnitDisposed$(type2) {
|
|
9423
10342
|
return this.unitDisposed$.pipe(filter((unit) => unit.type === type2));
|
|
@@ -9454,21 +10373,28 @@ let UniverInstanceService = (_a4 = class extends Disposable {
|
|
|
9454
10373
|
return id ? (_a13 = this._getUnitById(id)) == null ? void 0 : _a13[0] : null;
|
|
9455
10374
|
}
|
|
9456
10375
|
focusUnit(id) {
|
|
9457
|
-
this._focused$.next(id), this.focused instanceof Workbook ? (this._contextService.setContextValue(FOCUSING_DOC, !1), this._contextService.setContextValue(FOCUSING_SHEET, !0), this._contextService.setContextValue(FOCUSING_SLIDE, !1)) : this.focused instanceof DocumentDataModel ? (this._contextService.setContextValue(FOCUSING_DOC, !0), this._contextService.setContextValue(FOCUSING_SHEET, !1), this._contextService.setContextValue(FOCUSING_SLIDE, !1)) : this.focused instanceof SlideDataModel
|
|
10376
|
+
this._focused$.next(id), this.focused instanceof Workbook ? (this._contextService.setContextValue(FOCUSING_UNIT, !0), this._contextService.setContextValue(FOCUSING_DOC, !1), this._contextService.setContextValue(FOCUSING_SHEET, !0), this._contextService.setContextValue(FOCUSING_SLIDE, !1), this.setCurrentUnitForType(id)) : this.focused instanceof DocumentDataModel ? (this._contextService.setContextValue(FOCUSING_UNIT, !0), this._contextService.setContextValue(FOCUSING_DOC, !0), this._contextService.setContextValue(FOCUSING_SHEET, !1), this._contextService.setContextValue(FOCUSING_SLIDE, !1), this.setCurrentUnitForType(id)) : this.focused instanceof SlideDataModel ? (this._contextService.setContextValue(FOCUSING_UNIT, !0), this._contextService.setContextValue(FOCUSING_DOC, !1), this._contextService.setContextValue(FOCUSING_SHEET, !1), this._contextService.setContextValue(FOCUSING_SLIDE, !0), this.setCurrentUnitForType(id)) : (this._contextService.setContextValue(FOCUSING_UNIT, !1), this._contextService.setContextValue(FOCUSING_DOC, !1), this._contextService.setContextValue(FOCUSING_SHEET, !1), this._contextService.setContextValue(FOCUSING_SLIDE, !1));
|
|
9458
10377
|
}
|
|
9459
10378
|
getFocusedUnit() {
|
|
9460
10379
|
return this.focused;
|
|
9461
10380
|
}
|
|
9462
10381
|
getUnitType(unitId) {
|
|
9463
10382
|
const result = this._getUnitById(unitId);
|
|
9464
|
-
|
|
9465
|
-
return result[1];
|
|
10383
|
+
return result ? result[1] : I.UNRECOGNIZED;
|
|
9466
10384
|
}
|
|
9467
10385
|
disposeUnit(unitId) {
|
|
9468
10386
|
const result = this._getUnitById(unitId);
|
|
9469
10387
|
if (!result) return !1;
|
|
9470
10388
|
const [unit, type2] = result, units = this._unitsByType.get(type2), index2 = units.indexOf(unit);
|
|
9471
|
-
return units.splice(index2, 1), this.
|
|
10389
|
+
return units.splice(index2, 1), this._tryRemoveCurrentUnitForType(unitId, type2), this._tryBlurUnitOnRemoval(unitId), this._unitDisposed$.next(unit), !0;
|
|
10390
|
+
}
|
|
10391
|
+
_tryRemoveCurrentUnitForType(unitId, type2) {
|
|
10392
|
+
const current = this.getCurrentUnitForType(type2);
|
|
10393
|
+
(current == null ? void 0 : current.getUnitId()) === unitId && (this._currentUnits.set(type2, null), this._currentUnits$.next(this._currentUnits));
|
|
10394
|
+
}
|
|
10395
|
+
_tryBlurUnitOnRemoval(unitId) {
|
|
10396
|
+
var _a13;
|
|
10397
|
+
((_a13 = this.focused) == null ? void 0 : _a13.getUnitId()) === unitId && this._focused$.next(null);
|
|
9472
10398
|
}
|
|
9473
10399
|
_getUnitById(unitId) {
|
|
9474
10400
|
for (const [type2, units] of this._unitsByType) {
|
|
@@ -9738,8 +10664,8 @@ const _ResourceManagerService = class _ResourceManagerService extends Disposable
|
|
|
9738
10664
|
getAllResourceHooks() {
|
|
9739
10665
|
return [...this._resourceMap.values()];
|
|
9740
10666
|
}
|
|
9741
|
-
getResources(unitId) {
|
|
9742
|
-
return this.getAllResourceHooks().map((resourceHook) => {
|
|
10667
|
+
getResources(unitId, type2) {
|
|
10668
|
+
return type2 ? this.getResourcesByType(unitId, type2) : this.getAllResourceHooks().map((resourceHook) => {
|
|
9743
10669
|
const data = resourceHook.toJson(unitId);
|
|
9744
10670
|
return {
|
|
9745
10671
|
name: resourceHook.pluginName,
|
|
@@ -9789,7 +10715,16 @@ const _ResourceManagerService = class _ResourceManagerService extends Disposable
|
|
|
9789
10715
|
};
|
|
9790
10716
|
__name(_ResourceManagerService, "ResourceManagerService");
|
|
9791
10717
|
let ResourceManagerService = _ResourceManagerService;
|
|
9792
|
-
const IResourceManagerService = createIdentifier("resource-manager
|
|
10718
|
+
const IResourceManagerService = createIdentifier("core.resource-manager.service"), PREFIX = "__INTERNAL_EDITOR__", DOCS_NORMAL_EDITOR_UNIT_ID_KEY = `${PREFIX}DOCS_NORMAL`, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY = `${PREFIX}DOCS_FORMULA_BAR`, DOCS_ZEN_EDITOR_UNIT_ID_KEY = `${PREFIX}ZEN_EDITOR`, DEFAULT_EMPTY_DOCUMENT_VALUE = `\r
|
|
10719
|
+
`;
|
|
10720
|
+
function createInternalEditorID(id) {
|
|
10721
|
+
return `${PREFIX}${id}`;
|
|
10722
|
+
}
|
|
10723
|
+
__name(createInternalEditorID, "createInternalEditorID");
|
|
10724
|
+
function isInternalEditorID(id) {
|
|
10725
|
+
return id.startsWith(PREFIX);
|
|
10726
|
+
}
|
|
10727
|
+
__name(isInternalEditorID, "isInternalEditorID");
|
|
9793
10728
|
var __defProp$4 = Object.defineProperty, __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor, __decorateClass$4 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
9794
10729
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9795
10730
|
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
@@ -9799,7 +10734,7 @@ let ResourceLoaderService = (_a7 = class extends Disposable {
|
|
|
9799
10734
|
constructor(_resourceManagerService, _univerInstanceService) {
|
|
9800
10735
|
super();
|
|
9801
10736
|
__publicField(this, "saveWorkbook", /* @__PURE__ */ __name((workbook) => {
|
|
9802
|
-
const unitId = workbook.getUnitId(), resources = this._resourceManagerService.getResources(unitId)
|
|
10737
|
+
const unitId = workbook.getUnitId(), resources = this._resourceManagerService.getResources(unitId, I.UNIVER_SHEET), snapshot = workbook.getSnapshot();
|
|
9803
10738
|
return snapshot.resources = resources, snapshot;
|
|
9804
10739
|
}, "saveWorkbook"));
|
|
9805
10740
|
this._resourceManagerService = _resourceManagerService, this._univerInstanceService = _univerInstanceService, this._init();
|
|
@@ -9838,26 +10773,27 @@ let ResourceLoaderService = (_a7 = class extends Disposable {
|
|
|
9838
10773
|
}
|
|
9839
10774
|
});
|
|
9840
10775
|
}, "handleHookAdd");
|
|
9841
|
-
this._resourceManagerService.getAllResourceHooks().forEach((hook) =>
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
})), this.disposeWithMe(
|
|
9846
|
-
toDisposable(
|
|
9847
|
-
this._univerInstanceService.getTypeOfUnitAdded$(I.UNIVER_SHEET).subscribe((workbook) => {
|
|
9848
|
-
this._resourceManagerService.loadResources(workbook.getUnitId(), workbook.getSnapshot().resources);
|
|
9849
|
-
})
|
|
9850
|
-
)
|
|
10776
|
+
this._resourceManagerService.getAllResourceHooks().forEach((hook) => handleHookAdd(hook)), this.disposeWithMe(this._resourceManagerService.register$.subscribe((hook) => handleHookAdd(hook))), this.disposeWithMe(
|
|
10777
|
+
this._univerInstanceService.getTypeOfUnitAdded$(I.UNIVER_SHEET).subscribe((workbook) => {
|
|
10778
|
+
this._resourceManagerService.loadResources(workbook.getUnitId(), workbook.getSnapshot().resources);
|
|
10779
|
+
})
|
|
9851
10780
|
), this.disposeWithMe(
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
10781
|
+
this._univerInstanceService.getTypeOfUnitAdded$(I.UNIVER_DOC).subscribe((doc) => {
|
|
10782
|
+
const unitId = doc.getUnitId();
|
|
10783
|
+
isInternalEditorID(unitId) || this._resourceManagerService.loadResources(doc.getUnitId(), doc.getSnapshot().resources);
|
|
10784
|
+
})
|
|
10785
|
+
), this.disposeWithMe(
|
|
10786
|
+
this._univerInstanceService.getTypeOfUnitDisposed$(I.UNIVER_SHEET).subscribe((workbook) => {
|
|
10787
|
+
this._resourceManagerService.unloadResources(workbook.getUnitId());
|
|
10788
|
+
})
|
|
10789
|
+
), this.disposeWithMe(
|
|
10790
|
+
this._univerInstanceService.getTypeOfUnitDisposed$(I.UNIVER_DOC).subscribe((doc) => {
|
|
10791
|
+
this._resourceManagerService.unloadResources(doc.getUnitId());
|
|
10792
|
+
})
|
|
9857
10793
|
);
|
|
9858
10794
|
}
|
|
9859
10795
|
saveDoc(doc) {
|
|
9860
|
-
const unitId = doc.getUnitId(), resources = this._resourceManagerService.
|
|
10796
|
+
const unitId = doc.getUnitId(), resources = this._resourceManagerService.getResources(unitId, I.UNIVER_DOC), snapshot = doc.getSnapshot();
|
|
9861
10797
|
return snapshot.resources = resources, snapshot;
|
|
9862
10798
|
}
|
|
9863
10799
|
}, __name(_a7, "ResourceLoaderService"), _a7);
|
|
@@ -9886,16 +10822,6 @@ const _ThemeService = class _ThemeService extends Disposable {
|
|
|
9886
10822
|
};
|
|
9887
10823
|
__name(_ThemeService, "ThemeService");
|
|
9888
10824
|
let ThemeService = _ThemeService;
|
|
9889
|
-
const PREFIX = "__INTERNAL_EDITOR__", DOCS_NORMAL_EDITOR_UNIT_ID_KEY = `${PREFIX}DOCS_NORMAL`, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY = `${PREFIX}DOCS_FORMULA_BAR`, DOCS_ZEN_EDITOR_UNIT_ID_KEY = "__defaultDocumentZenEditorSpecialUnitId_20231218__", DEFAULT_EMPTY_DOCUMENT_VALUE = `\r
|
|
9890
|
-
`;
|
|
9891
|
-
function createInternalEditorID(id) {
|
|
9892
|
-
return `${PREFIX}${id}`;
|
|
9893
|
-
}
|
|
9894
|
-
__name(createInternalEditorID, "createInternalEditorID");
|
|
9895
|
-
function isInternalEditorID(id) {
|
|
9896
|
-
return id.startsWith(PREFIX);
|
|
9897
|
-
}
|
|
9898
|
-
__name(isInternalEditorID, "isInternalEditorID");
|
|
9899
10825
|
var __defProp$3 = Object.defineProperty, __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor, __decorateClass$3 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
9900
10826
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9901
10827
|
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
@@ -10038,7 +10964,7 @@ let LocalUndoRedoService = (_a8 = class extends Disposable {
|
|
|
10038
10964
|
_getFocusedUnitId() {
|
|
10039
10965
|
var _a13, _b2, _c, _d;
|
|
10040
10966
|
let unitID = "";
|
|
10041
|
-
const isFocusSheet = this._contextService.getContextValue(FOCUSING_SHEET), isFocusFormulaEditor = this._contextService.getContextValue(
|
|
10967
|
+
const isFocusSheet = this._contextService.getContextValue(FOCUSING_SHEET), isFocusFormulaEditor = this._contextService.getContextValue(FOCUSING_FX_BAR_EDITOR), isFocusEditor = this._contextService.getContextValue(EDITOR_ACTIVATED);
|
|
10042
10968
|
return isFocusSheet ? isFocusFormulaEditor ? unitID = DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY : isFocusEditor ? unitID = DOCS_NORMAL_EDITOR_UNIT_ID_KEY : unitID = (_b2 = (_a13 = this._univerInstanceService.getFocusedUnit()) == null ? void 0 : _a13.getUnitId()) != null ? _b2 : "" : unitID = (_d = (_c = this._univerInstanceService.getFocusedUnit()) == null ? void 0 : _c.getUnitId()) != null ? _d : "", unitID;
|
|
10043
10969
|
}
|
|
10044
10970
|
}, __name(_a8, "LocalUndoRedoService"), _a8);
|
|
@@ -10289,10 +11215,10 @@ function mergeOverrideWithDependencies(dependencies, override) {
|
|
|
10289
11215
|
}
|
|
10290
11216
|
__name(mergeOverrideWithDependencies, "mergeOverrideWithDependencies");
|
|
10291
11217
|
const nameMap = {
|
|
10292
|
-
[
|
|
10293
|
-
[
|
|
10294
|
-
[
|
|
10295
|
-
[
|
|
11218
|
+
[M.Editor]: "Editor",
|
|
11219
|
+
[M.Owner]: "Owner",
|
|
11220
|
+
[M.Reader]: "Reader",
|
|
11221
|
+
[M.UNRECOGNIZED]: "UNRECOGNIZED"
|
|
10296
11222
|
}, createDefaultUser = /* @__PURE__ */ __name((type2) => type2 ? {
|
|
10297
11223
|
userID: `${nameMap[type2]}_${Tools.generateRandomId(8)}`,
|
|
10298
11224
|
name: nameMap[type2],
|
|
@@ -10363,7 +11289,7 @@ let AuthzIoLocalService = (_a12 = class {
|
|
|
10363
11289
|
}
|
|
10364
11290
|
_initDefaultUser() {
|
|
10365
11291
|
const currentUser = this._userManagerService.getCurrentUser();
|
|
10366
|
-
currentUser && currentUser.userID || this._userManagerService.setCurrentUser(createDefaultUser(
|
|
11292
|
+
currentUser && currentUser.userID || this._userManagerService.setCurrentUser(createDefaultUser(M.Owner));
|
|
10367
11293
|
}
|
|
10368
11294
|
_getRole(type2) {
|
|
10369
11295
|
const user = this._userManagerService.getCurrentUser();
|
|
@@ -10393,12 +11319,12 @@ let AuthzIoLocalService = (_a12 = class {
|
|
|
10393
11319
|
async create(config) {
|
|
10394
11320
|
const id = Tools.generateRandomId(8);
|
|
10395
11321
|
switch (config.objectType) {
|
|
10396
|
-
case
|
|
11322
|
+
case l.SelectRange: {
|
|
10397
11323
|
const params = config.selectRangeObject;
|
|
10398
11324
|
this._permissionMap.set(id, { ...params, objectType: config.objectType });
|
|
10399
11325
|
break;
|
|
10400
11326
|
}
|
|
10401
|
-
case
|
|
11327
|
+
case l.Worksheet: {
|
|
10402
11328
|
const params = config.worksheetObject;
|
|
10403
11329
|
this._permissionMap.set(id, { ...params, objectType: config.objectType, readScope: L.SomeCollaborator });
|
|
10404
11330
|
}
|
|
@@ -10409,15 +11335,15 @@ let AuthzIoLocalService = (_a12 = class {
|
|
|
10409
11335
|
var _a13;
|
|
10410
11336
|
if (this._permissionMap.has(config.objectID)) {
|
|
10411
11337
|
const rule = this._permissionMap.get(config.objectID);
|
|
10412
|
-
if (rule && rule.objectType ===
|
|
11338
|
+
if (rule && rule.objectType === l.Worksheet)
|
|
10413
11339
|
return (_a13 = rule == null ? void 0 : rule.strategies) == null ? void 0 : _a13.map((s) => ({
|
|
10414
11340
|
action: s.action,
|
|
10415
|
-
allowed: s.role ===
|
|
11341
|
+
allowed: s.role === M.Editor
|
|
10416
11342
|
}));
|
|
10417
11343
|
}
|
|
10418
11344
|
return config.actions.map((a) => ({
|
|
10419
11345
|
action: a,
|
|
10420
|
-
allowed: this._getRole(
|
|
11346
|
+
allowed: this._getRole(M.Owner) || this._getRole(M.Editor)
|
|
10421
11347
|
}));
|
|
10422
11348
|
}
|
|
10423
11349
|
async batchAllowed(config) {
|
|
@@ -10429,7 +11355,7 @@ let AuthzIoLocalService = (_a12 = class {
|
|
|
10429
11355
|
allowed: !1
|
|
10430
11356
|
}))
|
|
10431
11357
|
}));
|
|
10432
|
-
return user && (isDevRole(user.userID,
|
|
11358
|
+
return user && (isDevRole(user.userID, M.Owner) || isDevRole(user.userID, M.Editor)) ? config.map((item) => ({
|
|
10433
11359
|
unitID: item.unitID,
|
|
10434
11360
|
objectID: item.objectID,
|
|
10435
11361
|
actions: item.actions.map((action) => ({
|
|
@@ -10449,12 +11375,12 @@ let AuthzIoLocalService = (_a12 = class {
|
|
|
10449
11375
|
objectType: rule.objectType,
|
|
10450
11376
|
name: rule.name,
|
|
10451
11377
|
shareOn: !1,
|
|
10452
|
-
shareRole:
|
|
11378
|
+
shareRole: M.Owner,
|
|
10453
11379
|
// TODO: @gggpound
|
|
10454
11380
|
shareScope: -1,
|
|
10455
|
-
creator: createDefaultUser(
|
|
11381
|
+
creator: createDefaultUser(M.Owner),
|
|
10456
11382
|
strategies: [],
|
|
10457
|
-
actions: config.actions.map((a) => ({ action: a, allowed: this._getRole(
|
|
11383
|
+
actions: config.actions.map((a) => ({ action: a, allowed: this._getRole(M.Owner) || this._getRole(M.Editor) }))
|
|
10458
11384
|
};
|
|
10459
11385
|
result.push(item);
|
|
10460
11386
|
}
|
|
@@ -10538,14 +11464,14 @@ const IAuthzIoService = createIdentifier("IAuthzIoIoService"), _Univer = class _
|
|
|
10538
11464
|
this._univerInstanceService.registerCtorForType(I.UNIVER_SHEET, Workbook), this._univerInstanceService.registerCtorForType(I.UNIVER_DOC, DocumentDataModel), this._univerInstanceService.registerCtorForType(I.UNIVER_SLIDE, SlideDataModel);
|
|
10539
11465
|
const univerInstanceService = injector.get(IUniverInstanceService);
|
|
10540
11466
|
univerInstanceService.__setCreateHandler(
|
|
10541
|
-
(type2, data, ctor) => {
|
|
11467
|
+
(type2, data, ctor, options) => {
|
|
10542
11468
|
if (!this._startedTypes.has(type2)) {
|
|
10543
11469
|
this._pluginService.startPluginForType(type2), this._startedTypes.add(type2);
|
|
10544
11470
|
const model2 = injector.createInstance(ctor, data);
|
|
10545
|
-
return univerInstanceService.__addUnit(model2), this._tryProgressToReady(), model2;
|
|
11471
|
+
return univerInstanceService.__addUnit(model2, options), this._tryProgressToReady(), model2;
|
|
10546
11472
|
}
|
|
10547
11473
|
const model = injector.createInstance(ctor, data);
|
|
10548
|
-
return univerInstanceService.__addUnit(model), model;
|
|
11474
|
+
return univerInstanceService.__addUnit(model, options), model;
|
|
10549
11475
|
}
|
|
10550
11476
|
);
|
|
10551
11477
|
}
|
|
@@ -10955,6 +11881,27 @@ function serializeCellDataSlice(slice) {
|
|
|
10955
11881
|
return textEncoder.encode(JSON.stringify(data));
|
|
10956
11882
|
}
|
|
10957
11883
|
__name(serializeCellDataSlice, "serializeCellDataSlice");
|
|
11884
|
+
async function generateTempDocumentSnapshot(_context, document2, unitID, rev) {
|
|
11885
|
+
var _a13;
|
|
11886
|
+
const documentMeta = {
|
|
11887
|
+
unitID: document2.id,
|
|
11888
|
+
rev,
|
|
11889
|
+
creator: "",
|
|
11890
|
+
name: (_a13 = document2.title) != null ? _a13 : "",
|
|
11891
|
+
resources: document2.resources || [],
|
|
11892
|
+
originalMeta: encodeDocOriginalMeta(document2)
|
|
11893
|
+
};
|
|
11894
|
+
return {
|
|
11895
|
+
snapshot: {
|
|
11896
|
+
unitID,
|
|
11897
|
+
rev: documentMeta.rev,
|
|
11898
|
+
type: I.UNIVER_DOC,
|
|
11899
|
+
workbook: void 0,
|
|
11900
|
+
doc: documentMeta
|
|
11901
|
+
}
|
|
11902
|
+
};
|
|
11903
|
+
}
|
|
11904
|
+
__name(generateTempDocumentSnapshot, "generateTempDocumentSnapshot");
|
|
10958
11905
|
async function generateTemporarySnap(context, workbook, unitID, rev, snapshotService) {
|
|
10959
11906
|
const blockMeta = {}, sheetMetas = {};
|
|
10960
11907
|
if (!await Promise.all(
|
|
@@ -11073,7 +12020,7 @@ async function transformWorkbookDataToSnapshot(context, workbook, unitID, rev, s
|
|
|
11073
12020
|
type: I.UNIVER_SHEET,
|
|
11074
12021
|
snapshot
|
|
11075
12022
|
});
|
|
11076
|
-
if (
|
|
12023
|
+
if (H(saveResult.error))
|
|
11077
12024
|
throw new Error(
|
|
11078
12025
|
`transformWorkbookDataToSnapshot(): Failed to save snapshot.
|
|
11079
12026
|
ErrorCode: ${(_a13 = saveResult.error) == null ? void 0 : _a13.code}:${(_b2 = saveResult.error) == null ? void 0 : _b2.message}`
|
|
@@ -11141,7 +12088,17 @@ function transformSnapshotToDocumentData(snapshot) {
|
|
|
11141
12088
|
const documentMeta = snapshot.doc;
|
|
11142
12089
|
if (documentMeta == null)
|
|
11143
12090
|
throw new Error("transformSnapshotToDocumentData(): snapshot.doc is undefined.");
|
|
11144
|
-
const { unitID, rev, name, originalMeta, resources = [] } = documentMeta, {
|
|
12091
|
+
const { unitID, rev, name, originalMeta, resources = [] } = documentMeta, {
|
|
12092
|
+
body,
|
|
12093
|
+
documentStyle = {},
|
|
12094
|
+
settings = {},
|
|
12095
|
+
drawings = {},
|
|
12096
|
+
drawingsOrder = [],
|
|
12097
|
+
tableSource = {},
|
|
12098
|
+
headers = {},
|
|
12099
|
+
footers = {},
|
|
12100
|
+
lists = {}
|
|
12101
|
+
} = decodeDocOriginalMeta(originalMeta);
|
|
11145
12102
|
return {
|
|
11146
12103
|
id: unitID,
|
|
11147
12104
|
rev,
|
|
@@ -11152,7 +12109,11 @@ function transformSnapshotToDocumentData(snapshot) {
|
|
|
11152
12109
|
settings,
|
|
11153
12110
|
drawings,
|
|
11154
12111
|
drawingsOrder,
|
|
11155
|
-
resources
|
|
12112
|
+
resources,
|
|
12113
|
+
tableSource,
|
|
12114
|
+
headers,
|
|
12115
|
+
footers,
|
|
12116
|
+
lists
|
|
11156
12117
|
};
|
|
11157
12118
|
}
|
|
11158
12119
|
__name(transformSnapshotToDocumentData, "transformSnapshotToDocumentData");
|
|
@@ -11176,7 +12137,7 @@ async function transformDocumentDataToSnapshot(context, document2, unitID, rev,
|
|
|
11176
12137
|
type: I.UNIVER_DOC,
|
|
11177
12138
|
snapshot
|
|
11178
12139
|
});
|
|
11179
|
-
if (
|
|
12140
|
+
if (H(saveResult.error))
|
|
11180
12141
|
throw new Error(
|
|
11181
12142
|
`transformDocumentDataToSnapshot(): Failed to save snapshot.
|
|
11182
12143
|
ErrorCode: ${(_b2 = saveResult.error) == null ? void 0 : _b2.code}:${(_c = saveResult.error) == null ? void 0 : _c.message}`
|
|
@@ -11191,7 +12152,7 @@ async function getSheetBlocksFromSnapshot(snapshot, snapshotService) {
|
|
|
11191
12152
|
if (!workbookMeta)
|
|
11192
12153
|
throw new Error("Workbook metadata is not available");
|
|
11193
12154
|
const blocks = [], promises = [];
|
|
11194
|
-
return Object.entries(workbookMeta.blockMeta).forEach(([
|
|
12155
|
+
return Object.entries(workbookMeta.blockMeta).forEach(([_, blocksOfSheet]) => {
|
|
11195
12156
|
const blockPromises = blocksOfSheet.blocks.map(async (blockID) => {
|
|
11196
12157
|
const params = {
|
|
11197
12158
|
unitID: workbookMeta.unitID,
|
|
@@ -11243,9 +12204,9 @@ export {
|
|
|
11243
12204
|
CommandType,
|
|
11244
12205
|
CommonHideTypes,
|
|
11245
12206
|
ConfigService,
|
|
11246
|
-
ContentAlignment,
|
|
11247
12207
|
ContextService,
|
|
11248
12208
|
CopyPasteType,
|
|
12209
|
+
CustomCommandExecutionError,
|
|
11249
12210
|
CustomDecorationType,
|
|
11250
12211
|
CustomRangeType,
|
|
11251
12212
|
DEFAULT_CELL,
|
|
@@ -11304,11 +12265,13 @@ export {
|
|
|
11304
12265
|
FOCUSING_EDITOR_BUT_HIDDEN,
|
|
11305
12266
|
FOCUSING_EDITOR_INPUT_FORMULA,
|
|
11306
12267
|
FOCUSING_EDITOR_STANDALONE,
|
|
11307
|
-
|
|
12268
|
+
FOCUSING_FX_BAR_EDITOR,
|
|
11308
12269
|
FOCUSING_SHEET,
|
|
11309
12270
|
FOCUSING_SLIDE,
|
|
12271
|
+
FOCUSING_UNIT,
|
|
11310
12272
|
FOCUSING_UNIVER_EDITOR,
|
|
11311
12273
|
FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE,
|
|
12274
|
+
FORMULA_EDITOR_ACTIVATED,
|
|
11312
12275
|
FollowNumberWithType,
|
|
11313
12276
|
FontItalic,
|
|
11314
12277
|
FontStyleType,
|
|
@@ -11372,6 +12335,8 @@ export {
|
|
|
11372
12335
|
PresetListType,
|
|
11373
12336
|
ProtectionType,
|
|
11374
12337
|
Quantity,
|
|
12338
|
+
QuickListType,
|
|
12339
|
+
QuickListTypeMap,
|
|
11375
12340
|
RANGE_TYPE,
|
|
11376
12341
|
RCDisposable,
|
|
11377
12342
|
RGBA_PAREN,
|
|
@@ -11405,6 +12370,11 @@ export {
|
|
|
11405
12370
|
Styles,
|
|
11406
12371
|
THEME_COLORS,
|
|
11407
12372
|
TabStopAlignment,
|
|
12373
|
+
TableAlignmentType,
|
|
12374
|
+
TableCellHeightRule,
|
|
12375
|
+
TableLayoutType,
|
|
12376
|
+
TableSizeType,
|
|
12377
|
+
TableTextWrapType,
|
|
11408
12378
|
TextDecoration,
|
|
11409
12379
|
TextDirection,
|
|
11410
12380
|
TextDirectionType,
|
|
@@ -11425,7 +12395,7 @@ export {
|
|
|
11425
12395
|
UserManagerService,
|
|
11426
12396
|
ValueIterator,
|
|
11427
12397
|
VerticalAlign,
|
|
11428
|
-
|
|
12398
|
+
VerticalAlignmentType,
|
|
11429
12399
|
WithDependency,
|
|
11430
12400
|
WithNew,
|
|
11431
12401
|
Workbook,
|
|
@@ -11466,6 +12436,7 @@ export {
|
|
|
11466
12436
|
fromEventSubject,
|
|
11467
12437
|
fromObservable,
|
|
11468
12438
|
generateRandomId,
|
|
12439
|
+
generateTempDocumentSnapshot,
|
|
11469
12440
|
generateTemporarySnap,
|
|
11470
12441
|
getArrayLength,
|
|
11471
12442
|
getBodySlice,
|
|
@@ -11514,6 +12485,7 @@ export {
|
|
|
11514
12485
|
makeArray,
|
|
11515
12486
|
makeCellRangeToRangeData,
|
|
11516
12487
|
makeCellToSelection,
|
|
12488
|
+
makeCustomRangeStream,
|
|
11517
12489
|
mergeOverrideWithDependencies,
|
|
11518
12490
|
mergeSets,
|
|
11519
12491
|
mergeWorksheetSnapshotWithDefault,
|