@nutui/nutui-react 2.0.13 → 2.0.15-beta.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ # v2.0.15
2
+ `2023-08-30`
3
+
4
+ * :sparkles: feat: support next.js (#1326) @oasis-cloud
5
+ * :bug: fix: dialog content 失效 (#1323) @oasis-cloud
6
+ * :bug: fix: space 复制按钮重复 (#1322) @oasis-cloud
7
+ * 🔨 chore(tabs): 更新文档与 demo (#1339) @Eiinu
8
+
9
+
10
+ # v2.0.14
11
+ `2023-08-18`
12
+
13
+ * :bug: fix: skeleton row 设置为 1 时, 宽度只能固定为70% (#1306) @ivan-My
14
+ * :bug: fix: loading 构建产物增加类型注释 (#1320) @oasis-cloud
15
+ * :bug: fix: space 构建产物增加类型注释 (#1321) @oasis-cloud
16
+ * 📖 docs: dialog 指令式用法注意事项 (#1318) @oasis-cloud
17
+
18
+
19
+
1
20
  # v2.0.13
2
21
  `2023-08-16`
3
22
 
@@ -23,9 +23,11 @@ function _objectSpread(target) {
23
23
  }
24
24
  return target;
25
25
  }
26
- import React__default, { useState, useRef, useLayoutEffect } from "react";
26
+ import React__default, { useLayoutEffect, useEffect, useState, useRef } from "react";
27
27
  import classNames from "classnames";
28
28
  import { C as ComponentDefaults } from "./typings.js";
29
+ import { c as canUseDom } from "./can-use-dom.js";
30
+ var useIsomorphicLayoutEffect = canUseDom ? useLayoutEffect : useEffect;
29
31
  var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
30
32
  content: "",
31
33
  direction: "end",
@@ -46,7 +48,7 @@ var Ellipsis = function Ellipsis2(props) {
46
48
  var ellipsis = useRef();
47
49
  var root = useRef(null);
48
50
  var classes = classNames(classPrefix, className);
49
- useLayoutEffect(function() {
51
+ useIsomorphicLayoutEffect(function() {
50
52
  if (content) {
51
53
  createContainer();
52
54
  }
@@ -29,6 +29,7 @@ import Popup from "./Popup.js";
29
29
  import { g as getRect } from "./use-client-rect.js";
30
30
  import { C as ComponentDefaults } from "./typings.js";
31
31
  import { u as useClickAway } from "./use-click-away.js";
32
+ import { c as canUseDom } from "./can-use-dom.js";
32
33
  import "./index.js";
33
34
  var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
34
35
  list: [],
@@ -65,7 +66,11 @@ var Popover = function Popover2(props) {
65
66
  }, 0);
66
67
  }
67
68
  }, [visible]);
68
- var targetSet = [targetId ? document.querySelector("#".concat(targetId)) : popoverRef.current, popoverContentRef.current];
69
+ var element;
70
+ if (canUseDom) {
71
+ element = targetId && document.querySelector("#".concat(targetId));
72
+ }
73
+ var targetSet = [targetId ? element : popoverRef.current, popoverContentRef.current];
69
74
  useClickAway(function() {
70
75
  props.onClick && props.onClick();
71
76
  onClose2 && onClose2();
@@ -27,7 +27,8 @@ import React__default, { useState, useRef, useEffect } from "react";
27
27
  import { useDrag } from "@use-gesture/react";
28
28
  import { useSpring, animated } from "@react-spring/web";
29
29
  import { useConfig } from "./ConfigProvider.js";
30
- import { c as canUseDom, g as getScrollParent } from "./get-scroll-parent.js";
30
+ import { g as getScrollParent } from "./get-scroll-parent.js";
31
+ import { c as canUseDom } from "./can-use-dom.js";
31
32
  import { C as ComponentDefaults } from "./typings.js";
32
33
  function bound(position, min, max) {
33
34
  var ret = position;
@@ -26,6 +26,7 @@ function _objectSpread(target) {
26
26
  import React__default, { useRef, useState, useEffect, useImperativeHandle } from "react";
27
27
  import { useConfig } from "./ConfigProvider.js";
28
28
  import { C as ComponentDefaults } from "./typings.js";
29
+ import { c as canUseDom } from "./can-use-dom.js";
29
30
  var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
30
31
  type: "png",
31
32
  lineWidth: 2,
@@ -41,20 +42,24 @@ var InternalSignature = function InternalSignature2(props, ref) {
41
42
  var _useState = useState(0), _useState2 = _slicedToArray(_useState, 2), canvasHeight = _useState2[0], setCanvasHeight = _useState2[1];
42
43
  var _useState3 = useState(0), _useState4 = _slicedToArray(_useState3, 2), canvasWidth = _useState4[0], setCanvasWidth = _useState4[1];
43
44
  var ctx = useRef(null);
44
- var isCanvasSupported = function isCanvasSupported2() {
45
+ var checkCanvas = function checkCanvas2() {
45
46
  var elem = document.createElement("canvas");
46
47
  return !!(elem.getContext && elem.getContext("2d"));
47
48
  };
48
- var isSupportTouch = "ontouchstart" in window;
49
+ var _useState5 = useState(false), _useState6 = _slicedToArray(_useState5, 2), isCanvasSupported = _useState6[0], setIsCanvasSupported = _useState6[1];
50
+ var isSupportTouch = canUseDom ? "ontouchstart" in window : false;
49
51
  var events = isSupportTouch ? ["touchstart", "touchmove", "touchend", "touchleave"] : ["mousedown", "mousemove", "mouseup", "mouseleave"];
50
52
  useEffect(function() {
51
- if (isCanvasSupported() && canvasRef.current && wrapRef.current) {
53
+ setIsCanvasSupported(checkCanvas);
54
+ }, []);
55
+ useEffect(function() {
56
+ if (isCanvasSupported && canvasRef.current && wrapRef.current) {
52
57
  ctx.current = canvasRef.current.getContext("2d");
53
58
  setCanvasWidth(wrapRef.current.offsetWidth);
54
59
  setCanvasHeight(wrapRef.current.offsetHeight);
55
60
  addEvent();
56
61
  }
57
- }, []);
62
+ }, [isCanvasSupported]);
58
63
  var startEventHandler = function startEventHandler2(event) {
59
64
  event.preventDefault();
60
65
  if (ctx.current && canvasRef.current) {
@@ -135,11 +140,11 @@ var InternalSignature = function InternalSignature2(props, ref) {
135
140
  }, rest), React__default.createElement("div", {
136
141
  className: "".concat(classPrefix, "__inner"),
137
142
  ref: wrapRef
138
- }, isCanvasSupported() ? React__default.createElement("canvas", {
143
+ }, React__default.createElement(React__default.Fragment, null, isCanvasSupported ? React__default.createElement("canvas", {
139
144
  ref: canvasRef,
140
145
  height: canvasHeight,
141
146
  width: canvasWidth
142
- }) : React__default.createElement(React__default.Fragment, null, unsupported || React__default.createElement("p", {
147
+ }) : unsupported ? React__default.createElement(React__default.Fragment, null, unsupported) : React__default.createElement("p", {
143
148
  className: "".concat(classPrefix, "__unsupport")
144
149
  }, locale.signature.unsupported))));
145
150
  };
@@ -1 +1 @@
1
- .nut-avatar-group{background-size:100% 100%;background-repeat:no-repeat;background-position:center center;display:inline-block;position:relative;flex:0 0 auto}.nut-avatar-group .nut-avatar{border:1px solid #fff}.nut-avatar-group .nut-avatar:not(:first-of-type){margin-left:-8px}.nut-avatar{background-size:100% 100%;background-repeat:no-repeat;background-position:center center;display:inline-block;position:relative;flex:0 0 auto;text-align:center}.nut-avatar .avatar-img{position:absolute;width:100%;height:100%;top:50%;left:50%;transform:translate(-50%,-50%);flex-shrink:0}.nut-avatar .icon{background-size:100% 100%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.nut-avatar .nut-icon__img{width:100%;height:100%}.nut-avatar .text{display:inline-block;width:100%;height:100%;text-align:center;overflow:hidden}.nut-avatar-large{width:var(--nutui-avatar-large-width, 60px);height:var(--nutui-avatar-large-height, 60px);line-height:var(--nutui-avatar-large-height, 60px)}.nut-avatar-small{width:var(--nutui-avatar-small-width, 32px);height:var(--nutui-avatar-small-height, 32px);line-height:var(--nutui-avatar-small-height, 32px)}.nut-avatar-normal{width:var(--nutui-avatar-normal-width, 40px);height:var(--nutui-avatar-normal-height, 40px);line-height:var(--nutui-avatar-normal-height, 40px)}.nut-avatar-round{border-radius:50%;overflow:hidden}.nut-avatar-square{border-radius:var(--nutui-avatar-square, 5px)}.nut-skeleton{display:inline-block;position:relative;overflow:hidden;vertical-align:middle;width:100%}.nut-skeleton__content{display:flex}.nut-skeleton__content .avatar{margin-right:20px;background:var(--nutui-skeleton-background, rgb(239, 239, 239))!important}.nut-skeleton__content .nut-skeleton__block{width:var(--nutui-skeleton-line-width, 100%);height:var(--nutui-skeleton-line-height, 15px);background:var(--nutui-skeleton-background, rgb(239, 239, 239));margin-top:10px;border-radius:var(--nutui-skeleton-line-border-radius, 0)}.nut-skeleton__content .nut-skeleton__block:last-child{width:70%}.nut-skeleton__content-line{width:100%;display:flex;flex-direction:column}.nut-skeleton__content-line .nut-skeleton__title{width:30%;height:var(--nutui-skeleton-line-height, 15px);background:var(--nutui-skeleton-background, rgb(239, 239, 239))}.nut-skeleton__animation{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;background:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.5) 50%,hsla(0,0%,100%,0) 80%);background-repeat:no-repeat;animation:nut-skeleton 2s ease-in-out 0s infinite}@keyframes nut-skeleton{0%{background-position-x:-500px}to{background-position-x:calc(500px + 100%)}}
1
+ .nut-avatar-group{background-size:100% 100%;background-repeat:no-repeat;background-position:center center;display:inline-block;position:relative;flex:0 0 auto}.nut-avatar-group .nut-avatar{border:1px solid #fff}.nut-avatar-group .nut-avatar:not(:first-of-type){margin-left:-8px}.nut-avatar{background-size:100% 100%;background-repeat:no-repeat;background-position:center center;display:inline-block;position:relative;flex:0 0 auto;text-align:center}.nut-avatar .avatar-img{position:absolute;width:100%;height:100%;top:50%;left:50%;transform:translate(-50%,-50%);flex-shrink:0}.nut-avatar .icon{background-size:100% 100%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.nut-avatar .nut-icon__img{width:100%;height:100%}.nut-avatar .text{display:inline-block;width:100%;height:100%;text-align:center;overflow:hidden}.nut-avatar-large{width:var(--nutui-avatar-large-width, 60px);height:var(--nutui-avatar-large-height, 60px);line-height:var(--nutui-avatar-large-height, 60px)}.nut-avatar-small{width:var(--nutui-avatar-small-width, 32px);height:var(--nutui-avatar-small-height, 32px);line-height:var(--nutui-avatar-small-height, 32px)}.nut-avatar-normal{width:var(--nutui-avatar-normal-width, 40px);height:var(--nutui-avatar-normal-height, 40px);line-height:var(--nutui-avatar-normal-height, 40px)}.nut-avatar-round{border-radius:50%;overflow:hidden}.nut-avatar-square{border-radius:var(--nutui-avatar-square, 5px)}.nut-skeleton{display:inline-block;position:relative;overflow:hidden;vertical-align:middle;width:100%}.nut-skeleton__content{display:flex}.nut-skeleton__content .avatar{margin-right:20px;background:var(--nutui-skeleton-background, rgb(239, 239, 239))!important}.nut-skeleton__content .nut-skeleton__block{width:var(--nutui-skeleton-line-width, 100%);height:var(--nutui-skeleton-line-height, 15px);background:var(--nutui-skeleton-background, rgb(239, 239, 239));margin-top:10px;border-radius:var(--nutui-skeleton-line-border-radius, 0)}.nut-skeleton__content-line{width:100%;display:flex;flex-direction:column}.nut-skeleton__content-line .nut-skeleton__title{width:30%;height:var(--nutui-skeleton-line-height, 15px);background:var(--nutui-skeleton-background, rgb(239, 239, 239))}.nut-skeleton__content-line .nut-skeleton__block:last-child{width:70%}.nut-skeleton__animation{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;background:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.5) 50%,hsla(0,0%,100%,0) 80%);background-repeat:no-repeat;animation:nut-skeleton 2s ease-in-out 0s infinite}@keyframes nut-skeleton{0%{background-position-x:-500px}to{background-position-x:calc(500px + 100%)}}
@@ -28,6 +28,7 @@ import classNames from "classnames";
28
28
  import { g as getScrollParent } from "./get-scroll-parent.js";
29
29
  import { g as getRect } from "./use-client-rect.js";
30
30
  import { C as ComponentDefaults } from "./typings.js";
31
+ import "./can-use-dom.js";
31
32
  function useWatch(dep, callback) {
32
33
  var config = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
33
34
  immediate: false
@@ -0,0 +1,4 @@
1
+ var canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
2
+ export {
3
+ canUseDom as c
4
+ };
@@ -1,4 +1,4 @@
1
- var canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
1
+ import { c as canUseDom } from "./can-use-dom.js";
2
2
  var defaultRoot = canUseDom ? window : void 0;
3
3
  var overflowStylePatterns = ["scroll", "auto", "overlay"];
4
4
  function isElement(node) {
@@ -21,6 +21,5 @@ function getScrollParent(el) {
21
21
  return root;
22
22
  }
23
23
  export {
24
- canUseDom as c,
25
24
  getScrollParent as g
26
25
  };
@@ -3,9 +3,9 @@ import { BasicComponent } from '@/utils/typings';
3
3
  export interface SideNavBarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>, BasicComponent {
4
4
  title: ReactNode;
5
5
  visible: boolean;
6
- width?: string;
7
- indent?: number;
8
- position?: 'left' | 'right';
6
+ width: string;
7
+ indent: number;
8
+ position: 'left' | 'right';
9
9
  onClose: () => void;
10
10
  }
11
- export declare const SideNavBar: FunctionComponent<SideNavBarProps>;
11
+ export declare const SideNavBar: FunctionComponent<Partial<SideNavBarProps>>;
@@ -3,9 +3,9 @@ import { BasicComponent } from '@/utils/typings';
3
3
  export interface SideNavBarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>, BasicComponent {
4
4
  title: ReactNode;
5
5
  visible: boolean;
6
- width?: string;
7
- indent?: number;
8
- position?: 'left' | 'right';
6
+ width: string;
7
+ indent: number;
8
+ position: 'left' | 'right';
9
9
  onClose: () => void;
10
10
  }
11
- export declare const SideNavBar: FunctionComponent<SideNavBarProps>;
11
+ export declare const SideNavBar: FunctionComponent<Partial<SideNavBarProps>>;
@@ -0,0 +1,2 @@
1
+ import { useEffect } from 'react';
2
+ export declare const useIsomorphicLayoutEffect: typeof useEffect;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.13 Wed Aug 16 2023 13:43:07 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:05:32 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.13 Wed Aug 16 2023 13:43:07 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:05:32 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.13 Wed Aug 16 2023 13:43:07 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:05:32 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.13 Wed Aug 16 2023 13:43:07 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:05:32 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.13 Wed Aug 16 2023 13:43:07 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:05:32 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.13 Wed Aug 16 2023 13:43:07 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:05:32 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.13 Wed Aug 16 2023 13:43:07 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:05:32 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => {
6
6
  };
7
7
  var _a;
8
8
  /*!
9
- * @nutui/nutui-react v2.0.13 Wed Aug 16 2023 13:42:21 GMT+0800 (China Standard Time)
9
+ * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:04:32 GMT+0800 (China Standard Time)
10
10
  * (c) 2023 @jdf2e.
11
11
  * Released under the MIT License.
12
12
  */
@@ -9138,10 +9138,10 @@ function deprecateDirectCall() {
9138
9138
  function isAnimatedString(value) {
9139
9139
  return is.str(value) && (value[0] == "#" || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {}));
9140
9140
  }
9141
- const useIsomorphicLayoutEffect = isSSR() ? useEffect : useLayoutEffect;
9141
+ const useIsomorphicLayoutEffect$1 = isSSR() ? useEffect : useLayoutEffect;
9142
9142
  const useIsMounted = () => {
9143
9143
  const isMounted = useRef(false);
9144
- useIsomorphicLayoutEffect(() => {
9144
+ useIsomorphicLayoutEffect$1(() => {
9145
9145
  isMounted.current = true;
9146
9146
  return () => {
9147
9147
  isMounted.current = false;
@@ -9423,7 +9423,7 @@ const withAnimated = (Component2, host2) => {
9423
9423
  };
9424
9424
  const observer = new PropsObserver(callback, deps);
9425
9425
  const observerRef = useRef();
9426
- useIsomorphicLayoutEffect(() => {
9426
+ useIsomorphicLayoutEffect$1(() => {
9427
9427
  observerRef.current = observer;
9428
9428
  each(deps, (dep) => addFluidObserver(dep, observer));
9429
9429
  return () => {
@@ -11108,7 +11108,7 @@ function useSprings(length, props, deps) {
11108
11108
  const context = useContext(SpringContext);
11109
11109
  const prevContext = usePrev(context);
11110
11110
  const hasContext = context !== prevContext && hasProps(context);
11111
- useIsomorphicLayoutEffect(() => {
11111
+ useIsomorphicLayoutEffect$1(() => {
11112
11112
  layoutId.current++;
11113
11113
  state.ctrls = ctrls.current;
11114
11114
  const {
@@ -18577,20 +18577,24 @@ const InternalSignature = (props, ref) => {
18577
18577
  const [canvasHeight, setCanvasHeight] = useState(0);
18578
18578
  const [canvasWidth, setCanvasWidth] = useState(0);
18579
18579
  const ctx2 = useRef(null);
18580
- const isCanvasSupported = () => {
18580
+ const checkCanvas = () => {
18581
18581
  const elem = document.createElement("canvas");
18582
18582
  return !!(elem.getContext && elem.getContext("2d"));
18583
18583
  };
18584
- const isSupportTouch = "ontouchstart" in window;
18584
+ const [isCanvasSupported, setIsCanvasSupported] = useState(false);
18585
+ const isSupportTouch = canUseDom ? "ontouchstart" in window : false;
18585
18586
  const events = isSupportTouch ? ["touchstart", "touchmove", "touchend", "touchleave"] : ["mousedown", "mousemove", "mouseup", "mouseleave"];
18586
18587
  useEffect(() => {
18587
- if (isCanvasSupported() && canvasRef.current && wrapRef.current) {
18588
+ setIsCanvasSupported(checkCanvas);
18589
+ }, []);
18590
+ useEffect(() => {
18591
+ if (isCanvasSupported && canvasRef.current && wrapRef.current) {
18588
18592
  ctx2.current = canvasRef.current.getContext("2d");
18589
18593
  setCanvasWidth(wrapRef.current.offsetWidth);
18590
18594
  setCanvasHeight(wrapRef.current.offsetHeight);
18591
18595
  addEvent();
18592
18596
  }
18593
- }, []);
18597
+ }, [isCanvasSupported]);
18594
18598
  const startEventHandler = (event) => {
18595
18599
  event.preventDefault();
18596
18600
  if (ctx2.current && canvasRef.current) {
@@ -18663,7 +18667,7 @@ const InternalSignature = (props, ref) => {
18663
18667
  handleClearBtn();
18664
18668
  }
18665
18669
  }));
18666
- return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2} ${className}`, style, ...rest }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__inner`, ref: wrapRef }, isCanvasSupported() ? /* @__PURE__ */ React__default.createElement("canvas", { ref: canvasRef, height: canvasHeight, width: canvasWidth }) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, unsupported || /* @__PURE__ */ React__default.createElement("p", { className: `${classPrefix2}__unsupport` }, locale.signature.unsupported))));
18670
+ return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2} ${className}`, style, ...rest }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__inner`, ref: wrapRef }, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, isCanvasSupported ? /* @__PURE__ */ React__default.createElement("canvas", { ref: canvasRef, height: canvasHeight, width: canvasWidth }) : unsupported ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, unsupported) : /* @__PURE__ */ React__default.createElement("p", { className: `${classPrefix2}__unsupport` }, locale.signature.unsupported))));
18667
18671
  };
18668
18672
  const Signature = React__default.forwardRef(InternalSignature);
18669
18673
  Signature.defaultProps = defaultProps$J;
@@ -20813,8 +20817,12 @@ const Popover = (props) => {
20813
20817
  }, 0);
20814
20818
  }
20815
20819
  }, [visible]);
20820
+ let element;
20821
+ if (canUseDom) {
20822
+ element = targetId && document.querySelector(`#${targetId}`);
20823
+ }
20816
20824
  const targetSet = [
20817
- targetId ? document.querySelector(`#${targetId}`) : popoverRef.current,
20825
+ targetId ? element : popoverRef.current,
20818
20826
  popoverContentRef.current
20819
20827
  ];
20820
20828
  useClickAway(
@@ -22719,6 +22727,7 @@ const InternalCountDown = (props, ref) => {
22719
22727
  const CountDown = React__default.forwardRef(InternalCountDown);
22720
22728
  CountDown.defaultProps = defaultProps$k;
22721
22729
  CountDown.displayName = "NutCountDown";
22730
+ const useIsomorphicLayoutEffect = canUseDom ? useLayoutEffect : useEffect;
22722
22731
  const defaultProps$j = {
22723
22732
  ...ComponentDefaults,
22724
22733
  content: "",
@@ -22753,7 +22762,7 @@ const Ellipsis = (props) => {
22753
22762
  const ellipsis = useRef();
22754
22763
  const root2 = useRef(null);
22755
22764
  const classes = classNames(classPrefix$4, className);
22756
- useLayoutEffect(() => {
22765
+ useIsomorphicLayoutEffect(() => {
22757
22766
  if (content) {
22758
22767
  createContainer();
22759
22768
  }
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
9
9
  return value;
10
10
  };
11
11
  /*!
12
- * @nutui/nutui-react v2.0.13 Wed Aug 16 2023 13:42:21 GMT+0800 (China Standard Time)
12
+ * @nutui/nutui-react v2.0.15 Wed Aug 30 2023 14:04:32 GMT+0800 (China Standard Time)
13
13
  * (c) 2023 @jdf2e.
14
14
  * Released under the MIT License.
15
15
  */
@@ -9156,10 +9156,10 @@ Please add \`${key}Action\` when creating your handler.`);
9156
9156
  function isAnimatedString(value) {
9157
9157
  return is.str(value) && (value[0] == "#" || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {}));
9158
9158
  }
9159
- const useIsomorphicLayoutEffect = isSSR() ? React.useEffect : React.useLayoutEffect;
9159
+ const useIsomorphicLayoutEffect$1 = isSSR() ? React.useEffect : React.useLayoutEffect;
9160
9160
  const useIsMounted = () => {
9161
9161
  const isMounted = React.useRef(false);
9162
- useIsomorphicLayoutEffect(() => {
9162
+ useIsomorphicLayoutEffect$1(() => {
9163
9163
  isMounted.current = true;
9164
9164
  return () => {
9165
9165
  isMounted.current = false;
@@ -9441,7 +9441,7 @@ Please add \`${key}Action\` when creating your handler.`);
9441
9441
  };
9442
9442
  const observer = new PropsObserver(callback, deps);
9443
9443
  const observerRef = React.useRef();
9444
- useIsomorphicLayoutEffect(() => {
9444
+ useIsomorphicLayoutEffect$1(() => {
9445
9445
  observerRef.current = observer;
9446
9446
  each(deps, (dep) => addFluidObserver(dep, observer));
9447
9447
  return () => {
@@ -11126,7 +11126,7 @@ Please add \`${key}Action\` when creating your handler.`);
11126
11126
  const context = React.useContext(SpringContext);
11127
11127
  const prevContext = usePrev(context);
11128
11128
  const hasContext = context !== prevContext && hasProps(context);
11129
- useIsomorphicLayoutEffect(() => {
11129
+ useIsomorphicLayoutEffect$1(() => {
11130
11130
  layoutId.current++;
11131
11131
  state.ctrls = ctrls.current;
11132
11132
  const {
@@ -18595,20 +18595,24 @@ Please add \`${key}Action\` when creating your handler.`);
18595
18595
  const [canvasHeight, setCanvasHeight] = React.useState(0);
18596
18596
  const [canvasWidth, setCanvasWidth] = React.useState(0);
18597
18597
  const ctx2 = React.useRef(null);
18598
- const isCanvasSupported = () => {
18598
+ const checkCanvas = () => {
18599
18599
  const elem = document.createElement("canvas");
18600
18600
  return !!(elem.getContext && elem.getContext("2d"));
18601
18601
  };
18602
- const isSupportTouch = "ontouchstart" in window;
18602
+ const [isCanvasSupported, setIsCanvasSupported] = React.useState(false);
18603
+ const isSupportTouch = canUseDom ? "ontouchstart" in window : false;
18603
18604
  const events = isSupportTouch ? ["touchstart", "touchmove", "touchend", "touchleave"] : ["mousedown", "mousemove", "mouseup", "mouseleave"];
18604
18605
  React.useEffect(() => {
18605
- if (isCanvasSupported() && canvasRef.current && wrapRef.current) {
18606
+ setIsCanvasSupported(checkCanvas);
18607
+ }, []);
18608
+ React.useEffect(() => {
18609
+ if (isCanvasSupported && canvasRef.current && wrapRef.current) {
18606
18610
  ctx2.current = canvasRef.current.getContext("2d");
18607
18611
  setCanvasWidth(wrapRef.current.offsetWidth);
18608
18612
  setCanvasHeight(wrapRef.current.offsetHeight);
18609
18613
  addEvent();
18610
18614
  }
18611
- }, []);
18615
+ }, [isCanvasSupported]);
18612
18616
  const startEventHandler = (event) => {
18613
18617
  event.preventDefault();
18614
18618
  if (ctx2.current && canvasRef.current) {
@@ -18681,7 +18685,7 @@ Please add \`${key}Action\` when creating your handler.`);
18681
18685
  handleClearBtn();
18682
18686
  }
18683
18687
  }));
18684
- return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2} ${className}`, style, ...rest }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__inner`, ref: wrapRef }, isCanvasSupported() ? /* @__PURE__ */ React.createElement("canvas", { ref: canvasRef, height: canvasHeight, width: canvasWidth }) : /* @__PURE__ */ React.createElement(React.Fragment, null, unsupported || /* @__PURE__ */ React.createElement("p", { className: `${classPrefix2}__unsupport` }, locale.signature.unsupported))));
18688
+ return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2} ${className}`, style, ...rest }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__inner`, ref: wrapRef }, /* @__PURE__ */ React.createElement(React.Fragment, null, isCanvasSupported ? /* @__PURE__ */ React.createElement("canvas", { ref: canvasRef, height: canvasHeight, width: canvasWidth }) : unsupported ? /* @__PURE__ */ React.createElement(React.Fragment, null, unsupported) : /* @__PURE__ */ React.createElement("p", { className: `${classPrefix2}__unsupport` }, locale.signature.unsupported))));
18685
18689
  };
18686
18690
  const Signature = React.forwardRef(InternalSignature);
18687
18691
  Signature.defaultProps = defaultProps$J;
@@ -20831,8 +20835,12 @@ Please add \`${key}Action\` when creating your handler.`);
20831
20835
  }, 0);
20832
20836
  }
20833
20837
  }, [visible]);
20838
+ let element;
20839
+ if (canUseDom) {
20840
+ element = targetId && document.querySelector(`#${targetId}`);
20841
+ }
20834
20842
  const targetSet = [
20835
- targetId ? document.querySelector(`#${targetId}`) : popoverRef.current,
20843
+ targetId ? element : popoverRef.current,
20836
20844
  popoverContentRef.current
20837
20845
  ];
20838
20846
  useClickAway(
@@ -22737,6 +22745,7 @@ Please add \`${key}Action\` when creating your handler.`);
22737
22745
  const CountDown = React.forwardRef(InternalCountDown);
22738
22746
  CountDown.defaultProps = defaultProps$k;
22739
22747
  CountDown.displayName = "NutCountDown";
22748
+ const useIsomorphicLayoutEffect = canUseDom ? React.useLayoutEffect : React.useEffect;
22740
22749
  const defaultProps$j = {
22741
22750
  ...ComponentDefaults,
22742
22751
  content: "",
@@ -22771,7 +22780,7 @@ Please add \`${key}Action\` when creating your handler.`);
22771
22780
  const ellipsis = React.useRef();
22772
22781
  const root2 = React.useRef(null);
22773
22782
  const classes = classNames(classPrefix$4, className);
22774
- React.useLayoutEffect(() => {
22783
+ useIsomorphicLayoutEffect(() => {
22775
22784
  if (content) {
22776
22785
  createContainer();
22777
22786
  }
@@ -20,10 +20,6 @@
20
20
  background: $skeleton-background;
21
21
  margin-top: 10px;
22
22
  border-radius: $skeleton-line-border-radius;
23
-
24
- &:last-child {
25
- width: 70%;
26
- }
27
23
  }
28
24
 
29
25
  &-line {
@@ -36,6 +32,9 @@
36
32
  height: $skeleton-line-height;
37
33
  background: $skeleton-background;
38
34
  }
35
+ .nut-skeleton__block:last-child {
36
+ width: 70%;
37
+ }
39
38
  }
40
39
  }
41
40