@lemoncat7/dsh-theme-xiaohei 0.4.5 → 0.4.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 +18 -91
- package/docs/releases/0.4.6.md +17 -0
- package/docs/releases/README.md +14 -0
- package/lib/bloub-heixiu/layout.d.ts +16 -0
- package/lib/bloub-heixiu/layout.js +14 -0
- package/lib/bloub-heixiu/runtime.js +41 -10
- package/lib/client.companion.js +100 -0
- package/lib/client.decorations.js +1 -1
- package/lib/client.js +32 -128
- package/lib/companion-entry.d.ts +3 -0
- package/lib/companion-entry.js +3 -0
- package/lib/deferred-companion.d.ts +5 -0
- package/lib/deferred-companion.js +9 -0
- package/lib/deferred-decorations.d.ts +1 -1
- package/lib/deferred-decorations.js +2 -2
- package/lib/host-dom.d.ts +1 -1
- package/lib/host-dom.js +6 -2
- package/lib/plugin.js +2 -2
- package/package.json +2 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type * as Companion from './companion-entry.js';
|
|
2
|
+
import type { HeixiuSignals } from './bloub-heixiu/signals.js';
|
|
3
|
+
/** Keep the SVG engine and its initialization off the conversation's first paint. */
|
|
4
|
+
export declare function installDeferredCompanion(signals: HeixiuSignals, doc?: Document | undefined, load?: () => Promise<typeof Companion>): () => void;
|
|
5
|
+
//# sourceMappingURL=deferred-companion.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { installDeferredDecorations } from './deferred-decorations.js';
|
|
2
|
+
/** Keep the SVG engine and its initialization off the conversation's first paint. */
|
|
3
|
+
export function installDeferredCompanion(signals, doc = typeof document === 'undefined' ? undefined : document, load = () => require.async('./client.companion.js')) {
|
|
4
|
+
return installDeferredDecorations(doc, async () => {
|
|
5
|
+
const module = await load();
|
|
6
|
+
return { installDecorations: (target) => module.installComposerBloub(target, signals) };
|
|
7
|
+
}, '#root [data-composer-card="true"]');
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=deferred-companion.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type * as Decorations from './decorations-entry.js';
|
|
2
|
-
export declare function installDeferredDecorations(doc?: Document | undefined, load?: () => Promise<typeof Decorations
|
|
2
|
+
export declare function installDeferredDecorations(doc?: Document | undefined, load?: () => Promise<typeof Decorations>, readySelector?: string): () => void;
|
|
3
3
|
//# sourceMappingURL=deferred-decorations.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { subscribeXiaoheiHostDom } from './host-dom.js';
|
|
2
|
-
export function installDeferredDecorations(doc = typeof document === 'undefined' ? undefined : document, load = () => require.async('./client.decorations.js')) {
|
|
2
|
+
export function installDeferredDecorations(doc = typeof document === 'undefined' ? undefined : document, load = () => require.async('./client.decorations.js'), readySelector = '[data-slot="sidebar"]') {
|
|
3
3
|
const win = doc?.defaultView;
|
|
4
4
|
if (!doc || !win)
|
|
5
5
|
return () => { };
|
|
@@ -22,7 +22,7 @@ export function installDeferredDecorations(doc = typeof document === 'undefined'
|
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
const check = () => {
|
|
25
|
-
if (disposed || started || !doc.querySelector(
|
|
25
|
+
if (disposed || started || !doc.querySelector(readySelector))
|
|
26
26
|
return;
|
|
27
27
|
started = true;
|
|
28
28
|
unsubscribe();
|
package/lib/host-dom.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** A listener that reconciles plugin-owned DOM after the DSH host tree changes. */
|
|
2
|
-
export type XiaoheiHostDomListener = () => void;
|
|
2
|
+
export type XiaoheiHostDomListener = (records: readonly MutationRecord[]) => void;
|
|
3
3
|
/**
|
|
4
4
|
* Share one batched body observer across all runtime theme behaviours.
|
|
5
5
|
*
|
package/lib/host-dom.js
CHANGED
|
@@ -17,22 +17,26 @@ export function subscribeXiaoheiHostDom(doc, listener) {
|
|
|
17
17
|
const nextHub = {
|
|
18
18
|
listeners,
|
|
19
19
|
queued: false,
|
|
20
|
+
records: [],
|
|
20
21
|
};
|
|
21
22
|
const flush = () => {
|
|
22
23
|
nextHub.queued = false;
|
|
23
24
|
delete nextHub.frame;
|
|
24
25
|
if (hubs.get(doc) !== nextHub)
|
|
25
26
|
return;
|
|
27
|
+
const records = nextHub.records;
|
|
28
|
+
nextHub.records = [];
|
|
26
29
|
for (const subscriber of [...listeners]) {
|
|
27
30
|
try {
|
|
28
|
-
subscriber();
|
|
31
|
+
subscriber(records);
|
|
29
32
|
}
|
|
30
33
|
catch (error) {
|
|
31
34
|
win.setTimeout(() => { throw error; }, 0);
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
37
|
};
|
|
35
|
-
nextHub.observer = new win.MutationObserver(() => {
|
|
38
|
+
nextHub.observer = new win.MutationObserver((records = []) => {
|
|
39
|
+
nextHub.records.push(...records);
|
|
36
40
|
if (nextHub.queued)
|
|
37
41
|
return;
|
|
38
42
|
nextHub.queued = true;
|
package/lib/plugin.js
CHANGED
|
@@ -6,7 +6,7 @@ import { installXiaoheiPluginLoading } from './loading-heixiu.js';
|
|
|
6
6
|
import { installDeferredDecorations } from './deferred-decorations.js';
|
|
7
7
|
import { installXiaoheiScene } from './scene/runtime.js';
|
|
8
8
|
import { installXiaoheiSidebarGlass } from './sidebar-glass.js';
|
|
9
|
-
import {
|
|
9
|
+
import { installDeferredCompanion } from './deferred-companion.js';
|
|
10
10
|
import { bindHeixiuSessions, createHeixiuSignals } from './bloub-heixiu/signals.js';
|
|
11
11
|
import { XIAOHEI_THEME_TOKEN_OVERRIDES } from './theme.js';
|
|
12
12
|
import { XiaoheiBrandName, XiaoheiMetallicBrandMark } from './metallic-brand-mark.js';
|
|
@@ -54,7 +54,7 @@ function installXiaoheiTheme(ctx) {
|
|
|
54
54
|
ctx.effect(installDeferredDecorations, 'xiaohei-theme: load decorations after first paint');
|
|
55
55
|
ctx.effect(installXiaoheiSidebarGlass, 'xiaohei-theme: install isolated sidebar glass');
|
|
56
56
|
const heixiuSignals = createHeixiuSignals();
|
|
57
|
-
ctx.effect(() =>
|
|
57
|
+
ctx.effect(() => installDeferredCompanion(heixiuSignals), 'xiaohei-theme: mount Heixiu after conversation paint');
|
|
58
58
|
ctx.inject(['sessions'], ready => bindHeixiuSessions(ready.sessions, heixiuSignals));
|
|
59
59
|
}
|
|
60
60
|
//# sourceMappingURL=plugin.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemoncat7/dsh-theme-xiaohei",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "A Luo Xiaohei-inspired animated dark theme for DeepSeek Harness",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
|
+
"docs/releases/0.4.6.md",
|
|
29
30
|
"docs/releases/0.4.5.md",
|
|
30
31
|
"docs/startup-audit-20261013.md",
|
|
31
32
|
"docs/releases/0.4.4.md",
|