@snowui-design-system/components 0.3.0-alpha.0 → 0.3.0-alpha.1

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 (79) hide show
  1. package/README.md +13 -6
  2. package/component-catalog.json +2 -23
  3. package/dist/client/blocks/Sidebar.js +2 -2
  4. package/dist/client/blocks/SidebarItem.js +2 -2
  5. package/dist/client/blocks/SidebarSection.js +2 -2
  6. package/dist/client/compat.d.ts +1 -1
  7. package/dist/client/compat.js +1 -1
  8. package/dist/client/components/BlurText.js +2 -2
  9. package/dist/client/components/DataTable.js +2 -2
  10. package/dist/client/components/FlowText.js +2 -2
  11. package/dist/client/components/Frame.d.ts +9 -0
  12. package/dist/client/components/Frame.js +82 -24
  13. package/dist/client/components/GradientMotion.d.ts +1 -1
  14. package/dist/client/components/GradientMotion.js +2 -2
  15. package/dist/client/components/NumberFlow.js +4 -4
  16. package/dist/client/components/NumericText.js +2 -2
  17. package/dist/client/components/ScrambleText.js +2 -2
  18. package/dist/client/components/SidePanel.js +3 -3
  19. package/dist/client/components/SlotText.js +2 -2
  20. package/dist/client/components/TableCell.js +1 -1
  21. package/dist/client/components/Toaster.js +1 -1
  22. package/dist/client/index.d.ts +0 -1
  23. package/dist/client/index.js +3 -5
  24. package/dist/client/internal/snow-ui-logo/Wordmark.js +1 -1
  25. package/dist/client/lib/edge-fade.js +1 -1
  26. package/dist/client/lib/resizable.d.ts +1 -1
  27. package/dist/client/logic/frame-motion.d.ts +15 -23
  28. package/dist/client/logic/frame-motion.js +196 -30
  29. package/dist/client/logic/frame-state.d.ts +2 -14
  30. package/dist/client/logic/frame-state.js +60 -9
  31. package/dist/client/motion/number.d.ts +3 -3
  32. package/dist/client/motion/number.js +3 -3
  33. package/dist/client/styles/components.css +14 -14
  34. package/dist/client/styles/layout.css +1 -1
  35. package/dist/server/blocks/Sidebar.js +2 -2
  36. package/dist/server/blocks/SidebarItem.js +2 -2
  37. package/dist/server/blocks/SidebarSection.js +2 -2
  38. package/dist/server/compat.d.ts +1 -1
  39. package/dist/server/compat.js +1 -1
  40. package/dist/server/components/BlurText.js +2 -2
  41. package/dist/server/components/DataTable.js +2 -2
  42. package/dist/server/components/FlowText.js +2 -2
  43. package/dist/server/components/Frame.d.ts +9 -0
  44. package/dist/server/components/Frame.js +52 -24
  45. package/dist/server/components/GradientMotion.d.ts +1 -1
  46. package/dist/server/components/GradientMotion.js +2 -2
  47. package/dist/server/components/NumberFlow.js +4 -4
  48. package/dist/server/components/NumericText.js +2 -2
  49. package/dist/server/components/ScrambleText.js +2 -2
  50. package/dist/server/components/SidePanel.js +3 -3
  51. package/dist/server/components/SlotText.js +2 -2
  52. package/dist/server/components/TableCell.js +1 -1
  53. package/dist/server/components/Toaster.js +1 -1
  54. package/dist/server/index.d.ts +0 -1
  55. package/dist/server/index.js +3 -5
  56. package/dist/server/internal/snow-ui-logo/Wordmark.js +1 -1
  57. package/dist/server/lib/edge-fade.js +1 -1
  58. package/dist/server/lib/resizable.d.ts +1 -1
  59. package/dist/server/logic/frame-motion.d.ts +15 -23
  60. package/dist/server/logic/frame-motion.js +75 -29
  61. package/dist/server/logic/frame-state.d.ts +2 -14
  62. package/dist/server/logic/frame-state.js +60 -9
  63. package/dist/server/motion/number.d.ts +3 -3
  64. package/dist/server/motion/number.js +3 -3
  65. package/dist/server/styles/components.css +14 -14
  66. package/dist/server/styles/layout.css +1 -1
  67. package/package.json +2 -2
  68. package/dist/client/components/FramePro.d.ts +0 -23
  69. package/dist/client/components/FramePro.js +0 -412
  70. package/dist/client/logic/frame-pro-motion.d.ts +0 -26
  71. package/dist/client/logic/frame-pro-motion.js +0 -310
  72. package/dist/client/logic/frame-pro-state.d.ts +0 -39
  73. package/dist/client/logic/frame-pro-state.js +0 -538
  74. package/dist/server/components/FramePro.d.ts +0 -23
  75. package/dist/server/components/FramePro.js +0 -301
  76. package/dist/server/logic/frame-pro-motion.d.ts +0 -26
  77. package/dist/server/logic/frame-pro-motion.js +0 -176
  78. package/dist/server/logic/frame-pro-state.d.ts +0 -39
  79. package/dist/server/logic/frame-pro-state.js +0 -445
