@nocobase/client 1.6.5 → 1.6.7

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.
@@ -24,6 +24,7 @@ export declare class TextareaFieldInterface extends CollectionFieldInterface {
24
24
  };
25
25
  availableTypes: string[];
26
26
  hasDefaultValue: boolean;
27
+ titleUsable: boolean;
27
28
  properties: {
28
29
  'uiSchema.title': {
29
30
  type: string;
package/es/index.mjs CHANGED
@@ -3777,6 +3777,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3777
3777
  get useIsInSettingsPage() {
3778
3778
  return useIsInSettingsPage;
3779
3779
  },
3780
+ get useIsLoggedIn() {
3781
+ return useIsLoggedIn;
3782
+ },
3780
3783
  get useIsSelectFieldMode() {
3781
3784
  return useIsSelectFieldMode;
3782
3785
  },
@@ -9158,7 +9161,7 @@ function addAppVersion(e, t) {
9158
9161
  addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
9159
9162
  }), e;
9160
9163
  }
9161
- const name = "@nocobase/client", version = "1.6.5", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9164
+ const name = "@nocobase/client", version = "1.6.7", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9162
9165
  "@ahooksjs/use-url-state": "3.5.1",
9163
9166
  "@ant-design/cssinjs": "^1.11.1",
9164
9167
  "@ant-design/icons": "^5.6.1",
@@ -9180,9 +9183,9 @@ const name = "@nocobase/client", version = "1.6.5", license = "AGPL-3.0", main =
9180
9183
  "@formily/reactive-react": "^2.2.27",
9181
9184
  "@formily/shared": "^2.2.27",
9182
9185
  "@formily/validator": "^2.2.27",
9183
- "@nocobase/evaluators": "1.6.5",
9184
- "@nocobase/sdk": "1.6.5",
9185
- "@nocobase/utils": "1.6.5",
9186
+ "@nocobase/evaluators": "1.6.7",
9187
+ "@nocobase/sdk": "1.6.7",
9188
+ "@nocobase/utils": "1.6.7",
9186
9189
  ahooks: "^3.7.2",
9187
9190
  antd: "5.12.8",
9188
9191
  "antd-style": "3.7.1",
@@ -24329,9 +24332,7 @@ function useFormItemCollectionField() {
24329
24332
  }
24330
24333
  function useIsAssociationField() {
24331
24334
  const e = useFormItemCollectionField();
24332
- return ["obo", "oho", "o2o", "o2m", "m2m", "m2o", "updatedBy", "createdBy", "mbm"].includes(
24333
- e == null ? void 0 : e.interface
24334
- );
24335
+ return e && ["hasOne", "hasMany", "belongsTo", "belongsToMany", "belongsToArray"].includes(e.type);
24335
24336
  }
24336
24337
  function useIsFileField() {
24337
24338
  const e = useCollectionManager(), t = useFormItemCollectionField(), n = e.getCollection(t == null ? void 0 : t.target);
@@ -24378,7 +24379,11 @@ const SettingsMenuProvider = (e) => SelectWithTitle, DropdownVisibleContext = cr
24378
24379
  DropdownVisibleContext.displayName = "DropdownVisibleContext";
24379
24380
  const CurrentUserContext = createContext(null);
24380
24381
  CurrentUserContext.displayName = "CurrentUserContext";
24381
- const useCurrentUserContext = () => useContext(CurrentUserContext), useCurrentRoles = () => {
24382
+ const useCurrentUserContext = () => useContext(CurrentUserContext), useIsLoggedIn = () => {
24383
+ var t;
24384
+ const e = useContext(CurrentUserContext);
24385
+ return !!((t = e == null ? void 0 : e.data) != null && t.data);
24386
+ }, useCurrentRoles = () => {
24382
24387
  var r;
24383
24388
  const { allowAnonymous: e } = useACLRoleContext(), { data: t } = useCurrentUserContext(), n = useCompile();
24384
24389
  return useMemo(() => {
@@ -24395,7 +24400,10 @@ const useCurrentUserContext = () => useContext(CurrentUserContext), useCurrentRo
24395
24400
  url: "/auth:check",
24396
24401
  skipNotify: !0,
24397
24402
  skipAuth: !0
24398
- }).then((r) => r == null ? void 0 : r.data)
24403
+ }).then((r) => r == null ? void 0 : r.data),
24404
+ {
24405
+ manual: !t.auth.token
24406
+ }
24399
24407
  ), { render: o } = useAppSpin();
24400
24408
  return n.loading ? o() : /* @__PURE__ */ jsx(CurrentUserContext.Provider, { value: n, children: e.children });
24401
24409
  }, CurrentUserSettingsMenuContext = createContext(null);
@@ -55387,9 +55395,9 @@ const ReadPretty$1 = (e) => {
55387
55395
  return P(x({}, e), {
55388
55396
  format: n,
55389
55397
  inputReadOnly: !0,
55390
- value: dayjsable(e.value, n),
55398
+ value: dayjsable(e.value, "HH:mm:ss"),
55391
55399
  onChange: (r) => {
55392
- o && o(formatDayjsValue(r, n) || null);
55400
+ o && o(formatDayjsValue(r, "HH:mm:ss") || null);
55393
55401
  }
55394
55402
  });
55395
55403
  };
@@ -61725,6 +61733,7 @@ class TextareaFieldInterface extends CollectionFieldInterface {
61725
61733
  });
61726
61734
  A(this, "availableTypes", ["text", "json", "string"]);
61727
61735
  A(this, "hasDefaultValue", !0);
61736
+ A(this, "titleUsable", !0);
61728
61737
  A(this, "properties", x({}, defaultProps));
61729
61738
  A(this, "validateSchema", (n) => ({
61730
61739
  max: {
@@ -62924,6 +62933,7 @@ const ACLProvider = (e) => /* @__PURE__ */ jsx(
62924
62933
  url: "roles:check"
62925
62934
  },
62926
62935
  {
62936
+ manual: !o.auth.token,
62927
62937
  onSuccess(a) {
62928
62938
  var l, c, u, d;
62929
62939
  (l = a == null ? void 0 : a.data) != null && l.snippets.includes("ui.*") || t(!1), ((c = a == null ? void 0 : a.data) == null ? void 0 : c.role) !== o.auth.role && o.auth.setRole((u = a == null ? void 0 : a.data) == null ? void 0 : u.role), r.pluginSettingsManager.setAclSnippets(((d = a == null ? void 0 : a.data) == null ? void 0 : d.snippets) || []);
@@ -65485,6 +65495,7 @@ export {
65485
65495
  useIsFileField,
65486
65496
  useIsFormReadPretty,
65487
65497
  useIsInSettingsPage,
65498
+ useIsLoggedIn,
65488
65499
  useIsSelectFieldMode,
65489
65500
  useIsSubPageClosedByPageMenu,
65490
65501
  useLabelUiSchema,
@@ -9,5 +9,6 @@
9
9
  import React from 'react';
10
10
  export declare const CurrentUserContext: React.Context<import("../api-client").UseRequestResult<any>>;
11
11
  export declare const useCurrentUserContext: () => import("../api-client").UseRequestResult<any>;
12
+ export declare const useIsLoggedIn: () => boolean;
12
13
  export declare const useCurrentRoles: () => any;
13
14
  export declare const CurrentUserProvider: (props: any) => React.JSX.Element;