bestax-migrate 2.22.1 → 2.23.1

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.
@@ -242,6 +242,14 @@ export interface RootEntry {
242
242
  readonly tag: string;
243
243
  readonly prop: string;
244
244
  };
245
+ /**
246
+ * The target builds its children from props (`IconText`): each `.icon`
247
+ * inside becomes one icon's props, its glyph's classes read as `library`
248
+ * and `name`, and a bare `<span>` of text right after it becomes that
249
+ * icon's text. The element converts only when its children are just that,
250
+ * and each `.icon` converts on its own; they go.
251
+ */
252
+ readonly buildsIcons?: boolean;
245
253
  /** The target takes no helper props, so every helper class stays a class. */
246
254
  readonly noHelpers?: boolean;
247
255
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"class-map.d.ts","sourceRoot":"","sources":["../../../src/sources/bulma-classes/class-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,MAAM,MAAM,GAChB;IAAE,QAAQ,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAE9E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;IACtC,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EA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AQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CA0CA,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEnE;AAiBD,qCAAqC;AACrC,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAE5D;AAED,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAE7D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAGlE;AAED,qCAAqC;AACrC,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,MAAM,GACZ,QAAQ,GAAG,SAAS,CAEtB;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE5D;AAED,0CAA0C;AAC1C,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE1D"}
@@ -1255,7 +1255,16 @@ export const ROOTS = {
1255
1255
  ],
1256
1256
  passThrough: ['style'],
1257
1257
  },
1258
- 'icon-text': todo('IconText', 'bestax `IconText` pairs with `Icon`, which renders its own `<i>`'),
1258
+ // `IconText` builds its icons from `iconProps` (`items`, for more than
1259
+ // one) and wraps each text in a `<span>` of its own, so the `.icon`s and
1260
+ // the texts beside them become its props.
1261
+ 'icon-text': {
1262
+ ...BASE,
1263
+ target: 'IconText',
1264
+ tag: 'span',
1265
+ buildsIcons: true,
1266
+ ownProps: ['textColor', 'bgColor', 'color', 'iconProps', 'items'],
1267
+ },
1259
1268
  // `Image` renders `.image` and the `<img>` inside it together, from `src`
1260
1269
  // and `alt`. A ratio stays a class: as `size`, it adds `has-ratio` too.
