@unicom-cloud/ui-common 0.1.18 → 0.1.19

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.
Files changed (280) hide show
  1. package/.virtual/_rolldown/runtime.js +1 -1
  2. package/.vite/manifest.json +86 -171
  3. package/development/index.js +1 -1
  4. package/empty/index.js +1 -1
  5. package/flex/index.js +1 -1
  6. package/flex/utils.js +1 -1
  7. package/higher-order/index.js +1 -1
  8. package/higher-order/with-speech-synthesis/index.js +1 -1
  9. package/hooks/create-deep-compare-effect/index.js +1 -1
  10. package/hooks/create-update-effect/index.js +1 -1
  11. package/hooks/create-use-storage-state/index.d.ts +2 -1
  12. package/hooks/create-use-storage-state/index.js +44 -35
  13. package/hooks/index.js +1 -1
  14. package/hooks/use-async-effect/index.js +1 -1
  15. package/hooks/use-boolean/index.js +1 -1
  16. package/hooks/use-click-away/index.js +1 -1
  17. package/hooks/use-computed-state/index.js +1 -1
  18. package/hooks/use-controllable-value/index.js +1 -1
  19. package/hooks/use-cookie-state/index.js +1 -1
  20. package/hooks/use-count-down/index.js +1 -1
  21. package/hooks/use-counter/index.js +1 -1
  22. package/hooks/use-create/index.js +1 -1
  23. package/hooks/use-creation/index.js +1 -1
  24. package/hooks/use-debounce/index.js +1 -1
  25. package/hooks/use-debounce-effect/index.js +1 -1
  26. package/hooks/use-debounce-fn/index.js +1 -1
  27. package/hooks/use-deep-compare-effect/index.js +1 -1
  28. package/hooks/use-deep-compare-layout-effect/index.js +1 -1
  29. package/hooks/use-document-visibility/index.js +1 -1
  30. package/hooks/use-drag/index.js +1 -1
  31. package/hooks/use-drop/index.js +1 -1
  32. package/hooks/use-effect-event/index.js +1 -1
  33. package/hooks/use-event/index.js +1 -1
  34. package/hooks/use-event-listener/index.d.ts +3 -2
  35. package/hooks/use-event-listener/index.js +1 -1
  36. package/hooks/use-event-target/index.js +1 -1
  37. package/hooks/use-external/index.js +1 -1
  38. package/hooks/use-favicon/index.js +1 -1
  39. package/hooks/use-focus-within/index.js +1 -1
  40. package/hooks/use-force-update/index.js +1 -1
  41. package/hooks/use-fullscreen/index.js +1 -1
  42. package/hooks/use-get-state/index.js +1 -1
  43. package/hooks/use-history-travel/index.js +1 -1
  44. package/hooks/use-hover/index.js +1 -1
  45. package/hooks/use-id/index.js +1 -1
  46. package/hooks/use-in-view/index.js +1 -1
  47. package/hooks/use-in-viewport/index.js +1 -1
  48. package/hooks/use-infinite-scroll/index.js +1 -1
  49. package/hooks/use-intersection-observer/index.js +1 -1
  50. package/hooks/use-intersection-observers/index.js +25 -25
  51. package/hooks/use-interval/index.js +1 -1
  52. package/hooks/use-is-first-render/index.js +1 -1
  53. package/hooks/use-isomorphic-layout-effect/index.js +1 -1
  54. package/hooks/use-key-press/index.js +1 -1
  55. package/hooks/use-keyboard-event/index.js +1 -1
  56. package/hooks/use-latest/index.js +1 -1
  57. package/hooks/use-listen-window-resize/index.js +1 -1
  58. package/hooks/use-local-storage-state/index.js +1 -1
  59. package/hooks/use-lock-fn/index.js +1 -1
  60. package/hooks/use-long-press/index.js +1 -1
  61. package/hooks/use-map/index.js +1 -1
  62. package/hooks/use-media/index.js +1 -1
  63. package/hooks/use-memo/index.js +1 -1
  64. package/hooks/use-memoized-fn/index.js +1 -1
  65. package/hooks/use-merge-props/index.js +1 -1
  66. package/hooks/use-merge-value/index.js +1 -1
  67. package/hooks/use-mobile/index.js +1 -1
  68. package/hooks/use-mount/index.js +1 -1
  69. package/hooks/use-mouse/index.js +1 -1
  70. package/hooks/use-move/index.js +1 -1
  71. package/hooks/use-mutation-observer/index.js +1 -1
  72. package/hooks/use-mutation-observers/index.js +24 -24
  73. package/hooks/use-network/index.js +1 -1
  74. package/hooks/use-online-status/index.js +1 -1
  75. package/hooks/use-overflow-hidden/index.js +17 -16
  76. package/hooks/use-override-ref/index.js +1 -1
  77. package/hooks/use-pagination/index.js +1 -1
  78. package/hooks/use-paste-image/index.js +1 -1
  79. package/hooks/use-persist-callback/index.js +1 -1
  80. package/hooks/use-prefers-color-scheme-dark/index.js +1 -1
  81. package/hooks/use-previous/index.js +1 -1
  82. package/hooks/use-raf-interval/index.js +1 -1
  83. package/hooks/use-raf-state/index.js +1 -1
  84. package/hooks/use-raf-timeout/index.js +1 -1
  85. package/hooks/use-reactive/index.js +1 -1
  86. package/hooks/use-ref-latest/index.js +1 -1
  87. package/hooks/use-refs/index.js +1 -1
  88. package/hooks/use-request/index.js +1 -1
  89. package/hooks/use-request/src/Fetch.js +1 -1
  90. package/hooks/use-request/src/plugins/useAutoRunPlugin.js +1 -1
  91. package/hooks/use-request/src/plugins/useCachePlugin.js +1 -1
  92. package/hooks/use-request/src/plugins/useDebouncePlugin.js +1 -1
  93. package/hooks/use-request/src/plugins/useLoadingDelayPlugin.js +1 -1
  94. package/hooks/use-request/src/plugins/usePollingPlugin.js +1 -1
  95. package/hooks/use-request/src/plugins/useRefreshOnWindowFocusPlugin.js +1 -1
  96. package/hooks/use-request/src/plugins/useRetryPlugin.js +1 -1
  97. package/hooks/use-request/src/plugins/useThrottlePlugin.js +1 -1
  98. package/hooks/use-request/src/useRequest.d.ts +6 -2
  99. package/hooks/use-request/src/useRequest.js +1 -1
  100. package/hooks/use-request/src/useRequestImplement.js +1 -1
  101. package/hooks/use-request/src/utils/cache.js +1 -1
  102. package/hooks/use-request/src/utils/cachePromise.js +1 -1
  103. package/hooks/use-request/src/utils/cacheSubscribe.js +1 -1
  104. package/hooks/use-request/src/utils/isDocumentVisible.js +1 -1
  105. package/hooks/use-request/src/utils/isOnline.js +1 -1
  106. package/hooks/use-request/src/utils/limit.js +1 -1
  107. package/hooks/use-request/src/utils/subscribeFocus.js +1 -1
  108. package/hooks/use-request/src/utils/subscribeReVisible.js +1 -1
  109. package/hooks/use-reset-state/index.js +1 -1
  110. package/hooks/use-resize-observer/index.js +1 -1
  111. package/hooks/use-resize-observers/index.js +25 -25
  112. package/hooks/use-responsive/index.js +1 -1
  113. package/hooks/use-safe-state/index.js +1 -1
  114. package/hooks/use-scroll/index.js +1 -1
  115. package/hooks/use-selections/index.js +1 -1
  116. package/hooks/use-session-storage-state/index.js +1 -1
  117. package/hooks/use-set/index.js +1 -1
  118. package/hooks/use-set-state/index.js +1 -1
  119. package/hooks/use-size/index.js +1 -1
  120. package/hooks/use-state-callback/index.js +1 -1
  121. package/hooks/use-state-with-promise/index.js +1 -1
  122. package/hooks/use-sync-state/index.js +1 -1
  123. package/hooks/use-text-selection/index.js +1 -1
  124. package/hooks/use-theme/index.js +1 -1
  125. package/hooks/use-throttle/index.js +1 -1
  126. package/hooks/use-throttle-effect/index.js +1 -1
  127. package/hooks/use-throttle-fn/index.js +1 -1
  128. package/hooks/use-timeout/index.js +1 -1
  129. package/hooks/use-title/index.js +1 -1
  130. package/hooks/use-toggle/index.js +1 -1
  131. package/hooks/use-tracked-effect/index.js +1 -1
  132. package/hooks/use-unmount/index.js +1 -1
  133. package/hooks/use-unmounted-ref/index.js +1 -1
  134. package/hooks/use-update/index.js +1 -1
  135. package/hooks/use-update-effect/index.js +1 -1
  136. package/hooks/use-update-layout-effect/index.js +1 -1
  137. package/hooks/use-url-state/index.js +1 -1
  138. package/hooks/use-virtual-list/index.js +1 -1
  139. package/hooks/use-watch/index.js +1 -1
  140. package/hooks/use-web-socket/index.js +1 -1
  141. package/hooks/use-why-did-you-update/index.js +1 -1
  142. package/hooks/use-window-size/index.js +1 -1
  143. package/hooks/utils/createEffectWithTarget.js +1 -1
  144. package/hooks/utils/depsAreSame.js +1 -1
  145. package/hooks/utils/depsEqual.js +1 -1
  146. package/hooks/utils/domTarget.js +1 -1
  147. package/hooks/utils/getDocumentOrShadow.js +1 -1
  148. package/hooks/utils/index.js +1 -1
  149. package/hooks/utils/isAppleDevice.js +1 -1
  150. package/hooks/utils/isBrowser.js +1 -1
  151. package/hooks/utils/isDev.js +1 -1
  152. package/hooks/utils/rect.js +1 -1
  153. package/hooks/utils/useDeepCompareWithTarget.js +1 -1
  154. package/hooks/utils/useEffectWithTarget.js +1 -1
  155. package/hooks/utils/useIsomorphicLayoutEffectWithTarget.js +1 -1
  156. package/hooks/utils/useLayoutEffectWithTarget.js +1 -1
  157. package/icons/file/index.js +1 -1
  158. package/index.js +487 -480
  159. package/package.json +1 -1
  160. package/progress/index.js +1 -1
  161. package/resize-observer/Collection.js +1 -1
  162. package/resize-observer/SingleObserver.js +1 -1
  163. package/resize-observer/index.js +2 -2
  164. package/resize-observer/observerUtil.js +1 -1
  165. package/space/index.js +1 -1
  166. package/style/animation.less +4 -4
  167. package/style.css +1 -1
  168. package/suspense-fallback-test/index.js +1 -1
  169. package/test.d.ts +0 -0
  170. package/test.js +5 -0
  171. package/timer/index.js +1 -1
  172. package/transition-group/ChildMapping.js +1 -1
  173. package/transition-group/Transition.d.ts +37 -41
  174. package/transition-group/Transition.js +96 -102
  175. package/transition-group/{CSSTransition.d.ts → TransitionCSS.d.ts} +9 -9
  176. package/transition-group/TransitionCSS.js +73 -0
  177. package/transition-group/TransitionGroup.d.ts +1 -1
  178. package/transition-group/TransitionGroup.js +2 -2
  179. package/transition-group/{ReplaceTransition.d.ts → TransitionReplace.d.ts} +5 -5
  180. package/transition-group/{ReplaceTransition.js → TransitionReplace.js} +2 -2
  181. package/transition-group/{SwitchTransition.d.ts → TransitionSwitch.d.ts} +10 -10
  182. package/transition-group/{SwitchTransition.js → TransitionSwitch.js} +3 -3
  183. package/transition-group/context.d.ts +2 -0
  184. package/transition-group/context.js +7 -0
  185. package/transition-group/index.d.ts +5 -5
  186. package/transition-group/index.js +6 -6
  187. package/utils/callOrReturn.js +1 -1
  188. package/utils/callbackOriginRef.js +1 -1
  189. package/utils/caseName.js +1 -1
  190. package/utils/className.js +1 -1
  191. package/utils/constant.js +1 -1
  192. package/utils/copy.js +1 -1
  193. package/utils/date.js +1 -1
  194. package/utils/dayjs.d.ts +1 -1
  195. package/utils/dayjs.js +19 -13
  196. package/utils/dom.js +15 -15
  197. package/utils/emitter.js +1 -1
  198. package/utils/fileRead.js +1 -1
  199. package/utils/fileToDataURL.js +1 -1
  200. package/utils/fillNBSP.js +1 -1
  201. package/utils/findRootElement.d.ts +4 -2
  202. package/utils/findRootElement.js +1 -1
  203. package/utils/findScrollParent.js +1 -1
  204. package/utils/getHighlightText.js +1 -1
  205. package/utils/getHotkeyHandler.js +1 -1
  206. package/utils/getScrollBarHeight.d.ts +3 -0
  207. package/utils/getScrollBarHeight.js +7 -0
  208. package/utils/getScrollBarSize.d.ts +3 -0
  209. package/utils/getScrollBarSize.js +10 -0
  210. package/utils/getScrollBarWidth.d.ts +3 -0
  211. package/utils/getScrollBarWidth.js +7 -0
  212. package/utils/getStringLength.js +1 -1
  213. package/utils/include.js +1 -1
  214. package/utils/index.d.ts +3 -0
  215. package/utils/index.js +221 -214
  216. package/utils/intersectionObserver.js +1 -1
  217. package/utils/is.d.ts +6 -6
  218. package/utils/is.js +15 -15
  219. package/utils/keyboardCode.js +1 -1
  220. package/utils/lodash.js +1 -1
  221. package/utils/math.js +1 -1
  222. package/utils/mergeProps.js +1 -1
  223. package/utils/mergedToString.js +1 -1
  224. package/utils/mutationObserver.js +1 -1
  225. package/utils/omit.d.ts +5 -1
  226. package/utils/omit.js +4 -8
  227. package/utils/pad.js +1 -1
  228. package/utils/pick.d.ts +4 -1
  229. package/utils/pick.js +5 -10
  230. package/utils/pinyin.js +1 -1
  231. package/utils/react19Adapter.js +1 -1
  232. package/utils/ref.js +1 -1
  233. package/utils/resizeObserver.js +21 -21
  234. package/utils/saveAs.js +1 -1
  235. package/utils/screenfull.js +1 -1
  236. package/utils/scrollIntoViewIfNeeded.js +1 -1
  237. package/utils/setCreateRoot.js +1 -1
  238. package/utils/setDarkTheme.js +1 -1
  239. package/utils/setDir.js +1 -1
  240. package/utils/setPrimaryColor.js +1 -1
  241. package/utils/setTheme.js +1 -1
  242. package/utils/string.js +1 -1
  243. package/utils/style.js +1 -1
  244. package/utils/throttleByRaf.js +1 -1
  245. package/utils/throttleByRaf2.js +1 -1
  246. package/utils/tinycolor.js +1 -1
  247. package/utils/toArray.js +1 -1
  248. package/utils/tree.js +1 -1
  249. package/utils/tween.js +1 -1
  250. package/utils/uuid.js +1 -1
  251. package/utils/validate.js +1 -1
  252. package/utils/warning.js +1 -1
  253. package/version/index.js +11 -14
  254. package/motion/CSSMotion.d.ts +0 -77
  255. package/motion/CSSMotion.js +0 -76
  256. package/motion/CSSMotionList.d.ts +0 -34
  257. package/motion/CSSMotionList.js +0 -82
  258. package/motion/context.d.ts +0 -9
  259. package/motion/context.js +0 -14
  260. package/motion/hooks/useDomMotionEvents.d.ts +0 -3
  261. package/motion/hooks/useDomMotionEvents.js +0 -19
  262. package/motion/hooks/useNextFrame.d.ts +0 -7
  263. package/motion/hooks/useNextFrame.js +0 -22
  264. package/motion/hooks/useStatus.d.ts +0 -5
  265. package/motion/hooks/useStatus.js +0 -92
  266. package/motion/hooks/useStepQueue.d.ts +0 -8
  267. package/motion/hooks/useStepQueue.js +0 -39
  268. package/motion/index.d.ts +0 -9
  269. package/motion/index.js +0 -9
  270. package/motion/interface.d.ts +0 -22
  271. package/motion/interface.js +0 -6
  272. package/motion/util/diff.d.ts +0 -20
  273. package/motion/util/diff.js +0 -50
  274. package/motion/util/motion.d.ts +0 -10
  275. package/motion/util/motion.js +0 -37
  276. package/transition-group/CSSTransition.js +0 -73
  277. package/transition-group/PqbCSSTransition.d.ts +0 -4
  278. package/transition-group/PqbCSSTransition.js +0 -34
  279. package/transition-group/TransitionGroupContext.d.ts +0 -3
  280. package/transition-group/TransitionGroupContext.js +0 -7
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@unicom-cloud/ui-common","version":"0.1.18","dependencies":{"@unicom-cloud/utils":"^0.1.0","@unicom-cloud/icons":"^0.1.0"},"peerDependencies":{"dayjs":"^1.11.19","lodash":"^4.17.23","react":"^18.3.1","react-dom":"^18.3.1","react-is":"^18.3.1"},"type":"module","types":"types/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
1
+ {"name":"@unicom-cloud/ui-common","version":"0.1.19","dependencies":{"@unicom-cloud/utils":"^0.1.0","@unicom-cloud/icons":"^0.1.0"},"peerDependencies":{"dayjs":"^1.11.19","lodash":"^4.18.1","react":"^18.3.1","react-dom":"^18.3.1","react-is":"^18.3.1"},"type":"module","types":"types/index.d.ts","main":"./index.js","bin":{"ui":"./test.js"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
package/progress/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-03-24 15:26:24 星期二 */
1
+ /* 潘启宝 2026-04-03 14:07:44 星期五 */
2
2
  import { isNumber as e } from "../utils/is.js";
3
3
  import { UI_COMMON_PREFIX as t } from "@unicom-cloud/utils/constant/ui";
4
4
  //#region components/common/progress/index.js
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-03-24 15:26:24 星期二 */
1
+ /* 潘启宝 2026-04-03 14:07:44 星期五 */
2
2
  import e from "react";
3
3
  import { jsx as t } from "react/jsx-runtime";
4
4
  //#region components/common/resize-observer/Collection.tsx
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-03-24 15:26:24 星期二 */
1
+ /* 潘启宝 2026-04-03 14:07:44 星期五 */
2
2
  import { isFunction as e } from "../utils/is.js";
3
3
  import { getReactElementRef as t, supportRef as n, useComposeRef as r } from "../utils/ref.js";
4
4
  import i from "../utils/findRootElement.js";
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-03-24 15:26:24 星期二 */
1
+ /* 潘启宝 2026-04-03 14:07:44 星期五 */
2
2
  import { isFunction as e } from "../utils/is.js";
3
3
  import t from "../utils/toArray.js";
4
4
  import { Collection as n } from "./Collection.js";
@@ -17,7 +17,7 @@ function o(n, i) {
17
17
  });
18
18
  }
