@univerjs/ui 1.0.0-alpha.1 → 1.0.0-alpha.3

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 (34) hide show
  1. package/lib/cjs/facade.js +2 -0
  2. package/lib/cjs/index.js +657 -268
  3. package/lib/es/facade.js +2 -0
  4. package/lib/es/index.js +648 -269
  5. package/lib/facade.js +2 -0
  6. package/lib/index.css +53 -8
  7. package/lib/index.js +648 -269
  8. package/lib/types/common/menu-hidden-observable.d.ts +2 -1
  9. package/lib/types/facade/f-menu-builder.d.ts +2 -0
  10. package/lib/types/index.d.ts +12 -6
  11. package/lib/types/services/contextmenu/contextmenu.service.d.ts +6 -3
  12. package/lib/types/services/dom/canvas-dom-layer.service.d.ts +52 -1
  13. package/lib/types/services/menu/menu-manager.service.d.ts +1 -0
  14. package/lib/types/services/popup/canvas-popup.service.d.ts +2 -1
  15. package/lib/types/services/ribbon/ribbon-override.service.d.ts +42 -0
  16. package/lib/types/services/runtime-scope/ui-runtime-scope.service.d.ts +32 -0
  17. package/lib/types/services/shortcut/shortcut.service.d.ts +2 -1
  18. package/lib/types/utils/embed-boundary.d.ts +23 -0
  19. package/lib/types/utils/index.d.ts +1 -0
  20. package/lib/types/views/components/context-menu/AnchoredContextMenu.d.ts +4 -0
  21. package/lib/types/views/components/context-menu/ContextMenuPanel.d.ts +4 -0
  22. package/lib/types/views/components/dom/FloatDom.d.ts +11 -0
  23. package/lib/types/views/components/dom/float-dom-layout.d.ts +35 -0
  24. package/lib/types/views/components/ribbon/Ribbon.d.ts +2 -0
  25. package/lib/types/views/components/ribbon/TooltipButtonWrapper.d.ts +6 -1
  26. package/lib/types/views/emoji-picker/emoji-picker-utils.d.ts +1 -1
  27. package/lib/types/views/font-family/FontFamily.d.ts +10 -2
  28. package/lib/types/views/font-family/FontFamilyDropdown.d.ts +32 -0
  29. package/lib/types/views/font-family/FontFamilyItem.d.ts +5 -3
  30. package/lib/types/views/font-family/index.d.ts +6 -2
  31. package/lib/types/views/font-family/{interface.d.ts → use-font-list.d.ts} +6 -9
  32. package/lib/types/views/menu/mobile/MobileMenu.d.ts +2 -0
  33. package/lib/umd/index.js +15 -22
  34. package/package.json +9 -9
@@ -13,7 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IAccessor, UniverInstanceType } from '@univerjs/core';
16
+ import type { IAccessor } from '@univerjs/core';
17
+ import { UniverInstanceType } from '@univerjs/core';
17
18
  import { Observable } from 'rxjs';
18
19
  export declare function getMenuHiddenObservable(accessor: IAccessor, targetUniverType: UniverInstanceType, matchUnitId?: string, needHideUnitId?: string | string[]): Observable<boolean>;
19
20
  export declare function getHeaderFooterMenuHiddenObservable(accessor: IAccessor): Observable<boolean>;
