@univerjs/ui 1.0.4 → 1.1.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 +110 -99
- package/lib/es/facade.js +6 -6
- package/lib/es/index.js +77 -66
- package/lib/facade.js +6 -6
- package/lib/index.css +0 -8
- package/lib/index.js +77 -66
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +17 -17
- package/package.json +10 -10
package/lib/cjs/facade.js
CHANGED
|
@@ -3,7 +3,7 @@ let _univerjs_core_facade = require("@univerjs/core/facade");
|
|
|
3
3
|
let _univerjs_engine_render = require("@univerjs/engine-render");
|
|
4
4
|
let _univerjs_ui = require("@univerjs/ui");
|
|
5
5
|
|
|
6
|
-
//#region \0@oxc-project+runtime@0.
|
|
6
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
7
7
|
function _typeof(o) {
|
|
8
8
|
"@babel/helpers - typeof";
|
|
9
9
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -14,7 +14,7 @@ function _typeof(o) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
|
-
//#region \0@oxc-project+runtime@0.
|
|
17
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
18
18
|
function toPrimitive(t, r) {
|
|
19
19
|
if ("object" != _typeof(t) || !t) return t;
|
|
20
20
|
var e = t[Symbol.toPrimitive];
|
|
@@ -27,14 +27,14 @@ function toPrimitive(t, r) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
//#endregion
|
|
30
|
-
//#region \0@oxc-project+runtime@0.
|
|
30
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
31
31
|
function toPropertyKey(t) {
|
|
32
32
|
var i = toPrimitive(t, "string");
|
|
33
33
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
//#endregion
|
|
37
|
-
//#region \0@oxc-project+runtime@0.
|
|
37
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
38
38
|
function _defineProperty(e, r, t) {
|
|
39
39
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
40
40
|
value: t,
|
|
@@ -45,7 +45,7 @@ function _defineProperty(e, r, t) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
//#endregion
|
|
48
|
-
//#region \0@oxc-project+runtime@0.
|
|
48
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
49
49
|
function __decorateParam(paramIndex, decorator) {
|
|
50
50
|
return function(target, key) {
|
|
51
51
|
decorator(target, key, paramIndex);
|
|
@@ -53,7 +53,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
//#endregion
|
|
56
|
-
//#region \0@oxc-project+runtime@0.
|
|
56
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
57
57
|
function __decorate(decorators, target, key, desc) {
|
|
58
58
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
59
59
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
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);
|
|
@@ -4051,7 +4063,7 @@ const toolbarSelectorRootVariants = (0, _univerjs_design.cva)("univer-toolbar-se
|
|
|
4051
4063
|
false: "univer-text-gray-900 dark:!univer-text-gray-0"
|
|
4052
4064
|
},
|
|
4053
4065
|
active: {
|
|
4054
|
-
true: "univer-bg-gray-200",
|
|
4066
|
+
true: "univer-bg-gray-200 dark:!univer-bg-gray-500",
|
|
4055
4067
|
false: ""
|
|
4056
4068
|
}
|
|
4057
4069
|
},
|
|
@@ -4322,7 +4334,7 @@ function RibbonGrid({ groups, title, className, ...props }) {
|
|
|
4322
4334
|
const placements = placeRibbonGridItems(group.children ?? []);
|
|
4323
4335
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4324
4336
|
"data-u-comp": "ribbon-grid-group",
|
|
4325
|
-
className: "univer-relative univer-box-border univer-flex univer-
|
|
4337
|
+
className: "univer-relative univer-box-border univer-flex univer-shrink-0 univer-flex-col univer-px-2",
|
|
4326
4338
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4327
4339
|
"data-testid": "ribbon-grid-group-grid",
|
|
4328
4340
|
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 +4753,6 @@ var ContextMenuHostService = class extends _univerjs_core.Disposable {
|
|
|
4741
4753
|
}
|
|
4742
4754
|
};
|
|
4743
4755
|
|
|
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
4756
|
//#endregion
|
|
4791
4757
|
//#region src/views/hooks/prevent-browser-zoom.ts
|
|
4792
4758
|
/**
|
|
@@ -5452,7 +5418,6 @@ function ContextMenuPanel(props) {
|
|
|
5452
5418
|
menuSessionVersion
|
|
5453
5419
|
]);
|
|
5454
5420
|
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
5421
|
(0, react.useEffect)(() => {
|
|
5457
5422
|
if (!menuElement) return;
|
|
5458
5423
|
return preventBrowserZoomInContainers([menuElement]);
|
|
@@ -6544,6 +6509,52 @@ function WorkbenchSkeleton({ darkMode, direction, overlay = false }) {
|
|
|
6544
6509
|
});
|
|
6545
6510
|
}
|
|
6546
6511
|
|
|
6512
|
+
//#endregion
|
|
6513
|
+
//#region src/views/hooks/layout.ts
|
|
6514
|
+
/**
|
|
6515
|
+
* These hooks are used for browser layout
|
|
6516
|
+
* Prefer to client-side
|
|
6517
|
+
*/
|
|
6518
|
+
/**
|
|
6519
|
+
* Allow the element to scroll when its height over the container height
|
|
6520
|
+
* @param element
|
|
6521
|
+
* Container means the window view that the element displays in.
|
|
6522
|
+
* Recommend pass the sheet mountContainer as container
|
|
6523
|
+
* @param container
|
|
6524
|
+
*/
|
|
6525
|
+
function useScrollYOverContainer(element, container) {
|
|
6526
|
+
const updater = useEvent(() => {
|
|
6527
|
+
if (!element || !container) return;
|
|
6528
|
+
const elStyle = element.style;
|
|
6529
|
+
const { y, height } = element.getBoundingClientRect();
|
|
6530
|
+
const containerRect = container.getBoundingClientRect();
|
|
6531
|
+
const scrolled = element.scrollHeight > height;
|
|
6532
|
+
const isOverViewport = y < 0 || y + height > containerRect.height;
|
|
6533
|
+
if (!isOverViewport && !scrolled) {
|
|
6534
|
+
elStyle.overflowY = "";
|
|
6535
|
+
elStyle.maxHeight = "";
|
|
6536
|
+
return;
|
|
6537
|
+
}
|
|
6538
|
+
if (isOverViewport) {
|
|
6539
|
+
elStyle.overflowY = "auto";
|
|
6540
|
+
elStyle.maxHeight = y < 0 ? `${element.scrollHeight + y}px` : `${containerRect.height - y}px`;
|
|
6541
|
+
}
|
|
6542
|
+
});
|
|
6543
|
+
(0, react.useEffect)(() => {
|
|
6544
|
+
if (!(0, _univerjs_design.isBrowser)() || !element || !container) return;
|
|
6545
|
+
updater();
|
|
6546
|
+
const resizeObserver = new ResizeObserver(updater);
|
|
6547
|
+
resizeObserver.observe(element);
|
|
6548
|
+
return () => {
|
|
6549
|
+
resizeObserver.disconnect();
|
|
6550
|
+
};
|
|
6551
|
+
}, [element, container]);
|
|
6552
|
+
}
|
|
6553
|
+
function useConfigValue(configKey) {
|
|
6554
|
+
const configService = (0, _wendellhu_redi_react_bindings.useDependency)(_univerjs_core.IConfigService);
|
|
6555
|
+
return (0, _wendellhu_redi_react_bindings.useObservable)((0, react.useMemo)(() => configService.subscribeConfigValue$(configKey), [configService]), configService.getConfig(configKey));
|
|
6556
|
+
}
|
|
6557
|
+
|
|
6547
6558
|
//#endregion
|
|
6548
6559
|
//#region src/views/hooks/update-effect.ts
|
|
6549
6560
|
/**
|
|
@@ -7025,7 +7036,7 @@ const IUIController = (0, _univerjs_core.createIdentifier)("univer.ui.ui-control
|
|
|
7025
7036
|
//#endregion
|
|
7026
7037
|
//#region package.json
|
|
7027
7038
|
var name = "@univerjs/ui";
|
|
7028
|
-
var version = "1.0
|
|
7039
|
+
var version = "1.1.0";
|
|
7029
7040
|
|
|
7030
7041
|
//#endregion
|
|
7031
7042
|
//#region src/views/color-picker/interface.ts
|
|
@@ -24548,7 +24559,7 @@ function MobileSchemaRow(props) {
|
|
|
24548
24559
|
if (disabled) return;
|
|
24549
24560
|
onExecute === null || onExecute === void 0 || onExecute({
|
|
24550
24561
|
commandId: menuItem.commandId,
|
|
24551
|
-
value: nextValue,
|
|
24562
|
+
value: typeof value === "number" && (0, _univerjs_core.isRealNum)(nextValue) ? Number(nextValue) : nextValue,
|
|
24552
24563
|
id: menuItem.id,
|
|
24553
24564
|
label: schema.key,
|
|
24554
24565
|
params: menuItem.params
|
|
@@ -29871,7 +29882,7 @@ function ProgressBar(props) {
|
|
|
29871
29882
|
|
|
29872
29883
|
//#endregion
|
|
29873
29884
|
exports.AnchoredContextMenu = AnchoredContextMenu;
|
|
29874
|
-
Object.defineProperty(exports,
|
|
29885
|
+
Object.defineProperty(exports, "BrowserClipboardService", {
|
|
29875
29886
|
enumerable: true,
|
|
29876
29887
|
get: function () {
|
|
29877
29888
|
return BrowserClipboardService;
|
|
@@ -29886,7 +29897,7 @@ exports.CanvasPopup = CanvasPopup;
|
|
|
29886
29897
|
exports.CanvasPopupService = CanvasPopupService;
|
|
29887
29898
|
exports.CommonLabel = CommonLabel;
|
|
29888
29899
|
exports.ComponentContainer = ComponentContainer;
|
|
29889
|
-
Object.defineProperty(exports,
|
|
29900
|
+
Object.defineProperty(exports, "ComponentManager", {
|
|
29890
29901
|
enumerable: true,
|
|
29891
29902
|
get: function () {
|
|
29892
29903
|
return ComponentManager;
|
|
@@ -29904,31 +29915,31 @@ exports.CustomLabel = CustomLabel;
|
|
|
29904
29915
|
exports.CutCommand = CutCommand;
|
|
29905
29916
|
exports.CutShortcutItem = CutShortcutItem;
|
|
29906
29917
|
exports.DISABLE_AUTO_FOCUS_KEY = DISABLE_AUTO_FOCUS_KEY;
|
|
29907
|
-
Object.defineProperty(exports,
|
|
29918
|
+
Object.defineProperty(exports, "DesktopBeforeCloseService", {
|
|
29908
29919
|
enumerable: true,
|
|
29909
29920
|
get: function () {
|
|
29910
29921
|
return DesktopBeforeCloseService;
|
|
29911
29922
|
}
|
|
29912
29923
|
});
|
|
29913
|
-
Object.defineProperty(exports,
|
|
29924
|
+
Object.defineProperty(exports, "DesktopConfirmService", {
|
|
29914
29925
|
enumerable: true,
|
|
29915
29926
|
get: function () {
|
|
29916
29927
|
return DesktopConfirmService;
|
|
29917
29928
|
}
|
|
29918
29929
|
});
|
|
29919
|
-
Object.defineProperty(exports,
|
|
29930
|
+
Object.defineProperty(exports, "DesktopDialogService", {
|
|
29920
29931
|
enumerable: true,
|
|
29921
29932
|
get: function () {
|
|
29922
29933
|
return DesktopDialogService;
|
|
29923
29934
|
}
|
|
29924
29935
|
});
|
|
29925
|
-
Object.defineProperty(exports,
|
|
29936
|
+
Object.defineProperty(exports, "DesktopGalleryService", {
|
|
29926
29937
|
enumerable: true,
|
|
29927
29938
|
get: function () {
|
|
29928
29939
|
return DesktopGalleryService;
|
|
29929
29940
|
}
|
|
29930
29941
|
});
|
|
29931
|
-
Object.defineProperty(exports,
|
|
29942
|
+
Object.defineProperty(exports, "DesktopLayoutService", {
|
|
29932
29943
|
enumerable: true,
|
|
29933
29944
|
get: function () {
|
|
29934
29945
|
return DesktopLayoutService;
|
|
@@ -29936,26 +29947,26 @@ Object.defineProperty(exports, 'DesktopLayoutService', {
|
|
|
29936
29947
|
});
|
|
29937
29948
|
exports.DesktopLocalFileService = DesktopLocalFileService;
|
|
29938
29949
|
exports.DesktopLocalStorageService = DesktopLocalStorageService;
|
|
29939
|
-
Object.defineProperty(exports,
|
|
29950
|
+
Object.defineProperty(exports, "DesktopMessageService", {
|
|
29940
29951
|
enumerable: true,
|
|
29941
29952
|
get: function () {
|
|
29942
29953
|
return DesktopMessageService;
|
|
29943
29954
|
}
|
|
29944
29955
|
});
|
|
29945
|
-
Object.defineProperty(exports,
|
|
29956
|
+
Object.defineProperty(exports, "DesktopNotificationService", {
|
|
29946
29957
|
enumerable: true,
|
|
29947
29958
|
get: function () {
|
|
29948
29959
|
return DesktopNotificationService;
|
|
29949
29960
|
}
|
|
29950
29961
|
});
|
|
29951
|
-
Object.defineProperty(exports,
|
|
29962
|
+
Object.defineProperty(exports, "DesktopRibbonService", {
|
|
29952
29963
|
enumerable: true,
|
|
29953
29964
|
get: function () {
|
|
29954
29965
|
return DesktopRibbonService;
|
|
29955
29966
|
}
|
|
29956
29967
|
});
|
|
29957
29968
|
exports.DesktopSidebarService = DesktopSidebarService;
|
|
29958
|
-
Object.defineProperty(exports,
|
|
29969
|
+
Object.defineProperty(exports, "DesktopUIController", {
|
|
29959
29970
|
enumerable: true,
|
|
29960
29971
|
get: function () {
|
|
29961
29972
|
return DesktopUIController;
|
|
@@ -29967,7 +29978,7 @@ exports.EMOJI_CATEGORIES = EMOJI_CATEGORIES;
|
|
|
29967
29978
|
exports.EMOJI_PICKER_COMPONENT = EMOJI_PICKER_COMPONENT;
|
|
29968
29979
|
exports.EMOJI_RECENT_LIMIT = EMOJI_RECENT_LIMIT;
|
|
29969
29980
|
exports.EmojiPicker = EmojiPicker;
|
|
29970
|
-
Object.defineProperty(exports,
|
|
29981
|
+
Object.defineProperty(exports, "ErrorController", {
|
|
29971
29982
|
enumerable: true,
|
|
29972
29983
|
get: function () {
|
|
29973
29984
|
return ErrorController;
|
|
@@ -29988,7 +29999,7 @@ exports.FloatingObjectToolbarPosition = FloatingObjectToolbarPosition;
|
|
|
29988
29999
|
exports.FontFamily = FontFamily;
|
|
29989
30000
|
exports.FontFamilyDropdown = FontFamilyDropdown;
|
|
29990
30001
|
exports.FontFamilyItem = FontFamilyItem;
|
|
29991
|
-
Object.defineProperty(exports,
|
|
30002
|
+
Object.defineProperty(exports, "FontService", {
|
|
29992
30003
|
enumerable: true,
|
|
29993
30004
|
get: function () {
|
|
29994
30005
|
return FontService;
|
|
@@ -30026,7 +30037,7 @@ exports.IUIPartsService = IUIPartsService;
|
|
|
30026
30037
|
exports.IUIRuntimeScopeService = IUIRuntimeScopeService;
|
|
30027
30038
|
exports.IUnitPresenceUIAdapterRegistry = IUnitPresenceUIAdapterRegistry;
|
|
30028
30039
|
exports.IWorkbenchService = IWorkbenchService;
|
|
30029
|
-
Object.defineProperty(exports,
|
|
30040
|
+
Object.defineProperty(exports, "IconManager", {
|
|
30030
30041
|
enumerable: true,
|
|
30031
30042
|
get: function () {
|
|
30032
30043
|
return IconManager;
|
|
@@ -30036,7 +30047,7 @@ exports.KeyCode = KeyCode;
|
|
|
30036
30047
|
exports.MOBILE_UI_MODE = MOBILE_UI_MODE;
|
|
30037
30048
|
exports.MenuItemType = MenuItemType;
|
|
30038
30049
|
exports.MenuManagerPosition = MenuManagerPosition;
|
|
30039
|
-
Object.defineProperty(exports,
|
|
30050
|
+
Object.defineProperty(exports, "MenuManagerService", {
|
|
30040
30051
|
enumerable: true,
|
|
30041
30052
|
get: function () {
|
|
30042
30053
|
return MenuManagerService;
|
|
@@ -30045,7 +30056,7 @@ Object.defineProperty(exports, 'MenuManagerService', {
|
|
|
30045
30056
|
exports.MetaKeys = MetaKeys;
|
|
30046
30057
|
exports.MobileCanvasGesture = MobileCanvasGesture;
|
|
30047
30058
|
exports.MobileContextMenu = MobileContextMenu;
|
|
30048
|
-
Object.defineProperty(exports,
|
|
30059
|
+
Object.defineProperty(exports, "MobileDialogService", {
|
|
30049
30060
|
enumerable: true,
|
|
30050
30061
|
get: function () {
|
|
30051
30062
|
return MobileDialogService;
|
|
@@ -30066,19 +30077,19 @@ exports.PlatformService = PlatformService;
|
|
|
30066
30077
|
exports.PrintFloatDomSingle = PrintFloatDomSingle;
|
|
30067
30078
|
exports.ProgressBar = ProgressBar;
|
|
30068
30079
|
exports.RectPopup = RectPopup;
|
|
30069
|
-
Object.defineProperty(exports,
|
|
30080
|
+
Object.defineProperty(exports, "RediConsumer", {
|
|
30070
30081
|
enumerable: true,
|
|
30071
30082
|
get: function () {
|
|
30072
30083
|
return _wendellhu_redi_react_bindings.RediConsumer;
|
|
30073
30084
|
}
|
|
30074
30085
|
});
|
|
30075
|
-
Object.defineProperty(exports,
|
|
30086
|
+
Object.defineProperty(exports, "RediContext", {
|
|
30076
30087
|
enumerable: true,
|
|
30077
30088
|
get: function () {
|
|
30078
30089
|
return _wendellhu_redi_react_bindings.RediContext;
|
|
30079
30090
|
}
|
|
30080
30091
|
});
|
|
30081
|
-
Object.defineProperty(exports,
|
|
30092
|
+
Object.defineProperty(exports, "RediProvider", {
|
|
30082
30093
|
enumerable: true,
|
|
30083
30094
|
get: function () {
|
|
30084
30095
|
return _wendellhu_redi_react_bindings.RediProvider;
|
|
@@ -30096,21 +30107,21 @@ exports.RibbonStartGroup = RibbonStartGroup;
|
|
|
30096
30107
|
exports.RibbonViewGroup = RibbonViewGroup;
|
|
30097
30108
|
exports.SYMBOL_CATEGORIES = SYMBOL_CATEGORIES;
|
|
30098
30109
|
exports.SYMBOL_PICKER_COMPONENT = SYMBOL_PICKER_COMPONENT;
|
|
30099
|
-
Object.defineProperty(exports,
|
|
30110
|
+
Object.defineProperty(exports, "SharedController", {
|
|
30100
30111
|
enumerable: true,
|
|
30101
30112
|
get: function () {
|
|
30102
30113
|
return SharedController;
|
|
30103
30114
|
}
|
|
30104
30115
|
});
|
|
30105
30116
|
exports.SheetPasteShortKeyCommandName = SheetPasteShortKeyCommandName;
|
|
30106
|
-
Object.defineProperty(exports,
|
|
30117
|
+
Object.defineProperty(exports, "ShortcutPanelController", {
|
|
30107
30118
|
enumerable: true,
|
|
30108
30119
|
get: function () {
|
|
30109
30120
|
return ShortcutPanelController;
|
|
30110
30121
|
}
|
|
30111
30122
|
});
|
|
30112
30123
|
exports.ShortcutPanelService = ShortcutPanelService;
|
|
30113
|
-
Object.defineProperty(exports,
|
|
30124
|
+
Object.defineProperty(exports, "ShortcutService", {
|
|
30114
30125
|
enumerable: true,
|
|
30115
30126
|
get: function () {
|
|
30116
30127
|
return ShortcutService;
|
|
@@ -30131,7 +30142,7 @@ exports.UIPartsService = UIPartsService;
|
|
|
30131
30142
|
exports.UIRuntimeScopeService = UIRuntimeScopeService;
|
|
30132
30143
|
exports.UI_PLUGIN_CONFIG_KEY = UI_PLUGIN_CONFIG_KEY;
|
|
30133
30144
|
exports.UNI_DISABLE_CHANGING_FOCUS_KEY = UNI_DISABLE_CHANGING_FOCUS_KEY;
|
|
30134
|
-
Object.defineProperty(exports,
|
|
30145
|
+
Object.defineProperty(exports, "UndoRedoGroupService", {
|
|
30135
30146
|
enumerable: true,
|
|
30136
30147
|
get: function () {
|
|
30137
30148
|
return UndoRedoGroupService;
|
|
@@ -30139,25 +30150,25 @@ Object.defineProperty(exports, 'UndoRedoGroupService', {
|
|
|
30139
30150
|
});
|
|
30140
30151
|
exports.UndoShortcutItem = UndoShortcutItem;
|
|
30141
30152
|
exports.UnitPresenceUIAdapterRegistry = UnitPresenceUIAdapterRegistry;
|
|
30142
|
-
Object.defineProperty(exports,
|
|
30153
|
+
Object.defineProperty(exports, "UniverMobileUIPlugin", {
|
|
30143
30154
|
enumerable: true,
|
|
30144
30155
|
get: function () {
|
|
30145
30156
|
return UniverMobileUIPlugin;
|
|
30146
30157
|
}
|
|
30147
30158
|
});
|
|
30148
|
-
Object.defineProperty(exports,
|
|
30159
|
+
Object.defineProperty(exports, "UniverUIPlugin", {
|
|
30149
30160
|
enumerable: true,
|
|
30150
30161
|
get: function () {
|
|
30151
30162
|
return UniverUIPlugin;
|
|
30152
30163
|
}
|
|
30153
30164
|
});
|
|
30154
|
-
Object.defineProperty(exports,
|
|
30165
|
+
Object.defineProperty(exports, "WithDependency", {
|
|
30155
30166
|
enumerable: true,
|
|
30156
30167
|
get: function () {
|
|
30157
30168
|
return _wendellhu_redi_react_bindings.WithDependency;
|
|
30158
30169
|
}
|
|
30159
30170
|
});
|
|
30160
|
-
Object.defineProperty(exports,
|
|
30171
|
+
Object.defineProperty(exports, "WorkbenchService", {
|
|
30161
30172
|
enumerable: true,
|
|
30162
30173
|
get: function () {
|
|
30163
30174
|
return WorkbenchService;
|
|
@@ -30166,13 +30177,13 @@ Object.defineProperty(exports, 'WorkbenchService', {
|
|
|
30166
30177
|
exports.ZIndexManager = ZIndexManager;
|
|
30167
30178
|
exports.ZoomInput = ZoomInput;
|
|
30168
30179
|
exports.bindFormatPainterCanvas = bindFormatPainterCanvas;
|
|
30169
|
-
Object.defineProperty(exports,
|
|
30180
|
+
Object.defineProperty(exports, "connectDependencies", {
|
|
30170
30181
|
enumerable: true,
|
|
30171
30182
|
get: function () {
|
|
30172
30183
|
return _wendellhu_redi_react_bindings.connectDependencies;
|
|
30173
30184
|
}
|
|
30174
30185
|
});
|
|
30175
|
-
Object.defineProperty(exports,
|
|
30186
|
+
Object.defineProperty(exports, "connectInjector", {
|
|
30176
30187
|
enumerable: true,
|
|
30177
30188
|
get: function () {
|
|
30178
30189
|
return _wendellhu_redi_react_bindings.connectInjector;
|
|
@@ -30217,14 +30228,14 @@ exports.useClickOutSide = useClickOutSide;
|
|
|
30217
30228
|
exports.useComponentsOfPart = useComponentsOfPart;
|
|
30218
30229
|
exports.useConfigValue = useConfigValue;
|
|
30219
30230
|
exports.useDebounceFn = useDebounceFn;
|
|
30220
|
-
Object.defineProperty(exports,
|
|
30231
|
+
Object.defineProperty(exports, "useDependency", {
|
|
30221
30232
|
enumerable: true,
|
|
30222
30233
|
get: function () {
|
|
30223
30234
|
return _wendellhu_redi_react_bindings.useDependency;
|
|
30224
30235
|
}
|
|
30225
30236
|
});
|
|
30226
30237
|
exports.useEvent = useEvent;
|
|
30227
|
-
Object.defineProperty(exports,
|
|
30238
|
+
Object.defineProperty(exports, "useInjector", {
|
|
30228
30239
|
enumerable: true,
|
|
30229
30240
|
get: function () {
|
|
30230
30241
|
return _wendellhu_redi_react_bindings.useInjector;
|
|
@@ -30232,7 +30243,7 @@ Object.defineProperty(exports, 'useInjector', {
|
|
|
30232
30243
|
});
|
|
30233
30244
|
exports.useMobileCanvasPanel = useMobileCanvasPanel;
|
|
30234
30245
|
exports.useMobileCanvasViewport = useMobileCanvasViewport;
|
|
30235
|
-
Object.defineProperty(exports,
|
|
30246
|
+
Object.defineProperty(exports, "useObservable", {
|
|
30236
30247
|
enumerable: true,
|
|
30237
30248
|
get: function () {
|
|
30238
30249
|
return _wendellhu_redi_react_bindings.useObservable;
|
|
@@ -30242,7 +30253,7 @@ exports.useObservableRef = useObservableRef;
|
|
|
30242
30253
|
exports.useScrollYOverContainer = useScrollYOverContainer;
|
|
30243
30254
|
exports.useSidebarClick = useSidebarClick;
|
|
30244
30255
|
exports.useToolbarItemStatus = useToolbarItemStatus;
|
|
30245
|
-
Object.defineProperty(exports,
|
|
30256
|
+
Object.defineProperty(exports, "useUpdateBinder", {
|
|
30246
30257
|
enumerable: true,
|
|
30247
30258
|
get: function () {
|
|
30248
30259
|
return _wendellhu_redi_react_bindings.useUpdateBinder;
|
package/lib/es/facade.js
CHANGED
|
@@ -3,7 +3,7 @@ import { FBase, FEnum, FUniver } from "@univerjs/core/facade";
|
|
|
3
3
|
import { IRenderManagerService } from "@univerjs/engine-render";
|
|
4
4
|
import { BuiltInUIPart, ComponentManager, CopyCommand, IDialogService, IFontService, IMenuManagerService, IMessageService, IShortcutService, ISidebarService, IUIPartsService, KeyCode, MenuItemType, MenuManagerPosition, PasteCommand, RibbonPosition, RibbonStartGroup, UI_PLUGIN_CONFIG_KEY, connectInjector } from "@univerjs/ui";
|
|
5
5
|
|
|
6
|
-
//#region \0@oxc-project+runtime@0.
|
|
6
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
7
7
|
function _typeof(o) {
|
|
8
8
|
"@babel/helpers - typeof";
|
|
9
9
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -14,7 +14,7 @@ function _typeof(o) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
|
-
//#region \0@oxc-project+runtime@0.
|
|
17
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
18
18
|
function toPrimitive(t, r) {
|
|
19
19
|
if ("object" != _typeof(t) || !t) return t;
|
|
20
20
|
var e = t[Symbol.toPrimitive];
|
|
@@ -27,14 +27,14 @@ function toPrimitive(t, r) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
//#endregion
|
|
30
|
-
//#region \0@oxc-project+runtime@0.
|
|
30
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
31
31
|
function toPropertyKey(t) {
|
|
32
32
|
var i = toPrimitive(t, "string");
|
|
33
33
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
//#endregion
|
|
37
|
-
//#region \0@oxc-project+runtime@0.
|
|
37
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
38
38
|
function _defineProperty(e, r, t) {
|
|
39
39
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
40
40
|
value: t,
|
|
@@ -45,7 +45,7 @@ function _defineProperty(e, r, t) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
//#endregion
|
|
48
|
-
//#region \0@oxc-project+runtime@0.
|
|
48
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
49
49
|
function __decorateParam(paramIndex, decorator) {
|
|
50
50
|
return function(target, key) {
|
|
51
51
|
decorator(target, key, paramIndex);
|
|
@@ -53,7 +53,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
//#endregion
|
|
56
|
-
//#region \0@oxc-project+runtime@0.
|
|
56
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
57
57
|
function __decorate(decorators, target, key, desc) {
|
|
58
58
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
59
59
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|