1261
1270
  image: {
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Read an icon's glyph, the `<i>` inside a `.icon`, as the props bestax
3
+ * `Icon` builds it from. Pure and exact: a glyph reads only when `Icon`,
4
+ * given those props, renders that `<i>` with exactly its classes and nothing
5
+ * else. `library` is always written, so a `ConfigProvider` with another
6
+ * `iconLibrary` can't change what renders.
7
+ */
8
+ import type { ChildFacts } from './plan.js';
9
+ export interface Glyph {
10
+ library: 'fa' | 'mdi';
11
+ name: string;
12
+ /** Font Awesome's style, when it isn't `Icon`'s default `fas`. */
13
+ variant?: string;
14
+ /** The glyph's other classes, which `Icon` renders after its own. */
15
+ features?: string[];
16
+ }
17
+ /**
18
+ * The props `Icon` renders this glyph from, or undefined when it can't: the
19
+ * glyph must be a bare, empty `<i>` whose classes name one Font Awesome or
20
+ * Material Design Icons glyph.
21
+ */
22
+ export declare function readGlyph(glyph: ChildFacts | undefined): Glyph | undefined;
23
+ //# sourceMappingURL=glyph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glyph.d.ts","sourceRoot":"","sources":["../../../src/sources/bulma-classes/glyph.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE,IAAI,GAAG,KAAK,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAkFD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,CAmC1E"}
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Read an icon's glyph, the `<i>` inside a `.icon`, as the props bestax
3
+ * `Icon` builds it from. Pure and exact: a glyph reads only when `Icon`,
4
+ * given those props, renders that `<i>` with exactly its classes and nothing
5
+ * else. `library` is always written, so a `ConfigProvider` with another
6
+ * `iconLibrary` can't change what renders.
7
+ */
8
+ /**
9
+ * Font Awesome's style classes. `Icon` renders its `variant` through this
10
+ * table when it's a key (`regular` as `far`), and as written otherwise, so
11
+ * the short forms read as the name `Icon` knows them by and the rest
12
+ * (`fa`, `fa-solid`) as themselves. `fas` is its default.
13
+ */
14
+ const FA_STYLES = {
15
+ fas: undefined,
16
+ far: 'regular',
17
+ fab: 'brands',
18
+ fal: 'light',
19
+ fad: 'duotone',
20
+ fat: 'thin',
21
+ fa: 'fa',
22
+ 'fa-solid': 'fa-solid',
23
+ 'fa-regular': 'fa-regular',
24
+ 'fa-brands': 'fa-brands',
25
+ 'fa-light': 'fa-light',
26
+ 'fa-thin': 'fa-thin',
27
+ 'fa-duotone': 'fa-duotone',
28
+ };
29
+ /** Font Awesome's classes that modify a glyph rather than name one. */
30
+ const FA_MODIFIERS = new Set([
31
+ 'fa-2xs',
32
+ 'fa-xs',
33
+ 'fa-sm',
34
+ 'fa-lg',
35
+ 'fa-xl',
36
+ 'fa-2xl',
37
+ ...Array.from({ length: 10 }, (_, index) => `fa-${index + 1}x`),
38
+ 'fa-fw',
39
+ 'fa-width-auto',
40
+ 'fa-border',
41
+ 'fa-inverse',
42
+ 'fa-li',
43
+ 'fa-ul',
44
+ 'fa-pull-left',
45
+ 'fa-pull-right',
46
+ 'fa-pull-start',
47
+ 'fa-pull-end',
48
+ 'fa-spin',
49
+ 'fa-pulse',
50
+ 'fa-spin-pulse',
51
+ 'fa-spin-reverse',
52
+ 'fa-beat',
53
+ 'fa-beat-fade',
54
+ 'fa-bounce',
55
+ 'fa-fade',
56
+ 'fa-flip',
57
+ 'fa-shake',
58
+ 'fa-rotate-90',
59
+ 'fa-rotate-180',
60
+ 'fa-rotate-270',
61
+ 'fa-rotate-by',
62
+ 'fa-flip-horizontal',
63
+ 'fa-flip-vertical',
64
+ 'fa-flip-both',
65
+ 'fa-stack-1x',
66
+ 'fa-stack-2x',
67
+ 'fa-swap-opacity',
68
+ 'fa-sharp',
69
+ 'fa-classic',
70
+ ]);
71
+ /** Material Design Icons' classes that modify a glyph rather than name one. */
72
+ const MDI_MODIFIERS = new Set([
73
+ 'mdi-18px',
74
+ 'mdi-24px',
75
+ 'mdi-36px',
76
+ 'mdi-48px',
77
+ 'mdi-dark',
78
+ 'mdi-light',
79
+ 'mdi-inactive',
80
+ ...[45, 90, 135, 180, 225, 270, 315].map(angle => `mdi-rotate-${angle}`),
81
+ 'mdi-flip-h',
82
+ 'mdi-flip-v',
83
+ 'mdi-spin',
84
+ ]);
85
+ /**
86
+ * The props `Icon` renders this glyph from, or undefined when it can't: the
87
+ * glyph must be a bare, empty `<i>` whose classes name one Font Awesome or
88
+ * Material Design Icons glyph.
89
+ */
90
+ export function readGlyph(glyph) {
91
+ if (glyph?.tag !== 'i' ||
92
+ !glyph.tokens ||
93
+ glyph.attributes.size > 0 ||
94
+ glyph.hasSpread ||
95
+ !glyph.isEmpty) {
96
+ return undefined;
97
+ }
98
+ const tokens = glyph.tokens;
99
+ const styles = tokens.filter(token => Object.hasOwn(FA_STYLES, token));
100
+ const mdi = tokens.includes('mdi');
101
+ if (styles.length === 1 && !mdi) {
102
+ const [style] = styles;
103
+ const named = nameIn(tokens, 'fa-', FA_MODIFIERS, style);
104
+ if (!named)
105
+ return undefined;
106
+ const variant = FA_STYLES[style];
107
+ return {
108
+ library: 'fa',
109
+ name: named.name,
110
+ ...(variant && { variant }),
111
+ ...(named.features.length > 0 && { features: named.features }),
112
+ };
113
+ }
114
+ if (mdi && styles.length === 0) {
115
+ const named = nameIn(tokens, 'mdi-', MDI_MODIFIERS, 'mdi');
116
+ if (!named)
117
+ return undefined;
118
+ return {
119
+ library: 'mdi',
120
+ name: named.name,
121
+ ...(named.features.length > 0 && { features: named.features }),
122
+ };
123
+ }
124
+ return undefined;
125
+ }
126
+ /**
127
+ * The one class among `tokens` that names a glyph (`fa-home`), without its
128
+ * prefix, and the rest but `base`, as features. Undefined unless exactly one
129
+ * does, and its name doesn't start with the prefix again, which `Icon` would
130
+ * strip.
131
+ */
132
+ function nameIn(tokens, prefix, modifiers, base) {
133
+ const rest = tokens.filter(token => token !== base);
134
+ const names = rest.filter(token => token.startsWith(prefix) &&
135
+ token.length > prefix.length &&
136
+ !modifiers.has(token));
137
+ if (names.length !== 1)
138
+ return undefined;
139
+ const name = names[0].slice(prefix.length);
140
+ if (name.startsWith(prefix))
141
+ return undefined;
142
+ return { name, features: rest.filter(token => token !== names[0]) };
143
+ }
@@ -121,6 +121,14 @@ export interface ChildFacts {
121
121
  * an element that goes would take it with it.
122
122
  */
123
123
  isEmpty: boolean;
124
+ /**
125
+ * For one of an element's `childElements`: what it converts to on its
126
+ * own, when it does, its only child, and the string its content renders,
127
+ * when that is one static text. What an entry that `buildsIcons` reads.
128
+ */
129
+ becomes?: Conversion;
130
+ soleChild?: ChildFacts;
131
+ text?: string;
124
132
  }
125
133
  export interface Todo {
126
134
  rule: string;
@@ -173,6 +181,31 @@ export interface Conversion {
173
181
  * prop set to their condition, each once. The rest stay in the joiner call.
174
182
  */
175
183
  conditional?: Array<[prop: string, token: string]>;
184
+ /**
185
+ * The target builds its children from props (`IconText`): one icon per
186
+ * `.icon` among them, as `iconProps`, or as `items` when there are more.
187
+ * The children go, and so does the element's closing tag unless one icon
188
+ * has a text, which becomes its children.
189
+ */
190
+ icons?: BuiltIcon[];
191
+ }
192
+ /** One icon a target that `buildsIcons` builds from props. */
193
+ export interface BuiltIcon {
194
+ /** Which of the element's `childElements` its `.icon` is. */
195
+ index: number;
196
+ /**
197
+ * Its props: the ones its glyph is built from, then what its `.icon`'s
198
+ * classes become. Its attributes join them, as they would on `Icon`.
199
+ */
200
+ props: Array<[name: string, value: string | true | readonly string[]]>;
201
+ /** What stays of its `.icon`'s `className`, or null when nothing does. */
202
+ className: string | null;
203
+ /** Its `.icon`'s attributes `Icon` renders by itself. */
204
+ drop: string[];
205
+ /** Its attributes, and props above, written as numbers. */
206
+ numbers: string[];
207
+ /** The text after it, if any. */
208
+ text?: string;
176
209
  }
177
210
  export interface Plan {
178
211
  conversion: Conversion | null;
@@ -1 +1 @@
1
- {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/sources/bulma-classes/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAmBH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,2DAA2D;IAC3D,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;IAC7C;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B;;;OAGG;IACH,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;IACtD,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,4EAA4E;IAC5E,WAAW,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACtC,qEAAqE;IACrE,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,qEAAqE;IACrE,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;OAGG;IACH,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAG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G;IACH,KAAK,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;IACvE,0EAA0E;IAC1E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,yDAAyD;IACzD,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,2DAA2D;IAC3D,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,IAAI;IACnB,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE;QACL,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;QACnD,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;IACF,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AA+BD,wBAAgB,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAse9C"}
@@ -10,6 +10,7 @@
10
10
  * render differently).
11
11
  */
12
12
  import { FORWARDS_REF, HELPER_PROPS, HELPER_TOKENS, inTagSet, legacyHint, modifierFor, numberAttrsOf, placedFor, PRECEDENCE, rootFor, WRAPPER_OWN_PROPS, wrapperFor, } from './class-map.js';
13
+ import { readGlyph } from './glyph.js';
13
14
  import { ruleId } from './rules.js';
14
15
  function wrapperEntry(tag) {
15
16
  const target = wrapperFor(tag);
@@ -314,6 +315,15 @@ export function plan(facts) {
314
315
  }
315
316
  as = tag;
316
317
  }
318
+ // Last, since what the children are can change once a refusal leaves
319
+ // them to convert on their own, and a re-run has to find the same reason.
320
+ let icons;
321
+ if (entry.buildsIcons) {
322
+ const built = buildIcons(facts.childElements, target);
323
+ if ('why' in built)
324
+ return refuse('children', target, built.why);
325
+ icons = built.icons;
326
+ }
317
327
  const props = [];
318
328
  if (as)
319
329
  props.push(['as', as]);
@@ -377,10 +387,78 @@ export function plan(facts) {
377
387
  : {}),
378
388
  ...(parent ? { replacesParent: true } : {}),
379
389
  ...(conditional.length > 0 ? { conditional } : {}),
390
+ ...(icons ? { icons } : {}),
380
391
  },
381
392
  todos,
382
393
  };
383
394
  }
