@deepseek-ai/dsh-client-ui-dockkit 0.1.7-rc.2 → 0.2.0-rc.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.
package/README.i18n.yaml CHANGED
@@ -18,8 +18,8 @@
18
18
  en: ea872ff2c2089037
19
19
  zh: b3ec3a218eacd5c8
20
20
  /deepseek-ai-dsh-client-ui-dockkit/embedding-it:
21
- en: 789c879dd83f463a
22
- zh: 37f2dc45f9588810
21
+ en: 47b9852393643b6a
22
+ zh: ce5f2ab60eec9564
23
23
  /deepseek-ai-dsh-client-ui-dockkit/interaction-rules-worth-keeping:
24
24
  en: 7e5c1e9a9f9f244f
25
25
  zh: 7e3a8fcef86bc7dd
package/README.md CHANGED
@@ -60,7 +60,7 @@ A tab's `kind` is an opaque string. Seeded tabs are factories (`DockControllerOp
60
60
 
61
61
  `DockLayout`, used by the Sidebar, keeps each tab in a stable DOM cell across selection, pane moves and floating. It accepts one docked pane or two horizontal panes; CSS Grid resolves their widths. `keepMounted(tab)` retains visited bodies and `active` controls Session visibility without reparenting content.
62
62
 
63
- `DockSurface` is the docked area for the separate recursive renderer. Chrome around it — a rail, a collapsed presentation, any history controls — belongs to the embedder, which reads `state.expanded` and decides; the kit ships no undo/redo control of its own. Surface-wide controls the embedder does want on the surface go through the `chrome` prop, which the kit places at the far end of the top-right pane's tab strip (the last child of every row split, the first of every column split), so a surface needs no header row of its own. `FloatLayer` owns its own gestures and positions panels in viewport coordinates, so it may be mounted anywhere, including a portal.
63
+ `DockSurface` is the docked area for the separate recursive renderer. Chrome around it — a rail, a collapsed presentation, any history controls — belongs to the embedder, which reads `state.expanded` and decides; the kit ships no undo/redo control of its own. Surface-wide controls the embedder does want on the surface go through the `chrome` prop, which the kit places at the far end of the top-right pane's tab strip (the last child of every row split, the first of every column split), so a surface needs no header row of its own. `FloatLayer` owns its own gestures and positions panels in viewport coordinates, so it may be mounted anywhere, including a portal. Both float renderers keep the header at least 20px below the Windows caption (20px below the viewport top in native fullscreen), including newly opened and restored panels. Dragging and resizing start at the displayed position.
64
64
 
65
65
  <a id="interaction-rules-worth-keeping"></a>
66
66
  ## Interaction rules worth keeping
