@snowui-design-system/components 0.3.0-alpha.1 → 0.3.0-alpha.3
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/AGENTS.md +21 -0
- package/LICENSE +133 -89
- package/README.md +21 -7
- package/component-catalog.json +505 -84
- package/dist/client/blocks/Sidebar.js +75 -46
- package/dist/client/blocks/SidebarSection.js +3 -1
- package/dist/client/blocks/index.js +2 -0
- package/dist/client/compat.js +2 -0
- package/dist/client/components/BarChart.js +1 -1
- package/dist/client/components/Breadcrumb.js +17 -11
- package/dist/client/components/CircularChart.js +2 -2
- package/dist/client/components/CodeBlock.js +278 -225
- package/dist/client/components/CopyButton.js +5 -2
- package/dist/client/components/ExpandButton.js +10 -3
- package/dist/client/components/Frame.js +15 -9
- package/dist/client/components/GaugeChart.js +2 -2
- package/dist/client/components/ImageViewer.js +51 -27
- package/dist/client/components/Indicator.js +5 -3
- package/dist/client/components/Input.js +27 -17
- package/dist/client/components/LineChart.js +1 -1
- package/dist/client/components/Link.d.ts +1 -1
- package/dist/client/components/Link.js +43 -22
- package/dist/client/components/Listbox.js +26 -15
- package/dist/client/components/OverflowAction.d.ts +2 -0
- package/dist/client/components/OverflowAction.js +146 -65
- package/dist/client/components/OverflowActions.d.ts +2 -0
- package/dist/client/components/OverflowActions.js +67 -16
- package/dist/client/components/Pagination.js +71 -48
- package/dist/client/components/Select.js +29 -18
- package/dist/client/components/SidePanel.js +76 -50
- package/dist/client/components/Tab.js +30 -31
- package/dist/client/components/TableBody.js +10 -4
- package/dist/client/components/TableCell.js +57 -32
- package/dist/client/components/TableHead.js +69 -38
- package/dist/client/components/TableToolbar.js +112 -79
- package/dist/client/components/Text.js +103 -47
- package/dist/client/components/Textarea.js +7 -1
- package/dist/client/components/Toast.js +8 -1
- package/dist/client/components/Tooltip.js +200 -195
- package/dist/client/context.js +2 -0
- package/dist/client/dev.js +2 -0
- package/dist/client/i18n/messages.d.ts +2 -2
- package/dist/client/i18n/messages.js +117 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +3 -1
- package/dist/client/internal/code-block/prettier-svelte.d.ts +2 -0
- package/dist/client/internal/component-icon/index.js +2 -0
- package/dist/client/internal/snow-ui-logo/emoji-metrics.js +2 -0
- package/dist/client/keys.js +2 -0
- package/dist/client/lib/adaptive-contrast-renderer.js +2 -0
- package/dist/client/lib/chart/appearance-timeline.js +2 -0
- package/dist/client/lib/chart/arc-path.js +2 -0
- package/dist/client/lib/chart/colors.js +2 -0
- package/dist/client/lib/chart/size.js +2 -0
- package/dist/client/lib/clipboard.js +2 -0
- package/dist/client/lib/color.js +2 -0
- package/dist/client/lib/date-format.js +2 -0
- package/dist/client/lib/edge-fade.js +2 -0
- package/dist/client/lib/number-format.js +8 -0
- package/dist/client/lib/overflow-actions-motion.js +2 -0
- package/dist/client/lib/overlay-trigger-timing.js +2 -0
- package/dist/client/lib/progressive-blur.d.ts +13 -0
- package/dist/client/lib/progressive-blur.js +54 -0
- package/dist/client/lib/responsive-exit.js +2 -0
- package/dist/client/lib/search-filter.js +2 -0
- package/dist/client/lib/side-panel.js +2 -0
- package/dist/client/lib/split-pane.js +2 -0
- package/dist/client/lib/table-column-motion.js +2 -0
- package/dist/client/lib/table-responsive.js +2 -0
- package/dist/client/lib/table-selection-fade.js +2 -0
- package/dist/client/lib/table-truncation.js +2 -0
- package/dist/client/lib/text-motion/animation.js +2 -0
- package/dist/client/lib/text-motion/character.js +2 -0
- package/dist/client/lib/text-motion/color.js +2 -0
- package/dist/client/lib/text-motion/layout.js +2 -0
- package/dist/client/lib/text-motion/preference.js +2 -0
- package/dist/client/lib/text-motion/sequence.js +2 -0
- package/dist/client/lib/text-motion/typography.js +2 -0
- package/dist/client/lib/tooltip-delay.js +2 -0
- package/dist/client/lib/tooltip-motion-dismiss.js +2 -0
- package/dist/client/lib/tooltip-pointer-speed.js +2 -0
- package/dist/client/lib/truncate.js +2 -0
- package/dist/client/logic/ComponentPartsBoundary.d.ts +7 -0
- package/dist/client/logic/ComponentPartsBoundary.js +15 -0
- package/dist/client/logic/frame-field-control.js +2 -0
- package/dist/client/logic/frame-motion-defaults.js +2 -0
- package/dist/client/logic/frame-prop-filter.js +2 -0
- package/dist/client/logic/geometry-cache.js +2 -0
- package/dist/client/logic/layout-flip.js +2 -0
- package/dist/client/logic/morph.js +2 -0
- package/dist/client/logic/motion-engine.js +2 -0
- package/dist/client/logic/motion-orchestration.js +2 -0
- package/dist/client/logic/motion-types.js +2 -0
- package/dist/client/logic/overflow-actions.d.ts +3 -2
- package/dist/client/logic/wc-adapter.js +2 -0
- package/dist/client/motion/bridge.js +2 -0
- package/dist/client/motion/content-crossfade.js +2 -0
- package/dist/client/motion/expand.js +2 -0
- package/dist/client/motion/fade-in.js +2 -0
- package/dist/client/motion/fade-out.js +2 -0
- package/dist/client/motion/morph.js +2 -0
- package/dist/client/motion/move.js +2 -0
- package/dist/client/motion/number.js +2 -0
- package/dist/client/motion/replace.js +2 -0
- package/dist/client/motion/rotate.css +2 -0
- package/dist/client/motion/rotate.js +2 -0
- package/dist/client/motion/scale-in.js +2 -0
- package/dist/client/motion/tokens.js +2 -0
- package/dist/client/motion/while-2xl.js +2 -0
- package/dist/client/motion/while-active.js +2 -0
- package/dist/client/motion/while-appear.js +2 -0
- package/dist/client/motion/while-click.js +2 -0
- package/dist/client/motion/while-collapsed.js +2 -0
- package/dist/client/motion/while-disabled.js +2 -0
- package/dist/client/motion/while-disappear.js +2 -0
- package/dist/client/motion/while-drag.js +2 -0
- package/dist/client/motion/while-editing.js +2 -0
- package/dist/client/motion/while-expanded.js +2 -0
- package/dist/client/motion/while-focus.js +2 -0
- package/dist/client/motion/while-hover.js +2 -0
- package/dist/client/motion/while-idle.js +2 -0
- package/dist/client/motion/while-key.js +2 -0
- package/dist/client/motion/while-lg.js +2 -0
- package/dist/client/motion/while-load.js +2 -0
- package/dist/client/motion/while-md.js +2 -0
- package/dist/client/motion/while-reload.js +2 -0
- package/dist/client/motion/while-scroll.js +2 -0
- package/dist/client/motion/while-sm.js +2 -0
- package/dist/client/motion/while-uploading.js +2 -0
- package/dist/client/motion/while-validating.js +2 -0
- package/dist/client/motion/while-xl.js +2 -0
- package/dist/client/motion/while-xs.js +2 -0
- package/dist/client/styles/auto-layout.css +3 -1
- package/dist/client/styles/backdrop.css +2 -0
- package/dist/client/styles/components.css +6 -4
- package/dist/client/styles/index.css +2 -0
- package/dist/client/styles/layout.css +20 -4
- package/dist/client/styles/scale.css +2 -0
- package/dist/client/styles/scrollbar.css +3 -1
- package/dist/client/styles/tokens.css +2 -0
- package/dist/client/vite-env.d.ts +2 -0
- package/dist/server/blocks/Sidebar.js +41 -21
- package/dist/server/blocks/SidebarSection.js +3 -1
- package/dist/server/blocks/index.js +2 -0
- package/dist/server/compat.js +2 -0
- package/dist/server/components/BarChart.js +1 -1
- package/dist/server/components/Breadcrumb.js +9 -2
- package/dist/server/components/CircularChart.js +2 -2
- package/dist/server/components/CodeBlock.js +25 -13
- package/dist/server/components/CopyButton.js +6 -2
- package/dist/server/components/ExpandButton.js +7 -3
- package/dist/server/components/Frame.js +10 -3
- package/dist/server/components/GaugeChart.js +2 -2
- package/dist/server/components/ImageViewer.js +6 -3
- package/dist/server/components/Indicator.js +5 -3
- package/dist/server/components/Input.js +14 -17
- package/dist/server/components/LineChart.js +1 -1
- package/dist/server/components/Link.d.ts +1 -1
- package/dist/server/components/Link.js +20 -3
- package/dist/server/components/Listbox.js +17 -4
- package/dist/server/components/OverflowAction.d.ts +2 -0
- package/dist/server/components/OverflowAction.js +70 -26
- package/dist/server/components/OverflowActions.d.ts +2 -0
- package/dist/server/components/OverflowActions.js +49 -14
- package/dist/server/components/Pagination.js +21 -10
- package/dist/server/components/Select.js +23 -11
- package/dist/server/components/SidePanel.js +28 -8
- package/dist/server/components/Tab.js +61 -52
- package/dist/server/components/TableBody.js +9 -2
- package/dist/server/components/TableCell.js +28 -7
- package/dist/server/components/TableHead.js +31 -7
- package/dist/server/components/TableToolbar.js +57 -30
- package/dist/server/components/Text.js +52 -12
- package/dist/server/components/Textarea.js +4 -1
- package/dist/server/components/Toast.js +4 -1
- package/dist/server/components/Tooltip.js +10 -10
- package/dist/server/context.js +2 -0
- package/dist/server/dev.js +2 -0
- package/dist/server/i18n/messages.d.ts +2 -2
- package/dist/server/i18n/messages.js +117 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +3 -1
- package/dist/server/internal/code-block/prettier-svelte.d.ts +2 -0
- package/dist/server/internal/component-icon/index.js +2 -0
- package/dist/server/internal/snow-ui-logo/emoji-metrics.js +2 -0
- package/dist/server/keys.js +2 -0
- package/dist/server/lib/adaptive-contrast-renderer.js +2 -0
- package/dist/server/lib/chart/appearance-timeline.js +2 -0
- package/dist/server/lib/chart/arc-path.js +2 -0
- package/dist/server/lib/chart/colors.js +2 -0
- package/dist/server/lib/chart/size.js +2 -0
- package/dist/server/lib/clipboard.js +2 -0
- package/dist/server/lib/color.js +2 -0
- package/dist/server/lib/date-format.js +2 -0
- package/dist/server/lib/edge-fade.js +2 -0
- package/dist/server/lib/number-format.js +8 -0
- package/dist/server/lib/overflow-actions-motion.js +2 -0
- package/dist/server/lib/overlay-trigger-timing.js +2 -0
- package/dist/server/lib/progressive-blur.d.ts +13 -0
- package/dist/server/lib/progressive-blur.js +54 -0
- package/dist/server/lib/responsive-exit.js +2 -0
- package/dist/server/lib/search-filter.js +2 -0
- package/dist/server/lib/side-panel.js +2 -0
- package/dist/server/lib/split-pane.js +2 -0
- package/dist/server/lib/table-column-motion.js +2 -0
- package/dist/server/lib/table-responsive.js +2 -0
- package/dist/server/lib/table-selection-fade.js +2 -0
- package/dist/server/lib/table-truncation.js +2 -0
- package/dist/server/lib/text-motion/animation.js +2 -0
- package/dist/server/lib/text-motion/character.js +2 -0
- package/dist/server/lib/text-motion/color.js +2 -0
- package/dist/server/lib/text-motion/layout.js +2 -0
- package/dist/server/lib/text-motion/preference.js +2 -0
- package/dist/server/lib/text-motion/sequence.js +2 -0
- package/dist/server/lib/text-motion/typography.js +2 -0
- package/dist/server/lib/tooltip-delay.js +2 -0
- package/dist/server/lib/tooltip-motion-dismiss.js +2 -0
- package/dist/server/lib/tooltip-pointer-speed.js +2 -0
- package/dist/server/lib/truncate.js +2 -0
- package/dist/server/logic/ComponentPartsBoundary.d.ts +7 -0
- package/dist/server/logic/ComponentPartsBoundary.js +12 -0
- package/dist/server/logic/frame-field-control.js +2 -0
- package/dist/server/logic/frame-motion-defaults.js +2 -0
- package/dist/server/logic/frame-prop-filter.js +2 -0
- package/dist/server/logic/geometry-cache.js +2 -0
- package/dist/server/logic/layout-flip.js +2 -0
- package/dist/server/logic/morph.js +2 -0
- package/dist/server/logic/motion-engine.js +2 -0
- package/dist/server/logic/motion-orchestration.js +2 -0
- package/dist/server/logic/motion-types.js +2 -0
- package/dist/server/logic/overflow-actions.d.ts +3 -2
- package/dist/server/logic/wc-adapter.js +2 -0
- package/dist/server/motion/bridge.js +2 -0
- package/dist/server/motion/content-crossfade.js +2 -0
- package/dist/server/motion/expand.js +2 -0
- package/dist/server/motion/fade-in.js +2 -0
- package/dist/server/motion/fade-out.js +2 -0
- package/dist/server/motion/morph.js +2 -0
- package/dist/server/motion/move.js +2 -0
- package/dist/server/motion/number.js +2 -0
- package/dist/server/motion/replace.js +2 -0
- package/dist/server/motion/rotate.css +2 -0
- package/dist/server/motion/rotate.js +2 -0
- package/dist/server/motion/scale-in.js +2 -0
- package/dist/server/motion/tokens.js +2 -0
- package/dist/server/motion/while-2xl.js +2 -0
- package/dist/server/motion/while-active.js +2 -0
- package/dist/server/motion/while-appear.js +2 -0
- package/dist/server/motion/while-click.js +2 -0
- package/dist/server/motion/while-collapsed.js +2 -0
- package/dist/server/motion/while-disabled.js +2 -0
- package/dist/server/motion/while-disappear.js +2 -0
- package/dist/server/motion/while-drag.js +2 -0
- package/dist/server/motion/while-editing.js +2 -0
- package/dist/server/motion/while-expanded.js +2 -0
- package/dist/server/motion/while-focus.js +2 -0
- package/dist/server/motion/while-hover.js +2 -0
- package/dist/server/motion/while-idle.js +2 -0
- package/dist/server/motion/while-key.js +2 -0
- package/dist/server/motion/while-lg.js +2 -0
- package/dist/server/motion/while-load.js +2 -0
- package/dist/server/motion/while-md.js +2 -0
- package/dist/server/motion/while-reload.js +2 -0
- package/dist/server/motion/while-scroll.js +2 -0
- package/dist/server/motion/while-sm.js +2 -0
- package/dist/server/motion/while-uploading.js +2 -0
- package/dist/server/motion/while-validating.js +2 -0
- package/dist/server/motion/while-xl.js +2 -0
- package/dist/server/motion/while-xs.js +2 -0
- package/dist/server/styles/auto-layout.css +3 -1
- package/dist/server/styles/backdrop.css +2 -0
- package/dist/server/styles/components.css +6 -4
- package/dist/server/styles/index.css +2 -0
- package/dist/server/styles/layout.css +20 -4
- package/dist/server/styles/scale.css +2 -0
- package/dist/server/styles/scrollbar.css +3 -1
- package/dist/server/styles/tokens.css +2 -0
- package/dist/server/vite-env.d.ts +2 -0
- package/llms.txt +5 -0
- package/package.json +14 -6
|
@@ -4,6 +4,7 @@ import Frame from "./Frame.js";
|
|
|
4
4
|
import Button from "./Button.js";
|
|
5
5
|
import Tooltip from "./Tooltip.js";
|
|
6
6
|
import { ComponentIcon } from "../internal/component-icon/index.js";
|
|
7
|
+
import ComponentPartsBoundary from "../logic/ComponentPartsBoundary.js";
|
|
7
8
|
import { fitTextToElement } from "../lib/truncate.js";
|
|
8
9
|
import { TextTruncation } from "../logic/frame-truncation.js";
|
|
9
10
|
import { collapse, findConstraintHost } from "../logic/text-collapse.js";
|
|
@@ -17,6 +18,7 @@ import {
|
|
|
17
18
|
import { resolveParentStateValue } from "../logic/frame-state-value.js";
|
|
18
19
|
import { useOverlayScrollbar } from "../lib/overlay-scrollbar.js";
|
|
19
20
|
import { resizeManager } from "../logic/observer.js";
|
|
21
|
+
import { useLocale } from "../i18n/locale.js";
|
|
20
22
|
|
|
21
23
|
const $$css = {
|
|
22
24
|
hash: 'svelte-4twshh',
|
|
@@ -28,6 +30,8 @@ export default function Text($$renderer, $$props) {
|
|
|
28
30
|
|
|
29
31
|
$$renderer.component(($$renderer) => {
|
|
30
32
|
// SnowUI 许可入口:首次阅读源码请先读 ../../LICENSE;访问文件不代表获得修改或移植权,官方维护授权及同任务去重见该文件。
|
|
33
|
+
const localeContext = useLocale();
|
|
34
|
+
|
|
31
35
|
const isTooltipConfigObject = (value) => {
|
|
32
36
|
return typeof value === "object" && value !== null && typeof value !== "function";
|
|
33
37
|
};
|
|
@@ -51,7 +55,7 @@ export default function Text($$renderer, $$props) {
|
|
|
51
55
|
renderHints: userRenderHints = undefined,
|
|
52
56
|
element = void 0,
|
|
53
57
|
parts = undefined,
|
|
54
|
-
children,
|
|
58
|
+
children: textChildren,
|
|
55
59
|
$$slots,
|
|
56
60
|
$$events,
|
|
57
61
|
...rest
|
|
@@ -414,10 +418,18 @@ export default function Text($$renderer, $$props) {
|
|
|
414
418
|
let $$inner_renderer;
|
|
415
419
|
|
|
416
420
|
function $$render_inner($$renderer) {
|
|
417
|
-
if (shouldAnalyzeSkeleton() &&
|
|
421
|
+
if (shouldAnalyzeSkeleton() && textChildren) {
|
|
418
422
|
$$renderer.push('<!--[0-->');
|
|
419
423
|
$$renderer.push(`<div aria-hidden="true" style="display: none;">`);
|
|
420
|
-
|
|
424
|
+
|
|
425
|
+
ComponentPartsBoundary($$renderer, {
|
|
426
|
+
children: ($$renderer) => {
|
|
427
|
+
textChildren($$renderer, { breakpoint: "md" });
|
|
428
|
+
$$renderer.push(`<!---->`);
|
|
429
|
+
},
|
|
430
|
+
$$slots: { default: true }
|
|
431
|
+
});
|
|
432
|
+
|
|
421
433
|
$$renderer.push(`<!----></div>`);
|
|
422
434
|
} else {
|
|
423
435
|
$$renderer.push('<!--[-1-->');
|
|
@@ -437,9 +449,16 @@ export default function Text($$renderer, $$props) {
|
|
|
437
449
|
if (resolvedStateText() !== undefined) {
|
|
438
450
|
$$renderer.push('<!--[0-->');
|
|
439
451
|
$$renderer.push(`${$.escape(resolvedStateText())}`);
|
|
440
|
-
} else if (
|
|
452
|
+
} else if (textChildren) {
|
|
441
453
|
$$renderer.push('<!--[1-->');
|
|
442
|
-
|
|
454
|
+
|
|
455
|
+
ComponentPartsBoundary($$renderer, {
|
|
456
|
+
children: ($$renderer) => {
|
|
457
|
+
textChildren($$renderer, { breakpoint });
|
|
458
|
+
$$renderer.push(`<!---->`);
|
|
459
|
+
},
|
|
460
|
+
$$slots: { default: true }
|
|
461
|
+
});
|
|
443
462
|
} else {
|
|
444
463
|
$$renderer.push('<!--[-1-->');
|
|
445
464
|
}
|
|
@@ -454,7 +473,7 @@ export default function Text($$renderer, $$props) {
|
|
|
454
473
|
{
|
|
455
474
|
as: 'more',
|
|
456
475
|
iconOnly: true,
|
|
457
|
-
'aria-label':
|
|
476
|
+
'aria-label': localeContext.t("text.expand"),
|
|
458
477
|
backgroundBlur: true,
|
|
459
478
|
class: 'snowui-text-built-in-more',
|
|
460
479
|
children: ($$renderer) => {
|
|
@@ -484,9 +503,16 @@ export default function Text($$renderer, $$props) {
|
|
|
484
503
|
if (resolvedStateText() !== undefined) {
|
|
485
504
|
$$renderer.push('<!--[0-->');
|
|
486
505
|
$$renderer.push(`${$.escape(resolvedStateText())}`);
|
|
487
|
-
} else if (
|
|
506
|
+
} else if (textChildren) {
|
|
488
507
|
$$renderer.push('<!--[1-->');
|
|
489
|
-
|
|
508
|
+
|
|
509
|
+
ComponentPartsBoundary($$renderer, {
|
|
510
|
+
children: ($$renderer) => {
|
|
511
|
+
textChildren($$renderer, { breakpoint });
|
|
512
|
+
$$renderer.push(`<!---->`);
|
|
513
|
+
},
|
|
514
|
+
$$slots: { default: true }
|
|
515
|
+
});
|
|
490
516
|
} else {
|
|
491
517
|
$$renderer.push('<!--[-1-->');
|
|
492
518
|
}
|
|
@@ -508,9 +534,16 @@ export default function Text($$renderer, $$props) {
|
|
|
508
534
|
if (resolvedStateText() !== undefined) {
|
|
509
535
|
$$renderer.push('<!--[0-->');
|
|
510
536
|
$$renderer.push(`${$.escape(resolvedStateText())}`);
|
|
511
|
-
} else if (
|
|
537
|
+
} else if (textChildren) {
|
|
512
538
|
$$renderer.push('<!--[1-->');
|
|
513
|
-
|
|
539
|
+
|
|
540
|
+
ComponentPartsBoundary($$renderer, {
|
|
541
|
+
children: ($$renderer) => {
|
|
542
|
+
textChildren($$renderer, { breakpoint });
|
|
543
|
+
$$renderer.push(`<!---->`);
|
|
544
|
+
},
|
|
545
|
+
$$slots: { default: true }
|
|
546
|
+
});
|
|
514
547
|
} else {
|
|
515
548
|
$$renderer.push('<!--[-1-->');
|
|
516
549
|
}
|
|
@@ -519,9 +552,16 @@ export default function Text($$renderer, $$props) {
|
|
|
519
552
|
} else if (resolvedStateText() !== undefined) {
|
|
520
553
|
$$renderer.push('<!--[3-->');
|
|
521
554
|
$$renderer.push(`${$.escape(resolvedStateText())}`);
|
|
522
|
-
} else if (
|
|
555
|
+
} else if (textChildren) {
|
|
523
556
|
$$renderer.push('<!--[4-->');
|
|
524
|
-
|
|
557
|
+
|
|
558
|
+
ComponentPartsBoundary($$renderer, {
|
|
559
|
+
children: ($$renderer) => {
|
|
560
|
+
textChildren($$renderer, { breakpoint });
|
|
561
|
+
$$renderer.push(`<!---->`);
|
|
562
|
+
},
|
|
563
|
+
$$slots: { default: true }
|
|
564
|
+
});
|
|
525
565
|
} else {
|
|
526
566
|
$$renderer.push('<!--[-1-->');
|
|
527
567
|
}
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import { resizeManager } from "../logic/observer.js";
|
|
13
13
|
import { splitFrameHostProps } from "../logic/frame-prop-filter.js";
|
|
14
14
|
import { useOverlayScrollbar } from "../lib/overlay-scrollbar.js";
|
|
15
|
+
import { useLocale } from "../i18n/locale.js";
|
|
15
16
|
|
|
16
17
|
const $$css = {
|
|
17
18
|
hash: 'svelte-1w1i9eu',
|
|
@@ -23,6 +24,8 @@ export default function Textarea($$renderer, $$props) {
|
|
|
23
24
|
|
|
24
25
|
$$renderer.component(($$renderer) => {
|
|
25
26
|
// SnowUI 许可入口:首次阅读源码请先读 ../../LICENSE;访问文件不代表获得修改或移植权,官方维护授权及同任务去重见该文件。
|
|
27
|
+
const localeContext = useLocale();
|
|
28
|
+
|
|
26
29
|
let {
|
|
27
30
|
value = void 0,
|
|
28
31
|
defaultValue = undefined,
|
|
@@ -277,7 +280,7 @@ export default function Textarea($$renderer, $$props) {
|
|
|
277
280
|
minWidth: 120,
|
|
278
281
|
minHeight: 60,
|
|
279
282
|
applySize: false,
|
|
280
|
-
ariaLabel:
|
|
283
|
+
ariaLabel: localeContext.t("textarea.resize"),
|
|
281
284
|
onSizeChange: handleIndicatorSize
|
|
282
285
|
});
|
|
283
286
|
} else {
|
|
@@ -4,6 +4,7 @@ import { onMount, onDestroy } from "svelte";
|
|
|
4
4
|
import { Frame } from "../index.js";
|
|
5
5
|
import { GENERIC_SCALE_APPEAR_MOTION } from "../motion/presets/generic.js";
|
|
6
6
|
import { ComponentIcon } from "../internal/component-icon/index.js";
|
|
7
|
+
import { useLocale } from "../i18n/locale.js";
|
|
7
8
|
import { registerToastTemplate, unregisterToastTemplate, showToast } from "../logic/toast.js";
|
|
8
9
|
import { mergeComponentPartProps, useComponentPart } from "../logic/component-parts.js";
|
|
9
10
|
|
|
@@ -17,6 +18,8 @@ export default function Toast($$renderer, $$props) {
|
|
|
17
18
|
|
|
18
19
|
$$renderer.component(($$renderer) => {
|
|
19
20
|
// SnowUI 许可入口:首次阅读源码请先读 ../../LICENSE;访问文件不代表获得修改或移植权,官方维护授权及同任务去重见该文件。
|
|
21
|
+
const localeContext = useLocale();
|
|
22
|
+
|
|
20
23
|
/** 内置图标按钮配置;事件与角色由所属组件控制。 */
|
|
21
24
|
/** 模版模式 id;配合 template=true 后可通过 showToast(id) 触发;Inline 模式自动生成 */
|
|
22
25
|
/** 模版模式:只注册为命令式 Toast 模板,不直接渲染 */
|
|
@@ -194,7 +197,7 @@ export default function Toast($$renderer, $$props) {
|
|
|
194
197
|
{
|
|
195
198
|
type: 'button',
|
|
196
199
|
class: `snowui-clear-icon-btn snowui-toast-close-btn${parts()?.Button?.class ? ` ${parts().Button.class}` : ""}`,
|
|
197
|
-
'aria-label':
|
|
200
|
+
'aria-label': localeContext.t("toast.close"),
|
|
198
201
|
onclick: () => onDismiss()?.(),
|
|
199
202
|
onmousedown: (e) => e.preventDefault(),
|
|
200
203
|
tabindex: -1,
|
|
@@ -1160,7 +1160,7 @@ export default function Tooltip($$renderer, $$props) {
|
|
|
1160
1160
|
enableDefaultMotion: false,
|
|
1161
1161
|
enableScaleObserver: false,
|
|
1162
1162
|
use: [portal],
|
|
1163
|
-
loopMotion: renderedOverlay
|
|
1163
|
+
loopMotion: renderedOverlay?.loopMotion,
|
|
1164
1164
|
class: 'snowui-tooltip-portal',
|
|
1165
1165
|
style: portalStyle(),
|
|
1166
1166
|
'data-ready': portalReady,
|
|
@@ -1174,7 +1174,7 @@ export default function Tooltip($$renderer, $$props) {
|
|
|
1174
1174
|
},
|
|
1175
1175
|
|
|
1176
1176
|
children: ($$renderer) => {
|
|
1177
|
-
$$renderer.push(`<div class="snowui-tooltip-motion-shell"${$.attr('data-move-mode', moveMode)}${$.attr('data-switch-phase', switchPhase)}${$.attr('data-retargeting', switchRetargeting)}${$.attr('data-rapid-retarget', renderedOverlay
|
|
1177
|
+
$$renderer.push(`<div class="snowui-tooltip-motion-shell"${$.attr('data-move-mode', moveMode)}${$.attr('data-switch-phase', switchPhase)}${$.attr('data-retargeting', switchRetargeting)}${$.attr('data-rapid-retarget', renderedOverlay?.rapidRetarget)}${$.attr('data-shell-duration', switchShellDurationMs)}${$.attr('data-width-duration', switchWidthDurationMs)}${$.attr('data-width-rebound', renderedOverlay?.widthRebound)}${$.attr('data-content-duration', switchContentDurationMs)}${$.attr('data-shell-distance', switchShellDistancePx)}${$.attr('data-content-distance', switchContentDistancePx)}${$.attr('data-content-speed-profile', switchContentSpeedProfile)}${$.attr_style(motionShellStyle())}>`);
|
|
1178
1178
|
|
|
1179
1179
|
Frame($$renderer, $.spread_props([
|
|
1180
1180
|
{
|
|
@@ -1182,21 +1182,21 @@ export default function Tooltip($$renderer, $$props) {
|
|
|
1182
1182
|
enableContext: false,
|
|
1183
1183
|
enableScaleObserver: false,
|
|
1184
1184
|
whileActive: effectiveSizeMotion(),
|
|
1185
|
-
'data-variant': renderedOverlay
|
|
1185
|
+
'data-variant': renderedOverlay?.variant,
|
|
1186
1186
|
'data-size-motion': sizeMotionEnabled && animatedShellSize === undefined,
|
|
1187
1187
|
class: [
|
|
1188
1188
|
"snowui-tooltip-content",
|
|
1189
1189
|
"snowui-tooltip-size-shell",
|
|
1190
1190
|
"snowui-rounded-rectangle",
|
|
1191
1191
|
`snowui-tooltip-pos-${finalPosition}`,
|
|
1192
|
-
renderedOverlay
|
|
1192
|
+
renderedOverlay?.className
|
|
1193
1193
|
].filter(Boolean).join(" "),
|
|
1194
|
-
style: [sizeShellStyle(), renderedOverlay
|
|
1194
|
+
style: [sizeShellStyle(), renderedOverlay?.style].filter(Boolean).join("; "),
|
|
1195
1195
|
role: 'tooltip',
|
|
1196
1196
|
onmouseenter: retainOverlay,
|
|
1197
1197
|
onmouseleave: releaseOverlay
|
|
1198
1198
|
},
|
|
1199
|
-
renderedOverlay
|
|
1199
|
+
renderedOverlay?.rest,
|
|
1200
1200
|
{
|
|
1201
1201
|
get element() {
|
|
1202
1202
|
return sizeShellRef;
|
|
@@ -1243,13 +1243,13 @@ export default function Tooltip($$renderer, $$props) {
|
|
|
1243
1243
|
|
|
1244
1244
|
$$renderer.push(`<!--]--> <span class="snowui-tooltip-content-layer" data-tooltip-layer="incoming"${$.attr('data-move-mode', moveMode)}${$.attr('data-layer-ready', incomingLayerReady)}${$.attr_style(incomingLayerStyle())}><span class="snowui-tooltip-inner">`);
|
|
1245
1245
|
|
|
1246
|
-
if (renderedOverlay
|
|
1246
|
+
if (renderedOverlay?.children) {
|
|
1247
1247
|
$$renderer.push('<!--[0-->');
|
|
1248
|
-
renderedOverlay
|
|
1248
|
+
renderedOverlay?.children?.($$renderer);
|
|
1249
1249
|
$$renderer.push(`<!---->`);
|
|
1250
|
-
} else if (renderedOverlay
|
|
1250
|
+
} else if (renderedOverlay?.fallbackContent) {
|
|
1251
1251
|
$$renderer.push('<!--[1-->');
|
|
1252
|
-
$$renderer.push(`${$.escape(renderedOverlay
|
|
1252
|
+
$$renderer.push(`${$.escape(renderedOverlay?.fallbackContent)}`);
|
|
1253
1253
|
} else {
|
|
1254
1254
|
$$renderer.push('<!--[-1-->');
|
|
1255
1255
|
}
|
package/dist/server/context.js
CHANGED
package/dist/server/dev.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* SnowUI source notice | LICENSE 2.2.0: ../LICENSE
|
|
3
|
+
复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
|
|
2
4
|
// Dev entry — use `playground/` for component development
|
|
3
5
|
// Run: cd ../playground && pnpm dev
|
|
4
6
|
document.getElementById("app").innerHTML =
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** SnowUI 组件内置 UI 文案 catalog。文档: ../../../specs/LocalizationSpec.md */
|
|
1
|
+
/** SnowUI 组件内置 UI 文案 catalog。文档: ../../../specs/maintainers/LocalizationSpec.md */
|
|
2
2
|
export declare const DEFAULT_LOCALE = "zh-CN";
|
|
3
|
-
export type SnowUIMessageKey = "colorSchemeButton.toLight" | "colorSchemeButton.toDark" | "styleButton.toSnowUI" | "styleButton.toApple" | "sidePanel.placement.toInline" | "sidePanel.placement.toFloating" | "sidePanel.previous" | "sidePanel.next" | "sidePanel.copy" | "sidePanel.delete" | "sidePanel.cancel" | "sidePanel.save" | "sidePanel.close" | "dialog.close";
|
|
3
|
+
export type SnowUIMessageKey = "copyButton.copy" | "copyButton.copied" | "codeBlock.copyCode" | "codeBlock.fullscreen" | "codeBlock.exitFullscreen" | "codeBlock.resize" | "codeBlock.fullscreenDialog" | "expandButton.expand" | "expandButton.collapse" | "sidebar.resize" | "pagination.pageSize" | "pagination.previous" | "pagination.next" | "pagination.page" | "input.clear" | "input.increment" | "input.decrement" | "input.openTime" | "input.openDate" | "input.year" | "input.month" | "input.day" | "input.week" | "input.hour" | "input.minute" | "input.second" | "input.yearPlaceholder" | "input.monthPlaceholder" | "input.dayPlaceholder" | "input.weekPlaceholder" | "imageViewer.previous" | "imageViewer.next" | "imageViewer.close" | "toast.close" | "tableHead.selectAll" | "tableHead.resizeColumn" | "tableCell.selectRow" | "text.expand" | "textarea.resize" | "indicator.resizeWidth" | "indicator.resizeHeight" | "indicator.resizeBoth" | "colorSchemeButton.toLight" | "colorSchemeButton.toDark" | "styleButton.toSnowUI" | "styleButton.toApple" | "sidePanel.placement.toInline" | "sidePanel.placement.toFloating" | "sidePanel.previous" | "sidePanel.next" | "sidePanel.copy" | "sidePanel.delete" | "sidePanel.cancel" | "sidePanel.save" | "sidePanel.close" | "sidePanel.resize" | "tableToolbar.name" | "tableToolbar.search" | "tableToolbar.sort" | "tableToolbar.filter" | "tableToolbar.clear" | "tableToolbar.copy" | "tableToolbar.delete" | "tableToolbar.selected" | "tableToolbar.deleting" | "tableToolbar.defaultSort" | "tableToolbar.ascending" | "tableToolbar.descending" | "tableToolbar.defaultFilter" | "overflowActions.more" | "dialog.close";
|
|
4
4
|
export type SnowUIMessageValues = Record<string, string | number>;
|
|
5
5
|
export type SnowUIMessageOverrides = Partial<Record<SnowUIMessageKey, string>>;
|
|
6
6
|
export declare const SNOWUI_MESSAGES: Record<string, Record<SnowUIMessageKey, string>>;
|
|
@@ -1,7 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
/* SnowUI source notice | LICENSE 2.2.0: ../../../LICENSE
|
|
2
|
+
复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
|
|
3
|
+
/** SnowUI 组件内置 UI 文案 catalog。文档: ../../../specs/maintainers/LocalizationSpec.md */
|
|
2
4
|
export const DEFAULT_LOCALE = "zh-CN";
|
|
3
5
|
export const SNOWUI_MESSAGES = {
|
|
4
6
|
"zh-CN": {
|
|
7
|
+
"copyButton.copy": "复制",
|
|
8
|
+
"copyButton.copied": "已复制",
|
|
9
|
+
"codeBlock.copyCode": "复制代码",
|
|
10
|
+
"codeBlock.fullscreen": "全屏查看",
|
|
11
|
+
"codeBlock.exitFullscreen": "退出全屏",
|
|
12
|
+
"codeBlock.resize": "调整代码块宽度和高度",
|
|
13
|
+
"codeBlock.fullscreenDialog": "全屏代码查看",
|
|
14
|
+
"expandButton.expand": "展开",
|
|
15
|
+
"expandButton.collapse": "收起",
|
|
16
|
+
"sidebar.resize": "调整侧边栏宽度",
|
|
17
|
+
"pagination.pageSize": "每页条数",
|
|
18
|
+
"pagination.previous": "上一页",
|
|
19
|
+
"pagination.next": "下一页",
|
|
20
|
+
"pagination.page": "第 {{page}} 页",
|
|
21
|
+
"input.clear": "清除输入",
|
|
22
|
+
"input.increment": "增加数值",
|
|
23
|
+
"input.decrement": "减少数值",
|
|
24
|
+
"input.openTime": "打开时间选择",
|
|
25
|
+
"input.openDate": "打开日期选择",
|
|
26
|
+
"input.year": "年",
|
|
27
|
+
"input.month": "月",
|
|
28
|
+
"input.day": "日",
|
|
29
|
+
"input.week": "周",
|
|
30
|
+
"input.hour": "时",
|
|
31
|
+
"input.minute": "分",
|
|
32
|
+
"input.second": "秒",
|
|
33
|
+
"input.yearPlaceholder": "年",
|
|
34
|
+
"input.monthPlaceholder": "月",
|
|
35
|
+
"input.dayPlaceholder": "日",
|
|
36
|
+
"input.weekPlaceholder": "周",
|
|
37
|
+
"imageViewer.previous": "上一张",
|
|
38
|
+
"imageViewer.next": "下一张",
|
|
39
|
+
"imageViewer.close": "关闭图片预览",
|
|
40
|
+
"toast.close": "关闭通知",
|
|
41
|
+
"tableHead.selectAll": "选择全部当前行",
|
|
42
|
+
"tableHead.resizeColumn": "调整 {{column}} 列宽",
|
|
43
|
+
"tableCell.selectRow": "选择当前行",
|
|
44
|
+
"text.expand": "展开",
|
|
45
|
+
"textarea.resize": "调整文本域大小",
|
|
46
|
+
"indicator.resizeWidth": "调整宽度",
|
|
47
|
+
"indicator.resizeHeight": "调整高度",
|
|
48
|
+
"indicator.resizeBoth": "调整宽度和高度",
|
|
5
49
|
"colorSchemeButton.toLight": "切换到亮色",
|
|
6
50
|
"colorSchemeButton.toDark": "切换到暗色",
|
|
7
51
|
"styleButton.toSnowUI": "切换到 SnowUI 风格",
|
|
@@ -15,9 +59,66 @@ export const SNOWUI_MESSAGES = {
|
|
|
15
59
|
"sidePanel.cancel": "取消",
|
|
16
60
|
"sidePanel.save": "保存",
|
|
17
61
|
"sidePanel.close": "关闭",
|
|
62
|
+
"sidePanel.resize": "调整弹出窗宽度",
|
|
63
|
+
"tableToolbar.name": "表格工具栏",
|
|
64
|
+
"tableToolbar.search": "搜索",
|
|
65
|
+
"tableToolbar.sort": "排序",
|
|
66
|
+
"tableToolbar.filter": "筛选",
|
|
67
|
+
"tableToolbar.clear": "清除",
|
|
68
|
+
"tableToolbar.copy": "复制",
|
|
69
|
+
"tableToolbar.delete": "删除",
|
|
70
|
+
"tableToolbar.selected": "已选择 {{count}} 项",
|
|
71
|
+
"tableToolbar.deleting": "删除中",
|
|
72
|
+
"tableToolbar.defaultSort": "默认排序",
|
|
73
|
+
"tableToolbar.ascending": "升序",
|
|
74
|
+
"tableToolbar.descending": "降序",
|
|
75
|
+
"tableToolbar.defaultFilter": "默认筛选",
|
|
76
|
+
"overflowActions.more": "更多操作",
|
|
18
77
|
"dialog.close": "关闭",
|
|
19
78
|
},
|
|
20
79
|
"en-US": {
|
|
80
|
+
"copyButton.copy": "Copy",
|
|
81
|
+
"copyButton.copied": "Copied",
|
|
82
|
+
"codeBlock.copyCode": "Copy code",
|
|
83
|
+
"codeBlock.fullscreen": "View fullscreen",
|
|
84
|
+
"codeBlock.exitFullscreen": "Exit fullscreen",
|
|
85
|
+
"codeBlock.resize": "Resize code block",
|
|
86
|
+
"codeBlock.fullscreenDialog": "Fullscreen code view",
|
|
87
|
+
"expandButton.expand": "Expand",
|
|
88
|
+
"expandButton.collapse": "Collapse",
|
|
89
|
+
"sidebar.resize": "Resize sidebar width",
|
|
90
|
+
"pagination.pageSize": "Items per page",
|
|
91
|
+
"pagination.previous": "Previous page",
|
|
92
|
+
"pagination.next": "Next page",
|
|
93
|
+
"pagination.page": "Page {{page}}",
|
|
94
|
+
"input.clear": "Clear input",
|
|
95
|
+
"input.increment": "Increase value",
|
|
96
|
+
"input.decrement": "Decrease value",
|
|
97
|
+
"input.openTime": "Open time picker",
|
|
98
|
+
"input.openDate": "Open date picker",
|
|
99
|
+
"input.year": "Year",
|
|
100
|
+
"input.month": "Month",
|
|
101
|
+
"input.day": "Day",
|
|
102
|
+
"input.week": "Week",
|
|
103
|
+
"input.hour": "Hour",
|
|
104
|
+
"input.minute": "Minute",
|
|
105
|
+
"input.second": "Second",
|
|
106
|
+
"input.yearPlaceholder": "YYYY",
|
|
107
|
+
"input.monthPlaceholder": "MM",
|
|
108
|
+
"input.dayPlaceholder": "DD",
|
|
109
|
+
"input.weekPlaceholder": "WW",
|
|
110
|
+
"imageViewer.previous": "Previous image",
|
|
111
|
+
"imageViewer.next": "Next image",
|
|
112
|
+
"imageViewer.close": "Close image viewer",
|
|
113
|
+
"toast.close": "Close notification",
|
|
114
|
+
"tableHead.selectAll": "Select all current rows",
|
|
115
|
+
"tableHead.resizeColumn": "Resize {{column}} column",
|
|
116
|
+
"tableCell.selectRow": "Select current row",
|
|
117
|
+
"text.expand": "Expand",
|
|
118
|
+
"textarea.resize": "Resize text area",
|
|
119
|
+
"indicator.resizeWidth": "Resize width",
|
|
120
|
+
"indicator.resizeHeight": "Resize height",
|
|
121
|
+
"indicator.resizeBoth": "Resize width and height",
|
|
21
122
|
"colorSchemeButton.toLight": "Switch to light color scheme",
|
|
22
123
|
"colorSchemeButton.toDark": "Switch to dark color scheme",
|
|
23
124
|
"styleButton.toSnowUI": "Switch to SnowUI style",
|
|
@@ -31,6 +132,21 @@ export const SNOWUI_MESSAGES = {
|
|
|
31
132
|
"sidePanel.cancel": "Cancel",
|
|
32
133
|
"sidePanel.save": "Save",
|
|
33
134
|
"sidePanel.close": "Close",
|
|
135
|
+
"sidePanel.resize": "Resize panel width",
|
|
136
|
+
"tableToolbar.name": "Table toolbar",
|
|
137
|
+
"tableToolbar.search": "Search",
|
|
138
|
+
"tableToolbar.sort": "Sort",
|
|
139
|
+
"tableToolbar.filter": "Filter",
|
|
140
|
+
"tableToolbar.clear": "Clear",
|
|
141
|
+
"tableToolbar.copy": "Copy",
|
|
142
|
+
"tableToolbar.delete": "Delete",
|
|
143
|
+
"tableToolbar.selected": "{{count}} selected",
|
|
144
|
+
"tableToolbar.deleting": "Deleting",
|
|
145
|
+
"tableToolbar.defaultSort": "Default sort",
|
|
146
|
+
"tableToolbar.ascending": "Ascending",
|
|
147
|
+
"tableToolbar.descending": "Descending",
|
|
148
|
+
"tableToolbar.defaultFilter": "Default filter",
|
|
149
|
+
"overflowActions.more": "More actions",
|
|
34
150
|
"dialog.close": "Close",
|
|
35
151
|
},
|
|
36
152
|
};
|
package/dist/server/index.d.ts
CHANGED
|
@@ -88,7 +88,7 @@ export { DEFAULT_LOCALE, SNOWUI_MESSAGES, type SnowUIMessageKey, type SnowUIMess
|
|
|
88
88
|
export { createLocaleContext, useLocale, type LocaleContext, } from "./i18n/locale.js";
|
|
89
89
|
export { getTooltipBehaviorEnhancement, registerTooltipBehaviorEnhancement, resetTooltipBehaviorEnhancement, type ResolvedTooltipBehaviorEnhancement, type TooltipBehaviorEnhancement, } from "./lib/tooltip-behavior";
|
|
90
90
|
export { DEFAULT_FLOATING_EDGE_GAP, clampFloatingPosition, clampFloatingValue, constrainFloatingAnchor, getFloatingVisualBounds, getOppositeFloatingSide, hasFloatingCollision, type FloatingBounds, type FloatingPoint, type FloatingSide, } from "./lib/floating-position";
|
|
91
|
-
export { DEFAULT_PROGRESSIVE_BLUR_LAYER_COUNT, DEFAULT_PROGRESSIVE_BLUR_WIDTH, createProgressiveBlurContainerStyle, createProgressiveBlurLayerStyles, createProgressiveBlurStyles, createUniformBlurLayerStyles, createUniformBlurStyles, type ProgressiveBlurDirection, type ProgressiveBlurLayerStyle, type ProgressiveBlurOptions, type ProgressiveBlurStyles, } from "./lib/progressive-blur";
|
|
91
|
+
export { DEFAULT_PROGRESSIVE_BLUR_LAYER_COUNT, DEFAULT_PROGRESSIVE_BLUR_WIDTH, createEdgeProgressiveBlurStyles, createProgressiveBlurContainerStyle, createProgressiveBlurLayerStyles, createProgressiveBlurStyles, createUniformBlurLayerStyles, createUniformBlurStyles, type EdgeProgressiveBlurDirection, type EdgeProgressiveBlurOptions, type ProgressiveBlurDirection, type ProgressiveBlurLayerStyle, type ProgressiveBlurOptions, type ProgressiveBlurStyles, } from "./lib/progressive-blur";
|
|
92
92
|
export { createEdgeFadeMaskImage, createEdgeFadeMaskStyle, type EdgeFadeDirection, type EdgeFadeMaskOptions, } from "./lib/edge-fade";
|
|
93
93
|
export { writeClipboardText } from "./lib/clipboard";
|
|
94
94
|
export { default as CopyLink } from "./components/CopyLink.js";
|
package/dist/server/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* SnowUI source notice | LICENSE 2.2.0: ../../LICENSE
|
|
2
|
+
复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
|
|
1
3
|
// SnowUI 许可入口:阅读或使用本公开入口前先读 ../LICENSE;同任务同许可版本去重,源码修改与框架移植须有相应权限。
|
|
2
4
|
export { default as Accordion } from "./components/Accordion.js";
|
|
3
5
|
export { default as AccordionItem } from "./components/AccordionItem.js";
|
|
@@ -76,7 +78,7 @@ export { DEFAULT_LOCALE, SNOWUI_MESSAGES, } from "./i18n/messages.js";
|
|
|
76
78
|
export { createLocaleContext, useLocale, } from "./i18n/locale.js";
|
|
77
79
|
export { getTooltipBehaviorEnhancement, registerTooltipBehaviorEnhancement, resetTooltipBehaviorEnhancement, } from "./lib/tooltip-behavior.js";
|
|
78
80
|
export { DEFAULT_FLOATING_EDGE_GAP, clampFloatingPosition, clampFloatingValue, constrainFloatingAnchor, getFloatingVisualBounds, getOppositeFloatingSide, hasFloatingCollision, } from "./lib/floating-position.js";
|
|
79
|
-
export { DEFAULT_PROGRESSIVE_BLUR_LAYER_COUNT, DEFAULT_PROGRESSIVE_BLUR_WIDTH, createProgressiveBlurContainerStyle, createProgressiveBlurLayerStyles, createProgressiveBlurStyles, createUniformBlurLayerStyles, createUniformBlurStyles, } from "./lib/progressive-blur.js";
|
|
81
|
+
export { DEFAULT_PROGRESSIVE_BLUR_LAYER_COUNT, DEFAULT_PROGRESSIVE_BLUR_WIDTH, createEdgeProgressiveBlurStyles, createProgressiveBlurContainerStyle, createProgressiveBlurLayerStyles, createProgressiveBlurStyles, createUniformBlurLayerStyles, createUniformBlurStyles, } from "./lib/progressive-blur.js";
|
|
80
82
|
export { createEdgeFadeMaskImage, createEdgeFadeMaskStyle, } from "./lib/edge-fade.js";
|
|
81
83
|
export { writeClipboardText } from "./lib/clipboard.js";
|
|
82
84
|
export { default as CopyLink } from "./components/CopyLink.js";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* SnowUI source notice | LICENSE 2.2.0: ../../../../LICENSE
|
|
2
|
+
复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
|
|
1
3
|
// 品牌专用:以系统 emoji 的实际着色像素边界匹配 32×32 图标,保持原始比例。
|
|
2
4
|
export const LOGO_EMOJI_FONT = '"Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif';
|
|
3
5
|
const cache = new Map();
|
package/dist/server/keys.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* SnowUI source notice | LICENSE 2.2.0: ../../../../LICENSE
|
|
2
|
+
复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
|
|
1
3
|
import { clamp } from "./geometry.js";
|
|
2
4
|
export const SEGMENT_APPEARANCE_FILL_DURATION = 500;
|
|
3
5
|
export const SEGMENT_APPEARANCE_OPACITY_DURATION = 750;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* SnowUI source notice | LICENSE 2.2.0: ../../../../LICENSE
|
|
2
|
+
复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
|
|
1
3
|
import { arc } from "d3-shape";
|
|
2
4
|
import { clamp, formatPoint, normalizePositiveAngle } from "./geometry.js";
|
|
3
5
|
export function buildArcPath(cx, cy, outer, inner, start, end, corner, separator = 0) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* SnowUI source notice | LICENSE 2.2.0: ../../../../LICENSE
|
|
2
|
+
复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
|
|
1
3
|
import { resizeManager } from "../../index.js";
|
|
2
4
|
import { toNumber } from "./geometry.js";
|
|
3
5
|
export function watchCartesianChartSize(element, onChange) {
|
package/dist/server/lib/color.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* SnowUI source notice | LICENSE 2.2.0: ../../../LICENSE
|
|
2
|
+
复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
|
|
1
3
|
export const DEFAULT_NUMBER_VALUE_LABEL_FRACTION_DIGITS = 2;
|
|
2
4
|
export const DEFAULT_NUMBER_PERCENT_FRACTION_DIGITS = 1;
|
|
3
5
|
export const DEFAULT_NUMBER_COMPACT_THRESHOLD = 1_000_000;
|
|
@@ -72,10 +74,16 @@ export function formatNumberLabel(value, options = {}) {
|
|
|
72
74
|
});
|
|
73
75
|
}
|
|
74
76
|
export function formatPercentLabel(value, options = {}) {
|
|
77
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
78
|
+
return options.emptyValue ?? DEFAULT_NUMBER_EMPTY_VALUE;
|
|
79
|
+
}
|
|
80
|
+
const hasExplicitFractionDigits = options.fractionDigits !== undefined ||
|
|
81
|
+
options.percentFractionDigits !== undefined;
|
|
75
82
|
return `${formatNumberLabel(value, {
|
|
76
83
|
...options,
|
|
77
84
|
fractionDigits: options.fractionDigits ??
|
|
78
85
|
options.percentFractionDigits ??
|
|
79
86
|
DEFAULT_NUMBER_PERCENT_FRACTION_DIGITS,
|
|
87
|
+
preserveTrailingZeros: options.preserveTrailingZeros ?? hasExplicitFractionDigits,
|
|
80
88
|
})}%`;
|
|
81
89
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* SnowUI source notice | LICENSE 2.2.0: ../../../LICENSE
|
|
2
|
+
复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
|
|
1
3
|
import { RESIZE_MOTION } from '../motion/presets/resize.js';
|
|
2
4
|
/** 操作组私有布局适配;Flex 决定终点,独立视觉壳只做平移,不缩放 Button。 */
|
|
3
5
|
export function createOverflowActionsMotion(root) {
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export type ProgressiveBlurDirection = "left-to-right" | "right-to-left";
|
|
2
|
+
export type EdgeProgressiveBlurDirection = "top-to-bottom" | "bottom-to-top" | ProgressiveBlurDirection;
|
|
3
|
+
export interface EdgeProgressiveBlurOptions {
|
|
4
|
+
direction?: EdgeProgressiveBlurDirection;
|
|
5
|
+
/** Visible height for vertical directions or width for horizontal directions. */
|
|
6
|
+
extent?: string;
|
|
7
|
+
position?: "absolute" | "fixed";
|
|
8
|
+
zIndex?: number;
|
|
9
|
+
}
|
|
2
10
|
export interface ProgressiveBlurOptions {
|
|
3
11
|
direction?: ProgressiveBlurDirection;
|
|
4
12
|
width?: string;
|
|
@@ -29,6 +37,11 @@ export interface ProgressiveBlurStyles {
|
|
|
29
37
|
containerStyle: string;
|
|
30
38
|
layers: ProgressiveBlurLayerStyle[];
|
|
31
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Decorative full-edge blur. The host supplies aria-hidden and owns its stacking context.
|
|
42
|
+
* Unsupported backdrop-filter leaves transparent layers and readable content.
|
|
43
|
+
*/
|
|
44
|
+
export declare function createEdgeProgressiveBlurStyles(options?: EdgeProgressiveBlurOptions): ProgressiveBlurStyles;
|
|
32
45
|
export declare const DEFAULT_PROGRESSIVE_BLUR_LAYER_COUNT = 16;
|
|
33
46
|
export declare const DEFAULT_PROGRESSIVE_BLUR_WIDTH = "calc((var(--size-12, 3rem) + var(--size-14, 3.5rem)) / 3)";
|
|
34
47
|
export declare const createProgressiveBlurContainerStyle: (options?: ProgressiveBlurOptions) => string;
|