@nocobase/client 0.13.0-alpha.7 → 0.13.0-alpha.9

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/es/index.mjs CHANGED
@@ -80,7 +80,7 @@ import * as ReactRouterDom from "react-router-dom";
80
80
  import { useNavigate, useParams, UNSAFE_RouteContext, UNSAFE_LocationContext, useRoutes, HashRouter, BrowserRouter, MemoryRouter, Link as Link$1, Navigate, NavLink, useSearchParams, useLocation, Outlet, useMatch } from "react-router-dom";
81
81
  import { APIClient as APIClient$1, getSubAppName } from "@nocobase/sdk";
82
82
  import * as antd from "antd";
83
- import { notification, Spin, Select as Select$1, message, ConfigProvider, theme, Popover as Popover$1, Space as Space$1, Checkbox as Checkbox$1, Dropdown, Button, App, Input as Input$4, Divider, DatePicker as DatePicker$1, Tooltip as Tooltip$1, Cascader as Cascader$1, InputNumber as InputNumber$1, Tag, Typography, Switch, Card as Card$1, Empty, Collapse, Badge, Tree as Tree$2, Radio as Radio$1, Modal, Alert, Drawer as Drawer$1, Progress, Upload as Upload$1, Row, Col, TreeSelect as TreeSelect$2, Table as Table$2, AutoComplete as AutoComplete$1, ColorPicker as ColorPicker$1, Slider, List as List$1, Result as Result$1, Tabs as Tabs$1, Menu as Menu$1, Pagination as Pagination$1, TimePicker as TimePicker$1, Popconfirm, Avatar, Layout } from "antd";
83
+ import { notification, Spin, Select as Select$1, message, ConfigProvider, theme, Space as Space$1, Checkbox as Checkbox$1, Dropdown, Button, App, Input as Input$4, Divider, DatePicker as DatePicker$1, Tooltip as Tooltip$1, Popover, Cascader as Cascader$1, InputNumber as InputNumber$1, Tag, Typography, Switch, Card as Card$1, Empty, Collapse, Badge, Tree as Tree$2, Radio as Radio$1, Modal, Alert, Drawer as Drawer$1, Progress, Upload as Upload$1, Row, Col, TreeSelect as TreeSelect$2, Table as Table$2, AutoComplete as AutoComplete$1, ColorPicker as ColorPicker$1, Slider, List as List$1, Result as Result$1, Tabs as Tabs$1, Menu as Menu$1, Pagination as Pagination$1, TimePicker as TimePicker$1, Popconfirm, Avatar, Layout } from "antd";
84
84
  import * as formilyShared from "@formily/shared";
85
85
  import { merge, uid, clone, isArr, toArr as toArr$3, isValid, isPlainObj, each, isFn, applyMiddleware, isNum as isNum$1, isStr, isBool } from "@formily/shared";
86
86
  import * as ahooks from "ahooks";
