@plasmicpkgs/antd5 0.0.109 → 0.0.111

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.js CHANGED
@@ -489,7 +489,7 @@ function themeToAntdConfig(opts) {
489
489
  };
490
490
  }
491
491
  function AntdConfigProvider(props) {
492
- const _a = props, { children, themeStyles } = _a, rest = __objRest$b(_a, ["children", "themeStyles"]);
492
+ const _a = props, { children, themeStyles, loadingText, removeLoading } = _a, rest = __objRest$b(_a, ["children", "themeStyles", "loadingText", "removeLoading"]);
493
493
  return /* @__PURE__ */ React__default.default.createElement(
494
494
  antd.ConfigProvider,
495
495
  __spreadValues$i({
@@ -500,7 +500,14 @@ function AntdConfigProvider(props) {
500
500
  lineHeight: themeStyles.lineHeight ? parseInt(themeStyles.lineHeight) : void 0,
501
501
  colorTextBase: themeStyles.color
502
502
  }))),
503
- /* @__PURE__ */ React__default.default.createElement(ForkedApp, null, /* @__PURE__ */ React__default.default.createElement(InnerConfigProvider, null, children))
503
+ /* @__PURE__ */ React__default.default.createElement(ForkedApp, null, /* @__PURE__ */ React__default.default.createElement(
504
+ InnerConfigProvider,
505
+ {
506
+ loadingText,
507
+ removeLoading
508
+ },
509
+ children
510
+ ))
504
511
  );
505
512
  }
506
513
  function normTokenValue(val) {
@@ -513,7 +520,7 @@ function normTokenValue(val) {
513
520
  }
514
521
  }
515
522
  function InnerConfigProvider(props) {
516
- const { children } = props;
523
+ const { children, loadingText, removeLoading } = props;
517
524
  const { token } = antd.theme.useToken();
518
525
  const makeVarName = (name) => `--antd-${name}`;
519
526
  const cssStyles = React__default.default.useMemo(
@@ -548,7 +555,7 @@ function InnerConfigProvider(props) {
548
555
  actions
549
556
  },
550
557
  children
551
- ) : children, /* @__PURE__ */ React__default.default.createElement(GlobalLoadingIndicator, null));
558
+ ) : children, !removeLoading && /* @__PURE__ */ React__default.default.createElement(GlobalLoadingIndicator, { loadingText }));
552
559
  }
553
560
  let warned = false;
554
561
  function warnOutdatedDeps() {
@@ -559,7 +566,8 @@ function warnOutdatedDeps() {
559
566
  warned = true;
560
567
  }
561
568
  }
562
- function GlobalLoadingIndicator() {
569
+ function GlobalLoadingIndicator(props) {
570
+ const { loadingText } = props;
563
571
  const app = useAppContext();
564
572
  React__default.default.useEffect(() => {
565
573
  if (query.addLoadingStateListener) {
@@ -567,7 +575,7 @@ function GlobalLoadingIndicator() {
567
575
  (isLoading) => {
568
576
  if (isLoading) {
569
577
  app.message.open({
570
- content: "Loading...",
578
+ content: loadingText != null ? loadingText : "Loading...",
571
579
  duration: 0,
572
580
  key: `plasmic-antd5-global-loading-indicator`
573
581
  });
@@ -575,7 +583,7 @@ function GlobalLoadingIndicator() {
575
583
  app.message.destroy(`plasmic-antd5-global-loading-indicator`);
576
584
  }
577
585
  },
578
- // Diabled immediat because it's creating an infinite rendering
586
+ // Disabled immediat because it's creating an infinite rendering
579
587
  // https://app.shortcut.com/plasmic/story/36991
580
588
  { immediate: false }
581
589
  );
@@ -835,27 +843,33 @@ const registerConfigProvider = makeRegisterGlobalContext(
835
843
  props: {
836
844
  colorPrimary: {
837
845
  type: "color",
838
- defaultValue: "#1677ff"
846
+ defaultValue: "#1677ff",
847
+ disableTokens: true
839
848
  },
840
849
  colorSuccess: {
841
850
  type: "color",
842
- defaultValue: "#52c41a"
851
+ defaultValue: "#52c41a",
852
+ disableTokens: true
843
853
  },
844
854
  colorWarning: {
845
855
  type: "color",
846
- defaultValue: "#faad14"
856
+ defaultValue: "#faad14",
857
+ disableTokens: true
847
858
  },
848
859
  colorError: {
849
860
  type: "color",
850
- defaultValue: "#ff4d4f"
861
+ defaultValue: "#ff4d4f",
862
+ disableTokens: true
851
863
  },
852
864
  colorInfo: {
853
865
  type: "color",
854
- defaultValue: "#1677ff"
866
+ defaultValue: "#1677ff",
867
+ disableTokens: true
855
868
  },
856
869
  colorBgBase: {
857
870
  type: "color",
858
- defaultValue: "#ffffff"
871
+ defaultValue: "#ffffff",
872
+ disableTokens: true
859
873
  },
860
874
  lineWidth: {
861
875
  type: "number",
@@ -877,6 +891,14 @@ const registerConfigProvider = makeRegisterGlobalContext(
877
891
  type: "number",
878
892
  defaultValue: 4
879
893
  },
894
+ loadingText: {
895
+ type: "string",
896
+ defaultValueHint: "Loading..."
897
+ },
898
+ removeLoading: {
899
+ type: "boolean",
900
+ defaultValueHint: false
901
+ },
880
902
  wireframe: {
881
903
  type: "boolean",
882
904
  defaultValue: false