@ws-ui/roles-editor 1.14.3 → 1.14.4-dev.1

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/dist/index.es.js CHANGED
@@ -33800,32 +33800,37 @@ const Dle = ({ item: e, depth: t }) => {
33800
33800
  }
33801
33801
  const y = async (_) => {
33802
33802
  _.stopPropagation();
33803
- const { confirmed: S } = await o.actions.openModal({
33804
- title: "Delete Privilege",
33805
- type: Ao.CONFIRM,
33806
- color: fl.DANGER,
33807
- message: "Are you sure you want to remove this Privilege?",
33808
- icon: "FdWarningDanger"
33809
- });
33810
- if (S) {
33811
- const O = oH(t.id, a);
33803
+ const S = () => {
33804
+ const R = oH(t.id, a);
33812
33805
  if ((r == null ? void 0 : r.id) !== t.id) {
33813
- o.actions.updatePrivileges(O);
33806
+ o.actions.updatePrivileges(R);
33814
33807
  return;
33815
33808
  }
33816
- const R = Object.keys(O).filter(
33817
- (N) => O[N].privilege !== "guest"
33809
+ const N = Object.keys(R).filter(
33810
+ (P) => R[P].privilege !== "guest"
33818
33811
  );
33819
- if (R.length === 0)
33812
+ if (N.length === 0)
33820
33813
  n(null);
33821
33814
  else {
33822
- const N = Object.keys(a).filter(
33823
- (H) => a[H].privilege !== "guest"
33824
- ), P = N.indexOf(t.id), z = Math.max(0, P - 1), D = N[z];
33825
- P === 0 ? n(O[R[0]]) : O[D] ? n(O[D]) : n(O[R[0]]);
33815
+ const P = Object.keys(a).filter(
33816
+ (W) => a[W].privilege !== "guest"
33817
+ ), z = P.indexOf(t.id), D = Math.max(0, z - 1), H = P[D];
33818
+ z === 0 ? n(R[N[0]]) : R[H] ? n(R[H]) : n(R[N[0]]);
33826
33819
  }
33827
- o.actions.updatePrivileges(O);
33820
+ o.actions.updatePrivileges(R);
33821
+ };
33822
+ if (o.getHost() === "vscode") {
33823
+ S();
33824
+ return;
33828
33825
  }
33826
+ const { confirmed: O } = await o.actions.openModal({
33827
+ title: "Delete Privilege",
33828
+ type: Ao.CONFIRM,
33829
+ color: fl.DANGER,
33830
+ message: "Are you sure you want to remove this Privilege?",
33831
+ icon: "FdWarningDanger"
33832
+ });
33833
+ O && S();
33829
33834
  }, E = Re(() => t.resources.some((_) => _.exists === !1), [t]);
33830
33835
  return /* @__PURE__ */ I(
33831
33836
  Xr,
@@ -33851,7 +33856,7 @@ const Dle = ({ item: e, depth: t }) => {
33851
33856
  ref: w,
33852
33857
  children: [
33853
33858
  /* @__PURE__ */ ue("div", { className: "flex items-center justify-between", children: [
33854
- /* @__PURE__ */ ue("div", { className: "flex flex-1 items-center", children: [
33859
+ /* @__PURE__ */ ue("div", { className: "flex min-w-0 flex-1 items-center", children: [
33855
33860
  /* @__PURE__ */ I("span", { className: "mr-4", children: i ? /* @__PURE__ */ I(YH, { className: "h-6 w-6" }) : /* @__PURE__ */ I(Ad, { className: "h-6 w-6" }) }),
33856
33861
  c ? /* @__PURE__ */ ue(
33857
33862
  It.Root,
@@ -33874,7 +33879,14 @@ const Dle = ({ item: e, depth: t }) => {
33874
33879
  p && /* @__PURE__ */ I(It.Message, { children: p })
33875
33880
  ]
33876
33881
  }
33877
- ) : /* @__PURE__ */ I("span", { className: "inline-block grow overflow-hidden truncate whitespace-nowrap text-xs font-bold", children: u })
33882
+ ) : /* @__PURE__ */ I(
33883
+ "span",
33884
+ {
33885
+ title: u,
33886
+ className: "inline-block grow overflow-hidden truncate whitespace-nowrap text-xs font-bold",
33887
+ children: u
33888
+ }
33889
+ )
33878
33890
  ] }),
33879
33891
  i ? /* @__PURE__ */ I("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ I(
33880
33892
  Xr,
@@ -33884,7 +33896,7 @@ const Dle = ({ item: e, depth: t }) => {
33884
33896
  usePortal: !0,
33885
33897
  children: /* @__PURE__ */ I(mn, { className: "h-4 w-4" })
33886
33898
  }
33887
- ) }) : /* @__PURE__ */ I("div", { className: "flex items-center gap-x-2", children: c ? /* @__PURE__ */ ue(Ht, { children: [
33899
+ ) }) : /* @__PURE__ */ I("div", { className: "flex shrink-0 items-center gap-x-2", children: c ? /* @__PURE__ */ ue(Ht, { children: [
33888
33900
  /* @__PURE__ */ I(
33889
33901
  ar,
33890
33902
  {
@@ -38522,7 +38534,7 @@ const Lue = ({
38522
38534
  /* @__PURE__ */ I("div", { children: /* @__PURE__ */ I(
38523
38535
  Xr,
38524
38536
  {
38525
- label: `Resetting the privilege will remove all configured
38537
+ label: `Resetting the privilege will remove all configured\r
38526
38538
  ressources`,
38527
38539
  container: Zr(),
38528
38540
  children: /* @__PURE__ */ I(
@@ -39024,7 +39036,7 @@ const Lue = ({
39024
39036
  },
39025
39037
  ref: g,
39026
39038
  children: [
39027
- /* @__PURE__ */ I("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ ue("div", { className: "flex flex-1 items-center", children: [
39039
+ /* @__PURE__ */ I("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ ue("div", { className: "flex min-w-0 flex-1 items-center", children: [
39028
39040
  /* @__PURE__ */ I("span", { className: "mr-4", children: /* @__PURE__ */ I(Ad, { className: "h-6 w-6" }) }),
39029
39041
  v ? /* @__PURE__ */ ue(
39030
39042
  It.Root,
@@ -39063,7 +39075,7 @@ const Lue = ({
39063
39075
  "div",
39064
39076
  {
39065
39077
  className: bn(
39066
- "justify-between ml-auto flex w-fit items-center gap-x-2"
39078
+ "justify-between ml-auto flex w-fit shrink-0 items-center gap-x-2"
39067
39079
  ),
39068
39080
  children: v ? /* @__PURE__ */ ue(Ht, { children: [
39069
39081
  /* @__PURE__ */ I(ar, { color: "white", variant: "ghost", onClick: x, children: /* @__PURE__ */ I(JH, { className: "h-4 w-4" }) }),
@@ -40259,9 +40271,10 @@ const Kue = ({ selectedRole: e }) => {
40259
40271
  onSelectRole: a,
40260
40272
  selectedPrivilege: s,
40261
40273
  onSelectPrivilege: c,
40262
- ...d
40274
+ host: d = "vscode",
40275
+ ...u
40263
40276
  }) => {
40264
- const u = Re(
40277
+ const h = Re(
40265
40278
  () => ({
40266
40279
  ...Mo(G7(e)),
40267
40280
  flags: { touched: !1 }
@@ -40271,8 +40284,9 @@ const Kue = ({ selectedRole: e }) => {
40271
40284
  return /* @__PURE__ */ I(
40272
40285
  QZ,
40273
40286
  {
40274
- initialState: u,
40287
+ initialState: h,
40275
40288
  catalog: t,
40289
+ host: d,
40276
40290
  history: r,
40277
40291
  selectedTab: n,
40278
40292
  onTabChange: i,
@@ -40280,7 +40294,7 @@ const Kue = ({ selectedRole: e }) => {
40280
40294
  onSelectRole: a,
40281
40295
  selectedPrivilege: s,
40282
40296
  onSelectPrivilege: c,
40283
- children: /* @__PURE__ */ I(ide, { initialValue: e, ...d })
40297
+ children: /* @__PURE__ */ I(ide, { initialValue: e, ...u })
40284
40298
  }
40285
40299
  );
40286
40300
  };