@univerjs-pro/embed-ui 1.0.0-insiders.20260709-5fcadb2
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/README.md +45 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/locale/ar-SA.js +1 -0
- package/lib/cjs/locale/ca-ES.js +1 -0
- package/lib/cjs/locale/de-DE.js +1 -0
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/es-ES.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/fr-FR.js +1 -0
- package/lib/cjs/locale/id-ID.js +1 -0
- package/lib/cjs/locale/it-IT.js +1 -0
- package/lib/cjs/locale/ja-JP.js +1 -0
- package/lib/cjs/locale/ko-KR.js +1 -0
- package/lib/cjs/locale/pl-PL.js +1 -0
- package/lib/cjs/locale/pt-BR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/sheets-floating.js +1 -0
- package/lib/cjs/locale/sk-SK.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-HK.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/index.js +1 -0
- package/lib/es/locale/ar-SA.js +1 -0
- package/lib/es/locale/ca-ES.js +1 -0
- package/lib/es/locale/de-DE.js +1 -0
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/es-ES.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/fr-FR.js +1 -0
- package/lib/es/locale/id-ID.js +1 -0
- package/lib/es/locale/it-IT.js +1 -0
- package/lib/es/locale/ja-JP.js +1 -0
- package/lib/es/locale/ko-KR.js +1 -0
- package/lib/es/locale/pl-PL.js +1 -0
- package/lib/es/locale/pt-BR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/sheets-floating.js +1 -0
- package/lib/es/locale/sk-SK.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-HK.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/index.css +1135 -0
- package/lib/index.js +1 -0
- package/lib/locale/ar-SA.js +1 -0
- package/lib/locale/ca-ES.js +1 -0
- package/lib/locale/de-DE.js +1 -0
- package/lib/locale/en-US.js +1 -0
- package/lib/locale/es-ES.js +1 -0
- package/lib/locale/fa-IR.js +1 -0
- package/lib/locale/fr-FR.js +1 -0
- package/lib/locale/id-ID.js +1 -0
- package/lib/locale/it-IT.js +1 -0
- package/lib/locale/ja-JP.js +1 -0
- package/lib/locale/ko-KR.js +1 -0
- package/lib/locale/pl-PL.js +1 -0
- package/lib/locale/pt-BR.js +1 -0
- package/lib/locale/ru-RU.js +1 -0
- package/lib/locale/sheets-floating.js +1 -0
- package/lib/locale/sk-SK.js +1 -0
- package/lib/locale/vi-VN.js +1 -0
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-HK.js +1 -0
- package/lib/locale/zh-TW.js +1 -0
- package/lib/types/common/const.d.ts +17 -0
- package/lib/types/common/embed-float-interaction-policy.d.ts +28 -0
- package/lib/types/common/embed-host-chrome-policy.d.ts +34 -0
- package/lib/types/common/embed-runtime-policy.d.ts +28 -0
- package/lib/types/common/embed-runtime-slots.d.ts +24 -0
- package/lib/types/common/tab-peer-workbench.d.ts +21 -0
- package/lib/types/components/EmbedFloatDomRenderer.d.ts +56 -0
- package/lib/types/components/EmbedFloatFullscreenButton.d.ts +31 -0
- package/lib/types/components/EmbedHostToolbarMenu.d.ts +52 -0
- package/lib/types/components/EmbedRuntimeProviders.d.ts +24 -0
- package/lib/types/config/config.d.ts +25 -0
- package/lib/types/controllers/docs-table-passive-wheel-bridge.controller.d.ts +7 -0
- package/lib/types/controllers/embed-host-anchor-cleanup.controller.d.ts +22 -0
- package/lib/types/controllers/embed-host-ribbon-override.controller.d.ts +29 -0
- package/lib/types/index.d.ts +71 -0
- package/lib/types/locale/ar-SA.d.ts +18 -0
- package/lib/types/locale/ca-ES.d.ts +18 -0
- package/lib/types/locale/de-DE.d.ts +18 -0
- package/lib/types/locale/en-US.d.ts +70 -0
- package/lib/types/locale/es-ES.d.ts +18 -0
- package/lib/types/locale/fa-IR.d.ts +18 -0
- package/lib/types/locale/fr-FR.d.ts +18 -0
- package/lib/types/locale/id-ID.d.ts +18 -0
- package/lib/types/locale/it-IT.d.ts +18 -0
- package/lib/types/locale/ja-JP.d.ts +18 -0
- package/lib/types/locale/ko-KR.d.ts +18 -0
- package/lib/types/locale/pl-PL.d.ts +18 -0
- package/lib/types/locale/pt-BR.d.ts +18 -0
- package/lib/types/locale/ru-RU.d.ts +18 -0
- package/lib/types/locale/sheets-floating.d.ts +62 -0
- package/lib/types/locale/sk-SK.d.ts +18 -0
- package/lib/types/locale/types.d.ts +18 -0
- package/lib/types/locale/vi-VN.d.ts +18 -0
- package/lib/types/locale/zh-CN.d.ts +18 -0
- package/lib/types/locale/zh-HK.d.ts +18 -0
- package/lib/types/locale/zh-TW.d.ts +18 -0
- package/lib/types/plugin.d.ts +38 -0
- package/lib/types/product-menus/docs-product-menus.d.ts +17 -0
- package/lib/types/products/bases/EmbedChildView.d.ts +13 -0
- package/lib/types/products/bases/EmbedChildView.spec.d.ts +1 -0
- package/lib/types/products/bases/EmbedFloatingMenu.d.ts +37 -0
- package/lib/types/products/bases/embed-block.d.ts +2 -0
- package/lib/types/products/bases/embed-content-size.d.ts +9 -0
- package/lib/types/products/bases/embed-host-adapter.d.ts +6 -0
- package/lib/types/products/bases/embed-passive-viewport.d.ts +3 -0
- package/lib/types/products/bases/register.d.ts +13 -0
- package/lib/types/products/docs/EmbedDocsCustomBlockRenderer.d.ts +54 -0
- package/lib/types/products/docs/EmbedFloatingMenu.d.ts +29 -0
- package/lib/types/products/docs/embed-block.d.ts +18 -0
- package/lib/types/products/docs/embed-docs-custom-block-bleed.render-controller.d.ts +40 -0
- package/lib/types/products/docs/embed-host-adapter.d.ts +21 -0
- package/lib/types/products/docs/embed-passive-viewport.d.ts +18 -0
- package/lib/types/products/docs/register.d.ts +17 -0
- package/lib/types/products/product-ui-contributions.d.ts +2 -0
- package/lib/types/products/sheets/EmbedBlock.d.ts +23 -0
- package/lib/types/products/sheets/EmbedFloatingMenu.d.ts +79 -0
- package/lib/types/products/sheets/embed-content-size.d.ts +17 -0
- package/lib/types/products/sheets/embed-host-adapter.d.ts +20 -0
- package/lib/types/products/sheets/embed-passive-viewport.d.ts +18 -0
- package/lib/types/products/sheets/embed-product-menu.d.ts +36 -0
- package/lib/types/products/sheets/register.d.ts +43 -0
- package/lib/types/products/slides/EmbedChildView.d.ts +3 -0
- package/lib/types/products/slides/components/embed-floating-menu/SlideEmbedFloatingMenu.d.ts +28 -0
- package/lib/types/products/slides/components/embed-floating-preview/SlideEmbedFloatingPreview.d.ts +24 -0
- package/lib/types/products/slides/embed-block.d.ts +2 -0
- package/lib/types/products/slides/embed-floating-menu-stage.d.ts +8 -0
- package/lib/types/products/slides/embed-floating-menu.d.ts +5 -0
- package/lib/types/products/slides/embed-host-adapter.d.ts +7 -0
- package/lib/types/products/slides/embed-passive-viewport.d.ts +2 -0
- package/lib/types/products/slides/register.d.ts +13 -0
- package/lib/types/products/slides/services/EmbedSlideReadonlyPreviewProvider.d.ts +15 -0
- package/lib/types/products/slides/services/embed-slide-float-preview.provider.d.ts +34 -0
- package/lib/types/services/embed-activation.service.d.ts +59 -0
- package/lib/types/services/embed-block-contribution-factory.d.ts +32 -0
- package/lib/types/services/embed-block-registry.service.d.ts +23 -0
- package/lib/types/services/embed-child-product-plugin-lease.d.ts +30 -0
- package/lib/types/services/embed-child-product-plugin-registry.service.d.ts +55 -0
- package/lib/types/services/embed-child-runtime-scope.d.ts +22 -0
- package/lib/types/services/embed-child-unit-scoped-injector.d.ts +21 -0
- package/lib/types/services/embed-child-view-registry.service.d.ts +23 -0
- package/lib/types/services/embed-content-size-registry.service.d.ts +24 -0
- package/lib/types/services/embed-default-floating-menu.d.ts +19 -0
- package/lib/types/services/embed-docs-sticky-wheel.d.ts +17 -0
- package/lib/types/services/embed-dom-passive-viewport-provider.d.ts +23 -0
- package/lib/types/services/embed-float-preview.service.d.ts +44 -0
- package/lib/types/services/embed-floating-active.service.d.ts +26 -0
- package/lib/types/services/embed-floating-geometry.service.d.ts +37 -0
- package/lib/types/services/embed-floating-menu-registry.service.d.ts +26 -0
- package/lib/types/services/embed-floating-menu-root.d.ts +17 -0
- package/lib/types/services/embed-fullscreen.service.d.ts +27 -0
- package/lib/types/services/embed-host-container-registry.service.d.ts +26 -0
- package/lib/types/services/embed-host-menu-override.service.d.ts +29 -0
- package/lib/types/services/embed-host-restore.service.d.ts +34 -0
- package/lib/types/services/embed-interaction-boundary.service.d.ts +57 -0
- package/lib/types/services/embed-mount.service.d.ts +68 -0
- package/lib/types/services/embed-overlay-root.service.d.ts +37 -0
- package/lib/types/services/embed-passive-viewport-registry.service.d.ts +24 -0
- package/lib/types/services/embed-passive-wheel-handler-registry.service.d.ts +24 -0
- package/lib/types/services/embed-product-floating-menu-contributions.d.ts +17 -0
- package/lib/types/services/embed-product-menu-mounting.d.ts +33 -0
- package/lib/types/services/embed-product-menu-registry.service.d.ts +29 -0
- package/lib/types/services/embed-readonly-preview-registry.service.d.ts +23 -0
- package/lib/types/services/embed-render-canvas-preview-provider.d.ts +23 -0
- package/lib/types/services/embed-render-child-view-contribution.d.ts +76 -0
- package/lib/types/services/embed-runtime-focus-coordinator.service.d.ts +91 -0
- package/lib/types/services/embed-runtime-policy.service.d.ts +43 -0
- package/lib/types/services/embed-runtime-scope-dom.d.ts +30 -0
- package/lib/types/services/embed-scene-canvas-capture.service.d.ts +39 -0
- package/lib/types/services/embed-scene-passive-wheel.d.ts +36 -0
- package/lib/types/services/embed-screenshot.service.d.ts +16 -0
- package/lib/types/services/embed-ui-contribution-register.d.ts +20 -0
- package/lib/types/services/embed-undo-bridge.service.d.ts +29 -0
- package/lib/types/services/react-root-disposal.d.ts +21 -0
- package/lib/types/types/embed-ui.d.ts +307 -0
- package/lib/umd/index.js +1 -0
- package/lib/umd/locale/ar-SA.js +1 -0
- package/lib/umd/locale/ca-ES.js +1 -0
- package/lib/umd/locale/de-DE.js +1 -0
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/es-ES.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/fr-FR.js +1 -0
- package/lib/umd/locale/id-ID.js +1 -0
- package/lib/umd/locale/it-IT.js +1 -0
- package/lib/umd/locale/ja-JP.js +1 -0
- package/lib/umd/locale/ko-KR.js +1 -0
- package/lib/umd/locale/pl-PL.js +1 -0
- package/lib/umd/locale/pt-BR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/sheets-floating.js +1 -0
- package/lib/umd/locale/sk-SK.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-HK.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +110 -0
|
@@ -0,0 +1,36 @@
|
|
|
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 type { IEmbedPassiveViewportWheelContext } from '../types/embed-ui';
|
|
17
|
+
export declare function normalizePassiveWheelDelta(event: WheelEvent, scaleX?: number, scaleY?: number): {
|
|
18
|
+
offsetX: number;
|
|
19
|
+
offsetY: number;
|
|
20
|
+
};
|
|
21
|
+
export declare function scrollSceneViewportPassive(context: IEmbedPassiveViewportWheelContext, viewport: {
|
|
22
|
+
viewportScrollX?: number;
|
|
23
|
+
viewportScrollY?: number;
|
|
24
|
+
scrollToViewportPos?: (position: Partial<{
|
|
25
|
+
viewportScrollX: number;
|
|
26
|
+
viewportScrollY: number;
|
|
27
|
+
}>) => unknown;
|
|
28
|
+
scrollByViewportDeltaVal?: (delta: {
|
|
29
|
+
viewportScrollX: number;
|
|
30
|
+
viewportScrollY: number;
|
|
31
|
+
}) => unknown;
|
|
32
|
+
} | null | undefined, scene?: {
|
|
33
|
+
scaleX?: number;
|
|
34
|
+
scaleY?: number;
|
|
35
|
+
makeDirty?: (force?: boolean) => void;
|
|
36
|
+
}): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
export { captureEmbedContextSceneCanvas as captureEmbedContextCanvasScreenshot, type IEmbedSceneCanvasCaptureProvider as EmbedScreenshotProvider, type EmbedSceneCanvasCaptureResult as EmbedScreenshotResult, EmbedSceneCanvasCaptureService as EmbedScreenshotService, } from './embed-scene-canvas-capture.service';
|
|
@@ -0,0 +1,20 @@
|
|
|
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 type { Injector } from '@univerjs/core';
|
|
17
|
+
type EmbedUIContributionRegister = (injector: Injector) => void;
|
|
18
|
+
export declare function registerEmbedUIContribution(injector: Injector, key: string, register: EmbedUIContributionRegister): void;
|
|
19
|
+
export declare function flushPendingEmbedUIContributions(injector: Injector): void;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
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 type { IUndoRedoItem } from '@univerjs/core';
|
|
17
|
+
import { IUndoRedoService } from '@univerjs/core';
|
|
18
|
+
import { EmbedFocusOwnerService } from '@univerjs-pro/embed';
|
|
19
|
+
export interface IEmbedUndoBridgeResult {
|
|
20
|
+
stackUnitId: string;
|
|
21
|
+
routedToHost: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare class EmbedUndoBridgeService {
|
|
24
|
+
private readonly _focusOwnerService;
|
|
25
|
+
private readonly _undoRedoService;
|
|
26
|
+
constructor(_focusOwnerService: EmbedFocusOwnerService, _undoRedoService: IUndoRedoService);
|
|
27
|
+
pushUndoRedoForChild(item: IUndoRedoItem): IEmbedUndoBridgeResult;
|
|
28
|
+
resolveStackUnitId(childUnitId: string): string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 type { ReactElement } from 'react';
|
|
17
|
+
export interface IEmbedReactRoot {
|
|
18
|
+
render: (node: ReactElement) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function createEmbedReactRoot(container: Element): IEmbedReactRoot;
|
|
21
|
+
export declare function disposeEmbedReactRoot(root: IEmbedReactRoot): void;
|
|
@@ -0,0 +1,307 @@
|
|
|
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 type { DependencyIdentifier, ICommandService, IDisposable, Injector, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
|
|
17
|
+
import type { EmbedHostEntry, EmbedLayout, EmbedMenuBehavior, IEmbedDescriptor, IEmbedLayoutPolicies } from '@univerjs-pro/embed';
|
|
18
|
+
import type { IMenuManagerService, IRibbonService } from '@univerjs/ui';
|
|
19
|
+
import type { Observable } from 'rxjs';
|
|
20
|
+
export interface IEmbedContainerContext {
|
|
21
|
+
descriptor: IEmbedDescriptor;
|
|
22
|
+
layout: EmbedLayout;
|
|
23
|
+
injector: Injector;
|
|
24
|
+
hostElement?: HTMLElement;
|
|
25
|
+
container?: HTMLElement;
|
|
26
|
+
hostUnitId: string;
|
|
27
|
+
embedId: string;
|
|
28
|
+
childUnitId: string;
|
|
29
|
+
childType: UniverInstanceType;
|
|
30
|
+
}
|
|
31
|
+
export interface IEmbedChildContainerContext extends IEmbedContainerContext {
|
|
32
|
+
hostElement: HTMLElement;
|
|
33
|
+
container: HTMLElement;
|
|
34
|
+
renderScope: IEmbedRenderScope;
|
|
35
|
+
runtimeScope: IEmbedChildRuntimeScope;
|
|
36
|
+
}
|
|
37
|
+
export interface IEmbedMenuOutlet {
|
|
38
|
+
container: HTMLElement;
|
|
39
|
+
}
|
|
40
|
+
export interface IEmbedRenderScope {
|
|
41
|
+
hostUnitId: string;
|
|
42
|
+
hostAnchorId: string;
|
|
43
|
+
embedId: string;
|
|
44
|
+
childUnitId: string;
|
|
45
|
+
childType: UniverInstanceType;
|
|
46
|
+
layout: EmbedLayout;
|
|
47
|
+
mode: 'tab' | 'float' | 'inline';
|
|
48
|
+
rootElement: HTMLElement;
|
|
49
|
+
contentRoot?: HTMLElement;
|
|
50
|
+
canvasRoot?: HTMLElement;
|
|
51
|
+
overlayRoot?: HTMLElement;
|
|
52
|
+
popupRoot?: HTMLElement;
|
|
53
|
+
menuOutlet?: IEmbedMenuOutlet;
|
|
54
|
+
active$: Observable<boolean>;
|
|
55
|
+
fullscreen?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface IEmbedChildRuntimeScope {
|
|
58
|
+
descriptor: IEmbedDescriptor;
|
|
59
|
+
host: {
|
|
60
|
+
unitId: string;
|
|
61
|
+
type: UniverInstanceType;
|
|
62
|
+
anchorId: string;
|
|
63
|
+
entry: EmbedHostEntry;
|
|
64
|
+
layout: 'doc-flow' | 'float' | 'tab-peer';
|
|
65
|
+
};
|
|
66
|
+
child: {
|
|
67
|
+
unitId: string;
|
|
68
|
+
type: UniverInstanceType;
|
|
69
|
+
};
|
|
70
|
+
injector: Injector;
|
|
71
|
+
instanceService?: IUniverInstanceService;
|
|
72
|
+
commandService?: ICommandService;
|
|
73
|
+
menuManagerService?: IMenuManagerService;
|
|
74
|
+
roots: {
|
|
75
|
+
root: HTMLElement;
|
|
76
|
+
content: HTMLElement;
|
|
77
|
+
canvas?: HTMLElement;
|
|
78
|
+
overlay: HTMLElement;
|
|
79
|
+
popup: HTMLElement;
|
|
80
|
+
menuSlot?: HTMLElement;
|
|
81
|
+
footerSlot?: HTMLElement;
|
|
82
|
+
};
|
|
83
|
+
activate: () => void;
|
|
84
|
+
deactivate: () => void;
|
|
85
|
+
dispose: () => void;
|
|
86
|
+
}
|
|
87
|
+
export interface IEmbedHostMountResult {
|
|
88
|
+
hostElement?: HTMLElement;
|
|
89
|
+
runtimeRoots?: {
|
|
90
|
+
content?: HTMLElement;
|
|
91
|
+
canvas?: HTMLElement;
|
|
92
|
+
overlay?: HTMLElement;
|
|
93
|
+
popup?: HTMLElement;
|
|
94
|
+
menuSlot?: HTMLElement;
|
|
95
|
+
footerSlot?: HTMLElement;
|
|
96
|
+
};
|
|
97
|
+
disposable?: IDisposable;
|
|
98
|
+
}
|
|
99
|
+
export interface IEmbedHostContainerContribution {
|
|
100
|
+
hostType: UniverInstanceType;
|
|
101
|
+
entry: EmbedHostEntry;
|
|
102
|
+
layout: EmbedLayout;
|
|
103
|
+
supportedLayouts?: EmbedLayout[];
|
|
104
|
+
menuBehavior: EmbedMenuBehavior;
|
|
105
|
+
mount?: (context: IEmbedContainerContext) => IEmbedHostMountResult | IDisposable | void;
|
|
106
|
+
}
|
|
107
|
+
export interface IEmbedChildViewContribution {
|
|
108
|
+
childType: UniverInstanceType;
|
|
109
|
+
supportedLayouts: EmbedLayout[];
|
|
110
|
+
beforeDeactivate?: (context: IEmbedChildContainerContext) => void;
|
|
111
|
+
mount?: (context: IEmbedChildContainerContext) => IDisposable | void;
|
|
112
|
+
}
|
|
113
|
+
export interface IEmbedProductMenuContribution {
|
|
114
|
+
childType: UniverInstanceType;
|
|
115
|
+
surface?: EmbedProductMenuSurface;
|
|
116
|
+
menuSchema?: unknown;
|
|
117
|
+
id?: string;
|
|
118
|
+
order?: number;
|
|
119
|
+
scopedActionServiceTokens?: readonly DependencyIdentifier<unknown>[];
|
|
120
|
+
mountMenu?: (context: IEmbedProductMenuMountContext) => IDisposable | void;
|
|
121
|
+
}
|
|
122
|
+
export type EmbedProductMenuSurface = 'ribbon' | 'product-toolbar' | 'context-menu' | 'float-toolbar' | 'footer' | 'side-panel' | 'floating-menu';
|
|
123
|
+
export interface IEmbedProductMenuMountContext {
|
|
124
|
+
container: HTMLElement;
|
|
125
|
+
portalContainer?: HTMLElement | null;
|
|
126
|
+
childType: UniverInstanceType;
|
|
127
|
+
surface?: EmbedProductMenuSurface;
|
|
128
|
+
childUnitId?: string;
|
|
129
|
+
embedId?: string;
|
|
130
|
+
injector: unknown;
|
|
131
|
+
menuSchema: unknown;
|
|
132
|
+
menuTitlePrefix?: string;
|
|
133
|
+
activeRibbonTab?: string;
|
|
134
|
+
headerMenu?: boolean;
|
|
135
|
+
toolbarOnly?: boolean;
|
|
136
|
+
ribbonHeaderClassName?: string;
|
|
137
|
+
scopedActionServiceTokens?: readonly DependencyIdentifier<unknown>[];
|
|
138
|
+
}
|
|
139
|
+
export interface IEmbedProductRibbonOverride {
|
|
140
|
+
mode?: EmbedHostChromeMode;
|
|
141
|
+
ribbonService: IRibbonService;
|
|
142
|
+
injector?: Pick<Injector, 'get' | 'has' | 'invoke'>;
|
|
143
|
+
portalContainer?: HTMLElement | null;
|
|
144
|
+
placeholderTitle?: string;
|
|
145
|
+
hideToolbar?: boolean;
|
|
146
|
+
disposable?: IDisposable;
|
|
147
|
+
}
|
|
148
|
+
export interface IEmbedProductRibbonOverrideContext {
|
|
149
|
+
childType: UniverInstanceType;
|
|
150
|
+
childUnitId?: string;
|
|
151
|
+
injector: unknown;
|
|
152
|
+
embedId: string;
|
|
153
|
+
hostUnitId: string;
|
|
154
|
+
entry: EmbedHostEntry;
|
|
155
|
+
}
|
|
156
|
+
export interface IEmbedBlockContribution {
|
|
157
|
+
childType: UniverInstanceType;
|
|
158
|
+
productName: string;
|
|
159
|
+
hostChromeMode?: EmbedHostChromeMode;
|
|
160
|
+
hostHeaderMode?: 'none' | 'placeholder';
|
|
161
|
+
layoutPolicy?: IEmbedLayoutPolicies;
|
|
162
|
+
createRibbonOverride?: (context: IEmbedProductRibbonOverrideContext) => IEmbedProductRibbonOverride | undefined;
|
|
163
|
+
}
|
|
164
|
+
export declare enum EmbedHostChromeMode {
|
|
165
|
+
RIBBON = "ribbon",
|
|
166
|
+
TITLE_ONLY = "title-only",
|
|
167
|
+
NONE = "none"
|
|
168
|
+
}
|
|
169
|
+
export type EmbedFloatingStage = 'inactive' | 'stage1' | 'stage2';
|
|
170
|
+
export type EmbedInteractionFlow = 'floating-stage' | 'doc-block';
|
|
171
|
+
export interface IEmbedFloatingActivation {
|
|
172
|
+
hostUnitId: string;
|
|
173
|
+
embedId: string;
|
|
174
|
+
childUnitId: string;
|
|
175
|
+
stage?: EmbedFloatingStage;
|
|
176
|
+
}
|
|
177
|
+
export interface IEmbedFloatingMenuMountContext extends IEmbedChildContainerContext {
|
|
178
|
+
active: IEmbedFloatingActivation | null;
|
|
179
|
+
}
|
|
180
|
+
export interface IEmbedFloatingMenuContribution {
|
|
181
|
+
hostType: UniverInstanceType;
|
|
182
|
+
entry: EmbedHostEntry;
|
|
183
|
+
childType?: UniverInstanceType;
|
|
184
|
+
mount: (context: IEmbedFloatingMenuMountContext) => IDisposable | void;
|
|
185
|
+
}
|
|
186
|
+
export interface IEmbedPassiveViewportWheelContext extends IEmbedChildContainerContext {
|
|
187
|
+
event: WheelEvent;
|
|
188
|
+
stage: EmbedFloatingStage;
|
|
189
|
+
source?: 'wheel' | 'host-scroll-sync';
|
|
190
|
+
viewportScrollX?: number;
|
|
191
|
+
viewportScrollY?: number;
|
|
192
|
+
}
|
|
193
|
+
export interface IEmbedPassiveViewportProvider {
|
|
194
|
+
childType: UniverInstanceType;
|
|
195
|
+
supportedLayouts?: EmbedLayout[];
|
|
196
|
+
handleWheel: (context: IEmbedPassiveViewportWheelContext) => boolean | void;
|
|
197
|
+
}
|
|
198
|
+
export interface IEmbedPassiveWheelHandlerContribution {
|
|
199
|
+
childType: UniverInstanceType;
|
|
200
|
+
order?: number;
|
|
201
|
+
supportedLayouts?: EmbedLayout[];
|
|
202
|
+
handleWheel: (context: IEmbedPassiveViewportWheelContext) => boolean | void;
|
|
203
|
+
}
|
|
204
|
+
export interface IEmbedContentSize {
|
|
205
|
+
height?: number;
|
|
206
|
+
width?: number;
|
|
207
|
+
}
|
|
208
|
+
export interface IEmbedContentSizeMeasureContext {
|
|
209
|
+
childType: UniverInstanceType;
|
|
210
|
+
childUnit?: unknown;
|
|
211
|
+
childUnitId: string;
|
|
212
|
+
viewportWidth?: number;
|
|
213
|
+
}
|
|
214
|
+
export interface IEmbedContentSizeProvider {
|
|
215
|
+
childType: UniverInstanceType;
|
|
216
|
+
measureContentSize: (context: IEmbedContentSizeMeasureContext) => IEmbedContentSize | undefined;
|
|
217
|
+
}
|
|
218
|
+
export interface IEmbedFullscreenSession {
|
|
219
|
+
hostUnitId: string;
|
|
220
|
+
embedId: string;
|
|
221
|
+
childUnitId: string;
|
|
222
|
+
childType: UniverInstanceType;
|
|
223
|
+
entry: EmbedHostEntry;
|
|
224
|
+
layout: EmbedLayout;
|
|
225
|
+
}
|
|
226
|
+
export interface IEmbedHostMenuOverride {
|
|
227
|
+
hostUnitId: string;
|
|
228
|
+
embedId: string;
|
|
229
|
+
childUnitId: string;
|
|
230
|
+
childType: UniverInstanceType;
|
|
231
|
+
entry: EmbedHostEntry;
|
|
232
|
+
reason: 'tab-active';
|
|
233
|
+
portalContainer?: HTMLElement | null;
|
|
234
|
+
hideHostFxBar?: boolean;
|
|
235
|
+
lockHostRibbon?: boolean;
|
|
236
|
+
}
|
|
237
|
+
export interface IEmbedMountSession {
|
|
238
|
+
hostUnitId: string;
|
|
239
|
+
embedId: string;
|
|
240
|
+
childUnitId: string;
|
|
241
|
+
childType: UniverInstanceType;
|
|
242
|
+
entry: EmbedHostEntry;
|
|
243
|
+
layout: EmbedLayout;
|
|
244
|
+
hostElement?: HTMLElement;
|
|
245
|
+
context?: IEmbedChildContainerContext;
|
|
246
|
+
}
|
|
247
|
+
export type EmbedFloatPreviewStatus = 'pending' | 'ready' | 'error' | 'stale';
|
|
248
|
+
export type EmbedFloatPreviewReason = 'initial' | 'stage-exit' | 'resize' | 'content-change' | 'manual';
|
|
249
|
+
export type EmbedFloatPreviewInvalidationReason = 'model-change' | 'view-state-change' | 'resize' | 'theme-change' | 'locale-change' | 'dispose';
|
|
250
|
+
export type EmbedFloatPreviewRenderResult = string | HTMLCanvasElement | ImageBitmap;
|
|
251
|
+
export interface IEmbedFloatPreviewEntry<TViewState = unknown> {
|
|
252
|
+
embedId: string;
|
|
253
|
+
childUnitId: string;
|
|
254
|
+
childType: UniverInstanceType;
|
|
255
|
+
status: EmbedFloatPreviewStatus;
|
|
256
|
+
image?: EmbedFloatPreviewRenderResult;
|
|
257
|
+
width: number;
|
|
258
|
+
height: number;
|
|
259
|
+
dpr: number;
|
|
260
|
+
viewState?: TViewState;
|
|
261
|
+
revision: number;
|
|
262
|
+
updatedAt: number;
|
|
263
|
+
error?: unknown;
|
|
264
|
+
}
|
|
265
|
+
export interface IEmbedFloatPreviewRenderRequest<TViewState = unknown> {
|
|
266
|
+
descriptor: IEmbedDescriptor;
|
|
267
|
+
childUnitId: string;
|
|
268
|
+
childType: UniverInstanceType;
|
|
269
|
+
width: number;
|
|
270
|
+
height: number;
|
|
271
|
+
dpr: number;
|
|
272
|
+
viewState?: TViewState;
|
|
273
|
+
reason: EmbedFloatPreviewReason;
|
|
274
|
+
context?: IEmbedChildContainerContext;
|
|
275
|
+
}
|
|
276
|
+
export interface IEmbedFloatPreviewInvalidationContext {
|
|
277
|
+
descriptor: IEmbedDescriptor;
|
|
278
|
+
childUnitId: string;
|
|
279
|
+
childType: UniverInstanceType;
|
|
280
|
+
reason: EmbedFloatPreviewInvalidationReason;
|
|
281
|
+
}
|
|
282
|
+
export interface IEmbedFloatPreviewProvider<TViewState = unknown> {
|
|
283
|
+
childType: UniverInstanceType;
|
|
284
|
+
collectViewState: (context: IEmbedChildContainerContext) => TViewState | Promise<TViewState>;
|
|
285
|
+
restoreViewState: (context: IEmbedChildContainerContext, state: TViewState) => void | Promise<void>;
|
|
286
|
+
renderPreview: (request: IEmbedFloatPreviewRenderRequest<TViewState>) => EmbedFloatPreviewRenderResult | null | undefined | Promise<EmbedFloatPreviewRenderResult | null | undefined>;
|
|
287
|
+
invalidateKeys?: (context: IEmbedFloatPreviewInvalidationContext) => string[];
|
|
288
|
+
}
|
|
289
|
+
export interface IEmbedReadonlyPreviewRoots {
|
|
290
|
+
root: HTMLElement;
|
|
291
|
+
content: HTMLElement;
|
|
292
|
+
canvas?: HTMLElement;
|
|
293
|
+
}
|
|
294
|
+
export interface IEmbedReadonlyPreviewContext<TViewState = unknown> extends IEmbedContainerContext {
|
|
295
|
+
roots: IEmbedReadonlyPreviewRoots;
|
|
296
|
+
viewState?: TViewState;
|
|
297
|
+
updateViewState: (viewState: TViewState) => void;
|
|
298
|
+
}
|
|
299
|
+
export interface IEmbedReadonlyPreviewWheelContext<TViewState = unknown> extends IEmbedReadonlyPreviewContext<TViewState> {
|
|
300
|
+
event: WheelEvent;
|
|
301
|
+
}
|
|
302
|
+
export interface IEmbedReadonlyPreviewProvider<TViewState = unknown> {
|
|
303
|
+
childType: UniverInstanceType;
|
|
304
|
+
supportedLayouts?: EmbedLayout[];
|
|
305
|
+
mount?: (context: IEmbedReadonlyPreviewContext<TViewState>) => IDisposable | void;
|
|
306
|
+
handleWheel?: (context: IEmbedReadonlyPreviewWheelContext<TViewState>) => boolean | void | Promise<boolean | void>;
|
|
307
|
+
}
|