@@ -31,7 +31,7 @@ var root_5 = $.from_html(`<td data-snowui-frame="true" data-content-width="hug"
31
31
 
32
32
  const $$css = {
33
33
  hash: 'svelte-5fogvw',
34
- code: ':where(.snowui-table-cell.snowui-table-cell-visible-first) {--snowui-table-cell-padding-start: max(var(--padding-2), var(--snowui-table-responsive-cell-padding-inline, var(--padding-3)));}:where(.snowui-table-cell.snowui-table-cell-visible-last) {--snowui-table-cell-padding-end: max(var(--padding-2), var(--snowui-table-responsive-cell-padding-inline, var(--padding-3)));}:where(.snowui-table-cell) {position:relative;box-sizing:border-box;height:var(--size-10, 2.5rem);padding:var(--snowui-table-cell-padding-override, var(--padding-2) var(--snowui-table-cell-padding-end, var(--snowui-table-responsive-cell-padding-inline, var(--padding-3))) var(--padding-2) var(--snowui-table-cell-padding-start, var(--snowui-table-responsive-cell-padding-inline, var(--padding-3))));border-bottom:var(--border-1, .5px) solid var(--black-10, #0000001a);background:var(--snowui-table-row-active-background, transparent);font-size:var(--text-12, .75rem);line-height:var(--leading-12, 1rem);vertical-align:middle;}:where(.snowui-table-cell[data-as="selection"]) {width:var(--size-10);padding:var(--snowui-table-cell-selection-padding-override, var(--padding-2) var(--snowui-table-cell-padding-end, var(--snowui-table-responsive-cell-padding-inline, var(--padding-3))) var(--padding-2) var(--snowui-table-cell-padding-start, var(--snowui-table-responsive-cell-padding-inline, var(--padding-3))));}:where(.snowui-table-cell[data-as="actions"]) {width:var(--size-10);padding:var(--snowui-table-cell-actions-padding-override, var(--padding-2) var(--snowui-table-cell-padding-end, var(--snowui-table-responsive-cell-padding-inline, var(--padding-3))) var(--padding-2) var(--snowui-table-cell-padding-start, var(--snowui-table-responsive-cell-padding-inline, var(--padding-3))));}:where(.snowui-table-cell[data-skeleton="true"]) {pointer-events:none;}:where(.snowui-table-cell-skeleton) {display:flex;width:100%;align-items:center;}:where(.snowui-table-cell[data-as="selection"] .snowui-table-selection-control),\n :where(.snowui-table-cell-content[data-actions="true"]) {opacity:0;pointer-events:none;transition:opacity var(--snowui-frame-color-motion-duration, .15s) var(--snowui-frame-color-motion-easing, ease-out);}:where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row[data-selected="true"]) .snowui-table-cell[data-as="selection"] .snowui-table-selection-control,\n :where(.snowui-table-cell[data-as="selection"] .snowui-table-selection-control[data-selected="true"]) {opacity:1;pointer-events:auto;}:where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row:has(.snowui-select-button-trigger[aria-expanded="true"])) .snowui-table-cell:not([data-role-layout="overlay"]) .snowui-table-cell-content[data-actions="true"] {opacity:1;pointer-events:auto;}:where(.snowui-table-cell[data-role-layout="overlay"][data-as="selection"]),\n :where(.snowui-table-cell[data-role-layout="overlay"][data-as="actions"]) {position:sticky;width:0;min-width:0;max-width:0;padding:0;overflow:visible;background:transparent;z-index:3;}:where(.snowui-table-cell[data-role-layout="overlay"][data-as="selection"]) {left:0;}:where(.snowui-table-cell[data-role-layout="overlay"][data-as="actions"]) {right:0;}:where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-selection-control) {position:absolute;inset-block:0 calc(-1 * var(--border-1, .5px));inset-inline-start:0;box-sizing:border-box;display:flex;width:var(--size-10, 2.5rem);align-items:center;justify-content:center;overflow:visible;padding-block:var(--padding-2);padding-inline:max(var(--padding-2), var(--snowui-table-responsive-cell-padding-inline, var(--padding-3)));border-radius:var(--snowui-table-row-radius-override, var(--radius-3, 0.75rem));background:transparent;z-index:2147483647;pointer-events:auto;}\n /* 内容 mask 退出是离散切换;同步撤去整个操作浮层,避免淡出按钮叠在已恢复的文字上。 */:where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-cell-content[data-actions="true"]) {opacity:1;visibility:hidden;pointer-events:none;transition:none;}:where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row:has(.snowui-select-button-trigger[aria-expanded="true"])) .snowui-table-cell[data-role-layout="overlay"] .snowui-table-cell-content[data-actions="true"] {visibility:visible;}:where(.snowui-table-body .snowui-table-row:last-child) > .snowui-table-cell {border-bottom-color:transparent;}:where(.snowui-table-cell-content) {position:relative;display:block;min-width:0;max-width:100%;overflow:hidden;--snowui-table-cell-actions-legacy-tail: calc(var(--snowui-table-cell-actions-fade-width) * (var(--snowui-table-actions-fade-feather-override) - 1));--snowui-table-cell-actions-fade-width: calc(var(--snowui-table-role-overlay-content-width, var(--snowui-table-role-overlay-width-override, calc((var(--size-12, 3rem) + var(--size-14, 3.5rem)) / 3))) * var(--snowui-table-actions-fade-coverage-override, 1));}\n /* 关闭截断的普通内容保留子组件外扩;角色浮层和 Skeleton 仍使用各自裁切。 */:where(.snowui-table-cell-content[data-lines="none"]) {overflow:visible;}:where(.snowui-table-cell-content.snowui-line-clamp-1) {white-space:nowrap;text-overflow:ellipsis;}:where(.snowui-table-cell-content.snowui-line-clamp-2),\n :where(.snowui-table-cell-content.snowui-line-clamp-3) {display:-webkit-box;-webkit-box-orient:vertical;white-space:normal;}:where(.snowui-table-cell-content.snowui-line-clamp-2) {-webkit-line-clamp:2;line-clamp:2;}:where(.snowui-table-cell-content.snowui-line-clamp-3) {-webkit-line-clamp:3;line-clamp:3;}:where(.snowui-table-cell-content[data-row="true"]) {display:inline-flex;vertical-align:middle;align-items:center;flex-wrap:wrap;}:where(.snowui-table-cell-content[data-nowrap="true"]) {white-space:nowrap;}:where(.snowui-table-cell-content[data-row="true"][data-nowrap="true"]) {flex-wrap:nowrap;}:where(.snowui-table-cell-content[data-actions="true"]) {display:flex;overflow:visible;width:100%;align-items:center;justify-content:flex-end;gap:var(--snowui-table-cell-actions-gap-override, var(--gap-2));}:where(.snowui-table-cell-content[data-actions="true"] .snowui-table-role-overlay-controls) {display:flex;align-items:center;justify-content:flex-end;gap:var(--snowui-table-cell-actions-gap-override, var(--gap-2));}:where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-cell-content[data-actions="true"]) {position:absolute;inset-block:0 calc(-1 * var(--border-1, .5px));inset-inline-end:0;display:flex;width:var(--snowui-table-role-overlay-width-override, calc((var(--size-12, 3rem) + var(--size-14, 3.5rem)) / 3));max-width:none;align-items:center;justify-content:flex-end;overflow:hidden;padding-inline:max(var(--padding-2), var(--snowui-table-responsive-cell-padding-inline, var(--padding-3)));border-radius:var(--snowui-table-row-radius-override, var(--radius-3, 0.75rem));}:where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-role-blur-layer) {opacity:0;transition:opacity var(--snowui-frame-color-motion-duration, .15s) var(--snowui-frame-color-motion-easing, ease-out);}:where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row[data-selected="true"]) .snowui-table-cell[data-role-layout="overlay"] .snowui-table-role-blur-layer {opacity:1;}:where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-selection-control) > :not(.snowui-table-role-blur-layer),\n :where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-cell-content[data-actions="true"]) > :not(.snowui-table-role-blur-layer) {position:relative;z-index:2;}:where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-selection-control) > :not(.snowui-table-role-blur-layer),\n :where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-cell-content[data-actions="true"]) > :not(.snowui-table-role-blur-layer) {opacity:0;pointer-events:none;transition:opacity var(--snowui-frame-color-motion-duration, .15s) var(--snowui-frame-color-motion-easing, ease-out);}:where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row[data-selected="true"]) .snowui-table-cell[data-role-layout="overlay"][data-as="selection"] .snowui-table-selection-control > :not(.snowui-table-role-blur-layer),\n :where(.snowui-table-cell[data-role-layout="overlay"][data-as="selection"] .snowui-table-selection-control[data-selected="true"]) > :not(.snowui-table-role-blur-layer),\n :where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row:has(.snowui-select-button-trigger[aria-expanded="true"])) .snowui-table-cell[data-role-layout="overlay"] .snowui-table-cell-content[data-actions="true"] > :not(.snowui-table-role-blur-layer) {opacity:1;pointer-events:auto;}:where(.snowui-table-cell[data-table-variant="striped"]) {border-bottom-color:transparent;}:where(.snowui-table-body .snowui-table-row:nth-child(odd of :not(:has(> .snowui-table-loading-cell)))) > .snowui-table-cell[data-table-variant="striped"] {background:var(--snowui-table-row-active-background, var(--surface-3, #f7f7f7));}:where(.snowui-table-body .snowui-table-row:nth-child(even of :not(:has(> .snowui-table-loading-cell)))) > .snowui-table-cell[data-table-variant="striped"] {background:var(--snowui-table-row-active-background, transparent);}:where(.snowui-table-body[data-continuous-hover-enabled="true"] .snowui-table-row:hover) > .snowui-table-cell[data-table-variant="striped"] {background:var(--snowui-table-row-active-background, transparent);}:where(.snowui-table-body .snowui-table-row[data-force-hover="true"]) > .snowui-table-cell:not([data-role-layout="overlay"]) {background:var(--snowui-table-row-hover-background-override, var(--black-4, #0000000a));}:where(.snowui-table-body .snowui-table-row:not([data-skeleton="true"]):hover, .snowui-table-body .snowui-table-row:not([data-skeleton="true"])[data-force-hover="true"]) > .snowui-table-cell {border-bottom-color:transparent;}:where(.snowui-table-body .snowui-table-row:has(+ .snowui-table-row:not([data-skeleton="true"]):hover), .snowui-table-body .snowui-table-row:has(+ .snowui-table-row:not([data-skeleton="true"])[data-force-hover="true"])) > .snowui-table-cell {border-bottom-color:transparent;}:where(.snowui-table-body .snowui-table-row) > .snowui-table-cell[data-role-layout="overlay"] {background:transparent;}:where(.snowui-table-body .snowui-table-row:hover) > .snowui-table-cell[data-role-layout="overlay"] {background:transparent;}\n /* overlay 模式 hover 边缘渐进式透明(复用 OSS edge-fade 通用能力 ../lib/edge-fade.ts;详见 Table.md)。\n selection mask 按 Checkbox 实际右边缘在内容节点生成;actions mask 依赖行级实测宽度,由内容 TableCell 在自身作用域生成,并按内容右边缘到可见行右边缘的实测距离平移。\n 此处状态规则只消费对应 CSS 变量,未触发时无 mask。selection 的内容遮罩与 Checkbox 可见条件一致(hover、键盘 focus、选中或 force-hover);actions 保持行 hover 时触发。相邻内容从靠控件一侧渐隐到清晰:\n - checkbox 侧(to right):透明区覆盖到 Checkbox 实际右边缘,再向右使用固定 --size-5(名义 20px)过渡;\n - actions 侧(to left):透明区默认覆盖到最左按钮实际左边缘,向左以 --size-5(名义 20px)固定长度过渡到清晰,不随按钮组宽度或响应式间距变化。\n coverage 默认 1;显式旧 feather override 仍按倍数计算尾巴,未设置时旧表达式无效,自动回退固定 Token 长度。\n 这些变量与表头渐隐(--snowui-table-head-fade-*-override)相互独立,可在 Table / 容器上单独设置覆盖。\n mask 只改变视觉,不影响指针事件,单元格内链接/按钮点击不受影响。\n data-force-hover="true" 可让某一行静态呈现 hover 态(用于演示 / 视觉走查)。 */:where(.snowui-table-cell-content) {transition:-webkit-mask-image var(--snowui-frame-color-motion-duration, .15s) var(--snowui-frame-color-motion-easing, ease-out),\n mask-image var(--snowui-frame-color-motion-duration, .15s) var(--snowui-frame-color-motion-easing, ease-out);}:where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row[data-selected="true"]) > .snowui-table-cell[data-role-layout="overlay"][data-as="selection"] + .snowui-table-cell > .snowui-table-cell-content {--snowui-table-cell-active-selection-mask: var(--snowui-table-selection-fade-mask);-webkit-mask-image:var(--snowui-table-cell-active-selection-mask), var(--snowui-table-cell-active-actions-mask, linear-gradient(#000, #000));mask-image:var(--snowui-table-cell-active-selection-mask), var(--snowui-table-cell-active-actions-mask, linear-gradient(#000, #000));mask-composite:intersect;}:where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row:has(.snowui-select-button-trigger[aria-expanded="true"])) > .snowui-table-cell:not([data-as="selection"]):has(~ .snowui-table-cell[data-role-layout="overlay"][data-as="actions"]) > .snowui-table-cell-content {--snowui-table-cell-active-actions-mask: var(--snowui-table-cell-actions-fade-mask);-webkit-mask-image:var(--snowui-table-cell-active-selection-mask, linear-gradient(#000, #000)), var(--snowui-table-cell-active-actions-mask);mask-image:var(--snowui-table-cell-active-selection-mask, linear-gradient(#000, #000)), var(--snowui-table-cell-active-actions-mask);mask-composite:intersect;}\n\n /* 遮罩退出时 Checkbox 同帧消失;不隐藏 DOM,保留键盘聚焦入口。 */:where(.snowui-table-row:not(:hover):not([data-force-hover="true"]):not(:has(:focus-visible)):not([data-selected="true"])) > .snowui-table-cell[data-role-layout="overlay"][data-as="selection"] .snowui-table-selection-control:not([data-selected="true"]),\n :where(.snowui-table-row:not(:hover):not([data-force-hover="true"]):not(:has(:focus-visible)):not([data-selected="true"])) > .snowui-table-cell[data-role-layout="overlay"][data-as="selection"] .snowui-table-selection-control:not([data-selected="true"]) > * {transition:none;}:where(.snowui-table-cell) {border-radius:var(--snowui-table-cell-leading-radius, 0) var(--snowui-table-cell-trailing-radius, 0) var(--snowui-table-cell-trailing-radius, 0) var(--snowui-table-cell-leading-radius, 0);}:where(.snowui-table-cell-visible-first) {--snowui-table-cell-leading-radius: var(--snowui-table-cell-corner-radius, var(--snowui-table-row-corner-radius, 0));}:where(.snowui-table-cell-visible-last) {--snowui-table-cell-trailing-radius: var(--snowui-table-cell-corner-radius, var(--snowui-table-row-corner-radius, 0));}:where(.snowui-table-cell[data-table-variant="striped"]) {--snowui-table-cell-corner-radius: var(--snowui-table-row-radius-override, var(--radius-3));}:where(.snowui-table-cell[data-role-layout="column"]) .snowui-table-selection-control,\n :where(.snowui-table-cell[data-role-layout="column"]) .snowui-table-cell-content[data-actions="true"] {opacity:1;pointer-events:auto;}:where(.snowui-table-responsive-text-fit .snowui-table-cell-content[data-nowrap="true"]:not([data-actions="true"])) {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}:where(.snowui-table-responsive-text-fit .snowui-table-cell-content[data-nowrap="false"]) {overflow-wrap:anywhere;}:where(.snowui-table-cell:not([data-as]) > .snowui-table-cell-content) {opacity:var(--snowui-table-responsive-column-opacity, 1);}\n @media (prefers-reduced-motion: reduce) {:where(.snowui-table-cell:not([data-as]) > .snowui-table-cell-content) {opacity:1;}\n }'
34
+ code: ':where(.snowui-table-cell.snowui-table-cell-visible-first) {--snowui-table-cell-padding-start: max(var(--padding-2), var(--snowui-table-responsive-cell-padding-inline, var(--padding-3)));}:where(.snowui-table-cell.snowui-table-cell-visible-last) {--snowui-table-cell-padding-end: max(var(--padding-2), var(--snowui-table-responsive-cell-padding-inline, var(--padding-3)));}:where(.snowui-table-cell) {position:relative;box-sizing:border-box;height:var(--size-10, 2.5rem);padding:var(--snowui-table-cell-padding-override, var(--padding-2) var(--snowui-table-cell-padding-end, var(--snowui-table-responsive-cell-padding-inline, var(--padding-3))) var(--padding-2) var(--snowui-table-cell-padding-start, var(--snowui-table-responsive-cell-padding-inline, var(--padding-3))));border-bottom:var(--border-1, .5px) solid var(--black-10, #0000001a);background:var(--snowui-table-row-active-background, transparent);font-size:var(--text-12, .75rem);line-height:var(--leading-12, 1rem);vertical-align:middle;}:where(.snowui-table-cell[data-as="selection"]) {width:var(--size-10);padding:var(--snowui-table-cell-selection-padding-override, var(--padding-2) var(--snowui-table-cell-padding-end, var(--snowui-table-responsive-cell-padding-inline, var(--padding-3))) var(--padding-2) var(--snowui-table-cell-padding-start, var(--snowui-table-responsive-cell-padding-inline, var(--padding-3))));}:where(.snowui-table-cell[data-as="actions"]) {width:var(--size-10);padding:var(--snowui-table-cell-actions-padding-override, var(--padding-2) var(--snowui-table-cell-padding-end, var(--snowui-table-responsive-cell-padding-inline, var(--padding-3))) var(--padding-2) var(--snowui-table-cell-padding-start, var(--snowui-table-responsive-cell-padding-inline, var(--padding-3))));}:where(.snowui-table-cell[data-skeleton="true"]) {pointer-events:none;}:where(.snowui-table-cell-skeleton) {display:flex;width:100%;align-items:center;}:where(.snowui-table-cell[data-as="selection"] .snowui-table-selection-control),\n :where(.snowui-table-cell-content[data-actions="true"]) {opacity:0;pointer-events:none;transition:opacity var(--snowui-frame-color-motion-duration, .15s) var(--snowui-frame-color-motion-easing, ease-out);}:where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row[data-selected="true"]) .snowui-table-cell[data-as="selection"] .snowui-table-selection-control,\n :where(.snowui-table-cell[data-as="selection"] .snowui-table-selection-control[data-selected="true"]) {opacity:1;pointer-events:auto;}:where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row:has(.snowui-select-button-trigger[aria-expanded="true"])) .snowui-table-cell:not([data-role-layout="overlay"]) .snowui-table-cell-content[data-actions="true"] {opacity:1;pointer-events:auto;}:where(.snowui-table-cell[data-role-layout="overlay"][data-as="selection"]),\n :where(.snowui-table-cell[data-role-layout="overlay"][data-as="actions"]) {position:sticky;width:0;min-width:0;max-width:0;padding:0;overflow:visible;background:transparent;z-index:3;}:where(.snowui-table-cell[data-role-layout="overlay"][data-as="selection"]) {left:0;}:where(.snowui-table-cell[data-role-layout="overlay"][data-as="actions"]) {right:0;}:where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-selection-control) {position:absolute;inset-block:0 calc(-1 * var(--border-1, .5px));inset-inline-start:0;box-sizing:border-box;display:flex;width:var(--size-10, 2.5rem);align-items:center;justify-content:center;overflow:visible;padding-block:var(--padding-2);padding-inline:max(var(--padding-2), var(--snowui-table-responsive-cell-padding-inline, var(--padding-3)));border-radius:var(--snowui-table-row-radius-override, var(--radius-3, 0.75rem));background:transparent;z-index:2147483647;pointer-events:auto;}\n /* 内容 mask 退出是离散切换;同步撤去整个操作浮层,避免淡出按钮叠在已恢复的文字上。 */:where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-cell-content[data-actions="true"]) {opacity:1;visibility:hidden;pointer-events:none;transition:none;}:where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row:has(.snowui-select-button-trigger[aria-expanded="true"])) .snowui-table-cell[data-role-layout="overlay"] .snowui-table-cell-content[data-actions="true"] {visibility:visible;}:where(.snowui-table-body .snowui-table-row:last-child) > .snowui-table-cell {border-bottom-color:transparent;}:where(.snowui-table-cell-content) {position:relative;display:block;min-width:0;max-width:100%;overflow:hidden;--snowui-table-cell-actions-legacy-tail: calc(var(--snowui-table-cell-actions-fade-width) * (var(--snowui-table-actions-fade-feather-override) - 1));--snowui-table-cell-actions-fade-width: calc(var(--snowui-table-role-overlay-content-width, var(--snowui-table-role-overlay-width-override, calc((var(--size-12, 3rem) + var(--size-14, 3.5rem)) / 3))) * var(--snowui-table-actions-fade-coverage-override, 1));}\n /* 关闭截断的普通内容保留子组件外扩;角色浮层和 Skeleton 仍使用各自裁切。 */:where(.snowui-table-cell-content[data-lines="none"]) {overflow:visible;}:where(.snowui-table-cell-content.snowui-line-clamp-1) {white-space:nowrap;text-overflow:ellipsis;}:where(.snowui-table-cell-content.snowui-line-clamp-2),\n :where(.snowui-table-cell-content.snowui-line-clamp-3) {display:-webkit-box;-webkit-box-orient:vertical;white-space:normal;}:where(.snowui-table-cell-content.snowui-line-clamp-2) {-webkit-line-clamp:2;line-clamp:2;}:where(.snowui-table-cell-content.snowui-line-clamp-3) {-webkit-line-clamp:3;line-clamp:3;}:where(.snowui-table-cell-content[data-row="true"]) {display:inline-flex;vertical-align:middle;align-items:center;flex-wrap:wrap;}:where(.snowui-table-cell-content[data-nowrap="true"]) {white-space:nowrap;}:where(.snowui-table-cell-content[data-row="true"][data-nowrap="true"]) {flex-wrap:nowrap;}:where(.snowui-table-cell-content[data-actions="true"]) {display:flex;overflow:visible;width:100%;align-items:center;justify-content:flex-end;gap:var(--snowui-table-cell-actions-gap-override, var(--gap-2));}:where(.snowui-table-cell-content[data-actions="true"] .snowui-table-role-overlay-controls) {display:flex;align-items:center;justify-content:flex-end;gap:var(--snowui-table-cell-actions-gap-override, var(--gap-2));}:where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-cell-content[data-actions="true"]) {position:absolute;inset-block:0 calc(-1 * var(--border-1, .5px));inset-inline-end:0;display:flex;width:var(--snowui-table-role-overlay-width-override, calc((var(--size-12, 3rem) + var(--size-14, 3.5rem)) / 3));max-width:none;align-items:center;justify-content:flex-end;overflow:hidden;padding-inline:max(var(--padding-2), var(--snowui-table-responsive-cell-padding-inline, var(--padding-3)));border-radius:var(--snowui-table-row-radius-override, var(--radius-3, 0.75rem));}:where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-role-blur-layer) {opacity:0;transition:opacity var(--snowui-frame-color-motion-duration, .15s) var(--snowui-frame-color-motion-easing, ease-out);}:where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row[data-selected="true"]) .snowui-table-cell[data-role-layout="overlay"] .snowui-table-role-blur-layer {opacity:1;}:where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-selection-control) > :not(.snowui-table-role-blur-layer),\n :where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-cell-content[data-actions="true"]) > :not(.snowui-table-role-blur-layer) {position:relative;z-index:2;}:where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-selection-control) > :not(.snowui-table-role-blur-layer),\n :where(.snowui-table-cell[data-role-layout="overlay"] .snowui-table-cell-content[data-actions="true"]) > :not(.snowui-table-role-blur-layer) {opacity:0;pointer-events:none;transition:opacity var(--snowui-frame-color-motion-duration, .15s) var(--snowui-frame-color-motion-easing, ease-out);}:where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row[data-selected="true"]) .snowui-table-cell[data-role-layout="overlay"][data-as="selection"] .snowui-table-selection-control > :not(.snowui-table-role-blur-layer),\n :where(.snowui-table-cell[data-role-layout="overlay"][data-as="selection"] .snowui-table-selection-control[data-selected="true"]) > :not(.snowui-table-role-blur-layer),\n :where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row:has(.snowui-select-button-trigger[aria-expanded="true"])) .snowui-table-cell[data-role-layout="overlay"] .snowui-table-cell-content[data-actions="true"] > :not(.snowui-table-role-blur-layer) {opacity:1;pointer-events:auto;}:where(.snowui-table-cell[data-table-variant="striped"]) {border-bottom-color:transparent;}:where(.snowui-table-body .snowui-table-row:nth-child(odd of :not(:has(> .snowui-table-loading-cell)))) > .snowui-table-cell[data-table-variant="striped"] {background:var(--snowui-table-row-active-background, var(--surface-3, #f7f7f7));}:where(.snowui-table-body .snowui-table-row:nth-child(even of :not(:has(> .snowui-table-loading-cell)))) > .snowui-table-cell[data-table-variant="striped"] {background:var(--snowui-table-row-active-background, transparent);}:where(.snowui-table-body[data-continuous-hover-enabled="true"] .snowui-table-row:hover) > .snowui-table-cell[data-table-variant="striped"] {background:var(--snowui-table-row-active-background, transparent);}:where(.snowui-table-body .snowui-table-row[data-force-hover="true"]) > .snowui-table-cell:not([data-role-layout="overlay"]) {background:var(--snowui-table-row-hover-background-override, var(--black-4, #0000000a));}:where(.snowui-table-body .snowui-table-row:not([data-skeleton="true"]):hover, .snowui-table-body .snowui-table-row:not([data-skeleton="true"])[data-force-hover="true"]) > .snowui-table-cell {border-bottom-color:transparent;}:where(.snowui-table-body .snowui-table-row:has(+ .snowui-table-row:not([data-skeleton="true"]):hover), .snowui-table-body .snowui-table-row:has(+ .snowui-table-row:not([data-skeleton="true"])[data-force-hover="true"])) > .snowui-table-cell {border-bottom-color:transparent;}:where(.snowui-table-body .snowui-table-row) > .snowui-table-cell[data-role-layout="overlay"] {background:transparent;}:where(.snowui-table-body .snowui-table-row:hover) > .snowui-table-cell[data-role-layout="overlay"] {background:transparent;}\n /* overlay 模式 hover 边缘渐进式透明(复用 edge-fade 通用能力 ../lib/edge-fade.ts;详见 Table.md)。\n selection mask 按 Checkbox 实际右边缘在内容节点生成;actions mask 依赖行级实测宽度,由内容 TableCell 在自身作用域生成,并按内容右边缘到可见行右边缘的实测距离平移。\n 此处状态规则只消费对应 CSS 变量,未触发时无 mask。selection 的内容遮罩与 Checkbox 可见条件一致(hover、键盘 focus、选中或 force-hover);actions 保持行 hover 时触发。相邻内容从靠控件一侧渐隐到清晰:\n - checkbox 侧(to right):透明区覆盖到 Checkbox 实际右边缘,再向右使用固定 --size-5(名义 20px)过渡;\n - actions 侧(to left):透明区默认覆盖到最左按钮实际左边缘,向左以 --size-5(名义 20px)固定长度过渡到清晰,不随按钮组宽度或响应式间距变化。\n coverage 默认 1;显式旧 feather override 仍按倍数计算尾巴,未设置时旧表达式无效,自动回退固定 Token 长度。\n 这些变量与表头渐隐(--snowui-table-head-fade-*-override)相互独立,可在 Table / 容器上单独设置覆盖。\n mask 只改变视觉,不影响指针事件,单元格内链接/按钮点击不受影响。\n data-force-hover="true" 可让某一行静态呈现 hover 态(用于演示 / 视觉走查)。 */:where(.snowui-table-cell-content) {transition:-webkit-mask-image var(--snowui-frame-color-motion-duration, .15s) var(--snowui-frame-color-motion-easing, ease-out),\n mask-image var(--snowui-frame-color-motion-duration, .15s) var(--snowui-frame-color-motion-easing, ease-out);}:where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row[data-selected="true"]) > .snowui-table-cell[data-role-layout="overlay"][data-as="selection"] + .snowui-table-cell > .snowui-table-cell-content {--snowui-table-cell-active-selection-mask: var(--snowui-table-selection-fade-mask);-webkit-mask-image:var(--snowui-table-cell-active-selection-mask), var(--snowui-table-cell-active-actions-mask, linear-gradient(#000, #000));mask-image:var(--snowui-table-cell-active-selection-mask), var(--snowui-table-cell-active-actions-mask, linear-gradient(#000, #000));mask-composite:intersect;}:where(.snowui-table-row:hover, .snowui-table-row[data-force-hover="true"], .snowui-table-row:has(:focus-visible), .snowui-table-row:has(.snowui-select-button-trigger[aria-expanded="true"])) > .snowui-table-cell:not([data-as="selection"]):has(~ .snowui-table-cell[data-role-layout="overlay"][data-as="actions"]) > .snowui-table-cell-content {--snowui-table-cell-active-actions-mask: var(--snowui-table-cell-actions-fade-mask);-webkit-mask-image:var(--snowui-table-cell-active-selection-mask, linear-gradient(#000, #000)), var(--snowui-table-cell-active-actions-mask);mask-image:var(--snowui-table-cell-active-selection-mask, linear-gradient(#000, #000)), var(--snowui-table-cell-active-actions-mask);mask-composite:intersect;}\n\n /* 遮罩退出时 Checkbox 同帧消失;不隐藏 DOM,保留键盘聚焦入口。 */:where(.snowui-table-row:not(:hover):not([data-force-hover="true"]):not(:has(:focus-visible)):not([data-selected="true"])) > .snowui-table-cell[data-role-layout="overlay"][data-as="selection"] .snowui-table-selection-control:not([data-selected="true"]),\n :where(.snowui-table-row:not(:hover):not([data-force-hover="true"]):not(:has(:focus-visible)):not([data-selected="true"])) > .snowui-table-cell[data-role-layout="overlay"][data-as="selection"] .snowui-table-selection-control:not([data-selected="true"]) > * {transition:none;}:where(.snowui-table-cell) {border-radius:var(--snowui-table-cell-leading-radius, 0) var(--snowui-table-cell-trailing-radius, 0) var(--snowui-table-cell-trailing-radius, 0) var(--snowui-table-cell-leading-radius, 0);}:where(.snowui-table-cell-visible-first) {--snowui-table-cell-leading-radius: var(--snowui-table-cell-corner-radius, var(--snowui-table-row-corner-radius, 0));}:where(.snowui-table-cell-visible-last) {--snowui-table-cell-trailing-radius: var(--snowui-table-cell-corner-radius, var(--snowui-table-row-corner-radius, 0));}:where(.snowui-table-cell[data-table-variant="striped"]) {--snowui-table-cell-corner-radius: var(--snowui-table-row-radius-override, var(--radius-3));}:where(.snowui-table-cell[data-role-layout="column"]) .snowui-table-selection-control,\n :where(.snowui-table-cell[data-role-layout="column"]) .snowui-table-cell-content[data-actions="true"] {opacity:1;pointer-events:auto;}:where(.snowui-table-responsive-text-fit .snowui-table-cell-content[data-nowrap="true"]:not([data-actions="true"])) {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}:where(.snowui-table-responsive-text-fit .snowui-table-cell-content[data-nowrap="false"]) {overflow-wrap:anywhere;}:where(.snowui-table-cell:not([data-as]) > .snowui-table-cell-content) {opacity:var(--snowui-table-responsive-column-opacity, 1);}\n @media (prefers-reduced-motion: reduce) {:where(.snowui-table-cell:not([data-as]) > .snowui-table-cell-content) {opacity:1;}\n }'
35
35
  };
36
36
 
37
37
  export default function TableCell($$anchor, $$props) {
@@ -265,7 +265,7 @@ export default function Toaster($$anchor, $$props) {
265
265
  const isTop = position.startsWith("top");
266
266
  const direction = isTop ? 1 : -1; // top: 后一条向下偏移;bottom: 向上
267
267
 
268
- // 退场残影修复:内层 FramePro 保持稳定的 ±100% 出入场动效;
268
+ // 退场残影修复:内层 Frame 保持稳定的 ±100% 出入场动效;
269
269
  // 外层 slot 先抵消当前堆叠层位移,再额外越过可视边缘 20px。
270
270
  const exitDistance = indexFromFront * gap() + offset() + 20;
271
271
 
@@ -92,7 +92,6 @@ export { DEFAULT_PROGRESSIVE_BLUR_LAYER_COUNT, DEFAULT_PROGRESSIVE_BLUR_WIDTH, c
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";
95
- export { default as FramePro } from "./components/FramePro.js";
96
95
  export { default as FlowText } from './components/FlowText.js';
97
96
  export { default as NumberFlow } from './components/NumberFlow.js';
98
97
  export { default as NumericText } from './components/NumericText.js';
@@ -63,7 +63,7 @@ export { default as Switch } from './components/Switch.js';
63
63
  export { default as Skeleton, getSkeletonComponentKey } from './components/Skeleton.js';
64
64
  export * from "./logic/component-parts.js";
65
65
  export { ContinuousHoverController, } from "./logic/continuous-hover.js";
66
- // PRO 包跨包消费需要的工具导出
66
+ // 共享能力公开工具导出
67
67
  export { resizeManager } from './logic/observer.js';
68
68
  export { resizable, clampResizableSize } from "./lib/resizable.js";
69
69
  export { TABLE_CONTEXT_KEY, provideTableContext, getTableContext, } from "./lib/table-context.js";
@@ -80,8 +80,7 @@ export { DEFAULT_PROGRESSIVE_BLUR_LAYER_COUNT, DEFAULT_PROGRESSIVE_BLUR_WIDTH, c
80
80
  export { createEdgeFadeMaskImage, createEdgeFadeMaskStyle, } from "./lib/edge-fade.js";
81
81
  export { writeClipboardText } from "./lib/clipboard.js";
82
82
  export { default as CopyLink } from "./components/CopyLink.js";
83
- // 全量组件与区块;FramePro 保持独立技术身份。
84
- export { default as FramePro } from "./components/FramePro.js";
83
+ // 全量组件与区块;Frame 保持独立技术身份。
85
84
  export { default as FlowText } from './components/FlowText.js';
86
85
  export { default as NumberFlow } from './components/NumberFlow.js';
87
86
  export { default as NumericText } from './components/NumericText.js';
@@ -108,9 +107,8 @@ export { default as Toast } from './components/Toast.js';
108
107
  export { default as Toaster } from './components/Toaster.js';
109
108
  export { toast, showToast, dismissToast, dismissAllToasts, registerToastTemplate, unregisterToastTemplate, DEFAULT_TOAST_DURATION, } from './logic/toast.js';
110
109
  export { initMotion, getMotion } from './logic/motion.js';
111
- // ── PRO Blocks(付费源码开放的产品级组合块)──
110
+ // 可复用区块
112
111
  export * from './blocks/index.js';
113
- // ── PRO 动效组件(复杂动效 / PRO 指定动效)(v1.0.0 起) ──
114
112
  export * from './lib/split-pane.js';
115
113
  export { default as SearchPopup } from "./blocks/SearchPopup.js";
116
114
  export { default as BlurText } from "./components/BlurText.js";
@@ -233,7 +233,7 @@ export default function Wordmark($$anchor, $$props) {
233
233
  const segmenter = new Intl.Segmenter(undefined, { granularity: "grapheme" });
234
234
  const reduced = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
235
235
 
236
- // 与指定文字动效相同的曲线采样;不是 PRO 运行时依赖。
236
+ // 与指定文字动效相同的曲线采样;不依赖通用文字动效运行时。
237
237
  const stops = [
238
238
  0,
239
239
  0.1052,
@@ -1,4 +1,4 @@
1
- // 内容边缘渐隐遮罩(Edge Fade Mask)OSS 通用能力。
1
+ // 内容边缘渐隐遮罩(Edge Fade Mask)共享能力。
2
2
  //
3
3
  // 用途:当“悬浮操作层”(覆盖在内容之上的按钮 / 复选框 / 操作块)浮在内容之上时,
4
4
  // 让其下方内容朝控件一侧渐隐到透明,保证浮层控件清晰可读,又不出现硬切边。
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 通用尺寸拖动 action。
3
- * TableHead、普通容器和 PRO 分栏均可复用同一套 pointer / keyboard / clamp 协议。
3
+ * TableHead、普通容器和 分栏均可复用同一套 pointer / keyboard / clamp 协议。
4
4
  */
5
5
  export type ResizeAxis = "horizontal" | "vertical";
6
6
  export type ResizeEdge = "start" | "end" | "top" | "bottom";
@@ -1,34 +1,26 @@
1
- /**
2
- * OSS Frame 动效控制器(v1.0.0 起在 OSS)
3
- *
4
- * 与 PRO 版本(components/src/logic/frame-pro-motion.svelte.ts)的差异:
5
- * - 不依赖 Motion 编排器(PRO `motion.svelte.ts`)
6
- * - 不向 Motion 注册自身(无 `register` / `notify` 调用)
7
- * - 不实现 `orchestrate*` 编排触发(4 处 $effect 已剥离)
8
- * - controller 仅暴露 FLIP 自身转场方法(`captureFlip` / `playFlipTo`),不暴露 `play` / `reset` / `captureLayout` / `playLayoutTo` 等需要 Motion 上下文的方法
9
- *
10
- * OSS 支持的能力:
11
- * - layoutId / itemId 自身 FLIP 进场(自动从 layout-flip 模块注册表读取起点)
12
- * - whileScroll 自身滚动联动
13
- * - whileAppear / whileHover / whileActive 等通过 CSS bridge 变量(由 frame-motion-defaults.ts 注入)由浏览器原生 transition 执行
14
- *
15
- * 作用半径:1 个 Frame
16
- *
17
- * PRO 版本独立维护一份完整实现,FramePro 使用 PRO 版本。
18
- * 详见 ../components/Frame.md §1 切割原则与 /Frame-Refactor-Plan.md §3.4。
19
- */
20
1
  import type { FrameProps } from "./frame-types";
2
+ import type { LayoutTransitionOptions } from "./motion-types";
3
+ import type { Motion } from "./motion.js";
21
4
  import type { FrameState } from "./frame-state.js";
5
+ import type { FrameResponsive } from "./frame-responsive.js";
22
6
  import { type FlipTransitionOptions } from "./layout-flip";
23
7
  export declare class FrameMotion {
24
8
  #private;
25
- constructor(props: FrameProps, state: FrameState, getId: () => string | undefined, getElement: () => HTMLElement | undefined);
26
- /** OSS 不需要 shouldRegister 概念,但保留 getter 以兼容旧调用方(始终返回 false) */
9
+ constructor(props: FrameProps, motion: Motion | undefined, state: FrameState, responsive: FrameResponsive | null, getId: () => string | undefined, getElement: () => HTMLElement | undefined);
27
10
  get shouldRegister(): boolean;
28
11
  get controller(): {
29
- /** 捕获当前 Frame 位置写入模块级 FLIP 注册表,无需 Motion 上下文。 */
12
+ play: (options?: {
13
+ reverse?: boolean;
14
+ }) => void;
15
+ captureLayout: (layoutId?: string) => void;
16
+ playLayoutTo: (target?: HTMLElement | DOMRect, options?: LayoutTransitionOptions & {
17
+ layoutId?: string;
18
+ }) => void;
19
+ /** 捕获当前 Frame 位置写入模块级 FLIP 注册表,无需 initMotion 上下文。 */
30
20
  captureFlip: (layoutId?: string) => void;
31
- /** 将当前 Frame 以 FLIP 方式过渡到目标位置,无需 Motion 上下文。 */
21
+ /** 将当前 Frame 以 FLIP 方式过渡到目标位置,无需 initMotion 上下文。 */
32
22
  playFlipTo: (target?: HTMLElement | DOMRect, options?: FlipTransitionOptions) => void;
23
+ reset: () => void;
24
+ pause: () => void;
33
25
  };
34
26
  }
@@ -1,63 +1,216 @@
1
1
  /* frame-motion.svelte.js generated by Svelte v5.56.4 */
2
2
  import * as $ from 'svelte/internal/client';
3
+ import { hasMotionConfig } from "./frame-utils.js";
3
4
  import { captureFlipRect, beginFlipEnter, applyFlipExit } from "./layout-flip.js";
4
5
 
5
6
  export class FrameMotion {
6
7
  #props;
8
+ #motion;
7
9
  #state;
10
+ #responsive;
8
11
  #getId;
9
12
  #getElement;
10
13
 
11
- constructor(props, state, getId, getElement) {
14
+ constructor(props, motion, state, responsive, getId, getElement) {
12
15
  this.#props = props;
16
+ this.#motion = motion;
13
17
  this.#state = state;
18
+ this.#responsive = responsive;
14
19
  this.#getId = getId;
15
20
  this.#getElement = getElement;
16
21
 
17
- // 注:OSS 不接受 FrameResponsive 参数(PRO 用它做 whileXs/Sm/... 断点 notify,
18
- // OSS 不向编排器 notify,断点动效由 frame-motion-defaults 写入 CSS bridge 完成)
19
- // === 独立 FLIP 进场 ===
20
- // layoutId/itemId 存在时尝试从模块注册表(layout-flip.ts)读取起点并播放进场动效。
21
- // 与 PRO 不同:OSS 不向 Motion 编排器注册,所以这是唯一的 FLIP 进场路径。
22
+ // 注册到编排器,并触发独立 FLIP 进场(无需 Motion 上下文)
22
23
  $.user_effect(() => {
24
+ const id = this.#getId();
23
25
  const element = this.#getElement();
26
+
27
+ // 独立 FLIP 进场:layoutId/itemId 存在时尝试从模块注册表读取起点
24
28
  const flipId = this.#props.itemId ?? this.#props.layoutId;
25
29
 
26
30
  if (flipId && element) {
27
31
  beginFlipEnter(flipId, element);
28
32
  }
33
+
34
+ if (!this.#motion || !this.shouldRegister || !element || !id) return;
35
+
36
+ return this.#motion.register({
37
+ id,
38
+ element,
39
+ timeline: this.#props.timeline,
40
+ scroll: this.#props.scroll,
41
+ layoutId: this.#props.itemId ?? this.#props.layoutId,
42
+ scope: this.#props.scope
43
+ });
44
+ });
45
+
46
+ // === 状态变化 -> 动效通知 (合并优化) ===
47
+ // 使用单一 effect 替代多个独立 effect,减少响应式订阅开销
48
+ // 缓存上一次的触发器状态,用于差量更新
49
+ let prevTriggerStates = {};
50
+
51
+ $.user_effect(() => {
52
+ if (!this.#motion) return;
53
+
54
+ // 收集所有触发器状态
55
+ const currentStates = {
56
+ whileHover: this.#state.hovered,
57
+ whileClick: this.#state.pressed,
58
+ whileFocus: this.#state.focused,
59
+ whileDrag: this.#state.isDragging,
60
+ whileScroll: this.#state.isScrolling,
61
+ whileKey: this.#state.isKeyActive,
62
+ whileLoad: this.#state.currentState === "StartLoad" || this.#state.currentState === "Load" || !!this.#props.loading,
63
+ whileReload: this.#state.currentState === "Reload" || !!this.#props.whileReload,
64
+ whileActive: this.#state.currentState === "Active" || !!this.#props.whileActive,
65
+ whileDisabled: this.#state.currentState === "Disabled" || !!this.#props.whileDisabled,
66
+ whileValidating: this.#state.currentState === "Validating" || !!this.#props.whileValidating,
67
+ whileUploading: this.#state.currentState === "Uploading" || !!this.#props.whileUploading,
68
+ whileEditing: this.#state.currentState === "Editing" || !!this.#props.whileEditing,
69
+ whileCollapsed: !!this.#props.collapsed,
70
+ whileExpanded: !!this.#props.expanded,
71
+ whileIdle: !this.#state.isAnyTriggerActive
72
+ };
73
+
74
+ // 仅通知发生变化的触发器
75
+ for (const [event, active] of Object.entries(currentStates)) {
76
+ if (prevTriggerStates[event] !== active) {
77
+ this.#notify(event, { active });
78
+ }
79
+ }
80
+
81
+ prevTriggerStates = currentStates;
82
+ });
83
+
84
+ // 生命周期通知 (单独保留,因为需要 cleanup)
85
+ $.user_effect(() => {
86
+ this.#notify("whileAppear", { active: true });
87
+
88
+ // === 编排触发逻辑 ===
89
+ // 根据 orchestrateTrigger 决定何时触发编排
90
+ const trigger = this.#props.orchestrateTrigger ?? "appear";
91
+
92
+ if (this.#props.orchestrate && trigger === "appear") {
93
+ const id = this.#getId();
94
+
95
+ if (id && this.#motion) {
96
+ // 使用微任务或下一帧确保子组件已挂载并注册
97
+ requestAnimationFrame(() => {
98
+ this.#motion?.Play(id);
99
+ });
100
+ }
101
+ }
102
+
103
+ return () => this.#notify("whileDisappear", { active: true });
104
+ });
105
+
106
+ // === orchestrateTrigger: hover ===
107
+ $.user_effect(() => {
108
+ const trigger = this.#props.orchestrateTrigger;
109
+
110
+ if (this.#props.orchestrate && trigger === "hover" && this.#state.hovered) {
111
+ const id = this.#getId();
112
+
113
+ if (id && this.#motion) {
114
+ this.#motion.Play(id);
115
+ }
116
+ }
117
+ });
118
+
119
+ // === orchestrateTrigger: click ===
120
+ $.user_effect(() => {
121
+ const trigger = this.#props.orchestrateTrigger;
122
+
123
+ if (this.#props.orchestrate && trigger === "click" && this.#state.pressed) {
124
+ const id = this.#getId();
125
+
126
+ if (id && this.#motion) {
127
+ this.#motion.Play(id);
128
+ }
129
+ }
130
+ });
131
+
132
+ // === orchestrateTrigger: scroll ===
133
+ $.user_effect(() => {
134
+ const trigger = this.#props.orchestrateTrigger;
135
+
136
+ if (this.#props.orchestrate && trigger === "scroll" && this.#state.isScrolling) {
137
+ const id = this.#getId();
138
+
139
+ if (id && this.#motion) {
140
+ this.#motion.Play(id);
141
+ }
142
+ }
29
143
  });
30
144
 
31
- // === whileScroll 触发器 ===
145
+ // 响应式断点通知
146
+ let prevBreakpoint;
147
+
148
+ $.user_effect(() => {
149
+ if (!this.#motion || !this.#responsive) return;
150
+
151
+ const breakpoint = this.#responsive.breakpoint;
152
+
153
+ if (!breakpoint || breakpoint === prevBreakpoint) return;
154
+
155
+ const eventMap = {
156
+ xs: "whileXs",
157
+ sm: "whileSm",
158
+ md: "whileMd",
159
+ lg: "whileLg",
160
+ xl: "whileXl",
161
+ "2xl": "while2xl"
162
+ };
163
+
164
+ const eventName = eventMap[breakpoint];
165
+
166
+ if (eventName) this.#notify(eventName, { active: true });
167
+
168
+ prevBreakpoint = breakpoint;
169
+ });
170
+
171
+ // Setup whileScroll trigger
32
172
  $.user_effect(() => {
33
173
  if (this.#props.whileScroll) {
34
174
  return this.#setupWhileScroll();
35
175
  }
36
176
  });
37
-
38
- // 注:OSS 不实现 PRO 的以下能力
39
- // - 注册到 Motion 编排器(PRO line 49-58)
40
- // - 状态→Motion notify 差量更新(PRO line 67-111)
41
- // - 生命周期 whileAppear/whileDisappear notify(PRO line 114-132)
42
- // - orchestrateTrigger: appear/hover/click/scroll(PRO line 121-165)
43
- // - 响应式断点 whileXs/Sm/Md/Lg/Xl/2xl notify(PRO line 168-185)
44
- //
45
- // 在 OSS 中:
46
- // - 状态驱动的视觉变化(hover/focus/active 等)通过 frame-inline-style 注入的 CSS bridge
47
- // 变量配合组件 CSS 的 transition 实现,由浏览器原生执行
48
- // - whileAppear 生命周期进入组合动效通过 frame-motion-defaults 写入 CSS 变量后
49
- // 组件 CSS / Frame 默认 CSS 完成
50
- // - 跨组件编排(orchestrate*)属 PRO,OSS 静默忽略相关 props
51
177
  }
52
178
 
53
- /** OSS 不需要 shouldRegister 概念,但保留 getter 以兼容旧调用方(始终返回 false) */
54
179
  get shouldRegister() {
55
- return false;
180
+ const id = this.#getId();
181
+
182
+ return !!id || hasMotionConfig(this.#props);
56
183
  }
57
184
 
58
185
  get controller() {
59
186
  return {
60
- /** 捕获当前 Frame 位置写入模块级 FLIP 注册表,无需 Motion 上下文。 */
187
+ play: (options) => {
188
+ const id = this.#getId();
189
+
190
+ if (id && this.#motion) this.#motion.Play(id, options);
191
+ },
192
+
193
+ captureLayout: (layoutId) => {
194
+ const id = layoutId ?? this.#props.itemId ?? this.#props.layoutId ?? this.#getId();
195
+ const element = this.#getElement();
196
+
197
+ if (id && element && this.#motion) {
198
+ this.#motion.captureLayout(id, element);
199
+ }
200
+ },
201
+
202
+ playLayoutTo: (target, options) => {
203
+ const id = options?.layoutId ?? this.#props.itemId ?? this.#props.layoutId ?? this.#getId();
204
+ const element = this.#getElement();
205
+
206
+ if (id && element && this.#motion) {
207
+ this.#motion.playLayoutTo(id, element, target, options);
208
+ } else {
209
+ options?.onComplete?.();
210
+ }
211
+ },
212
+
213
+ /** 捕获当前 Frame 位置写入模块级 FLIP 注册表,无需 initMotion 上下文。 */
61
214
  captureFlip: (layoutId) => {
62
215
  const id = layoutId ?? this.#props.itemId ?? this.#props.layoutId ?? this.#getId();
63
216
  const element = this.#getElement();
@@ -65,7 +218,7 @@ export class FrameMotion {
65
218
  if (id && element) captureFlipRect(id, element);
66
219
  },
67
220
 
68
- /** 将当前 Frame 以 FLIP 方式过渡到目标位置,无需 Motion 上下文。 */
221
+ /** 将当前 Frame 以 FLIP 方式过渡到目标位置,无需 initMotion 上下文。 */
69
222
  playFlipTo: (target, options) => {
70
223
  const element = this.#getElement();
71
224
 
@@ -74,15 +227,28 @@ export class FrameMotion {
74
227
  } else {
75
228
  options?.onComplete?.();
76
229
  }
77
- }
230
+ },
231
+
232
+ reset: () => {
233
+ const id = this.#getId();
234
+
235
+ if (id && this.#motion) this.#motion.Reset(id);
236
+ },
78
237
 
79
- // 以下方法在 OSS 中不可用(需要 Motion 编排器):
80
- // - play / reset / pause(需要 Motion.Play/Reset/pause)
81
- // - captureLayout / playLayoutTo(需要 Motion.captureLayout/playLayoutTo)
82
- // 如需以上能力请使用 FramePro。
238
+ pause: () => {
239
+ // TODO
240
+ }
83
241
  };
84
242
  }
85
243
 
244
+ #notify(event, detail) {
245
+ const id = this.#getId();
246
+
247
+ if (!this.#motion || !this.shouldRegister || !id) return;
248
+
249
+ this.#motion.notify(id, event, detail);
250
+ }
251
+
86
252
  #setupWhileScroll() {
87
253
  const element = this.#getElement();
88
254
 
@@ -1,17 +1,5 @@
1
- /**
2
- * OSS Frame 状态机(v1.0.0 起在 OSS)
3
- *
4
- * 与 PRO 版本(components/src/logic/frame-pro-state.svelte.ts)的差异:
5
- * - 不含 §8 联动控制(linkageControl / Motion 依赖)
6
- * - 构造函数不接收 motion 参数
7
- * - 事件处理器中的 `if ("target" in config) { ... }` 分支被剥离
8
- *
9
- * 作用半径:1 个 Frame(仅修改自身 currentState 与交互状态)
10
- *
11
- * PRO 版本独立维护一份完整实现,FramePro 使用 PRO 版本。
12
- * 详见 ../components/Frame.md §1 切割原则与 /Frame-Refactor-Plan.md §3.4。
13
- */
14
1
  import type { FrameProps, CoreState } from "./frame-types";
2
+ import type { Motion } from "./motion.js";
15
3
  export declare class FrameState {
16
4
  #private;
17
5
  hovered: boolean;
@@ -21,7 +9,7 @@ export declare class FrameState {
21
9
  isScrolling: boolean;
22
10
  isKeyActive: boolean;
23
11
  currentState: CoreState;
24
- constructor(props: FrameProps);
12
+ constructor(props: FrameProps, motion?: Motion | undefined);
25
13
  get interactionState(): (string & {}) | "StartLoad" | "Load" | "Reload" | "Appear" | "Disappear" | "Idle" | "Active" | "Disabled" | "Validating" | "Uploading" | "Editing" | "Click" | "Hover" | "Focus" | "Drag" | "Scroll";
26
14
  get isAnyTriggerActive(): boolean | undefined;
27
15
  handleClick: (e: MouseEvent) => void;
@@ -4,6 +4,7 @@ import { resolveFrameWhileMotionConfig } from "./frame-motion-defaults.js";
4
4
 
5
5
  export class FrameState {
6
6
  #props;
7
+ #motion;
7
8
 
8
9
  #hovered = // === 交互状态 (Internal Interaction States) ===
9
10
  $.state(false);
@@ -76,8 +77,9 @@ export class FrameState {
76
77
  $.set(this.#currentState, value, true);
77
78
  }
78
79
 
79
- constructor(props) {
80
+ constructor(props, motion = undefined) {
80
81
  this.#props = props;
82
+ this.#motion = motion;
81
83
 
82
84
  $.user_effect(() => {
83
85
  const controlledState = this.#props.currentState;
@@ -230,7 +232,7 @@ export class FrameState {
230
232
  return false;
231
233
  }
232
234
 
233
- // 这些字段属于普通 Trigger/Linkage 配置,不视为"按状态映射"
235
+ // 这些字段属于普通 Trigger/Linkage 配置,不视为“按状态映射”
234
236
  const reservedKeys = [
235
237
  "run",
236
238
  "target",
@@ -289,8 +291,9 @@ export class FrameState {
289
291
  this.currentState = config.next;
290
292
  }
291
293
 
292
- // OSS Frame 不支持 §8 联动控制 (Click={{target, action}})。
293
- // 配置中带 target 字段时,OSS 会忽略;如需联动控制请使用 FramePro。
294
+ if ("target" in config) {
295
+ this.#handleLinkageControl(config);
296
+ }
294
297
  }
295
298
  }
296
299
 
@@ -341,7 +344,9 @@ export class FrameState {
341
344
  Hover.run(e);
342
345
  }
343
346
 
344
- // OSS 忽略 target/action(§8 联动控制属 PRO)
347
+ if ("target" in Hover) {
348
+ this.#handleLinkageControl(Hover);
349
+ }
345
350
  }
346
351
  }
347
352
  };
@@ -400,7 +405,9 @@ export class FrameState {
400
405
  Focus.run(e);
401
406
  }
402
407
 
403
- // OSS 忽略 target/action(§8 联动控制属 PRO)
408
+ if ("target" in Focus) {
409
+ this.#handleLinkageControl(Focus);
410
+ }
404
411
  }
405
412
  }
406
413
  };
@@ -422,9 +429,9 @@ export class FrameState {
422
429
  Key.run(e);
423
430
  } else if ("state" in Key) {
424
431
  this.currentState = Key.state;
432
+ } else if ("target" in Key) {
433
+ this.#handleLinkageControl(Key);
425
434
  }
426
-
427
- // OSS 忽略 target/action(§8 联动控制属 PRO)
428
435
  }
429
436
  };
430
437
 
@@ -467,7 +474,9 @@ export class FrameState {
467
474
  Drag.run(e);
468
475
  }
469
476
 
470
- // OSS 忽略 target/action(§8 联动控制属 PRO)
477
+ if ("target" in Drag) {
478
+ this.#handleLinkageControl(Drag);
479
+ }
471
480
  }
472
481
  }
473
482
  };
@@ -484,4 +493,46 @@ export class FrameState {
484
493
  handleScroll = (_e) => {
485
494
  // Reserved
486
495
  };
496
+
497
+ #handleLinkageControl(config) {
498
+ if (config.target) {
499
+ // 1. Resolve Target Controller
500
+ let controller;
501
+
502
+ if (typeof config.target === 'string') {
503
+ // String ID -> Use internal motion instance
504
+ // No controller object for string IDs, handled in step 2 directly via this.#motion
505
+ } else if (typeof config.target === 'object') {
506
+ // Object Ref -> Try to get controller
507
+ // Case A: Svelte 5 bind:this instance with exported getController
508
+ if ('getController' in config.target && typeof config.target.getController === 'function') {
509
+ controller = config.target.getController();
510
+ } else // Case B: Maybe it IS the controller?
511
+ {
512
+ controller = config.target;
513
+ }
514
+ }
515
+
516
+ // 2. Execute Action
517
+ if (typeof config.target === 'string' && this.#motion) {
518
+ // Legacy String ID Logic
519
+ if (config.action === "play") {
520
+ this.#motion.Play(config.target, { reverse: config.reverse });
521
+ } else if (config.action === "reset") {
522
+ this.#motion.Reset(config.target);
523
+ } else if (config.action === "pause") {
524
+ this.#motion.pause(config.target);
525
+ }
526
+ } else if (controller) {
527
+ // Object Controller Logic
528
+ if (config.action === "play" && controller.play) {
529
+ controller.play({ reverse: config.reverse });
530
+ } else if (config.action === "reset" && controller.reset) {
531
+ controller.reset();
532
+ } else if (config.action === "pause" && controller.pause) {
533
+ controller.pause();
534
+ }
535
+ }
536
+ }
537
+ }
487
538
  }