@univerjs/docs 1.3.0 → 1.4.0
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/facade.js +14 -28
- package/lib/cjs/index.js +191 -1432
- package/lib/cjs/worker-BkTyL8zs.js +1293 -0
- package/lib/cjs/worker.js +44 -0
- package/lib/es/facade.js +14 -28
- package/lib/es/index.js +70 -1311
- package/lib/es/worker-Dny9WctR.js +1186 -0
- package/lib/es/worker.js +38 -0
- package/lib/facade.js +14 -28
- package/lib/index.js +70 -1311
- package/lib/types/config/config.d.ts +4 -0
- package/lib/types/index.d.ts +6 -2
- package/lib/types/layout-worker/index.d.ts +1 -5
- package/lib/types/layout-worker/worker.d.ts +1 -1
- package/lib/types/services/doc-interceptor/doc-interceptor.service.d.ts +1 -1
- package/lib/types/services/doc-state-change-manager.service.d.ts +1 -1
- package/lib/types/services/permission/document-permission.d.ts +1 -1
- package/lib/types/worker.d.ts +27 -0
- package/lib/umd/index.js +2 -2
- package/lib/worker-Dny9WctR.js +1186 -0
- package/lib/worker.js +38 -0
- package/package.json +15 -10
|
@@ -19,3 +19,7 @@ export interface IUniverDocsConfig {
|
|
|
19
19
|
hasScroll?: boolean;
|
|
20
20
|
}
|
|
21
21
|
export declare const defaultPluginConfig: IUniverDocsConfig;
|
|
22
|
+
export declare const DOCS_WORKER_PLUGIN_CONFIG_KEY = "docs.worker.config";
|
|
23
|
+
export interface IUniverDocsWorkerConfig {
|
|
24
|
+
}
|
|
25
|
+
export declare const defaultPluginWorkerConfig: IUniverDocsWorkerConfig;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -39,8 +39,12 @@ export type { ISetTextSelectionsOperationParams } from './commands/operations/te
|
|
|
39
39
|
export type { IUniverDocsConfig } from './config/config';
|
|
40
40
|
export { createDocsCustomBlockDrawing, createDocsCustomBlockInsertMutation, createDocsCustomBlockRemoveMutation, createEmbedDocsCustomBlockData, createInsertCustomBlockActions, createRemoveCustomBlockActions, EMBED_DOCS_CUSTOM_BLOCK_DEFAULT_COMPONENT_KEY, isEmbedDocsCustomBlockData, isSheetLikeDocsCustomBlockChildType, resolveDocsCustomBlockSize, shouldUseInlineTextSelectionForDocsCustomBlockDrawing, } from './embed-host-anchor';
|
|
41
41
|
export type { EmbedDocsCustomBlockInteractionMode, IDocsCustomBlockMutationParams, IEmbedDocsCustomBlockData, } from './embed-host-anchor';
|
|
42
|
-
export { DocsLayoutWorkerCapabilityError, DocsLayoutWorkerClientService,
|
|
43
|
-
export type {
|
|
42
|
+
export { DocsLayoutWorkerCapabilityError, DocsLayoutWorkerClientService, UniverDocsLayoutWorkerPlugin } from './layout-worker';
|
|
43
|
+
export type { IUniverDocsLayoutWorkerConfig } from './layout-worker/config/config';
|
|
44
|
+
export type { IDocsLayoutWorkerCapabilities, IDocsLayoutWorkerFontProbe, IDocsLayoutWorkerRuntime } from './layout-worker/protocol';
|
|
45
|
+
export {
|
|
46
|
+
/** @deprecated Register UniverDocsWorkerPlugin from '@univerjs/docs/worker' instead. This root export will be removed in the next release. */
|
|
47
|
+
startDocsLayoutWorker, } from './layout-worker/worker';
|
|
44
48
|
export { UniverDocsPlugin } from './plugin';
|
|
45
49
|
export { DocBlockMoveValidatorService } from './services/doc-block-move-validator.service';
|
|
46
50
|
export type { DocBlockMoveTransformer, DocBlockMoveValidator, IDocBlockMoveResult, IDocBlockMoveTransformContext, IDocBlockMoveValidationContext, } from './services/doc-block-move-validator.service';
|
|
@@ -13,12 +13,11 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { Disposable, IConfigService, Injector, Plugin } from '@univerjs/core';
|
|
16
17
|
import type { IDocLayoutCancelRequest, IDocLayoutCreateSessionRequest, IDocLayoutDisposeMountRequest, IDocLayoutDisposeSessionRequest, IDocLayoutExecutor, IDocLayoutPageRequest, IDocLayoutPageResult, IDocLayoutPerformanceMetrics, IDocLayoutStartRequest, IDocLayoutStartResult, IDocLayoutStepRequest, IDocLayoutStepResult } from '../services/doc-layout-executor.service';
|
|
17
18
|
import type { IDocsLayoutFontFace, IUniverDocsLayoutWorkerConfig } from './config/config';
|
|
18
19
|
import type { IDocsLayoutWorkerCapabilities } from './protocol';
|
|
19
|
-
import { Disposable, IConfigService, Injector, Plugin } from '@univerjs/core';
|
|
20
20
|
import { DocLayoutExecutorService, DocLayoutExecutorType } from '../services/doc-layout-executor.service';
|
|
21
|
-
import { startDocsLayoutWorker } from './worker';
|
|
22
21
|
export declare class DocsLayoutWorkerCapabilityError extends Error {
|
|
23
22
|
constructor(message: string);
|
|
24
23
|
}
|
|
@@ -68,6 +67,3 @@ export declare class UniverDocsLayoutWorkerPlugin extends Plugin {
|
|
|
68
67
|
constructor(_config: Partial<IUniverDocsLayoutWorkerConfig> | undefined, _injector: Injector, _layoutExecutorService: DocLayoutExecutorService, _configService: IConfigService);
|
|
69
68
|
onStarting(): void;
|
|
70
69
|
}
|
|
71
|
-
export type { IUniverDocsLayoutWorkerConfig } from './config/config';
|
|
72
|
-
export type { IDocsLayoutWorkerCapabilities, IDocsLayoutWorkerFontProbe, IDocsLayoutWorkerRuntime } from './protocol';
|
|
73
|
-
export { startDocsLayoutWorker };
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { ChannelService } from '@univerjs/rpc';
|
|
16
17
|
import type { IDocLayoutCancelRequest, IDocLayoutCreateSessionRequest, IDocLayoutDisposeMountRequest, IDocLayoutDisposeSessionRequest, IDocLayoutPageRequest, IDocLayoutPageResult, IDocLayoutPerformanceMetrics, IDocLayoutStartRequest, IDocLayoutStartResult, IDocLayoutStepRequest, IDocLayoutStepResult } from '../services/doc-layout-executor.service';
|
|
17
18
|
import type { IDocsLayoutFontFace } from './config/config';
|
|
18
19
|
import type { IDocsLayoutWorkerCapabilities, IDocsLayoutWorkerRuntime } from './protocol';
|
|
19
|
-
import { ChannelService } from '@univerjs/rpc';
|
|
20
20
|
import { DocLayoutExecutorType } from '../services/doc-layout-executor.service';
|
|
21
21
|
import { DocsLayoutWorkerPerformanceTracker } from './performance-tracker';
|
|
22
22
|
export declare class DocsLayoutWorkerRuntime implements IDocsLayoutWorkerRuntime {
|
|
@@ -22,7 +22,7 @@ export declare class DocInterceptorService extends Disposable implements IRender
|
|
|
22
22
|
private readonly _docSkeletonManagerService;
|
|
23
23
|
private _interceptorsByName;
|
|
24
24
|
constructor(_context: IRenderContext<DocumentDataModel>, _docSkeletonManagerService: DocSkeletonManagerService);
|
|
25
|
-
intercept<T extends IInterceptor<any, any>>(name: T, interceptor: T): import("@
|
|
25
|
+
intercept<T extends IInterceptor<any, any>>(name: T, interceptor: T): import("@univerjs/core").IDisposable;
|
|
26
26
|
fetchThroughInterceptors<T, C>(name: IInterceptor<T, C>): (initValue: Nullable<T>, initContext: C) => Nullable<T>;
|
|
27
27
|
interceptDocumentViewModel(viewModel: DocumentViewModel): DisposableCollection;
|
|
28
28
|
}
|
|
@@ -24,7 +24,7 @@ interface IStateCache {
|
|
|
24
24
|
export interface IDocStateChangeInterceptorService {
|
|
25
25
|
transformChangeStateInfo(changeStateInfo: IDocStateChangeInfo): Nullable<IDocStateChangeInfo>;
|
|
26
26
|
}
|
|
27
|
-
export declare const IDocStateChangeInterceptorService: import("@
|
|
27
|
+
export declare const IDocStateChangeInterceptorService: import("@univerjs/core").IdentifierDecorator<IDocStateChangeInterceptorService>;
|
|
28
28
|
export declare class DocStateChangeManagerService extends RxDisposable {
|
|
29
29
|
private _undoRedoService;
|
|
30
30
|
private readonly _commandService;
|
|
@@ -28,7 +28,7 @@ export type DocumentUnitPermissionAction = typeof DOCUMENT_UNIT_PERMISSION_ACTIO
|
|
|
28
28
|
export declare function getDocumentSectionPermissionObjectId(segmentId: string, sectionId: string): string;
|
|
29
29
|
export declare function getDocumentParagraphPermissionObjectId(segmentId: string, paragraphId: string): string;
|
|
30
30
|
export declare function getDocumentEntityPermissionObjectId(segmentId: string, entityType: string, entityId: string): string;
|
|
31
|
-
export declare function createDocumentPermissionPoint(unitId: string, objectId: string, action: UnitAction): DocumentCommentPermission | DocumentCopyPermission | DocumentEditablePermission |
|
|
31
|
+
export declare function createDocumentPermissionPoint(unitId: string, objectId: string, action: UnitAction): DocumentCommentPermission | DocumentCopyPermission | DocumentEditablePermission | DocumentEntityEditPermission | DocumentExportPermission | DocumentParagraphEditPermission | DocumentPrintPermission | DocumentSectionEditPermission;
|
|
32
32
|
export declare function getDocumentPermissionValue(permissionService: IPermissionService, unitId: string, objectId: string, action: UnitAction): boolean;
|
|
33
33
|
export declare function setDocumentPermissionValue(permissionService: IPermissionService, unitId: string, objectId: string, action: UnitAction, value: boolean): void;
|
|
34
34
|
export declare function clearDocumentPermissionValuesForUnit(permissionService: IPermissionService, unitId: string): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { IConfigService, Injector, Plugin } from '@univerjs/core';
|
|
17
|
+
import type { IUniverDocsWorkerConfig } from './config/config';
|
|
18
|
+
export declare class UniverDocsWorkerPlugin extends Plugin {
|
|
19
|
+
private readonly _config;
|
|
20
|
+
protected readonly _injector: Injector;
|
|
21
|
+
private readonly _configService;
|
|
22
|
+
static pluginName: string;
|
|
23
|
+
static packageName: string;
|
|
24
|
+
static version: string;
|
|
25
|
+
constructor(_config: IUniverDocsWorkerConfig | undefined, _injector: Injector, _configService: IConfigService);
|
|
26
|
+
onStarting(): void;
|
|
27
|
+
}
|