package/README.zh.md CHANGED
@@ -60,7 +60,7 @@ tab 的 `kind` 是不透明字符串。种子 tab 是工厂(`DockControllerOpt
60
60
 
61
61
  Sidebar 使用的 `DockLayout` 在选中项变化、跨格移动与浮动期间,把每个 tab 保留在稳定的 DOM 容器中。它接受一个停靠格或左右两个格,由 CSS Grid 计算宽度。`keepMounted(tab)` 保留已访问正文,`active` 控制 Session 可见性,不改变内容的父子关系。
62
62
 
63
- `DockSurface` 是独立递归渲染器的停靠区。它周围的 chrome——轨道、折叠形态、任何历史控件——属于嵌入方,由嵌入方读取 `state.expanded` 后自行决定;套件不自带撤销/重做控件。嵌入方确实想放到面上的整面控件通过 `chrome` prop 传入,套件把它放在右上格 tab 条的最末端(每个横向分裂的最后一个子节点、每个纵向分裂的第一个子节点),因此停靠面不需要自己的标题行。`FloatLayer` 拥有自己的手势并以视口坐标定位浮窗,因此可以挂在任何位置,包括 portal 里。
63
+ `DockSurface` 是独立递归渲染器的停靠区。它周围的 chrome——轨道、折叠形态、任何历史控件——属于嵌入方,由嵌入方读取 `state.expanded` 后自行决定;套件不自带撤销/重做控件。嵌入方确实想放到面上的整面控件通过 `chrome` prop 传入,套件把它放在右上格 tab 条的最末端(每个横向分裂的最后一个子节点、每个纵向分裂的第一个子节点),因此停靠面不需要自己的标题行。`FloatLayer` 拥有自己的手势并以视口坐标定位浮窗,因此可以挂在任何位置,包括 portal 里。 两种浮窗渲染器都让标题栏与 Windows 顶栏至少间隔 20px(原生全屏时距视口顶部 20px),新建和恢复的浮窗均适用。拖动和调整大小从实际显示位置开始。
64
64
 
65
65
  <a id="interaction-rules-worth-keeping"></a>
66
66
  ## 值得保留的交互规则
@@ -739,6 +739,14 @@
739
739
  height: 40%;
740
740
  }
741
741
 
742
+ :global(html[data-windows-titlebar]) .float {
743
+ --dsh-dockkit-float-top: calc(var(--dsh-windows-titlebar-height) + 20px);
744
+ }
745
+
746
+ :global(html[data-windows-titlebar][data-fullscreen]) .float {
747
+ --dsh-dockkit-float-top: 20px;
748
+ }
749
+
742
750
  .float {
743
751
  position: fixed;
744
752
  display: flex;
package/lib/index.js CHANGED
@@ -2877,11 +2877,19 @@ function useFloatGestures(state, intents) {
2877
2877
  /** Start a move or resize from a press on the panel's grip or corner; a release that moved nothing is a click. */
2878
2878
  const drag = (mode, paneId, event) => {
2879
2879
  event.stopPropagation();
2880
+ const root = document.documentElement;
2881
+ const windows = root.hasAttribute("data-windows-titlebar");
2882
+ const caption = windows && !root.hasAttribute("data-fullscreen") ? Number.parseFloat(root.style.getPropertyValue("--dsh-windows-titlebar-height")) : 0;
2883
+ const saved = floatRect(getPane(state, paneId));
2884
+ const rect = {
2885
+ ...saved,
2886
+ y: Math.max(saved.y, windows ? caption + 20 : 0)
2887
+ };
2880
2888
  const start = {
2881
2889
  mode,
2882
2890
  originX: event.clientX,
2883
2891
  originY: event.clientY,
2884
- rect: floatRect(getPane(state, paneId))
2892
+ rect
2885
2893
  };
2886
2894
  begin(event.currentTarget, event.pointerId, {
2887
2895
  move: (moved) => {
@@ -2978,7 +2986,7 @@ function FloatLayer({ state, intents, labels, renderTab, renderTabTitle, canClos
2978
2986
  "data-dockkit-float-active": state.activePaneId === paneId || void 0,
2979
2987
  style: {
2980
2988
  left: live.x,
2981
- top: live.y,
2989
+ top: `max(var(--dsh-dockkit-float-top, 0px), ${live.y}px)`,
2982
2990
  width: live.width,
2983
2991
  height: live.height,
2984
2992
  zIndex: lifted === void 0 ? depth + 1 : state.floats.length + 1
@@ -3084,7 +3092,7 @@ function TabHost({ state, callbacks, intents, tab, pane, column, floats, focusRe
3084
3092
  "data-dockkit-column": !floating ? column : void 0,
3085
3093
  style: rect === void 0 ? void 0 : {
3086
3094
  left: rect.x,
3087
- top: rect.y,
3095
+ top: `max(var(--dsh-dockkit-float-top, 0px), ${rect.y}px)`,
3088
3096
  width: rect.width,
3089
3097
  height: rect.height
3090
3098
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-client-ui-dockkit",
3
3
  "description": "Docking layout kit: split-tree engine with invertible operations, and the React components that render and drive it (zero cordis)",
4
- "version": "0.1.7-rc.2",
4
+ "version": "0.2.0-rc.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -29,9 +29,9 @@
29
29
  "react-dom": "^18.2.0",
30
30
  "react": "^18.2.0",
31
31
  "clsx": "^2.0.0",
32
- "@deepseek-ai/dsh-client-ui-primitives": "0.1.7-rc.2",
33
- "@deepseek-ai/cordis": "~4.0.4",
34
- "@deepseek-ai/dsh-brand": "0.1.7-rc.2"
32
+ "@deepseek-ai/dsh-brand": "0.2.0-rc.1",
33
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.1",
34
+ "@deepseek-ai/cordis": "~4.0.4"
35
35
  },
36
36
  "files": [
37
37
  "lib/index.js",