@univerjs-pro/embed-ui 1.0.0-alpha.3 → 1.0.0-alpha.5
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 +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/index.css +8 -39
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/components/EmbedFloatDomRenderer.d.ts +19 -1
- package/lib/types/controllers/components.controller.d.ts +7 -0
- package/lib/types/locale/en-US.d.ts +9 -0
- package/lib/types/products/bases/EmbedFloatingMenu.d.ts +0 -5
- package/lib/types/products/boards/BoardEmbedHostRenderController.d.ts +28 -0
- package/lib/types/products/boards/EmbedChildView.d.ts +2 -0
- package/lib/types/products/boards/EmbedFloatingMenu.d.ts +7 -0
- package/lib/types/products/boards/embed-block.d.ts +2 -0
- package/lib/types/products/boards/embed-host-adapter.d.ts +2 -0
- package/lib/types/products/boards/embed-passive-viewport.d.ts +2 -0
- package/lib/types/products/boards/register.d.ts +2 -0
- package/lib/types/products/docs/EmbedFloatingMenu.d.ts +0 -5
- package/lib/types/products/docs/embed-docs-custom-block-bleed.render-controller.d.ts +4 -4
- package/lib/types/products/sheets/EmbedFloatingMenu.d.ts +0 -7
- package/lib/types/products/slides/components/embed-floating-menu/SlideEmbedFloatingMenu.d.ts +0 -11
- package/lib/types/services/embed-activation.service.d.ts +5 -5
- package/lib/types/services/embed-child-product-plugin-registry.service.d.ts +2 -2
- package/lib/types/services/embed-host-wheel-gesture.service.d.ts +8 -0
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +34 -32
|
@@ -2,6 +2,15 @@ import type { Observable } from 'rxjs';
|
|
|
2
2
|
import type { EmbedFloatingStage, EmbedInteractionFlow, IEmbedChildContainerContext } from '../types/embed-ui';
|
|
3
3
|
import { UniverInstanceType } from '@univerjs/core';
|
|
4
4
|
export declare const EMBED_FLOAT_DRAG_HANDLE_POINTER_DOWN_EVENT = "univer:embed-float-drag-handle:pointerdown";
|
|
5
|
+
export interface IEmbedFloatDragHandlePointerDownDetail {
|
|
6
|
+
embedId: string;
|
|
7
|
+
hostUnitId: string;
|
|
8
|
+
hostAnchorId: string;
|
|
9
|
+
pointerId?: number;
|
|
10
|
+
clientX: number;
|
|
11
|
+
clientY: number;
|
|
12
|
+
button?: number;
|
|
13
|
+
}
|
|
5
14
|
export interface IEmbedFloatDomData {
|
|
6
15
|
version: 1;
|
|
7
16
|
embedId: string;
|
|
@@ -30,12 +39,21 @@ export declare function EmbedFloatDomRenderer(props: {
|
|
|
30
39
|
onHostWheel?: (event: WheelEvent, context: IEmbedChildContainerContext) => boolean | void;
|
|
31
40
|
onRuntimeStageEnter?: (stage: EmbedFloatingStage) => void;
|
|
32
41
|
onRuntimeStageExit?: () => void;
|
|
42
|
+
floatingChromeZIndex?: number;
|
|
33
43
|
syncHostVerticalScroll?: boolean;
|
|
34
44
|
enableStage1BodyDrag?: boolean;
|
|
45
|
+
fullscreenButtonInBlock?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Avoid mounting and measuring body-level floating chrome while the block
|
|
48
|
+
* is inactive. Hosts with an in-block fullscreen affordance can use this
|
|
49
|
+
* to keep viewport movement independent of the number of float blocks.
|
|
50
|
+
*/
|
|
51
|
+
deferInactiveFloatingChrome?: boolean;
|
|
52
|
+
resolveHostWheelGestureRoot?: (container: HTMLElement) => HTMLElement | null | undefined;
|
|
35
53
|
isExternalHostInteraction?: (event: PointerEvent) => boolean;
|
|
36
54
|
}): import("react").JSX.Element;
|
|
37
55
|
export declare function syncRuntimeInteractionVisibility(container: HTMLElement, chrome: HTMLElement | undefined, visible: boolean, _stage: 'inactive' | 'stage1' | 'stage2'): void;
|
|
38
|
-
export declare function syncChromeControlsVisibility(chrome: HTMLElement | undefined, visible: boolean, dragHandleVisible: boolean, stage: 'inactive' | 'stage1' | 'stage2'): void;
|
|
56
|
+
export declare function syncChromeControlsVisibility(container: HTMLElement, chrome: HTMLElement | undefined, visible: boolean, dragHandleVisible: boolean, stage: 'inactive' | 'stage1' | 'stage2'): void;
|
|
39
57
|
export declare function syncDocsSheetLikeChromePageArea(chrome: HTMLElement, chromeRect: DOMRect, pageRect: DOMRect): void;
|
|
40
58
|
export declare function resolveChromeAnchorRect(container: HTMLElement): DOMRect;
|
|
41
59
|
export declare function shouldAcquireOwnedInteractionPointerLease(options: {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
import { ComponentManager } from '@univerjs/ui';
|
|
3
|
+
export declare class ComponentsController extends Disposable {
|
|
4
|
+
private readonly _componentManager;
|
|
5
|
+
constructor(_componentManager: ComponentManager);
|
|
6
|
+
private _registerComponents;
|
|
7
|
+
}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
declare const locale: {
|
|
2
2
|
'embed-ui': {
|
|
3
|
+
deleteBlock: string;
|
|
3
4
|
fullscreen: {
|
|
4
5
|
exit: string;
|
|
5
6
|
};
|
|
7
|
+
boardsFloating: {
|
|
8
|
+
fitContent: string;
|
|
9
|
+
zoomOut: string;
|
|
10
|
+
resetZoom: string;
|
|
11
|
+
zoomIn: string;
|
|
12
|
+
delete: string;
|
|
13
|
+
};
|
|
6
14
|
basesFloating: {
|
|
7
15
|
copySuffix: string;
|
|
8
16
|
delete: string;
|
|
@@ -32,6 +40,7 @@ declare const locale: {
|
|
|
32
40
|
fontSize: string;
|
|
33
41
|
numberFormat: string;
|
|
34
42
|
bold: string;
|
|
43
|
+
filter: string;
|
|
35
44
|
resetColor: string;
|
|
36
45
|
textColor: {
|
|
37
46
|
main: string;
|
|
@@ -11,11 +11,6 @@ export declare function resolveBasesFloatingMenuStage(params: {
|
|
|
11
11
|
usesDomFloatingStage: boolean;
|
|
12
12
|
renderScopeActive: boolean;
|
|
13
13
|
}): 'inactive' | 'stage2';
|
|
14
|
-
export declare function resolveBasesFloatingMenuClassName(params: {
|
|
15
|
-
entry: string;
|
|
16
|
-
fullscreen: boolean;
|
|
17
|
-
stage: 'inactive' | 'stage2';
|
|
18
|
-
}): string;
|
|
19
14
|
export declare function shouldUseBaseFullscreenToolbar(fullscreen: boolean): boolean;
|
|
20
15
|
export declare function shouldUseBaseFullscreenViewTabs(fullscreen: boolean): boolean;
|
|
21
16
|
export declare function shouldShowBaseEmbedRemoveButton(fullscreen: boolean): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BoardModel } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
3
|
+
import { IBoardElementService } from '@univerjs-pro/boards';
|
|
4
|
+
import { BoardDomLayerService, IBoardElementStateService, IBoardUIStateService } from '@univerjs-pro/boards-ui';
|
|
5
|
+
import { EmbedModelService } from '@univerjs-pro/embed';
|
|
6
|
+
import { Disposable, ICommandService, IConfigService } from '@univerjs/core';
|
|
7
|
+
export declare class BoardEmbedHostRenderController extends Disposable implements IRenderModule {
|
|
8
|
+
private readonly _context;
|
|
9
|
+
private readonly _embedModelService;
|
|
10
|
+
private readonly _domLayerService;
|
|
11
|
+
private readonly _boardElementService;
|
|
12
|
+
private readonly _boardElementStateService;
|
|
13
|
+
private readonly _boardUIStateService;
|
|
14
|
+
private readonly _configService;
|
|
15
|
+
private readonly _commandService;
|
|
16
|
+
private readonly _items;
|
|
17
|
+
private _activeDragCleanup;
|
|
18
|
+
constructor(_context: IRenderContext<BoardModel>, _embedModelService: EmbedModelService, _domLayerService: BoardDomLayerService, _boardElementService: IBoardElementService, _boardElementStateService: IBoardElementStateService, _boardUIStateService: IBoardUIStateService, _configService: IConfigService, _commandService: ICommandService);
|
|
19
|
+
dispose(): void;
|
|
20
|
+
private _sync;
|
|
21
|
+
private _itemId;
|
|
22
|
+
private readonly _routeWheelToHost;
|
|
23
|
+
private readonly _resolveHostWheelGestureRoot;
|
|
24
|
+
private _selectAnchor;
|
|
25
|
+
private _setAnchorTransformerVisible;
|
|
26
|
+
private _handleDragStart;
|
|
27
|
+
private _clearItems;
|
|
28
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EmbedFloatingStage, IEmbedFloatingActivation, IEmbedFloatingMenuContribution } from '../../types/embed-ui';
|
|
2
|
+
export declare function createBoardsFloatingMenuContributions(): IEmbedFloatingMenuContribution[];
|
|
3
|
+
export declare function resolveBoardsFloatingMenuStage(params: {
|
|
4
|
+
embedId: string;
|
|
5
|
+
active: IEmbedFloatingActivation | null;
|
|
6
|
+
fullscreen: boolean;
|
|
7
|
+
}): EmbedFloatingStage;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
import type { IEmbedFloatingMenuContribution } from '../../types/embed-ui';
|
|
2
2
|
export declare function createDocsFloatingMenuContributions(): IEmbedFloatingMenuContribution[];
|
|
3
|
-
export declare function resolveDocsFloatingMenuClassName(params: {
|
|
4
|
-
entry: string;
|
|
5
|
-
fullscreen: boolean;
|
|
6
|
-
stage: 'inactive' | 'stage2';
|
|
7
|
-
}): string;
|
|
@@ -8,12 +8,12 @@ export declare class EmbedDocsCustomBlockBleedRenderController extends Disposabl
|
|
|
8
8
|
private readonly _context;
|
|
9
9
|
private readonly _univerInstanceService;
|
|
10
10
|
private readonly _commandService;
|
|
11
|
-
private readonly _contentSizeRegistry
|
|
12
|
-
private readonly _embedModelService
|
|
13
|
-
private readonly _renderManagerService
|
|
11
|
+
private readonly _contentSizeRegistry;
|
|
12
|
+
private readonly _embedModelService;
|
|
13
|
+
private readonly _renderManagerService;
|
|
14
14
|
private readonly _resolvedChildUnits;
|
|
15
15
|
private readonly _pendingChildUnits;
|
|
16
|
-
constructor(_context: IRenderContext<DocumentDataModel>, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _contentSizeRegistry
|
|
16
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _contentSizeRegistry: EmbedContentSizeRegistryService, _embedModelService: EmbedModelService, _renderManagerService: IRenderManagerService);
|
|
17
17
|
private _getHostUnit;
|
|
18
18
|
private _getHostSnapshot;
|
|
19
19
|
private _rerenderHostDoc;
|
|
@@ -2,7 +2,6 @@ import type { IMenuItem, IMenuSchema, IValueOption } from '@univerjs/ui';
|
|
|
2
2
|
import type { IEmbedFloatingMenuContribution } from '../../types/embed-ui';
|
|
3
3
|
import { BORDER_LINE_CHILDREN } from '@univerjs/sheets-ui';
|
|
4
4
|
import { FONT_SIZE_LIST } from '@univerjs/ui';
|
|
5
|
-
type SheetFloatingMenuStage = 'inactive' | 'stage2';
|
|
6
5
|
export type SheetFloatingToolbarItem = {
|
|
7
6
|
id: string;
|
|
8
7
|
type: 'button' | 'dropdown';
|
|
@@ -44,14 +43,8 @@ export declare function resolveMenuCommandRequest(item: IMenuItem | undefined, p
|
|
|
44
43
|
} | undefined;
|
|
45
44
|
export declare function createSheetsFloatingMenuContributions(): IEmbedFloatingMenuContribution[];
|
|
46
45
|
export declare function shouldUseSheetsFloatingMenuDomStage(_entry: string): boolean;
|
|
47
|
-
export declare function resolveSheetsFloatingMenuClassName(params: {
|
|
48
|
-
entry: string;
|
|
49
|
-
fullscreen: boolean;
|
|
50
|
-
stage: SheetFloatingMenuStage;
|
|
51
|
-
}): string;
|
|
52
46
|
export declare function isFloatingDropdownOwnSurfaceTarget(target: EventTarget | null, embedId: string): boolean;
|
|
53
47
|
export declare function keepFloatingDropdownOpenForOwnSurface(event: {
|
|
54
48
|
target: EventTarget | null;
|
|
55
49
|
preventDefault: () => void;
|
|
56
50
|
}, embedId: string): void;
|
|
57
|
-
export {};
|
package/lib/types/products/slides/components/embed-floating-menu/SlideEmbedFloatingMenu.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { Observable } from 'rxjs';
|
|
|
4
4
|
import type { EmbedFloatingActiveService } from '../../../../services/embed-floating-active.service';
|
|
5
5
|
export interface ISlideEmbedFloatingMenuProps {
|
|
6
6
|
hostUnitId: string;
|
|
7
|
-
entry: string;
|
|
8
7
|
embedId: string;
|
|
9
8
|
childUnitId: string;
|
|
10
9
|
slideModel: SlideModel | null;
|
|
@@ -15,14 +14,4 @@ export interface ISlideEmbedFloatingMenuProps {
|
|
|
15
14
|
usesDomFloatingStage: boolean;
|
|
16
15
|
renderScopeActive$: Observable<boolean>;
|
|
17
16
|
}
|
|
18
|
-
export declare function createSlideEmbedFloatingMenuClassName(params: {
|
|
19
|
-
entry: string;
|
|
20
|
-
fullscreen: boolean;
|
|
21
|
-
isStage2: boolean;
|
|
22
|
-
}): string;
|
|
23
17
|
export declare function SlideEmbedFloatingMenu(props: ISlideEmbedFloatingMenuProps): import("react").JSX.Element;
|
|
24
|
-
export declare function resolveSlideFloatingMenuClassName(params: {
|
|
25
|
-
entry: string;
|
|
26
|
-
fullscreen: boolean;
|
|
27
|
-
stage: 'inactive' | 'stage2';
|
|
28
|
-
}): string;
|
|
@@ -16,13 +16,13 @@ export declare class EmbedActivationService {
|
|
|
16
16
|
private readonly _hostAdapterRegistry;
|
|
17
17
|
private readonly _menuOverrideService;
|
|
18
18
|
private readonly _mountService;
|
|
19
|
-
private readonly _blockRegistry
|
|
20
|
-
private readonly _floatingActiveService
|
|
21
|
-
private readonly _contextService
|
|
22
|
-
private readonly _layoutService
|
|
19
|
+
private readonly _blockRegistry;
|
|
20
|
+
private readonly _floatingActiveService;
|
|
21
|
+
private readonly _contextService;
|
|
22
|
+
private readonly _layoutService;
|
|
23
23
|
private readonly _previousChildCurrentUnits;
|
|
24
24
|
private readonly _floatingHostFocusRestorers;
|
|
25
|
-
constructor(_univerInstanceService: IUniverInstanceService, _focusOwnerService: EmbedFocusOwnerService, _hostAdapterRegistry: EmbedHostAdapterRegistryService, _menuOverrideService: EmbedHostMenuOverrideService, _mountService: EmbedMountService, _blockRegistry
|
|
25
|
+
constructor(_univerInstanceService: IUniverInstanceService, _focusOwnerService: EmbedFocusOwnerService, _hostAdapterRegistry: EmbedHostAdapterRegistryService, _menuOverrideService: EmbedHostMenuOverrideService, _mountService: EmbedMountService, _blockRegistry: EmbedBlockRegistryService, _floatingActiveService: EmbedFloatingActiveService, _contextService: IContextService, _layoutService: ILayoutService);
|
|
26
26
|
activateTab(descriptor: IEmbedDescriptor): IEmbedHostMenuOverride | null;
|
|
27
27
|
activateFloating(descriptor: IEmbedDescriptor, stage?: 'stage1' | 'stage2', _options?: IEmbedFloatingActivationOptions): void;
|
|
28
28
|
focusFloatingRuntime(descriptor: IEmbedDescriptor, options?: IEmbedFloatingActivationOptions): void;
|
|
@@ -24,10 +24,10 @@ export declare function registerEmbedChildProductPluginContribution(injector: Pi
|
|
|
24
24
|
export declare function flushPendingEmbedChildProductPluginContributions(injector: Pick<Injector, 'get' | 'has'>): void;
|
|
25
25
|
export declare class EmbedChildProductPluginRegistryService {
|
|
26
26
|
private readonly _injector;
|
|
27
|
-
private readonly _focusCoordinator
|
|
27
|
+
private readonly _focusCoordinator;
|
|
28
28
|
private readonly _contributions;
|
|
29
29
|
private _nextIndex;
|
|
30
|
-
constructor(_injector: Injector, _focusCoordinator
|
|
30
|
+
constructor(_injector: Injector, _focusCoordinator: EmbedRuntimeFocusCoordinator);
|
|
31
31
|
register(contribution: IEmbedChildProductPluginContribution): IDisposable;
|
|
32
32
|
getAll(childType: UniverInstanceType): readonly IEmbedChildProductPluginContribution[];
|
|
33
33
|
prepare(options: IEmbedChildProductPluginPrepareOptions): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IDisposable } from '@univerjs/core';
|
|
2
|
+
export declare class EmbedHostWheelGestureService {
|
|
3
|
+
private readonly _sessions;
|
|
4
|
+
private readonly _hostGestureEvents;
|
|
5
|
+
register(root: HTMLElement): IDisposable;
|
|
6
|
+
isHostGesture(event: WheelEvent): boolean;
|
|
7
|
+
private _observeWheel;
|
|
8
|
+
}
|