@univerjs/ui 0.23.0 → 0.24.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/es/index.js CHANGED
@@ -2906,7 +2906,7 @@ function RectPopup(props) {
2906
2906
  window.removeEventListener("contextmenu", handleContextMenu);
2907
2907
  };
2908
2908
  }, [contextMenuFn]);
2909
- const { direction: dir } = useContext(ConfigContext);
2909
+ const dir = useObservable(useDependency(LocaleService).direction$);
2910
2910
  const ele = /* @__PURE__ */ jsxs(Fragment$1, { children: [mask && /* @__PURE__ */ jsx("div", {
2911
2911
  "data-u-comp": "rect-popup-mask",
2912
2912
  className: "univer-fixed univer-inset-0 univer-z-[100]",
@@ -3465,9 +3465,20 @@ function DropdownMenuWrapper({ menuId, slot, value, options, children, disabled,
3465
3465
  const { dropdownVisible, setDropdownVisible } = useContext(TooltipWrapperContext);
3466
3466
  const menuManagerService = useDependency(IMenuManagerService);
3467
3467
  const [hiddenStates, setHiddenStates] = useState({});
3468
+ const [menuVersion, setMenuVersion] = useState(0);
3469
+ useEffect(() => {
3470
+ const subscription = menuManagerService.menuChanged$.subscribe(() => {
3471
+ setMenuVersion((version) => version + 1);
3472
+ });
3473
+ return () => subscription.unsubscribe();
3474
+ }, [menuManagerService]);
3468
3475
  const menuItems = useMemo(() => {
3469
3476
  return menuId ? menuManagerService.getMenuByPositionKey(menuId) : [];
3470
- }, [menuId]);
3477
+ }, [
3478
+ menuId,
3479
+ menuManagerService,
3480
+ menuVersion
3481
+ ]);
3471
3482
  const filteredMenuItems = useMemo(() => {
3472
3483
  return menuItems.filter((item) => {
3473
3484
  var _item$key;
@@ -4231,6 +4242,7 @@ function ContextMenuPanel(props) {
4231
4242
  onWheel: (event) => event.stopPropagation(),
4232
4243
  children: /* @__PURE__ */ jsx(ContextMenuMenu, {
4233
4244
  menuSchemas: menuItems,
4245
+ menuSessionVersion,
4234
4246
  submenuPortalContainer,
4235
4247
  onOptionSelect,
4236
4248
  maxMenuHeight
@@ -4238,7 +4250,7 @@ function ContextMenuPanel(props) {
4238
4250
  });
4239
4251
  }
4240
4252
  function ContextMenuMenu(props) {
4241
- const { menuSchemas, submenuPortalContainer, onOptionSelect, maxMenuHeight } = props;
4253
+ const { menuSchemas, menuSessionVersion, submenuPortalContainer, onOptionSelect, maxMenuHeight } = props;
4242
4254
  const localeService = useDependency(LocaleService);
4243
4255
  const hiddenGroupStates = useContextGroupHiddenStates$1(menuSchemas);
4244
4256
  const visibleSchemas = useMemo(() => {
@@ -4253,6 +4265,7 @@ function ContextMenuMenu(props) {
4253
4265
  if (menuSchema.item) return /* @__PURE__ */ jsx(ContextMenuMenuItem, {
4254
4266
  menuKey: menuSchema.key,
4255
4267
  menuItem: menuSchema.item,
4268
+ menuSessionVersion,
4256
4269
  submenuPortalContainer,
4257
4270
  onOptionSelect,
4258
4271
  maxMenuHeight
@@ -4276,6 +4289,7 @@ function ContextMenuMenu(props) {
4276
4289
  }), menuSchema.children.map((childSchema) => childSchema.item && /* @__PURE__ */ jsx(ContextMenuMenuItem, {
4277
4290
  menuKey: childSchema.key,
4278
4291
  menuItem: childSchema.item,
4292
+ menuSessionVersion,
4279
4293
  submenuPortalContainer,
4280
4294
  onOptionSelect,
4281
4295
  maxMenuHeight
@@ -4284,8 +4298,8 @@ function ContextMenuMenu(props) {
4284
4298
  }) });
4285
4299
  }
4286
4300
  function ContextMenuMenuItem(props) {
4287
- const { menuKey, menuItem, submenuPortalContainer, onOptionSelect, maxMenuHeight } = props;
4288
- const { direction } = useContext(ConfigContext);
4301
+ const { menuKey, menuItem, menuSessionVersion, submenuPortalContainer, onOptionSelect, maxMenuHeight } = props;
4302
+ const direction = useObservable(useDependency(LocaleService).direction$);
4289
4303
  const menuManagerService = useDependency(IMenuManagerService);
4290
4304
  const disabled = useObservable(menuItem.disabled$, false);
4291
4305
  const activated = useObservable(menuItem.activated$, false);
@@ -4318,7 +4332,8 @@ function ContextMenuMenuItem(props) {
4318
4332
  }, [
4319
4333
  menuItem.id,
4320
4334
  menuItem.type,
4321
- menuManagerService
4335
+ menuManagerService,
4336
+ menuSessionVersion
4322
4337
  ]);
4323
4338
  const hasSelectionSubmenu = selections.length > 0;
4324
4339
  const hasSubItemSubmenu = subMenuItems.length > 0;
@@ -4514,6 +4529,7 @@ function ContextMenuMenuItem(props) {
4514
4529
  })
4515
4530
  }), hasSubItemSubmenu && /* @__PURE__ */ jsx(ContextMenuMenu, {
4516
4531
  menuSchemas: subMenuItems,
4532
+ menuSessionVersion,
4517
4533
  submenuPortalContainer,
4518
4534
  onOptionSelect: onSubmenuOptionSelect,
4519
4535
  maxMenuHeight
@@ -4703,62 +4719,18 @@ function DesktopContextMenu() {
4703
4719
  });
4704
4720
  }
4705
4721
 
4706
- //#endregion
4707
- //#region src/services/global-zone/global-zone.service.ts
4708
- const IGlobalZoneService = createIdentifier("univer.global-zone-service");
4709
-
4710
- //#endregion
4711
- //#region src/views/components/global-zone/GlobalZone.tsx
4712
- /**
4713
- * Copyright 2023-present DreamNum Co., Ltd.
4714
- *
4715
- * Licensed under the Apache License, Version 2.0 (the "License");
4716
- * you may not use this file except in compliance with the License.
4717
- * You may obtain a copy of the License at
4718
- *
4719
- * http://www.apache.org/licenses/LICENSE-2.0
4720
- *
4721
- * Unless required by applicable law or agreed to in writing, software
4722
- * distributed under the License is distributed on an "AS IS" BASIS,
4723
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4724
- * See the License for the specific language governing permissions and
4725
- * limitations under the License.
4726
- */
4727
- function GlobalZone() {
4728
- const globalZoneService = useDependency(IGlobalZoneService);
4729
- const [visible, setVisible] = useState(false);
4730
- const componentKey = useObservable(globalZoneService.componentKey$, globalZoneService.componentKey);
4731
- const componentManager = useDependency(ComponentManager);
4732
- const { direction } = useContext(ConfigContext);
4733
- const Component = useMemo(() => {
4734
- const Component = componentManager.get(componentKey !== null && componentKey !== void 0 ? componentKey : "");
4735
- if (Component) return Component;
4736
- }, [componentKey, componentManager]);
4737
- useEffect(() => {
4738
- const subscription = globalZoneService.visible$.subscribe((val) => {
4739
- setVisible(val);
4740
- });
4741
- return () => {
4742
- subscription.unsubscribe();
4743
- };
4744
- }, [globalZoneService.visible$]);
4745
- if (!visible) return null;
4746
- return /* @__PURE__ */ jsx("section", {
4747
- dir: direction,
4748
- className: clsx("univer-absolute univer-bg-gray-100", {
4749
- "univer-hidden": !visible,
4750
- "univer-inset-0 univer-z-[100] univer-block univer-size-full": visible
4751
- }),
4752
- children: Component && /* @__PURE__ */ jsx(Component, {})
4753
- });
4754
- }
4755
-
4756
4722
  //#endregion
4757
4723
  //#region src/views/components/sidebar/Sidebar.tsx
4724
+ const MIN_SIDEBAR_WIDTH = 280;
4725
+ const MAX_SIDEBAR_WIDTH = 800;
4758
4726
  function Sidebar() {
4759
4727
  const sidebarService = useDependency(ISidebarService);
4760
4728
  const sidebarOptions = useObservable(sidebarService.sidebarOptions$);
4761
4729
  const scrollRef = useRef(null);
4730
+ const sidebarRef = useRef(null);
4731
+ const closeButtonRef = useRef(null);
4732
+ const [isDragging, setIsDragging] = useState(false);
4733
+ const dragWidthRef = useRef(null);
4762
4734
  const options = useMemo(() => {
4763
4735
  if (!sidebarOptions) return null;
4764
4736
  const copy = { ...sidebarOptions };
@@ -4769,12 +4741,59 @@ function Sidebar() {
4769
4741
  ]) {
4770
4742
  const k = key;
4771
4743
  if (sidebarOptions[k]) {
4772
- const { key, ...props } = sidebarOptions[k];
4773
- if (props) copy[k] = /* @__PURE__ */ jsx(CustomLabel, { ...props }, key);
4744
+ const { key: itemKey, ...props } = sidebarOptions[k];
4745
+ if (props) copy[k] = /* @__PURE__ */ jsx(CustomLabel, { ...props }, itemKey);
4774
4746
  }
4775
4747
  }
4776
4748
  return copy;
4777
4749
  }, [sidebarOptions]);
4750
+ useEffect(() => {
4751
+ if ((options === null || options === void 0 ? void 0 : options.visible) && closeButtonRef.current) closeButtonRef.current.focus();
4752
+ }, [options === null || options === void 0 ? void 0 : options.visible]);
4753
+ useEffect(() => {
4754
+ const handleKeyDown = (e) => {
4755
+ if (e.key === "Escape" && sidebarService.visible) {
4756
+ e.stopPropagation();
4757
+ sidebarService.close();
4758
+ }
4759
+ };
4760
+ document.addEventListener("keydown", handleKeyDown);
4761
+ return () => document.removeEventListener("keydown", handleKeyDown);
4762
+ }, [sidebarService]);
4763
+ const handleResizeMouseDown = useCallback((e) => {
4764
+ e.preventDefault();
4765
+ e.stopPropagation();
4766
+ setIsDragging(true);
4767
+ document.body.style.cursor = "col-resize";
4768
+ document.body.style.userSelect = "none";
4769
+ }, []);
4770
+ useEffect(() => {
4771
+ if (!isDragging) {
4772
+ document.body.style.cursor = "";
4773
+ document.body.style.userSelect = "";
4774
+ return;
4775
+ }
4776
+ const handleMouseMove = (e) => {
4777
+ if (!sidebarRef.current) return;
4778
+ const newWidth = sidebarRef.current.getBoundingClientRect().right - e.clientX;
4779
+ const clampedWidth = Math.max(MIN_SIDEBAR_WIDTH, Math.min(newWidth, MAX_SIDEBAR_WIDTH));
4780
+ dragWidthRef.current = clampedWidth;
4781
+ sidebarRef.current.style.width = `${clampedWidth}px`;
4782
+ };
4783
+ const handleMouseUp = () => {
4784
+ setIsDragging(false);
4785
+ if (dragWidthRef.current != null) {
4786
+ sidebarService.setWidth(dragWidthRef.current);
4787
+ dragWidthRef.current = null;
4788
+ }
4789
+ };
4790
+ document.addEventListener("mousemove", handleMouseMove);
4791
+ document.addEventListener("mouseup", handleMouseUp);
4792
+ return () => {
4793
+ document.removeEventListener("mousemove", handleMouseMove);
4794
+ document.removeEventListener("mouseup", handleMouseUp);
4795
+ };
4796
+ }, [isDragging, sidebarService]);
4778
4797
  useEffect(() => {
4779
4798
  if (scrollRef.current) sidebarService.setContainer(scrollRef.current);
4780
4799
  return () => {
@@ -4792,29 +4811,66 @@ function Sidebar() {
4792
4811
  };
4793
4812
  }, [sidebarService]);
4794
4813
  const width = useMemo(() => {
4814
+ if (isDragging && dragWidthRef.current != null) return `${dragWidthRef.current}px`;
4795
4815
  if (!(options === null || options === void 0 ? void 0 : options.visible)) return 0;
4816
+ const savedWidth = sidebarService.width;
4817
+ if (savedWidth) return `${savedWidth}px`;
4796
4818
  if (typeof options.width === "number") return `${options.width}px`;
4797
4819
  return options.width;
4798
- }, [options]);
4820
+ }, [
4821
+ isDragging,
4822
+ options,
4823
+ sidebarService
4824
+ ]);
4799
4825
  function handleClose() {
4800
4826
  sidebarService.close(sidebarOptions === null || sidebarOptions === void 0 ? void 0 : sidebarOptions.id);
4801
4827
  }
4802
- return /* @__PURE__ */ jsx("section", {
4828
+ return /* @__PURE__ */ jsxs("section", {
4829
+ ref: sidebarRef,
4803
4830
  "data-u-comp": "sidebar",
4804
- className: clsx("univer-relative univer-h-full univer-bg-white univer-text-gray-900 dark:!univer-bg-gray-900 dark:!univer-text-white", {
4831
+ role: "complementary",
4832
+ "aria-expanded": !!(options === null || options === void 0 ? void 0 : options.visible),
4833
+ "aria-label": "Sidebar panel",
4834
+ className: clsx("univer-relative univer-h-full univer-flex-shrink-0 univer-bg-white univer-text-gray-900 dark:!univer-bg-gray-900 dark:!univer-text-white", {
4805
4835
  "univer-w-96 univer-translate-x-0": options === null || options === void 0 ? void 0 : options.visible,
4806
4836
  "univer-w-0 univer-translate-x-full": !(options === null || options === void 0 ? void 0 : options.visible)
4807
4837
  }),
4808
- style: { width },
4809
- children: /* @__PURE__ */ jsxs("section", {
4838
+ style: { width: isDragging ? void 0 : width },
4839
+ children: [(options === null || options === void 0 ? void 0 : options.visible) && /* @__PURE__ */ jsx("div", {
4840
+ className: "hover:univer-bg-primary-500/30 active:univer-bg-primary-500/50 univer-absolute univer-left-0 univer-top-0 univer-z-20 univer-h-full univer-w-1 univer-cursor-col-resize univer-transition-colors",
4841
+ onMouseDown: handleResizeMouseDown,
4842
+ role: "separator",
4843
+ "aria-orientation": "vertical",
4844
+ "aria-label": "Resize sidebar",
4845
+ tabIndex: 0,
4846
+ onKeyDown: (e) => {
4847
+ if (!sidebarRef.current) return;
4848
+ const currentWidth = sidebarRef.current.getBoundingClientRect().width;
4849
+ let newWidth = currentWidth;
4850
+ if (e.key === "ArrowLeft") {
4851
+ e.preventDefault();
4852
+ newWidth = Math.max(MIN_SIDEBAR_WIDTH, currentWidth - 20);
4853
+ } else if (e.key === "ArrowRight") {
4854
+ e.preventDefault();
4855
+ newWidth = Math.min(MAX_SIDEBAR_WIDTH, currentWidth + 20);
4856
+ }
4857
+ if (newWidth !== currentWidth) {
4858
+ sidebarRef.current.style.width = `${newWidth}px`;
4859
+ sidebarService.setWidth(newWidth);
4860
+ }
4861
+ }
4862
+ }), /* @__PURE__ */ jsxs("section", {
4810
4863
  ref: scrollRef,
4811
4864
  className: clsx("univer-box-border univer-grid univer-h-0 univer-min-h-full univer-grid-rows-[auto_1fr_auto] univer-overflow-y-auto", borderLeftBottomClassName, scrollbarClassName),
4812
4865
  children: [
4813
4866
  /* @__PURE__ */ jsxs("header", {
4814
4867
  className: "univer-sticky univer-top-0 univer-z-10 univer-box-border univer-flex univer-cursor-default univer-items-center univer-justify-between univer-bg-white univer-p-4 univer-pb-2 univer-text-base univer-font-medium univer-text-gray-800 dark:!univer-bg-gray-900 dark:!univer-text-white",
4815
- children: [options === null || options === void 0 ? void 0 : options.header, /* @__PURE__ */ jsx("a", {
4816
- className: "univer-cursor-pointer univer-text-gray-500 dark:!univer-text-gray-300",
4868
+ children: [options === null || options === void 0 ? void 0 : options.header, /* @__PURE__ */ jsx("button", {
4869
+ ref: closeButtonRef,
4870
+ type: "button",
4871
+ className: "focus:univer-ring-primary-500/50 univer-cursor-pointer univer-appearance-none univer-rounded-sm univer-border-none univer-bg-transparent univer-p-0 univer-text-gray-500 focus:univer-outline-none focus:univer-ring-2 dark:!univer-text-gray-300",
4817
4872
  onClick: handleClose,
4873
+ "aria-label": "Close sidebar",
4818
4874
  children: /* @__PURE__ */ jsx(CloseIcon, {})
4819
4875
  })]
4820
4876
  }),
@@ -4828,7 +4884,7 @@ function Sidebar() {
4828
4884
  children: options.footer
4829
4885
  })
4830
4886
  ]
4831
- })
4887
+ })]
4832
4888
  });
4833
4889
  }
4834
4890
 
@@ -5025,7 +5081,6 @@ function DesktopWorkbenchContent(props) {
5025
5081
  dir: direction,
5026
5082
  children: [
5027
5083
  /* @__PURE__ */ jsx(ComponentContainer, { components: globalComponents }, "global"),
5028
- /* @__PURE__ */ jsx(GlobalZone, {}),
5029
5084
  contextMenu && /* @__PURE__ */ jsx(DesktopContextMenu, {}),
5030
5085
  /* @__PURE__ */ jsx(FloatingContainer, {}),
5031
5086
  /* @__PURE__ */ jsx("div", { id: popupRootId })
@@ -5196,7 +5251,7 @@ const IUIController = createIdentifier("univer.ui.ui-controller");
5196
5251
  //#endregion
5197
5252
  //#region package.json
5198
5253
  var name = "@univerjs/ui";
5199
- var version = "0.23.0";
5254
+ var version = "0.24.0";
5200
5255
 
5201
5256
  //#endregion
5202
5257
  //#region src/views/components/ribbon/MobileRibbon.tsx
@@ -5693,7 +5748,8 @@ function MobileContextMenu() {
5693
5748
  const commandService = useDependency(ICommandService);
5694
5749
  const layoutService = useDependency(ILayoutService);
5695
5750
  const localeService = useDependency(LocaleService);
5696
- const { mountContainer, direction } = useContext(ConfigContext);
5751
+ const direction = useObservable(localeService.direction$);
5752
+ const { mountContainer } = useContext(ConfigContext);
5697
5753
  visibleRef.current = visible;
5698
5754
  useEffect(() => {
5699
5755
  const hostDisposable = contextMenuHostService.registerMenu(MOBILE_CONTEXT_MENU_HOST_ID, () => {
@@ -5890,7 +5946,6 @@ function MobileWorkbench(props) {
5890
5946
  ]
5891
5947
  }),
5892
5948
  footer && /* @__PURE__ */ jsx("footer", { children: /* @__PURE__ */ jsx(ComponentContainer, { components: footerComponents }, "footer") }),
5893
- /* @__PURE__ */ jsx(GlobalZone, {}),
5894
5949
  /* @__PURE__ */ jsx(ZenZone, {})
5895
5950
  ]
5896
5951
  })]
@@ -6666,37 +6721,6 @@ let DesktopGalleryService = class DesktopGalleryService extends Disposable {
6666
6721
  };
6667
6722
  DesktopGalleryService = __decorate([__decorateParam(0, Inject(Injector)), __decorateParam(1, IUIPartsService)], DesktopGalleryService);
6668
6723
 
6669
- //#endregion
6670
- //#region src/services/global-zone/desktop-global-zone.service.ts
6671
- let DesktopGlobalZoneService = class DesktopGlobalZoneService {
6672
- constructor(_componentManager) {
6673
- this._componentManager = _componentManager;
6674
- _defineProperty(this, "visible$", new Subject());
6675
- _defineProperty(this, "componentKey$", new Subject());
6676
- _defineProperty(this, "_componentKey", "");
6677
- }
6678
- get componentKey() {
6679
- return this._componentKey;
6680
- }
6681
- set(key, component) {
6682
- this._componentManager.register(key, component);
6683
- this.componentKey$.next(key);
6684
- this._componentKey = key;
6685
- return toDisposable(() => {
6686
- this._componentManager.delete(key);
6687
- this.visible$.complete();
6688
- this.componentKey$.complete();
6689
- });
6690
- }
6691
- open() {
6692
- this.visible$.next(true);
6693
- }
6694
- close() {
6695
- this.visible$.next(false);
6696
- }
6697
- };
6698
- DesktopGlobalZoneService = __decorate([__decorateParam(0, Inject(ComponentManager))], DesktopGlobalZoneService);
6699
-
6700
6724
  //#endregion
6701
6725
  //#region src/services/local-file/desktop-local-file.service.ts
6702
6726
  var DesktopLocalFileService = class extends Disposable {
@@ -6788,8 +6812,9 @@ var DesktopLocalStorageService = class {
6788
6812
  * limitations under the License.
6789
6813
  */
6790
6814
  function MessageContainer() {
6815
+ const localeService = useDependency(LocaleService);
6791
6816
  const darkMode = useObservable(useDependency(ThemeService).darkMode$);
6792
- const { direction } = useContext(ConfigContext);
6817
+ const direction = useObservable(localeService.direction$);
6793
6818
  return /* @__PURE__ */ jsx(Messager, {
6794
6819
  theme: darkMode ? "dark" : "light",
6795
6820
  dir: direction
@@ -6832,8 +6857,9 @@ DesktopMessageService = __decorate([__decorateParam(0, Inject(Injector)), __deco
6832
6857
  //#endregion
6833
6858
  //#region src/components/notification/Notification.tsx
6834
6859
  function Notification() {
6860
+ const localeService = useDependency(LocaleService);
6835
6861
  const darkMode = useObservable(useDependency(ThemeService).darkMode$);
6836
- const { direction } = useContext(ConfigContext);
6862
+ const direction = useObservable(localeService.direction$);
6837
6863
  return /* @__PURE__ */ jsx(Toaster, {
6838
6864
  theme: darkMode ? "dark" : "light",
6839
6865
  dir: direction
@@ -6878,6 +6904,7 @@ var DesktopSidebarService = class extends Disposable {
6878
6904
  _defineProperty(this, "scrollEvent$", new Subject());
6879
6905
  _defineProperty(this, "_container", void 0);
6880
6906
  _defineProperty(this, "_openAnimationFrameId", null);
6907
+ _defineProperty(this, "_width", void 0);
6881
6908
  }
6882
6909
  get visible() {
6883
6910
  return this._sidebarOptions.visible || false;
@@ -6885,6 +6912,12 @@ var DesktopSidebarService = class extends Disposable {
6885
6912
  get options() {
6886
6913
  return this._sidebarOptions;
6887
6914
  }
6915
+ get width() {
6916
+ return this._width;
6917
+ }
6918
+ setWidth(value) {
6919
+ this._width = value;
6920
+ }
6888
6921
  dispose() {
6889
6922
  super.dispose();
6890
6923
  this.close();
@@ -7037,10 +7070,6 @@ let UniverMobileUIPlugin = class UniverMobileUIPlugin extends Plugin {
7037
7070
  useClass: DesktopZenZoneService,
7038
7071
  lazy: true
7039
7072
  }],
7040
- [IGlobalZoneService, {
7041
- useClass: DesktopGlobalZoneService,
7042
- lazy: true
7043
- }],
7044
7073
  [IMessageService, {
7045
7074
  useClass: DesktopMessageService,
7046
7075
  lazy: true
@@ -7138,10 +7167,6 @@ let UniverUIPlugin = class UniverUIPlugin extends Plugin {
7138
7167
  useClass: DesktopZenZoneService,
7139
7168
  lazy: true
7140
7169
  }],
7141
- [IGlobalZoneService, {
7142
- useClass: DesktopGlobalZoneService,
7143
- lazy: true
7144
- }],
7145
7170
  [IMessageService, {
7146
7171
  useClass: DesktopMessageService,
7147
7172
  lazy: true
@@ -7886,4 +7911,4 @@ const PrintFloatDomSingle = memo((props) => {
7886
7911
  });
7887
7912
 
7888
7913
  //#endregion
7889
- export { AnchoredContextMenu, BrowserClipboardService, BuiltInUIPart, COLOR_PICKER_COMPONENT, COMMON_LABEL_COMPONENT, CanvasFloatDomService, CanvasPopup, CanvasPopupService, CommonLabel, ComponentContainer, ComponentManager, DesktopContextMenu as ContextMenu, ContextMenuGroup, ContextMenuHostService, ContextMenuPanel, ContextMenuPosition, ContextMenuService, CopyCommand, CopyShortcutItem, CustomLabel, CutCommand, CutShortcutItem, DISABLE_AUTO_FOCUS_KEY, DesktopBeforeCloseService, DesktopConfirmService, DesktopDialogService, DesktopGalleryService, DesktopGlobalZoneService, DesktopLayoutService, DesktopLocalFileService, DesktopLocalStorageService, DesktopMessageService, DesktopNotificationService, DesktopRibbonService, DesktopSidebarService, DesktopUIController, DesktopZenZoneService, ErrorController, FILE_PNG_CLIPBOARD_MIME_TYPE, FILE_SVG_XML_CLIPBOARD_MIME_TYPE, FILE__BMP_CLIPBOARD_MIME_TYPE, FILE__JPEG_CLIPBOARD_MIME_TYPE, FILE__WEBP_CLIPBOARD_MIME_TYPE, FONT_FAMILY_COMPONENT, FONT_FAMILY_ITEM_COMPONENT, FONT_SIZE_COMPONENT, FONT_SIZE_LIST, FloatDom, FloatDomSingle, FontFamily, FontFamilyItem, FontSize, GlobalZone, HEADING_ITEM_COMPONENT, HEADING_LIST, HTML_CLIPBOARD_MIME_TYPE, HeadingItem, IBeforeCloseService, ICanvasPopupService, IClipboardInterfaceService, IContextMenuHostService, IContextMenuService, IDialogService, IFontService, IGalleryService, IGlobalZoneService, ILayoutService, ILeftSidebarService, ILocalFileService, IMenuManagerService, IMessageService, INotificationService, IPlatformService, IRibbonService, IShortcutService, ISidebarService, IUIController, IUIPartsService, IZenZoneService, KeyCode, MenuItemType, MenuManagerPosition, MenuManagerService, MetaKeys, MobileContextMenu, MockMessageService, PLAIN_TEXT_CLIPBOARD_MIME_TYPE, PasteCommand, PlatformService, PrintFloatDomSingle, ProgressBar, RectPopup, RediConsumer, RediContext, RediProvider, RedoShortcutItem, Ribbon, RibbonDataGroup, RibbonFormulasGroup, RibbonInsertGroup, RibbonOthersGroup, RibbonPosition, RibbonStartGroup, RibbonViewGroup, SharedController, SheetPasteShortKeyCommandName, ShortcutPanelController, ShortcutPanelService, ShortcutService, Sidebar, SingleCanvasPopup, SingleUnitUIController, Slider, ThemeSwitcherService, ToggleShortcutPanelOperation, ToolbarButton, ToolbarItem, menuSchema as UIMenuSchema, UIPartsService, UI_PLUGIN_CONFIG_KEY, UNI_DISABLE_CHANGING_FOCUS_KEY, UndoShortcutItem, UniverMobileUIPlugin, UniverUIPlugin, WithDependency, ZIndexManager, ZenZone, connectDependencies, connectInjector, getHeaderFooterMenuHiddenObservable, getMenuHiddenObservable, handelExcelToJson, handelTableToJson, handleDomToJson, handlePlainToJson, handleStringToStyle, handleTableColgroup, handleTableMergeData, handleTableRowGroup, imageMimeTypeSet, mergeMenuConfigs, parseHtmlDocument, parseHtmlFragment, sanitizeParsedHtml, splitSpanText, supportClipboardAPI, t, textTrim, useClickOutSide, useComponentsOfPart, useConfigValue, useDebounceFn, useDependency, useEvent, useInjector, useObservable, useObservableRef, useScrollYOverContainer, useSidebarClick, useToolbarItemStatus, useUpdateBinder, useUpdateEffect, useVirtualList };
7914
+ export { AnchoredContextMenu, BrowserClipboardService, BuiltInUIPart, COLOR_PICKER_COMPONENT, COMMON_LABEL_COMPONENT, CanvasFloatDomService, CanvasPopup, CanvasPopupService, CommonLabel, ComponentContainer, ComponentManager, DesktopContextMenu as ContextMenu, ContextMenuGroup, ContextMenuHostService, ContextMenuPanel, ContextMenuPosition, ContextMenuService, CopyCommand, CopyShortcutItem, CustomLabel, CutCommand, CutShortcutItem, DISABLE_AUTO_FOCUS_KEY, DesktopBeforeCloseService, DesktopConfirmService, DesktopDialogService, DesktopGalleryService, DesktopLayoutService, DesktopLocalFileService, DesktopLocalStorageService, DesktopMessageService, DesktopNotificationService, DesktopRibbonService, DesktopSidebarService, DesktopUIController, DesktopZenZoneService, ErrorController, FILE_PNG_CLIPBOARD_MIME_TYPE, FILE_SVG_XML_CLIPBOARD_MIME_TYPE, FILE__BMP_CLIPBOARD_MIME_TYPE, FILE__JPEG_CLIPBOARD_MIME_TYPE, FILE__WEBP_CLIPBOARD_MIME_TYPE, FONT_FAMILY_COMPONENT, FONT_FAMILY_ITEM_COMPONENT, FONT_SIZE_COMPONENT, FONT_SIZE_LIST, FloatDom, FloatDomSingle, FontFamily, FontFamilyItem, FontSize, HEADING_ITEM_COMPONENT, HEADING_LIST, HTML_CLIPBOARD_MIME_TYPE, HeadingItem, IBeforeCloseService, ICanvasPopupService, IClipboardInterfaceService, IContextMenuHostService, IContextMenuService, IDialogService, IFontService, IGalleryService, ILayoutService, ILeftSidebarService, ILocalFileService, IMenuManagerService, IMessageService, INotificationService, IPlatformService, IRibbonService, IShortcutService, ISidebarService, IUIController, IUIPartsService, IZenZoneService, KeyCode, MenuItemType, MenuManagerPosition, MenuManagerService, MetaKeys, MobileContextMenu, MockMessageService, PLAIN_TEXT_CLIPBOARD_MIME_TYPE, PasteCommand, PlatformService, PrintFloatDomSingle, ProgressBar, RectPopup, RediConsumer, RediContext, RediProvider, RedoShortcutItem, Ribbon, RibbonDataGroup, RibbonFormulasGroup, RibbonInsertGroup, RibbonOthersGroup, RibbonPosition, RibbonStartGroup, RibbonViewGroup, SharedController, SheetPasteShortKeyCommandName, ShortcutPanelController, ShortcutPanelService, ShortcutService, Sidebar, SingleCanvasPopup, SingleUnitUIController, Slider, ThemeSwitcherService, ToggleShortcutPanelOperation, ToolbarButton, ToolbarItem, menuSchema as UIMenuSchema, UIPartsService, UI_PLUGIN_CONFIG_KEY, UNI_DISABLE_CHANGING_FOCUS_KEY, UndoShortcutItem, UniverMobileUIPlugin, UniverUIPlugin, WithDependency, ZIndexManager, ZenZone, connectDependencies, connectInjector, getHeaderFooterMenuHiddenObservable, getMenuHiddenObservable, handelExcelToJson, handelTableToJson, handleDomToJson, handlePlainToJson, handleStringToStyle, handleTableColgroup, handleTableMergeData, handleTableRowGroup, imageMimeTypeSet, mergeMenuConfigs, parseHtmlDocument, parseHtmlFragment, sanitizeParsedHtml, splitSpanText, supportClipboardAPI, t, textTrim, useClickOutSide, useComponentsOfPart, useConfigValue, useDebounceFn, useDependency, useEvent, useInjector, useObservable, useObservableRef, useScrollYOverContainer, useSidebarClick, useToolbarItemStatus, useUpdateBinder, useUpdateEffect, useVirtualList };
package/lib/facade.js CHANGED
@@ -332,7 +332,7 @@ let FShortcut = class FShortcut extends FBase {
332
332
  * ```
333
333
  */
334
334
  triggerShortcut(e) {
335
- const workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
335
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
336
336
  if (!workbook) return;
337
337
  const renderUnit = this._renderManagerService.getRenderById(workbook.getUnitId());
338
338
  if (!renderUnit) return;
package/lib/index.css CHANGED
@@ -93,6 +93,10 @@
93
93
  z-index: 10;
94
94
  }
95
95
 
96
+ .univer-z-20 {
97
+ z-index: 20;
98
+ }
99
+
96
100
  .univer-z-\[-1\] {
97
101
  z-index: -1;
98
102
  }
@@ -296,6 +300,10 @@
296
300
  width: 0;
297
301
  }
298
302
 
303
+ .univer-w-1 {
304
+ width: .25rem;
305
+ }
306
+
299
307
  .univer-w-10 {
300
308
  width: 2.5rem;
301
309
  }
@@ -430,6 +438,10 @@
430
438
  transform: translate(var(--univer-tw-translate-x), var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skewX(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));
431
439
  }
432
440
 
441
+ .univer-cursor-col-resize {
442
+ cursor: col-resize;
443
+ }
444
+
433
445
  .univer-cursor-default {
434
446
  cursor: default;
435
447
  }
@@ -1167,6 +1179,13 @@
1167
1179
  outline: 2px solid #0000;
1168
1180
  }
1169
1181
 
1182
+ .focus\:univer-ring-2:focus {
1183
+ --univer-tw-ring-offset-shadow: var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);
1184
+ --univer-tw-ring-shadow: var(--univer-tw-ring-inset) 0 0 0 calc(2px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);
1185
+ box-shadow: var(--univer-tw-ring-offset-shadow), var(--univer-tw-ring-shadow), 0 0 #0000;
1186
+ box-shadow: var(--univer-tw-ring-offset-shadow), var(--univer-tw-ring-shadow), var(--univer-tw-shadow, 0 0 #0000);
1187
+ }
1188
+
1170
1189
  .focus-visible\:univer-ring-2:focus-visible {
1171
1190
  --univer-tw-ring-offset-shadow: var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);
1172
1191
  --univer-tw-ring-shadow: var(--univer-tw-ring-inset) 0 0 0 calc(2px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);