@ws-ui/roles-editor 1.14.4 → 1.14.5

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,
@@ -40266,9 +40271,10 @@ const Kue = ({ selectedRole: e }) => {
40266
40271
  onSelectRole: a,
40267
40272
  selectedPrivilege: s,
40268
40273
  onSelectPrivilege: c,
40269
- ...d
40274
+ host: d = "vscode",
40275
+ ...u
40270
40276
  }) => {
40271
- const u = Re(
40277
+ const h = Re(
40272
40278
  () => ({
40273
40279
  ...Mo(G7(e)),
40274
40280
  flags: { touched: !1 }
@@ -40278,8 +40284,9 @@ const Kue = ({ selectedRole: e }) => {
40278
40284
  return /* @__PURE__ */ I(
40279
40285
  QZ,
40280
40286
  {
40281
- initialState: u,
40287
+ initialState: h,
40282
40288
  catalog: t,
40289
+ host: d,
40283
40290
  history: r,
40284
40291
  selectedTab: n,
40285
40292
  onTabChange: i,
@@ -40287,7 +40294,7 @@ const Kue = ({ selectedRole: e }) => {
40287
40294
  onSelectRole: a,
40288
40295
  selectedPrivilege: s,
40289
40296
  onSelectPrivilege: c,
40290
- children: /* @__PURE__ */ I(ide, { initialValue: e, ...d })
40297
+ children: /* @__PURE__ */ I(ide, { initialValue: e, ...u })
40291
40298
  }
40292
40299
  );
40293
40300
  };