@lmzhen/dsh-evolution-client-kit 0.37.1 → 0.39.0

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/lib/index.js CHANGED
@@ -9,6 +9,12 @@ import { createElement, useState } from "react";
9
9
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
10
10
  //#endregion
11
11
  //#region lib/types/panel.js
12
+ /** Fail loud when a client bundle is mounted without the shell seats it consumes. */
13
+ function requireClientSeats(ctx, owner) {
14
+ const candidate = ctx;
15
+ if (candidate.slots === void 0 || candidate.locale === void 0) throw new Error(owner + ": the client slots/locale seats are not mounted");
16
+ return candidate;
17
+ }
12
18
  function interpolate(text, values) {
13
19
  if (values === void 0) return text;
14
20
  return text.replace(/\{(\w+)\}/g, (_match, key) => String(values[key] ?? ""));
@@ -604,6 +610,29 @@ function EmptyState({ title, description, tone = "neutral", primary, secondary,
604
610
  }, createElement("h2", { "data-role": "empty-title" }, title), description === void 0 || description === "" ? null : createElement("p", { "data-role": "empty-description" }, description), actions);
605
611
  }
606
612
  //#endregion
613
+ //#region lib/types/presentation/table.js
614
+ /**
615
+ * Responsive table contract shared by family panels.
616
+ *
617
+ * Markup: wrap any table in an element carrying data-evo-table-wrap. At a
618
+ * narrow container (including a 200% browser zoom) the rows become stacked
619
+ * definition blocks: rule/name on its own line, the metric on the next, so a
620
+ * fixed numeric column can never squeeze a label to one character.
621
+ */
622
+ const RESPONSIVE_TABLE_CSS = [
623
+ "[data-evo-table-wrap]{container-type:inline-size;}",
624
+ "@container (max-width: 700px) {",
625
+ " [data-evo-table-wrap] table{display:block;width:100%;table-layout:auto;border:0;}",
626
+ " [data-evo-table-wrap] thead{display:none;}",
627
+ " [data-evo-table-wrap] tbody{display:flex;flex-direction:column;gap:var(--evo-space-4);}",
628
+ " [data-evo-table-wrap] tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--evo-space-2) var(--evo-space-8);padding:var(--evo-space-6) var(--evo-space-8);border:var(--evo-hairline-width) solid var(--dsw-alias-border-l1);border-radius:var(--evo-radius-control);}",
629
+ " [data-evo-table-wrap] td{display:block;padding:0;text-align:left;white-space:normal;overflow-wrap:anywhere;}",
630
+ " [data-evo-table-wrap] td[data-role=\"rule-name\"], [data-evo-table-wrap] td[data-role=\"name\"]{grid-column:1/-1;font-weight:500;}",
631
+ " [data-evo-table-wrap] td[data-role=\"rule-count\"], [data-evo-table-wrap] td[data-role=\"count\"]{grid-column:2;text-align:right;font-variant-numeric:tabular-nums;}",
632
+ " [data-evo-table-wrap] td[data-role=\"skills\"]{grid-column:1/-1;}",
633
+ "}"
634
+ ].join(String.fromCharCode(10));
635
+ //#endregion
607
636
  //#region lib/types/presentation/disclosure-group.js
608
637
  /** A native details group for normal/secondary facts. */
609
638
  /** Render a closed-by-default disclosure without introducing another accordion model. */
@@ -831,4 +860,4 @@ function createSettingsGatewayCache(binder, api) {
831
860
  };
832
861
  }
833
862
  //#endregion
