react-vant-nova 1.0.7-test → 1.0.8

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.
@@ -2,8 +2,8 @@ import React, { useRef, useEffect, useState, useMemo, useCallback, useContext, c
2
2
  import clsx from "clsx";
3
3
  import { ArrowLeft, ArrowUp, ArrowDown, Arrow, Cross, Clear, QuestionO, PhotoFail, Photo, Checked, Success, Search as Search$1, Star, StarO, Close, Description, Photograph, ExpandO } from "@react-vant/icons";
4
4
  import { CSSTransition } from "react-transition-group";
5
- import * as ReactDOM from "react-dom";
6
- import { createPortal } from "react-dom";
5
+ import * as require$$0 from "react-dom";
6
+ import require$$0__default, { createPortal } from "react-dom";
7
7
  import { createUseGesture, dragAction, pinchAction, useDrag } from "@use-gesture/react";
8
8
  import { useSpring, animated } from "@react-spring/web";
9
9
  import { createPopper, offsetModifier } from "@vant/popperjs";
@@ -2042,19 +2042,16 @@ const Dialog$1 = (p) => {
2042
2042
  onClosed: props.onClosed
2043
2043
  }, renderTitle(), renderContent(), renderFooter());
2044
2044
  };
2045
+ var createRoot;
2046
+ var m = require$$0__default;
2047
+ {
2048
+ createRoot = m.createRoot;
2049
+ m.hydrateRoot;
2050
+ }
2045
2051
  const fullClone = {
2046
- ...ReactDOM
2052
+ ...require$$0
2047
2053
  };
2048
- const { unmountComponentAtNode } = fullClone;
2049
- let createRoot;
2050
- if (fullClone.createRoot) {
2051
- createRoot = fullClone.createRoot;
2052
- } else {
2053
- try {
2054
- createRoot = require("react-dom/client").createRoot;
2055
- } catch (e) {
2056
- }
2057
- }
2054
+ const { render: reactRender, unmountComponentAtNode } = fullClone;
2058
2055
  function toggleWarning(skip) {
2059
2056
  const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED } = fullClone;
2060
2057
  if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === "object") {
@@ -2063,12 +2060,8 @@ function toggleWarning(skip) {
2063
2060
  }
2064
2061
  const MARK = "__react_vant_root__";
2065
2062
  function legacyRender(node, container) {
2066
- if (fullClone.render) {
2067
- fullClone.render(node, container);
2068
- } else {
2069
- if (createRoot) {
2070
- concurrentRender(node, container);
2071
- }
2063
+ if (reactRender) {
2064
+ reactRender(node, container);
2072
2065
  }
2073
2066
  }
2074
2067
  function concurrentRender(node, container) {
@@ -2086,7 +2079,7 @@ function render(node, container) {
2086
2079
  legacyRender(node, container);
2087
2080
  }
2088
2081
  function legacyUnmount(container) {
2089
- return unmountComponentAtNode(container);
2082
+ return unmountComponentAtNode ? unmountComponentAtNode(container) : false;
2090
2083
  }
2091
2084
  async function concurrentUnmount(container) {
2092
2085
  return Promise.resolve().then(() => {
@@ -2096,7 +2089,7 @@ async function concurrentUnmount(container) {
2096
2089
  });
2097
2090
  }
2098
2091
  function unmount(container) {
2099
- if (createRoot) {
2092
+ if (createRoot || container[MARK]) {
2100
2093
  return concurrentUnmount(container);
2101
2094
  }
2102
2095
  return legacyUnmount(container);
@@ -5634,15 +5627,13 @@ const Toast$1 = (p) => {
5634
5627
  return null;
5635
5628
  };
5636
5629
  const renderMessage = () => {
5637
- setTimeout(() => {
5638
- const { message } = props;
5639
- if (isDef(message) && message !== "") {
5640
- return /* @__PURE__ */ React.createElement("div", {
5641
- className: clsx(bem$10("info"))
5642
- }, message);
5643
- }
5644
- return null;
5645
- }, 100);
5630
+ const { message } = props;
5631
+ if (isDef(message) && message !== "") {
5632
+ return /* @__PURE__ */ React.createElement("div", {
5633
+ className: clsx(bem$10("info"))
5634
+ }, message);
5635
+ }
5636
+ return null;
5646
5637
  };
5647
5638
  return /* @__PURE__ */ React.createElement(Popup, {
5648
5639
  className: clsx([
@@ -2823,19 +2823,16 @@
2823
2823
  onClosed: props.onClosed
2824
2824
  }, renderTitle(), renderContent(), renderFooter());
2825
2825
  };
2826
+ var createRoot;
2827
+ var m$1 = ReactDOM__default["default"];
2828
+ {
2829
+ createRoot = m$1.createRoot;
2830
+ m$1.hydrateRoot;
2831
+ }
2826
2832
  const fullClone = {
2827
2833
  ...ReactDOM__namespace
2828
2834
  };
2829
- const { unmountComponentAtNode } = fullClone;
2830
- let createRoot;
2831
- if (fullClone.createRoot) {
2832
- createRoot = fullClone.createRoot;
2833
- } else {
2834
- try {
2835
- createRoot = require("react-dom/client").createRoot;
2836
- } catch (e2) {
2837
- }
2838
- }
2835
+ const { render: reactRender, unmountComponentAtNode } = fullClone;
2839
2836
  function toggleWarning(skip) {
2840
2837
  const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED } = fullClone;
2841
2838
  if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === "object") {
@@ -2844,12 +2841,8 @@
2844
2841
  }
2845
2842
  const MARK = "__react_vant_root__";
2846
2843
  function legacyRender(node, container) {
2847
- if (fullClone.render) {
2848
- fullClone.render(node, container);
2849
- } else {
2850
- if (createRoot) {
2851
- concurrentRender(node, container);
2852
- }
2844
+ if (reactRender) {
2845
+ reactRender(node, container);
2853
2846
  }
2854
2847
  }
2855
2848
  function concurrentRender(node, container) {
@@ -2867,7 +2860,7 @@
2867
2860
  legacyRender(node, container);
2868
2861
  }
2869
2862
  function legacyUnmount(container) {
2870
- return unmountComponentAtNode(container);
2863
+ return unmountComponentAtNode ? unmountComponentAtNode(container) : false;
2871
2864
  }
2872
2865
  async function concurrentUnmount(container) {
2873
2866
  return Promise.resolve().then(() => {
@@ -2877,7 +2870,7 @@
2877
2870
  });
2878
2871
  }
2879
2872
  function unmount(container) {
2880
- if (createRoot) {
2873
+ if (createRoot || container[MARK]) {
2881
2874
  return concurrentUnmount(container);
2882
2875
  }
2883
2876
  return legacyUnmount(container);
@@ -12193,15 +12186,13 @@
12193
12186
  return null;
12194
12187
  };
12195
12188
  const renderMessage = () => {
12196
- setTimeout(() => {
12197
- const { message } = props;
12198
- if (isDef(message) && message !== "") {
12199
- return /* @__PURE__ */ React__default["default"].createElement("div", {
12200
- className: clsx(bem$10("info"))
12201
- }, message);
12202
- }
12203
- return null;
12204
- }, 100);
12189
+ const { message } = props;
12190
+ if (isDef(message) && message !== "") {
12191
+ return /* @__PURE__ */ React__default["default"].createElement("div", {
12192
+ className: clsx(bem$10("info"))
12193
+ }, message);
12194
+ }
12195
+ return null;
12205
12196
  };
12206
12197
  return /* @__PURE__ */ React__default["default"].createElement(Popup, {
12207
12198
  className: clsx([