@@ -906,8 +906,8 @@ const nocobaseClient = /* @__PURE__ */ _mergeNamespaces({
906
906
  get PluginManagerLink() {
907
907
  return PluginManagerLink;
908
908
  },
909
- get Popover() {
910
- return Popover;
909
+ get PopoverWithStopPropagation() {
910
+ return PopoverWithStopPropagation;
911
911
  },
912
912
  get PoweredBy() {
913
913
  return PoweredBy;
@@ -2046,7 +2046,7 @@ class APIClient extends APIClient$1 {
2046
2046
  }
2047
2047
  if (this.app.maintaining) {
2048
2048
  this.app.error = (_i = (_h = error2 == null ? void 0 : error2.response) == null ? void 0 : _h.data) == null ? void 0 : _i.error;
2049
- return;
2049
+ throw error2;
2050
2050
  } else if (this.app.error) {
2051
2051
  this.app.error = null;
2052
2052
  }
@@ -4011,12 +4011,6 @@ const common = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
4011
4011
  SortableItem,
4012
4012
  SortableProvider
4013
4013
  }, Symbol.toStringTag, { value: "Module" }));
4014
- const Popover = (props) => {
4015
- const avoidClose = useCallback((e) => {
4016
- e.stopPropagation();
4017
- }, []);
4018
- return /* @__PURE__ */ jsx("div", { onClick: avoidClose, children: /* @__PURE__ */ jsx(Popover$1, __spreadValues({}, props)) });
4019
- };
4020
4014
  const useStyles$o = genStyleHook("nb-action-drawer", (token) => {
4021
4015
  const { componentCls } = token;
4022
4016
  return {
@@ -10400,6 +10394,12 @@ class SchemaComponentPlugin extends Plugin {
10400
10394
  });
10401
10395
  }
10402
10396
  }
10397
+ const PopoverWithStopPropagation = (props) => {
10398
+ const avoidClose = useCallback((e) => {
10399
+ e.stopPropagation();
10400
+ }, []);
10401
+ return /* @__PURE__ */ jsx("div", { onClick: avoidClose, children: /* @__PURE__ */ jsx(Popover, __spreadValues({}, props)) });
10402
+ };
10403
10403
  const FilterActionContext = createContext(null);
10404
10404
  const FilterAction = observer(
10405
10405
  (props) => {
@@ -10414,7 +10414,7 @@ const FilterAction = observer(
10414
10414
  setVisible(visible2);
10415
10415
  }, []);
10416
10416
  return /* @__PURE__ */ jsx(FilterActionContext.Provider, { value: { field, fieldSchema, designable, dn }, children: /* @__PURE__ */ jsx(
10417
- Popover,
10417
+ PopoverWithStopPropagation,
10418
10418
  {
10419
10419
  destroyTooltipOnHide: true,
10420
10420
  placement: "bottomLeft",
@@ -27914,7 +27914,8 @@ const defaultTheme = {
27914
27914
  // UI 配置组件
27915
27915
  colorSettings: "#F18B62",
27916
27916
  colorBgSettingsHover: "rgba(241, 139, 98, 0.06)",
27917
- colorBorderSettingsHover: "rgba(241, 139, 98, 0.3)"
27917
+ colorBorderSettingsHover: "rgba(241, 139, 98, 0.3)",
27918
+ motionUnit: 0.03
27918
27919
  }
27919
27920
  };
27920
27921
  function compatOldTheme(theme2) {
@@ -28121,9 +28122,6 @@ function useAppPluginLoad(app) {
28121
28122
  const [loading2, setLoading] = useState(true);
28122
28123
  const [error2, setError] = useState(null);
28123
28124
  useEffect(() => {
28124
- app.ws.on("message", (event) => {
28125
- console.log(event.data);
28126
- });
28127
28125
  function run() {
28128
28126
  return __async(this, null, function* () {
28129
28127
  try {
@@ -29840,6 +29838,7 @@ class Application {
29840
29838
  }
29841
29839
  load() {
29842
29840
  return __async(this, null, function* () {
29841
+ let loadFailed = false;
29843
29842
  this.ws.on("message", (event) => {
29844
29843
  var _a, _b, _c;
29845
29844
  const data = JSON.parse(event.data);
@@ -29857,6 +29856,10 @@ class Application {
29857
29856
  this.maintaining = true;
29858
29857
  this.error = data.payload;
29859
29858
  } else {
29859
+ console.log("loadFailed", loadFailed);
29860
+ if (loadFailed) {
29861
+ window.location.reload();
29862
+ }
29860
29863
  this.maintaining = false;
29861
29864
  this.maintained = true;
29862
29865
  this.error = null;
@@ -29870,6 +29873,7 @@ class Application {
29870
29873
  this.loading = true;
29871
29874
  yield this.pm.load();
29872
29875
  } catch (error2) {
29876
+ loadFailed = true;
29873
29877
  this.error = {
29874
29878
  code: "LOAD_ERROR",
29875
29879
  message: error2.message
@@ -32899,7 +32903,7 @@ const InternaPopoverNester = observer(
32899
32903
  };
32900
32904
  return /* @__PURE__ */ jsxs(ActionContextProvider, { value: __spreadProps(__spreadValues({}, ctx), { modalProps }), children: [
32901
32905
  /* @__PURE__ */ jsx(
32902
- Popover,
32906
+ PopoverWithStopPropagation,
32903
32907
  {
32904
32908
  overlayStyle: { padding: "0px" },
32905
32909
  content,
@@ -41275,7 +41279,7 @@ function IconField(props) {
41275
41279
  const { t } = useTranslation();
41276
41280
  return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(Input$4.Group, { compact: true, children: [
41277
41281
  /* @__PURE__ */ jsx(
41278
- Popover,
41282
+ PopoverWithStopPropagation,
41279
41283
  {
41280
41284
  placement: "bottom",
41281
41285
  open: visible,
@@ -44573,7 +44577,7 @@ const Editable = observer((props) => {
44573
44577
  return child;
44574
44578
  });
44575
44579
  return /* @__PURE__ */ jsx(FormItem$1, __spreadProps(__spreadValues({}, props), { labelStyle: { display: "none" }, children: /* @__PURE__ */ jsx(
44576
- Popover,
44580
+ PopoverWithStopPropagation,
44577
44581
  {
44578
44582
  content: /* @__PURE__ */ jsx("div", { style: { width: "100%", height: "100%", minWidth: 500 }, children: /* @__PURE__ */ jsx("div", { ref: containerRef, children: modifiedChildren }) }),
44579
44583
  trigger: "click",
@@ -47439,7 +47443,7 @@ const components$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.define
47439
47443
  Pagination,
47440
47444
  Password,
47441
47445
  Percent,
47442
- Popover,
47446
+ PopoverWithStopPropagation,
47443
47447
  Preview,
47444
47448
  QuickEdit,
47445
47449
  Radio,
@@ -61647,6 +61651,7 @@ const getProps = (app) => {
61647
61651
  };
61648
61652
  return __spreadValues(__spreadValues({}, props), commands[(_k = (_j = app.error) == null ? void 0 : _j.command) == null ? void 0 : _k.name]);
61649
61653
  }
61654
+ return {};
61650
61655
  };
61651
61656
  const AppMaintaining = observer$1(({ app }) => {
61652
61657
  const { icon: icon2, status, title, subTitle } = getProps(app);
@@ -62002,7 +62007,7 @@ export {
62002
62007
  Plugin,
62003
62008
  PluginManagerContext,
62004
62009
  PluginManagerLink,
62005
- Popover,
62010
+ PopoverWithStopPropagation,
62006
62011
  PoweredBy,
62007
62012
  Preview,
62008
62013
  PrintActionInitializer,
@@ -1,3 +1,3 @@
1
1
  import { PopoverProps } from 'antd';
2
2
  import React from 'react';
3
- export declare const Popover: (props: PopoverProps) => React.JSX.Element;
3
+ export declare const PopoverWithStopPropagation: (props: PopoverProps) => React.JSX.Element;
package/lib/index.js CHANGED
@@ -929,8 +929,8 @@ const nocobaseClient = /* @__PURE__ */ _mergeNamespaces({
929
929
  get PluginManagerLink() {
930
930
  return PluginManagerLink;
931
931
  },
932
- get Popover() {
933
- return Popover;
932
+ get PopoverWithStopPropagation() {
933
+ return PopoverWithStopPropagation;
934
934
  },
935
935
  get PoweredBy() {
936
936
  return PoweredBy;
@@ -2069,7 +2069,7 @@ class APIClient extends sdk.APIClient {
2069
2069
  }
2070
2070
  if (this.app.maintaining) {
2071
2071
  this.app.error = (_i = (_h = error == null ? void 0 : error.response) == null ? void 0 : _h.data) == null ? void 0 : _i.error;
2072
- return;
2072
+ throw error;
2073
2073
  } else if (this.app.error) {
2074
2074
  this.app.error = null;
2075
2075
  }
@@ -4034,12 +4034,6 @@ const common = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
4034
4034
  SortableItem,
4035
4035
  SortableProvider
4036
4036
  }, Symbol.toStringTag, { value: "Module" }));
4037
- const Popover = (props) => {
4038
- const avoidClose = React.useCallback((e) => {
4039
- e.stopPropagation();
4040
- }, []);
4041
- return /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: avoidClose, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Popover, __spreadValues({}, props)) });
4042
- };
4043
4037
  const useStyles$o = genStyleHook("nb-action-drawer", (token) => {
4044
4038
  const { componentCls } = token;
4045
4039
  return {
@@ -10423,6 +10417,12 @@ class SchemaComponentPlugin extends Plugin {
10423
10417
  });
10424
10418
  }
10425
10419
  }
10420
+ const PopoverWithStopPropagation = (props) => {
10421
+ const avoidClose = React.useCallback((e) => {
10422
+ e.stopPropagation();
10423
+ }, []);
10424
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: avoidClose, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Popover, __spreadValues({}, props)) });
10425
+ };
10426
10426
  const FilterActionContext = React.createContext(null);
10427
10427
  const FilterAction = formilyReact.observer(
10428
10428
  (props) => {
@@ -10437,7 +10437,7 @@ const FilterAction = formilyReact.observer(
10437
10437
  setVisible(visible2);
10438
10438
  }, []);
10439
10439
  return /* @__PURE__ */ jsxRuntime.jsx(FilterActionContext.Provider, { value: { field, fieldSchema, designable, dn }, children: /* @__PURE__ */ jsxRuntime.jsx(
10440
- Popover,
10440
+ PopoverWithStopPropagation,
10441
10441
  {
10442
10442
  destroyTooltipOnHide: true,
10443
10443
  placement: "bottomLeft",
@@ -11992,7 +11992,7 @@ const EllipsisWithTooltip = React.forwardRef((props, ref) => {
11992
11992
  return contentWidth > offsetWidth;
11993
11993
  };
11994
11994
  return /* @__PURE__ */ jsxRuntime.jsx(
11995
- Popover,
11995
+ antd.Popover,
11996
11996
  {
11997
11997
  open: ellipsis && visible,
11998
11998
  onOpenChange: (visible2) => {
@@ -22407,7 +22407,7 @@ Action.Popover = formilyReact.observer(
22407
22407
  (props) => {
22408
22408
  const { button, visible, setVisible } = useActionContext();
22409
22409
  return /* @__PURE__ */ jsxRuntime.jsx(
22410
- Popover,
22410
+ antd.Popover,
22411
22411
  __spreadProps(__spreadValues({}, props), {
22412
22412
  destroyTooltipOnHide: true,
22413
22413
  open: visible,
@@ -27937,7 +27937,8 @@ const defaultTheme = {
27937
27937
  // UI 配置组件
27938
27938
  colorSettings: "#F18B62",
27939
27939
  colorBgSettingsHover: "rgba(241, 139, 98, 0.06)",
27940
- colorBorderSettingsHover: "rgba(241, 139, 98, 0.3)"
27940
+ colorBorderSettingsHover: "rgba(241, 139, 98, 0.3)",
27941
+ motionUnit: 0.03
27941
27942
  }
27942
27943
  };
27943
27944
  function compatOldTheme(theme) {
@@ -28144,9 +28145,6 @@ function useAppPluginLoad(app) {
28144
28145
  const [loading2, setLoading] = React.useState(true);
28145
28146
  const [error, setError] = React.useState(null);
28146
28147
  React.useEffect(() => {
28147
- app.ws.on("message", (event) => {
28148
- console.log(event.data);
28149
- });
28150
28148
  function run() {
28151
28149
  return __async(this, null, function* () {
28152
28150
  try {
@@ -29863,6 +29861,7 @@ class Application {
29863
29861
  }
29864
29862
  load() {
29865
29863
  return __async(this, null, function* () {
29864
+ let loadFailed = false;
29866
29865
  this.ws.on("message", (event) => {
29867
29866
  var _a, _b, _c;
29868
29867
  const data = JSON.parse(event.data);
@@ -29880,6 +29879,10 @@ class Application {
29880
29879
  this.maintaining = true;
29881
29880
  this.error = data.payload;
29882
29881
  } else {
29882
+ console.log("loadFailed", loadFailed);
29883
+ if (loadFailed) {
29884
+ window.location.reload();
29885
+ }
29883
29886
  this.maintaining = false;
29884
29887
  this.maintained = true;
29885
29888
  this.error = null;
@@ -29893,6 +29896,7 @@ class Application {
29893
29896
  this.loading = true;
29894
29897
  yield this.pm.load();
29895
29898
  } catch (error) {
29899
+ loadFailed = true;
29896
29900
  this.error = {
29897
29901
  code: "LOAD_ERROR",
29898
29902
  message: error.message
@@ -32922,7 +32926,7 @@ const InternaPopoverNester = formilyReact.observer(
32922
32926
  };
32923
32927
  return /* @__PURE__ */ jsxRuntime.jsxs(ActionContextProvider, { value: __spreadProps(__spreadValues({}, ctx), { modalProps }), children: [
32924
32928
  /* @__PURE__ */ jsxRuntime.jsx(
32925
- Popover,
32929
+ PopoverWithStopPropagation,
32926
32930
  {
32927
32931
  overlayStyle: { padding: "0px" },
32928
32932
  content,
@@ -41298,7 +41302,7 @@ function IconField(props) {
41298
41302
  const { t } = reactI18next.useTranslation();
41299
41303
  return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Input.Group, { compact: true, children: [
41300
41304
  /* @__PURE__ */ jsxRuntime.jsx(
41301
- Popover,
41305
+ PopoverWithStopPropagation,
41302
41306
  {
41303
41307
  placement: "bottom",
41304
41308
  open: visible,
@@ -44596,7 +44600,7 @@ const Editable = formilyReact.observer((props) => {
44596
44600
  return child;
44597
44601
  });
44598
44602
  return /* @__PURE__ */ jsxRuntime.jsx(formilyAntdV5.FormItem, __spreadProps(__spreadValues({}, props), { labelStyle: { display: "none" }, children: /* @__PURE__ */ jsxRuntime.jsx(
44599
- Popover,
44603
+ PopoverWithStopPropagation,
44600
44604
  {
44601
44605
  content: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "100%", height: "100%", minWidth: 500 }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, children: modifiedChildren }) }),
44602
44606
  trigger: "click",
@@ -47462,7 +47466,7 @@ const components$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.define
47462
47466
  Pagination,
47463
47467
  Password,
47464
47468
  Percent,
47465
- Popover,
47469
+ PopoverWithStopPropagation,
47466
47470
  Preview,
47467
47471
  QuickEdit,
47468
47472
  Radio,
@@ -61670,6 +61674,7 @@ const getProps = (app) => {
61670
61674
  };
61671
61675
  return __spreadValues(__spreadValues({}, props), commands[(_k = (_j = app.error) == null ? void 0 : _j.command) == null ? void 0 : _k.name]);
61672
61676
  }
61677
+ return {};
61673
61678
  };
61674
61679
  const AppMaintaining = formilyReactiveReact.observer(({ app }) => {
61675
61680
  const { icon: icon2, status, title, subTitle } = getProps(app);
@@ -62028,7 +62033,7 @@ exports.PinnedPluginListProvider = PinnedPluginListProvider;
62028
62033
  exports.Plugin = Plugin;
62029
62034
  exports.PluginManagerContext = PluginManagerContext;
62030
62035
  exports.PluginManagerLink = PluginManagerLink;
62031
- exports.Popover = Popover;
62036
+ exports.PopoverWithStopPropagation = PopoverWithStopPropagation;
62032
62037
  exports.PoweredBy = PoweredBy;
62033
62038
  exports.Preview = Preview;
62034
62039
  exports.PrintActionInitializer = PrintActionInitializer;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@nocobase/client",
3
- "version": "0.13.0-alpha.7",
3
+ "version": "0.13.0-alpha.9",
4
4
  "license": "Apache-2.0",
5
- "main": "lib",
6
- "module": "es/index.js",
5
+ "main": "lib/index.js",
6
+ "module": "es/index.mjs",
7
7
  "types": "es/index.d.ts",
8
8
  "dependencies": {
9
9
  "@ant-design/cssinjs": "^1.11.1",
@@ -25,9 +25,9 @@
25
25
  "@formily/reactive-react": "^2.2.27",
26
26
  "@formily/shared": "^2.2.27",
27
27
  "@formily/validator": "^2.2.27",
28
- "@nocobase/evaluators": "0.13.0-alpha.7",
29
- "@nocobase/sdk": "0.13.0-alpha.7",
30
- "@nocobase/utils": "0.13.0-alpha.7",
28
+ "@nocobase/evaluators": "0.13.0-alpha.9",
29
+ "@nocobase/sdk": "0.13.0-alpha.9",
30
+ "@nocobase/utils": "0.13.0-alpha.9",
31
31
  "@types/requirejs": "^2.1.34",
32
32
  "ahooks": "^3.7.2",
33
33
  "antd": "5.8.6",
@@ -76,5 +76,5 @@
76
76
  "dumi": "^2.2.0",
77
77
  "dumi-theme-nocobase": "^0.2.14"
78
78
  },
79
- "gitHead": "5cd58b0b56718e525d4deca7e25e5e5172022212"
79
+ "gitHead": "ee5825377d8bec05f968a8365a0cdcd49878ada6"
80
80
  }