@unicom-cloud/ui-common 0.1.57 → 0.1.58
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/.virtual/_rolldown/runtime.js +1 -1
- package/animation/Animation.js +1 -1
- package/animation/constants.js +1 -1
- package/animation/context.js +1 -1
- package/animation/index.js +1 -1
- package/animation/style/index.js +1 -1
- package/animation/utils.js +1 -1
- package/base/Base.js +1 -1
- package/base/constants.js +1 -1
- package/base/context.js +1 -1
- package/base/index.js +1 -1
- package/base/style/index.js +1 -1
- package/base/utils.js +1 -1
- package/border-beam/BorderBeam.js +1 -1
- package/border-beam/Effect.js +13 -12
- package/border-beam/constants.js +1 -1
- package/border-beam/context.js +1 -1
- package/border-beam/hooks/useBorderSize.js +1 -1
- package/border-beam/hooks/useChildDom.js +1 -1
- package/border-beam/index.js +1 -1
- package/border-beam/style/index.js +1 -1
- package/border-beam/utils.js +1 -1
- package/development/Development.js +1 -1
- package/development/constants.js +1 -1
- package/development/context.js +1 -1
- package/development/index.js +1 -1
- package/development/style/index.js +1 -1
- package/development/utils.js +1 -1
- package/empty/Empty.js +1 -1
- package/empty/constants.js +1 -1
- package/empty/context.js +1 -1
- package/empty/index.js +1 -1
- package/empty/style/index.js +1 -1
- package/empty/utils.js +1 -1
- package/flex/Flex.js +1 -1
- package/flex/FlexVertical.js +1 -1
- package/flex/constants.js +1 -1
- package/flex/context.js +1 -1
- package/flex/index.js +1 -1
- package/flex/style/index.js +1 -1
- package/flex/utils.js +1 -1
- package/grid/Grid.js +1 -1
- package/grid/Item.js +1 -1
- package/grid/constants.js +1 -1
- package/grid/context.js +1 -1
- package/grid/index.js +1 -1
- package/grid/style/index.js +1 -1
- package/grid/utils.js +1 -1
- package/higher-order/with-speech-synthesis/context.js +1 -1
- package/higher-order/with-speech-synthesis/index.js +1 -1
- package/higher-order/with-speech-synthesis/style/index.js +1 -1
- package/higher-order/with-speech-synthesis/withSpeechSynthesis.js +1 -1
- package/hoc/withContext.js +1 -1
- package/hooks/create-deep-compare-effect/index.js +1 -1
- package/hooks/create-update-effect/index.js +1 -1
- package/hooks/create-use-storage-state/index.js +1 -1
- package/hooks/index.js +1 -1
- package/hooks/use-async-effect/index.js +1 -1
- package/hooks/use-boolean/index.js +1 -1
- package/hooks/use-click-away/index.js +1 -1
- package/hooks/use-computed-state/index.js +1 -1
- package/hooks/use-controllable-value/index.js +1 -1
- package/hooks/use-cookie-state/index.js +1 -1
- package/hooks/use-count-down/index.js +1 -1
- package/hooks/use-counter/index.js +1 -1
- package/hooks/use-create/index.js +1 -1
- package/hooks/use-creation/index.js +1 -1
- package/hooks/use-debounce/index.js +1 -1
- package/hooks/use-debounce-effect/index.js +1 -1
- package/hooks/use-debounce-fn/index.js +1 -1
- package/hooks/use-deep-compare-effect/index.js +1 -1
- package/hooks/use-deep-compare-layout-effect/index.js +1 -1
- package/hooks/use-document-visibility/index.js +1 -1
- package/hooks/use-drag/index.js +1 -1
- package/hooks/use-drag-move/index.js +1 -1
- package/hooks/use-drop/index.js +1 -1
- package/hooks/use-effect-event/index.js +1 -1
- package/hooks/use-event/index.js +1 -1
- package/hooks/use-event-emitter/index.js +1 -1
- package/hooks/use-event-listener/index.js +1 -1
- package/hooks/use-event-target/index.js +1 -1
- package/hooks/use-external/index.js +1 -1
- package/hooks/use-favicon/index.js +1 -1
- package/hooks/use-focus-within/index.js +1 -1
- package/hooks/use-force-update/index.js +1 -1
- package/hooks/use-fullscreen/index.js +1 -1
- package/hooks/use-get-state/index.js +1 -1
- package/hooks/use-history-travel/index.js +1 -1
- package/hooks/use-hover/index.js +1 -1
- package/hooks/use-id/index.js +1 -1
- package/hooks/use-in-viewport/index.js +1 -1
- package/hooks/use-infinite-scroll/index.js +1 -1
- package/hooks/use-intersection-observer/index.js +1 -1
- package/hooks/use-intersection-observers/index.js +1 -1
- package/hooks/use-interval/index.js +1 -1
- package/hooks/use-is-first-render/index.js +1 -1
- package/hooks/use-isomorphic-layout-effect/index.js +1 -1
- package/hooks/use-key-press/index.js +1 -1
- package/hooks/use-keyboard-event/index.js +1 -1
- package/hooks/use-latest/index.js +1 -1
- package/hooks/use-listen-window-resize/index.js +1 -1
- package/hooks/use-local-storage-state/index.js +1 -1
- package/hooks/use-lock-fn/index.js +1 -1
- package/hooks/use-long-press/index.js +1 -1
- package/hooks/use-map/index.js +1 -1
- package/hooks/use-media/index.js +1 -1
- package/hooks/use-memo/index.js +1 -1
- package/hooks/use-memoized-fn/index.js +1 -1
- package/hooks/use-merge-component-props/index.js +1 -1
- package/hooks/use-merge-value/index.js +1 -1
- package/hooks/use-mobile/index.js +1 -1
- package/hooks/use-mount/index.js +1 -1
- package/hooks/use-mouse/index.js +1 -1
- package/hooks/use-mutation-observer/index.js +1 -1
- package/hooks/use-mutation-observers/index.js +1 -1
- package/hooks/use-network/index.js +1 -1
- package/hooks/use-online-status/index.js +1 -1
- package/hooks/use-overflow-hidden/index.js +1 -1
- package/hooks/use-override-ref/index.js +1 -1
- package/hooks/use-pagination/index.js +1 -1
- package/hooks/use-paste-file/index.js +1 -1
- package/hooks/use-paste-image/index.js +1 -1
- package/hooks/use-persist-callback/index.js +1 -1
- package/hooks/use-prefers-color-scheme-dark/index.js +1 -1
- package/hooks/use-previous/index.js +1 -1
- package/hooks/use-raf-interval/index.js +1 -1
- package/hooks/use-raf-state/index.js +1 -1
- package/hooks/use-raf-timeout/index.js +1 -1
- package/hooks/use-reactive/index.js +1 -1
- package/hooks/use-ref-latest/index.js +1 -1
- package/hooks/use-ref-map/index.js +1 -1
- package/hooks/use-refs/index.js +1 -1
- package/hooks/use-request/index.js +1 -1
- package/hooks/use-request/src/Fetch.js +1 -1
- package/hooks/use-request/src/plugins/useAutoRunPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useCachePlugin.js +1 -1
- package/hooks/use-request/src/plugins/useDebouncePlugin.js +1 -1
- package/hooks/use-request/src/plugins/useLoadingDelayPlugin.js +1 -1
- package/hooks/use-request/src/plugins/usePollingPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useRefreshOnWindowFocusPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useRetryPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useThrottlePlugin.js +1 -1
- package/hooks/use-request/src/useRequest.js +1 -1
- package/hooks/use-request/src/useRequestImplement.js +1 -1
- package/hooks/use-request/src/utils/cache.js +1 -1
- package/hooks/use-request/src/utils/cachePromise.js +1 -1
- package/hooks/use-request/src/utils/cacheSubscribe.js +1 -1
- package/hooks/use-request/src/utils/isDocumentVisible.js +1 -1
- package/hooks/use-request/src/utils/isOnline.js +1 -1
- package/hooks/use-request/src/utils/limit.js +1 -1
- package/hooks/use-request/src/utils/subscribeFocus.js +1 -1
- package/hooks/use-request/src/utils/subscribeReVisible.js +1 -1
- package/hooks/use-reset-state/index.js +1 -1
- package/hooks/use-resize-observer/index.js +1 -1
- package/hooks/use-resize-observers/index.js +1 -1
- package/hooks/use-responsive/index.js +1 -1
- package/hooks/use-safe-state/index.js +1 -1
- package/hooks/use-scroll/index.js +1 -1
- package/hooks/use-selections/index.js +1 -1
- package/hooks/use-session-storage-state/index.js +1 -1
- package/hooks/use-set/index.js +1 -1
- package/hooks/use-set-state/index.js +1 -1
- package/hooks/use-size/index.js +1 -1
- package/hooks/use-state-callback/index.js +1 -1
- package/hooks/use-state-with-promise/index.js +1 -1
- package/hooks/use-sync-state/index.js +1 -1
- package/hooks/use-text-selection/index.js +1 -1
- package/hooks/use-theme/index.js +1 -1
- package/hooks/use-throttle/index.js +1 -1
- package/hooks/use-throttle-effect/index.js +1 -1
- package/hooks/use-throttle-fn/index.js +1 -1
- package/hooks/use-throttle-fn-with-raf/index.js +1 -1
- package/hooks/use-timeout/index.js +1 -1
- package/hooks/use-title/index.js +1 -1
- package/hooks/use-toggle/index.js +1 -1
- package/hooks/use-tracked-effect/index.js +1 -1
- package/hooks/use-unmount/index.js +1 -1
- package/hooks/use-unmounted-ref/index.js +1 -1
- package/hooks/use-update/index.js +1 -1
- package/hooks/use-update-effect/index.js +1 -1
- package/hooks/use-update-layout-effect/index.js +1 -1
- package/hooks/use-url-state/index.js +1 -1
- package/hooks/use-virtual-list/index.js +1 -1
- package/hooks/use-watch/index.js +1 -1
- package/hooks/use-web-socket/index.js +1 -1
- package/hooks/use-why-did-you-update/index.js +1 -1
- package/hooks/use-window-size/index.js +1 -1
- package/hooks/utils/createEffectWithTarget.js +1 -1
- package/hooks/utils/depsAreSame.js +1 -1
- package/hooks/utils/depsEqual.js +1 -1
- package/hooks/utils/domTarget.js +1 -1
- package/hooks/utils/getDocumentOrShadow.js +1 -1
- package/hooks/utils/index.js +1 -1
- package/hooks/utils/isAppleDevice.js +1 -1
- package/hooks/utils/isBrowser.js +1 -1
- package/hooks/utils/isDev.js +1 -1
- package/hooks/utils/rect.js +1 -1
- package/hooks/utils/useDeepCompareWithTarget.js +1 -1
- package/hooks/utils/useEffectWithTarget.js +1 -1
- package/hooks/utils/useIsomorphicLayoutEffectWithTarget.js +1 -1
- package/hooks/utils/useLayoutEffectWithTarget.js +1 -1
- package/icons/file/File.js +1 -1
- package/icons/file/context.js +1 -1
- package/icons/file/index.js +1 -1
- package/icons/file/style/index.js +1 -1
- package/index.js +1 -1
- package/morphicons/core/interpolate.js +1 -1
- package/morphicons/core/normalize.js +72 -71
- package/morphicons/core/resample.js +1 -1
- package/morphicons/core/serialize.js +1 -1
- package/morphicons/core/spring.js +1 -1
- package/morphicons/dom/index.js +61 -60
- package/morphicons/index.js +1 -1
- package/morphicons/react/index.js +15 -14
- package/package.json +1 -1
- package/progress/Progress.js +1 -1
- package/progress/constants.js +1 -1
- package/progress/context.js +1 -1
- package/progress/index.js +1 -1
- package/progress/style/index.js +1 -1
- package/progress/utils.js +1 -1
- package/resize-observer/Collection.js +1 -1
- package/resize-observer/ResizeObserver.js +1 -1
- package/resize-observer/SingleObserver.js +1 -1
- package/resize-observer/constants.js +1 -1
- package/resize-observer/context.js +1 -1
- package/resize-observer/index.js +1 -1
- package/resize-observer/observerUtil.js +1 -1
- package/resize-observer/style/index.js +1 -1
- package/resize-observer/utils.js +1 -1
- package/space/Space.js +1 -1
- package/space/SpaceVertical.js +1 -1
- package/space/constants.js +1 -1
- package/space/context.js +1 -1
- package/space/index.js +1 -1
- package/space/style/index.js +1 -1
- package/space/utils.js +1 -1
- package/suspense-fallback-test/SuspenseFallbackTest.js +1 -1
- package/suspense-fallback-test/constants.js +1 -1
- package/suspense-fallback-test/context.js +1 -1
- package/suspense-fallback-test/index.js +1 -1
- package/suspense-fallback-test/style/index.js +1 -1
- package/suspense-fallback-test/utils.js +1 -1
- package/test.js +1 -1
- package/timer/Timer.js +1 -1
- package/timer/constants.js +1 -1
- package/timer/context.js +1 -1
- package/timer/index.js +1 -1
- package/timer/style/index.js +1 -1
- package/timer/utils.js +1 -1
- package/transition/Transition.js +1 -1
- package/transition/TransitionCSS.js +1 -1
- package/transition/TransitionGroup.js +1 -1
- package/transition/TransitionStyle.js +1 -1
- package/transition/constants.js +1 -1
- package/transition/context.js +1 -1
- package/transition/index.js +1 -1
- package/transition/style/index.js +1 -1
- package/transition/utils.js +1 -1
- package/utils/callbackOriginRef.js +1 -1
- package/utils/confetti.js +1 -1
- package/utils/constants.js +1 -1
- package/utils/copy.js +1 -1
- package/utils/createRoot.js +1 -1
- package/utils/css.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/document.js +1 -1
- package/utils/dom.js +1 -1
- package/utils/file.js +1 -1
- package/utils/fillNBSP.js +1 -1
- package/utils/getCompatProp.js +1 -1
- package/utils/getElement.js +1 -1
- package/utils/getHighlightText.js +1 -1
- package/utils/getHotkeyHandler.js +1 -1
- package/utils/getPrefixCls.js +1 -1
- package/utils/getScrollBarHeight.js +1 -1
- package/utils/getScrollBarSize.js +1 -1
- package/utils/getScrollBarWidth.js +1 -1
- package/utils/getScrollParent.js +1 -1
- package/utils/getStringLength.js +1 -1
- package/utils/getUrlSearchParam.js +1 -1
- package/utils/index.js +1 -1
- package/utils/initAllLineClamp.js +1 -1
- package/utils/injectLineClamp.js +1 -1
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.js +1 -1
- package/utils/keyboardCode.js +1 -1
- package/utils/lodash.js +1 -1
- package/utils/mergeProps.js +1 -1
- package/utils/mergedToString.js +1 -1
- package/utils/migrateLegacyProps.js +1 -1
- package/utils/mutationObserver.js +1 -1
- package/utils/names.js +1 -1
- package/utils/object.js +1 -1
- package/utils/omit.js +1 -1
- package/utils/pad.js +1 -1
- package/utils/pick.js +1 -1
- package/utils/react19Adapter.js +1 -1
- package/utils/reactNode.js +1 -1
- package/utils/ref.js +1 -1
- package/utils/resizeObserver.js +1 -1
- package/utils/scrollIntoViewIfNeeded.js +1 -1
- package/utils/scrollTo.js +1 -1
- package/utils/setDarkTheme.js +1 -1
- package/utils/setDir.js +1 -1
- package/utils/setPrimaryColor.js +1 -1
- package/utils/setTheme.js +1 -1
- package/utils/string.js +1 -1
- package/utils/style.js +1 -1
- package/utils/tinycolor.js +1 -1
- package/utils/toArray.js +1 -1
- package/utils/tunnel.js +1 -1
- package/utils/warning.js +1 -1
- package/version/index.js +7 -6
- /package/{base → suspense-fallback-test}/style/index.css +0 -0
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-04 17:31:58 星期三 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { parsePath as e } from "./parse.js";
|
|
4
4
|
import { cubicsToPathD as t } from "./serialize.js";
|
|
5
|
+
import { isNumber as n, isString as r, isUndefined as i } from "@unicom-cloud/utils/is";
|
|
5
6
|
// components/common/morphicons/core/normalize.ts
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
let n = [e, t],
|
|
9
|
-
n.push(e, t,
|
|
7
|
+
var a = 4 / 3 * Math.tan(Math.PI / 8), o = 2 * Math.PI;
|
|
8
|
+
function s(e, t) {
|
|
9
|
+
let n = [e, t], r = e, i = t, a = (e, t, a, o, s, c) => {
|
|
10
|
+
n.push(e, t, a, o, s, c), r = s, i = c;
|
|
10
11
|
}, s = (e, t) => {
|
|
11
|
-
Math.abs(e -
|
|
12
|
+
Math.abs(e - r) < 1e-12 && Math.abs(t - i) < 1e-12 || a(r + (e - r) / 3, i + (t - i) / 3, r + 2 * (e - r) / 3, i + 2 * (t - i) / 3, e, t);
|
|
12
13
|
};
|
|
13
14
|
return [
|
|
14
|
-
|
|
15
|
+
a,
|
|
15
16
|
s,
|
|
16
|
-
(e, t, n,
|
|
17
|
-
|
|
17
|
+
(e, t, n, o) => {
|
|
18
|
+
a(r + 2 / 3 * (e - r), i + 2 / 3 * (t - i), n + 2 / 3 * (e - n), o + 2 / 3 * (t - o), n, o);
|
|
18
19
|
},
|
|
19
20
|
(e, t, n, c, l, u, d) => {
|
|
20
|
-
let f =
|
|
21
|
+
let f = r, p = i;
|
|
21
22
|
if (Math.abs(u - f) < 1e-12 && Math.abs(d - p) < 1e-12) return;
|
|
22
23
|
let m = Math.abs(e), h = Math.abs(t);
|
|
23
24
|
if (m < 1e-12 || h < 1e-12) {
|
|
@@ -32,11 +33,11 @@ function i(e, t) {
|
|
|
32
33
|
let w = m * m, T = h * h, E = x * x, D = S * S, O = (w * T - w * D - T * E) / (w * D + T * E);
|
|
33
34
|
O < 0 && (O = 0);
|
|
34
35
|
let k = (c === l ? -1 : 1) * Math.sqrt(O), A = k * m * S / h, j = -k * h * x / m, M = _ * A - v * j + (f + u) / 2, N = v * A + _ * j + (p + d) / 2, P = Math.atan2((S - j) / h, (x - A) / m), F = Math.atan2((-S - j) / h, (-x - A) / m) - P;
|
|
35
|
-
l === 0 && F > 0 ? F -=
|
|
36
|
+
l === 0 && F > 0 ? F -= o : l === 1 && F < 0 && (F += o);
|
|
36
37
|
let I = Math.max(1, Math.ceil(Math.abs(F) / (Math.PI / 2) - 1e-9)), L = F / I, R = 4 / 3 * Math.tan(L / 4), z = (e) => M + m * Math.cos(e) * _ - h * Math.sin(e) * v, B = (e) => N + m * Math.cos(e) * v + h * Math.sin(e) * _, V = (e) => -m * Math.sin(e) * _ - h * Math.cos(e) * v, H = (e) => -m * Math.sin(e) * v + h * Math.cos(e) * _, U = P, W = f, G = p;
|
|
37
38
|
for (let e = 1; e <= I; e++) {
|
|
38
39
|
let t = P + L * e, n = e === I ? u : z(t), r = e === I ? d : B(t);
|
|
39
|
-
|
|
40
|
+
a(W + R * V(U), G + R * H(U), n - R * V(t), r - R * H(t), n, r), U = t, W = n, G = r;
|
|
40
41
|
}
|
|
41
42
|
},
|
|
42
43
|
(e) => (e && s(n[0], n[1]), n.length < 8 ? null : {
|
|
@@ -45,121 +46,121 @@ function i(e, t) {
|
|
|
45
46
|
})
|
|
46
47
|
];
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
-
let [t, n, r,
|
|
50
|
-
for (let
|
|
49
|
+
function c(e) {
|
|
50
|
+
let [t, n, r, i, a] = s(e.x0, e.y0);
|
|
51
|
+
for (let a of e.segs) switch (a[0]) {
|
|
51
52
|
case "L":
|
|
52
|
-
n(
|
|
53
|
+
n(a[1], a[2]);
|
|
53
54
|
break;
|
|
54
55
|
case "C":
|
|
55
|
-
t(
|
|
56
|
+
t(a[1], a[2], a[3], a[4], a[5], a[6]);
|
|
56
57
|
break;
|
|
57
58
|
case "Q":
|
|
58
|
-
r(
|
|
59
|
+
r(a[1], a[2], a[3], a[4]);
|
|
59
60
|
break;
|
|
60
|
-
case "A": a
|
|
61
|
+
case "A": i(a[1], a[2], a[3], a[4], a[5], a[6], a[7]);
|
|
61
62
|
}
|
|
62
|
-
return
|
|
63
|
+
return a(e.closed);
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
-
let
|
|
66
|
-
if (
|
|
67
|
-
let
|
|
68
|
-
return Number.isFinite(
|
|
65
|
+
function l(e, t, r = 0) {
|
|
66
|
+
let a = e[t];
|
|
67
|
+
if (i(a)) return r;
|
|
68
|
+
let o = n(a) ? a : Number(a);
|
|
69
|
+
return Number.isFinite(o) ? o : r;
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
+
function u(e) {
|
|
71
72
|
let t = String(e ?? "").trim();
|
|
72
73
|
if (!t) return [];
|
|
73
74
|
let n = t.split(/[\s,]+/).map(Number);
|
|
74
75
|
if (n.some((e) => !Number.isFinite(e))) throw Error(`morphicons: invalid points: "${t}"`);
|
|
75
76
|
return n;
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
+
function d(e, t) {
|
|
78
79
|
if (e.length < 4) return null;
|
|
79
|
-
let [, n, , , r] =
|
|
80
|
+
let [, n, , , r] = s(e[0], e[1]);
|
|
80
81
|
for (let t = 2; t + 1 < e.length; t += 2) n(e[t], e[t + 1]);
|
|
81
82
|
return r(t);
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
if (
|
|
85
|
-
let
|
|
86
|
-
return f(c, t +
|
|
84
|
+
function f(e, t, n, r) {
|
|
85
|
+
if (n < 1e-12 || r < 1e-12) return null;
|
|
86
|
+
let i = a * n, o = a * r, c = e + n, l = e - n, u = t + r, d = t - r, [f, , , , p] = s(c, t);
|
|
87
|
+
return f(c, t + o, e + i, u, e, u), f(e - i, u, l, t + o, l, t), f(l, t - o, e - i, d, e, d), f(e + i, d, c, t - o, c, t), p(!0);
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
-
let t =
|
|
90
|
-
if (
|
|
91
|
-
let
|
|
92
|
-
if (Number.isNaN(
|
|
89
|
+
function p(e) {
|
|
90
|
+
let t = l(e, "x"), n = l(e, "y"), r = l(e, "width"), i = l(e, "height");
|
|
91
|
+
if (r < 1e-12 || i < 1e-12) return null;
|
|
92
|
+
let o = l(e, "rx", NaN), c = l(e, "ry", NaN);
|
|
93
|
+
if (Number.isNaN(o) && (o = Number.isNaN(c) ? 0 : c), Number.isNaN(c) && (c = o), o = Math.min(Math.max(o, 0), r / 2), c = Math.min(Math.max(c, 0), i / 2), o < 1e-12 || c < 1e-12) return d([
|
|
93
94
|
t,
|
|
94
|
-
|
|
95
|
-
t +
|
|
96
|
-
|
|
97
|
-
t +
|
|
98
|
-
|
|
95
|
+
n,
|
|
96
|
+
t + r,
|
|
97
|
+
n,
|
|
98
|
+
t + r,
|
|
99
|
+
n + i,
|
|
99
100
|
t,
|
|
100
|
-
|
|
101
|
+
n + i
|
|
101
102
|
], !0);
|
|
102
|
-
let
|
|
103
|
-
return b(f,
|
|
103
|
+
let u = t + o, f = t + r - o, p = t + r, m = n + c, h = n + i - c, g = n + i, _ = a * o, v = a * c, [y, b, , , x] = s(u, n);
|
|
104
|
+
return b(f, n), y(f + _, n, p, m - v, p, m), b(p, h), y(p, h + v, f + _, g, f, g), b(u, g), y(u - _, g, t, h + v, t, h), b(t, m), y(t, m - v, u - _, n, u, n), x(!0);
|
|
104
105
|
}
|
|
105
|
-
function
|
|
106
|
-
let n = [],
|
|
106
|
+
function m(t) {
|
|
107
|
+
let n = [], i = (e) => {
|
|
107
108
|
e && n.push(e);
|
|
108
109
|
};
|
|
109
|
-
if (
|
|
110
|
-
for (let n of e(t))
|
|
110
|
+
if (r(t)) {
|
|
111
|
+
for (let n of e(t)) i(c(n));
|
|
111
112
|
return n;
|
|
112
113
|
}
|
|
113
|
-
for (let [n,
|
|
114
|
+
for (let [n, r] of t) switch (n) {
|
|
114
115
|
case "path":
|
|
115
|
-
for (let t of e(String(
|
|
116
|
+
for (let t of e(String(r.d ?? ""))) i(c(t));
|
|
116
117
|
break;
|
|
117
118
|
case "line": {
|
|
118
|
-
let [, e, , , t] =
|
|
119
|
-
e(
|
|
119
|
+
let [, e, , , t] = s(l(r, "x1"), l(r, "y1"));
|
|
120
|
+
e(l(r, "x2"), l(r, "y2")), i(t(!1));
|
|
120
121
|
break;
|
|
121
122
|
}
|
|
122
123
|
case "circle": {
|
|
123
|
-
let e =
|
|
124
|
-
|
|
124
|
+
let e = l(r, "r");
|
|
125
|
+
i(f(l(r, "cx"), l(r, "cy"), e, e));
|
|
125
126
|
break;
|
|
126
127
|
}
|
|
127
128
|
case "ellipse":
|
|
128
|
-
|
|
129
|
+
i(f(l(r, "cx"), l(r, "cy"), l(r, "rx"), l(r, "ry")));
|
|
129
130
|
break;
|
|
130
131
|
case "rect":
|
|
131
|
-
|
|
132
|
+
i(p(r));
|
|
132
133
|
break;
|
|
133
134
|
case "polyline":
|
|
134
|
-
|
|
135
|
+
i(d(u(r.points), !1));
|
|
135
136
|
break;
|
|
136
137
|
case "polygon":
|
|
137
|
-
|
|
138
|
+
i(d(u(r.points), !0));
|
|
138
139
|
break;
|
|
139
140
|
default: throw Error(`morphicons: unsupported tag <${n}>`);
|
|
140
141
|
}
|
|
141
142
|
return n;
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
-
let t =
|
|
144
|
+
function h(e) {
|
|
145
|
+
let t = n(e) ? [
|
|
145
146
|
0,
|
|
146
147
|
0,
|
|
147
148
|
e,
|
|
148
149
|
e
|
|
149
|
-
] :
|
|
150
|
-
if (t.length !== 4 || !(
|
|
150
|
+
] : r(e) ? e.trim().split(/[\s,]+/).map(Number) : e, [i, a, o, s] = t;
|
|
151
|
+
if (t.length !== 4 || !(o > 0) || !(s > 0) || !Number.isFinite(i) || !Number.isFinite(a)) throw Error(`morphicons: invalid viewBox "${String(e)}"`);
|
|
151
152
|
return [
|
|
152
|
-
n,
|
|
153
|
-
r,
|
|
154
153
|
i,
|
|
155
|
-
a
|
|
154
|
+
a,
|
|
155
|
+
o,
|
|
156
|
+
s
|
|
156
157
|
];
|
|
157
158
|
}
|
|
158
|
-
function
|
|
159
|
-
let [i, a, o, s] =
|
|
160
|
-
for (let { pts: e } of
|
|
161
|
-
return t(
|
|
159
|
+
function g(e, n, r = 24) {
|
|
160
|
+
let [i, a, o, s] = h(n), c = Math.min(r / o, r / s), l = (r - o * c) / 2 - i * c, u = (r - s * c) / 2 - a * c, d = m(e);
|
|
161
|
+
for (let { pts: e } of d) for (let t = 0; t < e.length; t += 2) e[t] = e[t] * c + l, e[t + 1] = e[t + 1] * c + u;
|
|
162
|
+
return t(d);
|
|
162
163
|
}
|
|
163
|
-
export {
|
|
164
|
+
export { a as KAPPA, g as fitIcon, m as iconToCubics };
|
|
164
165
|
/* 欲穷千里目,更上一层楼 */
|
|
165
166
|
/* 独立思考,明辨是非 */
|
package/morphicons/dom/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-04 17:31:58 星期三 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { allocOutputs as e, interpPolar as t } from "../core/interpolate.js";
|
|
4
4
|
import { cubicsToPathD as n, serialize as r } from "../core/serialize.js";
|
|
@@ -6,93 +6,94 @@ import { iconToCubics as i } from "../core/normalize.js";
|
|
|
6
6
|
import { buildPlan as a } from "../core/plan.js";
|
|
7
7
|
import { resampleIcon as o } from "../core/resample.js";
|
|
8
8
|
import { SPRING_PRESETS as s, Spring as c } from "../core/spring.js";
|
|
9
|
+
import { isString as l, isUndefined as u } from "@unicom-cloud/utils/is";
|
|
9
10
|
// components/common/morphicons/dom/index.ts
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let t =
|
|
13
|
-
|
|
14
|
-
for (let e of [...
|
|
15
|
-
|
|
11
|
+
var d = /* @__PURE__ */ new Set(), f = 0, p = -1;
|
|
12
|
+
function m(e) {
|
|
13
|
+
let t = p < 0 ? 0 : Math.min(Math.max((e - p) / 1e3, 0), .1);
|
|
14
|
+
p = e;
|
|
15
|
+
for (let e of [...d]) e(t);
|
|
16
|
+
d.size > 0 ? f = requestAnimationFrame(m) : (f = 0, p = -1);
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
18
|
+
function h(e) {
|
|
19
|
+
d.add(e), f === 0 && (p = -1, f = requestAnimationFrame(m));
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
|
|
21
|
+
function g(e) {
|
|
22
|
+
d.delete(e), d.size === 0 && f !== 0 && (cancelAnimationFrame(f), f = 0, p = -1);
|
|
22
23
|
}
|
|
23
|
-
var
|
|
24
|
-
function
|
|
25
|
-
if (
|
|
26
|
-
let t =
|
|
27
|
-
return t || (t = o(e),
|
|
24
|
+
var _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap();
|
|
25
|
+
function b(e) {
|
|
26
|
+
if (l(e)) return o(e);
|
|
27
|
+
let t = _.get(e);
|
|
28
|
+
return t || (t = o(e), _.set(e, t)), t;
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
-
if (
|
|
31
|
-
let t =
|
|
32
|
-
return t || (t = n(i(e)),
|
|
30
|
+
function x(e) {
|
|
31
|
+
if (l(e)) return e;
|
|
32
|
+
let t = v.get(e);
|
|
33
|
+
return t || (t = n(i(e)), v.set(e, t)), t;
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
if (
|
|
36
|
-
let n =
|
|
37
|
-
n || (n = /* @__PURE__ */ new WeakMap(),
|
|
35
|
+
function S(e, t) {
|
|
36
|
+
if (l(e) || l(t)) return a(b(e), b(t));
|
|
37
|
+
let n = y.get(e);
|
|
38
|
+
n || (n = /* @__PURE__ */ new WeakMap(), y.set(e, n));
|
|
38
39
|
let r = n.get(t);
|
|
39
|
-
return r || (r = a(
|
|
40
|
+
return r || (r = a(b(e), b(t)), n.set(t, r)), r;
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
if (
|
|
42
|
+
function C(e) {
|
|
43
|
+
if (l(e)) return s[e];
|
|
43
44
|
let t = s.snappy;
|
|
44
45
|
return {
|
|
45
46
|
k: e?.stiffness ?? t.k,
|
|
46
47
|
c: e?.damping ?? t.c
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
-
let s = new c(), l = o?.reducedMotion ?? "never",
|
|
51
|
-
n.setAttribute("d",
|
|
52
|
-
let
|
|
53
|
-
let i =
|
|
54
|
-
i && a && o && (
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
},
|
|
50
|
+
function w(n, i, o) {
|
|
51
|
+
let s = new c(), l = o?.reducedMotion ?? "never", d = i, f = !0, p = null, m = null, _ = null, v = 1, y = !1, w = !1;
|
|
52
|
+
n.setAttribute("d", x(i));
|
|
53
|
+
let T = (e) => {
|
|
54
|
+
let i = p, a = m, o = _;
|
|
55
|
+
i && a && o && (v = e, t(i, e, a), n.setAttribute("d", r(a, o)));
|
|
56
|
+
}, E = () => {
|
|
57
|
+
y && (y = !1, g(D));
|
|
58
|
+
}, D = (e) => {
|
|
58
59
|
let t = s.step(e);
|
|
59
|
-
|
|
60
|
-
}, D = () => {
|
|
61
|
-
d = !0, f = null, h = null, g = null, _ = 1, s.x = 1, s.v = 0, n.setAttribute("d", y(u));
|
|
60
|
+
T(s.x), t && (E(), O());
|
|
62
61
|
}, O = () => {
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
f = !0, p = null, m = null, _ = null, v = 1, s.x = 1, s.v = 0, n.setAttribute("d", x(d));
|
|
63
|
+
}, k = () => {
|
|
64
|
+
let e = p, t = m;
|
|
65
|
+
return f || !e || !t ? b(d) : t.map((t, n) => ({
|
|
65
66
|
pts: Float64Array.from(t),
|
|
66
67
|
closed: e.items[n].closed
|
|
67
68
|
}));
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
if (
|
|
74
|
-
let n = !
|
|
75
|
-
|
|
69
|
+
}, A = (t) => {
|
|
70
|
+
p = f ? S(d, t) : a(k(), b(t)), m = e(p), _ = p.items.map((e) => e.closed), d = t, f = !1;
|
|
71
|
+
}, j = (e) => {
|
|
72
|
+
E(), d = e, O();
|
|
73
|
+
}, M = () => l === "always" ? !0 : l !== "user" || u(matchMedia) ? !1 : matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1, N = (e, t) => {
|
|
74
|
+
if (w) return;
|
|
75
|
+
let n = !f && p !== null && e === d;
|
|
76
|
+
E(), s.v = 0, n || A(e), T(t);
|
|
76
77
|
};
|
|
77
78
|
return {
|
|
78
79
|
morphTo(e, t) {
|
|
79
|
-
if (
|
|
80
|
-
if (
|
|
81
|
-
|
|
80
|
+
if (w || e === d && (f || y)) return;
|
|
81
|
+
if (M()) {
|
|
82
|
+
j(e);
|
|
82
83
|
return;
|
|
83
84
|
}
|
|
84
|
-
let { k: n, c: r } =
|
|
85
|
-
s.config(n, r),
|
|
85
|
+
let { k: n, c: r } = C(t);
|
|
86
|
+
s.config(n, r), A(e), s.start(), y || (y = !0, h(D));
|
|
86
87
|
},
|
|
87
88
|
set(e) {
|
|
88
|
-
|
|
89
|
+
w || j(e);
|
|
89
90
|
},
|
|
90
|
-
seek:
|
|
91
|
+
seek: N,
|
|
91
92
|
get progress() {
|
|
92
|
-
return
|
|
93
|
+
return f ? 1 : v;
|
|
93
94
|
},
|
|
94
95
|
set progress(e) {
|
|
95
|
-
|
|
96
|
+
w || N(d, e);
|
|
96
97
|
},
|
|
97
98
|
get reducedMotion() {
|
|
98
99
|
return l;
|
|
@@ -101,10 +102,10 @@ function S(n, i, o) {
|
|
|
101
102
|
l = e;
|
|
102
103
|
},
|
|
103
104
|
destroy() {
|
|
104
|
-
|
|
105
|
+
E(), w = !0, p = null, m = null, _ = null;
|
|
105
106
|
}
|
|
106
107
|
};
|
|
107
108
|
}
|
|
108
|
-
export {
|
|
109
|
+
export { x as canonicalD, w as createMorph };
|
|
109
110
|
/* 欲穷千里目,更上一层楼 */
|
|
110
111
|
/* 独立思考,明辨是非 */
|
package/morphicons/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-04 17:31:58 星期三 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { allocOutputs as e, interpLinear as t, interpPolar as n } from "./core/interpolate.js";
|
|
4
4
|
import { cubicsToPathD as r, serialize as i } from "./core/serialize.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-04 17:31:58 星期三 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { allocOutputs as e, interpPolar as t } from "../core/interpolate.js";
|
|
4
4
|
import { serialize as n } from "../core/serialize.js";
|
|
@@ -6,26 +6,27 @@ import { buildPlan as r } from "../core/plan.js";
|
|
|
6
6
|
import { resampleIcon as i } from "../core/resample.js";
|
|
7
7
|
import { canonicalD as a, createMorph as o } from "../dom/index.js";
|
|
8
8
|
import { forwardRef as s, useCallback as c, useEffect as l, useImperativeHandle as u, useLayoutEffect as d, useRef as f, useState as p } from "react";
|
|
9
|
-
import {
|
|
9
|
+
import { isUndefined as m } from "@unicom-cloud/utils/is";
|
|
10
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
10
11
|
// components/common/morphicons/react/index.tsx
|
|
11
|
-
var
|
|
12
|
-
function
|
|
12
|
+
var _ = m(document) ? l : d;
|
|
13
|
+
function v(o, s, c) {
|
|
13
14
|
if (c <= 0) return a(o);
|
|
14
15
|
if (c >= 1) return a(s);
|
|
15
16
|
let l = r(i(o), i(s)), u = e(l);
|
|
16
17
|
return t(l, c, u), n(u, l.items.map((e) => e.closed));
|
|
17
18
|
}
|
|
18
|
-
var
|
|
19
|
-
let { icon: n, from: r, to: i, progress: s, spring: d, reducedMotion:
|
|
19
|
+
var y = s(function(e, t) {
|
|
20
|
+
let { icon: n, from: r, to: i, progress: s, spring: d, reducedMotion: m, size: y = 24, color: b = "currentColor", strokeWidth: x = 2, absoluteStrokeWidth: S, label: C, ...w } = e, T = r !== void 0 && i !== void 0, E = n ?? r ?? i, [D] = p(() => T ? v(r, i, s ?? 0) : E === void 0 ? "" : a(E)), O = f(null), k = f(null), A = f(d);
|
|
20
21
|
A.current = d;
|
|
21
|
-
let j = f(
|
|
22
|
-
j.current =
|
|
22
|
+
let j = f(m);
|
|
23
|
+
j.current = m;
|
|
23
24
|
let M = f(n), N = f(T), P = f(!1), F = f(!1), I = f(null), L = c((e) => {
|
|
24
25
|
if (k.current) return k.current;
|
|
25
26
|
let t = O.current;
|
|
26
27
|
return P.current || !t ? null : (k.current = o(t, e, { reducedMotion: j.current }), k.current);
|
|
27
28
|
}, []);
|
|
28
|
-
|
|
29
|
+
_(() => {
|
|
29
30
|
P.current = !1;
|
|
30
31
|
let e = O.current;
|
|
31
32
|
if (e && E !== void 0) {
|
|
@@ -41,8 +42,8 @@ var v = s(function(e, t) {
|
|
|
41
42
|
};
|
|
42
43
|
}, []), l(() => {
|
|
43
44
|
let e = k.current;
|
|
44
|
-
e && (e.reducedMotion =
|
|
45
|
-
}, [
|
|
45
|
+
e && (e.reducedMotion = m ?? "never");
|
|
46
|
+
}, [m]), l(() => {
|
|
46
47
|
let e = N.current && !T;
|
|
47
48
|
N.current = T;
|
|
48
49
|
let t = n !== M.current;
|
|
@@ -79,7 +80,7 @@ var v = s(function(e, t) {
|
|
|
79
80
|
}
|
|
80
81
|
}), [L]);
|
|
81
82
|
let R = S ? Number(x) * 24 / Number(y) : x;
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ g("svg", {
|
|
83
84
|
xmlns: "http://www.w3.org/2000/svg",
|
|
84
85
|
width: y,
|
|
85
86
|
height: y,
|
|
@@ -92,12 +93,12 @@ var v = s(function(e, t) {
|
|
|
92
93
|
role: C ? "img" : void 0,
|
|
93
94
|
"aria-hidden": !C || void 0,
|
|
94
95
|
...w,
|
|
95
|
-
children: [C ? /* @__PURE__ */
|
|
96
|
+
children: [C ? /* @__PURE__ */ h("title", { children: C }) : null, /* @__PURE__ */ h("path", {
|
|
96
97
|
ref: O,
|
|
97
98
|
d: D
|
|
98
99
|
})]
|
|
99
100
|
});
|
|
100
101
|
});
|
|
101
|
-
export {
|
|
102
|
+
export { y as MorphIcon };
|
|
102
103
|
/* 欲穷千里目,更上一层楼 */
|
|
103
104
|
/* 独立思考,明辨是非 */
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unicom-cloud/ui-common","version":"0.1.
|
|
1
|
+
{"name":"@unicom-cloud/ui-common","version":"0.1.58","dependencies":{"@unicom-cloud/utils":"^0.1.0","@unicom-cloud/icons":"^0.1.0","react-compiler-runtime":"^1.0.0"},"peerDependencies":{"dayjs":"^1.11.23","lodash":"^4.18.1","react":"^18.3.1","react-dom":"^18.3.1","react-is":"^18.3.1"},"type":"module","types":"./index.d.ts","main":"./index.js","bin":{"ui":"./test.js"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
|
package/progress/Progress.js
CHANGED
package/progress/constants.js
CHANGED
package/progress/context.js
CHANGED
package/progress/index.js
CHANGED
package/progress/style/index.js
CHANGED
package/progress/utils.js
CHANGED
package/resize-observer/index.js
CHANGED
package/resize-observer/utils.js
CHANGED