@univerjs/ui 0.22.1 → 0.23.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/index.js +206 -132
- package/lib/es/index.js +206 -132
- package/lib/index.js +206 -132
- package/lib/types/index.d.ts +1 -1
- package/lib/types/services/menu/menu-manager.service.d.ts +2 -0
- package/lib/types/services/ribbon/ribbon.service.d.ts +16 -0
- package/lib/umd/index.js +11 -11
- package/package.json +7 -7
- /package/lib/types/views/components/dom/{print.d.ts → Print.d.ts} +0 -0
package/lib/es/index.js
CHANGED
|
@@ -2274,6 +2274,7 @@ let MenuManagerService = class MenuManagerService extends Disposable {
|
|
|
2274
2274
|
key,
|
|
2275
2275
|
order: value.order,
|
|
2276
2276
|
title: value.title,
|
|
2277
|
+
contextual: value.contextual,
|
|
2277
2278
|
quickLayout: value.quickLayout
|
|
2278
2279
|
};
|
|
2279
2280
|
if (value.menuItemFactory) {
|
|
@@ -2905,6 +2906,7 @@ function RectPopup(props) {
|
|
|
2905
2906
|
window.removeEventListener("contextmenu", handleContextMenu);
|
|
2906
2907
|
};
|
|
2907
2908
|
}, [contextMenuFn]);
|
|
2909
|
+
const { direction: dir } = useContext(ConfigContext);
|
|
2908
2910
|
const ele = /* @__PURE__ */ jsxs(Fragment$1, { children: [mask && /* @__PURE__ */ jsx("div", {
|
|
2909
2911
|
"data-u-comp": "rect-popup-mask",
|
|
2910
2912
|
className: "univer-fixed univer-inset-0 univer-z-[100]",
|
|
@@ -2913,6 +2915,7 @@ function RectPopup(props) {
|
|
|
2913
2915
|
}), /* @__PURE__ */ jsx("section", {
|
|
2914
2916
|
"data-u-comp": "rect-popup",
|
|
2915
2917
|
ref: nodeRef,
|
|
2918
|
+
dir,
|
|
2916
2919
|
className: clsx("univer-pointer-events-auto univer-fixed univer-left-[-9999px] univer-top-[-9999px] univer-z-[1020]", {
|
|
2917
2920
|
"univer-hidden": hidden,
|
|
2918
2921
|
"univer-animate-in univer-fade-in-70": !hidden
|
|
@@ -3033,11 +3036,29 @@ let DesktopRibbonService = class DesktopRibbonService extends Disposable {
|
|
|
3033
3036
|
_defineProperty(this, "collapsedIds$", this._collapsedIds$.asObservable());
|
|
3034
3037
|
_defineProperty(this, "_fakeToolbarVisible$", new BehaviorSubject(false));
|
|
3035
3038
|
_defineProperty(this, "fakeToolbarVisible$", this._fakeToolbarVisible$.asObservable());
|
|
3039
|
+
_defineProperty(this, "_visibleContextualTabs", /* @__PURE__ */ new Set());
|
|
3040
|
+
_defineProperty(this, "_contextualTabs", /* @__PURE__ */ new Set());
|
|
3041
|
+
_defineProperty(this, "_lastNonContextualActivatedTab", "ribbon.start");
|
|
3036
3042
|
this._initRibbonSubscription();
|
|
3037
3043
|
}
|
|
3038
3044
|
setActivatedTab(tab) {
|
|
3045
|
+
if (!this._isContextualTab(tab)) this._lastNonContextualActivatedTab = tab;
|
|
3039
3046
|
this._activatedTab$.next(tab);
|
|
3040
3047
|
}
|
|
3048
|
+
showContextualTab(tab, options) {
|
|
3049
|
+
this._visibleContextualTabs.add(tab);
|
|
3050
|
+
this._updateRibbon();
|
|
3051
|
+
if (options === null || options === void 0 ? void 0 : options.activate) this.setActivatedTab(tab);
|
|
3052
|
+
}
|
|
3053
|
+
hideContextualTab(tab) {
|
|
3054
|
+
if (!this._visibleContextualTabs.delete(tab)) return;
|
|
3055
|
+
this._updateRibbon();
|
|
3056
|
+
}
|
|
3057
|
+
hideAllContextualTabs() {
|
|
3058
|
+
if (this._visibleContextualTabs.size === 0) return;
|
|
3059
|
+
this._visibleContextualTabs.clear();
|
|
3060
|
+
this._updateRibbon();
|
|
3061
|
+
}
|
|
3041
3062
|
setCollapsedIds(ids) {
|
|
3042
3063
|
this._collapsedIds$.next(ids);
|
|
3043
3064
|
}
|
|
@@ -3050,7 +3071,7 @@ let DesktopRibbonService = class DesktopRibbonService extends Disposable {
|
|
|
3050
3071
|
}));
|
|
3051
3072
|
}
|
|
3052
3073
|
_updateRibbon() {
|
|
3053
|
-
const ribbon = this._menuManagerService.getMenuByPositionKey("ribbon");
|
|
3074
|
+
const ribbon = this._filterContextualTabs(this._menuManagerService.getMenuByPositionKey("ribbon"));
|
|
3054
3075
|
const hiddenObservableMap = [];
|
|
3055
3076
|
const hiddenKeyMap = [];
|
|
3056
3077
|
for (const group of ribbon) if (group.children) {
|
|
@@ -3063,7 +3084,7 @@ let DesktopRibbonService = class DesktopRibbonService extends Disposable {
|
|
|
3063
3084
|
}
|
|
3064
3085
|
}
|
|
3065
3086
|
if (hiddenObservableMap.length === 0) {
|
|
3066
|
-
this.
|
|
3087
|
+
this._setRibbon(ribbon);
|
|
3067
3088
|
return;
|
|
3068
3089
|
}
|
|
3069
3090
|
combineLatest(hiddenObservableMap).pipe(startWith$1(new Array(hiddenObservableMap.length).fill(false))).subscribe((hiddenMap) => {
|
|
@@ -3106,9 +3127,29 @@ let DesktopRibbonService = class DesktopRibbonService extends Disposable {
|
|
|
3106
3127
|
return (_item$children2 = item.children) === null || _item$children2 === void 0 ? void 0 : _item$children2.length;
|
|
3107
3128
|
})) newRibbon.push(newGroup);
|
|
3108
3129
|
}
|
|
3109
|
-
this.
|
|
3130
|
+
this._setRibbon(newRibbon);
|
|
3110
3131
|
}).unsubscribe();
|
|
3111
3132
|
}
|
|
3133
|
+
_filterContextualTabs(ribbon) {
|
|
3134
|
+
this._contextualTabs.clear();
|
|
3135
|
+
ribbon.forEach((group) => {
|
|
3136
|
+
if (group.contextual) this._contextualTabs.add(group.key);
|
|
3137
|
+
});
|
|
3138
|
+
return ribbon.filter((group) => !group.contextual || this._visibleContextualTabs.has(group.key));
|
|
3139
|
+
}
|
|
3140
|
+
_setRibbon(ribbon) {
|
|
3141
|
+
const activatedTab = this._activatedTab$.getValue();
|
|
3142
|
+
const activeGroup = ribbon.find((group) => group.key === activatedTab);
|
|
3143
|
+
if (!activeGroup && this._contextualTabs.has(activatedTab)) {
|
|
3144
|
+
var _ref, _ribbon$find;
|
|
3145
|
+
const fallbackTab = (_ref = (_ribbon$find = ribbon.find((group) => group.key === this._lastNonContextualActivatedTab && !group.contextual)) !== null && _ribbon$find !== void 0 ? _ribbon$find : ribbon.find((group) => group.key === "ribbon.start")) !== null && _ref !== void 0 ? _ref : ribbon[0];
|
|
3146
|
+
if (fallbackTab) this._activatedTab$.next(fallbackTab.key);
|
|
3147
|
+
} else if (activeGroup && !activeGroup.contextual) this._lastNonContextualActivatedTab = activeGroup.key;
|
|
3148
|
+
this._ribbon$.next(ribbon);
|
|
3149
|
+
}
|
|
3150
|
+
_isContextualTab(tab) {
|
|
3151
|
+
return this._contextualTabs.has(tab) || this._ribbon$.getValue().some((group) => group.key === tab && group.contextual);
|
|
3152
|
+
}
|
|
3112
3153
|
};
|
|
3113
3154
|
DesktopRibbonService = __decorate([__decorateParam(0, IMenuManagerService), __decorateParam(1, IUniverInstanceService)], DesktopRibbonService);
|
|
3114
3155
|
|
|
@@ -3199,7 +3240,8 @@ function DefaultMenu({ ribbon, activatedTab, onSelectTab }) {
|
|
|
3199
3240
|
overlay: /* @__PURE__ */ jsx("div", {
|
|
3200
3241
|
className: "univer-grid univer-gap-1 univer-px-2 univer-py-1",
|
|
3201
3242
|
children: ribbon.map((group) => {
|
|
3202
|
-
|
|
3243
|
+
var _iconMap;
|
|
3244
|
+
const Icon = (_iconMap = iconMap[group.key]) !== null && _iconMap !== void 0 ? _iconMap : MoreFunctionIcon;
|
|
3203
3245
|
return /* @__PURE__ */ jsxs("a", {
|
|
3204
3246
|
"data-u-comp": "ribbon-group-btn",
|
|
3205
3247
|
className: "univer-box-border univer-flex univer-cursor-pointer univer-items-center univer-gap-2.5 univer-rounded-lg univer-px-2 univer-py-1.5 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",
|
|
@@ -4243,6 +4285,7 @@ function ContextMenuMenu(props) {
|
|
|
4243
4285
|
}
|
|
4244
4286
|
function ContextMenuMenuItem(props) {
|
|
4245
4287
|
const { menuKey, menuItem, submenuPortalContainer, onOptionSelect, maxMenuHeight } = props;
|
|
4288
|
+
const { direction } = useContext(ConfigContext);
|
|
4246
4289
|
const menuManagerService = useDependency(IMenuManagerService);
|
|
4247
4290
|
const disabled = useObservable(menuItem.disabled$, false);
|
|
4248
4291
|
const activated = useObservable(menuItem.activated$, false);
|
|
@@ -4394,6 +4437,7 @@ function ContextMenuMenuItem(props) {
|
|
|
4394
4437
|
children: [contentNode, hasSubmenu && /* @__PURE__ */ jsx(MoreIcon, { className: "univer-size-3.5 univer-text-gray-400 dark:!univer-text-gray-200" })]
|
|
4395
4438
|
}), hasSubmenu && submenuVisible && (submenuPortalContainer ? createPortal(/* @__PURE__ */ jsx("div", {
|
|
4396
4439
|
ref: submenuElementRef,
|
|
4440
|
+
dir: direction,
|
|
4397
4441
|
["data-u-context-menu-submenu"]: "true",
|
|
4398
4442
|
className: "univer-z-[1080] univer-w-max univer-max-w-[calc(100vw-16px)]",
|
|
4399
4443
|
style: {
|
|
@@ -4685,6 +4729,7 @@ function GlobalZone() {
|
|
|
4685
4729
|
const [visible, setVisible] = useState(false);
|
|
4686
4730
|
const componentKey = useObservable(globalZoneService.componentKey$, globalZoneService.componentKey);
|
|
4687
4731
|
const componentManager = useDependency(ComponentManager);
|
|
4732
|
+
const { direction } = useContext(ConfigContext);
|
|
4688
4733
|
const Component = useMemo(() => {
|
|
4689
4734
|
const Component = componentManager.get(componentKey !== null && componentKey !== void 0 ? componentKey : "");
|
|
4690
4735
|
if (Component) return Component;
|
|
@@ -4699,6 +4744,7 @@ function GlobalZone() {
|
|
|
4699
4744
|
}, [globalZoneService.visible$]);
|
|
4700
4745
|
if (!visible) return null;
|
|
4701
4746
|
return /* @__PURE__ */ jsx("section", {
|
|
4747
|
+
dir: direction,
|
|
4702
4748
|
className: clsx("univer-absolute univer-bg-gray-100", {
|
|
4703
4749
|
"univer-hidden": !visible,
|
|
4704
4750
|
"univer-inset-0 univer-z-[100] univer-block univer-size-full": visible
|
|
@@ -4890,11 +4936,14 @@ function DesktopWorkbenchContent(props) {
|
|
|
4890
4936
|
if (contentRef.current) onRendered === null || onRendered === void 0 || onRendered(contentRef.current);
|
|
4891
4937
|
}, [onRendered]);
|
|
4892
4938
|
const [locale, setLocale] = useState(localeService.getLocales());
|
|
4939
|
+
const [direction, setDirection] = useState(localeService.getDirection());
|
|
4893
4940
|
const portalContainer = useMemo(() => document.createElement("div"), []);
|
|
4894
4941
|
useEffect(() => {
|
|
4895
4942
|
document.body.appendChild(portalContainer);
|
|
4896
4943
|
const subscriptions = [localeService.localeChanged$.subscribe(() => {
|
|
4897
4944
|
setLocale(localeService.getLocales());
|
|
4945
|
+
}), localeService.direction$.subscribe(() => {
|
|
4946
|
+
setDirection(localeService.getDirection());
|
|
4898
4947
|
})];
|
|
4899
4948
|
return () => {
|
|
4900
4949
|
subscriptions.forEach((subscription) => subscription.unsubscribe());
|
|
@@ -4905,76 +4954,83 @@ function DesktopWorkbenchContent(props) {
|
|
|
4905
4954
|
mountContainer,
|
|
4906
4955
|
portalContainer
|
|
4907
4956
|
]);
|
|
4957
|
+
useEffect(() => {
|
|
4958
|
+
portalContainer.dir = direction;
|
|
4959
|
+
}, [direction, portalContainer]);
|
|
4908
4960
|
return /* @__PURE__ */ jsxs(ConfigProvider, {
|
|
4909
4961
|
locale: locale === null || locale === void 0 ? void 0 : locale.design,
|
|
4962
|
+
direction,
|
|
4910
4963
|
mountContainer: portalContainer,
|
|
4911
|
-
children: [
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4964
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
4965
|
+
"data-u-comp": "workbench-layout",
|
|
4966
|
+
className: clsx("univer-flex univer-h-full univer-min-h-0 univer-flex-col univer-bg-white dark:!univer-bg-gray-800", { "univer-dark": darkMode }),
|
|
4967
|
+
tabIndex: -1,
|
|
4968
|
+
onBlur: (e) => e.stopPropagation(),
|
|
4969
|
+
onContextMenu: (e) => e.preventDefault(),
|
|
4970
|
+
dir: direction,
|
|
4971
|
+
children: [
|
|
4972
|
+
/* @__PURE__ */ jsx("div", {
|
|
4973
|
+
className: "univer-relative univer-flex univer-min-h-0 univer-flex-col univer-bg-white dark:!univer-bg-gray-800",
|
|
4974
|
+
children: /* @__PURE__ */ jsx(ComponentContainer, { components: customHeaderComponents }, "custom-header")
|
|
4975
|
+
}),
|
|
4976
|
+
header && toolbar && /* @__PURE__ */ jsx("header", {
|
|
4977
|
+
"data-u-comp": "headerbar",
|
|
4978
|
+
className: "univer-relative univer-z-10 univer-w-full univer-overflow-hidden",
|
|
4979
|
+
children: /* @__PURE__ */ jsx(ComponentContainer, {
|
|
4980
|
+
components: toolbarComponents,
|
|
4981
|
+
sharedProps: {
|
|
4982
|
+
ribbonType,
|
|
4983
|
+
headerMenuComponents,
|
|
4984
|
+
headerMenu
|
|
4985
|
+
}
|
|
4986
|
+
}, "toolbar")
|
|
4987
|
+
}),
|
|
4988
|
+
/* @__PURE__ */ jsxs("section", {
|
|
4989
|
+
className: "univer-relative univer-flex univer-min-h-0 univer-flex-1 univer-flex-col",
|
|
4990
|
+
children: [
|
|
4991
|
+
/* @__PURE__ */ jsxs("div", {
|
|
4992
|
+
className: "univer-grid univer-h-full univer-grid-cols-[auto_1fr_auto] univer-grid-rows-[100%] univer-overflow-hidden",
|
|
4993
|
+
children: [
|
|
4994
|
+
/* @__PURE__ */ jsx("aside", {
|
|
4995
|
+
"data-u-comp": "left-sidebar",
|
|
4996
|
+
className: "univer-h-full",
|
|
4997
|
+
children: /* @__PURE__ */ jsx(ComponentContainer, { components: leftSidebarComponents }, "left-sidebar")
|
|
4998
|
+
}),
|
|
4999
|
+
/* @__PURE__ */ jsxs("section", {
|
|
5000
|
+
className: clsx("univer-relative univer-grid univer-flex-1 univer-grid-rows-[auto_1fr] univer-overflow-hidden univer-bg-white dark:!univer-bg-gray-800", borderBottomClassName),
|
|
5001
|
+
children: [/* @__PURE__ */ jsx("header", { children: header && /* @__PURE__ */ jsx(ComponentContainer, { components: headerComponents }, "header") }), /* @__PURE__ */ jsx("section", {
|
|
5002
|
+
className: "univer-relative univer-overflow-hidden dark:!univer-bg-gray-900",
|
|
5003
|
+
ref: contentRef,
|
|
5004
|
+
"data-range-selector": true,
|
|
5005
|
+
onContextMenu: (e) => e.preventDefault(),
|
|
5006
|
+
children: /* @__PURE__ */ jsx(ComponentContainer, { components: contentComponents }, "content")
|
|
5007
|
+
})]
|
|
5008
|
+
}),
|
|
5009
|
+
/* @__PURE__ */ jsx("aside", {
|
|
5010
|
+
"data-u-comp": "right-sidebar",
|
|
5011
|
+
className: "univer-z-[100] univer-h-full",
|
|
5012
|
+
children: /* @__PURE__ */ jsx(Sidebar, {})
|
|
5013
|
+
})
|
|
5014
|
+
]
|
|
5015
|
+
}),
|
|
5016
|
+
footer && /* @__PURE__ */ jsx("footer", { children: /* @__PURE__ */ jsx(ComponentContainer, {
|
|
5017
|
+
components: footerComponents,
|
|
5018
|
+
sharedProps: { contextMenu }
|
|
5019
|
+
}, "footer") }),
|
|
5020
|
+
/* @__PURE__ */ jsx(ZenZone, {})
|
|
5021
|
+
]
|
|
5022
|
+
})
|
|
5023
|
+
]
|
|
5024
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
5025
|
+
dir: direction,
|
|
5026
|
+
children: [
|
|
5027
|
+
/* @__PURE__ */ jsx(ComponentContainer, { components: globalComponents }, "global"),
|
|
5028
|
+
/* @__PURE__ */ jsx(GlobalZone, {}),
|
|
5029
|
+
contextMenu && /* @__PURE__ */ jsx(DesktopContextMenu, {}),
|
|
5030
|
+
/* @__PURE__ */ jsx(FloatingContainer, {}),
|
|
5031
|
+
/* @__PURE__ */ jsx("div", { id: popupRootId })
|
|
5032
|
+
]
|
|
5033
|
+
})]
|
|
4978
5034
|
});
|
|
4979
5035
|
}
|
|
4980
5036
|
function FloatingContainer() {
|
|
@@ -5140,7 +5196,7 @@ const IUIController = createIdentifier("univer.ui.ui-controller");
|
|
|
5140
5196
|
//#endregion
|
|
5141
5197
|
//#region package.json
|
|
5142
5198
|
var name = "@univerjs/ui";
|
|
5143
|
-
var version = "0.
|
|
5199
|
+
var version = "0.23.0";
|
|
5144
5200
|
|
|
5145
5201
|
//#endregion
|
|
5146
5202
|
//#region src/views/components/ribbon/MobileRibbon.tsx
|
|
@@ -5637,7 +5693,7 @@ function MobileContextMenu() {
|
|
|
5637
5693
|
const commandService = useDependency(ICommandService);
|
|
5638
5694
|
const layoutService = useDependency(ILayoutService);
|
|
5639
5695
|
const localeService = useDependency(LocaleService);
|
|
5640
|
-
const { mountContainer } = useContext(ConfigContext);
|
|
5696
|
+
const { mountContainer, direction } = useContext(ConfigContext);
|
|
5641
5697
|
visibleRef.current = visible;
|
|
5642
5698
|
useEffect(() => {
|
|
5643
5699
|
const hostDisposable = contextMenuHostService.registerMenu(MOBILE_CONTEXT_MENU_HOST_ID, () => {
|
|
@@ -5676,6 +5732,7 @@ function MobileContextMenu() {
|
|
|
5676
5732
|
}, [localeService, menuType]);
|
|
5677
5733
|
if (!mountContainer || !visible) return null;
|
|
5678
5734
|
return createPortal(/* @__PURE__ */ jsxs("div", {
|
|
5735
|
+
dir: direction,
|
|
5679
5736
|
className: "univer-fixed univer-inset-0 univer-z-[1080] univer-flex univer-items-end",
|
|
5680
5737
|
children: [/* @__PURE__ */ jsx("button", {
|
|
5681
5738
|
type: "button",
|
|
@@ -5752,6 +5809,7 @@ function MobileWorkbench(props) {
|
|
|
5752
5809
|
if (contentRef.current) onRendered === null || onRendered === void 0 || onRendered(contentRef.current);
|
|
5753
5810
|
}, [onRendered]);
|
|
5754
5811
|
const [locale, setLocale] = useState(localeService.getLocales());
|
|
5812
|
+
const [direction, setDirection] = useState(localeService.getDirection());
|
|
5755
5813
|
const portalContainer = useMemo(() => document.createElement("div"), []);
|
|
5756
5814
|
useLayoutEffect(() => {
|
|
5757
5815
|
const sub = themeService.currentTheme$.subscribe((theme) => {
|
|
@@ -5765,6 +5823,8 @@ function MobileWorkbench(props) {
|
|
|
5765
5823
|
document.body.appendChild(portalContainer);
|
|
5766
5824
|
const subscriptions = [localeService.localeChanged$.subscribe(() => {
|
|
5767
5825
|
setLocale(localeService.getLocales());
|
|
5826
|
+
}), localeService.direction$.subscribe(() => {
|
|
5827
|
+
setDirection(localeService.getDirection());
|
|
5768
5828
|
})];
|
|
5769
5829
|
return () => {
|
|
5770
5830
|
subscriptions.forEach((subscription) => subscription.unsubscribe());
|
|
@@ -5775,65 +5835,69 @@ function MobileWorkbench(props) {
|
|
|
5775
5835
|
mountContainer,
|
|
5776
5836
|
portalContainer
|
|
5777
5837
|
]);
|
|
5838
|
+
useEffect(() => {
|
|
5839
|
+
portalContainer.dir = direction;
|
|
5840
|
+
}, [direction, portalContainer]);
|
|
5778
5841
|
return /* @__PURE__ */ jsxs(ConfigProvider, {
|
|
5779
5842
|
locale: locale === null || locale === void 0 ? void 0 : locale.design,
|
|
5843
|
+
direction,
|
|
5780
5844
|
mountContainer: portalContainer,
|
|
5781
|
-
children: [
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
contextMenu && /* @__PURE__ */ jsx(MobileContextMenu, {})
|
|
5836
|
-
]
|
|
5845
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
5846
|
+
"data-u-comp": "app-layout",
|
|
5847
|
+
className: clsx("univer-relative univer-flex univer-h-full univer-min-h-0 univer-flex-col univer-bg-white dark:!univer-bg-gray-800", { "univer-dark": darkMode }),
|
|
5848
|
+
tabIndex: -1,
|
|
5849
|
+
onBlur: (e) => e.stopPropagation(),
|
|
5850
|
+
onContextMenu: (e) => e.preventDefault(),
|
|
5851
|
+
dir: direction,
|
|
5852
|
+
children: [header && toolbar && /* @__PURE__ */ jsx("header", {
|
|
5853
|
+
"data-u-comp": "headerbar",
|
|
5854
|
+
className: "univer-relative univer-z-10 univer-w-full univer-overflow-hidden",
|
|
5855
|
+
children: /* @__PURE__ */ jsx(ComponentContainer, {
|
|
5856
|
+
components: toolbarComponents,
|
|
5857
|
+
sharedProps: {
|
|
5858
|
+
ribbonType,
|
|
5859
|
+
headerMenuComponents,
|
|
5860
|
+
headerMenu
|
|
5861
|
+
}
|
|
5862
|
+
}, "toolbar")
|
|
5863
|
+
}), /* @__PURE__ */ jsxs("section", {
|
|
5864
|
+
className: "univer-relative univer-flex univer-min-h-0 univer-flex-1 univer-flex-col",
|
|
5865
|
+
children: [
|
|
5866
|
+
/* @__PURE__ */ jsxs("div", {
|
|
5867
|
+
className: "univer-grid univer-h-full univer-grid-cols-[auto_1fr_auto] univer-grid-rows-[100%] univer-overflow-hidden",
|
|
5868
|
+
children: [
|
|
5869
|
+
/* @__PURE__ */ jsx("aside", {
|
|
5870
|
+
className: "univer-h-full",
|
|
5871
|
+
children: /* @__PURE__ */ jsx(ComponentContainer, { components: leftSidebarComponents }, "left-sidebar")
|
|
5872
|
+
}),
|
|
5873
|
+
/* @__PURE__ */ jsxs("section", {
|
|
5874
|
+
className: clsx("univer-relative univer-grid univer-flex-1 univer-grid-rows-[auto_1fr] univer-overflow-hidden univer-bg-white dark:!univer-bg-gray-800", borderBottomClassName),
|
|
5875
|
+
children: [/* @__PURE__ */ jsx("header", {
|
|
5876
|
+
className: "univer-w-screen",
|
|
5877
|
+
children: header && /* @__PURE__ */ jsx(ComponentContainer, { components: headerComponents }, "header")
|
|
5878
|
+
}), /* @__PURE__ */ jsx("section", {
|
|
5879
|
+
ref: contentRef,
|
|
5880
|
+
className: "univer-relative univer-overflow-hidden",
|
|
5881
|
+
"data-range-selector": true,
|
|
5882
|
+
onContextMenu: (e) => e.preventDefault(),
|
|
5883
|
+
children: /* @__PURE__ */ jsx(ComponentContainer, { components: contentComponents }, "content")
|
|
5884
|
+
})]
|
|
5885
|
+
}),
|
|
5886
|
+
/* @__PURE__ */ jsx("aside", {
|
|
5887
|
+
className: "univer-h-full",
|
|
5888
|
+
children: /* @__PURE__ */ jsx(Sidebar, {})
|
|
5889
|
+
})
|
|
5890
|
+
]
|
|
5891
|
+
}),
|
|
5892
|
+
footer && /* @__PURE__ */ jsx("footer", { children: /* @__PURE__ */ jsx(ComponentContainer, { components: footerComponents }, "footer") }),
|
|
5893
|
+
/* @__PURE__ */ jsx(GlobalZone, {}),
|
|
5894
|
+
/* @__PURE__ */ jsx(ZenZone, {})
|
|
5895
|
+
]
|
|
5896
|
+
})]
|
|
5897
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
5898
|
+
dir: direction,
|
|
5899
|
+
children: [/* @__PURE__ */ jsx(ComponentContainer, { components: globalComponents }, "global"), contextMenu && /* @__PURE__ */ jsx(MobileContextMenu, {})]
|
|
5900
|
+
})]
|
|
5837
5901
|
});
|
|
5838
5902
|
}
|
|
5839
5903
|
|
|
@@ -6724,7 +6788,12 @@ var DesktopLocalStorageService = class {
|
|
|
6724
6788
|
* limitations under the License.
|
|
6725
6789
|
*/
|
|
6726
6790
|
function MessageContainer() {
|
|
6727
|
-
|
|
6791
|
+
const darkMode = useObservable(useDependency(ThemeService).darkMode$);
|
|
6792
|
+
const { direction } = useContext(ConfigContext);
|
|
6793
|
+
return /* @__PURE__ */ jsx(Messager, {
|
|
6794
|
+
theme: darkMode ? "dark" : "light",
|
|
6795
|
+
dir: direction
|
|
6796
|
+
});
|
|
6728
6797
|
}
|
|
6729
6798
|
|
|
6730
6799
|
//#endregion
|
|
@@ -6763,7 +6832,12 @@ DesktopMessageService = __decorate([__decorateParam(0, Inject(Injector)), __deco
|
|
|
6763
6832
|
//#endregion
|
|
6764
6833
|
//#region src/components/notification/Notification.tsx
|
|
6765
6834
|
function Notification() {
|
|
6766
|
-
|
|
6835
|
+
const darkMode = useObservable(useDependency(ThemeService).darkMode$);
|
|
6836
|
+
const { direction } = useContext(ConfigContext);
|
|
6837
|
+
return /* @__PURE__ */ jsx(Toaster, {
|
|
6838
|
+
theme: darkMode ? "dark" : "light",
|
|
6839
|
+
dir: direction
|
|
6840
|
+
});
|
|
6767
6841
|
}
|
|
6768
6842
|
const notification = { show: (options) => {
|
|
6769
6843
|
const { type = "message", title, content, duration, closable = true, position = "top-right" } = options;
|
|
@@ -7744,7 +7818,7 @@ function extractFontFamily(styleStr) {
|
|
|
7744
7818
|
}
|
|
7745
7819
|
|
|
7746
7820
|
//#endregion
|
|
7747
|
-
//#region src/views/components/dom/
|
|
7821
|
+
//#region src/views/components/dom/Print.tsx
|
|
7748
7822
|
const PrintFloatDomSingle = memo((props) => {
|
|
7749
7823
|
var _position$startY, _position$startX;
|
|
7750
7824
|
const { layer, id, position } = props;
|