mirror of
https://github.com/dream-num/univer.git
synced 2026-10-02 04:24:34 +08:00
chore: update dependencies (#7678)
This commit is contained in:
@@ -9,15 +9,11 @@ inputs:
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v6
|
||||
- name: Setup pnpm and Node.js
|
||||
uses: pnpm/setup@v2
|
||||
with:
|
||||
run_install: false
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24.3.0
|
||||
runtime: node@24.3.0
|
||||
install: false
|
||||
|
||||
- name: Get pnpm store path
|
||||
id: pnpm-store
|
||||
|
||||
@@ -34,15 +34,15 @@ jobs:
|
||||
ref: ${{ github.ref_name }}
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v6
|
||||
- name: Install pnpm and Node.js
|
||||
uses: pnpm/setup@v2
|
||||
with:
|
||||
run_install: false
|
||||
runtime: node@24.3.0
|
||||
install: false
|
||||
|
||||
- name: Install Node.js
|
||||
- name: Configure npm registry
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24.3.0
|
||||
registry-url: https://registry.npmjs.org
|
||||
package-manager-cache: false
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
|
||||
@@ -44,11 +44,11 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
"typescript": "^6.0.3",
|
||||
"vue": "^3.5.40"
|
||||
"vue": "^3.5.42"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,22 +31,22 @@
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tsdown/css": "^0.22.14",
|
||||
"@tsdown/css": "^0.23.0",
|
||||
"@typescript-eslint/parser": "^8.65.0",
|
||||
"@vitest/coverage-istanbul": "^5.0.0",
|
||||
"autoprefixer": "^10.5.4",
|
||||
"autoprefixer": "^10.6.0",
|
||||
"eslint-plugin-better-tailwindcss": "^4.7.0",
|
||||
"eslint-plugin-header": "^3.1.1",
|
||||
"eslint-plugin-no-barrel-import": "^0.0.2",
|
||||
"eslint-plugin-no-penetrating-import": "^0.0.1",
|
||||
"happy-dom": "20.11.6",
|
||||
"javascript-obfuscator": "^5.5.0",
|
||||
"postcss-preset-env": "^11.4.0",
|
||||
"happy-dom": "20.14.5",
|
||||
"javascript-obfuscator": "^5.7.0",
|
||||
"postcss-preset-env": "^11.5.3",
|
||||
"postcss-replace": "^2.0.1",
|
||||
"sort-keys": "^6.0.1",
|
||||
"tailwind-scrollbar": "^3",
|
||||
"tailwindcss": "3.4.18",
|
||||
"tsdown": "^0.22.14",
|
||||
"tsdown": "^0.23.0",
|
||||
"unplugin-vue": "^7.2.0",
|
||||
"vitest": "^5.0.0"
|
||||
},
|
||||
|
||||
@@ -32,7 +32,7 @@ export const peerDepsMap = {
|
||||
'@wendellhu/redi': {
|
||||
global: '@wendellhu/redi',
|
||||
name: '@wendellhu/redi',
|
||||
version: '1.1.2',
|
||||
version: '1.1.3',
|
||||
},
|
||||
'@wendellhu/redi/react-bindings': {
|
||||
global: '@wendellhu/redi/react-bindings',
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"tailwindcss": "3.4.18",
|
||||
"tailwindcss-animate": "^1.0.7"
|
||||
}
|
||||
|
||||
@@ -40,18 +40,18 @@
|
||||
"@univerjs/slides-ui": "workspace:*",
|
||||
"@univerjs/themes": "workspace:*",
|
||||
"@univerjs/ui": "workspace:*",
|
||||
"react": "19.2.8",
|
||||
"react-dom": "19.2.8",
|
||||
"react": "19.3.0",
|
||||
"react-dom": "19.3.0",
|
||||
"rxjs": "^7.8.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"tailwindcss": "3.4.18",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"tsx": "^4.22.4",
|
||||
"tsx": "^4.23.13",
|
||||
"typescript": "^6.0.3",
|
||||
"vite": "^8.0.11",
|
||||
"vite": "^8.3.0",
|
||||
"vitest": "^5.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -3,7 +3,7 @@
|
||||
"type": "module",
|
||||
"version": "1.0.0-rc.0",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@11.22.0",
|
||||
"packageManager": "pnpm@12.4.1",
|
||||
"author": "DreamNum Co., Ltd. <developer@univer.ai>",
|
||||
"license": "Apache-2.0",
|
||||
"funding": {
|
||||
@@ -51,8 +51,8 @@
|
||||
"@eslint-react/eslint-plugin": "^5.18.1",
|
||||
"@eslint/compat": "^2.1.0",
|
||||
"@types/node": "^26.1.2",
|
||||
"@types/react": "19.2.18",
|
||||
"@types/react-dom": "19.2.4",
|
||||
"@types/react": "19.3.0",
|
||||
"@types/react-dom": "19.3.0",
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"@univerjs/design": "workspace:*",
|
||||
"eslint": "^10.8.0",
|
||||
@@ -61,12 +61,12 @@
|
||||
"eslint-plugin-react-hooks": "^7.1.1",
|
||||
"eslint-plugin-react-refresh": "^0.5.3",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^17.3.0",
|
||||
"react": "19.2.8",
|
||||
"react-dom": "19.2.8",
|
||||
"lint-staged": "^17.5.1",
|
||||
"react": "19.3.0",
|
||||
"react-dom": "19.3.0",
|
||||
"serve": "^14.2.6",
|
||||
"tailwindcss": "3.4.18",
|
||||
"turbo": "^2.10.8",
|
||||
"turbo": "^2.10.12",
|
||||
"typescript": "^6.0.3",
|
||||
"vitest": "^5.0.0"
|
||||
},
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
"dependencies": {
|
||||
"@univerjs/protocol": "workspace:*",
|
||||
"@univerjs/themes": "workspace:*",
|
||||
"@wendellhu/redi": "1.1.2",
|
||||
"@wendellhu/redi": "1.1.3",
|
||||
"async-lock": "^1.4.1",
|
||||
"fast-diff": "1.3.0",
|
||||
"kdbush": "^4.1.0",
|
||||
|
||||
@@ -85,13 +85,13 @@
|
||||
"@univerjs/icons": "1.38.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"cmdk": "1.1.1",
|
||||
"sonner": "^2.0.7"
|
||||
"sonner": "^2.0.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/jest-dom": "6.9.1",
|
||||
"@testing-library/react": "^16.3.2",
|
||||
"@testing-library/jest-dom": "7.0.1",
|
||||
"@testing-library/react": "^16.3.3",
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1",
|
||||
"tailwind-merge": "2.6.0",
|
||||
|
||||
@@ -86,10 +86,10 @@
|
||||
"@univerjs/ui": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/react": "^16.3.2",
|
||||
"@testing-library/react": "^16.3.3",
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"@univerjs/protocol": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"jest-canvas-mock": "^2.5.2",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
"@univerjs/docs-drawing": "workspace:*",
|
||||
"jest-canvas-mock": "^2.5.2",
|
||||
"jsdom": "^29.1.1",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -67,8 +67,7 @@
|
||||
"rxjs": ">=7.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@univerjs/core": "workspace:*",
|
||||
"ot-json1": "^1.0.2"
|
||||
"@univerjs/core": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
import type { IDrawingParam, IDrawingSearch } from '@univerjs/core';
|
||||
import { BooleanNumber, DrawingTypeEnum, Injector, JSON1 } from '@univerjs/core';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { UnitDrawingService } from '../drawing-manager-impl.service';
|
||||
|
||||
import { DrawingManagerService, UnitDrawingService } from '../drawing-manager-impl.service';
|
||||
|
||||
const unitId = 'unit';
|
||||
const subUnitId = 'subUnit';
|
||||
@@ -536,3 +537,27 @@ describe('UnitDrawingService', () => {
|
||||
expect(service.drawingManagerData).toEqual({});
|
||||
});
|
||||
});
|
||||
|
||||
describe('DrawingManagerService', () => {
|
||||
it('uses the shared drawing manager behavior to register and remove drawings by unit', () => {
|
||||
const injector = new Injector();
|
||||
injector.add([DrawingManagerService]);
|
||||
const service = injector.get(DrawingManagerService);
|
||||
const removed: unknown[] = [];
|
||||
service.remove$.subscribe((value) => removed.push(value));
|
||||
|
||||
service.registerDrawingData('unit-1', {
|
||||
'sheet-1': {
|
||||
data: {
|
||||
image1: { unitId: 'unit-1', subUnitId: 'sheet-1', drawingId: 'image1', drawingType: DrawingTypeEnum.DRAWING_IMAGE },
|
||||
},
|
||||
order: ['image1'],
|
||||
},
|
||||
});
|
||||
expect(service.getDrawingData('unit-1', 'sheet-1')).toHaveProperty('image1');
|
||||
|
||||
service.removeDrawingDataForUnit('unit-1');
|
||||
expect(service.getDrawingDataForUnit('unit-1')).toEqual({});
|
||||
expect(removed).toEqual([[{ unitId: 'unit-1', subUnitId: 'sheet-1', drawingId: 'image1' }]]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
/**
|
||||
* Copyright 2023-present DreamNum Co., Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DrawingTypeEnum, Injector } from '@univerjs/core';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { DrawingManagerService } from '../drawing-manager-impl.service';
|
||||
|
||||
function createService(): DrawingManagerService {
|
||||
const injector = new Injector();
|
||||
injector.add([DrawingManagerService]);
|
||||
return injector.get(DrawingManagerService);
|
||||
}
|
||||
|
||||
describe('DrawingManagerService', () => {
|
||||
it('uses the shared drawing manager behavior to register and remove drawings by unit', () => {
|
||||
const service = createService();
|
||||
const removed: unknown[] = [];
|
||||
service.remove$.subscribe((value) => removed.push(value));
|
||||
|
||||
service.registerDrawingData('unit-1', {
|
||||
'sheet-1': {
|
||||
data: {
|
||||
image1: { unitId: 'unit-1', subUnitId: 'sheet-1', drawingId: 'image1', drawingType: DrawingTypeEnum.DRAWING_IMAGE },
|
||||
},
|
||||
order: ['image1'],
|
||||
},
|
||||
});
|
||||
expect(service.getDrawingData('unit-1', 'sheet-1')).toHaveProperty('image1');
|
||||
|
||||
service.removeDrawingDataForUnit('unit-1');
|
||||
expect(service.getDrawingDataForUnit('unit-1')).toEqual({});
|
||||
expect(removed).toEqual([[{ unitId: 'unit-1', subUnitId: 'sheet-1', drawingId: 'image1' }]]);
|
||||
});
|
||||
});
|
||||
@@ -32,12 +32,11 @@ import type {
|
||||
IDrawingVisibleParam,
|
||||
IUnitDrawingService,
|
||||
} from './drawing-manager.service';
|
||||
import { DrawingTypeEnum, normalizeDrawingOrderIndex, sortRules, sortRulesByDesc } from '@univerjs/core';
|
||||
import * as json1 from 'ot-json1';
|
||||
import { DrawingTypeEnum, JSON1, normalizeDrawingOrderIndex, sortRules, sortRulesByDesc } from '@univerjs/core';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
type JSONOp = json1.JSONOp;
|
||||
type JSONOpList = json1.JSONOpList;
|
||||
type JSONOp = JSON1.JSONOp;
|
||||
type JSONOpList = JSON1.JSONOpList;
|
||||
|
||||
export interface IDrawingJsonUndo1<
|
||||
TObjects = IDrawingSearch[] | IDrawingOrderMapParam | IDrawingGroupUpdateParam | IDrawingGroupUpdateParam[]
|
||||
@@ -99,11 +98,11 @@ function hasOnlyEnumerableOwnProperties(value: Record<string, unknown>): boolean
|
||||
return Object.getOwnPropertyNames(value).every((key) => Object.prototype.propertyIsEnumerable.call(value, key));
|
||||
}
|
||||
|
||||
function createJsonRemoveOp(path: Array<number | string>, value: json1.Doc): JSONOp {
|
||||
return json1.type.writeCursor().writeAtPath(path, 'r', value).get();
|
||||
function createJsonRemoveOp(path: Array<number | string>, value: JSON1.Doc): JSONOp {
|
||||
return JSON1.type.writeCursor().writeAtPath(path, 'r', value).get();
|
||||
}
|
||||
|
||||
function normalizeJsonDocument(value: unknown): json1.Doc | undefined {
|
||||
function normalizeJsonDocument(value: unknown): JSON1.Doc | undefined {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -120,7 +119,7 @@ function normalizeJsonDocument(value: unknown): json1.Doc | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const normalizedValue: Record<string, json1.Doc> = {};
|
||||
const normalizedValue: Record<string, JSON1.Doc> = {};
|
||||
Object.entries(value).forEach(([key, item]) => {
|
||||
const normalizedItem = normalizeJsonDocument(item);
|
||||
if (normalizedItem !== undefined) {
|
||||
@@ -164,10 +163,10 @@ function appendJsonUpdateOps(
|
||||
}
|
||||
|
||||
const op = !hasNormalizedOldValue
|
||||
? normalizedNewValue === undefined ? null : json1.insertOp(path, normalizedNewValue)
|
||||
? normalizedNewValue === undefined ? null : JSON1.insertOp(path, normalizedNewValue)
|
||||
: normalizedNewValue === undefined
|
||||
? createJsonRemoveOp(path, normalizedOldValue)
|
||||
: json1.replaceOp(path, normalizedOldValue, normalizedNewValue);
|
||||
: JSON1.replaceOp(path, normalizedOldValue, normalizedNewValue);
|
||||
if (op && isNonEmptyOp(op)) {
|
||||
ops.push(op);
|
||||
}
|
||||
@@ -376,8 +375,8 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
invertOps.push(invertOp);
|
||||
});
|
||||
|
||||
const op = ops.reduce(json1.type.compose, null);
|
||||
const invertOp = invertOps.reduce(json1.type.compose, null);
|
||||
const op = ops.reduce(JSON1.type.compose, null);
|
||||
const invertOp = invertOps.reduce(JSON1.type.compose, null);
|
||||
|
||||
// this._add$.next(objects);
|
||||
|
||||
@@ -484,8 +483,8 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
ops.unshift(op);
|
||||
invertOps.push(invertOp);
|
||||
});
|
||||
const op = ops.reduce(json1.type.compose, null);
|
||||
const invertOp = invertOps.reduce(json1.type.compose, null);
|
||||
const op = ops.reduce(JSON1.type.compose, null);
|
||||
const invertOp = invertOps.reduce(JSON1.type.compose, null);
|
||||
|
||||
// this._remove$.next(objects);
|
||||
|
||||
@@ -512,8 +511,8 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
return { undo: null as unknown as JSONOp, redo: null as unknown as JSONOp, unitId, subUnitId, objects };
|
||||
}
|
||||
|
||||
const op = ops.reduce(json1.type.compose, null);
|
||||
const invertOp = invertOps.reduce(json1.type.compose, null);
|
||||
const op = ops.reduce(JSON1.type.compose, null);
|
||||
const invertOp = invertOps.reduce(JSON1.type.compose, null);
|
||||
|
||||
// this._update$.next(objects);
|
||||
|
||||
@@ -557,9 +556,9 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
ops.push(this._getGroupDrawingOp(groupParam));
|
||||
});
|
||||
|
||||
const op = ops.reduce(json1.type.compose, null);
|
||||
const op = ops.reduce(JSON1.type.compose, null);
|
||||
|
||||
const invertOp = json1.type.invertWithDoc(op, this.drawingManagerData as unknown as json1.Doc);
|
||||
const invertOp = JSON1.type.invertWithDoc(op, this.drawingManagerData as unknown as JSON1.Doc);
|
||||
|
||||
return { undo: invertOp, redo: op, unitId, subUnitId, objects: groupParams };
|
||||
}
|
||||
@@ -571,9 +570,9 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
ops.push(this._getUngroupDrawingOp(groupParam));
|
||||
});
|
||||
|
||||
const op = ops.reduce(json1.type.compose, null);
|
||||
const op = ops.reduce(JSON1.type.compose, null);
|
||||
|
||||
const invertOp = json1.type.invertWithDoc(op, this.drawingManagerData as unknown as json1.Doc);
|
||||
const invertOp = JSON1.type.invertWithDoc(op, this.drawingManagerData as unknown as JSON1.Doc);
|
||||
|
||||
return { undo: invertOp, redo: op, unitId, subUnitId, objects: groupParams };
|
||||
}
|
||||
@@ -657,7 +656,7 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
const ops: JSONOp[] = [];
|
||||
|
||||
ops.push(
|
||||
json1.insertOp([groupUnitId, groupSubUnitId, DrawingMapItemType.data, groupDrawingId], parent as unknown as json1.Doc)
|
||||
JSON1.insertOp([groupUnitId, groupSubUnitId, DrawingMapItemType.data, groupDrawingId], parent as unknown as JSON1.Doc)
|
||||
);
|
||||
let maxChildIndex = Number.NEGATIVE_INFINITY;
|
||||
children.forEach((child) => {
|
||||
@@ -674,10 +673,10 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
}
|
||||
|
||||
ops.push(
|
||||
json1.insertOp([groupUnitId, groupSubUnitId, DrawingMapItemType.order, maxChildIndex], groupDrawingId)
|
||||
JSON1.insertOp([groupUnitId, groupSubUnitId, DrawingMapItemType.order, maxChildIndex], groupDrawingId)
|
||||
);
|
||||
|
||||
return ops.reduce(json1.type.compose, null);
|
||||
return ops.reduce(JSON1.type.compose, null);
|
||||
}
|
||||
|
||||
private _getUngroupDrawingOp(groupParam: IDrawingGroupUpdateParam): JSONOp {
|
||||
@@ -693,20 +692,20 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
);
|
||||
});
|
||||
ops.push(
|
||||
json1.removeOp([groupUnitId, groupSubUnitId, DrawingMapItemType.data, groupDrawingId], true)
|
||||
JSON1.removeOp([groupUnitId, groupSubUnitId, DrawingMapItemType.data, groupDrawingId], true)
|
||||
);
|
||||
ops.push(
|
||||
json1.removeOp([groupUnitId, groupSubUnitId, DrawingMapItemType.order, this._getDrawingOrder(groupUnitId, groupSubUnitId).indexOf(groupDrawingId)], true)
|
||||
JSON1.removeOp([groupUnitId, groupSubUnitId, DrawingMapItemType.order, this._getDrawingOrder(groupUnitId, groupSubUnitId).indexOf(groupDrawingId)], true)
|
||||
);
|
||||
|
||||
return ops.reduce(json1.type.compose, null);
|
||||
return ops.reduce(JSON1.type.compose, null);
|
||||
}
|
||||
|
||||
applyJson1(unitId: string, subUnitId: string, jsonOp: JSONOp) {
|
||||
this._establishDrawingMap(unitId, subUnitId);
|
||||
// this._fillMissingFields(jsonOp);
|
||||
this._oldDrawingManagerData = { ...this.drawingManagerData };
|
||||
this.drawingManagerData = json1.type.apply(this.drawingManagerData as unknown as json1.Doc, jsonOp) as unknown as IDrawingMap<T>;
|
||||
this.drawingManagerData = JSON1.type.apply(this.drawingManagerData as unknown as JSON1.Doc, jsonOp) as unknown as IDrawingMap<T>;
|
||||
}
|
||||
|
||||
// private _fillMissingFields(jsonOp: JSONOp) {
|
||||
@@ -825,7 +824,7 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
if (index === -1 || index === orders.length - 1) {
|
||||
return;
|
||||
}
|
||||
const op = json1.moveOp([unitId, subUnitId, DrawingMapItemType.order, index], [unitId, subUnitId, DrawingMapItemType.order, index + 1]);
|
||||
const op = JSON1.moveOp([unitId, subUnitId, DrawingMapItemType.order, index], [unitId, subUnitId, DrawingMapItemType.order, index + 1]);
|
||||
ops.push(op);
|
||||
if (!newIds.includes(orders[index + 1])) {
|
||||
newIds.push(orders[index + 1]);
|
||||
@@ -833,8 +832,8 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
// this._moveDrawingOrder(unitId, subUnitId, drawingId, index + 1);
|
||||
});
|
||||
|
||||
const op = ops.reduce(json1.type.compose, null);
|
||||
const invertOp = json1.type.invertWithDoc(op, this.drawingManagerData as unknown as json1.Doc);
|
||||
const op = ops.reduce(JSON1.type.compose, null);
|
||||
const invertOp = JSON1.type.invertWithDoc(op, this.drawingManagerData as unknown as JSON1.Doc);
|
||||
|
||||
// this._order$.next({ unitId, subUnitId, drawingIds: this.getDrawingOrder(unitId, subUnitId) });
|
||||
|
||||
@@ -852,15 +851,15 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
return;
|
||||
}
|
||||
// this._moveDrawingOrder(unitId, subUnitId, drawingId, index - 1);
|
||||
const op = json1.moveOp([unitId, subUnitId, DrawingMapItemType.order, index], [unitId, subUnitId, DrawingMapItemType.order, index - 1]);
|
||||
const op = JSON1.moveOp([unitId, subUnitId, DrawingMapItemType.order, index], [unitId, subUnitId, DrawingMapItemType.order, index - 1]);
|
||||
ops.push(op);
|
||||
if (!newIds.includes(orders[index - 1])) {
|
||||
newIds.push(orders[index - 1]);
|
||||
}
|
||||
});
|
||||
|
||||
const op = ops.reduce(json1.type.compose, null);
|
||||
const invertOp = json1.type.invertWithDoc(op, this.drawingManagerData as unknown as json1.Doc);
|
||||
const op = ops.reduce(JSON1.type.compose, null);
|
||||
const invertOp = JSON1.type.invertWithDoc(op, this.drawingManagerData as unknown as JSON1.Doc);
|
||||
|
||||
// this._order$.next({ unitId, subUnitId, drawingIds: this.getDrawingOrder(unitId, subUnitId) });
|
||||
|
||||
@@ -877,7 +876,7 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
const { drawingId } = orderDrawingId;
|
||||
const index = this._getDrawingCount(unitId, subUnitId) - 1;
|
||||
|
||||
const op = json1.moveOp([unitId, subUnitId, DrawingMapItemType.order, this._getDrawingOrder(unitId, subUnitId).indexOf(drawingId)], [unitId, subUnitId, DrawingMapItemType.order, index]);
|
||||
const op = JSON1.moveOp([unitId, subUnitId, DrawingMapItemType.order, this._getDrawingOrder(unitId, subUnitId).indexOf(drawingId)], [unitId, subUnitId, DrawingMapItemType.order, index]);
|
||||
ops.push(op);
|
||||
if (!newIds.includes(orders[index])) {
|
||||
newIds.push(orders[index]);
|
||||
@@ -885,8 +884,8 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
// this._moveDrawingOrder(unitId, subUnitId, drawingId, index + 1);
|
||||
});
|
||||
|
||||
const op = ops.reduce(json1.type.compose, null);
|
||||
const invertOp = json1.type.invertWithDoc(op, this.drawingManagerData as unknown as json1.Doc);
|
||||
const op = ops.reduce(JSON1.type.compose, null);
|
||||
const invertOp = JSON1.type.invertWithDoc(op, this.drawingManagerData as unknown as JSON1.Doc);
|
||||
|
||||
return { undo: invertOp, redo: op, unitId, subUnitId, objects: { ...orderParams, drawingIds: newIds } };
|
||||
}
|
||||
@@ -900,7 +899,7 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
orderSearchParams.forEach((orderSearchParam) => {
|
||||
const { drawingId } = orderSearchParam;
|
||||
|
||||
const op = json1.moveOp([unitId, subUnitId, DrawingMapItemType.order, this._getDrawingOrder(unitId, subUnitId).indexOf(drawingId)], [unitId, subUnitId, DrawingMapItemType.order, 0]);
|
||||
const op = JSON1.moveOp([unitId, subUnitId, DrawingMapItemType.order, this._getDrawingOrder(unitId, subUnitId).indexOf(drawingId)], [unitId, subUnitId, DrawingMapItemType.order, 0]);
|
||||
ops.push(op);
|
||||
|
||||
if (!newIds.includes(orders[0])) {
|
||||
@@ -908,8 +907,8 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
}
|
||||
});
|
||||
|
||||
const op = ops.reduce(json1.type.compose, null);
|
||||
const invertOp = json1.type.invertWithDoc(op, this.drawingManagerData as unknown as json1.Doc);
|
||||
const op = ops.reduce(JSON1.type.compose, null);
|
||||
const invertOp = JSON1.type.invertWithDoc(op, this.drawingManagerData as unknown as JSON1.Doc);
|
||||
|
||||
return { undo: invertOp, redo: op, unitId, subUnitId, objects: { ...orderParams, drawingIds: newIds } };
|
||||
}
|
||||
@@ -928,11 +927,11 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
return null;
|
||||
}
|
||||
|
||||
const op = json1.moveOp(
|
||||
const op = JSON1.moveOp(
|
||||
[unitId, subUnitId, DrawingMapItemType.order, currentIndex],
|
||||
[unitId, subUnitId, DrawingMapItemType.order, targetIndex]
|
||||
);
|
||||
const invertOp = json1.type.invertWithDoc(op, this.drawingManagerData as unknown as json1.Doc);
|
||||
const invertOp = JSON1.type.invertWithDoc(op, this.drawingManagerData as unknown as JSON1.Doc);
|
||||
const affectedDrawingIds = orders.slice(
|
||||
Math.min(currentIndex, targetIndex),
|
||||
Math.max(currentIndex, targetIndex) + 1
|
||||
@@ -1013,11 +1012,11 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
|
||||
// this._insertDrawingOrder({ unitId, subUnitId, drawingId });
|
||||
|
||||
const op1 = json1.insertOp([unitId, subUnitId, DrawingMapItemType.data, drawingId], insertParam as unknown as json1.Doc);
|
||||
const op2 = json1.insertOp([unitId, subUnitId, DrawingMapItemType.order, this._getDrawingOrder(unitId, subUnitId).length], drawingId);
|
||||
const op = [op1, op2].reduce(json1.type.compose, null);
|
||||
const op1 = JSON1.insertOp([unitId, subUnitId, DrawingMapItemType.data, drawingId], insertParam as unknown as JSON1.Doc);
|
||||
const op2 = JSON1.insertOp([unitId, subUnitId, DrawingMapItemType.order, this._getDrawingOrder(unitId, subUnitId).length], drawingId);
|
||||
const op = [op1, op2].reduce(JSON1.type.compose, null);
|
||||
|
||||
const invertOp = json1.type.invertWithDoc(op, this.drawingManagerData as unknown as json1.Doc);
|
||||
const invertOp = JSON1.type.invertWithDoc(op, this.drawingManagerData as unknown as JSON1.Doc);
|
||||
|
||||
return { op, invertOp };
|
||||
}
|
||||
@@ -1038,11 +1037,11 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
|
||||
// this._removeDrawingOrder({ unitId, subUnitId, drawingId });
|
||||
|
||||
const op1 = json1.removeOp([unitId, subUnitId, DrawingMapItemType.data, drawingId], true);
|
||||
const op2 = json1.removeOp([unitId, subUnitId, DrawingMapItemType.order, this._getDrawingOrder(unitId, subUnitId).indexOf(drawingId)], true);
|
||||
const op = [op1, op2].reduce(json1.type.compose, null);
|
||||
const op1 = JSON1.removeOp([unitId, subUnitId, DrawingMapItemType.data, drawingId], true);
|
||||
const op2 = JSON1.removeOp([unitId, subUnitId, DrawingMapItemType.order, this._getDrawingOrder(unitId, subUnitId).indexOf(drawingId)], true);
|
||||
const op = [op1, op2].reduce(JSON1.type.compose, null);
|
||||
|
||||
const invertOp = json1.type.invertWithDoc(op, this.drawingManagerData as unknown as json1.Doc);
|
||||
const invertOp = JSON1.type.invertWithDoc(op, this.drawingManagerData as unknown as JSON1.Doc);
|
||||
|
||||
return { op, invertOp };
|
||||
}
|
||||
@@ -1069,9 +1068,9 @@ export class UnitDrawingService<T extends IDrawingParam> implements IUnitDrawing
|
||||
return { op: [] as unknown as JSONOp, invertOp: [] as unknown as JSONOp };
|
||||
}
|
||||
|
||||
const op = ops.reduce(json1.type.compose, null);
|
||||
const op = ops.reduce(JSON1.type.compose, null);
|
||||
|
||||
const invertOp = json1.type.invert(op);
|
||||
const invertOp = JSON1.type.invert(op);
|
||||
|
||||
return { op, invertOp };
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
"jest-canvas-mock": "^2.5.8",
|
||||
"rollup-plugin-polyfill-node": "^0.13.0",
|
||||
"rxjs": "^7.8.2",
|
||||
"tsdown": "^0.22.14",
|
||||
"tsdown": "^0.23.0",
|
||||
"typescript": "^6.0.3",
|
||||
"vitest": "^5.0.0"
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"@univerjs/docs": "workspace:*",
|
||||
"@univerjs/docs-ui": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"@univerjs/sheets-formula-ui": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"@univerjs/themes": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"tailwindcss": "3.4.18",
|
||||
|
||||
@@ -74,6 +74,6 @@
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"typescript": "^6.0.3",
|
||||
"vitest": "^5.0.0",
|
||||
"vue": "^3.5.40"
|
||||
"vue": "^3.5.42"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,13 +92,13 @@
|
||||
"@univerjs/engine-render": "workspace:*",
|
||||
"@univerjs/icons": "1.38.0",
|
||||
"@univerjs/protocol": "workspace:*",
|
||||
"@wendellhu/redi": "1.1.2"
|
||||
"@wendellhu/redi": "1.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/react": "^16.3.2",
|
||||
"@testing-library/react": "^16.3.3",
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"@univerjs/themes": "workspace:*",
|
||||
"postcss": "^8.5.26",
|
||||
"postcss": "^8.5.28",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
|
||||
Generated
+2306
-2027
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -13,10 +13,10 @@ allowBuilds:
|
||||
esbuild: false
|
||||
protobufjs: false
|
||||
overrides:
|
||||
'@types/react': 19.2.18
|
||||
'@types/react-dom': 19.2.4
|
||||
react: 19.2.8
|
||||
react-dom: 19.2.8
|
||||
'@types/react': 19.3.0
|
||||
'@types/react-dom': 19.3.0
|
||||
react: 19.3.0
|
||||
react-dom: 19.3.0
|
||||
minimumReleaseAgeExclude:
|
||||
- '@amamo/*'
|
||||
- '@univerjs/*'
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"@wendellhu/redi": "1.1.2",
|
||||
"@wendellhu/redi": "1.1.3",
|
||||
"typescript": "^6.0.3"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user