834
- export { ActionMenu, AsyncResource, Block, CommandCopyButton, DecisionFrame, DisclosureGroup, EmptyState, FALLBACKS, FailureBlock, FilterChip, PAGE_SURFACE_CLASS, PAGE_SURFACE_CSS, PLATFORM_MENU, ROUTES, StateNotice, StatusChip, TOKENS, TOKEN_CSS, TaskBanner, TimeText, copyAction, createSettingsGatewayCache, createSettingsSeat, failureText, formatLocalClock, formatLocalDateTime, isSameLocalDay, loadStateOf, menuPrimitivesFrom, panelWorkspaceId, registerSidebarPanel, registerWorkbenchView, renderPlatformMenu, saveSettings, tokenVars };
863
+ export { ActionMenu, AsyncResource, Block, CommandCopyButton, DecisionFrame, DisclosureGroup, EmptyState, FALLBACKS, FailureBlock, FilterChip, PAGE_SURFACE_CLASS, PAGE_SURFACE_CSS, PLATFORM_MENU, RESPONSIVE_TABLE_CSS, ROUTES, StateNotice, StatusChip, TOKENS, TOKEN_CSS, TaskBanner, TimeText, copyAction, createSettingsGatewayCache, createSettingsSeat, failureText, formatLocalClock, formatLocalDateTime, isSameLocalDay, loadStateOf, menuPrimitivesFrom, panelWorkspaceId, registerSidebarPanel, registerWorkbenchView, renderPlatformMenu, requireClientSeats, saveSettings, tokenVars };
@@ -1,6 +1,6 @@
1
1
  /** Shared browser seams and panel lifecycle for the evolution family. */
2
2
  export type { ClientSeam, ConfigFormLike, ConfigFormSnapshotLike, ConfigFormsSeat, ConfigPathOpLike, ConfigWriteKind, ConfigWriteOutcome, LocaleSeat, PanelBodyOptions, PanelRowOptions, SettingsFace, SlotsSeat } from './seam.ts';
3
- export { registerSidebarPanel, type SidebarPanelSpec, type Translate } from './panel.ts';
3
+ export { registerSidebarPanel, requireClientSeats, type SidebarPanelSpec, type Translate } from './panel.ts';
4
4
  export { registerWorkbenchView } from './workbench-view.ts';
5
5
  export { createSettingsSeat } from './settings-seat.ts';
6
6
  export type { WorkbenchViewSpec } from './workbench-view.ts';
@@ -12,6 +12,7 @@ export { DecisionFrame, type DecisionFrameProps } from './presentation/decision-
12
12
  export { TaskBanner, type TaskBannerProps } from './presentation/task-banner.ts';
13
13
  export { StatusChip, FilterChip, type StatusChipProps, type FilterChipProps } from './presentation/chips.ts';
14
14
  export { EmptyState, type EmptyStateProps } from './presentation/empty-state.ts';
15
+ export { RESPONSIVE_TABLE_CSS } from './presentation/table.ts';
15
16
  export { DisclosureGroup, type DisclosureGroupProps } from './presentation/disclosure-group.ts';
16
17
  export { TimeText, type TimeTextProps } from './presentation/time-text.ts';
17
18
  export { ActionMenu, PLATFORM_MENU, renderPlatformMenu, menuPrimitivesFrom, type ActionMenuProps, type RowMenuAction, type MenuPrimitives, type MenuSurfaceComponent, type MenuItemButtonComponent } from './presentation/action-menu.ts';
@@ -1,4 +1,4 @@
1
- export { registerSidebarPanel } from "./panel.js";
1
+ export { registerSidebarPanel, requireClientSeats } from "./panel.js";
2
2
  export { registerWorkbenchView } from "./workbench-view.js";
3
3
  export { createSettingsSeat } from "./settings-seat.js";
4
4
  export { panelWorkspaceId } from "./workspace.js";
@@ -9,6 +9,7 @@ export { DecisionFrame } from "./presentation/decision-frame.js";
9
9
  export { TaskBanner } from "./presentation/task-banner.js";
10
10
  export { StatusChip, FilterChip } from "./presentation/chips.js";
11
11
  export { EmptyState } from "./presentation/empty-state.js";
12
+ export { RESPONSIVE_TABLE_CSS } from "./presentation/table.js";
12
13
  export { DisclosureGroup } from "./presentation/disclosure-group.js";
13
14
  export { TimeText } from "./presentation/time-text.js";
14
15
  export { ActionMenu, PLATFORM_MENU, renderPlatformMenu, menuPrimitivesFrom } from "./presentation/action-menu.js";
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import type { Context as ClientContext } from '@deepseek-ai/cordis';
6
6
  import type { ReactNode } from 'react';
7
+ import type { ClientSeam } from './seam.ts';
7
8
  /** Dictionary lookup used by the panel body and row label. */
