@astryxdesign/cli 0.7.15 → 0.7.16-canary.g8514aae

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.
Files changed (116) hide show
  1. package/README.md +5 -3
  2. package/api/component/_adapter.d.mts +1 -1
  3. package/api/component/_adapter.mjs +28 -1
  4. package/api/doctor/_adapter.d.mts +17 -0
  5. package/api/doctor/_adapter.mjs +35 -0
  6. package/api/doctor/doctor.mjs +18 -4
  7. package/api/integration/validate-integration.mjs +1 -1
  8. package/api/theme/_adapter.d.mts +5 -2
  9. package/api/theme/_adapter.mjs +43 -12
  10. package/api/theme/build/build.d.mts +1 -21
  11. package/api/theme/build/build.mjs +149 -37
  12. package/api/theme/eject/eject.mjs +22 -1
  13. package/api/theme/template/template.d.mts +19 -0
  14. package/api/theme/template/template.mjs +91 -19
  15. package/api/theme/theme.type.d.mts +5 -1
  16. package/api/theme/theme.type.mjs +2 -1
  17. package/api/theme/themeBuild.doc.mjs +3 -3
  18. package/api/theme/themeEject.doc.mjs +1 -1
  19. package/api/theme/themeTemplate.doc.mjs +9 -3
  20. package/api/theme-edit/_adapter.d.mts +21 -0
  21. package/api/theme-edit/_adapter.mjs +176 -22
  22. package/api/theme-edit/_check.d.mts +7 -0
  23. package/api/theme-edit/_check.mjs +1050 -173
  24. package/api/theme-edit/_color.d.mts +2 -8
  25. package/api/theme-edit/_color.mjs +292 -219
  26. package/api/theme-edit/_compiler.d.mts +1 -0
  27. package/api/theme-edit/_compiler.mjs +20 -1
  28. package/api/theme-edit/_context.d.mts +21 -0
  29. package/api/theme-edit/_context.mjs +235 -12
  30. package/api/theme-edit/_css.d.mts +50 -1
  31. package/api/theme-edit/_css.mjs +310 -28
  32. package/api/theme-edit/_edit.d.mts +9 -0
  33. package/api/theme-edit/_edit.mjs +907 -123
  34. package/api/theme-edit/_how-commands.d.mts +11 -26
  35. package/api/theme-edit/_how-commands.mjs +30 -2
  36. package/api/theme-edit/_how-question.d.mts +7 -0
  37. package/api/theme-edit/_how-question.mjs +1304 -176
  38. package/api/theme-edit/_how.mjs +144 -30
  39. package/api/theme-edit/_palette.d.mts +6 -0
  40. package/api/theme-edit/_palette.mjs +164 -62
  41. package/api/theme-edit/_parts.d.mts +16 -0
  42. package/api/theme-edit/_parts.mjs +49 -1
  43. package/api/theme-edit/_png.mjs +19 -14
  44. package/api/theme-edit/_preview-app.mjs +514 -27
  45. package/api/theme-edit/_preview.d.mts +11 -0
  46. package/api/theme-edit/_preview.mjs +245 -24
  47. package/api/theme-edit/_project.d.mts +11 -0
  48. package/api/theme-edit/_project.mjs +35 -9
  49. package/api/theme-edit/_settings.d.mts +122 -5
  50. package/api/theme-edit/_settings.mjs +1363 -71
  51. package/api/theme-edit/_tables.d.mts +19 -0
  52. package/api/theme-edit/_tables.mjs +205 -149
  53. package/api/theme-edit/_vet.d.mts +42 -0
  54. package/api/theme-edit/_vet.mjs +144 -0
  55. package/api/theme-edit/theme-edit.type.d.mts +2 -1
  56. package/api/theme-edit/theme-edit.type.mjs +1 -1
  57. package/api/theme-edit/themeEditNew.doc.mjs +1 -1
  58. package/api/theme-edit/themeEditShow.doc.mjs +11 -3
  59. package/assets/docs/tree/single-component.doc.mjs +11 -2
  60. package/assets/docs/tree/tokens-and-setup.doc.mjs +39 -3
  61. package/assets/docs.generated.json +2 -2
  62. package/assets/preview-app/next.config.mjs +7 -1
  63. package/assets/preview-app/src/app/globals.css +1 -0
  64. package/assets/self-audit.generated.json +1 -1
  65. package/assets/templates/blocks/components/Table/ColumnsVirtualizationHookUsage.doc.mjs +14 -0
  66. package/assets/templates/blocks/components/Table/ColumnsVirtualizationHookUsage.tsx +53 -0
  67. package/assets/templates/blocks/components/Table/InfiniteScrollHookUsage.doc.mjs +14 -0
  68. package/assets/templates/blocks/components/Table/InfiniteScrollHookUsage.tsx +33 -0
  69. package/assets/templates/components.generated.json +1 -1
  70. package/authoring/doctypes/_schema.d.mts +52 -5
  71. package/authoring/doctypes/_schema.mjs +62 -7
  72. package/authoring/doctypes/base/type.ts +10 -0
  73. package/authoring/doctypes/component/component.doc.mjs +1 -1
  74. package/authoring/doctypes/function/function.doc.mjs +6 -0
  75. package/authoring/doctypes/function/type.ts +3 -0
  76. package/authoring/doctypes/legacy.mjs +5 -1
  77. package/authoring/index.d.ts +1 -0
  78. package/clients/cli/build-id.generated.json +1 -1
  79. package/clients/cli/commands/doctor.doc.mjs +2 -2
  80. package/clients/cli/commands/experimental/theme.mjs +188 -37
  81. package/clients/cli/commands/experimental-theme-compile.doc.mjs +2 -2
  82. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +1 -1
  83. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +2 -2
  84. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
  85. package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
  86. package/clients/cli/commands/experimental-theme-eject.doc.mjs +1 -1
  87. package/clients/cli/commands/experimental-theme-template.doc.mjs +2 -2
  88. package/clients/cli/commands/theme-build.doc.mjs +2 -2
  89. package/clients/cli/commands/theme-eject.doc.mjs +1 -1
  90. package/clients/cli/commands/theme-template.doc.mjs +3 -1
  91. package/clients/cli/commands/theme.mjs +89 -6
  92. package/clients/cli/formatters/index.mjs +7 -4
  93. package/clients/cli/lib/cli-error.mjs +9 -3
  94. package/clients/cli/lib/component-format.mjs +27 -9
  95. package/clients/cli/lib/json-shim.mjs +40 -2
  96. package/clients/cli/manifest.generated.json +1 -1
  97. package/foundation/config/project.mjs +50 -14
  98. package/foundation/discovery/theme-discovery.d.mts +5 -1
  99. package/foundation/discovery/theme-discovery.mjs +24 -3
  100. package/foundation/fs/gather-cache.d.mts +9 -2
  101. package/foundation/fs/gather-cache.mjs +36 -10
  102. package/foundation/fs/paths.d.mts +16 -0
  103. package/foundation/fs/paths.mjs +25 -0
  104. package/foundation/render/host-exit.d.mts +8 -0
  105. package/foundation/render/host-exit.mjs +11 -0
  106. package/foundation/render/page-host.mjs +56 -10
  107. package/foundation/render/page-worker.mjs +14 -0
  108. package/foundation/render/render-page.mjs +37 -2
  109. package/foundation/response/error-codes.d.mts +2 -1
  110. package/foundation/response/error-codes.d.ts +1 -0
  111. package/foundation/response/error-codes.doc.mjs +5 -0
  112. package/foundation/response/error-codes.mjs +3 -0
  113. package/foundation/response/json.d.mts +15 -0
  114. package/foundation/response/json.mjs +52 -1
  115. package/foundation/response/response-types.doc.mjs +1 -1
  116. package/package.json +7 -6
