@astryxdesign/cli 0.7.13 → 0.7.14-canary.108f354
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 +18 -18
- package/api/component/__fixtures__/resolutions/modules.txt +1 -1
- package/api/doctor/doctor.mjs +3 -7
- package/api/experimental.d.mts +2 -0
- package/api/experimental.mjs +12 -0
- package/api/icon/_adapter.d.mts +10 -0
- package/api/icon/_adapter.mjs +31 -2
- package/api/icon/_authoring.d.mts +2 -1
- package/api/icon/_authoring.mjs +91 -6
- package/api/icon/_options.mjs +1 -0
- package/api/icon/_records.d.mts +18 -0
- package/api/icon/_records.mjs +26 -0
- package/api/icon/add/add.mjs +7 -1
- package/api/icon/definitions/definitions.d.mts +12 -0
- package/api/icon/definitions/definitions.mjs +83 -0
- package/api/icon/icon.doc.mjs +5 -4
- package/api/icon/icon.mjs +5 -16
- package/api/icon/icon.type.d.mts +29 -2
- package/api/icon/icon.type.mjs +17 -3
- package/api/icon/iconAdd.doc.mjs +1 -1
- package/api/icon/iconMap.doc.mjs +2 -2
- package/api/icon/iconNewSet.doc.mjs +8 -2
- package/api/icon/map/map.mjs +21 -2
- package/api/icon/new-set/new-set.mjs +14 -2
- package/api/icon/search/search.mjs +2 -15
- package/api/icon/use/use.mjs +4 -3
- package/api/integration/validate-integration.mjs +6 -1
- package/api/integration/validate-integration.type.d.mts +12 -0
- package/api/integration/validate-integration.type.mjs +5 -0
- package/api/theme-edit/_adapter.d.mts +116 -0
- package/api/theme-edit/_adapter.mjs +1683 -0
- package/api/theme-edit/_catalog.d.mts +59 -0
- package/api/theme-edit/_catalog.mjs +564 -0
- package/api/theme-edit/_check.d.mts +49 -0
- package/api/theme-edit/_check.mjs +845 -0
- package/api/theme-edit/_color.d.mts +29 -0
- package/api/theme-edit/_color.mjs +300 -0
- package/api/theme-edit/_compiler.d.mts +61 -0
- package/api/theme-edit/_compiler.mjs +522 -0
- package/api/theme-edit/_css-properties.d.mts +10 -0
- package/api/theme-edit/_css-properties.mjs +556 -0
- package/api/theme-edit/_parts.d.mts +111 -0
- package/api/theme-edit/_parts.mjs +409 -0
- package/api/theme-edit/_png.d.mts +40 -0
- package/api/theme-edit/_png.mjs +187 -0
- package/api/theme-edit/_preview.d.mts +121 -0
- package/api/theme-edit/_preview.mjs +720 -0
- package/api/theme-edit/_project.d.mts +83 -0
- package/api/theme-edit/_project.mjs +289 -0
- package/api/theme-edit/_settings.d.mts +222 -0
- package/api/theme-edit/_settings.mjs +861 -0
- package/api/theme-edit/_tables.d.mts +132 -0
- package/api/theme-edit/_tables.mjs +700 -0
- package/api/theme-edit/theme-edit.d.mts +93 -0
- package/api/theme-edit/theme-edit.mjs +145 -0
- package/api/theme-edit/theme-edit.type.d.mts +413 -0
- package/api/theme-edit/theme-edit.type.mjs +233 -0
- package/api/theme-edit/themeEditHow.doc.d.mts +6 -0
- package/api/theme-edit/themeEditHow.doc.mjs +88 -0
- package/api/theme-edit/themeEditNew.doc.d.mts +6 -0
- package/api/theme-edit/themeEditNew.doc.mjs +89 -0
- package/api/theme-edit/themeEditPreviewAdd.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreviewAdd.doc.mjs +100 -0
- package/api/theme-edit/themeEditPreviewApp.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +84 -0
- package/api/theme-edit/themeEditPreviewList.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreviewList.doc.mjs +53 -0
- package/api/theme-edit/themeEditPreviewRemove.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreviewRemove.doc.mjs +66 -0
- package/api/theme-edit/themeEditSet.doc.d.mts +6 -0
- package/api/theme-edit/themeEditSet.doc.mjs +165 -0
- package/api/theme-edit/themeEditShow.doc.d.mts +6 -0
- package/api/theme-edit/themeEditShow.doc.mjs +86 -0
- package/api/theme-edit/themeEditUndo.doc.d.mts +6 -0
- package/api/theme-edit/themeEditUndo.doc.mjs +124 -0
- package/assets/docs/color.doc.mjs +5 -5
- package/assets/docs/tree/icon-sets.doc.mjs +6 -2
- package/assets/docs/tree/tokens-border.doc.mjs +1 -1
- package/assets/docs/tree/tokens-color.doc.mjs +2 -2
- package/assets/docs/tree/tokens-data.doc.mjs +2 -2
- package/assets/docs/tree/tokens-duration.doc.mjs +1 -1
- package/assets/docs/tree/tokens-ease.doc.mjs +1 -1
- package/assets/docs/tree/tokens-focus.doc.mjs +1 -1
- package/assets/docs/tree/tokens-font-weight.doc.mjs +1 -1
- package/assets/docs/tree/tokens-radius.doc.mjs +1 -1
- package/assets/docs/tree/tokens-shadow.doc.mjs +1 -1
- package/assets/docs/tree/tokens-size.doc.mjs +1 -1
- package/assets/docs/tree/tokens-spacing.doc.mjs +1 -1
- package/assets/docs/tree/tokens-syntax.doc.mjs +1 -1
- package/assets/docs/tree/tokens-text-size.doc.mjs +1 -1
- package/assets/docs/tree/tokens-type-scale.doc.mjs +1 -1
- package/assets/docs/tree/tokens-typography.doc.mjs +1 -1
- package/assets/icons/definitions/bank.doc.mjs +1 -1
- package/assets/icons/definitions/save.doc.mjs +1 -1
- package/assets/preview-app/README.md +6 -0
- package/assets/preview-app/css.d.ts +5 -0
- package/assets/preview-app/gitignore +1 -0
- package/assets/preview-app/next.config.mjs +6 -0
- package/assets/preview-app/package.json +23 -0
- package/assets/preview-app/src/app/globals.css +5 -0
- package/assets/preview-app/src/app/layout.tsx +21 -0
- package/assets/preview-app/src/app/page.tsx +94 -0
- package/assets/preview-app/src/app/providers.tsx +16 -0
- package/assets/preview-app/tsconfig.json +27 -0
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.doc.mjs +2 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.doc.mjs +2 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider03RtlDirection.doc.mjs +2 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider04Calendar.doc.mjs +2 -1
- package/assets/templates/blocks/components/Text/useTruncationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Text/useTruncationHookUsage.tsx +112 -0
- package/authoring/doctypes/_schema.d.mts +1 -0
- package/authoring/doctypes/_schema.mjs +1 -0
- package/authoring/doctypes/command/command.doc.mjs +7 -0
- package/authoring/doctypes/command/type.ts +3 -0
- package/authoring/doctypes/icon-set/parse.d.mts +7 -0
- package/authoring/doctypes/icon-set/parse.mjs +18 -8
- package/clients/cli/commands/doctor.mjs +33 -3
- package/clients/cli/commands/experimental/icon.mjs +67 -14
- package/clients/cli/commands/experimental/index.mjs +2 -0
- package/clients/cli/commands/experimental/theme.mjs +684 -0
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +7 -1
- package/clients/cli/commands/experimental-icon.doc.mjs +3 -2
- package/clients/cli/commands/experimental-theme-add.doc.mjs +78 -0
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +97 -0
- package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +84 -0
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +66 -0
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +121 -0
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +66 -0
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +104 -0
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +49 -0
- package/clients/cli/commands/experimental-theme-eject.doc.mjs +71 -0
- package/clients/cli/commands/experimental-theme-list.doc.mjs +49 -0
- package/clients/cli/commands/experimental-theme-palette-generate.doc.mjs +73 -0
- package/clients/cli/commands/experimental-theme-palette.doc.mjs +37 -0
- package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +86 -0
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +66 -0
- package/clients/cli/commands/experimental-theme-preview-list.doc.mjs +48 -0
- package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +59 -0
- package/clients/cli/commands/experimental-theme-preview.doc.mjs +40 -0
- package/clients/cli/commands/experimental-theme-remove.doc.mjs +55 -0
- package/clients/cli/commands/experimental-theme-targets.doc.mjs +61 -0
- package/clients/cli/commands/experimental-theme-template.doc.mjs +61 -0
- package/clients/cli/commands/experimental-theme-use.doc.mjs +55 -0
- package/clients/cli/commands/experimental-theme.doc.mjs +57 -0
- package/clients/cli/commands/experimental.doc.mjs +10 -3
- package/clients/cli/commands/theme.mjs +101 -34
- package/clients/cli/index.mjs +18 -0
- package/clients/cli/lib/define-command.mjs +3 -0
- package/foundation/discovery/icon-set-checks.d.mts +16 -1
- package/foundation/discovery/icon-set-checks.mjs +68 -7
- package/foundation/discovery/icon-set-discovery.d.mts +21 -6
- package/foundation/discovery/icon-set-discovery.mjs +17 -8
- package/foundation/discovery/template-icon-meanings.d.mts +39 -0
- package/foundation/discovery/template-icon-meanings.mjs +95 -0
- package/foundation/discovery/theming-targets.d.mts +6 -0
- package/foundation/discovery/theming-targets.mjs +33 -0
- package/foundation/response/error-codes.d.mts +12 -1
- package/foundation/response/error-codes.doc.mjs +66 -0
- package/foundation/response/error-codes.mjs +55 -0
- package/foundation/response/response-types.doc.mjs +55 -0
- package/foundation/text/template-meanings-line.d.mts +16 -0
- package/foundation/text/template-meanings-line.mjs +37 -0
- package/foundation/xle/browser.d.mts +2 -2
- package/package.json +6 -6
package/api/icon/icon.mjs
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file Programmatic API for the `icon` command (AST-084 FR6, FR7):
|
|
5
|
-
* dispatcher over
|
|
5
|
+
* dispatcher over its read leaves.
|
|
6
6
|
*
|
|
7
7
|
* icon('<words>') icon.search: icons ranked by meaning
|
|
8
8
|
* icon('<set>/<id>') icon.detail: one icon and every variant's import
|
|
9
9
|
* icon('', {list}) icon.list: the installed sets
|
|
10
|
+
* icon('', {definitions}) icon.definitions: every Astryx definition, its
|
|
11
|
+
* template count, and whether a set maps it
|
|
10
12
|
*
|
|
11
13
|
* Every read comes from installed icon sets' data files, through the
|
|
12
14
|
* `Project` seam; nothing executes an icon module.
|
|
@@ -22,7 +24,7 @@ import {iconSearch} from './search/search.mjs';
|
|
|
22
24
|
import {iconDetail} from './detail/detail.mjs';
|
|
23
25
|
import {iconList} from './list/list.mjs';
|
|
24
26
|
import {iconSetIcons} from './search/search.mjs';
|
|
25
|
-
import {
|
|
27
|
+
import {iconDefinitions} from './definitions/definitions.mjs';
|
|
26
28
|
import {passed, refuseIgnoredPairs} from './_options.mjs';
|
|
27
29
|
|
|
28
30
|
/** The default `limit` for `icon.search`. */
|
|
@@ -71,7 +73,6 @@ export async function icon(query, options = {}) {
|
|
|
71
73
|
['--list', '--limit'],
|
|
72
74
|
['--definitions', 'a query'],
|
|
73
75
|
['--definitions', '--all-icons'],
|
|
74
|
-
['--definitions', '--set'],
|
|
75
76
|
['--definitions', '--limit'],
|
|
76
77
|
['--all-icons', 'a query'],
|
|
77
78
|
['--all-icons', '--limit'],
|
|
@@ -89,19 +90,7 @@ export async function icon(query, options = {}) {
|
|
|
89
90
|
}
|
|
90
91
|
const term = (query ?? '').trim();
|
|
91
92
|
if (list) return iconList({cwd});
|
|
92
|
-
if (definitions) {
|
|
93
|
-
return {
|
|
94
|
-
type: /** @type {const} */ ('icon.definitions'),
|
|
95
|
-
data: {
|
|
96
|
-
definitions: astryxIconDefinitions().definitions.map(({doc}) => ({
|
|
97
|
-
name: doc.name,
|
|
98
|
-
builtIn: doc.builtIn === true,
|
|
99
|
-
description: doc.description,
|
|
100
|
-
words: doc.words,
|
|
101
|
-
})),
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
}
|
|
93
|
+
if (definitions) return iconDefinitions({cwd, set});
|
|
105
94
|
if (allIcons) {
|
|
106
95
|
if (set == null) {
|
|
107
96
|
throw new AstryxError(
|
package/api/icon/icon.type.d.mts
CHANGED
|
@@ -249,6 +249,7 @@ export type IconMapManyResponse = {
|
|
|
249
249
|
module: string;
|
|
250
250
|
} | undefined;
|
|
251
251
|
files?: string[] | undefined;
|
|
252
|
+
templateMeanings?: IconTemplateMeanings | undefined;
|
|
252
253
|
};
|
|
253
254
|
};
|
|
254
255
|
/**
|
|
@@ -269,6 +270,7 @@ export type IconMapResponse = {
|
|
|
269
270
|
module: string;
|
|
270
271
|
} | undefined;
|
|
271
272
|
files?: string[] | undefined;
|
|
273
|
+
templateMeanings?: IconTemplateMeanings | undefined;
|
|
272
274
|
};
|
|
273
275
|
};
|
|
274
276
|
/**
|
|
@@ -362,6 +364,7 @@ export type IconAddResponse = {
|
|
|
362
364
|
module: string;
|
|
363
365
|
} | undefined;
|
|
364
366
|
note?: string | undefined;
|
|
367
|
+
templateMeanings?: IconTemplateMeanings | undefined;
|
|
365
368
|
};
|
|
366
369
|
};
|
|
367
370
|
/**
|
|
@@ -405,7 +408,7 @@ export type IconOptions = {
|
|
|
405
408
|
*/
|
|
406
409
|
list?: boolean | undefined;
|
|
407
410
|
/**
|
|
408
|
-
* - Keep one set, by name or `<package>/<set
|
|
411
|
+
* - Keep one set, by name or `<package>/<set>`; with `definitions`, the set whose `map` they are checked against.
|
|
409
412
|
*/
|
|
410
413
|
set?: string | undefined;
|
|
411
414
|
/**
|
|
@@ -427,14 +430,30 @@ export type IconOptions = {
|
|
|
427
430
|
export type IconDefinitionsResponse = {
|
|
428
431
|
type: "icon.definitions";
|
|
429
432
|
data: {
|
|
433
|
+
set: string | null;
|
|
430
434
|
definitions: Array<{
|
|
431
435
|
name: string;
|
|
432
436
|
builtIn: boolean;
|
|
433
437
|
description: string;
|
|
434
438
|
words: string[];
|
|
439
|
+
templates: number;
|
|
440
|
+
mapped?: boolean;
|
|
435
441
|
}>;
|
|
436
442
|
};
|
|
437
443
|
};
|
|
444
|
+
/**
|
|
445
|
+
* The icon definitions the bundled templates use that a set's `map` does not
|
|
446
|
+
* name.
|
|
447
|
+
*/
|
|
448
|
+
export type IconTemplateMeanings = {
|
|
449
|
+
/**
|
|
450
|
+
* - Each such definition and how many bundled templates use it, most used first, then by name; empty when the set maps them all.
|
|
451
|
+
*/
|
|
452
|
+
unmapped: Array<{
|
|
453
|
+
definition: string;
|
|
454
|
+
templates: number;
|
|
455
|
+
}>;
|
|
456
|
+
};
|
|
438
457
|
/**
|
|
439
458
|
* `astryx --json experimental icon --set <name> --all-icons`.
|
|
440
459
|
*/
|
|
@@ -472,6 +491,10 @@ export type IconNewSetOptions = {
|
|
|
472
491
|
* - With `from`: export names that are not icons; a string is split on commas.
|
|
473
492
|
*/
|
|
474
493
|
exclude?: string | string[] | undefined;
|
|
494
|
+
/**
|
|
495
|
+
* - `./<path>#<export>`: a function in the package that turns one library export that is not a component into one. It is written to the data file's `adapter`; with `from`, every data export of the library becomes an icon through it. On a set that already has icons, only with `from`.
|
|
496
|
+
*/
|
|
497
|
+
adapter?: string | undefined;
|
|
475
498
|
/**
|
|
476
499
|
* - The variants the set supplies, such as `outline,solid`; a string is split on commas.
|
|
477
500
|
*/
|
|
@@ -547,7 +570,7 @@ export type IconNewData = {
|
|
|
547
570
|
*/
|
|
548
571
|
icons?: number | undefined;
|
|
549
572
|
/**
|
|
550
|
-
* - With `from` on an existing set: the set was refreshed, not created.
|
|
573
|
+
* - With `from` on an existing set that has icons: the set was refreshed, not created. Absent when the set had no icons yet: its icons were created.
|
|
551
574
|
*/
|
|
552
575
|
refreshed?: boolean | undefined;
|
|
553
576
|
/**
|
|
@@ -602,6 +625,10 @@ export type IconNewData = {
|
|
|
602
625
|
previous: string;
|
|
603
626
|
module: string;
|
|
604
627
|
} | undefined;
|
|
628
|
+
/**
|
|
629
|
+
* - From `iconNewSet()`, except in a dry run: the icon definitions the bundled templates use that the set's `map` does not name. A copied template renders a placeholder for each in a project that uses this set.
|
|
630
|
+
*/
|
|
631
|
+
templateMeanings?: IconTemplateMeanings | undefined;
|
|
605
632
|
};
|
|
606
633
|
/**
|
|
607
634
|
* `astryx --json experimental icon new-set <name>`.
|
package/api/icon/icon.type.mjs
CHANGED
|
@@ -166,6 +166,7 @@
|
|
|
166
166
|
* @property {boolean} data.changed - Whether the file was written.
|
|
167
167
|
* @property {{previous: string, module: string}} [data.moduleUpdate] - The data file's `module` before and after this command, when the package was renamed and the command wrote its new name.
|
|
168
168
|
* @property {string[]} [data.files] - The generated module and its types, when its theme map was rewritten.
|
|
169
|
+
* @property {IconTemplateMeanings} [data.templateMeanings] - After a write: the icon definitions the bundled templates use that the set's `map` does not name. A copied template renders a placeholder for each in a project that uses this set.
|
|
169
170
|
*/
|
|
170
171
|
|
|
171
172
|
/**
|
|
@@ -183,6 +184,7 @@
|
|
|
183
184
|
* @property {boolean} data.changed - Whether the file was written.
|
|
184
185
|
* @property {{previous: string, module: string}} [data.moduleUpdate] - The data file's `module` before and after this command, when the package was renamed and the command wrote its new name.
|
|
185
186
|
* @property {string[]} [data.files] - The generated module and its types, when its theme map was rewritten.
|
|
187
|
+
* @property {IconTemplateMeanings} [data.templateMeanings] - After a write: the icon definitions the bundled templates use that the set's `map` does not name. A copied template renders a placeholder for each in a project that uses this set.
|
|
186
188
|
*/
|
|
187
189
|
|
|
188
190
|
/**
|
|
@@ -237,6 +239,7 @@
|
|
|
237
239
|
* @property {boolean} data.added - Whether the icon, its variant, its `map` entry, or a new definition was added. False when the set already had them, even when `changed` is true because the command wrote a renamed package's new name.
|
|
238
240
|
* @property {{previous: string, module: string}} [data.moduleUpdate] - The data file's `module` before and after this command, when the package was renamed and the command wrote its new name.
|
|
239
241
|
* @property {string} [data.note] - What the package still needs, as text to copy: the entry line that exports the icon from the set's module, and the package.json `files` that publishes a `./` source.
|
|
242
|
+
* @property {IconTemplateMeanings} [data.templateMeanings] - After a write: the icon definitions the bundled templates use that the set's `map` does not name. A copied template renders a placeholder for each in a project that uses this set.
|
|
240
243
|
*/
|
|
241
244
|
|
|
242
245
|
/**
|
|
@@ -271,7 +274,7 @@
|
|
|
271
274
|
* @typedef {object} IconOptions
|
|
272
275
|
* @property {string} [cwd]
|
|
273
276
|
* @property {boolean} [list] - List the installed sets.
|
|
274
|
-
* @property {string} [set] - Keep one set, by name or `<package>/<set
|
|
277
|
+
* @property {string} [set] - Keep one set, by name or `<package>/<set>`; with `definitions`, the set whose `map` they are checked against.
|
|
275
278
|
* @property {number} [limit] - Max matches (default 10).
|
|
276
279
|
* @property {boolean} [allIcons] - With `set` and no query: every icon of that set.
|
|
277
280
|
* @property {boolean} [definitions] - Every Astryx icon definition, and nothing else.
|
|
@@ -283,7 +286,16 @@
|
|
|
283
286
|
* @typedef {object} IconDefinitionsResponse
|
|
284
287
|
* @property {'icon.definitions'} type
|
|
285
288
|
* @property {object} data
|
|
286
|
-
* @property {
|
|
289
|
+
* @property {string | null} data.set - The set `mapped` describes, as `<package>/<set>`: the one `set` names, else the project's main set, else the only set of the icon-set package the command runs in; null when there is none.
|
|
290
|
+
* @property {Array<{name: string, builtIn: boolean, description: string, words: string[], templates: number, mapped?: boolean}>} data.definitions - Every Astryx icon definition, by name; `builtIn` ones every set maps. `templates`: how many bundled templates use it. `mapped`: whether the set's `map` names it, present when `set` is not null.
|
|
291
|
+
*/
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* The icon definitions the bundled templates use that a set's `map` does not
|
|
295
|
+
* name.
|
|
296
|
+
* @experimental May change or be removed in a patch release.
|
|
297
|
+
* @typedef {object} IconTemplateMeanings
|
|
298
|
+
* @property {Array<{definition: string, templates: number}>} unmapped - Each such definition and how many bundled templates use it, most used first, then by name; empty when the set maps them all.
|
|
287
299
|
*/
|
|
288
300
|
|
|
289
301
|
/**
|
|
@@ -306,6 +318,7 @@
|
|
|
306
318
|
* @property {boolean} [dryRun] - Return the receipt without writing.
|
|
307
319
|
* @property {string} [from] - A module whose every icon component the set wraps: a package, a package subpath, or a ./ path in the package.
|
|
308
320
|
* @property {string[] | string} [exclude] - With `from`: export names that are not icons; a string is split on commas.
|
|
321
|
+
* @property {string} [adapter] - `./<path>#<export>`: a function in the package that turns one library export that is not a component into one. It is written to the data file's `adapter`; with `from`, every data export of the library becomes an icon through it. On a set that already has icons, only with `from`.
|
|
309
322
|
* @property {string[] | string} [variants] - The variants the set supplies, such as `outline,solid`; a string is split on commas.
|
|
310
323
|
* @property {string} [defaultVariant] - With `variants`: the variant each icon's own export draws; when absent, the look the icons' exports draw in a library whose names encode looks; otherwise the set's current default, else, on a set without icons, the first variant. A set with icons changes it only with `from`, and only in a library whose names encode looks.
|
|
311
324
|
* @property {string} [displayName] - The descriptor's display name; the set name in title case when absent.
|
|
@@ -337,7 +350,7 @@
|
|
|
337
350
|
* @property {boolean} dryRun
|
|
338
351
|
* @property {string} [from]
|
|
339
352
|
* @property {number} [icons] - With `from`: how many icons it wrote.
|
|
340
|
-
* @property {boolean} [refreshed] - With `from` on an existing set: the set was refreshed, not created.
|
|
353
|
+
* @property {boolean} [refreshed] - With `from` on an existing set that has icons: the set was refreshed, not created. Absent when the set had no icons yet: its icons were created.
|
|
341
354
|
* @property {boolean} [updated] - Without `from` on an existing set: its variants, default variant, display name, or description were updated in place, not created.
|
|
342
355
|
* @property {Array<{id: string, from: string, to: string}>} [moved] - On a refresh from a package root: the icons that read one file of that package (`from`) and now import from the root (`to`); each keeps its id, export, `map` entries, variants, and words.
|
|
343
356
|
* @property {{library: string, path: string}} [licenseNoticeMissing] - With `from`: the wrapped library (`name@version`) ships no license file to copy and the set has none. `path` is where to add a NOTICE file that names the library and its license; the CLI never writes it.
|
|
@@ -346,6 +359,7 @@
|
|
|
346
359
|
* @property {Array<{definition: string, icon: string, word: string}>} [suggestions] - With `from`: for each unmapped Astryx definition, up to three icons it might map to, best first: the definition's name in another spelling or as another name of an icon, ids that start with it, an id or another name that is one of its words, then two-word ids that are a one-word word sized, shaped, or numbered (`grid-2x2`); never a negated form, the opposite direction, or an icon already mapped. `word` is the name or word that matched. Never written.
|
|
347
360
|
* @property {string[]} [notes] - What the author does next, including each change the package needs that the CLI never makes itself (its entry, peers, scripts), as text to copy.
|
|
348
361
|
* @property {{previous: string, module: string}} [moduleUpdate] - On a refresh, an update, or a new definition with `icon`: the data file's `module` before and after this command, when the package was renamed and the command writes its new name.
|
|
362
|
+
* @property {IconTemplateMeanings} [templateMeanings] - From `iconNewSet()`, except in a dry run: the icon definitions the bundled templates use that the set's `map` does not name. A copied template renders a placeholder for each in a project that uses this set.
|
|
349
363
|
*/
|
|
350
364
|
|
|
351
365
|
/**
|
package/api/icon/iconAdd.doc.mjs
CHANGED
|
@@ -99,7 +99,7 @@ export const doc = {
|
|
|
99
99
|
{
|
|
100
100
|
type: 'icon.add',
|
|
101
101
|
description:
|
|
102
|
-
|
|
102
|
+
"The icon registered, the definition mapped, and the files written. `templateMeanings.unmapped` lists the icon definitions the bundled templates use that the set's `map` does not name, each with its template count, most used first.",
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
type: 'icon.addVariants',
|
package/api/icon/iconMap.doc.mjs
CHANGED
|
@@ -58,12 +58,12 @@ export const doc = {
|
|
|
58
58
|
{
|
|
59
59
|
type: 'icon.mapMany',
|
|
60
60
|
description:
|
|
61
|
-
|
|
61
|
+
"With pairs: the set, the data file, each entry with the icon it replaced, and whether the file changed. `templateMeanings.unmapped` lists the icon definitions the bundled templates use that the set's `map` does not name, each with its template count, most used first.",
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
type: 'icon.map',
|
|
65
65
|
description:
|
|
66
|
-
|
|
66
|
+
"The set, the data file, the definition, the icon now mapped, the icon it replaced, and whether the file changed. `templateMeanings.unmapped` lists the icon definitions the bundled templates use that the set's `map` does not name, each with its template count, most used first.",
|
|
67
67
|
},
|
|
68
68
|
],
|
|
69
69
|
throws: [
|
|
@@ -10,7 +10,7 @@ export const doc = {
|
|
|
10
10
|
displayName: 'iconNewSet()',
|
|
11
11
|
summary: 'Add an icon set to an integration package.',
|
|
12
12
|
description:
|
|
13
|
-
"Creates an integration manifest when the package has none, writes the set directory with its strongly typed same-stem IconSetDoc and a starter data file (schemaVersion 1, module set to the package name, no icons and an empty map yet), and the set's generated module with its declaration file and an empty themeIcons theme map; with from, it wraps a library's icons into them, records the installed library and version as the data file's source, copies the library's license notices into the set, uses the library's license, maps each Astryx definition whose name is an icon id, and returns up to three likely icons for each other definition as suggestions (by its name, its words, and the other names the library gives an icon; never a part of a word, a negated form, or the opposite direction), never written. A library whose export names end in style, size and weight words gives one icon per glyph, named without those words, in the look the default variant names, else the library's usual default (outline, regular, the middle weight). Over an existing set, `from` refreshes it; without `from`, `variants`, `defaultVariant`, `displayName` and `description` update it in place and leave its icons, map and generated module unchanged (a variant an icon has must stay declared, and a set with icons keeps its default variant). It declares the manifest's `experimental.iconSets` root on first use, and includes the manifest and root in package.json files when the package already uses an allowlist. It never writes the package's entry, exports, main, types, files list, peers, or scripts: its notes name each change the package needs as text to copy. Every path is confined to the package, and an existing set is changed only as above. Experimental: it may change or be removed in a patch release.",
|
|
13
|
+
"Creates an integration manifest when the package has none, writes the set directory with its strongly typed same-stem IconSetDoc and a starter data file (schemaVersion 1, module set to the package name, no icons and an empty map yet), and the set's generated module with its declaration file and an empty themeIcons theme map; with from, it wraps a library's icons into them, records the installed library and version as the data file's source, copies the library's license notices into the set, uses the library's license, maps each Astryx definition whose name is an icon id, and returns up to three likely icons for each other definition as suggestions (by its name, its words, and the other names the library gives an icon; never a part of a word, a negated form, or the opposite direction), never written. A library whose export names end in style, size and weight words gives one icon per glyph, named without those words, in the look the default variant names, else the library's usual default (outline, regular, the middle weight). With adapter, it declares the data file's adapter, so `from` also wraps a library's data exports through it. Over an existing set with icons, `from` refreshes it (the first `from` into a set with no icons creates them); without `from`, `variants`, `defaultVariant`, `displayName` and `description` update it in place and leave its icons, map and generated module unchanged (a variant an icon has must stay declared, and a set with icons keeps its default variant). It declares the manifest's `experimental.iconSets` root on first use, and includes the manifest and root in package.json files when the package already uses an allowlist. It never writes the package's entry, exports, main, types, files list, peers, or scripts: its notes name each change the package needs as text to copy. Every path is confined to the package, and an existing set is changed only as above. Experimental: it may change or be removed in a patch release.",
|
|
14
14
|
importPath: '@astryxdesign/cli/api',
|
|
15
15
|
signature:
|
|
16
16
|
'iconNewSet(name: string, options?: IconNewSetOptions): Promise<IconNewSetResponse>',
|
|
@@ -46,6 +46,12 @@ export const doc = {
|
|
|
46
46
|
description:
|
|
47
47
|
'With from: export names that are not icons; a string is split on commas. SCREAMING_CASE names and number or boolean exports are always left out.',
|
|
48
48
|
},
|
|
49
|
+
{
|
|
50
|
+
name: 'options.adapter',
|
|
51
|
+
type: 'string',
|
|
52
|
+
description:
|
|
53
|
+
"`./<path>#<export>`: a function in the package that turns one library export that is not a component (an icon data object, an SVG string) into one. The file must exist. It is written to the data file's adapter; with from, every data export of the library becomes an icon through it. A set that already has icons takes another adapter only with from.",
|
|
54
|
+
},
|
|
49
55
|
{
|
|
50
56
|
name: 'options.variants',
|
|
51
57
|
type: 'string[] | string',
|
|
@@ -75,7 +81,7 @@ export const doc = {
|
|
|
75
81
|
{
|
|
76
82
|
type: 'icon.newSet',
|
|
77
83
|
description:
|
|
78
|
-
|
|
84
|
+
"What it wrote: the manifest root, the files, and what to do next. Except in a dry run, `templateMeanings.unmapped` lists the icon definitions the bundled templates use that the set's `map` does not name, each with its template count, most used first.",
|
|
79
85
|
},
|
|
80
86
|
],
|
|
81
87
|
throws: [
|
package/api/icon/map/map.mjs
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
findLocalIconSet,
|
|
18
18
|
mappableDefinitions,
|
|
19
19
|
refuseOutsideProject,
|
|
20
|
+
templateMeaningsOf,
|
|
20
21
|
writeGeneratedIcons,
|
|
21
22
|
writeIconSetData,
|
|
22
23
|
definitionNameOf,
|
|
@@ -55,9 +56,12 @@ export async function iconMap(definition, icon, options = {}) {
|
|
|
55
56
|
],
|
|
56
57
|
);
|
|
57
58
|
if (pairs != null) {
|
|
58
|
-
return
|
|
59
|
+
return withTemplateMeanings(
|
|
60
|
+
await authoring(() => mapMany({cwd, selector, pairs})),
|
|
61
|
+
cwd,
|
|
62
|
+
);
|
|
59
63
|
}
|
|
60
|
-
|
|
64
|
+
const result = await authoring(async () => {
|
|
61
65
|
if (typeof definition !== 'string' || definition.trim() === '') {
|
|
62
66
|
throw new AstryxError(
|
|
63
67
|
'Name the icon definition to map',
|
|
@@ -146,6 +150,21 @@ export async function iconMap(definition, icon, options = {}) {
|
|
|
146
150
|
},
|
|
147
151
|
};
|
|
148
152
|
});
|
|
153
|
+
return withTemplateMeanings(result, cwd);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Add the template meanings the set leaves unmapped after the write.
|
|
158
|
+
* @template {{data: {set: string}}} T
|
|
159
|
+
* @param {T} result
|
|
160
|
+
* @param {string} cwd
|
|
161
|
+
* @returns {Promise<T>}
|
|
162
|
+
*/
|
|
163
|
+
async function withTemplateMeanings(result, cwd) {
|
|
164
|
+
const templateMeanings = await templateMeaningsOf(cwd, result.data.set);
|
|
165
|
+
return templateMeanings
|
|
166
|
+
? {...result, data: {...result.data, templateMeanings}}
|
|
167
|
+
: result;
|
|
149
168
|
}
|
|
150
169
|
|
|
151
170
|
/**
|
|
@@ -9,7 +9,12 @@
|
|
|
9
9
|
* command
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
addIconSet,
|
|
14
|
+
authoring,
|
|
15
|
+
refuseOutsideProject,
|
|
16
|
+
templateMeaningsOf,
|
|
17
|
+
} from '../_adapter.mjs';
|
|
13
18
|
import {refuseOtherOptions} from '../_options.mjs';
|
|
14
19
|
|
|
15
20
|
/**
|
|
@@ -28,5 +33,12 @@ export async function iconNewSet(name, options = {}) {
|
|
|
28
33
|
'the integration package',
|
|
29
34
|
);
|
|
30
35
|
const {data} = await authoring(() => addIconSet(name, options));
|
|
31
|
-
|
|
36
|
+
// A dry run writes nothing, so the set's map is not yet what it says.
|
|
37
|
+
const templateMeanings = data.dryRun
|
|
38
|
+
? null
|
|
39
|
+
: await templateMeaningsOf(options.cwd ?? process.cwd(), name);
|
|
40
|
+
return {
|
|
41
|
+
type: 'icon.newSet',
|
|
42
|
+
data: templateMeanings ? {...data, templateMeanings} : data,
|
|
43
|
+
};
|
|
32
44
|
}
|
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
* @position api/icon/search — dispatched by ../icon.mjs
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import {AstryxError} from '../../error.mjs';
|
|
13
|
-
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
14
12
|
import {loadIconSets} from '../_adapter.mjs';
|
|
15
13
|
import {
|
|
16
14
|
answeringMatches,
|
|
15
|
+
oneNamedSet,
|
|
17
16
|
rankIcons,
|
|
18
17
|
setsNamed,
|
|
19
18
|
unusableSet,
|
|
@@ -27,19 +26,7 @@ import {
|
|
|
27
26
|
*/
|
|
28
27
|
export async function iconSetIcons({cwd, set}) {
|
|
29
28
|
const {sets, withdrawn} = await loadIconSets(cwd);
|
|
30
|
-
const
|
|
31
|
-
if (named.length === 0) throw unusableSet(sets, withdrawn, set);
|
|
32
|
-
if (named.length > 1) {
|
|
33
|
-
throw new AstryxError(
|
|
34
|
-
`"${set}" names ${named.length} sets; name one as <package>/<set>`,
|
|
35
|
-
named.map(each => ({
|
|
36
|
-
name: `${each.package}/${each.name}`,
|
|
37
|
-
reason: 'name the package',
|
|
38
|
-
})),
|
|
39
|
-
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
const [only] = named;
|
|
29
|
+
const only = oneNamedSet(sets, withdrawn, set);
|
|
43
30
|
/** @type {Map<string, string[]>} */
|
|
44
31
|
const drawn = new Map();
|
|
45
32
|
for (const [definition, id] of Object.entries(only.data.map ?? {})) {
|
package/api/icon/use/use.mjs
CHANGED
|
@@ -114,10 +114,11 @@ export async function iconUse(
|
|
|
114
114
|
list: Array.isArray(value),
|
|
115
115
|
});
|
|
116
116
|
// Doctor fails a project that installs several sets and leaves one out.
|
|
117
|
-
const
|
|
117
|
+
const unlistedSets = sets.filter(set => !listed.includes(set));
|
|
118
|
+
const unlisted = unlistedSets.map(iconSetKey);
|
|
118
119
|
const left =
|
|
119
|
-
|
|
120
|
-
? unlistedIconSets(sets
|
|
120
|
+
unlistedSets.length > 0
|
|
121
|
+
? unlistedIconSets(sets, main, backupSets, unlistedSets)
|
|
121
122
|
: null;
|
|
122
123
|
return {
|
|
123
124
|
type: 'icon.use',
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
iconSetIssues,
|
|
42
42
|
} from '../../foundation/discovery/icon-set-checks.mjs';
|
|
43
43
|
import {olderCliNotes} from '../../foundation/discovery/doc-stability.mjs';
|
|
44
|
+
import {templateIconMeanings} from '../../foundation/discovery/template-icon-meanings.mjs';
|
|
44
45
|
import {
|
|
45
46
|
templateIconNotes,
|
|
46
47
|
templateIconUndeclaredNotes,
|
|
@@ -503,7 +504,11 @@ async function validateAtPackageDir(
|
|
|
503
504
|
issues.push(...iconSetIssues(packageDir, loaded, unchecked));
|
|
504
505
|
// Which definitions each set leaves unmapped, and what the checks could
|
|
505
506
|
// not judge: listed, never an issue.
|
|
506
|
-
result.iconSets = iconSetCoverage(
|
|
507
|
+
result.iconSets = iconSetCoverage(
|
|
508
|
+
loaded,
|
|
509
|
+
unchecked,
|
|
510
|
+
await templateIconMeanings(),
|
|
511
|
+
);
|
|
507
512
|
}
|
|
508
513
|
// What the docs say that no reader serves: a prop listed twice, an
|
|
509
514
|
// overlay's text for a prop the doc lacks, an empty or unreachable section,
|
|
@@ -202,6 +202,18 @@ export type IconSetCoverage = {
|
|
|
202
202
|
entry?: string;
|
|
203
203
|
reason: string;
|
|
204
204
|
}>;
|
|
205
|
+
/**
|
|
206
|
+
* The icon definitions the bundled templates use that the set's `map`
|
|
207
|
+
* does not name, each with how many templates use it, most used first,
|
|
208
|
+
* then by name. A copied template renders a placeholder for each in a
|
|
209
|
+
* project that uses only this set. Built-in ones are also error issues.
|
|
210
|
+
*/
|
|
211
|
+
templateMeanings?: {
|
|
212
|
+
unmapped: Array<{
|
|
213
|
+
definition: string;
|
|
214
|
+
templates: number;
|
|
215
|
+
}>;
|
|
216
|
+
} | undefined;
|
|
205
217
|
};
|
|
206
218
|
/**
|
|
207
219
|
* A descriptor an older CLI drops: a page or block template, or a namespace
|
|
@@ -140,6 +140,11 @@
|
|
|
140
140
|
* cannot prove either way (`icon`); an adapter export it cannot prove
|
|
141
141
|
* (`adapter`); and a theme map or theme-map entry it cannot read
|
|
142
142
|
* (`entry`).
|
|
143
|
+
* @property {{unmapped: Array<{definition: string, templates: number}>}} [templateMeanings]
|
|
144
|
+
* The icon definitions the bundled templates use that the set's `map`
|
|
145
|
+
* does not name, each with how many templates use it, most used first,
|
|
146
|
+
* then by name. A copied template renders a placeholder for each in a
|
|
147
|
+
* project that uses only this set. Built-in ones are also error issues.
|
|
143
148
|
*/
|
|
144
149
|
|
|
145
150
|
/**
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Start a theme in themes/<name>/, optionally on a built-in theme.
|
|
6
|
+
* @experimental
|
|
7
|
+
* @param {string} name
|
|
8
|
+
* @param {import('./theme-edit.type.mjs').ThemeEditNewOptions} [options]
|
|
9
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditNewResponse>}
|
|
10
|
+
*/
|
|
11
|
+
export function themeEditNew(name: string, options?: import("./theme-edit.type.mjs").ThemeEditNewOptions): Promise<import("./theme-edit.type.mjs").ThemeEditNewResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Change one thing in a theme: checked, built, previewed.
|
|
14
|
+
* @experimental
|
|
15
|
+
* @param {string} theme
|
|
16
|
+
* @param {string} thing a dial, a token, or a CSS property
|
|
17
|
+
* @param {string} value
|
|
18
|
+
* @param {ChangeOptions} [options]
|
|
19
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditChangeResponse>}
|
|
20
|
+
*/
|
|
21
|
+
export function themeEditSet(theme: string, thing: string, value: string, options?: ChangeOptions): Promise<import("./theme-edit.type.mjs").ThemeEditChangeResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Every setting of a theme, key resolved values, problems it caused, the
|
|
24
|
+
* sample page and the theme-building page with every component.
|
|
25
|
+
* @experimental
|
|
26
|
+
* @param {string} theme
|
|
27
|
+
* @param {import('./theme-edit.type.mjs').ThemeEditShowOptions} [options]
|
|
28
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditShowResponse>}
|
|
29
|
+
*/
|
|
30
|
+
export function themeEditShow(theme: string, options?: import("./theme-edit.type.mjs").ThemeEditShowOptions): Promise<import("./theme-edit.type.mjs").ThemeEditShowResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* Put the theme back as it was before its last change. With `thing`, remove
|
|
33
|
+
* that one setting instead, wherever it is in the settings: it goes back to
|
|
34
|
+
* the base theme's value.
|
|
35
|
+
* @experimental
|
|
36
|
+
* @param {string} theme
|
|
37
|
+
* @param {import('./theme-edit.type.mjs').ThemeEditUndoOptions} [options]
|
|
38
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditUndoResponse | import('./theme-edit.type.mjs').ThemeEditChangeResponse>}
|
|
39
|
+
*/
|
|
40
|
+
export function themeEditUndo(theme: string, options?: import("./theme-edit.type.mjs").ThemeEditUndoOptions): Promise<import("./theme-edit.type.mjs").ThemeEditUndoResponse | import("./theme-edit.type.mjs").ThemeEditChangeResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* Add pages to the in-app theme preview, and write the preview route the
|
|
43
|
+
* first time. With a description, the build ranking picks the template
|
|
44
|
+
* pages that fit it best (`top` of them); `template` names one instead.
|
|
45
|
+
* With neither, the default pages: the sample app page and every component.
|
|
46
|
+
* Every check runs before the first write, so a refusal changes nothing.
|
|
47
|
+
* @experimental
|
|
48
|
+
* @param {string} [description]
|
|
49
|
+
* @param {import('./theme-edit.type.mjs').ThemeEditPreviewAddOptions} [options]
|
|
50
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewAddResponse>}
|
|
51
|
+
*/
|
|
52
|
+
export function themeEditPreviewAdd(description?: string, options?: import("./theme-edit.type.mjs").ThemeEditPreviewAddOptions): Promise<import("./theme-edit.type.mjs").ThemeEditPreviewAddResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* Make a new starter app (Next.js app router, Core and the neutral theme,
|
|
55
|
+
* with the Astryx packages pinned to this CLI's release) in `dir`, with the
|
|
56
|
+
* theme preview route and its default pages inside. With `theme`, the theme
|
|
57
|
+
* folder is copied into the app and the pages wear it. No install runs.
|
|
58
|
+
* Every check runs before the first write, so a refusal changes nothing.
|
|
59
|
+
* @experimental
|
|
60
|
+
* @param {string} dir
|
|
61
|
+
* @param {import('./theme-edit.type.mjs').ThemeEditPreviewAppOptions} [options]
|
|
62
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewAppResponse>}
|
|
63
|
+
*/
|
|
64
|
+
export function themeEditPreviewApp(dir: string, options?: import("./theme-edit.type.mjs").ThemeEditPreviewAppOptions): Promise<import("./theme-edit.type.mjs").ThemeEditPreviewAppResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* The pages of the in-app theme preview. With no preview, and with no
|
|
67
|
+
* routes folder for one, the list is empty.
|
|
68
|
+
* @experimental
|
|
69
|
+
* @param {import('./theme-edit.type.mjs').ThemeEditPreviewListOptions} [options]
|
|
70
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewListResponse>}
|
|
71
|
+
*/
|
|
72
|
+
export function themeEditPreviewList(options?: import("./theme-edit.type.mjs").ThemeEditPreviewListOptions): Promise<import("./theme-edit.type.mjs").ThemeEditPreviewListResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Remove one page from the in-app theme preview, or with no page the whole
|
|
75
|
+
* preview: only the files it wrote are deleted, and only inside the route
|
|
76
|
+
* folder.
|
|
77
|
+
* @experimental
|
|
78
|
+
* @param {string} [page]
|
|
79
|
+
* @param {import('./theme-edit.type.mjs').ThemeEditPreviewListOptions} [options]
|
|
80
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewRemoveResponse>}
|
|
81
|
+
*/
|
|
82
|
+
export function themeEditPreviewRemove(page?: string, options?: import("./theme-edit.type.mjs").ThemeEditPreviewListOptions): Promise<import("./theme-edit.type.mjs").ThemeEditPreviewRemoveResponse>;
|
|
83
|
+
/**
|
|
84
|
+
* Explain anything a theme change can name, or answer a question about one:
|
|
85
|
+
* a part (what it reads for each aspect, its variants, states and the parts
|
|
86
|
+
* inside it), a family (its members), a setting (a dial's rungs, a token's
|
|
87
|
+
* type and readers, a CSS property), an aspect (colors, text, corners...: the
|
|
88
|
+
* whole-theme tokens and dial), a plain-words question (exact commands), a
|
|
89
|
+
* PNG picture (its main colors, or the color at points), or with `list` a
|
|
90
|
+
* list of dials, tokens, parts, families or CSS properties.
|
|
91
|
+
* @experimental
|
|
92
|
+
* @param {string} subject a part, family, setting, aspect, question, or PNG file; with `list`, a filter
|
|
93
|
+
* @param {import('./theme-edit.type.mjs').ThemeEditHowOptions} [options]
|
|
94
|
+
* @returns {Promise<import('./theme-edit.type.mjs').ThemeEditHowResponse>}
|
|
95
|
+
*/
|
|
96
|
+
export function themeEditHow(subject: string, options?: import("./theme-edit.type.mjs").ThemeEditHowOptions): Promise<import("./theme-edit.type.mjs").ThemeEditHowResponse>;
|
|
97
|
+
/**
|
|
98
|
+
* Read `--at` points: "x,y;x,y", "x,y x,y", repeated, or a flat "a,b,c,d".
|
|
99
|
+
* @param {string[]} at
|
|
100
|
+
*/
|
|
101
|
+
export function parsePoints(at: string[]): {
|
|
102
|
+
x: number;
|
|
103
|
+
y: number;
|
|
104
|
+
}[];
|
|
105
|
+
export type ChangeOptions = import("./theme-edit.type.mjs").ThemeEditChangeOptions;
|
|
106
|
+
export type PreviewPage = {
|
|
107
|
+
id: string;
|
|
108
|
+
label: string;
|
|
109
|
+
file: string;
|
|
110
|
+
};
|
|
111
|
+
export type PreviewData = {
|
|
112
|
+
version: 1;
|
|
113
|
+
theme: string | null;
|
|
114
|
+
pages: PreviewPage[];
|
|
115
|
+
files: string[];
|
|
116
|
+
};
|