@contentful/experience-design-system-cli 2.37.1-dev-build-6e954110.0 → 2.37.1-dev-build-320f5360.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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-6e954110.0",
3
+ "version": "2.37.1-dev-build-320f5360.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,9 @@
1
+ import { type TokenRow } from './logic.js';
2
+ /** The generated tokens, read from the `tokens.json` the token stage wrote. */
3
+ export declare function loadTokenRows(tokensPath: string): {
4
+ ok: true;
5
+ rows: TokenRow[];
6
+ } | {
7
+ ok: false;
8
+ message: string;
9
+ };
@@ -0,0 +1,33 @@
1
+ export interface TokenRow {
2
+ /** Dot-separated DTCG path, e.g. `color.brand.primary`. */
3
+ path: string;
4
+ type: string;
5
+ value: string;
6
+ }
7
+ /**
8
+ * The tokens of a DTCG tree, in file order. A node with `$value` is a token; any other node is a group whose children are
9
+ * walked. A token without its own `$type` takes the nearest group's.
10
+ */
11
+ export declare function flattenTokens(tree: unknown): TokenRow[];
12
+ /** The longest token name and value, which a side-by-side listing needs room for. */
13
+ export declare function longestEntries(rows: readonly TokenRow[]): {
14
+ path: number;
15
+ value: number;
16
+ };
17
+ /** The rows to draw: a window of `visibleCount` around the cursor, and how many rows are cut off above and below. */
18
+ export declare function computeColumnWindow(total: number, cursor: number, visibleCount: number): {
19
+ start: number;
20
+ end: number;
21
+ above: number;
22
+ below: number;
23
+ };
24
+ export declare const TOKEN_REVIEW_CONTROLS: readonly [{
25
+ readonly keys: "↑/↓";
26
+ readonly label: "Scroll";
27
+ }, {
28
+ readonly keys: "Enter";
29
+ readonly label: "Continue";
30
+ }, {
31
+ readonly keys: "Esc";
32
+ readonly label: "Quit";
33
+ }];
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface TokenReviewScreenProps {
3
+ tokensPath: string;
4
+ onContinue: () => void;
5
+ onQuit: () => void;
6
+ }
7
+ /** Shows the generated design tokens before the import goes on. Read only: the tokens are pushed as they are. */
8
+ export declare function TokenReviewScreen({ tokensPath, onContinue, onQuit }: TokenReviewScreenProps): React.ReactElement;
9
+ export {};
@@ -15,16 +15,14 @@ export interface ScopeGatePanelLayout {
15
15
  * the same header and indicator chrome.
16
16
  */
17
17
  export declare function computePanelLayout(mainVisibleCount: number): ScopeGatePanelLayout;
18
- export declare function computeColumnWidths(totalWidth: number): {
18
+ /** The token column needs the width and something to show; without either the gate is the main column alone. */
19
+ export declare function computeColumnWidths(totalWidth: number, hasTokens: boolean,
20
+ /** The width the token column would like, so no row has to be cut. It gets at most what the terminal has left. */
21
+ wantedTokensWidth?: number): {
19
22
  layout: 'single' | 'two-column';
20
23
  main: number;
21
- added: number;
24
+ tokens: number;
22
25
  };
23
- export interface AddedComponentEntry {
24
- name: string;
25
- isCycle: boolean;
26
- }
27
- export declare function buildAddedComponentsList(components: ScopeComponentLike[], stateByKey: Map<string, Decision>, cycleParticipants?: Set<string>): AddedComponentEntry[];
28
26
  export declare function computeCounters(components: ScopeComponentLike[], closures: Map<string, Closure>, stateByKey: Map<string, Decision>): {
29
27
  accepted: number;
30
28
  rejected: number;
@@ -32,23 +30,3 @@ export declare function computeCounters(components: ScopeComponentLike[], closur
32
30
  groups: number;
33
31
  total: number;
34
32
  };
35
- export declare function sideColumnLabelStyle(input: {
36
- isCycle: boolean;
37
- isSelected: boolean;
38
- focused: boolean;
39
- }): {
40
- nameColor: string | undefined;
41
- nameBold: boolean;
42
- nameInverse: boolean;
43
- nameUnderline: boolean;
44
- suffixColor: string | undefined;
45
- suffixDim: boolean;
46
- suffixInverse: boolean;
47
- suffixUnderline: boolean;
48
- };
49
- export declare function computeColumnWindow(total: number, cursor: number, visibleCount: number): {
50
- start: number;
51
- end: number;
52
- above: number;
53
- below: number;
54
- };
@@ -11,7 +11,7 @@ export interface KeyPress {
11
11
  }
12
12
  /** What legacy looked at besides the key and the open panel. */
13
13
  export interface GateContext {
14
- focusedColumn: 'main' | 'added-components';
14
+ focusedColumn: 'main' | 'tokens';
15
15
  /** The layout has only the main column, so Tab has nowhere to go. */
16
16
  singleColumn: boolean;
17
17
  hasCycles: boolean;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { type TokenRow } from '../../05-token-review/logic.js';
3
+ interface TokensColumnProps {
4
+ title: string;
5
+ width: number;
6
+ height: number;
7
+ tokens: readonly TokenRow[];
8
+ cursor: number;
9
+ focused: boolean;
10
+ visibleCount: number;
11
+ }
12
+ /** The design tokens that will be imported with the components. Read only: scrolling is all it allows. */
13
+ export declare function TokensColumn(props: TokensColumnProps): React.ReactElement;
14
+ export {};
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import type { ScopeComponent, ScopeDecisions } from './types.js';
3
3
  interface ScopeGateScreenProps {
4
4
  components: ScopeComponent[];
5
+ tokensPath?: string;
5
6
  onConfirm: (decisions: ScopeDecisions) => void;
6
7
  onQuit: () => void;
7
8
  }
@@ -1,21 +1,25 @@
1
1
  import type { ScopeComponent, ScopeDecisions } from './types.js';
2
2
  interface UseScopeGateOptions {
3
3
  components: ScopeComponent[];
4
+ /** How many design tokens the side column lists. It is read only, so the hook only needs to scroll it. */
5
+ tokenCount: number;
6
+ /** The width the token column would like: its longest name and value side by side. */
7
+ tokensWidth: number;
4
8
  onConfirm: (decisions: ScopeDecisions) => void;
5
9
  onQuit: () => void;
6
10
  }
7
- type FocusedColumn = 'main' | 'added-components';
11
+ type FocusedColumn = 'main' | 'tokens';
8
12
  export interface PendingRejectCascade {
9
13
  target: string;
10
14
  ancestors: string[];
11
15
  descendants: string[];
12
16
  }
13
- export declare function useScopeGate({ components, onConfirm, onQuit }: UseScopeGateOptions): {
17
+ export declare function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }: UseScopeGateOptions): {
14
18
  totalWidth: number;
15
19
  columnPlan: {
16
20
  layout: "single" | "two-column";
17
21
  main: number;
18
- added: number;
22
+ tokens: number;
19
23
  };
20
24
  panelLayout: import("./columns.js").ScopeGatePanelLayout;
21
25
  visibleCount: number;
@@ -47,8 +51,7 @@ export declare function useScopeGate({ components, onConfirm, onQuit }: UseScope
47
51
  }[];
48
52
  aiExcludedCount: number;
49
53
  pendingRejectCascade: PendingRejectCascade | null;
50
- addedComponents: import("./columns.js").AddedComponentEntry[];
51
- safeAddedComponentsCursor: number;
54
+ safeTokensCursor: number;
52
55
  counters: {
53
56
  accepted: number;
54
57
  rejected: number;
@@ -4,3 +4,4 @@ export { TokenInputScreen } from './02-token-input/screen.js';
4
4
  export { PathValidationScreen } from './03-path-validation/screen.js';
5
5
  export { CredentialsScreen } from './04-credentials/screen.js';
6
6
  export { ExtractionScreen } from './06-extraction/screen.js';
7
+ export { TokenReviewScreen } from './05-token-review/screen.js';
@@ -19,6 +19,8 @@ declare const IMPORT_STEPS: readonly [{
19
19
  readonly label: "Push";
20
20
  }];
21
21
  export type ImportStepId = (typeof IMPORT_STEPS)[number]['id'];
22
+ /** Steps the current import never goes through, left out of the header. A tokens-only import has no extract, select or generate. */
23
+ export declare const HiddenStepsContext: React.Context<readonly ("push" | "setup" | "extraction" | "scope-gate" | "generation" | "review")[]>;
22
24
  export interface StepHeaderProps {
23
25
  step: ImportStepId | 'done';
24
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-6e954110.0",
3
+ "version": "2.37.1-dev-build-320f5360.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,8 +45,8 @@
45
45
  "ts-morph": "^27.0.2",
46
46
  "typescript": "^5.9.3",
47
47
  "zod": "^4.6.5",
48
- "@contentful/experience-design-system-types": "2.37.1-dev-build-6e954110.0",
49
- "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-6e954110.0"
48
+ "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-320f5360.0",
49
+ "@contentful/experience-design-system-types": "2.37.1-dev-build-320f5360.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@tsconfig/node24": "^24.0.4",
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { type AddedComponentEntry } from '../columns.js';
3
- interface AddedColumnProps {
4
- title: string;
5
- width: number;
6
- height: number;
7
- entries: AddedComponentEntry[];
8
- cursor: number;
9
- focused: boolean;
10
- aiFlaggedByKey?: Map<string, boolean>;
11
- visibleCount: number;
12
- }
13
- /** The accepted components, cycle members first. Rejecting from here is the only decision it allows. */
14
- export declare function AddedColumn(props: AddedColumnProps): React.ReactElement;
15
- export {};