@@ -9,6 +9,7 @@
9
9
  */
10
10
 
11
11
  import {createRequire} from 'node:module';
12
+ import {wordTable} from './_tables.mjs';
12
13
 
13
14
  const require = createRequire(import.meta.url);
14
15
 
@@ -58,18 +59,118 @@ let names = null;
58
59
  export function cssProperties() {
59
60
  if (names) return names;
60
61
  const mdn = mdnProperties();
62
+ const current = syntaxPatches().properties;
61
63
  names = new Set([
62
64
  ...Object.keys(csstree().lexer.properties).filter(
63
- k => !k.startsWith('-') && mdn[k] && mdn[k].status !== 'obsolete',
65
+ k =>
66
+ !k.startsWith('-') &&
67
+ mdn[k] &&
68
+ // MDN marks a renamed property obsolete (font-stretch is font-width
69
+ // now); one the current specifications still define, as browsers
70
+ // ship it, stays.
71
+ (mdn[k].status !== 'obsolete' || k in current),
64
72
  ),
65
73
  ...NOT_IN_MDN_YET,
66
74
  ]);
67
75
  return names;
68
76
  }
69
77
 
78
+ /**
79
+ * The current specifications' grammar, as patches to css-tree's: the
80
+ * ranges MDN's data leaves out (`line-height` takes `<number [0,∞]>`).
81
+ * @returns {{properties: Record<string, string>, types: Record<string, string>, atrules: Record<string, unknown>}}
82
+ */
83
+ const syntaxPatches = () =>
84
+ require('@csstools/css-syntax-patches-for-csstree').next;
85
+
86
+ /** @type {any} */
87
+ let patched = null;
88
+ /** css-tree's lexer with the current specifications' grammar. */
89
+ const currentLexer = () => (patched ??= csstree().fork(syntaxPatches()).lexer);
90
+
91
+ /** @type {Map<string, Set<string>>} */
92
+ const longhandCache = new Map();
93
+
94
+ /**
95
+ * Every longhand a shorthand sets, through shorthands inside it (border
96
+ * sets border-color, so border-top-color), as MDN's data lists them; empty
97
+ * for a property that is no shorthand.
98
+ * @param {string} prop
99
+ * @returns {Set<string>}
100
+ */
101
+ export function longhandsOf(prop) {
102
+ const cached = longhandCache.get(prop);
103
+ if (cached) return cached;
104
+ /** @type {Set<string>} */
105
+ const out = new Set();
106
+ longhandCache.set(prop, out);
107
+ const computed = /** @type {any} */ (mdnProperties()[prop])?.computed;
108
+ if (Array.isArray(computed))
109
+ for (const p of computed) {
110
+ if (typeof p !== 'string' || p === prop) continue;
111
+ out.add(p);
112
+ for (const q of longhandsOf(p)) out.add(q);
113
+ }
114
+ return out;
115
+ }
116
+
117
+ /**
118
+ * Whether setting `a` sets `b` too: `b` is one of `a`'s longhands, or a
119
+ * shorthand whose every longhand `a` sets (border covers border-top).
120
+ * overflow-wrap is no part of overflow, nor transform-origin of transform.
121
+ * @param {string} a
122
+ * @param {string} b
123
+ */
124
+ export function coversProperty(a, b) {
125
+ if (a === b) return false;
126
+ const of = longhandsOf(a);
127
+ if (of.has(b)) return true;
128
+ const sub = longhandsOf(b);
129
+ return sub.size > 0 && [...sub].every(x => of.has(x));
130
+ }
131
+
70
132
  /** What a var() or env() may stand for while the rest of a value is matched. */
