@contentful/experience-design-system-cli 2.38.1-dev-build-962dbe22.0 → 2.38.1-dev-build-9ac452eb.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/app.js +1356 -1269
- package/dist/index.js +1412 -1301
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/05-token-review/load.d.ts +8 -0
- package/dist/src/tui/import/steps/05-token-review/logic.d.ts +30 -0
- package/dist/src/tui/import/steps/05-token-review/screen.d.ts +8 -0
- package/dist/src/tui/import/steps/07-scope-gate/columns.d.ts +2 -27
- package/dist/src/tui/import/steps/07-scope-gate/keymap.d.ts +1 -1
- package/dist/src/tui/import/steps/07-scope-gate/panels/tokens-column.d.ts +13 -0
- package/dist/src/tui/import/steps/07-scope-gate/screen.d.ts +1 -0
- package/dist/src/tui/import/steps/07-scope-gate/use-scope-gate.d.ts +6 -5
- package/dist/src/tui/import/steps/index.d.ts +1 -0
- package/dist/src/tui/shared/components/StepHeader.d.ts +2 -0
- package/package.json +3 -3
- package/dist/src/tui/import/steps/07-scope-gate/panels/added-column.d.ts +0 -15
package/dist/package.json
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface TokenRow {
|
|
2
|
+
path: string;
|
|
3
|
+
type: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 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
|
|
8
|
+
* walked. A token without its own `$type` takes the nearest group's.
|
|
9
|
+
*/
|
|
10
|
+
export declare function flattenTokens(tree: unknown): TokenRow[];
|
|
11
|
+
export declare function longestEntries(rows: readonly TokenRow[]): {
|
|
12
|
+
path: number;
|
|
13
|
+
value: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function computeColumnWindow(total: number, cursor: number, visibleCount: number): {
|
|
16
|
+
start: number;
|
|
17
|
+
end: number;
|
|
18
|
+
above: number;
|
|
19
|
+
below: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const TOKEN_REVIEW_CONTROLS: readonly [{
|
|
22
|
+
readonly keys: "↑/↓";
|
|
23
|
+
readonly label: "Scroll";
|
|
24
|
+
}, {
|
|
25
|
+
readonly keys: "Enter";
|
|
26
|
+
readonly label: "Continue";
|
|
27
|
+
}, {
|
|
28
|
+
readonly keys: "Esc";
|
|
29
|
+
readonly label: "Quit";
|
|
30
|
+
}];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface TokenReviewScreenProps {
|
|
3
|
+
tokensPath: string;
|
|
4
|
+
onContinue: () => void;
|
|
5
|
+
onQuit: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function TokenReviewScreen({ tokensPath, onContinue, onQuit }: TokenReviewScreenProps): React.ReactElement;
|
|
8
|
+
export {};
|
|
@@ -15,16 +15,11 @@ 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
|
+
export declare function computeColumnWidths(totalWidth: number, hasTokens: boolean, wantedTokensWidth?: number): {
|
|
19
19
|
layout: 'single' | 'two-column';
|
|
20
20
|
main: number;
|
|
21
|
-
|
|
21
|
+
tokens: number;
|
|
22
22
|
};
|
|
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
23
|
export declare function computeCounters(components: ScopeComponentLike[], closures: Map<string, Closure>, stateByKey: Map<string, Decision>): {
|
|
29
24
|
accepted: number;
|
|
30
25
|
rejected: number;
|
|
@@ -32,23 +27,3 @@ export declare function computeCounters(components: ScopeComponentLike[], closur
|
|
|
32
27
|
groups: number;
|
|
33
28
|
total: number;
|
|
34
29
|
};
|
|
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' | '
|
|
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,13 @@
|
|
|
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
|
+
export declare function TokensColumn(props: TokensColumnProps): React.ReactElement;
|
|
13
|
+
export {};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import type { ScopeComponent, ScopeDecisions } from './types.js';
|
|
2
2
|
interface UseScopeGateOptions {
|
|
3
3
|
components: ScopeComponent[];
|
|
4
|
+
tokenCount: number;
|
|
5
|
+
tokensWidth: number;
|
|
4
6
|
onConfirm: (decisions: ScopeDecisions) => void;
|
|
5
7
|
onQuit: () => void;
|
|
6
8
|
}
|
|
7
|
-
type FocusedColumn = 'main' | '
|
|
9
|
+
type FocusedColumn = 'main' | 'tokens';
|
|
8
10
|
export interface PendingRejectCascade {
|
|
9
11
|
target: string;
|
|
10
12
|
ancestors: string[];
|
|
11
13
|
descendants: string[];
|
|
12
14
|
}
|
|
13
|
-
export declare function useScopeGate({ components, onConfirm, onQuit }: UseScopeGateOptions): {
|
|
15
|
+
export declare function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }: UseScopeGateOptions): {
|
|
14
16
|
totalWidth: number;
|
|
15
17
|
columnPlan: {
|
|
16
18
|
layout: "single" | "two-column";
|
|
17
19
|
main: number;
|
|
18
|
-
|
|
20
|
+
tokens: number;
|
|
19
21
|
};
|
|
20
22
|
panelLayout: import("./columns.js").ScopeGatePanelLayout;
|
|
21
23
|
visibleCount: number;
|
|
@@ -47,8 +49,7 @@ export declare function useScopeGate({ components, onConfirm, onQuit }: UseScope
|
|
|
47
49
|
}[];
|
|
48
50
|
aiExcludedCount: number;
|
|
49
51
|
pendingRejectCascade: PendingRejectCascade | null;
|
|
50
|
-
|
|
51
|
-
safeAddedComponentsCursor: number;
|
|
52
|
+
safeTokensCursor: number;
|
|
52
53
|
counters: {
|
|
53
54
|
accepted: number;
|
|
54
55
|
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.38.1-dev-build-
|
|
3
|
+
"version": "2.38.1-dev-build-9ac452eb.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-backend-pipeline": "2.38.1-dev-build-
|
|
49
|
-
"@contentful/experience-design-system-types": "2.38.1-dev-build-
|
|
48
|
+
"@contentful/experience-design-system-backend-pipeline": "2.38.1-dev-build-9ac452eb.0",
|
|
49
|
+
"@contentful/experience-design-system-types": "2.38.1-dev-build-9ac452eb.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 {};
|