@univerjs/ui 1.0.0-beta.0 → 1.0.0-beta.2

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 (99) hide show
  1. package/lib/cjs/index.js +10227 -8985
  2. package/lib/cjs/locale/ar-SA.js +51 -80
  3. package/lib/cjs/locale/ca-ES.js +51 -80
  4. package/lib/cjs/locale/de-DE.js +51 -80
  5. package/lib/cjs/locale/en-US.js +51 -80
  6. package/lib/cjs/locale/es-ES.js +51 -80
  7. package/lib/cjs/locale/fa-IR.js +51 -80
  8. package/lib/cjs/locale/fr-FR.js +51 -80
  9. package/lib/cjs/locale/id-ID.js +51 -80
  10. package/lib/cjs/locale/it-IT.js +51 -80
  11. package/lib/cjs/locale/ja-JP.js +51 -80
  12. package/lib/cjs/locale/ko-KR.js +51 -80
  13. package/lib/cjs/locale/pl-PL.js +51 -80
  14. package/lib/cjs/locale/pt-BR.js +51 -80
  15. package/lib/cjs/locale/ru-RU.js +51 -80
  16. package/lib/cjs/locale/sk-SK.js +51 -80
  17. package/lib/cjs/locale/vi-VN.js +51 -80
  18. package/lib/cjs/locale/zh-CN.js +51 -80
  19. package/lib/cjs/locale/zh-HK.js +51 -80
  20. package/lib/cjs/locale/zh-TW.js +51 -80
  21. package/lib/es/index.js +10212 -8986
  22. package/lib/es/locale/ar-SA.js +51 -80
  23. package/lib/es/locale/ca-ES.js +51 -80
  24. package/lib/es/locale/de-DE.js +51 -80
  25. package/lib/es/locale/en-US.js +51 -80
  26. package/lib/es/locale/es-ES.js +51 -80
  27. package/lib/es/locale/fa-IR.js +51 -80
  28. package/lib/es/locale/fr-FR.js +51 -80
  29. package/lib/es/locale/id-ID.js +51 -80
  30. package/lib/es/locale/it-IT.js +51 -80
  31. package/lib/es/locale/ja-JP.js +51 -80
  32. package/lib/es/locale/ko-KR.js +51 -80
  33. package/lib/es/locale/pl-PL.js +51 -80
  34. package/lib/es/locale/pt-BR.js +51 -80
  35. package/lib/es/locale/ru-RU.js +51 -80
  36. package/lib/es/locale/sk-SK.js +51 -80
  37. package/lib/es/locale/vi-VN.js +51 -80
  38. package/lib/es/locale/zh-CN.js +51 -80
  39. package/lib/es/locale/zh-HK.js +51 -80
  40. package/lib/es/locale/zh-TW.js +51 -80
  41. package/lib/index.css +128 -28
  42. package/lib/index.js +10212 -8986
  43. package/lib/locale/ar-SA.js +51 -80
  44. package/lib/locale/ca-ES.js +51 -80
  45. package/lib/locale/de-DE.js +51 -80
  46. package/lib/locale/en-US.js +51 -80
  47. package/lib/locale/es-ES.js +51 -80
  48. package/lib/locale/fa-IR.js +51 -80
  49. package/lib/locale/fr-FR.js +51 -80
  50. package/lib/locale/id-ID.js +51 -80
  51. package/lib/locale/it-IT.js +51 -80
  52. package/lib/locale/ja-JP.js +51 -80
  53. package/lib/locale/ko-KR.js +51 -80
  54. package/lib/locale/pl-PL.js +51 -80
  55. package/lib/locale/pt-BR.js +51 -80
  56. package/lib/locale/ru-RU.js +51 -80
  57. package/lib/locale/sk-SK.js +51 -80
  58. package/lib/locale/vi-VN.js +51 -80
  59. package/lib/locale/zh-CN.js +51 -80
  60. package/lib/locale/zh-HK.js +51 -80
  61. package/lib/locale/zh-TW.js +51 -80
  62. package/lib/types/common/icon-manager.d.ts +1 -0
  63. package/lib/types/index.d.ts +5 -0
  64. package/lib/types/locale/en-US.d.ts +0 -27
  65. package/lib/types/services/popup/canvas-popup.service.d.ts +2 -0
  66. package/lib/types/services/presence/unit-presence-ui-adapter.service.d.ts +66 -0
  67. package/lib/types/services/undo-redo/undo-redo-group.service.d.ts +25 -0
  68. package/lib/types/services/workbench/workbench.service.d.ts +9 -2
  69. package/lib/types/views/components/hover-track/HoverTrack.d.ts +19 -0
  70. package/lib/types/views/components/popup/RectPopup.d.ts +14 -7
  71. package/lib/types/views/components/ribbon/ToolbarButton.d.ts +1 -1
  72. package/lib/types/views/components/ribbon/ToolbarItem.d.ts +1 -0
  73. package/lib/types/views/components/ribbon/TooltipButtonWrapper.d.ts +12 -2
  74. package/lib/types/views/custom-label/CustomLabel.d.ts +1 -0
  75. package/lib/types/views/emoji-picker/emoji-picker-utils.d.ts +16 -3
  76. package/lib/types/views/emoji-picker/emojis.generated.d.ts +10 -2
  77. package/lib/types/views/hooks/prevent-browser-zoom.d.ts +16 -0
  78. package/lib/types/views/hooks/virtual-list.d.ts +2 -1
  79. package/lib/umd/index.js +15 -15
  80. package/lib/umd/locale/ar-SA.js +1 -1
  81. package/lib/umd/locale/ca-ES.js +1 -1
  82. package/lib/umd/locale/de-DE.js +1 -1
  83. package/lib/umd/locale/en-US.js +1 -1
  84. package/lib/umd/locale/es-ES.js +1 -1
  85. package/lib/umd/locale/fa-IR.js +1 -1
  86. package/lib/umd/locale/fr-FR.js +1 -1
  87. package/lib/umd/locale/id-ID.js +1 -1
  88. package/lib/umd/locale/it-IT.js +1 -1
  89. package/lib/umd/locale/ja-JP.js +1 -1
  90. package/lib/umd/locale/ko-KR.js +1 -1
  91. package/lib/umd/locale/pl-PL.js +1 -1
  92. package/lib/umd/locale/pt-BR.js +1 -1
  93. package/lib/umd/locale/ru-RU.js +1 -1
  94. package/lib/umd/locale/sk-SK.js +1 -1
  95. package/lib/umd/locale/vi-VN.js +1 -1
  96. package/lib/umd/locale/zh-CN.js +1 -1
  97. package/lib/umd/locale/zh-HK.js +1 -1
  98. package/lib/umd/locale/zh-TW.js +1 -1
  99. package/package.json +7 -7