395
+ /**
396
+ * The icons a target that `buildsIcons` builds from an element's children:
397
+ * each `.icon` that converts to `Icon` on its own and holds a glyph `Icon`
398
+ * can build, with the bare `<span>` of text after it, if any.
399
+ *
400
+ * A child that converts on its own does so once the element stays markup,
401
+ * and a re-run then finds a component there, so the reason is the general
402
+ * one whenever one does: a TODO has to read the same on the next run.
403
+ */
404
+ function buildIcons(children, target) {
405
+ const shape = `bestax \`${target}\` builds its icons from props and wraps each text in a <span> of its own, so this converts only when its children are \`.icon\`s with no \`key\`, \`ref\` or dashed attribute but an \`aria-\` one, each holding one bare, empty <i> that names a Font Awesome or Material Design Icons glyph, and each followed by at most one bare <span> of static text; keep it as markup, or convert it by hand`;
406
+ const alone = children?.some(child => child.becomes) ?? false;
407
+ const icons = [];
408
+ for (const [index, child] of (children ?? []).entries()) {
409
+ if (child.tokens?.includes('icon')) {
410
+ const icon = child.becomes;
411
+ if (icon?.target !== 'Icon' || icon.conditional) {
412
+ return {
413
+ why: alone
414
+ ? shape
415
+ : `bestax \`${target}\` builds each icon from \`iconProps\`, so this converts only once every \`.icon\` in it converts to \`Icon\` on its own; see the TODO on each, then re-run`,
416
+ };
417
+ }
418
+ // In a props object, a dashed name is type-checked where JSX lets any
419
+ // through, and only `aria-` ones are declared (`data-test` is not).
420
+ const loose = [...child.attributes.keys()].some(name => name === 'key' ||
421
+ name === 'ref' ||
422
+ (name.includes('-') && !name.startsWith('aria-')));
423
+ const glyph = readGlyph(child.soleChild);
424
+ if (!glyph || loose)
425
+ return { why: shape };
426
+ const props = [
427
+ ['library', glyph.library],
428
+ ['name', glyph.name],
429
+ ];
430
+ if (glyph.variant)
431
+ props.push(['variant', glyph.variant]);
432
+ const { features } = glyph;
433
+ if (features) {
434
+ props.push([
435
+ 'features',
436
+ features.length === 1 ? features[0] : features,
437
+ ]);
438
+ }
439
+ icons.push({
440
+ index,
441
+ props: [...props, ...icon.props],
442
+ className: icon.className,
443
+ drop: icon.drop,
444
+ numbers: icon.numbers,
445
+ });
446
+ continue;
447
+ }
448
+ const last = icons[icons.length - 1];
449
+ const text = child.tag === 'span' &&
450
+ child.tokens === undefined &&
451
+ child.attributes.size === 0 &&
452
+ !child.hasSpread
453
+ ? child.text
454
+ : undefined;
455
+ // It renders a text only when the text is truthy.
456
+ if (!last || last.text !== undefined || !text)
457
+ return { why: shape };
458
+ last.text = text;
459
+ }
460
+ return icons.length > 0 ? { icons } : { why: shape };
461
+ }
384
462
  /**
385
463
  * What an element's classes become on `entry`'s target: the props they
386
464
  * write, the classes that leave `className`, and the props written as
@@ -1 +1 @@
1
- {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/sources/bulma-classes/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAW,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAyyBvD,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,EACR,OAAO,GAAE,gBAAqB,GAC7B,MAAM,GAAG,SAAS,CAgqBpB"}
1
+ {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/sources/bulma-classes/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAW,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAo3BvD,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,EACR,OAAO,GAAE,gBAAqB,GAC7B,MAAM,GAAG,SAAS,CAkwBpB"}
@@ -648,9 +648,10 @@ function childFacts(child) {
648
648
  }
649
649
  /**
650
650
  * An element's children as plain HTML elements, when that is every one
651
- * React renders; undefined when one is anything else.
651
+ * React renders; undefined when one is anything else. `more` adds what else
652
+ * is known of each.
652
653
  */