71
133
  const VAR_STANDS_FOR = ['0', '1px', '1ms', 'red', 'ease', 'serif', '0 0 red'];
72
134
 
135
+ /**
136
+ * The value as it reads when each variable is unset: every `var(--x, f)`
137
+ * replaced by its fallback `f`; null when no var() has one.
138
+ * @param {string} value
139
+ * @returns {string | null}
140
+ */
141
+ export function withFallbacks(value) {
142
+ let any = false;
143
+ /** @param {string} v @returns {string} */
144
+ const pass = v => {
145
+ const at = v.search(/var\(/i);
146
+ if (at < 0) return v;
147
+ let depth = 0;
148
+ let comma = -1;
149
+ let end = -1;
150
+ for (let i = at + 4; i < v.length; i++) {
151
+ const c = v[i];
152
+ if (c === '(') depth++;
153
+ else if (c === ')') {
154
+ if (depth === 0) {
155
+ end = i;
156
+ break;
157
+ }
158
+ depth--;
159
+ } else if (c === ',' && depth === 0 && comma < 0) comma = i;
160
+ }
161
+ if (end < 0) return v;
162
+ if (comma < 0) return v.slice(0, end + 1) + pass(v.slice(end + 1));
163
+ any = true;
164
+ return (
165
+ v.slice(0, at) +
166
+ pass(v.slice(comma + 1, end).trim()) +
167
+ pass(v.slice(end + 1))
168
+ );
169
+ };
170
+ const out = pass(value);
171
+ return any ? out : null;
172
+ }
173
+
73
174
  /**
74
175
  * Whether a value matches a property's grammar, as css-tree reads it. A
75
176
  * var() or env() can hold anything, so the value matches when some
@@ -178,7 +279,8 @@ function matchWith(value, match) {
178
279
  /**
179
280
  * Whether a value that matches a property's grammar is still below a range
180
281
  * the specs set and css-tree's data does not carry: a `<line-width>` (a
181
- * border or outline width) and a duration are never negative.
282
+ * border or outline width) and a duration are never negative, nor is any
283
+ * number the current specifications' grammar ranges at 0 or more.
182
284
  * @param {string} property
183
285
  * @param {string} value
184
286
  */
@@ -208,6 +310,19 @@ export function belowRange(property, value) {
208
310
  numbersIn(ast).some(n => n.value < 0 && ['s', 'ms'].includes(n.unit))
209
311
  )
210
312
  below = true;
313
+ // A negative number the current grammar's range refuses (`line-height
314
+ // -1`, `gap -2px`).
315
+ // Only the sign decides: the same value with every number made positive
316
+ // must match the current grammar.
317
+ if (!below && numbersIn(ast).some(n => n.value < 0)) {
318
+ const lexer = currentLexer();
319
+ const positive = parse(value.replace(/(^|[\s(,/])-(?=\.?\d)/g, '$1'), {
320
+ context: 'value',
321
+ });
322
+ below =
323
+ Boolean(lexer.matchProperty(property, ast).error) &&
324
+ !lexer.matchProperty(property, positive).error;
325
+ }
211
326
  return below;
212
327
  }
213
328
 
@@ -299,15 +414,17 @@ const UNIT_TYPES = /** @type {Record<string, string>} */ (
299
414
  )
300
415
  );