19
19
  var s = i.forwardRef(o);
20
- s.Collection = n;
20
+ s.displayName = "ResizeObserver", s.Collection = n;
21
21
  //#endregion
22
22
  export { s as default };
23
23
  /* 独立思考,明辨是非 */
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-03-24 15:26:24 星期二 */
1
+ /* 潘启宝 2026-04-03 14:07:44 星期五 */
2
2
  //#region components/common/resize-observer/observerUtil.ts
3
3
  var e = /* @__PURE__ */ new Map();
4
4
  function t(t) {
package/space/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-03-24 15:26:24 星期二 */
1
+ /* 潘启宝 2026-04-03 14:07:44 星期五 */
2
2
  import e from "../hooks/use-merge-props/index.js";
3
3
  import t from "../utils/className.js";
4
4
  import n from "../utils/toArray.js";
@@ -7,12 +7,12 @@
7
7
  animation: ~'@{ui-common-prefix}-keyframes-vibrate' 0.3s linear infinite both;
8
8
  }
9
9
 
10
- .@{ui-common-prefix}-animation-blink-enter,
11
- .@{ui-common-prefix}-animation-blink-appear {
10
+ .@{ui-common-prefix}-animation-blink-appear,
11
+ .@{ui-common-prefix}-animation-blink-enter {
12
12
  opacity: 0;
13
13
  }
14
- .@{ui-common-prefix}-animation-blink-enter-active,
15
- .@{ui-common-prefix}-animation-blink-appear-active {
14
+ .@{ui-common-prefix}-animation-blink-appear-active,
15
+ .@{ui-common-prefix}-animation-blink-enter-active {
16
16
  opacity: 1;
17
17
  transition: opacity 0.3s linear;
18
18
  }
package/style.css CHANGED
@@ -1,2 +1,2 @@
1
- :root{--pi:3.14159}@keyframes pqbc-keyframes-vibrate{0%{transform:translate(0)}20%{transform:translate(-2px,2px)}40%{transform:translate(-2px,-2px)}60%{transform:translate(2px,2px)}80%{transform:translate(2px,-2px)}to{transform:translate(0)}}@keyframes pqbc-keyframes-rotate-360deg{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes pqbc-keyframes-blink{0%{opacity:1}50%{opacity:0}to{opacity:1}}.pqbc-animation-rotate-360deg{animation:1s cubic-bezier(0,0,1,1) infinite pqbc-keyframes-rotate-360deg}.pqbc-animation-vibrate{animation:.3s linear infinite both pqbc-keyframes-vibrate}.pqbc-animation-blink-enter,.pqbc-animation-blink-appear{opacity:0}.pqbc-animation-blink-enter-active,.pqbc-animation-blink-appear-active{opacity:1;transition:opacity .3s linear}.pqbc-animation-blink-enter-done{animation:.5s linear pqbc-keyframes-blink}.pqbc-display-none{display:none!important}.pqbc-visibility-hidden{visibility:hidden!important}.pqbc-overflow-hidden{overflow:hidden}.pqbc-cursor-pointer{cursor:pointer}.pqbc-filter-invert-100{filter:invert()}.pqbc-filter-grayscale-100{filter:grayscale()}.pqbc-isolation-isolate{isolation:isolate}.pqbc-direction-rtl{direction:rtl}.pqbc-line-height-1{line-height:1}.pqbc-text-overflow-ellipsis{text-overflow:ellipsis;white-space:nowrap;word-break:break-all;overflow:hidden}.pqbc-line-clamp-2,.pqbc-line-clamp-3,.pqbc-line-clamp-4,.pqbc-line-clamp-5{text-overflow:ellipsis;white-space:normal;-webkit-box-orient:vertical;display:-webkit-box;display:-moz-box;overflow:hidden}.pqbc-line-clamp-2{line-clamp:2;-webkit-line-clamp:2}.pqbc-line-clamp-3{line-clamp:3;-webkit-line-clamp:3}.pqbc-line-clamp-4{line-clamp:4;-webkit-line-clamp:4}.pqbc-line-clamp-5{line-clamp:5;-webkit-line-clamp:5}.pqb-theme-dark,.pqbm-theme-dark,.pqb-theme-dark *,.pqbm-theme-dark *{color-scheme:dark}[dir=rtl] *,.pqbc-with-speech-synthesis-rtl{direction:rtl}.pqbc-empty{width:100%}.pqbc-empty .pqbc-empty-description{line-height:1}.pqbc-development{flex-direction:column;justify-content:center;align-items:center;gap:10px;width:100%;height:100%;min-height:300px;display:flex}.pqbc-development-icon,.pqbc-development-img{width:50px;height:50px}.pqbc-development-label{--color-neutral:#868788;color:var(--pqbc-color-neutral-6,var(--pqb-color-neutral-6,var(--pqbm-color-neutral-6,--color-neutral)));font-size:20px}.pqbc-space-vertical{width:100%}.pqbc-space-rtl{direction:rtl}.pqbc-icons-file{position:relative}.pqbc-icons-file-svg{width:30px;height:30px}.pqbc-icons-file-svg-bg{--primary:26, 94, 255;fill:rgb(var(--pqbc-primary-6,var(--pqb-primary-6,var(--pqbm-primary-6,--primary))))}.pqbc-icons-file-svg-tr{fill:#fff;fill-opacity:.7}.pqbc-icons-file-svg-text{fill:#fff;text-align:center;font-size:66px;font-weight:bolder}.pqbc-flex{box-sizing:border-box;margin:0;padding:0;display:flex}.pqbc-flex-inline{display:inline-flex}.pqbc-flex:empty{display:none}.pqbc-flex-rtl{direction:rtl}.pqbc-progress{pointer-events:none}.pqbc-progress-bar{--primary:26, 94, 255;background-color:rgb(var(--pqbc-primary-6,var(--pqb-primary-6,var(--pqbm-primary-6,--primary))));z-index:870227;width:100%;height:2px;position:fixed;inset-block-start:0;inset-inline-start:0}.pqbc-timer-rtl{direction:rtl}
1
+ :root{--pi:3.14159}@keyframes pqbc-keyframes-vibrate{0%{transform:translate(0)}20%{transform:translate(-2px,2px)}40%{transform:translate(-2px,-2px)}60%{transform:translate(2px,2px)}80%{transform:translate(2px,-2px)}to{transform:translate(0)}}@keyframes pqbc-keyframes-rotate-360deg{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes pqbc-keyframes-blink{0%{opacity:1}50%{opacity:0}to{opacity:1}}.pqbc-animation-rotate-360deg{animation:1s cubic-bezier(0,0,1,1) infinite pqbc-keyframes-rotate-360deg}.pqbc-animation-vibrate{animation:.3s linear infinite both pqbc-keyframes-vibrate}.pqbc-animation-blink-appear,.pqbc-animation-blink-enter{opacity:0}.pqbc-animation-blink-appear-active,.pqbc-animation-blink-enter-active{opacity:1;transition:opacity .3s linear}.pqbc-animation-blink-enter-done{animation:.5s linear pqbc-keyframes-blink}.pqbc-display-none{display:none!important}.pqbc-visibility-hidden{visibility:hidden!important}.pqbc-overflow-hidden{overflow:hidden}.pqbc-cursor-pointer{cursor:pointer}.pqbc-filter-invert-100{filter:invert()}.pqbc-filter-grayscale-100{filter:grayscale()}.pqbc-isolation-isolate{isolation:isolate}.pqbc-direction-rtl{direction:rtl}.pqbc-line-height-1{line-height:1}.pqbc-text-overflow-ellipsis{text-overflow:ellipsis;white-space:nowrap;word-break:break-all;overflow:hidden}.pqbc-line-clamp-2,.pqbc-line-clamp-3,.pqbc-line-clamp-4,.pqbc-line-clamp-5{text-overflow:ellipsis;white-space:normal;-webkit-box-orient:vertical;display:-webkit-box;display:-moz-box;overflow:hidden}.pqbc-line-clamp-2{line-clamp:2;-webkit-line-clamp:2}.pqbc-line-clamp-3{line-clamp:3;-webkit-line-clamp:3}.pqbc-line-clamp-4{line-clamp:4;-webkit-line-clamp:4}.pqbc-line-clamp-5{line-clamp:5;-webkit-line-clamp:5}.pqb-theme-dark,.pqbm-theme-dark,.pqb-theme-dark *,.pqbm-theme-dark *{color-scheme:dark}[dir=rtl] *,.pqbc-with-speech-synthesis-rtl{direction:rtl}.pqbc-empty{width:100%}.pqbc-empty .pqbc-empty-description{line-height:1}.pqbc-development{flex-direction:column;justify-content:center;align-items:center;gap:10px;width:100%;height:100%;min-height:300px;display:flex}.pqbc-development-icon,.pqbc-development-img{width:50px;height:50px}.pqbc-development-label{--color-neutral:#868788;color:var(--pqbc-color-neutral-6,var(--pqb-color-neutral-6,var(--pqbm-color-neutral-6,--color-neutral)));font-size:20px}.pqbc-space-vertical{width:100%}.pqbc-space-rtl{direction:rtl}.pqbc-icons-file{position:relative}.pqbc-icons-file-svg{width:30px;height:30px}.pqbc-icons-file-svg-bg{--primary:26, 94, 255;fill:rgb(var(--pqbc-primary-6,var(--pqb-primary-6,var(--pqbm-primary-6,--primary))))}.pqbc-icons-file-svg-tr{fill:#fff;fill-opacity:.7}.pqbc-icons-file-svg-text{fill:#fff;text-align:center;font-size:66px;font-weight:bolder}.pqbc-flex{box-sizing:border-box;margin:0;padding:0;display:flex}.pqbc-flex-inline{display:inline-flex}.pqbc-flex:empty{display:none}.pqbc-flex-rtl{direction:rtl}.pqbc-progress{pointer-events:none}.pqbc-progress-bar{--primary:26, 94, 255;background-color:rgb(var(--pqbc-primary-6,var(--pqb-primary-6,var(--pqbm-primary-6,--primary))));z-index:870227;width:100%;height:2px;position:fixed;inset-block-start:0;inset-inline-start:0}.pqbc-timer-rtl{direction:rtl}
2
2
  /*$vite$:1*/
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-03-24 15:26:24 星期二 */
1
+ /* 潘启宝 2026-04-03 14:07:44 星期五 */
2
2
  import e from "react";
3
3
  import { jsx as t } from "react/jsx-runtime";
4
4
  var n = e.forwardRef((n, r) => /* @__PURE__ */ t(e.useMemo(() => e.lazy(() => new Promise(() => {})), []), {}));
package/test.d.ts ADDED
File without changes
package/test.js ADDED
@@ -0,0 +1,5 @@
1
+ /* 潘启宝 2026-04-03 14:07:44 星期五 */
2
+ //#region components/common/test.js
3
+ console.log("我是潘启宝");
4
+ //#endregion
5
+ /* 独立思考,明辨是非 */
package/timer/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-03-24 15:26:24 星期二 */
1
+ /* 潘启宝 2026-04-03 14:07:44 星期五 */
2
2
  import { isFunction as e } from "../utils/is.js";
3
3
  import t from "../utils/className.js";
4
4
  import { forwardRef as n, useEffect as r, useImperativeHandle as i, useRef as a, useState as o } from "react";
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-03-24 15:26:24 星期二 */
1
+ /* 潘启宝 2026-04-03 14:07:44 星期五 */
2
2
  import { Children as e, cloneElement as t, isValidElement as n } from "react";
3
3
  //#region components/common/transition-group/ChildMapping.ts
4
4
  function r(t, r) {
@@ -1,30 +1,29 @@
1
1
  import React from 'react';
2
- export declare const UNMOUNTED = "unmounted";
3
- export declare const EXITED = "exited";
4
2
  export declare const ENTERING = "entering";
5
3
  export declare const ENTERED = "entered";
6
4
  export declare const EXITING = "exiting";
5
+ export declare const EXITED = "exited";
6
+ export declare const UNMOUNTED = "unmounted";
7
7
  /**
8
- * The Transition component lets you describe a transition from one component
9
- * state to another _over time_ with a simple declarative API. Most commonly
10
- * it's used to animate the mounting and unmounting of a component, but can also
11
- * be used to describe in-place transition states as well.
8
+ * Transition 组件允许你通过简单的声明式 API,
9
+ * 描述组件状态随时间的过渡。
10
+ * 最常用于组件的挂载和卸载动画,
11
+ * 也可用于组件在位状态切换。
12
12
  *
13
13
  * ---
14
14
  *
15
- * **Note**: `Transition` is a platform-agnostic base component. If you're using
16
- * transitions in CSS, you'll probably want to use
17
- * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
18
- * instead. It inherits all the features of `Transition`, but contains
19
- * additional features necessary to play nice with CSS transitions (hence the
20
- * name of the component).
15
+ * 注意:`Transition` 是一个与平台无关的基础组件。
16
+ * 如果你在使用 CSS 过渡,可能更适合使用
17
+ * [`TransitionCSS`](https://reactcommunity.org/react-transition-group/css-transition)。
18
+ * 它继承了 Transition 的所有功能,
19
+ * 还包含了适配 CSS 过渡所需的额外特性。
21
20
  *
22
21
  * ---
23
22
  *
24
- * By default the `Transition` component does not alter the behavior of the
25
- * component it renders, it only tracks "enter" and "exit" states for the
26
- * components. It's up to you to give meaning and effect to those states. For
27
- * example we can add styles to a component when it enters or exits:
23
+ * 默认情况下,Transition 组件不会改变所渲染组件的行为,
24
+ * 它只追踪组件的「进入」和「退出」状态。
25
+ * 你需要自行为这些状态定义样式和行为。
26
+ * 例如,你可以在组件进入/退出时添加样式:
28
27
  *
29
28
  * ```jsx
30
29
  * import { Transition } from 'react-transition-group';
@@ -47,7 +46,7 @@ export declare const EXITING = "exiting";
47
46
  * function Fade({ in: inProp }) {
48
47
  * const refElement = useRef(null);
49
48
  * return (
50
- * <Transition refElement={refElement} in={inProp} timeout={duration}>
49
+ * <Transition refElement={refElement} in={inProp} duration={duration}>
51
50
  * {state => (
52
51
  * <div ref={refElement} style={{
53
52
  * ...defaultStyle,
@@ -61,18 +60,16 @@ export declare const EXITING = "exiting";
61
60
  * }
62
61
  * ```
63
62
  *
64
- * There are 4 main states a Transition can be in:
65
- * - `'entering'`
66
- * - `'entered'`
67
- * - `'exiting'`
68
- * - `'exited'`
63
+ * Transition 共有 4 种主要状态:
64
+ * - `'entering'` 进入中
65
+ * - `'entered'` 已进入
66
+ * - `'exiting'` 退出中
67
+ * - `'exited'` 已退出
69
68
  *
70
- * Transition state is toggled via the `in` prop. When `true` the component
71
- * begins the "Enter" stage. During this stage, the component will shift from
72
- * its current transition state, to `'entering'` for the duration of the
73
- * transition and then to the `'entered'` stage once it's complete. Let's take
74
- * the following example (we'll use the
75
- * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
69
+ * 过渡状态由 `in` 属性控制。
70
+ * 当 `in={true}` 时,组件开始「进入」阶段。
71
+ * 在此阶段,组件状态会切换为 `entering`,
72
+ * 持续过渡时长后切换为 `entered`。
76
73
  *
77
74
  * ```jsx
78
75
  * import { Transition } from 'react-transition-group';
@@ -83,7 +80,7 @@ export declare const EXITING = "exiting";
83
80
  * const refElement = useRef(null);
84
81
  * return (
85
82
  * <div>
86
- * <Transition refElement={refElement} in={inProp} timeout={500}>
83
+ * <Transition refElement={refElement} in={inProp} duration={500}>
87
84
  * {state => ()}
88
85
  * </Transition>
89
86
  * <button onClick={() => setInProp(true)}>
@@ -94,12 +91,11 @@ export declare const EXITING = "exiting";
94
91
  * }
95
92
  * ```
96
93
  *
97
- * When the button is clicked the component will shift to the `'entering'` state
98
- * and stay there for 500ms (the value of `timeout`) before it finally switches
99
- * to `'entered'`.
94
+ * 点击按钮后,组件状态变为 `entering`,
95
+ * 持续 500ms 后切换为 `entered`。
100
96
  *
101
- * When `in` is `false` the same thing happens except the state moves from
102
- * `'exiting'` to `'exited'`.
97
+ * 当 `in={false}` 时,过程类似,
98
+ * 状态从 `exiting` 变为 `exited`。
103
99
  */
104
100
  declare class Transition extends React.Component {
105
101
  #private;
@@ -113,18 +109,18 @@ declare class Transition extends React.Component {
113
109
  componentDidMount(): void;
114
110
  componentDidUpdate(prevProps: any): void;
115
111
  componentWillUnmount(): void;
116
- getTimeouts(): {
112
+ getDurations: () => {
117
113
  exit: any;
118
114
  enter: any;
119
115
  appear: any;
120
116
  };
121
- updateStatus(mounting: boolean | undefined, nextStatus: any): void;
122
- performEnter(mounting: any): void;
123
- performExit(): void;
124
- cancelNextCallback(): void;
117
+ updateStatus: (mounting: boolean | undefined, nextStatus: any) => void;
118
+ performEnter: (mounting: any) => void;
119
+ performExit: () => void;
120
+ cancelNextCallback: () => void;
125
121
  safeSetState(nextState: any, callback: any): void;
126
- setNextCallback(callback: any): any;
127
- onTransitionEnd(timeout: any, handler: any): void;
122
+ setNextCallback: (callback: any) => null;
123
+ onTransitionEnd: (duration: any, handler: any) => void;
128
124
  render(): import("react/jsx-runtime").JSX.Element | null;
129
125
  }
130
126
  export default Transition;
@@ -1,26 +1,90 @@
1
- /* 潘启宝 2026-03-24 15:26:24 星期二 */
2
- import { isFunction as e } from "../utils/is.js";
3
- import { forceReflow as t } from "../utils/dom.js";
4
- import n from "../utils/findRootElement.js";
5
- import { NOOP as r } from "../utils/constant.js";
6
- import i from "./TransitionGroupContext.js";
7
- import a from "react";
8
- import { jsx as o } from "react/jsx-runtime";
1
+ /* 潘启宝 2026-04-03 14:07:44 星期五 */
2
+ import { isFunction as e, isNull as t, isNullOrUndefined as n, isNumber as r, isObject as i } from "../utils/is.js";
3
+ import { forceReflow as a } from "../utils/dom.js";
4
+ import o from "../utils/findRootElement.js";
5
+ import { NOOP as s } from "../utils/constant.js";
6
+ import { TransitionGroupContext as c } from "./context.js";
7
+ import l from "react";
8
+ import { jsx as u } from "react/jsx-runtime";
9
9
  //#region components/common/transition-group/Transition.tsx
10
- var s = "unmounted", c = "exited", l = "entering", u = "entered", d = "exiting", f = class extends a.Component {
10
+ var d = "entering", f = "entered", p = "exiting", m = "exited", h = "unmounted", g = class extends l.Component {
11
11
  static {
12
- this.contextType = i;
13
- }
14
- constructor(e, t) {
15
- super(e, t);
16
- let n = t, r = n && !n.isMounting ? e.enter : e.appear, i;
17
- this.appearStatus = null, e.in ? r ? (i = c, this.appearStatus = l) : i = u : i = e.unmountOnExit || e.mountOnEnter ? s : c, this.state = { status: i }, this.nextCallback = null;
18
- }
19
- #e() {
20
- return n(this.props.refElement) || n(this);
12
+ this.contextType = c;
13
+ }
14
+ constructor(o, s) {
15
+ super(o, s), this.getDurations = () => {
16
+ let { duration: e } = this.props, t, n, r;
17
+ return t = n = r = e, i(e) && (t = e.exit, n = e.enter, r = e.appear ?? n), {
18
+ exit: t,
19
+ enter: n,
20
+ appear: r
21
+ };
22
+ }, this.updateStatus = (e = !1, n) => {
23
+ if (t(n)) this.props.unmountOnExit && this.state.status === "exited" && this.setState({ status: h });
24
+ else if (this.cancelNextCallback(), n === "entering") {
25
+ if (this.props.unmountOnExit || this.props.mountOnEnter) {
26
+ let e = this.#n();
27
+ e && a(e);
28
+ }
29
+ this.performEnter(e);
30
+ } else this.performExit();
31
+ }, this.performEnter = (e) => {
32
+ let { enter: t } = this.props, n = this.context ? this.context.isMounting : e, [r, i] = [this.#n(), n], a = this.getDurations(), o = n ? a.appear : a.enter;
33
+ if (!(e || t)) {
34
+ this.safeSetState({ status: f }, () => {
35
+ this.props.onEntered(r);
36
+ });
37
+ return;
38
+ }
39
+ this.props.onEnter(r, i), this.safeSetState({ status: d }, () => {
40
+ this.props.onEntering(r, i), this.onTransitionEnd(o, () => {
41
+ this.safeSetState({ status: f }, () => {
42
+ this.props.onEntered(r, i);
43
+ });
44
+ });
45
+ });
46
+ }, this.performExit = () => {
47
+ let { exit: e } = this.props, t = this.getDurations(), n = this.#n();
48
+ if (!e) {
49
+ this.safeSetState({ status: m }, () => {
50
+ this.props.onExited(n);
51
+ });
52
+ return;
53
+ }
54
+ this.props.onExit(n), this.safeSetState({ status: p }, () => {
55
+ this.props.onExiting(n), this.onTransitionEnd(t.exit, () => {
56
+ this.safeSetState({ status: m }, () => {
57
+ this.props.onExited(n);
58
+ });
59
+ });
60
+ });
61
+ }, this.cancelNextCallback = () => {
62
+ n(this.#t) || (this.#t.cancel(), this.#t = null);
63
+ }, this.setNextCallback = (e) => {
64
+ let t = !0;
65
+ return this.#t = (n) => {
66
+ t && (t = !1, this.#t = null, e(n));
67
+ }, this.#t.cancel = () => {
68
+ t = !1;
69
+ }, this.#t;
70
+ }, this.onTransitionEnd = (t, n) => {
71
+ let { setTimeout: i, clearTimeout: a } = window;
72
+ this.setNextCallback(n);
73
+ let o = this.#n(), s = this.props.addEndListener;
74
+ if (!o || !r(t) && !e(s)) {
75
+ a(this.#e), this.#e = i(this.#t, 0);
76
+ return;
77
+ }
78
+ e(s) && s(o, this.#t), r(t) && (a(this.#e), this.#e = i(this.#t, t));
79
+ };
80
+ let c = s, l = c && !c.isMounting ? o.enter : o.appear, u;
81
+ this.appearStatus = null, o.in ? l ? (u = m, this.appearStatus = d) : u = f : u = o.unmountOnExit || o.mountOnEnter ? h : m, this.state = { status: u };
21
82
  }
83
+ #e = -1;
84
+ #t = null;
85
+ #n = () => o(this.props.refElement) || o(this);
22
86
  static getDerivedStateFromProps({ in: e }, t) {
23
- return e && t.status === "unmounted" ? { status: c } : null;
87
+ return e && t.status === "unmounted" ? { status: m } : null;
24
88
  }
25
89
  componentDidMount() {
26
90
  this.updateStatus(!0, this.appearStatus);
@@ -29,97 +93,27 @@ var s = "unmounted", c = "exited", l = "entering", u = "entered", d = "exiting",
29
93
  let t = null;
30
94
  if (e !== this.props) {
31
95
  let { status: e } = this.state;
32
- this.props.in ? e !== "entering" && e !== "entered" && (t = l) : (e === "entering" || e === "entered") && (t = d);
96
+ this.props.in ? e !== "entering" && e !== "entered" && (t = d) : (e === "entering" || e === "entered") && (t = p);
33
97
  }
34
98
  this.updateStatus(!1, t);
35
99
  }
36
100
  componentWillUnmount() {
37
101
  this.cancelNextCallback();
38
102
  }
39
- getTimeouts() {
40
- let { timeout: e } = this.props, t, n, r;
41
- return t = n = r = e, e != null && typeof e != "number" && (t = e.exit, n = e.enter, r = e.appear === void 0 ? n : e.appear), {
42
- exit: t,
43
- enter: n,
44
- appear: r
45
- };
46
- }
47
- updateStatus(e = !1, n) {
48
- if (n !== null) if (this.cancelNextCallback(), n === "entering") {
49
- if (this.props.unmountOnExit || this.props.mountOnEnter) {
50
- let e = this.#e();
51
- e && t(e);
52
- }
53
- this.performEnter(e);
54
- } else this.performExit();
55
- else this.props.unmountOnExit && this.state.status === "exited" && this.setState({ status: s });
56
- }
57
- performEnter(e) {
58
- let { enter: t } = this.props, n = this.context ? this.context.isMounting : e, [r, i] = [this.#e(), n], a = this.getTimeouts(), o = n ? a.appear : a.enter;
59
- if (!e && !t) {
60
- this.safeSetState({ status: u }, () => {
61
- this.props.onEntered(r);
62
- });
63
- return;
64
- }
65
- this.props.onEnter(r, i), this.safeSetState({ status: l }, () => {
66
- this.props.onEntering(r, i), this.onTransitionEnd(o, () => {
67
- this.safeSetState({ status: u }, () => {
68
- this.props.onEntered(r, i);
69
- });
70
- });
71
- });
72
- }
73
- performExit() {
74
- let { exit: e } = this.props, t = this.getTimeouts(), n = this.#e();
75
- if (!e) {
76
- this.safeSetState({ status: c }, () => {
77
- this.props.onExited(n);
78
- });
79
- return;
80
- }
81
- this.props.onExit(n), this.safeSetState({ status: d }, () => {
82
- this.props.onExiting(n), this.onTransitionEnd(t.exit, () => {
83
- this.safeSetState({ status: c }, () => {
84
- this.props.onExited(n);
85
- });
86
- });
87
- });
88
- }
89
- cancelNextCallback() {
90
- this.nextCallback !== null && (this.nextCallback.cancel(), this.nextCallback = null);
91
- }
92
103
  safeSetState(e, t) {
93
104
  t = this.setNextCallback(t), this.setState(e, t);
94
105
  }
95
- setNextCallback(e) {
96
- let t = !0;
97
- return this.nextCallback = (n) => {
98
- t && (t = !1, this.nextCallback = null, e(n));
99
- }, this.nextCallback.cancel = () => {
100
- t = !1;
101
- }, this.nextCallback;
102
- }
103
- onTransitionEnd(e, t) {
104
- this.setNextCallback(t);
105
- let n = this.#e(), r = this.props.addEndListener;
106
- if (!n || e == null && !r) {
107
- setTimeout(this.nextCallback, 0);
108
- return;
109
- }
110
- r && r(n, this.nextCallback), e != null && setTimeout(this.nextCallback, e);
111
- }
112
106
  render() {
113
107
  let t = this.state.status;
114
108
  if (t === "unmounted") return null;
115
- let { children: n, in: r, mountOnEnter: s, unmountOnExit: c, appear: l, enter: u, exit: d, timeout: f, addEndListener: p, onEnter: m, onEntering: h, onEntered: g, onExit: _, onExiting: v, onExited: y, refElement: b, ...x } = this.props;
116
- return /* @__PURE__ */ o(i.Provider, {
109
+ let { children: n, in: r, mountOnEnter: i, unmountOnExit: a, appear: o, enter: s, exit: d, duration: f, addEndListener: p, onEnter: m, onEntering: h, onEntered: g, onExit: _, onExiting: v, onExited: y, refElement: b, ...x } = this.props;
110
+ return /* @__PURE__ */ u(c.Provider, {
117
111
  value: null,
118
- children: e(n) ? n(t, x) : a.cloneElement(a.Children.only(n), x)
112
+ children: e(n) ? n(t, x) : l.cloneElement(l.Children.only(n), x)
119
113
  });
120
114
  }
121
115
  };
122
- f.defaultProps = {
116
+ g.defaultProps = {
123
117
  in: !1,
124
118
  mountOnEnter: !1,
125
119
  unmountOnExit: !1,
@@ -127,13 +121,13 @@ f.defaultProps = {
127
121
  enter: !0,
128
122
  exit: !0,
129
123
  refElement: void 0,
130
- onEnter: r,
131
- onEntering: r,
132
- onEntered: r,
133
- onExit: r,
134
- onExiting: r,
135
- onExited: r
136
- }, f.UNMOUNTED = s, f.EXITED = c, f.ENTERING = l, f.ENTERED = u, f.EXITING = d;
124
+ onEnter: s,
125
+ onEntering: s,
126
+ onEntered: s,
127
+ onExit: s,
128
+ onExiting: s,
129
+ onExited: s
130
+ }, g.UNMOUNTED = h, g.EXITED = m, g.ENTERING = d, g.ENTERED = f, g.EXITING = p;
137
131
  //#endregion
138
- export { u as ENTERED, l as ENTERING, c as EXITED, d as EXITING, s as UNMOUNTED, f as default };
132
+ export { f as ENTERED, d as ENTERING, m as EXITED, p as EXITING, h as UNMOUNTED, g as default };
139
133
  /* 独立思考,明辨是非 */
@@ -6,7 +6,7 @@ import React from 'react';
6
6
  * [`Transition`](https://reactcommunity.org/react-transition-group/transition)
7
7
  * component, so it inherits all of its props.
8
8
  *
9
- * `CSSTransition` applies a pair of class names during the `appear`, `enter`,
9
+ * `TransitionCSS` applies a pair of class names during the `appear`, `enter`,
10
10
  * and `exit` states of the transition. The first class is applied and then a
11
11
  * second `*-active` class in order to activate the CSS transition. After the
12
12
  * transition, matching `*-done` class names are applied to persist the
@@ -18,11 +18,11 @@ import React from 'react';
18
18
  * const refElement = useRef(null);
19
19
  * return (
20
20
  * <div>
21
- * <CSSTransition refElement={refElement} in={inProp} timeout={200} classNames="my-element">
21
+ * <TransitionCSS refElement={refElement} in={inProp} duration={200} classNames="my-element">
22
22
  * <div ref={refElement}>
23
23
  * {"I'll receive my-element-* classes"}
24
24
  * </div>
25
- * </CSSTransition>
25
+ * </TransitionCSS>
26
26
  * <button type="button" onClick={() => setInProp(true)}>
27
27
  * Click to Enter
28
28
  * </button>
@@ -33,8 +33,8 @@ import React from 'react';
33
33
  *
34
34
  * When the `in` prop is set to `true`, the child component will first receive
35
35
  * the class `example-enter`, then the `example-enter-active` will be added in
36
- * the next tick. `CSSTransition` [forces a
37
- * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
36
+ * the next tick. `TransitionCSS` [forces a
37
+ * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/TransitionCSS.js#L208-L215)
38
38
  * between before adding the `example-enter-active`. This is an important trick
39
39
  * because it allows us to transition between `example-enter` and
40
40
  * `example-enter-active` even though they were added immediately one after
@@ -69,7 +69,7 @@ import React from 'react';
69
69
  * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)
70
70
  * prop, make sure to define styles for `.appear-*` classes as well.
71
71
  */
72
- declare class CSSTransition extends React.Component {
72
+ declare class TransitionCSS extends React.Component {
73
73
  static defaultProps: {
74
74
  classNames: string;
75
75
  };
@@ -90,8 +90,8 @@ declare class CSSTransition extends React.Component {
90
90
  activeClassName: any;
91
91
  doneClassName: any;
92
92
  };
93
- addClass(element: any, type: any, phase: any): void;
94
- removeClasses(element: any, type: any): void;
93
+ addClass: (element: any, type: any, phase: any) => void;
94
+ removeClasses: (element: any, type: any) => void;
95
95
  render(): import("react/jsx-runtime").JSX.Element;
96
96
  }
97
- export default CSSTransition;
97
+ export default TransitionCSS;
@@ -0,0 +1,73 @@
1
+ /* 潘启宝 2026-04-03 14:07:44 星期五 */
2
+ import { isElementByInstanceof as e, isFunction as t, isString as n } from "../utils/is.js";
3
+ import { forceReflow as r } from "../utils/dom.js";
4
+ import i from "../utils/findRootElement.js";
5
+ import a from "./Transition.js";
6
+ import o from "react";
7
+ import { jsx as s } from "react/jsx-runtime";
8
+ //#region components/common/transition-group/TransitionCSS.tsx
9
+ function c(t, r, i = "add") {
10
+ e(t) && r && n(r) && r.split(" ").filter(Boolean).forEach((e, n, r) => {
11
+ t.classList[i](e);
12
+ });
13
+ }
14
+ var l = class extends o.Component {
15
+ constructor(...e) {
16
+ super(...e), this.appliedClasses = {
17
+ appear: {},
18
+ enter: {},
19
+ exit: {}
20
+ }, this.onEnter = (e, n) => {
21
+ let [r, i] = this.resolveArguments(e, n);
22
+ this.removeClasses(r, "exit"), this.addClass(r, i ? "appear" : "enter", "base"), t(this.props.onEnter) && this.props.onEnter(r, n);
23
+ }, this.onEntering = (e, n) => {
24
+ let [r, i] = this.resolveArguments(e, n), a = i ? "appear" : "enter";
25
+ this.addClass(r, a, "active"), t(this.props.onEntering) && this.props.onEntering(r, n);
26
+ }, this.onEntered = (e, n) => {
27
+ let [r, i] = this.resolveArguments(e, n), a = i ? "appear" : "enter";
28
+ this.removeClasses(r, a), this.addClass(r, a, "done"), t(this.props.onEntered) && this.props.onEntered(r, n);
29
+ }, this.onExit = (e) => {
30
+ let [n] = this.resolveArguments(e);
31
+ this.removeClasses(n, "appear"), this.removeClasses(n, "enter"), this.addClass(n, "exit", "base"), t(this.props.onExit) && this.props.onExit(n);
32
+ }, this.onExiting = (e) => {
33
+ let [n] = this.resolveArguments(e);
34
+ this.addClass(n, "exit", "active"), t(this.props.onExiting) && this.props.onExiting(n);
35
+ }, this.onExited = (e) => {
36
+ let [n] = this.resolveArguments(e);
37
+ this.removeClasses(n, "exit"), this.addClass(n, "exit", "done"), t(this.props.onExited) && this.props.onExited(n);
38
+ }, this.resolveArguments = (e, t) => [i(this.props.refElement) || e, t], this.getClassNames = (e) => {
39
+ let { classNames: t, duration: r } = this.props;
40
+ r == 0 && (t = "");
41
+ let i = n(t), a = i && t ? `${t}-` : "", o = i ? `${a}${e}` : t[e];
42
+ return {
43
+ baseClassName: o,
44
+ activeClassName: i ? `${o}-active` : t[`${e}Active`],
45
+ doneClassName: i ? `${o}-done` : t[`${e}Done`]
46
+ };
47
+ }, this.addClass = (e, t, n) => {
48
+ let i = this.getClassNames(t)[`${n}ClassName`], { doneClassName: a } = this.getClassNames("enter");
49
+ t === "appear" && n === "done" && a && (i += ` ${a}`), n === "active" && e && r(e), i && (this.appliedClasses[t][n] = i, c(e, i, "add"));
50
+ }, this.removeClasses = (e, t) => {
51
+ let { base: n, active: r, done: i } = this.appliedClasses[t];
52
+ this.appliedClasses[t] = {}, n && c(e, n, "remove"), r && c(e, r, "remove"), i && c(e, i, "remove");
53
+ };
54
+ }
55
+ static {
56
+ this.defaultProps = { classNames: "" };
57
+ }
58
+ render() {
59
+ let { classNames: e, ...t } = this.props;
60
+ return /* @__PURE__ */ s(a, {
61
+ ...t,
62
+ onEnter: this.onEnter,
63
+ onEntered: this.onEntered,
64
+ onEntering: this.onEntering,
65
+ onExit: this.onExit,
66
+ onExiting: this.onExiting,
67
+ onExited: this.onExited
68
+ });
69
+ }
70
+ };
71
+ //#endregion
72
+ export { l as default };
73
+ /* 独立思考,明辨是非 */
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  /**
3
3
  * The `<TransitionGroup>` component manages a set of transition components
4
- * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
4
+ * (`<Transition>` and `<TransitionCSS>`) in a list. Like with the transition
5
5
  * components, `<TransitionGroup>` is a state machine for managing the mounting
6
6
  * and unmounting of components over time.
7
7
  *
@@ -1,6 +1,6 @@
1
- /* 潘启宝 2026-03-24 15:26:24 星期二 */
1
+ /* 潘启宝 2026-04-03 14:07:44 星期五 */
2
2
  import { getChildMapping as e, getInitialChildMapping as t, getNextChildMapping as n } from "./ChildMapping.js";
3
- import r from "./TransitionGroupContext.js";
3
+ import { TransitionGroupContext as r } from "./context.js";
4
4
  import i from "react";
5
5
  import { jsx as a } from "react/jsx-runtime";
6
6
  //#region components/common/transition-group/TransitionGroup.tsx