@univerjs/slides-ui 0.7.0-nightly.202505091607 → 0.7.0-nightly.202505101606

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
@@ -1,10 +1,10 @@
1
1
  var ai = Object.defineProperty;
2
2
  var ci = (n, e, t) => e in n ? ai(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var S = (n, e, t) => ci(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { Inject as X, Injector as ze, IUniverInstanceService as y, RxDisposable as ve, UniverInstanceType as E, debounce as li, getColorStyle as di, CommandType as D, Tools as ui, LocaleService as Q, ICommandService as U, generateRandomId as Ct, BasicShapes as hi, PageElementType as ke, Disposable as De, DisposableCollection as Ke, IContextService as fe, toDisposable as St, FOCUSING_COMMON_DRAWINGS as gi, createInternalEditorID as vi, createIdentifier as It, EDITOR_ACTIVATED as Re, FOCUSING_EDITOR_STANDALONE as bt, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as Et, DocumentDataModel as fi, HorizontalAlign as Ot, VerticalAlign as xe, IUndoRedoService as mi, WrapStrategy as et, FOCUSING_EDITOR_BUT_HIDDEN as pi, DEFAULT_EMPTY_DOCUMENT_VALUE as _i, Direction as j, DocumentFlavor as Ci, FOCUSING_UNIVER_EDITOR as Rt, FORMULA_EDITOR_ACTIVATED as Si, Plugin as Ii, merge as bi, mergeOverrideWithDependencies as tt, IConfigService as Ei } from "@univerjs/core";
5
- import { IRenderManagerService as G, Viewport as it, ScrollBar as xt, getCurrentTypeOfRenderer as Ae, Slide as Oi, Rect as yt, Scene as Ri, ObjectType as le, pxToNum as xi, DeviceInputEventType as q, convertTextRotation as nt, FIX_ONE_PIXEL_BLUR_OFFSET as ne, fixLineWidthByScale as rt } from "@univerjs/engine-render";
4
+ import { Inject as X, Injector as ze, IUniverInstanceService as y, RxDisposable as ve, UniverInstanceType as E, debounce as li, getColorStyle as di, CommandType as D, Tools as ui, LocaleService as Q, ICommandService as U, generateRandomId as Ct, BasicShapes as hi, PageElementType as ke, Disposable as De, DisposableCollection as Ke, IContextService as fe, toDisposable as St, FOCUSING_COMMON_DRAWINGS as gi, createInternalEditorID as vi, createIdentifier as It, EDITOR_ACTIVATED as xe, FOCUSING_EDITOR_STANDALONE as bt, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as Et, DocumentDataModel as fi, HorizontalAlign as Ot, VerticalAlign as Re, IUndoRedoService as mi, WrapStrategy as et, FOCUSING_EDITOR_BUT_HIDDEN as pi, DEFAULT_EMPTY_DOCUMENT_VALUE as _i, Direction as j, DocumentFlavor as Ci, FOCUSING_UNIVER_EDITOR as xt, FORMULA_EDITOR_ACTIVATED as Si, Plugin as Ii, merge as bi, mergeOverrideWithDependencies as tt, IConfigService as Ei } from "@univerjs/core";
5
+ import { IRenderManagerService as G, Viewport as it, ScrollBar as Rt, getCurrentTypeOfRenderer as Ae, Slide as Oi, Rect as yt, Scene as xi, ObjectType as le, pxToNum as Ri, DeviceInputEventType as q, convertTextRotation as nt, FIX_ONE_PIXEL_BLUR_OFFSET as ne, fixLineWidthByScale as rt } from "@univerjs/engine-render";
6
6
  import { ObjectProvider as yi, SLIDE_KEY as re } from "@univerjs/slides";
7
- import { useDependency as x, ISidebarService as Pt, ICanvasPopupService as Pi, ILayoutService as wi, KeyCode as P, ILocalFileService as Ti, useObservable as Mi, DISABLE_AUTO_FOCUS_KEY as st, getMenuHiddenObservable as me, MenuItemType as pe, RibbonStartGroup as Ni, MetaKeys as Di, IMenuManagerService as Ui, ComponentManager as Vi, IUIPartsService as ji, IShortcutService as Li, BuiltInUIPart as ot, connectInjector as at } from "@univerjs/ui";
7
+ import { useDependency as R, ISidebarService as Pt, ICanvasPopupService as Pi, ILayoutService as wi, KeyCode as P, ILocalFileService as Ti, useObservable as Mi, DISABLE_AUTO_FOCUS_KEY as st, getMenuHiddenObservable as me, MenuItemType as pe, RibbonStartGroup as Ni, MetaKeys as Di, IMenuManagerService as Ui, ComponentManager as Vi, IUIPartsService as ji, IShortcutService as Li, BuiltInUIPart as ot, connectInjector as at } from "@univerjs/ui";
8
8
  import { jsxs as O, jsx as u } from "react/jsx-runtime";
9
9
  import { Button as Se, clsx as K, Dropdown as wt, ColorPicker as Ai, borderTopClassName as Tt, InputNumber as ce, borderClassName as ue, scrollbarClassName as Bi } from "@univerjs/design";
10
10
  import $i, { forwardRef as A, useRef as Mt, createElement as B, useState as k, useEffect as he, useMemo as Hi, createRef as Fi, useCallback as ct } from "react";
@@ -56,7 +56,7 @@ let ge = class extends ve {
56
56
  o.onMouseWheel(l, h);
57
57
  }), i.onFileLoaded$.subscribeEvent(() => {
58
58
  this._refreshThumb();
59
- }), xt.attachTo(o);
59
+ }), Rt.attachTo(o);
60
60
  const a = this._createSlide(i);
