@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.
@@ -0,0 +1,3 @@
1
+ /** Self-contained native DSH chunk, shared by Web and Desktop transports. */
2
+ export { installComposerBloub } from './bloub-heixiu/runtime.js';
3
+ //# sourceMappingURL=companion-entry.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Self-contained native DSH chunk, shared by Web and Desktop transports. */
2
+ export { installComposerBloub } from './bloub-heixiu/runtime.js';
3
+ //# sourceMappingURL=companion-entry.js.map
@@ -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>): () => void;
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('[data-slot="sidebar"]'))
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 { installComposerBloub } from './bloub-heixiu/runtime.js';
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(() => installComposerBloub(undefined, heixiuSignals), 'xiaohei-theme: mount bloub Heixiu beside composer');
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.5",
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",