@@ -133,6 +133,7 @@ export declare class FMenu extends FMenuBase {
133
133
  constructor(_item: IFacadeMenuItem, _injector: Injector, _commandService: ICommandService, _menuManagerService: IMenuManagerService);
134
134
  /**
135
135
  * @ignore
136
+ * @returns The generated menu schema.
136
137
  */
137
138
  __getSchema(): {
138
139
  [key: string]: MenuSchemaType;
@@ -223,6 +224,7 @@ export declare class FSubmenu extends FMenuBase {
223
224
  addSeparator(): this;
224
225
  /**
225
226
  * @ignore
227
+ * @returns The generated submenu schema.
226
228
  */
227
229
  __getSchema(): {
228
230
  [key: string]: MenuSchemaType;
@@ -41,8 +41,8 @@ export { ContextMenuService, IContextMenuService } from './services/contextmenu/
41
41
  export type { IContextMenuHandler } from './services/contextmenu/contextmenu.service';
42
42
  export { DesktopDialogService } from './services/dialog/desktop-dialog.service';
43
43
  export { IDialogService } from './services/dialog/dialog.service';
44
- export { CanvasFloatDomService } from './services/dom/canvas-dom-layer.service';
45
- export type { IFloatDom, IFloatDomLayout } from './services/dom/canvas-dom-layer.service';
44
+ export { CanvasFloatDomPreviewService, CanvasFloatDomService } from './services/dom/canvas-dom-layer.service';
45
+ export type { ICanvasFloatDomPreview, ICanvasFloatDomPreviewRequest, IFloatDom, IFloatDomLayout } from './services/dom/canvas-dom-layer.service';
46
46
  export { FontService, IFontService } from './services/font.service';
47
47
  export type { IFontConfig } from './services/font.service';
48
48
  export { DesktopGalleryService } from './services/gallery/desktop-gallery.service';
@@ -67,7 +67,11 @@ export { BuiltInUIPart, IUIPartsService, UIPartsService } from './services/parts
67
67
  export { IPlatformService, PlatformService } from './services/platform/platform.service';
68
68
  export { CanvasPopupService, ICanvasPopupService } from './services/popup/canvas-popup.service';
69
69
  export type { IPopup } from './services/popup/canvas-popup.service';
70
+ export { IRibbonOverrideService, RibbonOverrideService } from './services/ribbon/ribbon-override.service';
71
+ export type { IRibbonOverride } from './services/ribbon/ribbon-override.service';
70
72
  export { DesktopRibbonService, IRibbonService } from './services/ribbon/ribbon.service';
73
+ export { IUIRuntimeScopeService, UIRuntimeScopeService } from './services/runtime-scope/ui-runtime-scope.service';
74
+ export type { IUIRuntimeScope } from './services/runtime-scope/ui-runtime-scope.service';
71
75
  export { KeyCode, MetaKeys } from './services/shortcut/keycode';
72
76
  export { ShortcutPanelService } from './services/shortcut/shortcut-panel.service';
73
77
  export { IShortcutService, ShortcutService } from './services/shortcut/shortcut.service';
@@ -100,10 +104,12 @@ export { ToolbarButton } from './views/components/ribbon/ToolbarButton';
100
104
  export { ToolbarItem } from './views/components/ribbon/ToolbarItem';
101
105
  export { Sidebar } from './views/components/sidebar/Sidebar';
102
106
  export type { ISidebarMethodOptions } from './views/components/sidebar/Sidebar';
103
- export { FontFamily } from './views/font-family/FontFamily';
104
- export { FontFamilyItem } from './views/font-family/FontFamilyItem';
105
- export { FONT_FAMILY_COMPONENT, FONT_FAMILY_ITEM_COMPONENT } from './views/font-family/interface';
106
- export type { IFontFamilyProps } from './views/font-family/interface';
107
+ export { FONT_FAMILY_COMPONENT, FontFamily } from './views/font-family/FontFamily';
108
+ export type { IFontFamilyProps } from './views/font-family/FontFamily';
109
+ export { FontFamilyDropdown } from './views/font-family/FontFamilyDropdown';
110
+ export type { IFontFamilyDropdownProps } from './views/font-family/FontFamilyDropdown';
111
+ export { FONT_FAMILY_ITEM_COMPONENT, FontFamilyItem } from './views/font-family/FontFamilyItem';
112
+ export type { IFontFamilyItemProps } from './views/font-family/FontFamilyItem';
107
113
  export { FontSize } from './views/font-size/FontSize';
108
114
  export { FONT_SIZE_COMPONENT, FONT_SIZE_LIST, HEADING_LIST } from './views/font-size/interface';
109
115
  export * from './views/hooks/index';
@@ -16,9 +16,12 @@
16
16
  import type { IDisposable } from '@univerjs/core';
17
17
  import type { IMouseEvent, IPointerEvent } from '@univerjs/engine-render';
18
18
  import { Disposable } from '@univerjs/core';
19
+ export interface IContextMenuTriggerContext {
20
+ unitId?: string;
21
+ }
19
22
  export interface IContextMenuHandler {
20
23
  /** A callback to open context menu with given position and menu type. */
21
- handleContextMenu(event: IPointerEvent | IMouseEvent, menuType: string): void;
24
+ handleContextMenu(event: IPointerEvent | IMouseEvent, menuType: string, context?: IContextMenuTriggerContext): void;
22
25
  hideContextMenu(): void;
23
26
  get visible(): boolean;
24
27
  }
@@ -27,7 +30,7 @@ export interface IContextMenuService {
27
30
  get visible(): boolean;
28
31
  enable(): void;
29
32
  disable(): void;
30
- triggerContextMenu(event: IPointerEvent | IMouseEvent, menuType: string): void;
33
+ triggerContextMenu(event: IPointerEvent | IMouseEvent, menuType: string, context?: IContextMenuTriggerContext): void;
31
34
  hideContextMenu(): void;
32
35
  registerContextMenuHandler(handler: IContextMenuHandler): IDisposable;
33
36
  }
@@ -38,7 +41,7 @@ export declare class ContextMenuService extends Disposable implements IContextMe
38
41
  get visible(): boolean;
39
42
  disable(): void;
40
43
  enable(): void;
41
- triggerContextMenu(event: IPointerEvent | IMouseEvent, menuType: string): void;
44
+ triggerContextMenu(event: IPointerEvent | IMouseEvent, menuType: string, context?: IContextMenuTriggerContext): void;
42
45
  hideContextMenu(): void;
43
46
  registerContextMenuHandler(handler: IContextMenuHandler): IDisposable;
44
47
  }
@@ -15,6 +15,8 @@
15
15
  */
16
16
  import type { IPosition, Serializable } from '@univerjs/core';
17
17
  import type { Observable } from 'rxjs';
18
+ import { Disposable } from '@univerjs/core';
19
+ import { Subject } from 'rxjs';
18
20
  export interface IFloatDomLayout extends IPosition {
19
21
  rotate: number;
20
22
  width: number;
@@ -25,11 +27,34 @@ export interface IFloatDomLayout extends IPosition {
25
27
  };
26
28
  opacity?: number;
27
29
  }
30
+ export interface IFloatDomContentBoxConfig {
31
+ /** Amount subtracted from the visible wrapper width and height. @default 2 */
32
+ wrapperInset?: number;
33
+ /** Amount subtracted from the content width and height. @default 4 */
34
+ contentInset?: number;
35
+ }
28
36
  export interface IFloatDom {
29
37
  position$: Observable<IFloatDomLayout>;
30
38
  id: string;
31
39
  domId?: string;
32
40
  componentKey: string | React.ComponentType;
41
+ /**
42
+ * Whether pointer and wheel events inside the floating DOM should be
43
+ * forwarded back to the host canvas. Existing canvas-owned float DOMs keep
44
+ * forwarding by default; interactive embed runtimes can opt out.
45
+ */
46
+ eventPassThrough?: boolean;
47
+ /**
48
+ * Keep rendering this host-owned layer even when focus temporarily moves
49
+ * into a child runtime unit. Interactive embed float blocks need this so
50
+ * their DOM portal is not filtered out when the child handles focus.
51
+ */
52
+ preserveOnFocusChange?: boolean;
53
+ /**
54
+ * Insets subtracted from FloatDom's wrapper and content dimensions.
55
+ * Omitted values preserve the historical wrapper/content insets of 2/4.
56
+ */
57
+ contentBox?: IFloatDomContentBoxConfig;
33
58
  onPointerMove: (evt: PointerEvent | MouseEvent) => void;
34
59
  onPointerDown: (evt: PointerEvent | MouseEvent) => void;
35
60
  onPointerUp: (evt: PointerEvent | MouseEvent) => void;
@@ -38,7 +63,9 @@ export interface IFloatDom {
38
63
  data?: Serializable;
39
64
  unitId: string;
40
65
  }
41
- export declare class CanvasFloatDomService {
66
+ export declare function shouldForwardFloatDomEvents(layer: Pick<IFloatDom, 'eventPassThrough'>): boolean;
67
+ export declare function shouldRenderFloatDomLayer(layer: Pick<IFloatDom, 'unitId' | 'preserveOnFocusChange'>, currentUnitId: string | null | undefined): boolean;
68
+ export declare class CanvasFloatDomService extends Disposable {
42
69
  private _domLayerMap;
43
70
  private _domLayers$;
44
71
  domLayers$: Observable<[string, IFloatDom][]>;
@@ -48,4 +75,28 @@ export declare class CanvasFloatDomService {
48
75
  addFloatDom(item: IFloatDom): void;
49
76
  removeFloatDom(id: string): void;
50
77
  removeAll(): void;
78
+ dispose(): void;
79
+ }
80
+ export interface ICanvasFloatDomPreview {
81
+ id: string;
82
+ image: string;
83
+ updatedAt: number;
84
+ }
85
+ export interface ICanvasFloatDomPreviewRequest {
86
+ id: string;
87
+ width: number;
88
+ height: number;
89
+ data?: unknown;
90
+ }
91
+ export declare class CanvasFloatDomPreviewService extends Disposable {
92
+ readonly previewUpdated$: Subject<ICanvasFloatDomPreview>;
93
+ readonly previewRequested$: Subject<ICanvasFloatDomPreviewRequest>;
94
+ private readonly _previewMap;
95
+ private readonly _requestMap;
96
+ getPreview(id: string): ICanvasFloatDomPreview | undefined;
97
+ getPendingRequests(): ICanvasFloatDomPreviewRequest[];
98
+ setPreview(preview: ICanvasFloatDomPreview): void;
99
+ removePreview(id: string): void;
100
+ requestPreview(request: ICanvasFloatDomPreviewRequest): void;
101
+ dispose(): void;
51
102
  }
@@ -69,6 +69,7 @@ export declare class MenuManagerService extends Disposable implements IMenuManag
69
69
  */
70
70
  mergeMenu(source: MenuSchemaType, target?: MenuSchemaType): void;
71
71
  appendRootMenu(source: MenuSchemaType): void;
72
+ createScoped(injector: Injector): IMenuManagerService;
72
73
  private _buildMenuSchema;
73
74
  /**
74
75
  * Get menu schema by position key
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { Nullable } from '@univerjs/core';
16
+ import type { Injector, Nullable } from '@univerjs/core';
17
17
  import type { IBoundRectNoAngle } from '@univerjs/engine-render';
18
18
  import type { Observable } from 'rxjs';
19
19
  import type { IRectPopupProps } from '../../views/components/popup/RectPopup';
@@ -24,6 +24,7 @@ export interface IPopup<T = Record<string, unknown>> extends Omit<IRectPopupProp
24
24
  excludeRects$?: Observable<IBoundRectNoAngle[]>;
25
25
  excludeRects?: Nullable<IBoundRectNoAngle[]>;
26
26
  componentKey: string;
27
+ connectorInjector?: Injector;
27
28
  unitId: string;
28
29
  subUnitId: string;
29
30
  offset?: [number, number];
@@ -0,0 +1,42 @@
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
+ import type { Observable } from 'rxjs';
18
+ import type { IRibbonService } from './ribbon.service';
19
+ import { Disposable } from '@univerjs/core';
20
+ export interface IRibbonOverride {
21
+ id: string;
22
+ ribbonService: IRibbonService;
23
+ injector?: Pick<Injector, 'get' | 'has' | 'invoke'>;
24
+ portalContainer?: HTMLElement | null;
25
+ placeholderTitle?: string;
26
+ hideToolbar?: boolean;
27
+ }
28
+ export interface IRibbonOverrideService {
29
+ readonly override$: Observable<IRibbonOverride | null>;
30
+ getOverride(): IRibbonOverride | null;
31
+ activate(override: IRibbonOverride): void;
32
+ clear(id?: string): void;
33
+ }
34
+ export declare const IRibbonOverrideService: import("@wendellhu/redi").IdentifierDecorator<IRibbonOverrideService>;
35
+ export declare class RibbonOverrideService extends Disposable implements IRibbonOverrideService {
36
+ private readonly _override$;
37
+ readonly override$: Observable<IRibbonOverride | null>;
38
+ getOverride(): IRibbonOverride | null;
39
+ activate(override: IRibbonOverride): void;
40
+ clear(id?: string): void;
41
+ dispose(): void;
42
+ }
@@ -0,0 +1,32 @@
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 { IDisposable } from '@univerjs/core';
17
+ import { Disposable } from '@univerjs/core';
18
+ export interface IUIRuntimeScope {
19
+ unitId: string;
20
+ has(identifier: unknown): boolean;
21
+ get<T = unknown>(identifier: unknown): T;
22
+ }
23
+ export interface IUIRuntimeScopeService {
24
+ register(scope: IUIRuntimeScope): IDisposable;
25
+ get(unitId: string | null | undefined): IUIRuntimeScope | undefined;
26
+ }
27
+ export declare const IUIRuntimeScopeService: import("@wendellhu/redi").IdentifierDecorator<IUIRuntimeScopeService>;
28
+ export declare class UIRuntimeScopeService extends Disposable implements IUIRuntimeScopeService {
29
+ private readonly _scopes;
30
+ register(scope: IUIRuntimeScope): IDisposable;
31
+ get(unitId: string | null | undefined): IUIRuntimeScope | undefined;
32
+ }
@@ -15,10 +15,10 @@
15
15
  */
16
16
  import type { IDisposable } from '@univerjs/core';
17
17
  import type { Observable } from 'rxjs';
18
- import type { KeyCode } from './keycode';
19
18
  import { Disposable, ICommandService, IContextService } from '@univerjs/core';
20
19
  import { ILayoutService } from '../layout/layout.service';
21
20
  import { IPlatformService } from '../platform/platform.service';
21
+ import { KeyCode } from './keycode';
22
22
  /**
23
23
  * A shortcut item that could be registered to the {@link IShortcutService}.
24
24
  */
@@ -154,4 +154,5 @@ export declare class ShortcutService extends Disposable implements IShortcutServ
154
154
  dispatch(e: KeyboardEvent): IShortcutItem<object> | undefined;
155
155
  private _getBindingFromItem;
156
156
  private _deriveBindingFromEvent;
157
+ private _shouldLetEmbedTextEditorHandleNativeShortcut;
157
158
  }
@@ -0,0 +1,23 @@
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 declare const EMBED_INTERACTION_BOUNDARY_OWNER_ATTRIBUTE = "data-embed-interaction-boundary-owner";
17
+ export declare function getEmbedBoundaryOwner(target: EventTarget | null): string | undefined;
18
+ export declare function isEmbedBoundaryTarget(target: EventTarget | null): boolean;
19
+ export declare function keepInteractionInsideSameEmbedBoundary(event: {
20
+ currentTarget: EventTarget | null;
21
+ target: EventTarget | null;
22
+ preventDefault: () => void;
23
+ }): void;
@@ -15,5 +15,6 @@
15
15
  */
16
16
  export * from './cell';
17
17
  export * from './di';
18
+ export * from './embed-boundary';
18
19
  export * from './html';
19
20
  export * from './util';
@@ -13,7 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import type { ILayoutService } from '../../../services/layout/layout.service';
16
17
  import type { IValueOption } from '../../../services/menu/menu';
18
+ import type { IMenuManagerService } from '../../../services/menu/menu-manager.service';
17
19
  export interface IContextMenuAnchorRect {
18
20
  left: number;
19
21
  top: number;
@@ -26,6 +28,8 @@ export interface IAnchoredContextMenuProps {
26
28
  menuType: string;
27
29
  anchorVertical?: 'top' | 'bottom';
28
30
  menuOffset?: number;
31
+ menuManagerService?: IMenuManagerService;
32
+ layoutService?: ILayoutService;
29
33
  onRequestClose: () => void;
30
34
  onOptionSelect?: (option: IValueOption) => void;
31
35
  }
@@ -15,10 +15,14 @@
15
15
  */
16
16
  import type { IValueOption } from '../../../services/menu/menu';
17
17
  import type { IMenuSchema } from '../../../services/menu/menu-manager.service';
18
+ import { ILayoutService } from '../../../services/layout/layout.service';
19
+ import { IMenuManagerService } from '../../../services/menu/menu-manager.service';
18
20
  type ContextMenuSizeVariant = 'default' | 'paragraph-t';
19
21
  type ContextMenuAutoFocusTarget = 'first-item' | 'container';
20
22
  interface IContextMenuPanelProps {
21
23
  menuType: string;
24
+ menuManagerService?: IMenuManagerService;
25
+ layoutService?: ILayoutService;
22
26
  menuSessionVersion?: number;
23
27
  className?: string;
24
28
  activeItemIds?: string[];
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import type { CSSProperties } from 'react';
16
17
  import type { IFloatDom } from '../../../services/dom/canvas-dom-layer.service';
17
18
  export declare const FloatDomSingle: import("react").MemoExoticComponent<(props: {
18
19
  layer: IFloatDom;
@@ -21,3 +22,13 @@ export declare const FloatDomSingle: import("react").MemoExoticComponent<(props:
21
22
  export declare const FloatDom: ({ unitId }: {
22
23
  unitId?: string;
23
24
  }) => import("react").JSX.Element[] | undefined;
25
+ export declare function resolveFloatDomCurrentUnitId(unitId: string | undefined, focusedUnit: unknown): string | null;
26
+ export declare function resolveFloatDomOverflow(props: {
27
+ customBlockRenderViewport?: {
28
+ bleedLeft?: number;
29
+ bleedWidth?: number;
30
+ };
31
+ }): {
32
+ outerOverflow: CSSProperties['overflow'];
33
+ innerOverflow: CSSProperties['overflow'];
34
+ };
@@ -0,0 +1,35 @@
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 { IFloatDomContentBoxConfig, IFloatDomLayout } from '../../../services/dom/canvas-dom-layer.service';
17
+ export interface IFloatDomLayoutStyle {
18
+ wrapper: {
19
+ top: number;
20
+ left: number;
21
+ width: number;
22
+ height: number;
23
+ transform: string;
24
+ opacity: number;
25
+ };
26
+ inner: {
27
+ width: number;
28
+ height: number;
29
+ left: number | 'auto';
30
+ top: number | 'auto';
31
+ right: number | 'auto';
32
+ bottom: number | 'auto';
33
+ };
34
+ }
35
+ export declare function resolveFloatDomLayout(position: IFloatDomLayout, contentBox?: IFloatDomContentBoxConfig): IFloatDomLayoutStyle;
@@ -19,6 +19,8 @@ interface IRibbonProps {
19
19
  ribbonType: RibbonType;
20
20
  headerMenuComponents?: Set<ComponentType>;
21
21
  headerMenu?: boolean;
22
+ toolbarOnly?: boolean;
23
+ headerClassName?: string;
22
24
  }
23
25
  export declare function Ribbon(props: IRibbonProps): import("react").JSX.Element;
24
26
  export {};
@@ -19,7 +19,12 @@ import type { IMenuItem, IValueOption } from '../../../services/menu/menu';
19
19
  export interface ITooltipWrapperRef {
20
20
  el: HTMLSpanElement | null;
21
21
  }
22
- export declare const TooltipWrapper: import("react").ForwardRefExoticComponent<ITooltipProps & import("react").RefAttributes<ITooltipWrapperRef>>;
22
+ export declare function ToolbarDropdownProvider(props: {
23
+ children: ReactNode;
24
+ }): import("react").JSX.Element;
25
+ export declare const TooltipWrapper: import("react").ForwardRefExoticComponent<ITooltipProps & {
26
+ dropdownKey?: string;
27
+ } & import("react").RefAttributes<ITooltipWrapperRef>>;
23
28
  export declare function DropdownWrapper(props: Omit<Partial<IDropdownProps>, 'overlay'> & {
24
29
  overlay: ReactNode;
25
30
  align?: 'start' | 'end' | 'center';
@@ -27,7 +27,7 @@ export type EmojiCategory = Exclude<keyof typeof emojis, 'frequent'>;
27
27
  export declare const EMOJI_RECENT_LIMIT = 11;
28
28
  export declare const EMOJI_CATEGORIES: {
29
29
  key: EmojiCategory;
30
- titleKey: string;
30
+ titleKey: "ui.shortcut-panel.title" | "ui.fontFamily.arial" | "ui.fontFamily.times-new-roman" | "ui.fontFamily.tahoma" | "ui.fontFamily.verdana" | "ui.fontFamily.microsoft-yahei" | "ui.fontFamily.simsun" | "ui.fontFamily.simhei" | "ui.fontFamily.kaiti" | "ui.fontFamily.fangsong" | "ui.fontFamily.nsimsun" | "ui.fontFamily.stxinwei" | "ui.fontFamily.stxingkai" | "ui.fontFamily.stliti" | "ui.shortcut.copy" | "ui.common-edit" | "ui.shortcut.cut" | "ui.shortcut.paste" | "ui.shortcut.undo" | "ui.shortcut.redo" | "ui.ribbon.start" | "ui.ribbon.insert" | "ui.ribbon.formulas" | "ui.ribbon.data" | "ui.ribbon.view" | "ui.ribbon.others" | "ui.shortcut.shortcut-panel" | "ui.global-shortcut" | "ui.row" | "ui.column" | "ui.toggle-shortcut-panel" | "ui.fontFamily.not-supported" | "ui.toolbar.heading.title" | "ui.toolbar.heading.normal" | "ui.toolbar.heading.tooltip" | "ui.toolbar.heading.subTitle" | "ui.ribbon.startDesc" | "ui.ribbon.insertDesc" | "ui.ribbon.formulasDesc" | "ui.ribbon.dataDesc" | "ui.ribbon.viewDesc" | "ui.ribbon.othersDesc" | "ui.ribbon.more" | "ui.clipboard.authentication.title" | "ui.clipboard.authentication.content" | "ui.emojiPicker.search" | "ui.emojiPicker.objects" | "ui.emojiPicker.random" | "ui.emojiPicker.recents" | "ui.emojiPicker.emojis" | "ui.emojiPicker.animals" | "ui.emojiPicker.food" | "ui.emojiPicker.activities" | "ui.emojiPicker.places" | "ui.emojiPicker.symbols" | "ui.emojiPicker.searchResults" | "ui.emojiPicker.noResults" | `ui.emojiPicker.emojiSearchIndex.${string}` | `ui.emojiPicker.emojiTitles.${string}` | "ui.textEditor.formulaError" | "ui.textEditor.rangeError" | "ui.rangeSelector.title" | "ui.rangeSelector.cancel" | "ui.rangeSelector.addAnotherRange" | "ui.rangeSelector.buttonTooltip" | "ui.rangeSelector.placeHolder" | "ui.rangeSelector.confirm" | "ui.zoom-slider.resetTo";
31
31
  }[];
32
32
  export declare function getDefaultRecentEmojis(): IEmojiItem[];
33
33
  export declare function getAllEmojis(): IEmojiItem[];
@@ -13,5 +13,13 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IFontFamilyProps } from './interface';
17
- export declare const FontFamily: ({ id, value, disabled$ }: IFontFamilyProps) => import("react").JSX.Element;
16
+ import type { Observable } from 'rxjs';
17
+ import type { ICustomComponentProps } from '../../services/menu/menu';
18
+ export interface IFontFamilyProps extends ICustomComponentProps<string> {
19
+ className?: string;
20
+ disabled?: boolean;
21
+ value: string;
22
+ disabled$?: Observable<boolean>;
23
+ }
24
+ export declare const FONT_FAMILY_COMPONENT = "UI_FONT_FAMILY_COMPONENT";
25
+ export declare const FontFamily: ({ className, disabled: disabledProp, value, disabled$, onChange }: IFontFamilyProps) => import("react").JSX.Element;
@@ -0,0 +1,32 @@
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 { MouseEvent, PointerEvent, ReactNode } from 'react';
17
+ import type { Observable } from 'rxjs';
18
+ export interface IFontFamilyDropdownProps {
19
+ value: string;
20
+ onChange: (value: string) => void;
21
+ ariaLabel?: string;
22
+ className?: string;
23
+ disabled?: boolean;
24
+ disabled$?: Observable<boolean>;
25
+ inputClassName?: string;
26
+ popupClassName?: string;
27
+ popupDataComponent?: string;
28
+ title?: ReactNode;
29
+ onMouseDown?: (event: MouseEvent<HTMLElement>) => void;
30
+ onPointerDown?: (event: PointerEvent<HTMLElement>) => void;
31
+ }
32
+ export declare function FontFamilyDropdown(props: IFontFamilyDropdownProps): import("react").JSX.Element;
@@ -13,7 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const FontFamilyItem: ({ id, value }: {
17
- id: string;
16
+ import type { ICustomComponentProps } from '../../services/menu/menu';
17
+ export interface IFontFamilyItemProps extends ICustomComponentProps<string> {
18
18
  value: string;
19
- }) => import("react").JSX.Element;
19
+ }
20
+ export declare const FONT_FAMILY_ITEM_COMPONENT = "UI_FONT_FAMILY_ITEM_COMPONENT";
21
+ export declare const FontFamilyItem: ({ value, onChange }: IFontFamilyItemProps) => import("react").JSX.Element;
@@ -13,5 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export { FontFamily } from './FontFamily';
17
- export { FontFamilyItem } from './FontFamilyItem';
16
+ export { FONT_FAMILY_COMPONENT, FontFamily } from './FontFamily';
17
+ export type { IFontFamilyProps } from './FontFamily';
18
+ export { FontFamilyDropdown } from './FontFamilyDropdown';
19
+ export type { IFontFamilyDropdownProps } from './FontFamilyDropdown';
20
+ export { FONT_FAMILY_ITEM_COMPONENT, FontFamilyItem } from './FontFamilyItem';
21
+ export type { IFontFamilyItemProps } from './FontFamilyItem';
@@ -13,12 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { Observable } from 'rxjs';
17
- import type { ICustomComponentProps } from '../../services/menu/menu';
18
- export interface IFontFamilyProps extends ICustomComponentProps<string> {
19
- id: string;
20
- value: string;
21
- disabled$?: Observable<boolean>;
22
- }
23
- export declare const FONT_FAMILY_COMPONENT = "UI_FONT_FAMILY_COMPONENT";
24
- export declare const FONT_FAMILY_ITEM_COMPONENT = "UI_FONT_FAMILY_ITEM_COMPONENT";
16
+ import type { IFontConfig } from '../../services/font.service';
17
+ import { IFontService } from '../../services/font.service';
18
+ export declare function useFontList(): {
19
+ fonts: IFontConfig[];
20
+ fontService: IFontService;
21
+ };
@@ -15,8 +15,10 @@
15
15
  */
16
16
  import type { IMenuSchema } from '../../../services/menu/menu-manager.service';
17
17
  import type { IBaseMenuProps } from '../types';
18
+ import { IMenuManagerService } from '../../../services/menu/menu-manager.service';
18
19
  interface IMobileMenuProps extends IBaseMenuProps {
19
20
  schemas?: IMenuSchema[];
21
+ menuManagerService?: IMenuManagerService;
20
22
  }
21
23
  export declare function MobileMenu(props: IMobileMenuProps): import("react").JSX.Element | null;
22
24
  export {};