@univerjs/core 0.4.0-alpha.0 → 0.4.0-alpha.1

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/es/index.js CHANGED
@@ -4,7 +4,6 @@ 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 { BehaviorSubject, Subject, Observable, filter, merge as merge$1, 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, generateRandomId as generateRandomId$1, DataStreamTreeTokenType as DataStreamTreeTokenType$1 } from "@univerjs/core";
8
7
  import * as React from "react";
9
8
  import React__default, { useState, useEffect, useRef, useMemo, createContext, useCallback, useContext } from "react";
10
9
  function _mergeNamespaces(n, m) {
@@ -9785,7 +9784,7 @@ __name(textXApply, "textXApply");
9785
9784
  function transformTextRuns(originTextRuns, targetTextRuns, transformType) {
9786
9785
  if (originTextRuns.length === 0)
9787
9786
  return targetTextRuns;
9788
- targetTextRuns = Tools$1.deepClone(targetTextRuns), originTextRuns = Tools$1.deepClone(originTextRuns);
9787
+ targetTextRuns = Tools.deepClone(targetTextRuns), originTextRuns = Tools.deepClone(originTextRuns);
9789
9788
  const newUpdateTextRuns = [], updateLength = targetTextRuns.length, removeLength = originTextRuns.length;
9790
9789
  let updateIndex = 0, removeIndex = 0, pending = null;
9791
9790
  function pushPendingAndReturnStatus() {
@@ -9829,7 +9828,7 @@ function transformTextRuns(originTextRuns, targetTextRuns, transformType) {
9829
9828
  }
9830
9829
  pushPendingAndReturnStatus();
9831
9830
  const tempTopTextRun = newUpdateTextRuns[newUpdateTextRuns.length - 1], updateLastTextRun = targetTextRuns[updateLength - 1], removeLastTextRun = originTextRuns[removeLength - 1];
9832
- return tempTopTextRun.ed !== Math.max(updateLastTextRun.ed, removeLastTextRun.ed) && (updateLastTextRun.ed > removeLastTextRun.ed ? newUpdateTextRuns.push(updateLastTextRun) : newUpdateTextRuns.push(removeLastTextRun)), normalizeTextRuns$1(newUpdateTextRuns);
9831
+ return tempTopTextRun.ed !== Math.max(updateLastTextRun.ed, removeLastTextRun.ed) && (updateLastTextRun.ed > removeLastTextRun.ed ? newUpdateTextRuns.push(updateLastTextRun) : newUpdateTextRuns.push(removeLastTextRun)), normalizeTextRuns(newUpdateTextRuns);
9833
9832
  }
9834
9833
  __name(transformTextRuns, "transformTextRuns");
9835
9834
  function transformParagraph(originParagraph, targetParagraph, transformType) {
@@ -9892,7 +9891,7 @@ function transformBody(thisAction, otherAction, priority = !1) {
9892
9891
  0
9893
9892
  /* COVER */
9894
9893
  ), paragraphs.push(paragraph), thisIndex++, otherIndex++;
9895
- } else thisStart < otherStart ? thisIndex++ : (paragraphs.push(Tools$1.deepClone(otherParagraph)), otherIndex++);
9894
+ } else thisStart < otherStart ? thisIndex++ : (paragraphs.push(Tools.deepClone(otherParagraph)), otherIndex++);
9896
9895
  }
9897
9896
  return otherIndex < otherParagraphs.length && paragraphs.push(...otherParagraphs.slice(otherIndex)), paragraphs.length && (retBody.paragraphs = paragraphs), retBody;
9898
9897
  }
@@ -10364,7 +10363,7 @@ const _DocumentDataModel = class _DocumentDataModel extends DocumentDataModelSim
10364
10363
  __name(_DocumentDataModel, "DocumentDataModel");
10365
10364
  let DocumentDataModel = _DocumentDataModel;
10366
10365
  function isCustomRangeSplitSymbol(text) {
10367
- return text === DataStreamTreeTokenType$1.CUSTOM_RANGE_END || text === DataStreamTreeTokenType$1.CUSTOM_RANGE_START;
10366
+ return text === DataStreamTreeTokenType.CUSTOM_RANGE_END || text === DataStreamTreeTokenType.CUSTOM_RANGE_START;
10368
10367
  }