8
9
  export type Translate = (key: string, values?: Readonly<Record<string, string | number>>) => string;
9
10
  /** The feature-specific part of one sidebar panel. */
@@ -42,6 +43,8 @@ export interface SidebarPanelSpec<Face> {
42
43
  /** Optional store owned by this registration; the platform binds it to the occupant. */
43
44
  store?: unknown;
44
45
  }
46
+ /** Fail loud when a client bundle is mounted without the shell seats it consumes. */
47
+ export declare function requireClientSeats(ctx: unknown, owner: string): ClientSeam;
45
48
  /**
46
49
  * Register one sidebar row and its main body under one lifecycle.
47
50
  * @param ctx - the client context carrying the slots and locale seats.
@@ -1,3 +1,11 @@
1
+ /** Fail loud when a client bundle is mounted without the shell seats it consumes. */
2
+ export function requireClientSeats(ctx, owner) {
3
+ const candidate = ctx;
4
+ if (candidate.slots === undefined || candidate.locale === undefined) {
5
+ throw new Error(owner + ': the client slots/locale seats are not mounted');
6
+ }
7
+ return candidate;
8
+ }
1
9
  function interpolate(text, values) {
2
10
  if (values === undefined)
3
11
  return text;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Responsive table contract shared by family panels.
3
+ *
4
+ * Markup: wrap any table in an element carrying data-evo-table-wrap. At a
5
+ * narrow container (including a 200% browser zoom) the rows become stacked
6
+ * definition blocks: rule/name on its own line, the metric on the next, so a
7
+ * fixed numeric column can never squeeze a label to one character.
8
+ */
9
+ export declare const RESPONSIVE_TABLE_CSS: string;
10
+ //# sourceMappingURL=table.d.ts.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Responsive table contract shared by family panels.
3
+ *
4
+ * Markup: wrap any table in an element carrying data-evo-table-wrap. At a
5
+ * narrow container (including a 200% browser zoom) the rows become stacked
6
+ * definition blocks: rule/name on its own line, the metric on the next, so a
7
+ * fixed numeric column can never squeeze a label to one character.
8
+ */
9
+ export const RESPONSIVE_TABLE_CSS = [
10
+ '[data-evo-table-wrap]{container-type:inline-size;}',
11
+ '@container (max-width: 700px) {',
12
+ ' [data-evo-table-wrap] table{display:block;width:100%;table-layout:auto;border:0;}',
13
+ ' [data-evo-table-wrap] thead{display:none;}',
14
+ ' [data-evo-table-wrap] tbody{display:flex;flex-direction:column;gap:var(--evo-space-4);}',
15
+ ' [data-evo-table-wrap] tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--evo-space-2) var(--evo-space-8);padding:var(--evo-space-6) var(--evo-space-8);border:var(--evo-hairline-width) solid var(--dsw-alias-border-l1);border-radius:var(--evo-radius-control);}',
16
+ ' [data-evo-table-wrap] td{display:block;padding:0;text-align:left;white-space:normal;overflow-wrap:anywhere;}',
17
+ ' [data-evo-table-wrap] td[data-role="rule-name"], [data-evo-table-wrap] td[data-role="name"]{grid-column:1/-1;font-weight:500;}',
18
+ ' [data-evo-table-wrap] td[data-role="rule-count"], [data-evo-table-wrap] td[data-role="count"]{grid-column:2;text-align:right;font-variant-numeric:tabular-nums;}',
19
+ ' [data-evo-table-wrap] td[data-role="skills"]{grid-column:1/-1;}',
20
+ '}',
21
+ ].join(String.fromCharCode(10));
22
+ //# sourceMappingURL=table.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-client-kit",
3
3
  "description": "Shared browser seams and lifecycle for the evolution family sidebar panels (community build)",
4
- "version": "0.37.1",
4
+ "version": "0.39.0",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -61,6 +61,6 @@
61
61
  "react": "^18.2.0"
62
62
  },
63
63
  "engines": {
64
- "dsh": ">=0.2.1-rc.2 <0.2.2-0"
64
+ "dsh": ">=0.2.2-rc.0 <0.2.3-0"
65
65
  }
66
66
  }