301
416
  /** A value of each type, to match where a math function stands. */
302
- const TYPE_SAMPLES = /** @type {Record<string, string>} */ ({
303
- number: '1',
304
- percent: '1%',
305
- length: '1px',
306
- time: '1s',
307
- angle: '1deg',
308
- frequency: '1hz',
309
- resolution: '1dppx',
310
- });
417
+ const TYPE_SAMPLES = wordTable(
418
+ /** @type {Record<string, string>} */ ({
419
+ number: '1',
420
+ percent: '1%',
421
+ length: '1px',
422
+ time: '1s',
423
+ angle: '1deg',
424
+ frequency: '1hz',
425
+ resolution: '1dppx',
426
+ }),
427
+ );
311
428
 
312
429
  /**
313
430
  * The type of a sum (or of the arguments of min(), max(), clamp()):
@@ -513,10 +630,15 @@ export function numbersIn(ast) {
513
630
  csstree().walk(ast, {
514
631
  enter(/** @type {any} */ node) {
515
632
  if (node.type === 'Function') fns.push(node.name.toLowerCase());
516
- if (node.type === 'Dimension' || node.type === 'Number')
633
+ if (
634
+ node.type === 'Dimension' ||
635
+ node.type === 'Number' ||
636
+ node.type === 'Percentage'
637
+ )
517
638
  out.push({
518
639
  value: Number(node.value),
519
- unit: (node.unit ?? '').toLowerCase(),
640
+ unit:
641
+ node.type === 'Percentage' ? '%' : (node.unit ?? '').toLowerCase(),
520
642
  fn: fns.at(-1) ?? null,
521
643
  });
522
644
  },
@@ -565,6 +687,40 @@ export function keywordsOf(prop) {
565
687
  return [...words];
566
688
  }
567
689
 