61
61
  this._renderContext.mainComponent = a, this._createSlidePages(r, a), this.createThumbs(), t.runRenderLoop(() => {
62
62
  i.render();
@@ -183,7 +183,7 @@ let ge = class extends ve {
183
183
  const i = this._renderContext;
184
184
  if (!i || !this._objectProvider)
185
185
  return;
186
- const { scene: r, mainComponent: s } = i, o = s, { width: a, height: c } = o, h = new Ri(e, o, {
186
+ const { scene: r, mainComponent: s } = i, o = s, { width: a, height: c } = o, h = new xi(e, o, {
187
187
  width: a,
188
188
  height: c
189
189
  });
@@ -442,7 +442,7 @@ const W = {
442
442
  }
443
443
  };
444
444
  function In(n) {
445
- const { pageId: e, unitId: t } = n, i = x(Q), r = x(T), s = x(U), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
445
+ const { pageId: e, unitId: t } = n, i = R(Q), r = R(T), s = R(U), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
446
446
  if (!a) return null;
447
447
  const c = a.getTransformer();
448
448
  if (!c) return null;
@@ -465,8 +465,17 @@ function In(n) {
465
465
  });
466
466
  };
467
467
  return /* @__PURE__ */ O("div", { className: "univer-relative univer-w-full", children: [
468
- /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full univer-text-left univer-text-gray-600", children: /* @__PURE__ */ u("div", { children: i.t("image-panel.arrange.title") }) }) }),
469
- /* @__PURE__ */ O("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: [
468
+ /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ u(
469
+ "div",
470
+ {
471
+ className: `
472
+ univer-w-full univer-text-left univer-text-gray-600
473
+ dark:univer-text-gray-200
474
+ `,
475
+ children: /* @__PURE__ */ u("div", { children: i.t("image-panel.arrange.title") })
476
+ }
477
+ ) }),
478
+ /* @__PURE__ */ O("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: [
470
479
  /* @__PURE__ */ u("div", { className: "univer-w-1/2", children: /* @__PURE__ */ u(Se, { onClick: () => {
471
480
  d(
472
481
  0
@@ -486,7 +495,7 @@ function In(n) {
486
495
  i.t("image-panel.arrange.backward")
487
496
  ] }) }) })
488
497
  ] }),
489
- /* @__PURE__ */ O("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: [
498
+ /* @__PURE__ */ O("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: [
490
499
  /* @__PURE__ */ u("div", { className: "univer-w-1/2", children: /* @__PURE__ */ u(Se, { onClick: () => {
491
500
  d(
492
501
  2
@@ -510,7 +519,7 @@ function In(n) {
510
519
  }
511
520
  function bn(n) {
512
521
  var m, f;
513
- const { pageId: e, unitId: t } = n, i = x(Q), r = x(T), s = x(U), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
522
+ const { pageId: e, unitId: t } = n, i = R(Q), r = R(T), s = R(U), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
514
523
  if (!a) return null;
515
524
  const c = a.getTransformer();
516
525
  if (!c) return null;
@@ -539,8 +548,17 @@ function bn(n) {
539
548
  {
540
549
  className: K("univer-relative univer-bottom-0 univer-mt-5 univer-w-full", Tt),
541
550
  children: /* @__PURE__ */ O("div", { className: "univer-relative univer-w-full", children: [
542
- /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full univer-text-left univer-text-gray-600", children: /* @__PURE__ */ u("div", { children: i.t("slide.panel.fill.title") }) }) }),
543
- /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-1/2", children: /* @__PURE__ */ u(
551
+ /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ u(
552
+ "div",
553
+ {
554
+ className: `
555
+ univer-w-full univer-text-left univer-text-gray-600
556
+ dark:univer-text-gray-200
557
+ `,
558
+ children: /* @__PURE__ */ u("div", { children: i.t("slide.panel.fill.title") })
559
+ }
560
+ ) }),
561
+ /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ u("div", { className: "univer-w-1/2", children: /* @__PURE__ */ u(
544
562
  wt,
545
563
  {
546
564
  overlay: /* @__PURE__ */ u("div", { className: "univer-rounded-lg univer-p-4", children: /* @__PURE__ */ u(
@@ -561,7 +579,7 @@ function bn(n) {
561
579
  );
562
580
  }
563
581
  function En(n) {
564
- const { pageId: e, unitId: t } = n, i = x(Q), r = x(T), s = x(U), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
582
+ const { pageId: e, unitId: t } = n, i = R(Q), r = R(T), s = R(U), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
565
583
  if (!a) return null;
566
584
  const c = a.getTransformer();
567
585
  if (!c) return null;
@@ -573,7 +591,7 @@ function En(n) {
573
591
  left: p = 0,
574
592
  top: m = 0,
575
593
  angle: f = 0
576
- } = l, [g, _] = k(d), [I, b] = k(v), [w, M] = k(p), [V, R] = k(m), [z, se] = k(f), H = (C) => {
594
+ } = l, [g, _] = k(d), [I, b] = k(v), [w, M] = k(p), [V, x] = k(m), [z, se] = k(f), H = (C) => {
577
595
  const { objects: oe } = C, ae = oe.values().next().value, {
578
596
  width: ii = 0,
579
597
  height: ni = 0,
@@ -581,7 +599,7 @@ function En(n) {
581
599
  top: si = 0,
582
600
  angle: oi = 0
583
601
  } = ae;
584
- _(ii), b(ni), M(ri), R(si), se(oi);
602
+ _(ii), b(ni), M(ri), x(si), se(oi);
585
603
  };
586
604
  he(() => {
587
605
  const C = c.changeStart$.subscribe((ae) => {
@@ -627,7 +645,7 @@ function En(n) {
627
645
  props: {
628
646
  right: C
629
647
  }
630
- }), l == null || l.translate(l.left, C), R(C), c == null || c.refreshControls());
648
+ }), l == null || l.translate(l.left, C), x(C), c == null || c.refreshControls());
631
649
  }
632
650
  function Ce(C) {
633
651
  !C || !l || (s.executeCommand(W.id, {
@@ -645,11 +663,20 @@ function En(n) {
645
663
  {
646
664
  className: K("univer-relative univer-bottom-0 univer-mt-5 univer-w-full", Tt),
647
665
  children: [
648
- /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full univer-text-left univer-text-gray-600", children: /* @__PURE__ */ u("div", { children: i.t("image-panel.transform.title") }) }) }),
649
- /* @__PURE__ */ O("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: [
666
+ /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ u(
667
+ "div",
668
+ {
669
+ className: `
670
+ univer-w-full univer-text-left univer-text-gray-600
671
+ dark:univer-text-gray-200
672
+ `,
673
+ children: /* @__PURE__ */ u("div", { children: i.t("image-panel.transform.title") })
674
+ }
675
+ ) }),
676
+ /* @__PURE__ */ O("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: [
650
677
  /* @__PURE__ */ u("div", { className: "univer-w-1/3", children: /* @__PURE__ */ O("label", { children: [
651
- /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.width") }) }),
652
- /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
678
+ /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.width") }) }),
679
+ /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
653
680
  ce,
654
681
  {
655
682
  className: "univer-w-11/12",
@@ -662,8 +689,8 @@ function En(n) {
662
689
  ) }) })
663
690
  ] }) }),
664
691
  /* @__PURE__ */ u("div", { className: "univer-w-1/3", children: /* @__PURE__ */ O("label", { children: [
665
- /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.height") }) }),
666
- /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
692
+ /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.height") }) }),
693
+ /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
667
694
  ce,
668
695
  {
669
696
  className: "univer-w-11/12",
@@ -676,10 +703,10 @@ function En(n) {
676
703
  ) }) })
677
704
  ] }) })
678
705
  ] }),
679
- /* @__PURE__ */ O("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: [
706
+ /* @__PURE__ */ O("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: [
680
707
  /* @__PURE__ */ u("div", { className: "univer-w-1/3", children: /* @__PURE__ */ O("label", { children: [
681
- /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.x") }) }),
682
- /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
708
+ /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.x") }) }),
709
+ /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
683
710
  ce,
684
711
  {
685
712
  className: "univer-w-11/12",
@@ -693,8 +720,8 @@ function En(n) {
693
720
  ) }) })
694
721
  ] }) }),
695
722
  /* @__PURE__ */ u("div", { className: "univer-w-1/3", children: /* @__PURE__ */ O("label", { children: [
696
- /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.y") }) }),
697
- /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
723
+ /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.y") }) }),
724
+ /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
698
725
  ce,
699
726
  {
700
727
  className: "univer-w-11/12",
@@ -708,8 +735,8 @@ function En(n) {
708
735
  ) }) })
709
736
  ] }) }),
710
737
  /* @__PURE__ */ u("div", { className: "univer-w-1/3", children: /* @__PURE__ */ O("label", { children: [
711
- /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.rotate") }) }),
712
- /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
738
+ /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.rotate") }) }),
739
+ /* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
713
740
  ce,
714
741
  {
715
742
  className: "univer-w-11/12",
@@ -727,7 +754,7 @@ function En(n) {
727
754
  const Oe = "COMPONENT_SLIDE_SIDEBAR";
728
755
  function On() {
729
756
  var h, l, d;
730
- const n = x(y), e = x(T), t = n.getCurrentUnitForType(E.UNIVER_SLIDE), i = (h = t == null ? void 0 : t.getActivePage()) == null ? void 0 : h.id;
757
+ const n = R(y), e = R(T), t = n.getCurrentUnitForType(E.UNIVER_SLIDE), i = (h = t == null ? void 0 : t.getActivePage()) == null ? void 0 : h.id;
731
758
  if (!i) return null;
732
759
  const s = (l = e.getRenderUnitByPageId(i, i).scene) == null ? void 0 : l.getTransformer();
733
760
  if (!s) return null;
@@ -794,8 +821,8 @@ const Ye = {
794
821
  }) : r.close(), !0;
795
822
  }
796
823
  }, kt = "COMPONENT_SLIDE_IMAGE_POPUP_MENU";
797
- var Rn = Object.getOwnPropertyDescriptor, xn = (n, e, t, i) => {
798
- for (var r = i > 1 ? void 0 : i ? Rn(e, t) : e, s = n.length - 1, o; s >= 0; s--)
824
+ var xn = Object.getOwnPropertyDescriptor, Rn = (n, e, t, i) => {
825
+ for (var r = i > 1 ? void 0 : i ? xn(e, t) : e, s = n.length - 1, o; s >= 0; s--)
799
826
  (o = n[s]) && (r = o(r) || r);
800
827
  return r;
801
828
  }, Ie = (n, e) => (t, i) => e(t, i, n);
@@ -833,7 +860,7 @@ let ye = class extends De {
833
860
  right: c + l,
834
861
  top: h,
835
862
  bottom: h + d
836
- }, f = a.getCanvasElement(), g = f.getBoundingClientRect(), _ = xi(f.style.width), { scaleX: I, scaleY: b } = o.getAncestorScale(), w = yn(m, o), { top: M, left: V, width: R } = g, z = R / _;
863
+ }, f = a.getCanvasElement(), g = f.getBoundingClientRect(), _ = Ri(f.style.width), { scaleX: I, scaleY: b } = o.getAncestorScale(), w = yn(m, o), { top: M, left: V, width: x } = g, z = x / _;
837
864
  return {
838
865
  left: w.left * z * I + V + v,
839
866
  right: w.right * z * I + V + v,
@@ -869,7 +896,7 @@ let ye = class extends De {
869
896
  };
870
897
  }
871
898
  };
872
- ye = xn([
899
+ ye = Rn([
873
900
  Ie(0, X(Pi)),
874
901
  Ie(1, G),
875
902
  Ie(2, y),
@@ -1033,7 +1060,7 @@ let $e = class extends De {
1033
1060
  * @editorInfo editorInfo
1034
1061
  */
1035
1062
  setEditorRect(e) {
1036
- this._currentEditRectInfo = e, this._editorService.getFocusEditor() || (this._editorService.focus(de), this._contextService.setContextValue(Re, !1), this._contextService.setContextValue(bt, !1), this._contextService.setContextValue(Et, !1));
1063
+ this._currentEditRectInfo = e, this._editorService.getFocusEditor() || (this._editorService.focus(de), this._contextService.setContextValue(xe, !1), this._contextService.setContextValue(bt, !1), this._contextService.setContextValue(Et, !1));
1037
1064
  const t = this.getEditRectState();
1038
1065
  this._currentEditRectState = t, this._currentEditRectState$.next(t);
1039
1066
  }
@@ -1057,7 +1084,7 @@ let $e = class extends De {
1057
1084
  fontString: "document",
1058
1085
  textRotation: { a: 0, v: 0 },
1059
1086
  wrapStrategy: 0,
1060
- verticalAlign: xe.TOP,
1087
+ verticalAlign: Re.TOP,
1061
1088
  horizontalAlign: Ot.LEFT,
1062
1089
  paddingData: { t: 0, b: 1, l: 2, r: 2 }
1063
1090
  }, a = t.richTextObj.width, c = t.richTextObj.height, h = t.richTextObj.left, l = t.richTextObj.top, d = {
@@ -1125,7 +1152,7 @@ let $e = class extends De {
1125
1152
  textStyle: { fs: r },
1126
1153
  renderConfig: {
1127
1154
  // horizontalAlign: HorizontalAlign.CENTER,
1128
- verticalAlign: xe.MIDDLE,
1155
+ verticalAlign: Re.MIDDLE,
1129
1156
  centerAngle: 0,
1130
1157
  vertexAngle: 0,
1131
1158
  wrapStrategy: 0
@@ -1288,7 +1315,7 @@ let He = class extends De {
1288
1315
  I = p, d.updateDocumentDataMargin(f);
1289
1316
  else {
1290
1317
  let b = 0;
1291
- m === xe.MIDDLE ? b = (I - p) / 2 / o : m === xe.TOP ? b = f.t || 0 : b = (I - p) / o - (f.b || 0), b = b < (f.t || 0) ? f.t || 0 : b, d.updateDocumentDataMargin({
1318
+ m === Re.MIDDLE ? b = (I - p) / 2 / o : m === Re.TOP ? b = f.t || 0 : b = (I - p) / o - (f.b || 0), b = b < (f.t || 0) ? f.t || 0 : b, d.updateDocumentDataMargin({
1292
1319
  t: b
1293
1320
  });
1294
1321
  }
@@ -1333,9 +1360,9 @@ let He = class extends De {
1333
1360
  const d = this._renderContext.engine.getCanvasElement(), v = d.getBoundingClientRect(), p = h(d.style.width), { top: m, left: f, width: g } = v, _ = g / p;
1334
1361
  let { startX: I, startY: b } = i;
1335
1362
  I += r.left, b += r.top;
1336
- const { document: w, scene: M, engine: V } = c, R = M.getViewport(ht.VIEW_MAIN), z = document.body.clientHeight - b - r.top - Vn * 2, se = document.body.clientWidth - I - r.left;
1337
- let H = t, F = R == null ? void 0 : R.getScrollBar();
1338
- H > z ? (H = z, F == null ? R && new xt(R, { enableHorizontal: !1, barSize: 8 }) : R == null || R.resetCanvasSizeAndUpdateScroll()) : (F = null, (C = R == null ? void 0 : R.getScrollBar()) == null || C.dispose()), e += (F == null ? void 0 : F.barSize) || 0, e = Math.min(e, se), I -= ne, b -= ne, this._addBackground(M, e / o, t / a, s);
1363
+ const { document: w, scene: M, engine: V } = c, x = M.getViewport(ht.VIEW_MAIN), z = document.body.clientHeight - b - r.top - Vn * 2, se = document.body.clientWidth - I - r.left;
1364
+ let H = t, F = x == null ? void 0 : x.getScrollBar();
1365
+ H > z ? (H = z, F == null ? x && new Rt(x, { enableHorizontal: !1, barSize: 8 }) : x == null || x.resetCanvasSizeAndUpdateScroll()) : (F = null, (C = x == null ? void 0 : x.getScrollBar()) == null || C.dispose()), e += (F == null ? void 0 : F.barSize) || 0, e = Math.min(e, se), I -= ne, b -= ne, this._addBackground(M, e / o, t / a, s);
1339
1366
  const { scaleX: ee, scaleY: te } = M.getPrecisionScale();
1340
1367
  M.transformByState({
1341
1368
  width: e * _ / o,
@@ -1406,7 +1433,7 @@ let He = class extends De {
1406
1433
  if (d == null)
1407
1434
  return;
1408
1435
  const { scene: v } = d;
1409
- this._contextService.setContextValue(Re, !0);
1436
+ this._contextService.setContextValue(xe, !0);
1410
1437
  const { documentModel: p } = s, m = this._getEditorSkeleton(h);
1411
1438
  if (!m || !p)
1412
1439
  return;
@@ -1469,7 +1496,7 @@ let He = class extends De {
1469
1496
  this._moveCursor(t);
1470
1497
  }
1471
1498
  _exitInput(e) {
1472
- this._contextService.setContextValue(Re, !1), this._cellEditorManagerService.setState({
1499
+ this._contextService.setContextValue(xe, !1), this._cellEditorManagerService.setState({
1473
1500
  show: e.visible
1474
1501
  });
1475
1502
  const t = this._editorBridgeService.getCurrentEditorId();
@@ -1694,14 +1721,14 @@ const Kt = {
1694
1721
  if (!i) return !1;
1695
1722
  const s = await n.get(Ti).openFile({
1696
1723
  multiple: !0,
1697
- accept: qi.map((R) => `.${R.replace("image/", "")}`).join(",")
1724
+ accept: qi.map((x) => `.${x.replace("image/", "")}`).join(",")
1698
1725
  });
1699
1726
  if (s.length !== 1) return !1;
1700
1727
  const a = await n.get(Ji).saveImage(s[0]);
1701
1728
  if (!a) return !1;
1702
1729
  const { imageId: c, imageSourceType: h, source: l, base64Cache: d } = a, { width: v, height: p, image: m } = await Qi(d || ""), f = t.getUnit(i);
1703
1730
  if (!f) return !1;
1704
- const g = f.getActivePage(), _ = Object.values(g.pageElements), I = _ != null && _.length ? Math.max(..._.map((R) => R.zIndex)) : 20, b = {
1731
+ const g = f.getActivePage(), _ = Object.values(g.pageElements), I = _ != null && _.length ? Math.max(..._.map((x) => x.zIndex)) : 20, b = {
1705
1732
  id: c,
1706
1733
  zIndex: I + 1,
1707
1734
  left: 0,
@@ -1772,7 +1799,7 @@ function Bn(n) {
1772
1799
  const e = (f = (m = n.popup) == null ? void 0 : m.extraProps) == null ? void 0 : f.menuItems;
1773
1800
  if (!e)
1774
1801
  return null;
1775
- const t = x(U), i = x(Q), [r, s] = k(!1), [o, a] = k(!1), c = () => {
1802
+ const t = R(U), i = R(Q), [r, s] = k(!1), [o, a] = k(!1), c = () => {
1776
1803
  a(!0);
1777
1804
  }, h = () => {
1778
1805
  a(!1);
@@ -1818,13 +1845,24 @@ function Bn(n) {
1818
1845
  "div",
1819
1846
  {
1820
1847
  className: K(`
1821
- univer-flex univer-items-center univer-justify-center univer-rounded univer-bg-white univer-p-1
1848
+ univer-flex univer-items-center univer-gap-2 univer-rounded univer-p-1
1849
+ dark:hover:univer-bg-gray-800
1850
+ hover:univer-bg-gray-100
1822
1851
  `, ue, {
1823
- "univer-bg-gray-100": r
1852
+ "univer-bg-gray-100 dark:univer-bg-gray-800": r,
1853
+ "univer-bg-white dark:univer-bg-gray-900": !r
1824
1854
  }),
1825
1855
  children: [
1826
- /* @__PURE__ */ u(jt, { className: "univer-fill-primary-600 univer-text-gray-900" }),
1827
- v && /* @__PURE__ */ u(Ge, {})
1856
+ /* @__PURE__ */ u(
1857
+ jt,
1858
+ {
1859
+ className: `
1860
+ univer-fill-primary-600 univer-text-gray-900
1861
+ dark:univer-text-white
1862
+ `
1863
+ }
1864
+ ),
1865
+ v && /* @__PURE__ */ u(Ge, { className: "dark:univer-text-white" })
1828
1866
  ]
1829
1867
  }
1830
1868
  )
@@ -1835,7 +1873,7 @@ function Bn(n) {
1835
1873
  }
1836
1874
  function $n() {
1837
1875
  var m, f;
1838
- const n = x(y), e = x(U), t = x(G), i = x(Q), r = Mt(null), s = n.getCurrentUnitForType(E.UNIVER_SLIDE), o = s == null ? void 0 : s.getPages(), a = s == null ? void 0 : s.getPageOrder();
1876
+ const n = R(y), e = R(U), t = R(G), i = R(Q), r = Mt(null), s = n.getCurrentUnitForType(E.UNIVER_SLIDE), o = s == null ? void 0 : s.getPages(), a = s == null ? void 0 : s.getPageOrder();
1839
1877
  if (!o || !a)
1840
1878
  return null;
1841
1879
  const c = a.map((g) => o[g]), [h, l] = k((f = (m = s == null ? void 0 : s.getActivePage()) == null ? void 0 : m.id) != null ? f : null), d = Hi(() => c.map(() => Fi()), [c]);
@@ -1917,7 +1955,7 @@ const Te = -1e3, pt = {
1917
1955
  }, Hn = () => {
1918
1956
  const [n, e] = k({
1919
1957
  ...pt
1920
- }), t = x(qe), i = x(Xe), r = x(fe), s = Mi(
1958
+ }), t = R(qe), i = R(Xe), r = R(fe), s = Mi(
1921
1959
  () => r.subscribeContextValue$(st),
1922
1960
  !1,
1923
1961
  void 0,
@@ -2038,10 +2076,10 @@ const Xn = {
2038
2076
  }
2039
2077
  };
2040
2078
  function We(n) {
2041
- return n.getContextValue(Rt) && n.getContextValue(Re);
2079
+ return n.getContextValue(xt) && n.getContextValue(xe);
2042
2080
  }
2043
2081
  function Gn(n) {
2044
- return n.getContextValue(Si) && n.getContextValue(Rt);
2082
+ return n.getContextValue(Si) && n.getContextValue(xt);
2045
2083
  }
2046
2084
  const ti = [
2047
2085
  P.ARROW_DOWN,
package/lib/index.css CHANGED
@@ -1 +1 @@
1
- .univer-absolute{position:absolute}.univer-relative{position:relative}.univer-bottom-0{bottom:0}.univer-z-10{z-index:10}.univer-m-0{margin:0}.univer-my-4{margin-top:16px;margin-bottom:16px}.univer-mt-2\.5{margin-top:10px}.univer-mt-5{margin-top:20px}.univer-box-border{box-sizing:border-box}.univer-block{display:block}.univer-flex{display:flex}.univer-grid{display:grid}.univer-h-32{height:128px}.univer-h-8{height:32px}.univer-h-full{height:100%}.univer-w-1\/2{width:50%}.univer-w-1\/3{width:33.333333%}.univer-w-11\/12{width:91.666667%}.univer-w-52{width:208px}.univer-w-64{width:256px}.univer-w-full{width:100%}.univer-cursor-pointer{cursor:pointer}.univer-list-none{list-style-type:none}.univer-flex-col{flex-direction:column}.univer-items-start{align-items:flex-start}.univer-items-center{align-items:center}.univer-justify-center{justify-content:center}.univer-gap-1{gap:4px}.univer-gap-2{gap:8px}.univer-overflow-y-auto{overflow-y:auto}.univer-overflow-x-hidden{overflow-x:hidden}.univer-rounded{border-radius:4px}.univer-rounded-lg{border-radius:8px}.univer-rounded-md{border-radius:6px}.univer-bg-gray-100{background-color:var(--univer-gray-100)}.univer-bg-white{background-color:var(--univer-white)}.univer-fill-primary-600{fill:var(--univer-primary-600)}.univer-p-1{padding:4px}.univer-p-1\.5{padding:6px}.univer-p-2{padding:8px}.univer-p-4{padding:16px}.univer-px-2{padding-left:8px;padding-right:8px}.univer-px-4{padding-left:16px;padding-right:16px}.univer-py-1\.5{padding-top:6px;padding-bottom:6px}.univer-pt-4{padding-top:16px}.univer-text-left{text-align:left}.univer-text-center{text-align:center}.univer-align-middle{vertical-align:middle}.univer-text-sm{font-size:14px;line-height:20px}.univer-leading-8{line-height:32px}.univer-text-gray-600{color:var(--univer-gray-600)}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-primary-600{color:var(--univer-primary-600)}.univer-shadow-lg{--tw-shadow: 0px 4px 6px 0px rgba(30, 40, 77, .05), 0px 10px 15px -3px rgba(30, 40, 77, .1);--tw-shadow-colored: 0px 4px 6px 0px var(--tw-shadow-color), 0px 10px 15px -3px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px #1e284d0d,0 10px 15px -3px #1e284d1a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.univer-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:univer-border-primary-600:hover{border-color:var(--univer-primary-600)}.hover\:univer-bg-gray-100:hover{background-color:var(--univer-gray-100)}.\[\&\>div\]\:univer-border-primary-600>div{border-color:var(--univer-primary-600)}.\[\&\>span\]\:univer-text-primary-600>span{color:var(--univer-primary-600)}
1
+ .univer-absolute{position:absolute}.univer-relative{position:relative}.univer-bottom-0{bottom:0}.univer-z-10{z-index:10}.univer-m-0{margin:0}.univer-my-4{margin-top:16px;margin-bottom:16px}.univer-mt-2\.5{margin-top:10px}.univer-mt-5{margin-top:20px}.univer-box-border{box-sizing:border-box}.univer-block{display:block}.univer-flex{display:flex}.univer-grid{display:grid}.univer-h-32{height:128px}.univer-h-8{height:32px}.univer-h-full{height:100%}.univer-w-1\/2{width:50%}.univer-w-1\/3{width:33.333333%}.univer-w-11\/12{width:91.666667%}.univer-w-52{width:208px}.univer-w-64{width:256px}.univer-w-full{width:100%}.univer-cursor-pointer{cursor:pointer}.univer-list-none{list-style-type:none}.univer-flex-col{flex-direction:column}.univer-items-center{align-items:center}.univer-justify-center{justify-content:center}.univer-gap-1{gap:4px}.univer-gap-2{gap:8px}.univer-overflow-y-auto{overflow-y:auto}.univer-overflow-x-hidden{overflow-x:hidden}.univer-rounded{border-radius:4px}.univer-rounded-lg{border-radius:8px}.univer-rounded-md{border-radius:6px}.univer-bg-gray-100{background-color:var(--univer-gray-100)}.univer-bg-gray-800{background-color:var(--univer-gray-800)}.univer-bg-gray-900{background-color:var(--univer-gray-900)}.univer-bg-white{background-color:var(--univer-white)}.univer-fill-primary-600{fill:var(--univer-primary-600)}.univer-p-1{padding:4px}.univer-p-1\.5{padding:6px}.univer-p-2{padding:8px}.univer-p-4{padding:16px}.univer-px-2{padding-left:8px;padding-right:8px}.univer-px-4{padding-left:16px;padding-right:16px}.univer-py-1\.5{padding-top:6px;padding-bottom:6px}.univer-pt-4{padding-top:16px}.univer-text-left{text-align:left}.univer-text-center{text-align:center}.univer-align-middle{vertical-align:middle}.univer-text-sm{font-size:14px;line-height:20px}.univer-leading-8{line-height:32px}.univer-text-gray-600{color:var(--univer-gray-600)}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-primary-600{color:var(--univer-primary-600)}.univer-shadow-lg{--tw-shadow: 0px 4px 6px 0px rgba(30, 40, 77, .05), 0px 10px 15px -3px rgba(30, 40, 77, .1);--tw-shadow-colored: 0px 4px 6px 0px var(--tw-shadow-color), 0px 10px 15px -3px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px #1e284d0d,0 10px 15px -3px #1e284d1a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.univer-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:univer-border-primary-600:hover{border-color:var(--univer-primary-600)}.hover\:univer-bg-gray-100:hover{background-color:var(--univer-gray-100)}.dark\:univer-bg-gray-800:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-800)}.dark\:univer-bg-gray-900:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-900)}.dark\:univer-text-gray-200:where(.univer-dark,.univer-dark *){color:var(--univer-gray-200)}.dark\:univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)}.dark\:hover\:univer-bg-gray-800:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-800)}.\[\&\>div\]\:univer-border-primary-600>div{border-color:var(--univer-primary-600)}.\[\&\>span\]\:univer-text-primary-600>span{color:var(--univer-primary-600)}