@univerjs-pro/embed-ui 1.0.0-alpha.6 → 1.0.0-alpha.7

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.
Files changed (89) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/cjs/locale/ar-SA.js +1 -1
  3. package/lib/cjs/locale/ca-ES.js +1 -1
  4. package/lib/cjs/locale/de-DE.js +1 -1
  5. package/lib/cjs/locale/en-US.js +1 -1
  6. package/lib/cjs/locale/es-ES.js +1 -1
  7. package/lib/cjs/locale/fa-IR.js +1 -1
  8. package/lib/cjs/locale/fr-FR.js +1 -1
  9. package/lib/cjs/locale/id-ID.js +1 -1
  10. package/lib/cjs/locale/it-IT.js +1 -1
  11. package/lib/cjs/locale/ja-JP.js +1 -1
  12. package/lib/cjs/locale/ko-KR.js +1 -1
  13. package/lib/cjs/locale/pl-PL.js +1 -1
  14. package/lib/cjs/locale/pt-BR.js +1 -1
  15. package/lib/cjs/locale/ru-RU.js +1 -1
  16. package/lib/cjs/locale/sk-SK.js +1 -1
  17. package/lib/cjs/locale/vi-VN.js +1 -1
  18. package/lib/cjs/locale/zh-CN.js +1 -1
  19. package/lib/cjs/locale/zh-HK.js +1 -1
  20. package/lib/cjs/locale/zh-TW.js +1 -1
  21. package/lib/es/index.js +1 -1
  22. package/lib/es/locale/ar-SA.js +1 -1
  23. package/lib/es/locale/ca-ES.js +1 -1
  24. package/lib/es/locale/de-DE.js +1 -1
  25. package/lib/es/locale/en-US.js +1 -1
  26. package/lib/es/locale/es-ES.js +1 -1
  27. package/lib/es/locale/fa-IR.js +1 -1
  28. package/lib/es/locale/fr-FR.js +1 -1
  29. package/lib/es/locale/id-ID.js +1 -1
  30. package/lib/es/locale/it-IT.js +1 -1
  31. package/lib/es/locale/ja-JP.js +1 -1
  32. package/lib/es/locale/ko-KR.js +1 -1
  33. package/lib/es/locale/pl-PL.js +1 -1
  34. package/lib/es/locale/pt-BR.js +1 -1
  35. package/lib/es/locale/ru-RU.js +1 -1
  36. package/lib/es/locale/sk-SK.js +1 -1
  37. package/lib/es/locale/vi-VN.js +1 -1
  38. package/lib/es/locale/zh-CN.js +1 -1
  39. package/lib/es/locale/zh-HK.js +1 -1
  40. package/lib/es/locale/zh-TW.js +1 -1
  41. package/lib/index.js +1 -1
  42. package/lib/locale/ar-SA.js +1 -1
  43. package/lib/locale/ca-ES.js +1 -1
  44. package/lib/locale/de-DE.js +1 -1
  45. package/lib/locale/en-US.js +1 -1
  46. package/lib/locale/es-ES.js +1 -1
  47. package/lib/locale/fa-IR.js +1 -1
  48. package/lib/locale/fr-FR.js +1 -1
  49. package/lib/locale/id-ID.js +1 -1
  50. package/lib/locale/it-IT.js +1 -1
  51. package/lib/locale/ja-JP.js +1 -1
  52. package/lib/locale/ko-KR.js +1 -1
  53. package/lib/locale/pl-PL.js +1 -1
  54. package/lib/locale/pt-BR.js +1 -1
  55. package/lib/locale/ru-RU.js +1 -1
  56. package/lib/locale/sk-SK.js +1 -1
  57. package/lib/locale/vi-VN.js +1 -1
  58. package/lib/locale/zh-CN.js +1 -1
  59. package/lib/locale/zh-HK.js +1 -1
  60. package/lib/locale/zh-TW.js +1 -1
  61. package/lib/types/components/EmbedFloatDomRenderer.d.ts +4 -0
  62. package/lib/types/components/EmbedRuntimeProviders.d.ts +1 -0
  63. package/lib/types/products/docs/EmbedDocsCustomBlockRenderer.d.ts +0 -6
  64. package/lib/types/products/docs/docs-custom-block-layout.d.ts +5 -0
  65. package/lib/types/services/embed-activation.service.d.ts +4 -5
  66. package/lib/types/services/embed-floating-menu-root.d.ts +1 -1
  67. package/lib/types/services/embed-runtime-focus-coordinator.service.d.ts +1 -0
  68. package/lib/types/services/embed-runtime-scope-dom.d.ts +2 -1
  69. package/lib/umd/index.js +1 -1
  70. package/lib/umd/locale/ar-SA.js +1 -1
  71. package/lib/umd/locale/ca-ES.js +1 -1
  72. package/lib/umd/locale/de-DE.js +1 -1
  73. package/lib/umd/locale/en-US.js +1 -1
  74. package/lib/umd/locale/es-ES.js +1 -1
  75. package/lib/umd/locale/fa-IR.js +1 -1
  76. package/lib/umd/locale/fr-FR.js +1 -1
  77. package/lib/umd/locale/id-ID.js +1 -1
  78. package/lib/umd/locale/it-IT.js +1 -1
  79. package/lib/umd/locale/ja-JP.js +1 -1
  80. package/lib/umd/locale/ko-KR.js +1 -1
  81. package/lib/umd/locale/pl-PL.js +1 -1
  82. package/lib/umd/locale/pt-BR.js +1 -1
  83. package/lib/umd/locale/ru-RU.js +1 -1
  84. package/lib/umd/locale/sk-SK.js +1 -1
  85. package/lib/umd/locale/vi-VN.js +1 -1
  86. package/lib/umd/locale/zh-CN.js +1 -1
  87. package/lib/umd/locale/zh-HK.js +1 -1
  88. package/lib/umd/locale/zh-TW.js +1 -1
  89. package/package.json +34 -34