@@ -15,25 +15,38 @@
15
15
  */
16
16
  import type { LocaleService } from '@univerjs/core';
17
17
  import { emojis } from './emojis.generated';
18
- export interface IEmojiItem {
18
+ export interface IEmojiVariant {
19
19
  emoji: string;
20
20
  title: string;
21
21
  }
22
+ export interface IEmojiItem extends IEmojiVariant {
23
+ skinToneVariants?: IEmojiVariant[];
24
+ }
22
25
  export interface IEmojiLocaleData {
23
26
  emojiSearchIndex?: Record<string, string>;
24
27
  emojiTitles?: Record<string, string>;
25
28
  }
26
29
  export type EmojiCategory = Exclude<keyof typeof emojis, 'frequent'>;
30
+ export declare const EMOJI_SKIN_TONES: readonly ["", "🏻", "🏼", "🏽", "🏾", "🏿"];
31
+ export type EmojiSkinTone = (typeof EMOJI_SKIN_TONES)[number];
32
+ export declare const EMOJI_SKIN_TONE_OPTIONS: ReadonlyArray<IEmojiVariant & {
33
+ value: EmojiSkinTone;
34
+ }>;
27
35
  export declare const EMOJI_RECENT_LIMIT = 11;
28
36
  export declare const EMOJI_CATEGORIES: {
29
37
  key: EmojiCategory;
30
- titleKey: "ui.column" | "ui.row" | "ui.common-edit" | "ui.toggle-shortcut-panel" | "ui.global-shortcut" | "ui.fontFamily.not-supported" | "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.ribbon.start" | "ui.ribbon.view" | "ui.ribbon.insert" | "ui.ribbon.data" | "ui.ribbon.startDesc" | "ui.ribbon.insertDesc" | "ui.ribbon.formulas" | "ui.ribbon.formulasDesc" | "ui.ribbon.dataDesc" | "ui.ribbon.viewDesc" | "ui.ribbon.others" | "ui.ribbon.othersDesc" | "ui.ribbon.more" | "ui.clipboard.authentication.title" | "ui.clipboard.authentication.content" | "ui.featureSearch.title" | "ui.featureSearch.empty" | "ui.featureSearch.placeholder" | "ui.featureSearch.ribbon" | "ui.featureSearch.contextMenu" | "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.symbolPicker.mathematics" | "ui.symbolPicker.greek" | "ui.symbolPicker.common" | "ui.toolbar.heading.title" | "ui.toolbar.heading.normal" | "ui.toolbar.heading.subTitle" | "ui.toolbar.heading.tooltip" | "ui.shortcut-panel.title" | "ui.shortcut.copy" | "ui.shortcut.cut" | "ui.shortcut.paste" | "ui.shortcut.shortcut-panel" | "ui.shortcut.undo" | "ui.shortcut.redo" | "ui.navigation.next" | "ui.navigation.back" | "ui.navigation.previous" | "ui.sidebar.close" | "ui.sidebar.resize" | "ui.sidebar.panel" | "ui.beforeClose.title" | "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";
38
+ titleKey: "ui.column" | "ui.row" | "ui.common-edit" | "ui.toggle-shortcut-panel" | "ui.global-shortcut" | "ui.fontFamily.not-supported" | "ui.ribbon.start" | "ui.ribbon.view" | "ui.ribbon.insert" | "ui.ribbon.data" | "ui.ribbon.startDesc" | "ui.ribbon.insertDesc" | "ui.ribbon.formulas" | "ui.ribbon.formulasDesc" | "ui.ribbon.dataDesc" | "ui.ribbon.viewDesc" | "ui.ribbon.others" | "ui.ribbon.othersDesc" | "ui.ribbon.more" | "ui.clipboard.authentication.title" | "ui.clipboard.authentication.content" | "ui.featureSearch.title" | "ui.featureSearch.empty" | "ui.featureSearch.placeholder" | "ui.featureSearch.ribbon" | "ui.featureSearch.contextMenu" | "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.symbolPicker.mathematics" | "ui.symbolPicker.greek" | "ui.symbolPicker.common" | "ui.toolbar.heading.title" | "ui.toolbar.heading.normal" | "ui.toolbar.heading.subTitle" | "ui.shortcut-panel.title" | "ui.shortcut.copy" | "ui.shortcut.cut" | "ui.shortcut.paste" | "ui.shortcut.shortcut-panel" | "ui.shortcut.undo" | "ui.shortcut.redo" | "ui.navigation.next" | "ui.navigation.back" | "ui.navigation.previous" | "ui.sidebar.close" | "ui.sidebar.resize" | "ui.sidebar.panel" | "ui.beforeClose.title" | "ui.rangeSelector.cancel";
31
39
  }[];
32
40
  export declare function getDefaultRecentEmojis(): IEmojiItem[];
33
41
  export declare function getAllEmojis(): IEmojiItem[];
34
42
  export declare function searchEmojis(keyword: string, searchIndex?: Record<string, string>): IEmojiItem[];
35
43
  export declare function promoteRecentEmoji(recents: IEmojiItem[], item: IEmojiItem): IEmojiItem[];
36
44
  export declare function parseStoredRecentEmojis(value: IEmojiItem[] | string | null): IEmojiItem[];
37
- export declare function getRandomEmoji(random?: () => number): IEmojiItem;
45
+ export declare function getRandomEmoji(random?: () => number, skinTone?: EmojiSkinTone): IEmojiItem;
46
+ export declare function applyEmojiSkinTone(item: IEmojiItem, skinTone: EmojiSkinTone): IEmojiItem;
47
+ export declare function getEmojiFamilyKey(emoji: string): string;
48
+ export declare function getEmojiFamilyVariants(emoji: string): IEmojiVariant[];
49
+ export declare function hasMixedSkinToneVariants(item: IEmojiItem): boolean;
50
+ export declare function parseStoredEmojiSkinTone(value: unknown): EmojiSkinTone;
38
51
  export declare function getLocalizedEmojiTitle(item: IEmojiItem, emojiTitles?: Record<string, string>): string;
39
52
  export declare function getEmojiLocaleData(localeService: Pick<LocaleService, 'getLocales'>): IEmojiLocaleData;
@@ -3,10 +3,18 @@ export declare const emojis: {
3
3
  emoji: string;
4
4
  title: string;
5
5
  }[];
6
- people: {
6
+ people: ({
7
7
  emoji: string;
8
8
  title: string;
9
- }[];
9
+ skinToneVariants?: undefined;
10
+ } | {
11
+ emoji: string;
12
+ title: string;
13
+ skinToneVariants: {
14
+ emoji: string;
15
+ title: string;
16
+ }[];
17
+ })[];
10
18
  nature: {
11
19
  emoji: string;
12
20
  title: string;
@@ -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 declare function preventBrowserZoomInContainers(containers: readonly HTMLElement[]): () => void;
@@ -13,9 +13,10 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import type { RefObject } from 'react';
16
17
  type ItemHeight<T> = (index: number, data: T) => number;
17
18
  export interface IVirtualListOptions<T> {
18
- containerTarget: React.RefObject<HTMLElement>;
19
+ containerTarget: RefObject<HTMLElement | null>;
19
20
  itemHeight: number | ItemHeight<T>;
20
21
  overscan?: number;
21
22
  }