653
- function childElementsOf(element) {
654
+ function childElementsOf(element, more = () => ({})) {
654
655
  const children = [];
655
656
  for (const child of element.children ?? []) {
656
657
  if (dropped(child))
@@ -658,10 +659,58 @@ function childElementsOf(element) {
658
659
  const found = child.type === 'JSXElement' ? childFacts(child) : undefined;
659
660
  if (!found)
660
661
  return undefined;
661
- children.push(found);
662
+ children.push({ ...found, ...more(child) });
662
663
  }
663
664
  return children;
664
665
  }
666
+ /** A JSX key for a prop: its name, quoted when it isn't an identifier. */
667
+ function propKey(j, name) {
668
+ return /^[A-Za-z_$][\w$]*$/.test(name)
669
+ ? j.identifier(name)
670
+ : j.stringLiteral(name);
671
+ }
672
+ /** A prop's value as an expression, a number when it's written as one. */
673
+ function propValue(j, value, number) {
674
+ if (value === true)
675
+ return j.booleanLiteral(true);
676
+ if (typeof value !== 'string') {
677
+ return j.arrayExpression(value.map(item => j.stringLiteral(item)));
678
+ }
679
+ return number ? j.numericLiteral(Number(value)) : j.stringLiteral(value);
680
+ }
681
+ /**
682
+ * The props one built icon is given, as an object: its glyph's and its
683
+ * classes' first, then its `.icon`'s attributes, as `Icon` would have been
684
+ * given them, with `aria-label` under the name `Icon` declares for it.
685
+ */
686
+ function iconObject(j, icon, built) {
687
+ const properties = built.props.map(([name, value]) => j.objectProperty(propKey(j, name), propValue(j, value, built.numbers.includes(name))));
688
+ if (built.className !== null) {
689
+ properties.push(j.objectProperty(j.identifier('className'), j.stringLiteral(built.className)));
690
+ }
691
+ for (const attr of icon.openingElement.attributes ?? []) {
692
+ const name = attributeName(attr);
693
+ if (name === 'className' || built.drop.includes(name))
694
+ continue;
695
+ const given = attr.value;
696
+ const value = given === null
697
+ ? j.booleanLiteral(true)
698
+ : given.type === 'JSXExpressionContainer'
699
+ ? given.expression
700
+ : propValue(j, given.value, built.numbers.includes(name));
701
+ properties.push(j.objectProperty(propKey(j, name === 'aria-label' ? 'ariaLabel' : name), value));
702
+ }
703
+ return j.objectExpression(properties);
704
+ }
705
+ /**
706
+ * A text as a JSX child: as written when it renders as itself there, and as
707
+ * a string otherwise (leading or trailing space, a character JSX reads).
708
+ */
709
+ function textChild(j, text) {
710
+ return /^[^\s{}<>&](?:[^{}<>&\r\n]*[^\s{}<>&])?$/.test(text)
711
+ ? j.jsxText(text)
712
+ : j.jsxExpressionContainer(j.stringLiteral(text));
713
+ }
665
714
  function insideForeignContent(elementPath) {
666
715
  let current = elementPath.parent;
667
716
  while (current) {
@@ -933,7 +982,17 @@ export default function transform(fileInfo, api, options = {}) {
933
982
  childTargets: childTargets(elementPath),
934
983
  soleChildTarget: planned.get(sole)?.conversion?.target,
935
984
  soleChild: sole && childFacts(sole),
936
- childElements: childElementsOf(element),
985
+ childElements: childElementsOf(element, child => {
986
+ const becomes = planned.get(child)?.conversion;
987
+ const only = soleChild(child);
988
+ const inner = only && childFacts(only);
989
+ const text = textOf(child);
990
+ return {
991
+ ...(becomes && { becomes }),
992
+ ...(inner && { soleChild: inner }),
993
+ ...(text !== undefined && { text }),
994
+ };
995
+ }),
937
996
  bestaxInside: bestaxInside.get(element) ?? [],
938
997
  bestaxAround: surrounding.bestax,
939
998
  componentsAround: surrounding.other,
@@ -966,6 +1025,7 @@ export default function transform(fileInfo, api, options = {}) {
966
1025
  exact = undefined;
967
1026
  }
968
1027
  let result = exact ?? plan(facts);
1028
+ const builds = result.conversion?.icons;
969
1029
  const converts = result.conversion !== null || result.fold !== undefined;
970
1030
  const becomes = result.conversion?.target ?? result.fold?.target;
971
1031
  if (className === null && !exact && becomes) {
@@ -997,6 +1057,27 @@ export default function transform(fileInfo, api, options = {}) {
997
1057
  inner.props.push(...result.fold.props);
998
1058
  inner.numbers.push(...result.fold.numbers);
999
1059
  }
1060
+ if (builds) {
1061
+ // A `.icon` the target builds from props goes with the element, so it
1062
+ // doesn't convert on its own, and nor does it when a computed
1063
+ // `className` leaves the element to a person: a re-run has to find
1064
+ // the markup it found.
1065
+ const inside = (element.children ?? []).filter((child) => !dropped(child));
1066
+ for (const icon of builds) {
1067
+ const node = inside[icon.index];
1068
+ const own = { conversion: null, todos: planned.get(node).todos };
1069
+ planned.set(node, own);
1070
+ const at = elements.findIndex(found => found.path.node === node);
1071
+ if (at === -1)
1072
+ continue;
1073
+ if (own.todos.length > 0) {
1074
+ elements[at] = { ...elements[at], plan: own, converts: false };
1075
+ }
1076
+ else {
1077
+ elements.splice(at, 1);
1078
+ }
1079
+ }
1080
+ }
1000
1081
  planned.set(element, result);
1001
1082
  if (result.conversion || result.fold || result.todos.length > 0) {
1002
1083
  elements.unshift({ path: elementPath, plan: result, converts });
@@ -1183,6 +1264,48 @@ export default function transform(fileInfo, api, options = {}) {
1183
1264
  name.comments = [...(name.comments ?? []), ...gone.map(afterTagName)];
1184
1265
  }
1185
1266
  }
1267
+ if (conversion.icons) {
1268
+ // The target builds its children from props: one icon as `iconProps`,
1269
+ // with its text as the children, or several as `items`. The children
1270
+ // go, and their comments move to the name that stays.
1271
+ const icons = conversion.icons;
1272
+ const inside = (element.children ?? []).filter((child) => !dropped(child));
1273
+ const objects = icons.map(icon => iconObject(j, inside[icon.index], icon));
1274
+ const [only] = icons;
1275
+ const prop = icons.length === 1
1276
+ ? j.jsxAttribute(j.jsxIdentifier('iconProps'), j.jsxExpressionContainer(objects[0]))
1277
+ : j.jsxAttribute(j.jsxIdentifier('items'), j.jsxExpressionContainer(j.arrayExpression(icons.map((icon, index) => j.objectExpression([
1278
+ j.objectProperty(j.identifier('iconProps'), objects[index]),
1279
+ ...(icon.text === undefined
1280
+ ? []
1281
+ : [
1282
+ j.objectProperty(j.identifier('text'), j.stringLiteral(icon.text)),
1283
+ ]),
1284
+ ])))));
1285
+ element.openingElement.attributes = [
1286
+ ...(element.openingElement.attributes ?? []),
1287
+ prop,
1288
+ ];
1289
+ const text = icons.length === 1 ? only.text : undefined;
1290
+ const moved = [
1291
+ ...inside.flatMap((child) => commentsWithin(child)),
1292
+ ...(text === undefined
1293
+ ? [element.closingElement, element.closingElement?.name].flatMap((node) => node?.comments ?? [])
1294
+ : []),
1295
+ ];
1296
+ if (text === undefined) {
1297
+ element.children = [];
1298
+ element.openingElement.selfClosing = true;
1299
+ element.closingElement = null;
1300
+ }
1301
+ else {
1302
+ element.children = [textChild(j, text)];
1303
+ }
1304
+ if (moved.length) {
1305
+ const name = element.openingElement.name;
1306
+ name.comments = [...(name.comments ?? []), ...moved.map(afterTagName)];
1307
+ }
1308
+ }
1186
1309
  let written = element;
1187
1310
  if (child) {
1188
1311
  child.openingElement.name = element.openingElement.name;
@@ -1 +1 @@
1
- {"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../../src/sources/rbx/mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA8BnE;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CA6CtD,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAOrD,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAQvD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAShE,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAktBpD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CA2FhD,CAAC;AAEF,sDAAsD;AACtD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,GAAG,SAAS,CAM3E"}
1
+ {"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../../src/sources/rbx/mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA8BnE;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CA4CtD,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAOrD,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAQvD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAShE,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CA0tBpD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CA2FhD,CAAC;AAEF,sDAAsD;AACtD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,GAAG,SAAS,CAM3E"}
@@ -79,8 +79,7 @@ export const UNIVERSAL_PROPS = {
79
79
  // Per-component maps override this with AS_OK where bestax has an `as`.
80
80
  as: AS_TODO,
81
81
  // Same shape: the per-component maps override this with `rename: 'ref'` on
82
- // the targets that forward one, and the `navbar-item` special handles the
83
- // two it chooses between. Whatever is left reaches here, so no `innerRef`
82
+ // the targets that forward one. Whatever is left reaches here, so no `innerRef`
84
83
  // migrates in silence onto a target that cannot take it — the RBC sibling
85
84
  // `domRef` has been flagged universally all along.
86
85
  innerRef: {
@@ -697,7 +696,15 @@ export const MAPPING = {
697
696
  target: 'Navbar.Item',
698
697
  status: 'mapped',
699
698
  special: 'navbar-item',
700
- props: { active: {}, onClick: {}, as: AS_OK },
699
+ // Both targets the special picks forward a ref to the element rbx's
700
+ // `innerRef` reached: the item itself, or the `has-dropdown`
701
+ // container `Navbar.Dropdown` renders.
702
+ props: {
703
+ active: {},
704
+ onClick: {},
705
+ as: AS_OK,
706
+ innerRef: { rename: 'ref' },
707
+ },
701
708
  subs: { Container: { status: 'mapped', special: 'navbar-container' } },
702
709
  },
703
710
  Dropdown: { status: 'mapped', special: 'navbar-dropdown' },
@@ -1 +1 @@
1
- {"version":3,"file":"specials.d.ts","sourceRoot":"","sources":["../../../src/sources/rbx/specials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAO3C,OAAO,EAYL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAUL,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EAAE,aAAa,EAAE,CAAC;AAq3B9B,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,EAClB,OAAO,EAAE,GAAG,GACX,aAAa,CAIf"}
1
+ {"version":3,"file":"specials.d.ts","sourceRoot":"","sources":["../../../src/sources/rbx/specials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAO3C,OAAO,EAYL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAUL,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EAAE,aAAa,EAAE,CAAC;AAu1B9B,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,EAClB,OAAO,EAAE,GAAG,GACX,aAAa,CAIf"}
@@ -510,31 +510,6 @@ const SPECIALS = {
510
510
  addTodo(ctx, path, `prop:${prop}`, `bestax \`Navbar.Item\` has no \`${prop}\` prop; restructure or add a class by hand`);
511
511
  ctx.dirty = true;
512
512
  }
513
- // bestax's `Navbar.Dropdown` forwards a ref, but it is the one such target
514
- // the `innerRef: { rename: 'ref' }` entries in mapping.ts cannot reach:
515
- // that table is keyed on the rbx name (`Navbar.Item`), and only this
516
- // handler knows which of the two targets was picked. The condition is
517
- // about that, not about ref support: a plain `Navbar.Item` forwards one
518
- // too since #661, so leaving `innerRef` alone there is a rename this
519
- // handler declines rather than one the target cannot take. Performing it
520
- // changes emitted output on code that migrates today, so it stays #734 —
521
- // but declining silently is not an option either. `innerRef` is in no
522
- // rbx prop table, so nothing downstream flags it and it used to reach the
523
- // DOM as an unknown attribute with the report saying nothing, which is
524
- // the silent skip bestax-migrate/CLAUDE.md rules out. It is flagged here
525
- // instead, and the rename stays the user's to make.
526
- const handledInnerRef = [];
527
- const innerRefAttr = findAttr(element, 'innerRef');
528
- if (innerRefAttr) {
529
- handledInnerRef.push('innerRef');
530
- if (target === 'Navbar.Dropdown') {
531
- innerRefAttr.name = ctx.j.jsxIdentifier('ref');
532
- ctx.dirty = true;
533
- }
534
- else {
535
- addTodo(ctx, path, 'prop:innerRef', 'bestax `Navbar.Item` forwards a ref; rename `innerRef` to `ref` by hand');
536
- }
537
- }
538
513
  restrictAsToTargets(ctx, path, element, target ?? 'Navbar.Item', [
539
514
  'Navbar.Item',
540
515
  ]);
@@ -548,7 +523,6 @@ const SPECIALS = {
548
523
  'expanded',
549
524
  'hoverable',
550
525
  'managed',
551
- ...handledInnerRef,
552
526
  ],
553
527
  };
554
528
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bestax-migrate",
3
- "version": "2.22.1",
3
+ "version": "2.23.1",
4
4
  "description": "Codemods for migrating existing React apps from other Bulma libraries to @allxsmith/bestax-bulma",
5
5
  "type": "module",
6
6
  "bin": {