@@ -1,6 +1,9 @@
1
+ import type { IDisposable } from '@univerjs/core';
1
2
  import type { Observable } from 'rxjs';
2
3
  import type { EmbedFloatingStage, EmbedInteractionFlow, IEmbedChildContainerContext } from '../types/embed-ui';
3
4
  import { UniverInstanceType } from '@univerjs/core';
5
+ import { ILayoutService } from '@univerjs/ui';
6
+ import { EmbedRuntimeFocusCoordinator } from '../services/embed-runtime-focus-coordinator.service';
4
7
  export declare const EMBED_FLOAT_DRAG_HANDLE_POINTER_DOWN_EVENT = "univer:embed-float-drag-handle:pointerdown";
5
8
  export interface IEmbedFloatDragHandlePointerDownDetail {
6
9
  embedId: string;
@@ -56,6 +59,7 @@ export declare function syncRuntimeInteractionVisibility(container: HTMLElement,
56
59
  export declare function syncChromeControlsVisibility(container: HTMLElement, chrome: HTMLElement | undefined, visible: boolean, dragHandleVisible: boolean, stage: 'inactive' | 'stage1' | 'stage2'): void;
57
60
  export declare function syncDocsSheetLikeChromePageArea(chrome: HTMLElement, chromeRect: DOMRect, pageRect: DOMRect): void;
58
61
  export declare function resolveChromeAnchorRect(container: HTMLElement): DOMRect;
62
+ export declare function registerEmbedStage2LayoutContainers(layoutService: Pick<ILayoutService, 'checkElementInCurrentContainers' | 'registerContainerElement'>, focusCoordinator: Pick<EmbedRuntimeFocusCoordinator, 'listElements' | 'runtimeFocusChanged$'>, embedId: string | undefined, container: HTMLElement | null, stage: EmbedFloatingStage): IDisposable | undefined;
59
63
  export declare function shouldAcquireOwnedInteractionPointerLease(options: {
60
64
  stage: EmbedFloatingStage;
61
65
  target: EventTarget | null;
@@ -7,3 +7,4 @@ export interface IEmbedRuntimeProvidersProps {
7
7
  embedId?: string;
8
8
  }
9
9
  export declare function EmbedRuntimeProviders(props: IEmbedRuntimeProvidersProps): import("react").JSX.Element;
10
+ export declare function focusEmbedRuntimePointerTarget(embedId: string, runtimeProvider: HTMLElement, target: EventTarget | null): void;
@@ -26,13 +26,7 @@ export declare function createDocsTableLikeCustomBlockStage2WheelHandler(options
26
26
  export declare function resolveDocsTableLikeCustomBlockRuntimeContentHeight(authoritativeContentHeight: number | undefined): number;
27
27
  export declare function resolveDocsCustomBlockRuntimeViewportHeight(params: {
28
28
  contentHeight: number;
29
- sheetLike: boolean;
30
29
  viewportHeight?: number;
31
30
  }): number;
32
- export declare function resolveDocsCustomBlockRuntimeOuterHeight(params: {
33
- contentHeight: number;
34
- menuInsetTop: number;
35
- sheetLike: boolean;
36
- }): number;
37
31
  export declare function resolveDocsTableLikeCustomBlockRuntimeContentWidth(authoritativeContentWidth: number | undefined, measureFallback: () => number): number;
38
32
  export declare function shouldSyncDocsTableLikeCustomBlockBleedOnScroll(root: HTMLElement, target: EventTarget | null): boolean;
@@ -0,0 +1,5 @@
1
+ export declare const DOCS_CUSTOM_BLOCK_FLOATING_MENU_INSET_TOP = 52;
2
+ export declare function resolveDocsCustomBlockLayoutHeight(params: {
3
+ contentHeight: number;
4
+ tableLike: boolean;
5
+ }): number;
@@ -1,7 +1,7 @@
1
1
  import type { IEmbedDescriptor } from '@univerjs-pro/embed';
2
2
  import type { IEmbedHostMenuOverride } from '../types/embed-ui';
3
3
  import { EmbedFocusOwnerService, EmbedHostAdapterRegistryService } from '@univerjs-pro/embed';
4
- import { IContextService, IUniverInstanceService } from '@univerjs/core';
4
+ import { Disposable, IContextService, IUniverInstanceService } from '@univerjs/core';
5
5
  import { ILayoutService } from '@univerjs/ui';
6
6
  import { EmbedBlockRegistryService } from './embed-block-registry.service';
7
7
  import { EmbedFloatingActiveService } from './embed-floating-active.service';
@@ -10,7 +10,7 @@ import { EmbedMountService } from './embed-mount.service';
10
10
  export interface IEmbedFloatingActivationOptions {
11
11
  portalContainer?: HTMLElement | null;
12
12
  }
13
- export declare class EmbedActivationService {
13
+ export declare class EmbedActivationService extends Disposable {
14
14
  private readonly _univerInstanceService;
15
15
  private readonly _focusOwnerService;
16
16
  private readonly _hostAdapterRegistry;
@@ -21,7 +21,6 @@ export declare class EmbedActivationService {
21
21
  private readonly _contextService;
22
22
  private readonly _layoutService;
23
23
  private readonly _previousChildCurrentUnits;
24
- private readonly _floatingHostFocusRestorers;
25
24
  constructor(_univerInstanceService: IUniverInstanceService, _focusOwnerService: EmbedFocusOwnerService, _hostAdapterRegistry: EmbedHostAdapterRegistryService, _menuOverrideService: EmbedHostMenuOverrideService, _mountService: EmbedMountService, _blockRegistry: EmbedBlockRegistryService, _floatingActiveService: EmbedFloatingActiveService, _contextService: IContextService, _layoutService: ILayoutService);
26
25
  activateTab(descriptor: IEmbedDescriptor): IEmbedHostMenuOverride | null;
27
26
  activateFloating(descriptor: IEmbedDescriptor, stage?: 'stage1' | 'stage2', _options?: IEmbedFloatingActivationOptions): void;
@@ -36,9 +35,9 @@ export declare class EmbedActivationService {
36
35
  private _hasUnit;
37
36
  private _findFallbackUnitId;
38
37
  private _focusUnit;
38
+ private _restoreStage2ChildFocusWhenHostRefocuses;
39
+ private _scheduleFloatingChildFocus;
39
40
  private _setCurrentUnitForType;
40
41
  private _focusLayout;
41
- private _preserveHostGlobalFocusForFloating;
42
- private _releaseFloatingHostFocusRestorers;
43
42
  private _assertResolvedChild;
44
43
  }
@@ -1,2 +1,2 @@
1
1
  import type { IEmbedFloatingMenuMountContext } from '../types/embed-ui';
2
- export declare function resolveEmbedFloatingMenuRoot(context: Pick<IEmbedFloatingMenuMountContext, 'renderScope' | 'runtimeScope'>): HTMLElement;
2
+ export declare function resolveEmbedFloatingMenuRoot(context: Pick<IEmbedFloatingMenuMountContext, 'embedId' | 'renderScope' | 'runtimeScope'>): HTMLElement;
@@ -50,6 +50,7 @@ export declare class EmbedRuntimeFocusCoordinator {
50
50
  isChildUnitRuntimeEvent(unitId: string | undefined, target: EventTarget | null | undefined, event?: Event): boolean;
51
51
  shouldSuppressHostInteraction(unitId: string | undefined, target?: EventTarget | null, event?: Event, options?: IEmbedRuntimeFocusLeaseQueryOptions): boolean;
52
52
  registerElement(options: IEmbedRuntimeFocusElementRegistration): IDisposable;
53
+ listElements(embedId: string | undefined): HTMLElement[];
53
54
  containsElement(embedId: string | undefined, target: EventTarget | null | undefined, event?: Event): boolean;
54
55
  private _containsRegisteredElement;
55
56
  private _isBlockingLease;
@@ -1,9 +1,10 @@
1
1
  import type { UniverInstanceType } from '@univerjs/core';
2
+ import { EMBED_CHILD_UNIT_ID_ATTRIBUTE } from '@univerjs/ui';
2
3
  export declare const EMBED_FLOAT_DOM_ATTRIBUTE = "data-embed-float-dom";
3
4
  export declare const EMBED_ID_ATTRIBUTE = "data-embed-id";
4
5
  export declare const EMBED_HOST_UNIT_ID_ATTRIBUTE = "data-embed-host-unit-id";
5
- export declare const EMBED_CHILD_UNIT_ID_ATTRIBUTE = "data-embed-child-unit-id";
6
6
  export declare const EMBED_CHILD_TYPE_ATTRIBUTE = "data-embed-child-type";
7
+ export { EMBED_CHILD_UNIT_ID_ATTRIBUTE };
7
8
  export interface IEmbedRuntimeDomScope {
8
9
  embedId: string;
9
10
  hostUnitId?: string;