10369
10368
  __name(isCustomRangeSplitSymbol, "isCustomRangeSplitSymbol");
10370
10369
  function isIntersecting(line1Start, line1End, line2Start, line2End) {
@@ -10397,8 +10396,8 @@ function getCustomRangesInterestsWithRange(range, customRanges) {
10397
10396
  __name(getCustomRangesInterestsWithRange, "getCustomRangesInterestsWithRange");
10398
10397
  function copyCustomRange(range) {
10399
10398
  return {
10400
- ...Tools$1.deepClone(range),
10401
- rangeId: generateRandomId$1()
10399
+ ...Tools.deepClone(range),
10400
+ rangeId: generateRandomId()
10402
10401
  };
10403
10402
  }
10404
10403
  __name(copyCustomRange, "copyCustomRange");
@@ -11168,7 +11167,7 @@ const FOCUSING_UNIT = "FOCUSING_UNIT", FOCUSING_SHEET = "FOCUSING_SHEET", FOCUSI
11168
11167
  };
11169
11168
  __name(_ErrorService, "ErrorService");
11170
11169
  let ErrorService = _ErrorService;
11171
- const version = "0.4.0-alpha.0";
11170
+ const version = "0.4.0-alpha.1";
11172
11171
  function getEmptySnapshot(unitID = "", locale = LocaleType.ZH_CN, name = "") {
11173
11172
  return {
11174
11173
  id: unitID,
@@ -1,4 +1,6 @@
1
- import { DataStreamTreeTokenType, ICustomRange, ITextRange } from '@univerjs/core';
1
+ import { ITextRange } from '../../../../sheets/typedef';
2
+ import { ICustomRange } from '../../../../types/interfaces';
3
+ import { DataStreamTreeTokenType } from '../../types';
2
4
  export declare function isCustomRangeSplitSymbol(text: string): text is DataStreamTreeTokenType.CUSTOM_RANGE_START | DataStreamTreeTokenType.CUSTOM_RANGE_END;
3
5
  export declare function isIntersecting(line1Start: number, line1End: number, line2Start: number, line2End: number): boolean;
4
6
  export declare function shouldDeleteCustomRange(deleteStart: number, deleteLen: number, customRange: ICustomRange, dataStream: string): boolean;
@@ -7,7 +9,7 @@ export declare function copyCustomRange(range: ICustomRange): {
7
9
  rangeId: string;
8
10
  startIndex: number;
9
11
  endIndex: number;
10
- rangeType: import('@univerjs/core').CustomRangeType | number;
12
+ rangeType: import('../../../..').CustomRangeType | number;
11
13
  wholeEntity?: boolean;
12
14
  properties?: Record<string, any> | undefined;
13
15
  };
@@ -1,2 +1,3 @@
1
- import { IDocumentBody, IRetainAction } from '@univerjs/core';
1
+ import { IDocumentBody } from '../../../types/interfaces';
2
+ import { IRetainAction } from './action-types';
2
3
  export declare function transformBody(thisAction: IRetainAction, otherAction: IRetainAction, priority?: boolean): IDocumentBody;
@@ -1,5 +1,6 @@
1
- import { ICommandService, Univer } from '@univerjs/core';
2
1
  import { Dependency } from '../../common/di';
2
+ import { Univer } from '../../univer';
3
+ import { ICommandService } from '../command/command.service';
3
4
  export declare const createTestBed: (dependencies?: Dependency[]) => {
4
5
  univer: Univer;
5
6
  get: {
@@ -10,7 +11,7 @@ export declare const createTestBed: (dependencies?: Dependency[]) => {
10
11
  <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
11
12
  <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
12
13
  };
13
- workbook: import('@univerjs/core').Workbook;
14
+ workbook: import('../..').UnitModel<object, number>;
14
15
  unitId: string;
15
16
  subUnitId: string;
16
17
  commandService: ICommandService;
@@ -1,6 +1,6 @@
1
- import { UniverInstanceType } from '@univerjs/core';
2
1
  import { Observable } from 'rxjs';
3
2
  import { IDisposable } from '../../common/di';
3
+ import { UniverInstanceType } from '../../common/unit';
4
4
  export type IResources = Array<{
5
5
  id?: string;
6
6
  name: string;