@astryxdesign/cli 0.7.15 → 0.7.16-canary.g07c77c0
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 +5 -3
- package/api/build/_adapter.d.mts +1 -0
- package/api/build/blocks/blocks.d.mts +1 -0
- package/api/build/blocks/blocks.mjs +18 -1
- package/api/component/_adapter.d.mts +1 -1
- package/api/component/_adapter.mjs +28 -1
- package/api/doctor/_adapter.d.mts +17 -0
- package/api/doctor/_adapter.mjs +43 -0
- package/api/doctor/built-checks.mjs +1 -1
- package/api/doctor/doctor.mjs +18 -4
- package/api/doctor/theme-checks.mjs +1 -1
- package/api/integration/add-contribution.mjs +3 -3
- package/api/integration/pack-check.mjs +14 -8
- package/api/integration/validate-integration.mjs +1 -1
- package/api/search/_adapter.mjs +15 -16
- package/api/search/_entries.d.mts +2 -1
- package/api/search/_entries.mjs +28 -1
- package/api/swizzle/_moduleGraph.mjs +1 -1
- package/api/theme/_adapter.d.mts +5 -2
- package/api/theme/_adapter.mjs +43 -12
- package/api/theme/_fork.mjs +1 -1
- package/api/theme/build/build.d.mts +116 -32
- package/api/theme/build/build.mjs +449 -102
- package/api/theme/eject/eject.mjs +22 -1
- package/api/theme/template/template.d.mts +19 -0
- package/api/theme/template/template.mjs +102 -25
- package/api/theme/theme.type.d.mts +5 -1
- package/api/theme/theme.type.mjs +2 -1
- package/api/theme/themeBuild.doc.mjs +3 -3
- package/api/theme/themeEject.doc.mjs +1 -1
- package/api/theme/themeTemplate.doc.mjs +9 -3
- package/api/theme-edit/_adapter.d.mts +32 -2
- package/api/theme-edit/_adapter.mjs +213 -36
- package/api/theme-edit/_check.d.mts +69 -3
- package/api/theme-edit/_check.mjs +1517 -218
- package/api/theme-edit/_color.d.mts +2 -8
- package/api/theme-edit/_color.mjs +292 -219
- package/api/theme-edit/_compiler.d.mts +1 -0
- package/api/theme-edit/_compiler.mjs +20 -1
- package/api/theme-edit/_context.d.mts +29 -0
- package/api/theme-edit/_context.mjs +426 -40
- package/api/theme-edit/_css.d.mts +60 -1
- package/api/theme-edit/_css.mjs +404 -28
- package/api/theme-edit/_edit.d.mts +9 -0
- package/api/theme-edit/_edit.mjs +1300 -135
- package/api/theme-edit/_how-commands.d.mts +11 -26
- package/api/theme-edit/_how-commands.mjs +30 -2
- package/api/theme-edit/_how-question.d.mts +7 -0
- package/api/theme-edit/_how-question.mjs +1304 -176
- package/api/theme-edit/_how.mjs +144 -30
- package/api/theme-edit/_overview.mjs +2 -0
- package/api/theme-edit/_palette.d.mts +11 -0
- package/api/theme-edit/_palette.mjs +194 -65
- package/api/theme-edit/_parts.d.mts +33 -0
- package/api/theme-edit/_parts.mjs +138 -9
- package/api/theme-edit/_png.d.mts +18 -0
- package/api/theme-edit/_png.mjs +95 -14
- package/api/theme-edit/_preview-app.d.mts +9 -0
- package/api/theme-edit/_preview-app.mjs +1191 -71
- package/api/theme-edit/_preview.d.mts +16 -3
- package/api/theme-edit/_preview.mjs +335 -30
- package/api/theme-edit/_project.d.mts +11 -0
- package/api/theme-edit/_project.mjs +46 -12
- package/api/theme-edit/_settings.d.mts +240 -5
- package/api/theme-edit/_settings.mjs +2561 -115
- package/api/theme-edit/_tables.d.mts +24 -0
- package/api/theme-edit/_tables.mjs +211 -149
- package/api/theme-edit/_vet.d.mts +42 -0
- package/api/theme-edit/_vet.mjs +144 -0
- package/api/theme-edit/theme-edit.type.d.mts +2 -1
- package/api/theme-edit/theme-edit.type.mjs +1 -1
- package/api/theme-edit/themeEditNew.doc.mjs +1 -1
- package/api/theme-edit/themeEditShow.doc.mjs +11 -3
- package/api/upgrade/registry/registry.mjs +6 -1
- package/assets/codemods/parse.mjs +2 -2
- package/assets/docs/tree/single-component.doc.mjs +11 -2
- package/assets/docs/tree/tokens-and-setup.doc.mjs +39 -3
- package/assets/docs.generated.json +2 -2
- package/assets/preview-app/next.config.mjs +7 -1
- package/assets/preview-app/package.json +1 -0
- package/assets/preview-app/src/app/globals.css +1 -0
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Table/ColumnsVirtualizationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/ColumnsVirtualizationHookUsage.tsx +53 -0
- package/assets/templates/blocks/components/Table/InfiniteScrollHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/InfiniteScrollHookUsage.tsx +33 -0
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/dashboard/page.tsx +1 -1
- package/authoring/doctypes/_schema.d.mts +52 -5
- package/authoring/doctypes/_schema.mjs +62 -7
- package/authoring/doctypes/base/type.ts +10 -0
- package/authoring/doctypes/component/component.doc.mjs +1 -1
- package/authoring/doctypes/function/function.doc.mjs +6 -0
- package/authoring/doctypes/function/type.ts +3 -0
- package/authoring/doctypes/legacy.mjs +5 -1
- package/authoring/index.d.ts +1 -0
- package/authoring/shadcn/source-variants.d.mts +1 -1
- package/authoring/shadcn/source-variants.mjs +32 -10
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/doctor.doc.mjs +2 -2
- package/clients/cli/commands/experimental/theme.mjs +237 -45
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-eject.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-template.doc.mjs +2 -2
- package/clients/cli/commands/theme-build.doc.mjs +2 -2
- package/clients/cli/commands/theme-eject.doc.mjs +1 -1
- package/clients/cli/commands/theme-template.doc.mjs +3 -1
- package/clients/cli/commands/theme.mjs +190 -46
- package/clients/cli/formatters/index.mjs +7 -4
- package/clients/cli/lib/cli-error.mjs +9 -3
- package/clients/cli/lib/component-format.mjs +27 -9
- package/clients/cli/lib/json-shim.mjs +72 -2
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +49 -0
- package/foundation/agent-docs/agent-docs-target.d.mts +2 -6
- package/foundation/agent-docs/agent-docs-target.mjs +9 -17
- package/foundation/agent-docs/agent-docs.mjs +3 -2
- package/foundation/config/config-writer.mjs +2 -2
- package/foundation/config/project.mjs +60 -14
- package/foundation/discovery/component-discovery.mjs +5 -17
- package/foundation/discovery/icon-set-writer.mjs +1 -1
- package/foundation/discovery/module-exports.mjs +1 -15
- package/foundation/discovery/template-adapter.mjs +44 -19
- package/foundation/discovery/template-source-tree.mjs +3 -16
- package/foundation/discovery/theme-discovery.d.mts +5 -1
- package/foundation/discovery/theme-discovery.mjs +30 -35
- package/foundation/fs/exact-codec.d.mts +35 -0
- package/foundation/fs/exact-codec.mjs +148 -0
- package/foundation/fs/gather-cache.d.mts +15 -5
- package/foundation/fs/gather-cache.mjs +123 -30
- package/foundation/fs/paths.d.mts +39 -0
- package/foundation/fs/paths.mjs +44 -11
- package/foundation/fs/read-record.mjs +11 -1
- package/foundation/integrations/contribution-fixes.mjs +1 -16
- package/foundation/integrations/may-have-integrations.mjs +3 -2
- package/foundation/integrations/public-imports.mjs +1 -1
- package/foundation/render/embedded-imports.mjs +1 -1
- package/foundation/render/host-exit.d.mts +8 -0
- package/foundation/render/host-exit.mjs +11 -0
- package/foundation/render/page-host.mjs +56 -10
- package/foundation/render/page-worker.mjs +14 -0
- package/foundation/render/render-page.mjs +37 -2
- package/foundation/response/error-codes.d.mts +2 -1
- package/foundation/response/error-codes.d.ts +1 -0
- package/foundation/response/error-codes.doc.mjs +5 -0
- package/foundation/response/error-codes.mjs +3 -0
- package/foundation/response/json.d.mts +15 -0
- package/foundation/response/json.mjs +52 -1
- package/foundation/response/response-types.doc.mjs +1 -1
- package/foundation/runtime/lazy-dependencies.d.mts +14 -0
- package/foundation/runtime/lazy-dependencies.mjs +82 -0
- package/foundation/xle/browser.d.mts +2 -2
- package/package.json +7 -6
|
@@ -18,8 +18,80 @@ export function themeFiles(cwd: string, slug: string): {
|
|
|
18
18
|
preview: string;
|
|
19
19
|
sheet: string;
|
|
20
20
|
previewPng: string;
|
|
21
|
+
pictures: string;
|
|
21
22
|
sheetPng: string;
|
|
22
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Whether a value fits what a dial takes, read from the dial's own list of
|
|
26
|
+
* values: a named rung in any case, or a value of the kind it names (a size,
|
|
27
|
+
* a color, a number). `set` still checks the value in full.
|
|
28
|
+
* @param {string} dial
|
|
29
|
+
* @param {string} value
|
|
30
|
+
*/
|
|
31
|
+
export function dialValueFits(dial: string, value: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Record files the editor just wrote into a theme folder.
|
|
34
|
+
* @param {string} cwd
|
|
35
|
+
* @param {string} slug
|
|
36
|
+
* @param {string[]} files
|
|
37
|
+
*/
|
|
38
|
+
export function recordWritten(cwd: string, slug: string, files: string[]): void;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the editor wrote this file in the theme folder and it is
|
|
41
|
+
* unchanged since.
|
|
42
|
+
* @param {string} cwd
|
|
43
|
+
* @param {string} slug
|
|
44
|
+
* @param {string} file
|
|
45
|
+
*/
|
|
46
|
+
export function editorWrote(cwd: string, slug: string, file: string): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Adopt a picture an older editor took (before it recorded or stamped its
|
|
49
|
+
* pictures) into the record: only while the theme has no record at all, the
|
|
50
|
+
* name is one the editor writes, and the picture is the editor's 1280-pixel
|
|
51
|
+
* wide window. Returns whether it was adopted.
|
|
52
|
+
* @param {string} cwd
|
|
53
|
+
* @param {string} slug
|
|
54
|
+
* @param {string} file
|
|
55
|
+
*/
|
|
56
|
+
export function adoptOlderPicture(cwd: string, slug: string, file: string): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* A name `new` takes, for a suggestion: `name` itself when it is valid, not a
|
|
59
|
+
* built-in theme and its folder is free; `my-<name>` for a built-in theme's
|
|
60
|
+
* name; else the first free numbered name.
|
|
61
|
+
* @param {string} cwd
|
|
62
|
+
* @param {string} name
|
|
63
|
+
*/
|
|
64
|
+
export function usableNewName(cwd: string, name: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* A theme name near `name` that is valid and whose folder is free: `name-2`,
|
|
67
|
+
* `name-3`, …, shortened to fit the name's length limit.
|
|
68
|
+
* @param {string} cwd
|
|
69
|
+
* @param {string} name
|
|
70
|
+
*/
|
|
71
|
+
export function freeThemeName(cwd: string, name: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* Why the editor cannot read one of its files, or null when it can (or the
|
|
74
|
+
* file is not there): a folder in the file's place, or no permission to read
|
|
75
|
+
* it. Bad content is a different problem, judged where the file is parsed.
|
|
76
|
+
* @param {string} file
|
|
77
|
+
* @returns {string | null}
|
|
78
|
+
*/
|
|
79
|
+
export function unreadableReason(file: string): string | null;
|
|
80
|
+
/**
|
|
81
|
+
* Refuse, by name, when a file of the theme is a folder or cannot be read:
|
|
82
|
+
* every command reads them, and none should crash on one. The fix is to
|
|
83
|
+
* look at the file and give it back its place; a file is never deleted.
|
|
84
|
+
* @param {string} cwd
|
|
85
|
+
* @param {string} slug
|
|
86
|
+
*/
|
|
87
|
+
export function refuseUnreadableFiles(cwd: string, slug: string): void;
|
|
88
|
+
/**
|
|
89
|
+
* Refuse when the app's themes/ is a file or a link to something other
|
|
90
|
+
* than a folder: every editor theme lives in themes/<name>/. The run lists
|
|
91
|
+
* what is there; the message says to rename or move it.
|
|
92
|
+
* @param {string} cwd
|
|
93
|
+
*/
|
|
94
|
+
export function refuseThemesNotFolder(cwd: string): void;
|
|
23
95
|
/**
|
|
24
96
|
* The themes the editor made in the app (a settings file of its own), by
|
|
25
97
|
* name, or with `changed` the one an editor command changed last first: the
|
|
@@ -51,6 +123,14 @@ export function refuse(code: string, message: string, extra?: {
|
|
|
51
123
|
fix?: string;
|
|
52
124
|
also?: string[];
|
|
53
125
|
}): never;
|
|
126
|
+
/**
|
|
127
|
+
* A theme name as typed, read the way the editor reads it: a path to its
|
|
128
|
+
* folder or a file in it (t.theme.ts, Brand.settings.json), in any case,
|
|
129
|
+
* names the theme. The result may still need slugFor.
|
|
130
|
+
* @param {unknown} s
|
|
131
|
+
* @returns {string}
|
|
132
|
+
*/
|
|
133
|
+
export function typedThemeName(s: unknown): string;
|
|
54
134
|
/**
|
|
55
135
|
* The settings of a theme, or a refusal naming the command that makes it.
|
|
56
136
|
* @param {string} cwd
|
|
@@ -106,6 +186,65 @@ export function withoutBadValues(data: ThemeData): {
|
|
|
106
186
|
* @returns {string | null}
|
|
107
187
|
*/
|
|
108
188
|
export function valueProblem(s: any): string | null;
|
|
189
|
+
/**
|
|
190
|
+
* The tokens a base theme's own component rules for a part read through
|
|
191
|
+
* var() (neutral's progress-bar reads --color-border-emphasized), from its
|
|
192
|
+
* built module; an empty set when it is not installed.
|
|
193
|
+
* @param {string} cwd
|
|
194
|
+
* @param {string | null | undefined} like
|
|
195
|
+
* @param {string} target
|
|
196
|
+
* @returns {Set<string>}
|
|
197
|
+
*/
|
|
198
|
+
export function baseComponentReads(cwd: string, like: string | null | undefined, target: string): Set<string>;
|
|
199
|
+
/**
|
|
200
|
+
* The top-level tokens a base theme's built module gives (what the
|
|
201
|
+
* editor's settings extend), or an empty map when it is not installed.
|
|
202
|
+
* @param {string} cwd
|
|
203
|
+
* @param {string | null | undefined} like
|
|
204
|
+
* @returns {Map<string, string | null>}
|
|
205
|
+
*/
|
|
206
|
+
export function baseTopTokens(cwd: string, like: string | null | undefined): Map<string, string | null>;
|
|
207
|
+
/**
|
|
208
|
+
* What a part's plain rule (its `base` block) holds in the theme as built
|
|
209
|
+
* (the base theme's, the settings' and the own source's together), else in
|
|
210
|
+
* the base theme alone when there is no build: tokens and properties by
|
|
211
|
+
* name. Kebab-case property names, as the editor names them.
|
|
212
|
+
* @param {string} cwd
|
|
213
|
+
* @param {string} slug
|
|
214
|
+
* @param {string | null | undefined} like
|
|
215
|
+
* @param {string} part
|
|
216
|
+
* @returns {Map<string, string | null>}
|
|
217
|
+
*/
|
|
218
|
+
export function partRuleTokens(cwd: string, slug: string, like: string | null | undefined, part: string): Map<string, string | null>;
|
|
219
|
+
/**
|
|
220
|
+
* The tokens and properties a theme's own source sets on a part's plain
|
|
221
|
+
* rule, read from the build as ownTokens reads page-wide ones: what the
|
|
222
|
+
* built rule holds that the settings module and the base theme do not give
|
|
223
|
+
* as they are, and that the person's files name.
|
|
224
|
+
* @param {string} cwd
|
|
225
|
+
* @param {string} slug
|
|
226
|
+
* @param {string} part
|
|
227
|
+
* @param {string} [scope] the rule: `base` (the plain one), or a variant
|
|
228
|
+
* such as `variant:primary`
|
|
229
|
+
* @returns {Map<string, string | null>}
|
|
230
|
+
*/
|
|
231
|
+
export function ownPartTokens(cwd: string, slug: string, part: string, scope?: string): Map<string, string | null>;
|
|
232
|
+
/**
|
|
233
|
+
* The page-wide tokens a theme's own source sets itself (see ownTokens):
|
|
234
|
+
* they win over the settings it extends.
|
|
235
|
+
* @param {string} cwd
|
|
236
|
+
* @param {string} slug
|
|
237
|
+
* @returns {string[]}
|
|
238
|
+
*/
|
|
239
|
+
export function ownSourceTokens(cwd: string, slug: string): string[];
|
|
240
|
+
/**
|
|
241
|
+
* The values a theme's own source gives page-wide tokens as plain text, by
|
|
242
|
+
* token (see ownTokens).
|
|
243
|
+
* @param {string} cwd
|
|
244
|
+
* @param {string} slug
|
|
245
|
+
* @returns {Record<string, string>}
|
|
246
|
+
*/
|
|
247
|
+
export function ownSourceTokenValues(cwd: string, slug: string): Record<string, string>;
|
|
109
248
|
/** One line for a setting. @param {Setting} s */
|
|
110
249
|
export function describe(s: Setting): string;
|
|
111
250
|
/**
|
|
@@ -134,6 +273,14 @@ export function fontOf(value: string): {
|
|
|
134
273
|
fallbacks: string;
|
|
135
274
|
pkg: string | null;
|
|
136
275
|
};
|
|
276
|
+
/**
|
|
277
|
+
* Spacing in a font family name as CSS reads a bare name: every Unicode
|
|
278
|
+
* space (a no-break space, a thin space, a tab) is one space, a run of them
|
|
279
|
+
* one, and zero-width and format characters (zero-width space, joiners,
|
|
280
|
+
* word joiner, byte-order mark) are dropped.
|
|
281
|
+
* @param {string} v
|
|
282
|
+
*/
|
|
283
|
+
export function familySpaces(v: string): string;
|
|
137
284
|
/**
|
|
138
285
|
* A font family name as CSS reads it. A name that is a sequence of CSS
|
|
139
286
|
* identifiers stays bare; any other is quoted, or the browser drops the
|
|
@@ -144,6 +291,21 @@ export function fontOf(value: string): {
|
|
|
144
291
|
* @param {boolean} [spaced]
|
|
145
292
|
*/
|
|
146
293
|
export function cssFamily(name: string, spaced?: boolean): string;
|
|
294
|
+
/**
|
|
295
|
+
* The staleness reason for an own source changed since the editor's build.
|
|
296
|
+
* @param {string} slug
|
|
297
|
+
*/
|
|
298
|
+
export function sourceChangedReason(slug: string): string;
|
|
299
|
+
/**
|
|
300
|
+
* Record in an editor theme's generated settings that they were built with
|
|
301
|
+
* its own source as it is now, after `compile` built that source (the
|
|
302
|
+
* settings do not depend on what the source sets), only in a module as the
|
|
303
|
+
* editor wrote it.
|
|
304
|
+
* @param {string} cwd
|
|
305
|
+
* @param {string} slug
|
|
306
|
+
* @returns {boolean} whether it was recorded
|
|
307
|
+
*/
|
|
308
|
+
export function refreshSourceStamp(cwd: string, slug: string): boolean;
|
|
147
309
|
/**
|
|
148
310
|
* Whether a generated module is as the editor wrote it: true, false for a
|
|
149
311
|
* hand edit, null for a module with no hash (an earlier editor's).
|
|
@@ -178,9 +340,10 @@ export function compileTheme(ctx: Ctx, data: ThemeData, base: {
|
|
|
178
340
|
* Settings whose effect a later or stronger setting hides, with why: `type`
|
|
179
341
|
* loses heading weight and tracking to `headings`.
|
|
180
342
|
* @param {ThemeData} data
|
|
343
|
+
* @param {Ctx | null} [ctx] with it, a later setting that reaches the parts through a spread counts too
|
|
181
344
|
* @returns {Map<Setting, string>}
|
|
182
345
|
*/
|
|
183
|
-
export function maskedSettings(data: ThemeData): Map<Setting, string>;
|
|
346
|
+
export function maskedSettings(data: ThemeData, ctx?: Ctx | null): Map<Setting, string>;
|
|
184
347
|
/**
|
|
185
348
|
* A plain part setting can lose to a more specific rule for the same part
|
|
186
349
|
* and property, such as a base theme's `.astryx-heading[data-level="1"]
|
|
@@ -204,6 +367,22 @@ export function findOverrides(cssText: string, theme: any): Array<{
|
|
|
204
367
|
* @returns {string | null}
|
|
205
368
|
*/
|
|
206
369
|
export function themeSourceProblem(cwd: string, slug: string): string | null;
|
|
370
|
+
/**
|
|
371
|
+
* Why the person's own theme source does not parse (its line and the
|
|
372
|
+
* parser's message), or null when it parses or is not there.
|
|
373
|
+
* @param {string} cwd
|
|
374
|
+
* @param {string} slug
|
|
375
|
+
* @returns {string | null}
|
|
376
|
+
*/
|
|
377
|
+
export function themeSourceParseError(cwd: string, slug: string): string | null;
|
|
378
|
+
/**
|
|
379
|
+
* Refuse, before anything is written or removed, a command whose build
|
|
380
|
+
* would load the person's own theme source when it does not parse: the
|
|
381
|
+
* build would fail part way.
|
|
382
|
+
* @param {string} cwd
|
|
383
|
+
* @param {string} slug
|
|
384
|
+
*/
|
|
385
|
+
export function refuseThemeParse(cwd: string, slug: string): void;
|
|
207
386
|
/**
|
|
208
387
|
* Refuse a build whose theme source cannot carry the settings, naming the
|
|
209
388
|
* lines that put it back.
|
|
@@ -224,6 +403,15 @@ export function buildTheme(ctx: Ctx, slug: string, data: ThemeData): Promise<{
|
|
|
224
403
|
lifted: string[];
|
|
225
404
|
notes: string[];
|
|
226
405
|
}>;
|
|
406
|
+
/**
|
|
407
|
+
* Why the built outputs differ from what the theme builds now: one that is
|
|
408
|
+
* missing or changed by hand, found the way `compile --check` finds it
|
|
409
|
+
* (the same build, compared and not written), or null when they match.
|
|
410
|
+
* @param {Ctx} ctx
|
|
411
|
+
* @param {string} slug
|
|
412
|
+
* @returns {Promise<string | null>}
|
|
413
|
+
*/
|
|
414
|
+
export function outputsDrift(ctx: Ctx, slug: string): Promise<string | null>;
|
|
227
415
|
/**
|
|
228
416
|
* Resolved tokens of the built theme in both modes.
|
|
229
417
|
* @param {Ctx} ctx
|
|
@@ -299,12 +487,38 @@ export function radiusTokenOf(ctx: Ctx, part: string, when?: string): string;
|
|
|
299
487
|
export function clearNewMarker(dir: string): void;
|
|
300
488
|
/**
|
|
301
489
|
* The pseudo key a state writes in a part's styles. Core marks a disabled
|
|
302
|
-
* button, link
|
|
303
|
-
*
|
|
490
|
+
* button, link or tab with aria-disabled (it stays focusable). A form
|
|
491
|
+
* control styled on a wrapper (a typeahead, a complex selector) has its
|
|
492
|
+
* input or button inside marked, so it also matches a disabled form
|
|
493
|
+
* control inside it (never a list row); an action part that holds
|
|
494
|
+
* children (a button group, a segmented control) never does, so one
|
|
495
|
+
* disabled child never makes the whole part look disabled.
|
|
304
496
|
* @param {string} state
|
|
497
|
+
* @param {boolean} [wrapsControl]
|
|
305
498
|
* @returns {string}
|
|
306
499
|
*/
|
|
307
|
-
export function stateKey(state: string): string;
|
|
500
|
+
export function stateKey(state: string, wrapsControl?: boolean): string;
|
|
501
|
+
/**
|
|
502
|
+
* The component docs of a part: its own component's, and the one named like
|
|
503
|
+
* the part (tab is Tab, under TabList), each with its name, for the ones the
|
|
504
|
+
* project has.
|
|
505
|
+
* @param {Ctx} ctx
|
|
506
|
+
* @param {string} part
|
|
507
|
+
* @returns {Array<{name: string, doc: any}>}
|
|
508
|
+
*/
|
|
509
|
+
export function partComponentDocs(ctx: Ctx, part: string): Array<{
|
|
510
|
+
name: string;
|
|
511
|
+
doc: any;
|
|
512
|
+
}>;
|
|
513
|
+
/**
|
|
514
|
+
* Whether a part's styled element wraps one control: its component (or the
|
|
515
|
+
* one named like the part) is a form control (Core's own category) that
|
|
516
|
+
* takes a disabled prop. An action part that holds children (a button
|
|
517
|
+
* group) never does.
|
|
518
|
+
* @param {Ctx} ctx
|
|
519
|
+
* @param {string} target
|
|
520
|
+
*/
|
|
521
|
+
export function wrapsOneControl(ctx: Ctx, target: string): boolean;
|
|
308
522
|
/**
|
|
309
523
|
* The whole-theme radius tokens a generated settings module writes, or null
|
|
310
524
|
* when it writes none.
|
|
@@ -358,6 +572,18 @@ export function settingsStamp(data: ThemeData): string;
|
|
|
358
572
|
* @returns {string | null}
|
|
359
573
|
*/
|
|
360
574
|
export function staleBuild(cwd: string, slug: string, data: ThemeData): string | null;
|
|
575
|
+
/**
|
|
576
|
+
* Every file the editor's build of a theme writes, the one list staleness
|
|
577
|
+
* reads: the generated settings module, the built stylesheet, module and
|
|
578
|
+
* their types, and, with a color dial set, the generated color files.
|
|
579
|
+
* @param {string} cwd
|
|
580
|
+
* @param {string} slug
|
|
581
|
+
* @param {ThemeData} data
|
|
582
|
+
* @param {boolean} [some] the files a build writes only for some themes
|
|
583
|
+
* (the variants types, for a theme with component variants) instead
|
|
584
|
+
* @returns {string[]}
|
|
585
|
+
*/
|
|
586
|
+
export function builtFiles(cwd: string, slug: string, data: ThemeData, some?: boolean): string[];
|
|
361
587
|
/**
|
|
362
588
|
* A theme's undo history: the settings text before each change, oldest
|
|
363
589
|
* first, and how many damaged steps were dropped. Every step after the
|
|
@@ -400,7 +626,7 @@ export function fontPackages(ctx: Ctx, data: ThemeData): {
|
|
|
400
626
|
installed: boolean;
|
|
401
627
|
of: Setting;
|
|
402
628
|
}[];
|
|
403
|
-
/** @typedef {{project: import('./_project.mjs').ThemeProject, C: import('./_compiler.mjs').Compiler, unchecked?: string | null, uncheckedCode?: string | null, wrote?: Map<string, string | null>, base?: {light: Record<string, string>, dark: Record<string, string>, components?: Record<string, any>}, keepStops?: Record<string, Record<'light' | 'dark', {family: string, stop: number, alpha?: string}>> | null, keepRadii?: Record<string, string> | null}} Ctx */
|
|
629
|
+
/** @typedef {{project: import('./_project.mjs').ThemeProject, C: import('./_compiler.mjs').Compiler, unchecked?: string | null, uncheckedCode?: string | null, wrote?: Map<string, string | null>, base?: {light: Record<string, string>, dark: Record<string, string>, components?: Record<string, any>}, keepStops?: Record<string, Record<'light' | 'dark', {family: string, stop: number, alpha?: string}>> | null, keepRadii?: Record<string, string> | null, derived?: Record<string, Array<{property: string, vars?: string[], replaces?: boolean, expand?: string}>>}} Ctx */
|
|
404
630
|
/** @typedef {import('./_parts.mjs').PaintSide} PaintSide */
|
|
405
631
|
/** @typedef {import('./_parts.mjs').TextPair} TextPair */
|
|
406
632
|
/** What a theme name may be, in words. */
|
|
@@ -414,6 +640,8 @@ export function shown(cwd: string, f: string): string;
|
|
|
414
640
|
export function keyOf(s: Setting): string;
|
|
415
641
|
export function cornerPx(v: string): number;
|
|
416
642
|
export function textPx(v: string): number;
|
|
643
|
+
/** The type tokens base themes set again for phones: families and weights. */
|
|
644
|
+
export const PHONE_TYPE: RegExp;
|
|
417
645
|
export function themeSource(slug: string): string;
|
|
418
646
|
/** The file a `new` keeps beside the files it writes until it is done. */
|
|
419
647
|
export const NEW_MARKER: ".astryx-new.json";
|
|
@@ -423,6 +651,7 @@ export const NEW_MARKER: ".astryx-new.json";
|
|
|
423
651
|
* leaves (a designer's `<slug>.design.psd` beside them is never touched).
|
|
424
652
|
*/
|
|
425
653
|
export const EDITOR_SUFFIXES: string[];
|
|
654
|
+
export function isEditorFile(slug: string, n: string): boolean;
|
|
426
655
|
/** The undo steps a theme keeps; older ones are dropped. */
|
|
427
656
|
export const HISTORY_STEPS: 80;
|
|
428
657
|
/**
|
|
@@ -489,6 +718,12 @@ export type Ctx = {
|
|
|
489
718
|
alpha?: string;
|
|
490
719
|
}>> | null;
|
|
491
720
|
keepRadii?: Record<string, string> | null;
|
|
721
|
+
derived?: Record<string, Array<{
|
|
722
|
+
property: string;
|
|
723
|
+
vars?: string[];
|
|
724
|
+
replaces?: boolean;
|
|
725
|
+
expand?: string;
|
|
726
|
+
}>>;
|
|
492
727
|
};
|
|
493
728
|
export type PaintSide = import("./_parts.mjs").PaintSide;
|
|
494
729
|
export type TextPair = import("./_parts.mjs").TextPair;
|