690
+ /** @type {string[] | null} */
691
+ let generics = null;
692
+
693
+ /**
694
+ * The CSS generic font families (serif, math, ui-rounded …), as the
695
+ * grammar's `<generic-family>` type lists them; non-standard ones left out.
696
+ * @returns {string[]}
697
+ */
698
+ export function genericFamilies() {
699
+ if (generics) return generics;
700
+ const t = csstree();
701
+ const seen = new Set();
702
+ /** @type {Set<string>} */
703
+ const words = new Set();
704
+ /** @param {any} syntax */
705
+ const walk = syntax => {
706
+ if (!syntax) return;
707
+ t.definitionSyntax.walk(syntax, (/** @type {any} */ n) => {
708
+ if (n.type === 'Keyword') {
709
+ if (!n.name.startsWith('-')) words.add(n.name);
710
+ } else if (
711
+ n.type === 'Type' &&
712
+ !n.name.startsWith('-') &&
713
+ !seen.has(n.name)
714
+ ) {
715
+ seen.add(n.name);
716
+ walk(currentLexer().types[n.name]?.syntax);
717
+ }
718
+ });
719
+ };
720
+ walk(currentLexer().types['generic-family']?.syntax);
721
+ return (generics = [...words]);
722
+ }
723
+
568
724
  /**
569
725
  * A value the property takes, to put in a suggestion: its initial value
570
726
  * from MDN's data (a shorthand's first longhand's).
@@ -583,13 +739,64 @@ export function initialOf(prop) {
583
739
  : null;
584
740
  }
585
741
 
742
+ /**
743
+ * One CSS number, percentage or dimension, read by css-tree's tokenizer as
744
+ * the browser reads it (`1.5e0`, `+1.5`, `15E-1`, `1.5EM`; never `50.%`),
745
+ * or null for anything else.
746
+ * @param {string} value
747
+ * @returns {{value: number, unit: string} | null}
748
+ */
749
+ export function cssNumber(value) {
750
+ /** @type {any} */
751
+ let ast;
752
+ try {
753
+ ast = csstree().parse(value.trim(), {context: 'value'});
754
+ } catch {
755
+ return null;
756
+ }
757
+ const nodes = ast.children?.toArray?.() ?? [];
758
+ if (nodes.length !== 1) return null;
759
+ const [n] = nodes;
760
+ if (n.type === 'Number') return {value: Number(n.value), unit: ''};
761
+ if (n.type === 'Percentage') return {value: Number(n.value), unit: '%'};
762
+ if (n.type === 'Dimension')
763
+ return {value: Number(n.value), unit: String(n.unit).toLowerCase()};
764
+ return null;
765
+ }
766
+
767
+ /**
768
+ * A value split at `sep` outside brackets: `a(b, c), d` by `,` is
769
+ * [`a(b, c)`, ` d`]. A space separator also splits runs of spaces.
770
+ * @param {string} v
771
+ * @param {',' | ' ' | '/'} sep
772
+ * @returns {string[]}
773
+ */
774
+ export function splitTop(v, sep) {
775
+ /** @type {string[]} */
776
+ const out = [];
777
+ let depth = 0;
778
+ let cur = '';
779
+ for (const c of v) {
780
+ if (c === '(') depth++;
781
+ if (c === ')') depth--;
782
+ if (depth === 0 && (sep === ' ' ? /\s/.test(c) : c === sep)) {
783
+ if (cur.trim() || sep === ',') out.push(cur);
784
+ cur = '';
785
+ } else cur += c;
786
+ }
787
+ if (cur.trim() || sep === ',') out.push(cur);
788
+ return out.filter(x => sep === ',' || x.trim());
789
+ }
790
+
586
791
  /** The longhand each type of the `font` grammar sets, where css-tree names a type, not a property. */
587
- const FONT_TYPE_LONGHAND = /** @type {Record<string, string>} */ ({
588
- 'font-variant-css2': 'font-variant-caps',
589
- 'font-width-css3': 'font-stretch',
590
- 'font-stretch-absolute': 'font-stretch',
591
- 'system-family-name': 'system',
592
- });
792
+ const FONT_TYPE_LONGHAND = wordTable(
793
+ /** @type {Record<string, string>} */ ({
794
+ 'font-variant-css2': 'font-variant-caps',
795
+ 'font-width-css3': 'font-stretch',
796
+ 'font-stretch-absolute': 'font-stretch',
797
+ 'system-family-name': 'system',
798
+ }),
799
+ );
593
800
 
