@univerjs/ui 1.0.4 → 1.2.0
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/facade.js +6 -6
- package/lib/cjs/index.js +257 -192
- package/lib/es/facade.js +6 -6
- package/lib/es/index.js +224 -159
- package/lib/facade.js +6 -6
- package/lib/index.css +28 -18
- package/lib/index.js +224 -159
- package/lib/types/views/emoji-picker/EmojiPicker.d.ts +1 -1
- package/lib/types/views/emoji-picker/emoji-picker-utils.d.ts +1 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +20 -20
- package/package.json +11 -11
package/lib/cjs/index.js
CHANGED
|
@@ -56,7 +56,7 @@ function getAttributeValue(target, name) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
//#endregion
|
|
59
|
-
//#region \0@oxc-project+runtime@0.
|
|
59
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
60
60
|
function _typeof(o) {
|
|
61
61
|
"@babel/helpers - typeof";
|
|
62
62
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -67,7 +67,7 @@ function _typeof(o) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
//#endregion
|
|
70
|
-
//#region \0@oxc-project+runtime@0.
|
|
70
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
71
71
|
function toPrimitive(t, r) {
|
|
72
72
|
if ("object" != _typeof(t) || !t) return t;
|
|
73
73
|
var e = t[Symbol.toPrimitive];
|
|
@@ -80,14 +80,14 @@ function toPrimitive(t, r) {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
//#endregion
|
|
83
|
-
//#region \0@oxc-project+runtime@0.
|
|
83
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
84
84
|
function toPropertyKey(t) {
|
|
85
85
|
var i = toPrimitive(t, "string");
|
|
86
86
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
//#endregion
|
|
90
|
-
//#region \0@oxc-project+runtime@0.
|
|
90
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
91
91
|
function _defineProperty(e, r, t) {
|
|
92
92
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
93
93
|
value: t,
|
|
@@ -98,7 +98,7 @@ function _defineProperty(e, r, t) {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
//#endregion
|
|
101
|
-
//#region \0@oxc-project+runtime@0.
|
|
101
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
102
102
|
function __decorateParam(paramIndex, decorator) {
|
|
103
103
|
return function(target, key) {
|
|
104
104
|
decorator(target, key, paramIndex);
|
|
@@ -106,7 +106,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
//#endregion
|
|
109
|
-
//#region \0@oxc-project+runtime@0.
|
|
109
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
110
110
|
function __decorate(decorators, target, key, desc) {
|
|
111
111
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
112
112
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -308,7 +308,8 @@ const ToggleShortcutPanelOperation = {
|
|
|
308
308
|
shortcutPanelService.open();
|
|
309
309
|
sidebarService.open({
|
|
310
310
|
header: { title: "ui.shortcut-panel.title" },
|
|
311
|
-
children: { label: ShortcutPanelComponentName }
|
|
311
|
+
children: { label: ShortcutPanelComponentName },
|
|
312
|
+
onClose: () => shortcutPanelService.close()
|
|
312
313
|
});
|
|
313
314
|
}
|
|
314
315
|
return true;
|
|
@@ -1674,27 +1675,33 @@ let DesktopRibbonService = class DesktopRibbonService extends _univerjs_core.Dis
|
|
|
1674
1675
|
this._initRibbonSubscription();
|
|
1675
1676
|
}
|
|
1676
1677
|
setActivatedTab(tab) {
|
|
1678
|
+
if (this._disposed) return;
|
|
1677
1679
|
if (!this._isContextualTab(tab)) this._lastNonContextualActivatedTab = tab;
|
|
1678
1680
|
this._activatedTab$.next(tab);
|
|
1679
1681
|
}
|
|
1680
1682
|
showContextualTab(tab, options) {
|
|
1683
|
+
if (this._disposed) return;
|
|
1681
1684
|
this._visibleContextualTabs.add(tab);
|
|
1682
1685
|
this._updateRibbon();
|
|
1683
1686
|
if (options === null || options === void 0 ? void 0 : options.activate) this.setActivatedTab(tab);
|
|
1684
1687
|
}
|
|
1685
1688
|
hideContextualTab(tab) {
|
|
1689
|
+
if (this._disposed) return;
|
|
1686
1690
|
if (!this._visibleContextualTabs.delete(tab)) return;
|
|
1687
1691
|
this._updateRibbon();
|
|
1688
1692
|
}
|
|
1689
1693
|
hideAllContextualTabs() {
|
|
1694
|
+
if (this._disposed) return;
|
|
1690
1695
|
if (this._visibleContextualTabs.size === 0) return;
|
|
1691
1696
|
this._visibleContextualTabs.clear();
|
|
1692
1697
|
this._updateRibbon();
|
|
1693
1698
|
}
|
|
1694
1699
|
setCollapsedIds(ids) {
|
|
1700
|
+
if (this._disposed) return;
|
|
1695
1701
|
this._collapsedIds$.next(ids);
|
|
1696
1702
|
}
|
|
1697
1703
|
setFakeToolbarVisible(visible) {
|
|
1704
|
+
if (this._disposed) return;
|
|
1698
1705
|
this._fakeToolbarVisible$.next(visible);
|
|
1699
1706
|
}
|
|
1700
1707
|
_initRibbonSubscription() {
|
|
@@ -1704,15 +1711,16 @@ let DesktopRibbonService = class DesktopRibbonService extends _univerjs_core.Dis
|
|
|
1704
1711
|
}
|
|
1705
1712
|
_updateRibbon() {
|
|
1706
1713
|
var _this$_hiddenSubscrip;
|
|
1714
|
+
if (this._disposed) return;
|
|
1707
1715
|
const ribbon = this._filterContextualTabs(this._menuManagerService.getMenuByPositionKey("ribbon"));
|
|
1708
1716
|
const hiddenObservableMap = [];
|
|
1709
|
-
const
|
|
1717
|
+
const menusWithHiddenState = [];
|
|
1710
1718
|
for (const group of ribbon) if (group.children) {
|
|
1711
1719
|
for (const item of group.children) if (item.children) for (const child of item.children) {
|
|
1712
1720
|
var _child$item;
|
|
1713
1721
|
if ((_child$item = child.item) === null || _child$item === void 0 ? void 0 : _child$item.hidden$) {
|
|
1714
1722
|
hiddenObservableMap.push(child.item.hidden$);
|
|
1715
|
-
|
|
1723
|
+
menusWithHiddenState.push(child);
|
|
1716
1724
|
}
|
|
1717
1725
|
}
|
|
1718
1726
|
}
|
|
@@ -1724,10 +1732,7 @@ let DesktopRibbonService = class DesktopRibbonService extends _univerjs_core.Dis
|
|
|
1724
1732
|
}
|
|
1725
1733
|
this._hiddenSubscription = (0, rxjs.combineLatest)(hiddenObservableMap.map((hidden$) => hidden$.pipe((0, rxjs_operators.startWith)(false)))).pipe((0, rxjs_operators.distinctUntilChanged)(isSameHiddenMap)).subscribe((hiddenMap) => {
|
|
1726
1734
|
const newRibbon = [];
|
|
1727
|
-
const
|
|
1728
|
-
if (hidden) return hiddenKeyMap[index];
|
|
1729
|
-
return null;
|
|
1730
|
-
}).filter((item) => !!item);
|
|
1735
|
+
const hiddenMenus = new Set(menusWithHiddenState.filter((_, index) => hiddenMap[index]));
|
|
1731
1736
|
for (const group of ribbon) {
|
|
1732
1737
|
var _group$children, _newGroup$children2;
|
|
1733
1738
|
const newGroup = {
|
|
@@ -1743,7 +1748,7 @@ let DesktopRibbonService = class DesktopRibbonService extends _univerjs_core.Dis
|
|
|
1743
1748
|
let shouldAddItem = true;
|
|
1744
1749
|
if ((_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.length) {
|
|
1745
1750
|
var _newItem$children2;
|
|
1746
|
-
for (const child of item.children) if (!
|
|
1751
|
+
for (const child of item.children) if (!hiddenMenus.has(child)) {
|
|
1747
1752
|
var _newItem$children;
|
|
1748
1753
|
(_newItem$children = newItem.children) === null || _newItem$children === void 0 || _newItem$children.push(child);
|
|
1749
1754
|
}
|
|
@@ -1764,6 +1769,10 @@ let DesktopRibbonService = class DesktopRibbonService extends _univerjs_core.Dis
|
|
|
1764
1769
|
}
|
|
1765
1770
|
this._setRibbon(newRibbon);
|
|
1766
1771
|
});
|
|
1772
|
+
if (this._disposed) {
|
|
1773
|
+
this._hiddenSubscription.unsubscribe();
|
|
1774
|
+
this._hiddenSubscription = null;
|
|
1775
|
+
}
|
|
1767
1776
|
}
|
|
1768
1777
|
_filterContextualTabs(ribbon) {
|
|
1769
1778
|
this._contextualTabs.clear();
|
|
@@ -1790,6 +1799,10 @@ let DesktopRibbonService = class DesktopRibbonService extends _univerjs_core.Dis
|
|
|
1790
1799
|
}
|
|
1791
1800
|
dispose() {
|
|
1792
1801
|
var _this$_hiddenSubscrip2;
|
|
1802
|
+
if (this._disposed) return;
|
|
1803
|
+
super.dispose();
|
|
1804
|
+
this._visibleContextualTabs.clear();
|
|
1805
|
+
this._contextualTabs.clear();
|
|
1793
1806
|
(_this$_hiddenSubscrip2 = this._hiddenSubscription) === null || _this$_hiddenSubscrip2 === void 0 || _this$_hiddenSubscrip2.unsubscribe();
|
|
1794
1807
|
this._hiddenSubscription = null;
|
|
1795
1808
|
this._ribbon$.next([]);
|
|
@@ -1797,7 +1810,6 @@ let DesktopRibbonService = class DesktopRibbonService extends _univerjs_core.Dis
|
|
|
1797
1810
|
this._activatedTab$.complete();
|
|
1798
1811
|
this._collapsedIds$.complete();
|
|
1799
1812
|
this._fakeToolbarVisible$.complete();
|
|
1800
|
-
super.dispose();
|
|
1801
1813
|
}
|
|
1802
1814
|
};
|
|
1803
1815
|
DesktopRibbonService = __decorate([__decorateParam(0, IMenuManagerService), __decorateParam(1, _univerjs_core.IUniverInstanceService)], DesktopRibbonService);
|
|
@@ -1823,17 +1835,23 @@ function useObservableRef(observable, defaultValue) {
|
|
|
1823
1835
|
|
|
1824
1836
|
//#endregion
|
|
1825
1837
|
//#region src/views/components/feature-search/FeatureSearch.tsx
|
|
1838
|
+
/**
|
|
1839
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1840
|
+
*
|
|
1841
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1842
|
+
* you may not use this file except in compliance with the License.
|
|
1843
|
+
* You may obtain a copy of the License at
|
|
1844
|
+
*
|
|
1845
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1846
|
+
*
|
|
1847
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1848
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1849
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1850
|
+
* See the License for the specific language governing permissions and
|
|
1851
|
+
* limitations under the License.
|
|
1852
|
+
*/
|
|
1826
1853
|
const FEATURE_SEARCH_COMPONENT = "FeatureSearch";
|
|
1827
1854
|
const FEATURE_SEARCH_DIALOG_ID = "FEATURE_SEARCH_DIALOG";
|
|
1828
|
-
function resolveParams(item, value) {
|
|
1829
|
-
return (typeof item.params === "function" ? item.params() : item.params) ?? (value === void 0 ? void 0 : { value });
|
|
1830
|
-
}
|
|
1831
|
-
function resolveOptionParams(option) {
|
|
1832
|
-
return (typeof option.params === "function" ? option.params(option.value) : option.params) ?? (option.value === void 0 ? void 0 : { value: option.value });
|
|
1833
|
-
}
|
|
1834
|
-
function deduplicate(items) {
|
|
1835
|
-
return items.filter((item, index) => items.findIndex((candidate) => candidate.commandId === item.commandId && _univerjs_core.Tools.diffValue(candidate.params, item.params)) === index);
|
|
1836
|
-
}
|
|
1837
1855
|
function FeatureSearch() {
|
|
1838
1856
|
const menuManagerService = (0, _wendellhu_redi_react_bindings.useDependency)(IMenuManagerService);
|
|
1839
1857
|
const localeService = (0, _wendellhu_redi_react_bindings.useDependency)(_univerjs_core.LocaleService);
|
|
@@ -1842,6 +1860,15 @@ function FeatureSearch() {
|
|
|
1842
1860
|
const layoutService = (0, _wendellhu_redi_react_bindings.useDependency)(ILayoutService);
|
|
1843
1861
|
const ribbonService = (0, _wendellhu_redi_react_bindings.useDependency)(IRibbonService);
|
|
1844
1862
|
const items$ = (0, react.useMemo)(() => {
|
|
1863
|
+
function resolveParams(item, value) {
|
|
1864
|
+
return (typeof item.params === "function" ? item.params() : item.params) ?? (value === void 0 ? void 0 : { value });
|
|
1865
|
+
}
|
|
1866
|
+
function resolveOptionParams(option) {
|
|
1867
|
+
return (typeof option.params === "function" ? option.params(option.value) : option.params) ?? (option.value === void 0 ? void 0 : { value: option.value });
|
|
1868
|
+
}
|
|
1869
|
+
function deduplicate(items) {
|
|
1870
|
+
return items.filter((item, index) => items.findIndex((candidate) => candidate.commandId === item.commandId && _univerjs_core.Tools.diffValue(candidate.params, item.params)) === index);
|
|
1871
|
+
}
|
|
1845
1872
|
function getItemTitle(item) {
|
|
1846
1873
|
const titleKey = item.title ?? item.tooltip ?? item.description;
|
|
1847
1874
|
return titleKey ? localeService.t(titleKey) : "";
|
|
@@ -1966,7 +1993,7 @@ function FeatureSearch() {
|
|
|
1966
1993
|
children: item.title
|
|
1967
1994
|
})]
|
|
1968
1995
|
}), item.path && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1969
|
-
className: "univer-max-w-
|
|
1996
|
+
className: "univer-max-w-[50%] univer-truncate univer-text-xs univer-text-gray-400",
|
|
1970
1997
|
children: item.path
|
|
1971
1998
|
})]
|
|
1972
1999
|
}, item.key)) })] })]
|
|
@@ -3209,6 +3236,21 @@ function useComponentsOfPart(part, injector) {
|
|
|
3209
3236
|
|
|
3210
3237
|
//#endregion
|
|
3211
3238
|
//#region src/views/components/ribbon/ribbon-menu/ClassicMenu.tsx
|
|
3239
|
+
/**
|
|
3240
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3241
|
+
*
|
|
3242
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3243
|
+
* you may not use this file except in compliance with the License.
|
|
3244
|
+
* You may obtain a copy of the License at
|
|
3245
|
+
*
|
|
3246
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3247
|
+
*
|
|
3248
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3249
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3250
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3251
|
+
* See the License for the specific language governing permissions and
|
|
3252
|
+
* limitations under the License.
|
|
3253
|
+
*/
|
|
3212
3254
|
function ClassicMenu({ ribbon, activatedTab, onSelectTab }) {
|
|
3213
3255
|
const localeService = (0, _wendellhu_redi_react_bindings.useDependency)(_univerjs_core.LocaleService);
|
|
3214
3256
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -3222,7 +3264,7 @@ function ClassicMenu({ ribbon, activatedTab, onSelectTab }) {
|
|
|
3222
3264
|
"aria-selected": isActive,
|
|
3223
3265
|
title: localeService.t(group.title || group.key),
|
|
3224
3266
|
onClick: () => onSelectTab(group),
|
|
3225
|
-
className: (0, _univerjs_design.clsx)("univer-
|
|
3267
|
+
className: (0, _univerjs_design.clsx)("univer-flex univer-cursor-pointer univer-appearance-none univer-items-center univer-gap-1 univer-rounded-sm univer-border-none univer-px-2 univer-py-1 univer-text-sm univer-transition-colors focus:univer-outline-none focus:univer-ring-2 focus:univer-ring-primary-500 dark:focus:!univer-ring-primary-300", isActive ? "univer-bg-primary-50 univer-font-semibold univer-text-primary-600 univer-shadow-sm dark:!univer-bg-primary-900 dark:!univer-text-primary-300" : "univer-bg-transparent univer-text-gray-700 hover:univer-bg-gray-100 dark:!univer-text-gray-200 dark:hover:!univer-bg-gray-700"),
|
|
3226
3268
|
children: localeService.t(group.title || group.key)
|
|
3227
3269
|
}, group.key);
|
|
3228
3270
|
})
|
|
@@ -4051,7 +4093,7 @@ const toolbarSelectorRootVariants = (0, _univerjs_design.cva)("univer-toolbar-se
|
|
|
4051
4093
|
false: "univer-text-gray-900 dark:!univer-text-gray-0"
|
|
4052
4094
|
},
|
|
4053
4095
|
active: {
|
|
4054
|
-
true: "univer-bg-gray-200",
|
|
4096
|
+
true: "univer-bg-gray-200 dark:!univer-bg-gray-500",
|
|
4055
4097
|
false: ""
|
|
4056
4098
|
}
|
|
4057
4099
|
},
|
|
@@ -4322,7 +4364,7 @@ function RibbonGrid({ groups, title, className, ...props }) {
|
|
|
4322
4364
|
const placements = placeRibbonGridItems(group.children ?? []);
|
|
4323
4365
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4324
4366
|
"data-u-comp": "ribbon-grid-group",
|
|
4325
|
-
className: "univer-relative univer-box-border univer-flex univer-
|
|
4367
|
+
className: "univer-relative univer-box-border univer-flex univer-shrink-0 univer-flex-col univer-px-2",
|
|
4326
4368
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4327
4369
|
"data-testid": "ribbon-grid-group-grid",
|
|
4328
4370
|
className: "univer-grid univer-min-h-0 univer-flex-1 univer-grid-flow-col univer-grid-rows-[repeat(2,1.5rem)] univer-content-center univer-gap-2 univer-py-2 [&>div>span>span]:univer-h-full",
|
|
@@ -4741,52 +4783,6 @@ var ContextMenuHostService = class extends _univerjs_core.Disposable {
|
|
|
4741
4783
|
}
|
|
4742
4784
|
};
|
|
4743
4785
|
|
|
4744
|
-
//#endregion
|
|
4745
|
-
//#region src/views/hooks/layout.ts
|
|
4746
|
-
/**
|
|
4747
|
-
* These hooks are used for browser layout
|
|
4748
|
-
* Prefer to client-side
|
|
4749
|
-
*/
|
|
4750
|
-
/**
|
|
4751
|
-
* Allow the element to scroll when its height over the container height
|
|
4752
|
-
* @param element
|
|
4753
|
-
* Container means the window view that the element displays in.
|
|
4754
|
-
* Recommend pass the sheet mountContainer as container
|
|
4755
|
-
* @param container
|
|
4756
|
-
*/
|
|
4757
|
-
function useScrollYOverContainer(element, container) {
|
|
4758
|
-
const updater = useEvent(() => {
|
|
4759
|
-
if (!element || !container) return;
|
|
4760
|
-
const elStyle = element.style;
|
|
4761
|
-
const { y, height } = element.getBoundingClientRect();
|
|
4762
|
-
const containerRect = container.getBoundingClientRect();
|
|
4763
|
-
const scrolled = element.scrollHeight > height;
|
|
4764
|
-
const isOverViewport = y < 0 || y + height > containerRect.height;
|
|
4765
|
-
if (!isOverViewport && !scrolled) {
|
|
4766
|
-
elStyle.overflowY = "";
|
|
4767
|
-
elStyle.maxHeight = "";
|
|
4768
|
-
return;
|
|
4769
|
-
}
|
|
4770
|
-
if (isOverViewport) {
|
|
4771
|
-
elStyle.overflowY = "auto";
|
|
4772
|
-
elStyle.maxHeight = y < 0 ? `${element.scrollHeight + y}px` : `${containerRect.height - y}px`;
|
|
4773
|
-
}
|
|
4774
|
-
});
|
|
4775
|
-
(0, react.useEffect)(() => {
|
|
4776
|
-
if (!(0, _univerjs_design.isBrowser)() || !element || !container) return;
|
|
4777
|
-
updater();
|
|
4778
|
-
const resizeObserver = new ResizeObserver(updater);
|
|
4779
|
-
resizeObserver.observe(element);
|
|
4780
|
-
return () => {
|
|
4781
|
-
resizeObserver.disconnect();
|
|
4782
|
-
};
|
|
4783
|
-
}, [element, container]);
|
|
4784
|
-
}
|
|
4785
|
-
function useConfigValue(configKey) {
|
|
4786
|
-
const configService = (0, _wendellhu_redi_react_bindings.useDependency)(_univerjs_core.IConfigService);
|
|
4787
|
-
return (0, _wendellhu_redi_react_bindings.useObservable)((0, react.useMemo)(() => configService.subscribeConfigValue$(configKey), [configService]), configService.getConfig(configKey));
|
|
4788
|
-
}
|
|
4789
|
-
|
|
4790
4786
|
//#endregion
|
|
4791
4787
|
//#region src/views/hooks/prevent-browser-zoom.ts
|
|
4792
4788
|
/**
|
|
@@ -4963,6 +4959,21 @@ function DesignTinyMenuGroup({ items, columns, sizeVariant = "default", layoutVa
|
|
|
4963
4959
|
|
|
4964
4960
|
//#endregion
|
|
4965
4961
|
//#region src/views/menu/desktop/TinyMenuGroup.tsx
|
|
4962
|
+
/**
|
|
4963
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
4964
|
+
*
|
|
4965
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4966
|
+
* you may not use this file except in compliance with the License.
|
|
4967
|
+
* You may obtain a copy of the License at
|
|
4968
|
+
*
|
|
4969
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4970
|
+
*
|
|
4971
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4972
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4973
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4974
|
+
* See the License for the specific language governing permissions and
|
|
4975
|
+
* limitations under the License.
|
|
4976
|
+
*/
|
|
4966
4977
|
const EMPTY_HIDDEN_ITEM_IDS = [];
|
|
4967
4978
|
const EMPTY_TINY_MENU_CHILDREN = [];
|
|
4968
4979
|
const quickTileMenuButtonVariants = (0, _univerjs_design.cva)("univer-relative univer-box-border univer-flex univer-size-12 univer-w-full univer-appearance-none univer-flex-col univer-items-center univer-justify-center univer-gap-0.5 univer-rounded-lg univer-border-none univer-bg-gray-0 univer-p-0 univer-font-medium univer-text-gray-700 univer-outline-none univer-transition-all focus-visible:univer-ring-2 focus-visible:univer-ring-primary-600 focus-visible:univer-ring-offset-0 dark:!univer-bg-gray-700 dark:!univer-text-gray-100", {
|
|
@@ -5089,7 +5100,7 @@ function UIQuickTileMenuGroup(props) {
|
|
|
5089
5100
|
const { item, activeItemIds, hiddenItemIds = EMPTY_HIDDEN_ITEM_IDS, onOptionSelect } = props;
|
|
5090
5101
|
if (!((_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.length)) return null;
|
|
5091
5102
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5092
|
-
className: "univer-
|
|
5103
|
+
className: "univer-grid univer-grid-cols-3 univer-items-center univer-gap-1.5 univer-py-1",
|
|
5093
5104
|
children: getVisibleTinyMenuChildren(item.children, hiddenItemIds).map((menuSchema) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(QuickTileMenuItem, {
|
|
5094
5105
|
menuSchema,
|
|
5095
5106
|
activeItemIds,
|
|
@@ -5452,7 +5463,6 @@ function ContextMenuPanel(props) {
|
|
|
5452
5463
|
menuSessionVersion
|
|
5453
5464
|
]);
|
|
5454
5465
|
const submenuPortalContainer = ((_layoutService$rootCo = layoutService.rootContainerElement) === null || _layoutService$rootCo === void 0 || (_layoutService$rootCo = _layoutService$rootCo.ownerDocument) === null || _layoutService$rootCo === void 0 ? void 0 : _layoutService$rootCo.body) ?? (typeof document !== "undefined" ? document.body : null);
|
|
5455
|
-
useScrollYOverContainer(menuElement, layoutService.rootContainerElement);
|
|
5456
5466
|
(0, react.useEffect)(() => {
|
|
5457
5467
|
if (!menuElement) return;
|
|
5458
5468
|
return preventBrowserZoomInContainers([menuElement]);
|
|
@@ -6405,7 +6415,7 @@ function Sidebar() {
|
|
|
6405
6415
|
}),
|
|
6406
6416
|
style: { width: isDragging ? void 0 : width },
|
|
6407
6417
|
children: [(options === null || options === void 0 ? void 0 : options.visible) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
6408
|
-
className: "
|
|
6418
|
+
className: "univer-absolute univer-left-0 univer-top-0 univer-z-20 univer-h-full univer-w-1 univer-cursor-col-resize univer-transition-colors hover:univer-bg-primary-500 active:univer-bg-primary-500",
|
|
6409
6419
|
onMouseDown: handleResizeMouseDown,
|
|
6410
6420
|
role: "separator",
|
|
6411
6421
|
"aria-orientation": "vertical",
|
|
@@ -6436,7 +6446,7 @@ function Sidebar() {
|
|
|
6436
6446
|
children: [options === null || options === void 0 ? void 0 : options.header, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
6437
6447
|
ref: closeButtonRef,
|
|
6438
6448
|
type: "button",
|
|
6439
|
-
className: "
|
|
6449
|
+
className: "univer-flex univer-size-6 univer-cursor-pointer univer-appearance-none univer-items-center univer-justify-center univer-rounded-sm univer-border-none univer-bg-transparent univer-p-0 univer-text-gray-500 focus:univer-outline-none focus:univer-ring-2 focus:univer-ring-primary-500 dark:!univer-text-gray-300",
|
|
6440
6450
|
onClick: handleClose,
|
|
6441
6451
|
"aria-label": localeService.t("ui.sidebar.close"),
|
|
6442
6452
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.CloseIcon, {})
|
|
@@ -6544,6 +6554,52 @@ function WorkbenchSkeleton({ darkMode, direction, overlay = false }) {
|
|
|
6544
6554
|
});
|
|
6545
6555
|
}
|
|
6546
6556
|
|
|
6557
|
+
//#endregion
|
|
6558
|
+
//#region src/views/hooks/layout.ts
|
|
6559
|
+
/**
|
|
6560
|
+
* These hooks are used for browser layout
|
|
6561
|
+
* Prefer to client-side
|
|
6562
|
+
*/
|
|
6563
|
+
/**
|
|
6564
|
+
* Allow the element to scroll when its height over the container height
|
|
6565
|
+
* @param element
|
|
6566
|
+
* Container means the window view that the element displays in.
|
|
6567
|
+
* Recommend pass the sheet mountContainer as container
|
|
6568
|
+
* @param container
|
|
6569
|
+
*/
|
|
6570
|
+
function useScrollYOverContainer(element, container) {
|
|
6571
|
+
const updater = useEvent(() => {
|
|
6572
|
+
if (!element || !container) return;
|
|
6573
|
+
const elStyle = element.style;
|
|
6574
|
+
const { y, height } = element.getBoundingClientRect();
|
|
6575
|
+
const containerRect = container.getBoundingClientRect();
|
|
6576
|
+
const scrolled = element.scrollHeight > height;
|
|
6577
|
+
const isOverViewport = y < 0 || y + height > containerRect.height;
|
|
6578
|
+
if (!isOverViewport && !scrolled) {
|
|
6579
|
+
elStyle.overflowY = "";
|
|
6580
|
+
elStyle.maxHeight = "";
|
|
6581
|
+
return;
|
|
6582
|
+
}
|
|
6583
|
+
if (isOverViewport) {
|
|
6584
|
+
elStyle.overflowY = "auto";
|
|
6585
|
+
elStyle.maxHeight = y < 0 ? `${element.scrollHeight + y}px` : `${containerRect.height - y}px`;
|
|
6586
|
+
}
|
|
6587
|
+
});
|
|
6588
|
+
(0, react.useEffect)(() => {
|
|
6589
|
+
if (!(0, _univerjs_design.isBrowser)() || !element || !container) return;
|
|
6590
|
+
updater();
|
|
6591
|
+
const resizeObserver = new ResizeObserver(updater);
|
|
6592
|
+
resizeObserver.observe(element);
|
|
6593
|
+
return () => {
|
|
6594
|
+
resizeObserver.disconnect();
|
|
6595
|
+
};
|
|
6596
|
+
}, [element, container]);
|
|
6597
|
+
}
|
|
6598
|
+
function useConfigValue(configKey) {
|
|
6599
|
+
const configService = (0, _wendellhu_redi_react_bindings.useDependency)(_univerjs_core.IConfigService);
|
|
6600
|
+
return (0, _wendellhu_redi_react_bindings.useObservable)((0, react.useMemo)(() => configService.subscribeConfigValue$(configKey), [configService]), configService.getConfig(configKey));
|
|
6601
|
+
}
|
|
6602
|
+
|
|
6547
6603
|
//#endregion
|
|
6548
6604
|
//#region src/views/hooks/update-effect.ts
|
|
6549
6605
|
/**
|
|
@@ -6619,16 +6675,8 @@ function useLatest(value) {
|
|
|
6619
6675
|
ref.current = value;
|
|
6620
6676
|
return ref;
|
|
6621
6677
|
}
|
|
6622
|
-
|
|
6623
|
-
const { containerTarget, itemHeight, overscan = 5 } = options;
|
|
6678
|
+
function useVirtualListMetrics(list, itemHeight) {
|
|
6624
6679
|
const itemHeightRef = useLatest(itemHeight);
|
|
6625
|
-
const [size, setSize] = (0, react.useState)(null);
|
|
6626
|
-
const scrollTriggerByScrollToFunc = (0, react.useRef)(false);
|
|
6627
|
-
const [targetList, setTargetList] = (0, react.useState)([]);
|
|
6628
|
-
const [wrapperStyle, setWrapperStyle] = (0, react.useState)({
|
|
6629
|
-
height: void 0,
|
|
6630
|
-
marginTop: void 0
|
|
6631
|
-
});
|
|
6632
6680
|
const getVisibleCount = (containerHeight, fromIndex) => {
|
|
6633
6681
|
if (typeof itemHeightRef.current === "number") return Math.ceil(containerHeight / itemHeightRef.current);
|
|
6634
6682
|
let sum = 0;
|
|
@@ -6659,29 +6707,18 @@ const useVirtualList = (list, options) => {
|
|
|
6659
6707
|
if (typeof itemHeightRef.current === "number") return index * itemHeightRef.current;
|
|
6660
6708
|
return list.slice(0, index).reduce((sum, _, i) => sum + itemHeightRef.current(i, list[i]), 0);
|
|
6661
6709
|
};
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
const offset = getOffset(scrollTop);
|
|
6671
|
-
const visibleCount = getVisibleCount(clientHeight, offset);
|
|
6672
|
-
const start = Math.max(0, offset - overscan);
|
|
6673
|
-
const end = Math.min(list.length, offset + visibleCount + overscan);
|
|
6674
|
-
const offsetTop = getDistanceTop(start);
|
|
6675
|
-
setWrapperStyle({
|
|
6676
|
-
height: `${totalHeight - offsetTop}px`,
|
|
6677
|
-
marginTop: `${offsetTop}px`
|
|
6678
|
-
});
|
|
6679
|
-
setTargetList(list.slice(start, end).map((ele, index) => ({
|
|
6680
|
-
data: ele,
|
|
6681
|
-
index: index + start
|
|
6682
|
-
})));
|
|
6683
|
-
}
|
|
6710
|
+
return {
|
|
6711
|
+
getVisibleCount,
|
|
6712
|
+
getOffset,
|
|
6713
|
+
getDistanceTop,
|
|
6714
|
+
totalHeight: (0, react.useMemo)(() => {
|
|
6715
|
+
if (isNumber(itemHeightRef.current)) return list.length * itemHeightRef.current;
|
|
6716
|
+
return list.reduce((sum, _, index) => sum + itemHeightRef.current(index, list[index]), 0);
|
|
6717
|
+
}, [list])
|
|
6684
6718
|
};
|
|
6719
|
+
}
|
|
6720
|
+
function useContainerSize(containerTarget) {
|
|
6721
|
+
const [size, setSize] = (0, react.useState)(null);
|
|
6685
6722
|
(0, react.useEffect)(() => {
|
|
6686
6723
|
if (containerTarget.current) {
|
|
6687
6724
|
const getSize = () => {
|
|
@@ -6700,6 +6737,37 @@ const useVirtualList = (list, options) => {
|
|
|
6700
6737
|
};
|
|
6701
6738
|
}
|
|
6702
6739
|
}, []);
|
|
6740
|
+
return size;
|
|
6741
|
+
}
|
|
6742
|
+
const useVirtualList = (list, options) => {
|
|
6743
|
+
const { containerTarget, itemHeight, overscan = 5 } = options;
|
|
6744
|
+
const { getVisibleCount, getOffset, getDistanceTop, totalHeight } = useVirtualListMetrics(list, itemHeight);
|
|
6745
|
+
const size = useContainerSize(containerTarget);
|
|
6746
|
+
const scrollTriggerByScrollToFunc = (0, react.useRef)(false);
|
|
6747
|
+
const [targetList, setTargetList] = (0, react.useState)([]);
|
|
6748
|
+
const [wrapperStyle, setWrapperStyle] = (0, react.useState)({
|
|
6749
|
+
height: void 0,
|
|
6750
|
+
marginTop: void 0
|
|
6751
|
+
});
|
|
6752
|
+
const calculateRange = () => {
|
|
6753
|
+
const container = containerTarget.current;
|
|
6754
|
+
if (container) {
|
|
6755
|
+
const { scrollTop, clientHeight } = container;
|
|
6756
|
+
const offset = getOffset(scrollTop);
|
|
6757
|
+
const visibleCount = getVisibleCount(clientHeight, offset);
|
|
6758
|
+
const start = Math.max(0, offset - overscan);
|
|
6759
|
+
const end = Math.min(list.length, offset + visibleCount + overscan);
|
|
6760
|
+
const offsetTop = getDistanceTop(start);
|
|
6761
|
+
setWrapperStyle({
|
|
6762
|
+
height: `${totalHeight - offsetTop}px`,
|
|
6763
|
+
marginTop: `${offsetTop}px`
|
|
6764
|
+
});
|
|
6765
|
+
setTargetList(list.slice(start, end).map((ele, index) => ({
|
|
6766
|
+
data: ele,
|
|
6767
|
+
index: index + start
|
|
6768
|
+
})));
|
|
6769
|
+
}
|
|
6770
|
+
};
|
|
6703
6771
|
(0, react.useEffect)(() => {
|
|
6704
6772
|
if (!(size === null || size === void 0 ? void 0 : size.width) || !(size === null || size === void 0 ? void 0 : size.height)) return;
|
|
6705
6773
|
calculateRange();
|
|
@@ -7025,7 +7093,7 @@ const IUIController = (0, _univerjs_core.createIdentifier)("univer.ui.ui-control
|
|
|
7025
7093
|
//#endregion
|
|
7026
7094
|
//#region package.json
|
|
7027
7095
|
var name = "@univerjs/ui";
|
|
7028
|
-
var version = "1.0
|
|
7096
|
+
var version = "1.2.0";
|
|
7029
7097
|
|
|
7030
7098
|
//#endregion
|
|
7031
7099
|
//#region src/views/color-picker/interface.ts
|
|
@@ -22697,6 +22765,37 @@ function EmojiPicker(props) {
|
|
|
22697
22765
|
const recentStorageKey = (extraProps === null || extraProps === void 0 ? void 0 : extraProps.recentStorageKey) ?? RECENTS_STORAGE_KEY;
|
|
22698
22766
|
const isSearching = deferredQuery.trim().length > 0;
|
|
22699
22767
|
const { rows, sectionPositions } = (0, react.useMemo)(() => {
|
|
22768
|
+
function createEmojiVirtualRows(sections, locale) {
|
|
22769
|
+
const rows = [];
|
|
22770
|
+
const sectionPositions = [];
|
|
22771
|
+
let top = 0;
|
|
22772
|
+
sections.forEach((section) => {
|
|
22773
|
+
if (!section.emojis.length) return;
|
|
22774
|
+
sectionPositions.push({
|
|
22775
|
+
key: section.key,
|
|
22776
|
+
rowIndex: rows.length,
|
|
22777
|
+
top
|
|
22778
|
+
});
|
|
22779
|
+
rows.push({
|
|
22780
|
+
key: `${locale}-${section.key}-header`,
|
|
22781
|
+
title: section.title,
|
|
22782
|
+
type: "header"
|
|
22783
|
+
});
|
|
22784
|
+
top += EMOJI_SECTION_HEADER_HEIGHT;
|
|
22785
|
+
for (let start = 0; start < section.emojis.length; start += EMOJI_COLUMN_COUNT) {
|
|
22786
|
+
rows.push({
|
|
22787
|
+
items: section.emojis.slice(start, start + EMOJI_COLUMN_COUNT),
|
|
22788
|
+
key: `${locale}-${section.key}-${start / EMOJI_COLUMN_COUNT}`,
|
|
22789
|
+
type: "emojis"
|
|
22790
|
+
});
|
|
22791
|
+
top += EMOJI_ROW_HEIGHT;
|
|
22792
|
+
}
|
|
22793
|
+
});
|
|
22794
|
+
return {
|
|
22795
|
+
rows,
|
|
22796
|
+
sectionPositions
|
|
22797
|
+
};
|
|
22798
|
+
}
|
|
22700
22799
|
const normalSections = [{
|
|
22701
22800
|
key: "recent",
|
|
22702
22801
|
title: localeService.t("ui.emojiPicker.recents"),
|
|
@@ -22721,7 +22820,7 @@ function EmojiPicker(props) {
|
|
|
22721
22820
|
]);
|
|
22722
22821
|
const [virtualRows, { containerProps, scrollTo, wrapperStyle }] = useVirtualList(rows, {
|
|
22723
22822
|
containerTarget: scrollRef,
|
|
22724
|
-
itemHeight:
|
|
22823
|
+
itemHeight: (_index, row) => row.type === "header" ? EMOJI_SECTION_HEADER_HEIGHT : EMOJI_ROW_HEIGHT,
|
|
22725
22824
|
overscan: EMOJI_VIRTUAL_OVERSCAN
|
|
22726
22825
|
});
|
|
22727
22826
|
(0, react.useEffect)(() => {
|
|
@@ -22753,6 +22852,16 @@ function EmojiPicker(props) {
|
|
|
22753
22852
|
scrollTo,
|
|
22754
22853
|
sectionPositions
|
|
22755
22854
|
]);
|
|
22855
|
+
function writeStorageItem(localStorageService, storageKey, value) {
|
|
22856
|
+
localStorageService.setItem(storageKey, value).catch(() => void 0);
|
|
22857
|
+
}
|
|
22858
|
+
function getActiveSectionByScrollTop(sectionPositions, scrollTop) {
|
|
22859
|
+
let active = "recent";
|
|
22860
|
+
sectionPositions.forEach((position) => {
|
|
22861
|
+
if (position.top <= scrollTop + ACTIVE_SECTION_SCROLL_OFFSET) active = position.key;
|
|
22862
|
+
});
|
|
22863
|
+
return active;
|
|
22864
|
+
}
|
|
22756
22865
|
const handleSelect = (item, options) => {
|
|
22757
22866
|
var _props$onChange, _extraProps$onSelect;
|
|
22758
22867
|
const nextRecents = promoteRecentEmoji(recents, item);
|
|
@@ -22917,7 +23026,7 @@ function EmojiButton(props) {
|
|
|
22917
23026
|
type: "button",
|
|
22918
23027
|
"aria-label": `${title}, ${props.moreTitle}`,
|
|
22919
23028
|
title: `${title}, ${props.moreTitle}`,
|
|
22920
|
-
className: "univer-
|
|
23029
|
+
className: "univer-absolute univer-bottom-0 univer-right-0 univer-flex univer-size-3 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-border-0 univer-bg-gray-0 univer-p-0 univer-text-gray-500 hover:univer-bg-gray-100 hover:univer-text-gray-700 focus-visible:univer-outline-none focus-visible:univer-ring-1 focus-visible:univer-ring-primary-600 dark:!univer-bg-gray-800 dark:!univer-text-gray-300 dark:hover:!univer-bg-gray-700",
|
|
22921
23030
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.MoreDownIcon, { className: "!univer-size-2.5" })
|
|
22922
23031
|
})
|
|
22923
23032
|
})]
|
|
@@ -23005,50 +23114,6 @@ function CategoryButton(props) {
|
|
|
23005
23114
|
children: props.children
|
|
23006
23115
|
});
|
|
23007
23116
|
}
|
|
23008
|
-
function writeStorageItem(localStorageService, storageKey, value) {
|
|
23009
|
-
localStorageService.setItem(storageKey, value).catch(() => void 0);
|
|
23010
|
-
}
|
|
23011
|
-
function createEmojiVirtualRows(sections, locale) {
|
|
23012
|
-
const rows = [];
|
|
23013
|
-
const sectionPositions = [];
|
|
23014
|
-
let top = 0;
|
|
23015
|
-
sections.forEach((section) => {
|
|
23016
|
-
if (!section.emojis.length) return;
|
|
23017
|
-
sectionPositions.push({
|
|
23018
|
-
key: section.key,
|
|
23019
|
-
rowIndex: rows.length,
|
|
23020
|
-
top
|
|
23021
|
-
});
|
|
23022
|
-
rows.push({
|
|
23023
|
-
key: `${locale}-${section.key}-header`,
|
|
23024
|
-
title: section.title,
|
|
23025
|
-
type: "header"
|
|
23026
|
-
});
|
|
23027
|
-
top += EMOJI_SECTION_HEADER_HEIGHT;
|
|
23028
|
-
for (let start = 0; start < section.emojis.length; start += EMOJI_COLUMN_COUNT) {
|
|
23029
|
-
rows.push({
|
|
23030
|
-
items: section.emojis.slice(start, start + EMOJI_COLUMN_COUNT),
|
|
23031
|
-
key: `${locale}-${section.key}-${start / EMOJI_COLUMN_COUNT}`,
|
|
23032
|
-
type: "emojis"
|
|
23033
|
-
});
|
|
23034
|
-
top += EMOJI_ROW_HEIGHT;
|
|
23035
|
-
}
|
|
23036
|
-
});
|
|
23037
|
-
return {
|
|
23038
|
-
rows,
|
|
23039
|
-
sectionPositions
|
|
23040
|
-
};
|
|
23041
|
-
}
|
|
23042
|
-
function getEmojiVirtualRowHeight(_index, row) {
|
|
23043
|
-
return row.type === "header" ? EMOJI_SECTION_HEADER_HEIGHT : EMOJI_ROW_HEIGHT;
|
|
23044
|
-
}
|
|
23045
|
-
function getActiveSectionByScrollTop(sectionPositions, scrollTop) {
|
|
23046
|
-
let active = "recent";
|
|
23047
|
-
sectionPositions.forEach((position) => {
|
|
23048
|
-
if (position.top <= scrollTop + ACTIVE_SECTION_SCROLL_OFFSET) active = position.key;
|
|
23049
|
-
});
|
|
23050
|
-
return active;
|
|
23051
|
-
}
|
|
23052
23117
|
function CategoryIcon(props) {
|
|
23053
23118
|
switch (props.category) {
|
|
23054
23119
|
case "activity": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.ActivityIcon, {});
|
|
@@ -24112,7 +24177,7 @@ function MobileRibbonToolbar(props) {
|
|
|
24112
24177
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
24113
24178
|
className: (0, _univerjs_design.clsx)("univer-flex univer-shrink-0 univer-items-center univer-gap-0.5 univer-pr-1.5 rtl:univer-pl-1.5 rtl:univer-pr-0", { [_univerjs_design.borderRightClassName]: groupIndex !== activeGroups.length - 1 }),
|
|
24114
24179
|
children: groupItems.map((child) => child.item && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
24115
|
-
className: (0, _univerjs_design.clsx)("
|
|
24180
|
+
className: (0, _univerjs_design.clsx)("univer-flex univer-h-8 univer-shrink-0 univer-items-center univer-rounded-md [&_*]:univer-box-border [&_.univer-custom-label]:univer-text-sm [&_.univer-custom-label]:univer-leading-none [&_.univer-toolbar-button-selector-main]:!univer-h-8 [&_.univer-toolbar-button-selector-main]:!univer-rounded-none [&_.univer-toolbar-button-selector-main]:!univer-rounded-l-md [&_.univer-toolbar-button-selector-main]:!univer-px-1.5 [&_.univer-toolbar-button-selector-root]:!univer-h-8 [&_.univer-toolbar-button-selector-root]:univer-overflow-hidden [&_.univer-toolbar-button-selector-root]:!univer-rounded-md [&_.univer-toolbar-button-selector-root]:!univer-pr-0 [&_.univer-toolbar-button-selector-trigger]:!univer-static [&_.univer-toolbar-button-selector-trigger]:!univer-h-8 [&_.univer-toolbar-button-selector-trigger]:!univer-w-6 [&_.univer-toolbar-button-selector-trigger]:!univer-rounded-none [&_.univer-toolbar-button-selector-trigger]:!univer-rounded-r-md [&_.univer-toolbar-selector-root]:!univer-h-8 [&_.univer-toolbar-selector-root]:!univer-gap-1 [&_.univer-toolbar-selector-root]:!univer-rounded-md [&_.univer-toolbar-selector-root]:!univer-px-1.5 [&_.univer-toolbar-selector-trigger]:!univer-pl-0.5 [&_.univer-tooltip]:univer-inline-flex [&_.univer-tooltip]:univer-h-full [&_.univer-tooltip]:univer-items-center [&_[data-u-command]]:!univer-h-8 [&_[data-u-command]]:!univer-min-h-8 [&_[data-u-command]]:!univer-rounded-md [&_[data-u-command]]:!univer-px-1.5 [&_button]:!univer-m-0 [&_button]:!univer-h-8 [&_button]:!univer-min-w-8 [&_button]:!univer-appearance-none [&_button]:!univer-rounded-md [&_button]:!univer-border-0 [&_button]:!univer-bg-transparent [&_button]:!univer-p-0 [&_button]:!univer-px-1.5 [&_button]:!univer-leading-none [&_button]:!univer-outline-none [&_button]:![font-family:inherit] [&_input]:!univer-m-0 [&_input]:!univer-appearance-none [&_input]:!univer-border-0 [&_input]:!univer-bg-transparent [&_input]:!univer-p-0 [&_input]:!univer-leading-none [&_input]:!univer-outline-none"),
|
|
24116
24181
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MobileToolbarItem, {
|
|
24117
24182
|
...child.item,
|
|
24118
24183
|
preserveStrokeWidth: true
|
|
@@ -24548,7 +24613,7 @@ function MobileSchemaRow(props) {
|
|
|
24548
24613
|
if (disabled) return;
|
|
24549
24614
|
onExecute === null || onExecute === void 0 || onExecute({
|
|
24550
24615
|
commandId: menuItem.commandId,
|
|
24551
|
-
value: nextValue,
|
|
24616
|
+
value: typeof value === "number" && (0, _univerjs_core.isRealNum)(nextValue) ? Number(nextValue) : nextValue,
|
|
24552
24617
|
id: menuItem.id,
|
|
24553
24618
|
label: schema.key,
|
|
24554
24619
|
params: menuItem.params
|
|
@@ -27787,7 +27852,7 @@ function Slider(props) {
|
|
|
27787
27852
|
onPointerDown: handlePointerDown,
|
|
27788
27853
|
children: [
|
|
27789
27854
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
27790
|
-
className: (0, _univerjs_design.clsx)("univer-
|
|
27855
|
+
className: (0, _univerjs_design.clsx)("univer-absolute univer-top-0 univer-h-full univer-rounded-full univer-bg-primary-500", isRtl ? "univer-right-0" : "univer-left-0"),
|
|
27791
27856
|
style: { width: `${sliderOffset}%` }
|
|
27792
27857
|
}),
|
|
27793
27858
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
@@ -29871,7 +29936,7 @@ function ProgressBar(props) {
|
|
|
29871
29936
|
|
|
29872
29937
|
//#endregion
|
|
29873
29938
|
exports.AnchoredContextMenu = AnchoredContextMenu;
|
|
29874
|
-
Object.defineProperty(exports,
|
|
29939
|
+
Object.defineProperty(exports, "BrowserClipboardService", {
|
|
29875
29940
|
enumerable: true,
|
|
29876
29941
|
get: function () {
|
|
29877
29942
|
return BrowserClipboardService;
|
|
@@ -29886,7 +29951,7 @@ exports.CanvasPopup = CanvasPopup;
|
|
|
29886
29951
|
exports.CanvasPopupService = CanvasPopupService;
|
|
29887
29952
|
exports.CommonLabel = CommonLabel;
|
|
29888
29953
|
exports.ComponentContainer = ComponentContainer;
|
|
29889
|
-
Object.defineProperty(exports,
|
|
29954
|
+
Object.defineProperty(exports, "ComponentManager", {
|
|
29890
29955
|
enumerable: true,
|
|
29891
29956
|
get: function () {
|
|
29892
29957
|
return ComponentManager;
|
|
@@ -29904,31 +29969,31 @@ exports.CustomLabel = CustomLabel;
|
|
|
29904
29969
|
exports.CutCommand = CutCommand;
|
|
29905
29970
|
exports.CutShortcutItem = CutShortcutItem;
|
|
29906
29971
|
exports.DISABLE_AUTO_FOCUS_KEY = DISABLE_AUTO_FOCUS_KEY;
|
|
29907
|
-
Object.defineProperty(exports,
|
|
29972
|
+
Object.defineProperty(exports, "DesktopBeforeCloseService", {
|
|
29908
29973
|
enumerable: true,
|
|
29909
29974
|
get: function () {
|
|
29910
29975
|
return DesktopBeforeCloseService;
|
|
29911
29976
|
}
|
|
29912
29977
|
});
|
|
29913
|
-
Object.defineProperty(exports,
|
|
29978
|
+
Object.defineProperty(exports, "DesktopConfirmService", {
|
|
29914
29979
|
enumerable: true,
|
|
29915
29980
|
get: function () {
|
|
29916
29981
|
return DesktopConfirmService;
|
|
29917
29982
|
}
|
|
29918
29983
|
});
|
|
29919
|
-
Object.defineProperty(exports,
|
|
29984
|
+
Object.defineProperty(exports, "DesktopDialogService", {
|
|
29920
29985
|
enumerable: true,
|
|
29921
29986
|
get: function () {
|
|
29922
29987
|
return DesktopDialogService;
|
|
29923
29988
|
}
|
|
29924
29989
|
});
|
|
29925
|
-
Object.defineProperty(exports,
|
|
29990
|
+
Object.defineProperty(exports, "DesktopGalleryService", {
|
|
29926
29991
|
enumerable: true,
|
|
29927
29992
|
get: function () {
|
|
29928
29993
|
return DesktopGalleryService;
|
|
29929
29994
|
}
|
|
29930
29995
|
});
|
|
29931
|
-
Object.defineProperty(exports,
|
|
29996
|
+
Object.defineProperty(exports, "DesktopLayoutService", {
|
|
29932
29997
|
enumerable: true,
|
|
29933
29998
|
get: function () {
|
|
29934
29999
|
return DesktopLayoutService;
|
|
@@ -29936,26 +30001,26 @@ Object.defineProperty(exports, 'DesktopLayoutService', {
|
|
|
29936
30001
|
});
|
|
29937
30002
|
exports.DesktopLocalFileService = DesktopLocalFileService;
|
|
29938
30003
|
exports.DesktopLocalStorageService = DesktopLocalStorageService;
|
|
29939
|
-
Object.defineProperty(exports,
|
|
30004
|
+
Object.defineProperty(exports, "DesktopMessageService", {
|
|
29940
30005
|
enumerable: true,
|
|
29941
30006
|
get: function () {
|
|
29942
30007
|
return DesktopMessageService;
|
|
29943
30008
|
}
|
|
29944
30009
|
});
|
|
29945
|
-
Object.defineProperty(exports,
|
|
30010
|
+
Object.defineProperty(exports, "DesktopNotificationService", {
|
|
29946
30011
|
enumerable: true,
|
|
29947
30012
|
get: function () {
|
|
29948
30013
|
return DesktopNotificationService;
|
|
29949
30014
|
}
|
|
29950
30015
|
});
|
|
29951
|
-
Object.defineProperty(exports,
|
|
30016
|
+
Object.defineProperty(exports, "DesktopRibbonService", {
|
|
29952
30017
|
enumerable: true,
|
|
29953
30018
|
get: function () {
|
|
29954
30019
|
return DesktopRibbonService;
|
|
29955
30020
|
}
|
|
29956
30021
|
});
|
|
29957
30022
|
exports.DesktopSidebarService = DesktopSidebarService;
|
|
29958
|
-
Object.defineProperty(exports,
|
|
30023
|
+
Object.defineProperty(exports, "DesktopUIController", {
|
|
29959
30024
|
enumerable: true,
|
|
29960
30025
|
get: function () {
|
|
29961
30026
|
return DesktopUIController;
|
|
@@ -29967,7 +30032,7 @@ exports.EMOJI_CATEGORIES = EMOJI_CATEGORIES;
|
|
|
29967
30032
|
exports.EMOJI_PICKER_COMPONENT = EMOJI_PICKER_COMPONENT;
|
|
29968
30033
|
exports.EMOJI_RECENT_LIMIT = EMOJI_RECENT_LIMIT;
|
|
29969
30034
|
exports.EmojiPicker = EmojiPicker;
|
|
29970
|
-
Object.defineProperty(exports,
|
|
30035
|
+
Object.defineProperty(exports, "ErrorController", {
|
|
29971
30036
|
enumerable: true,
|
|
29972
30037
|
get: function () {
|
|
29973
30038
|
return ErrorController;
|
|
@@ -29988,7 +30053,7 @@ exports.FloatingObjectToolbarPosition = FloatingObjectToolbarPosition;
|
|
|
29988
30053
|
exports.FontFamily = FontFamily;
|
|
29989
30054
|
exports.FontFamilyDropdown = FontFamilyDropdown;
|
|
29990
30055
|
exports.FontFamilyItem = FontFamilyItem;
|
|
29991
|
-
Object.defineProperty(exports,
|
|
30056
|
+
Object.defineProperty(exports, "FontService", {
|
|
29992
30057
|
enumerable: true,
|
|
29993
30058
|
get: function () {
|
|
29994
30059
|
return FontService;
|
|
@@ -30026,7 +30091,7 @@ exports.IUIPartsService = IUIPartsService;
|
|
|
30026
30091
|
exports.IUIRuntimeScopeService = IUIRuntimeScopeService;
|
|
30027
30092
|
exports.IUnitPresenceUIAdapterRegistry = IUnitPresenceUIAdapterRegistry;
|
|
30028
30093
|
exports.IWorkbenchService = IWorkbenchService;
|
|
30029
|
-
Object.defineProperty(exports,
|
|
30094
|
+
Object.defineProperty(exports, "IconManager", {
|
|
30030
30095
|
enumerable: true,
|
|
30031
30096
|
get: function () {
|
|
30032
30097
|
return IconManager;
|
|
@@ -30036,7 +30101,7 @@ exports.KeyCode = KeyCode;
|
|
|
30036
30101
|
exports.MOBILE_UI_MODE = MOBILE_UI_MODE;
|
|
30037
30102
|
exports.MenuItemType = MenuItemType;
|
|
30038
30103
|
exports.MenuManagerPosition = MenuManagerPosition;
|
|
30039
|
-
Object.defineProperty(exports,
|
|
30104
|
+
Object.defineProperty(exports, "MenuManagerService", {
|
|
30040
30105
|
enumerable: true,
|
|
30041
30106
|
get: function () {
|
|
30042
30107
|
return MenuManagerService;
|
|
@@ -30045,7 +30110,7 @@ Object.defineProperty(exports, 'MenuManagerService', {
|
|
|
30045
30110
|
exports.MetaKeys = MetaKeys;
|
|
30046
30111
|
exports.MobileCanvasGesture = MobileCanvasGesture;
|
|
30047
30112
|
exports.MobileContextMenu = MobileContextMenu;
|
|
30048
|
-
Object.defineProperty(exports,
|
|
30113
|
+
Object.defineProperty(exports, "MobileDialogService", {
|
|
30049
30114
|
enumerable: true,
|
|
30050
30115
|
get: function () {
|
|
30051
30116
|
return MobileDialogService;
|
|
@@ -30066,19 +30131,19 @@ exports.PlatformService = PlatformService;
|
|
|
30066
30131
|
exports.PrintFloatDomSingle = PrintFloatDomSingle;
|
|
30067
30132
|
exports.ProgressBar = ProgressBar;
|
|
30068
30133
|
exports.RectPopup = RectPopup;
|
|
30069
|
-
Object.defineProperty(exports,
|
|
30134
|
+
Object.defineProperty(exports, "RediConsumer", {
|
|
30070
30135
|
enumerable: true,
|
|
30071
30136
|
get: function () {
|
|
30072
30137
|
return _wendellhu_redi_react_bindings.RediConsumer;
|
|
30073
30138
|
}
|
|
30074
30139
|
});
|
|
30075
|
-
Object.defineProperty(exports,
|
|
30140
|
+
Object.defineProperty(exports, "RediContext", {
|
|
30076
30141
|
enumerable: true,
|
|
30077
30142
|
get: function () {
|
|
30078
30143
|
return _wendellhu_redi_react_bindings.RediContext;
|
|
30079
30144
|
}
|
|
30080
30145
|
});
|
|
30081
|
-
Object.defineProperty(exports,
|
|
30146
|
+
Object.defineProperty(exports, "RediProvider", {
|
|
30082
30147
|
enumerable: true,
|
|
30083
30148
|
get: function () {
|
|
30084
30149
|
return _wendellhu_redi_react_bindings.RediProvider;
|
|
@@ -30096,21 +30161,21 @@ exports.RibbonStartGroup = RibbonStartGroup;
|
|
|
30096
30161
|
exports.RibbonViewGroup = RibbonViewGroup;
|
|
30097
30162
|
exports.SYMBOL_CATEGORIES = SYMBOL_CATEGORIES;
|
|
30098
30163
|
exports.SYMBOL_PICKER_COMPONENT = SYMBOL_PICKER_COMPONENT;
|
|
30099
|
-
Object.defineProperty(exports,
|
|
30164
|
+
Object.defineProperty(exports, "SharedController", {
|
|
30100
30165
|
enumerable: true,
|
|
30101
30166
|
get: function () {
|
|
30102
30167
|
return SharedController;
|
|
30103
30168
|
}
|
|
30104
30169
|
});
|
|
30105
30170
|
exports.SheetPasteShortKeyCommandName = SheetPasteShortKeyCommandName;
|
|
30106
|
-
Object.defineProperty(exports,
|
|
30171
|
+
Object.defineProperty(exports, "ShortcutPanelController", {
|
|
30107
30172
|
enumerable: true,
|
|
30108
30173
|
get: function () {
|
|
30109
30174
|
return ShortcutPanelController;
|
|
30110
30175
|
}
|
|
30111
30176
|
});
|
|
30112
30177
|
exports.ShortcutPanelService = ShortcutPanelService;
|
|
30113
|
-
Object.defineProperty(exports,
|
|
30178
|
+
Object.defineProperty(exports, "ShortcutService", {
|
|
30114
30179
|
enumerable: true,
|
|
30115
30180
|
get: function () {
|
|
30116
30181
|
return ShortcutService;
|
|
@@ -30131,7 +30196,7 @@ exports.UIPartsService = UIPartsService;
|
|
|
30131
30196
|
exports.UIRuntimeScopeService = UIRuntimeScopeService;
|
|
30132
30197
|
exports.UI_PLUGIN_CONFIG_KEY = UI_PLUGIN_CONFIG_KEY;
|
|
30133
30198
|
exports.UNI_DISABLE_CHANGING_FOCUS_KEY = UNI_DISABLE_CHANGING_FOCUS_KEY;
|
|
30134
|
-
Object.defineProperty(exports,
|
|
30199
|
+
Object.defineProperty(exports, "UndoRedoGroupService", {
|
|
30135
30200
|
enumerable: true,
|
|
30136
30201
|
get: function () {
|
|
30137
30202
|
return UndoRedoGroupService;
|
|
@@ -30139,25 +30204,25 @@ Object.defineProperty(exports, 'UndoRedoGroupService', {
|
|
|
30139
30204
|
});
|
|
30140
30205
|
exports.UndoShortcutItem = UndoShortcutItem;
|
|
30141
30206
|
exports.UnitPresenceUIAdapterRegistry = UnitPresenceUIAdapterRegistry;
|
|
30142
|
-
Object.defineProperty(exports,
|
|
30207
|
+
Object.defineProperty(exports, "UniverMobileUIPlugin", {
|
|
30143
30208
|
enumerable: true,
|
|
30144
30209
|
get: function () {
|
|
30145
30210
|
return UniverMobileUIPlugin;
|
|
30146
30211
|
}
|
|
30147
30212
|
});
|
|
30148
|
-
Object.defineProperty(exports,
|
|
30213
|
+
Object.defineProperty(exports, "UniverUIPlugin", {
|
|
30149
30214
|
enumerable: true,
|
|
30150
30215
|
get: function () {
|
|
30151
30216
|
return UniverUIPlugin;
|
|
30152
30217
|
}
|
|
30153
30218
|
});
|
|
30154
|
-
Object.defineProperty(exports,
|
|
30219
|
+
Object.defineProperty(exports, "WithDependency", {
|
|
30155
30220
|
enumerable: true,
|
|
30156
30221
|
get: function () {
|
|
30157
30222
|
return _wendellhu_redi_react_bindings.WithDependency;
|
|
30158
30223
|
}
|
|
30159
30224
|
});
|
|
30160
|
-
Object.defineProperty(exports,
|
|
30225
|
+
Object.defineProperty(exports, "WorkbenchService", {
|
|
30161
30226
|
enumerable: true,
|
|
30162
30227
|
get: function () {
|
|
30163
30228
|
return WorkbenchService;
|
|
@@ -30166,13 +30231,13 @@ Object.defineProperty(exports, 'WorkbenchService', {
|
|
|
30166
30231
|
exports.ZIndexManager = ZIndexManager;
|
|
30167
30232
|
exports.ZoomInput = ZoomInput;
|
|
30168
30233
|
exports.bindFormatPainterCanvas = bindFormatPainterCanvas;
|
|
30169
|
-
Object.defineProperty(exports,
|
|
30234
|
+
Object.defineProperty(exports, "connectDependencies", {
|
|
30170
30235
|
enumerable: true,
|
|
30171
30236
|
get: function () {
|
|
30172
30237
|
return _wendellhu_redi_react_bindings.connectDependencies;
|
|
30173
30238
|
}
|
|
30174
30239
|
});
|
|
30175
|
-
Object.defineProperty(exports,
|
|
30240
|
+
Object.defineProperty(exports, "connectInjector", {
|
|
30176
30241
|
enumerable: true,
|
|
30177
30242
|
get: function () {
|
|
30178
30243
|
return _wendellhu_redi_react_bindings.connectInjector;
|
|
@@ -30217,14 +30282,14 @@ exports.useClickOutSide = useClickOutSide;
|
|
|
30217
30282
|
exports.useComponentsOfPart = useComponentsOfPart;
|
|
30218
30283
|
exports.useConfigValue = useConfigValue;
|
|
30219
30284
|
exports.useDebounceFn = useDebounceFn;
|
|
30220
|
-
Object.defineProperty(exports,
|
|
30285
|
+
Object.defineProperty(exports, "useDependency", {
|
|
30221
30286
|
enumerable: true,
|
|
30222
30287
|
get: function () {
|
|
30223
30288
|
return _wendellhu_redi_react_bindings.useDependency;
|
|
30224
30289
|
}
|
|
30225
30290
|
});
|
|
30226
30291
|
exports.useEvent = useEvent;
|
|
30227
|
-
Object.defineProperty(exports,
|
|
30292
|
+
Object.defineProperty(exports, "useInjector", {
|
|
30228
30293
|
enumerable: true,
|
|
30229
30294
|
get: function () {
|
|
30230
30295
|
return _wendellhu_redi_react_bindings.useInjector;
|
|
@@ -30232,7 +30297,7 @@ Object.defineProperty(exports, 'useInjector', {
|
|
|
30232
30297
|
});
|
|
30233
30298
|
exports.useMobileCanvasPanel = useMobileCanvasPanel;
|
|
30234
30299
|
exports.useMobileCanvasViewport = useMobileCanvasViewport;
|
|
30235
|
-
Object.defineProperty(exports,
|
|
30300
|
+
Object.defineProperty(exports, "useObservable", {
|
|
30236
30301
|
enumerable: true,
|
|
30237
30302
|
get: function () {
|
|
30238
30303
|
return _wendellhu_redi_react_bindings.useObservable;
|
|
@@ -30242,7 +30307,7 @@ exports.useObservableRef = useObservableRef;
|
|
|
30242
30307
|
exports.useScrollYOverContainer = useScrollYOverContainer;
|
|
30243
30308
|
exports.useSidebarClick = useSidebarClick;
|
|
30244
30309
|
exports.useToolbarItemStatus = useToolbarItemStatus;
|
|
30245
|
-
Object.defineProperty(exports,
|
|
30310
|
+
Object.defineProperty(exports, "useUpdateBinder", {
|
|
30246
30311
|
enumerable: true,
|
|
30247
30312
|
get: function () {
|
|
30248
30313
|
return _wendellhu_redi_react_bindings.useUpdateBinder;
|