@oh-story/dsh 0.1.5 → 0.1.6
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.md +3 -3
- package/lib/client.js +24 -9
- package/lib/client.js.map +2 -2
- package/lib/types/client/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
## 安装
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
npx -y @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add @oh-story/dsh@0.1.
|
|
24
|
+
npx -y @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add @oh-story/dsh@0.1.6
|
|
25
25
|
npx -y @deepseek-ai/dsh@0.1.2-alpha.3 web
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
也可以直接安装 GitHub Release 中的预构建包:
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
npx -y @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add https://github.com/zenstory-ai/oh-story-dsh/releases/download/v0.1.
|
|
31
|
+
npx -y @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile web add https://github.com/zenstory-ai/oh-story-dsh/releases/download/v0.1.6/oh-story-dsh-0.1.6.tgz
|
|
32
32
|
npx -y @deepseek-ai/dsh@0.1.2-alpha.3 web
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -67,7 +67,7 @@ Drama Skills 0.6.0 不支持把 v0.5 结构化项目原地升级为 creator-firs
|
|
|
67
67
|
插件装进哪个 profile,那个 profile 的每个 Session 就都会加载创作 Skills 与三栏工作台。想让原版 `web` 保持干净、只在创作时打开工作台,就装进独立 profile:
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
|
-
npx -y @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile story add @oh-story/dsh@0.1.
|
|
70
|
+
npx -y @deepseek-ai/dsh@0.1.2-alpha.3 plugin --profile story add @oh-story/dsh@0.1.6
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
新 profile 默认没有界面。编辑 `~/.dsh/profiles/story/package.json`,把 `dsh.profile.bundles` 改成 `["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "@oh-story/dsh"]`,顺序照抄,这个包不用另外安装。
|
package/lib/client.js
CHANGED
|
@@ -3914,22 +3914,37 @@ function CreativeSplitBridge({ sessionId, useSession, useChat, useStore, actions
|
|
|
3914
3914
|
}, [sessionId]), (0, import_react3.useLayoutEffect)(() => {
|
|
3915
3915
|
let scroller = target?.parentElement;
|
|
3916
3916
|
if (scroller == null) return;
|
|
3917
|
-
let composerSeat = () => scroller.querySelector(":scope > [data-composer-seat]"),
|
|
3918
|
-
|
|
3917
|
+
let composerSeat = () => scroller.querySelector(":scope > [data-composer-seat]"), parkedAtTail = () => scroller.scrollHeight - scroller.scrollTop - scroller.clientHeight <= 8, parked = parkedAtTail(), drivenAt = 0, markDriven = (event) => {
|
|
3918
|
+
event.target instanceof Node && composerSeat()?.contains(event.target) === !0 || (drivenAt = performance.now());
|
|
3919
|
+
}, trackParked = () => {
|
|
3920
|
+
parkedAtTail() ? parked = !0 : performance.now() - drivenAt < 400 && (parked = !1);
|
|
3921
|
+
}, publishLayout = () => {
|
|
3919
3922
|
scroller.style.setProperty("--oh-story-scroll-height", `${String(scroller.clientHeight)}px`), scroller.style.setProperty("--oh-story-composer-height", `${String(composerSeat()?.getBoundingClientRect().height ?? 0)}px`), scroller.dataset.ohStoryWorkbench = workbench;
|
|
3920
3923
|
let studioPane = workbench === "video" ? videoPane : gamePane;
|
|
3921
3924
|
scroller.dataset.ohStudioPane = studioPane;
|
|
3922
3925
|
let compactAt = workbench === "game" || workbench === "video" ? 720 : 620, mediumAt = workbench === "game" || workbench === "video" ? 960 : 900, layout = scroller.clientWidth < compactAt ? "compact" : scroller.clientWidth < mediumAt ? "medium" : "wide";
|
|
3923
|
-
scroller.dataset.ohStoryLayout !== layout && (scroller.dataset.ohStoryLayout = layout),
|
|
3924
|
-
}, observer = new ResizeObserver(publishLayout), observed = /* @__PURE__ */ new WeakSet(),
|
|
3925
|
-
let
|
|
3926
|
-
|
|
3926
|
+
scroller.dataset.ohStoryLayout !== layout && (scroller.dataset.ohStoryLayout = layout), parked && (scroller.scrollTop = scroller.scrollHeight - scroller.clientHeight);
|
|
3927
|
+
}, observer = new ResizeObserver(publishLayout), observed = /* @__PURE__ */ new WeakSet(), flowObserved = !1, observePanes = () => {
|
|
3928
|
+
let flow = scroller.querySelector("[data-chat-flow]");
|
|
3929
|
+
flowObserved = flow !== null;
|
|
3930
|
+
for (let pane of [composerSeat(), flow])
|
|
3931
|
+
pane === null || observed.has(pane) || (observed.add(pane), observer.observe(pane));
|
|
3927
3932
|
};
|
|
3928
|
-
publishLayout(),
|
|
3933
|
+
publishLayout(), scroller.addEventListener("scroll", trackParked, { passive: !0 });
|
|
3934
|
+
for (let driven of ["wheel", "touchmove", "pointerdown", "keydown"])
|
|
3935
|
+
scroller.addEventListener(driven, markDriven, { passive: !0 });
|
|
3936
|
+
observer.observe(scroller), observePanes();
|
|
3929
3937
|
let seats = new MutationObserver(() => {
|
|
3930
|
-
|
|
3938
|
+
observePanes(), publishLayout();
|
|
3931
3939
|
});
|
|
3932
|
-
|
|
3940
|
+
seats.observe(scroller, { childList: !0 });
|
|
3941
|
+
let panes = new MutationObserver(() => {
|
|
3942
|
+
flowObserved || observePanes();
|
|
3943
|
+
});
|
|
3944
|
+
return panes.observe(scroller, { childList: !0, subtree: !0 }), () => {
|
|
3945
|
+
panes.disconnect(), scroller.removeEventListener("scroll", trackParked);
|
|
3946
|
+
for (let driven of ["wheel", "touchmove", "pointerdown", "keydown"])
|
|
3947
|
+
scroller.removeEventListener(driven, markDriven);
|
|
3933
3948
|
observer.disconnect(), seats.disconnect(), scroller.style.removeProperty("--oh-story-scroll-height"), scroller.style.removeProperty("--oh-story-composer-height"), delete scroller.dataset.ohStoryLayout, delete scroller.dataset.ohStoryWorkbench, delete scroller.dataset.ohStudioPane;
|
|
3934
3949
|
};
|
|
3935
3950
|
}, [gamePane, target, videoPane, workbench]), /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|