594
801
  /**
595
802
  * The parts of a CSS `font` value, by the longhand each sets, as written:
@@ -602,15 +809,90 @@ const FONT_TYPE_LONGHAND = /** @type {Record<string, string>} */ ({
602
809
  */
603
810
  export function fontShorthandParts(value) {
604
811
  const {lexer, parse, generate} = csstree();
605
- const word = value.trim().toLowerCase();
606
- if (/^[a-z-]+$/.test(word))
607
- for (const prop of [
608
- 'font-weight',
609
- 'font-style',
610
- 'font-variant-caps',
611
- 'font-stretch',
612
- ])
613
- if (keywordsOf(prop).includes(word)) return {[prop]: word};
812
+ // Words that are each one longhand's keyword, size or weight (`bold`,
813
+ // `italic bold`, `bold 1rem`) are those longhands, in any order before the
814
+ // size; after the size the rest is the family (`1rem bold` names a family
815
+ // called bold), as CSS reads it.
816
+ const LONGHANDS = [
817
+ 'font-weight',
818
+ 'font-style',
819
+ 'font-variant-caps',
820
+ 'font-stretch',
821
+ 'font-size',
822
+ ];
823
+ // A lone generic family (math, fangsong) is a family, though a longhand
824
+ // may share the word (font-size: math).
825
+ if (genericFamilies().includes(value.trim().toLowerCase()))
826
+ return {'font-family': value.trim()};
827
+ if (!value.includes(',')) {
828
+ /** @type {Record<string, string>} */
829
+ const each = {};
830
+ const words = splitTop(value.trim(), ' ');
831
+ let all = true;
832
+ // `normal` fits several longhands: every other word is placed first,
833
+ // then each `normal` takes the first longhand still free.
834
+ const normals = words.filter(w => w.toLowerCase() === 'normal').length;
835
+ // A normal after the size is part of the family, read below.
836
+ const sizeAt = words.findIndex(
837
+ w => matchValue('font-size', w.split('/')[0]) && !/^[a-z-]+$/i.test(w),
838
+ );
839
+ if (
840
+ sizeAt >= 0 &&
841
+ words.slice(sizeAt + 1).some(w => w.toLowerCase() === 'normal')
842
+ )
843
+ all = false;
844
+ for (const w of words.filter(x => x.toLowerCase() !== 'normal')) {
845
+ if (!all) break;
846
+ const lower = w.toLowerCase();
847
+ // After the size, the rest is the family (16px bold names a family
848
+ // called bold): the grammar below reads it.
849
+ if ('font-size' in each) {
850
+ all = false;
851
+ break;
852
+ }
853
+ // A size with its line height (1rem/1.5).
854
+ const slash = /^([^/]+)\/([^/]+)$/.exec(w);
855
+ if (
856
+ slash &&
857
+ !('font-size' in each) &&
858
+ matchValue('font-size', slash[1]) &&
859
+ matchValue('line-height', slash[2])
860
+ ) {
861
+ each['font-size'] = slash[1];
862
+ each['line-height'] = slash[2];
863
+ continue;
864
+ }
865
+ const takers = LONGHANDS.filter(p => keywordsOf(p).includes(lower));
866
+ const keyword = takers.find(p => !(p in each));
867
+ // A part given twice (bold bold, bold lighter, italic oblique) is no
868
+ // font value.
869
+ if (takers.length && !keyword) return {repeat: lower, part: takers[0]};
870
+ const prop =
871
+ keyword ??
872
+ ['font-size', 'font-weight'].find(
873
+ p => !(p in each) && !/^[a-z-]+$/i.test(w) && matchValue(p, w),
874
+ );
875
+ if (!prop) {
876
+ all = false;
877
+ break;
878
+ }
879
+ each[prop] = /^[a-z-]+$/i.test(w) ? lower : w;
880
+ }
881
+ for (let n = 0; all && n < normals; n += 1) {
882
+ const free = LONGHANDS.find(
883
+ p => !(p in each) && keywordsOf(p).includes('normal'),
884
+ );
885
+ if (!free)
886
+ return {
887
+ repeat: 'normal',
888
+ part: LONGHANDS.filter(p => keywordsOf(p).includes('normal')).join(
889
+ ', ',
890
+ ),
891
+ };
892
+ each[free] = 'normal';
893
+ }
894
+ if (all && words.length) return each;
895
+ }
614
896
  /** @type {any} */
615
897
  let ast;
616
898
  try {
@@ -11,6 +11,15 @@
11
11
  * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditNewResponse>}
12
12
  */
13
13
  export function themeEditNew(name: string, options?: import("./theme-edit.type.mjs").ThemeEditNewOptions): Promise<import("./theme-edit.type.mjs").ThemeEditNewResponse>;
14
+ /**
15
+ * The options of a `new` as flags, in the order given (`new --help`'s order
16
+ * for the command): `--like`, each dial setting, then `--png`.
17
+ * @param {string | null | undefined} like none when null or undefined
18
+ * @param {Record<string, string | string[] | undefined>} settings
19
+ * @param {boolean} [png]
20
+ * @returns {string[]}
21
+ */
22
+ export function newFlagList(like: string | null | undefined, settings: Record<string, string | string[] | undefined>, png?: boolean): string[];
14
23
  /**
15
24
  * Change one thing in a theme: checked, built, previewed.
16
25
  * @experimental