bestax-migrate 2.25.5 → 2.25.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sources/_shared/html/attributes.d.ts +96 -0
- package/dist/sources/_shared/html/attributes.d.ts.map +1 -0
- package/dist/sources/_shared/html/attributes.js +313 -0
- package/dist/sources/_shared/html/emit.d.ts +49 -0
- package/dist/sources/_shared/html/emit.d.ts.map +1 -0
- package/dist/sources/_shared/html/emit.js +355 -0
- package/dist/sources/_shared/html/parse.d.ts +54 -0
- package/dist/sources/_shared/html/parse.d.ts.map +1 -0
- package/dist/sources/_shared/html/parse.js +85 -0
- package/dist/sources/_shared/html/style.d.ts +61 -0
- package/dist/sources/_shared/html/style.d.ts.map +1 -0
- package/dist/sources/_shared/html/style.js +185 -0
- package/dist/sources/_shared/html/text.d.ts +43 -0
- package/dist/sources/_shared/html/text.d.ts.map +1 -0
- package/dist/sources/_shared/html/text.js +120 -0
- package/dist/sources/_shared/html/whitespace.d.ts +80 -0
- package/dist/sources/_shared/html/whitespace.d.ts.map +1 -0
- package/dist/sources/_shared/html/whitespace.js +409 -0
- package/dist/sources/bulma-classes/class-map.d.ts +6 -0
- package/dist/sources/bulma-classes/class-map.d.ts.map +1 -1
- package/dist/sources/bulma-classes/class-map.js +6 -0
- package/dist/sources/bulma-classes/display.d.ts +74 -0
- package/dist/sources/bulma-classes/display.d.ts.map +1 -0
- package/dist/sources/bulma-classes/display.js +215 -0
- package/dist/sources/bulma-classes/plan.d.ts.map +1 -1
- package/dist/sources/bulma-classes/plan.js +4 -3
- package/dist/sources/rbx/mapping.js +1 -1
- package/dist/sources/react-bulma-components/mapping.js +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The display Bulma's stylesheet gives an element, for the HTML input's
|
|
3
|
+
* whitespace. A whitespace-only run beside a block, flex or grid box renders
|
|
4
|
+
* nothing, so the converter can drop it, while one between inline boxes can
|
|
5
|
+
* be a space the page shows. The tag's own display is the converter's to
|
|
6
|
+
* know; this is what Bulma's classes make of it.
|
|
7
|
+
*
|
|
8
|
+
* Answered from the element's own tag and classes, so a rule that reaches it
|
|
9
|
+
* through an ancestor (`.tabs li`) or a state (`:hover`) is out of reach, as
|
|
10
|
+
* is the page's own CSS. `e2e/bulma-classes-display.test.ts` holds both
|
|
11
|
+
* tables to `bulma.css`, in both directions.
|
|
12
|
+
*
|
|
13
|
+
* Apart from `class-map.ts` because nothing here converts anything, and the
|
|
14
|
+
* MCP index and the ESLint plugin's metadata are generated from that table.
|
|
15
|
+
*/
|
|
16
|
+
import { VIEWPORT_SUFFIX } from '../_shared/viewports.js';
|
|
17
|
+
/**
|
|
18
|
+
* Bulma's element and component rules that set a display, by selector: the
|
|
19
|
+
* classes all on the one element, after a tag where the rule names one
|
|
20
|
+
* (`div.icon-text`), with any class it must not have (`:not(.is-desktop)`).
|
|
21
|
+
* A plain display holds at every viewport; a media rule that restates it
|
|
22
|
+
* changes nothing.
|
|
23
|
+
*/
|
|
24
|
+
export const COMPONENT_DISPLAY = {
|
|
25
|
+
'.button': 'inline-flex',
|
|
26
|
+
'.button.is-fullwidth': 'flex',
|
|
27
|
+
'.buttons': 'flex',
|
|
28
|
+
'.box': 'block',
|
|
29
|
+
'.delete': 'inline-flex',
|
|
30
|
+
'.modal-close': 'inline-flex',
|
|
31
|
+
'.icon': 'inline-flex',
|
|
32
|
+
'.icon-text': 'inline-flex',
|
|
33
|
+
'div.icon-text': 'flex',
|
|
34
|
+
'.image': 'block',
|
|
35
|
+
'.loader': 'block',
|
|
36
|
+
'.progress': 'block',
|
|
37
|
+
'.tags': 'flex',
|
|
38
|
+
'.tag': 'inline-flex',
|
|
39
|
+
'.input': 'inline-flex',
|
|
40
|
+
'.textarea': 'block',
|
|
41
|
+
'.is-fullwidth.input': 'block',
|
|
42
|
+
'.is-fullwidth.textarea': 'block',
|
|
43
|
+
'.is-inline.input': 'inline',
|
|
44
|
+
'.is-inline.textarea': 'inline',
|
|
45
|
+
'.checkbox': 'inline-block',
|
|
46
|
+
'.radio': 'inline-block',
|
|
47
|
+
'.checkboxes': 'flex',
|
|
48
|
+
'.radios': 'flex',
|
|
49
|
+
'.select': 'inline-block',
|
|
50
|
+
'.file': 'flex',
|
|
51
|
+
'.file-label': 'flex',
|
|
52
|
+
'.file-cta': 'inline-flex',
|
|
53
|
+
'.file-name': 'block',
|
|
54
|
+
'.file-icon': 'flex',
|
|
55
|
+
'.label': 'block',
|
|
56
|
+
'.help': 'block',
|
|
57
|
+
'.field.has-addons': 'flex',
|
|
58
|
+
'.field.is-grouped': 'flex',
|
|
59
|
+
'.field.is-horizontal': { media: 'flex' },
|
|
60
|
+
'.field-body': { media: 'flex' },
|
|
61
|
+
'.card-header': 'flex',
|
|
62
|
+
'.card-header-title': 'flex',
|
|
63
|
+
'.card-header-icon': 'flex',
|
|
64
|
+
'.card-image': 'block',
|
|
65
|
+
'.card-footer': 'flex',
|
|
66
|
+
'.card-footer-item': 'flex',
|
|
67
|
+
'.dropdown': 'inline-flex',
|
|
68
|
+
'.dropdown-menu': 'none',
|
|
69
|
+
'.dropdown-item': 'block',
|
|
70
|
+
'.dropdown-divider': 'block',
|
|
71
|
+
'.message-header': 'flex',
|
|
72
|
+
'.modal': 'none',
|
|
73
|
+
'.modal.is-active': 'flex',
|
|
74
|
+
'.modal-card': 'flex',
|
|
75
|
+
'.modal-card-head': 'flex',
|
|
76
|
+
'.modal-card-foot': 'flex',
|
|
77
|
+
'.navbar': { media: 'flex' },
|
|
78
|
+
'.navbar-brand': 'flex',
|
|
79
|
+
'.navbar-tabs': 'flex',
|
|
80
|
+
'.navbar-burger': { base: 'inline-flex', media: 'none' },
|
|
81
|
+
'.navbar-menu': { base: 'none', media: 'flex' },
|
|
82
|
+
'.navbar-menu.is-active': { media: 'block' },
|
|
83
|
+
'.navbar-start': { media: 'flex' },
|
|
84
|
+
'.navbar-end': { media: 'flex' },
|
|
85
|
+
'.navbar-item': { base: 'block', media: 'flex' },
|
|
86
|
+
'.navbar-link': { base: 'block', media: 'flex' },
|
|
87
|
+
'.navbar-dropdown': { media: 'none' },
|
|
88
|
+
'.navbar-dropdown.is-boxed': { media: 'block' },
|
|
89
|
+
'.navbar-divider': { base: 'none', media: 'block' },
|
|
90
|
+
'.pagination': 'flex',
|
|
91
|
+
'.pagination-list': 'flex',
|
|
92
|
+
'.pagination-previous': 'inline-flex',
|
|
93
|
+
'.pagination-next': 'inline-flex',
|
|
94
|
+
'.pagination-link': 'inline-flex',
|
|
95
|
+
'.pagination-ellipsis': 'inline-flex',
|
|
96
|
+
'.panel-tabs': 'flex',
|
|
97
|
+
'.panel-block': 'flex',
|
|
98
|
+
'.panel-icon': 'inline-block',
|
|
99
|
+
'.tabs': 'flex',
|
|
100
|
+
'.column': 'block',
|
|
101
|
+
'.columns.is-mobile': 'flex',
|
|
102
|
+
'.columns:not(.is-desktop)': { media: 'flex' },
|
|
103
|
+
'.columns.is-desktop': { media: 'flex' },
|
|
104
|
+
'.grid': 'grid',
|
|
105
|
+
'.hero': 'flex',
|
|
106
|
+
'.hero-video': { media: 'none' },
|
|
107
|
+
'.hero-buttons': { media: 'flex' },
|
|
108
|
+
'.level': 'flex',
|
|
109
|
+
'.level.is-mobile': 'flex',
|
|
110
|
+
'.level-item': 'flex',
|
|
111
|
+
'.level-left': 'flex',
|
|
112
|
+
'.level-right': 'flex',
|
|
113
|
+
'.media': 'flex',
|
|
114
|
+
'.skeleton-lines': 'flex',
|
|
115
|
+
};
|
|
116
|
+
/** The display helpers, each under both of Bulma's spellings. */
|
|
117
|
+
const HELPERS = {
|
|
118
|
+
'is-display-none': 'none',
|
|
119
|
+
'is-hidden': 'none',
|
|
120
|
+
'is-display-block': 'block',
|
|
121
|
+
'is-block': 'block',
|
|
122
|
+
'is-display-flex': 'flex',
|
|
123
|
+
'is-flex': 'flex',
|
|
124
|
+
'is-display-inline': 'inline',
|
|
125
|
+
'is-inline': 'inline',
|
|
126
|
+
'is-display-inline-block': 'inline-block',
|
|
127
|
+
'is-inline-block': 'inline-block',
|
|
128
|
+
'is-display-inline-flex': 'inline-flex',
|
|
129
|
+
'is-inline-flex': 'inline-flex',
|
|
130
|
+
'is-display-grid': 'grid',
|
|
131
|
+
'is-grid': 'grid',
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* The display helpers' rules, which are `!important`: each helper at every
|
|
135
|
+
* viewport, and its variant for each viewport (`is-flex-tablet`) at that one
|
|
136
|
+
* only.
|
|
137
|
+
*/
|
|
138
|
+
export const HELPER_DISPLAY = Object.fromEntries(Object.entries(HELPERS).flatMap(([name, display]) => [
|
|
139
|
+
[`.${name}`, display],
|
|
140
|
+
...Object.keys(VIEWPORT_SUFFIX).map(viewport => [
|
|
141
|
+
`.${name}-${viewport}`,
|
|
142
|
+
{ media: display },
|
|
143
|
+
]),
|
|
144
|
+
]));
|
|
145
|
+
/** A display table's selectors, read as the rules the lookup weighs. */
|
|
146
|
+
export function rulesOf(table, important) {
|
|
147
|
+
return Object.entries(table).flatMap(([selector, entry]) => {
|
|
148
|
+
// A tag can carry digits (`h1`), so it reads whole.
|
|
149
|
+
const tag = /^[a-z][a-z0-9]*/.exec(selector)?.[0];
|
|
150
|
+
const without = [...selector.matchAll(/:not\(\.([\w-]+)\)/g)].map(match => match[1]);
|
|
151
|
+
const classes = [
|
|
152
|
+
...selector.replace(/:not\([^)]*\)/g, '').matchAll(/\.([\w-]+)/g),
|
|
153
|
+
].map(match => match[1]);
|
|
154
|
+
const rule = {
|
|
155
|
+
tag,
|
|
156
|
+
classes,
|
|
157
|
+
without,
|
|
158
|
+
weight: (important ? 1000 : 0) +
|
|
159
|
+
10 * (classes.length + without.length) +
|
|
160
|
+
(tag ? 1 : 0),
|
|
161
|
+
};
|
|
162
|
+
if (typeof entry === 'string') {
|
|
163
|
+
return [{ ...rule, display: entry, media: false }];
|
|
164
|
+
}
|
|
165
|
+
return [
|
|
166
|
+
...(entry.base ? [{ ...rule, display: entry.base, media: false }] : []),
|
|
167
|
+
{ ...rule, display: entry.media, media: true },
|
|
168
|
+
];
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
const RULES = [
|
|
172
|
+
...rulesOf(COMPONENT_DISPLAY, false),
|
|
173
|
+
...rulesOf(HELPER_DISPLAY, true),
|
|
174
|
+
];
|
|
175
|
+
/**
|
|
176
|
+
* Every display Bulma's rules can give an element across viewports, or
|
|
177
|
+
* undefined when no rule sets one, so the tag's own holds. A set of one holds
|
|
178
|
+
* at every viewport. An `undefined` in the set stands for the tag's own at
|
|
179
|
+
* the viewports no rule reaches: `.columns` is the tag's on mobile and flex
|
|
180
|
+
* from tablet up.
|
|
181
|
+
*
|
|
182
|
+
* Weighed as the cascade weighs these selectors: an `!important` helper
|
|
183
|
+
* beats any component rule (`button is-block` is block), then the selector
|
|
184
|
+
* with more classes (`button is-fullwidth` is flex), then the one naming a
|
|
185
|
+
* tag. A media rule as weighty as the winner or more adds its display. Two
|
|
186
|
+
* equally weighty rules that disagree (`is-hidden is-flex`) both count,
|
|
187
|
+
* since only the stylesheet's order would settle them, and the tables don't
|
|
188
|
+
* keep it. So the set can hold a display the element never takes, but never
|
|
189
|
+
* misses one its own tag and classes give it, and whitespace beside the
|
|
190
|
+
* element can go when every display in the set drops it.
|
|
191
|
+
*
|
|
192
|
+
* `none` is no box at all (`.modal` until it is active), so a run beside one
|
|
193
|
+
* is beside whatever is past it. And these are displays alone: a box a rule
|
|
194
|
+
* also takes out of the flow (`.modal`'s `position: fixed`) still reads as
|
|
195
|
+
* its display here, though a run beside it is beside its neighbours.
|
|
196
|
+
*/
|
|
197
|
+
export function bulmaDisplay(tag, classes) {
|
|
198
|
+
const own = new Set(classes);
|
|
199
|
+
const name = tag.toLowerCase();
|
|
200
|
+
const matching = RULES.filter(rule => (!rule.tag || rule.tag === name) &&
|
|
201
|
+
rule.classes.every(token => own.has(token)) &&
|
|
202
|
+
!rule.without.some(token => own.has(token)));
|
|
203
|
+
if (matching.length === 0)
|
|
204
|
+
return undefined;
|
|
205
|
+
const base = matching.filter(rule => !rule.media);
|
|
206
|
+
const top = Math.max(-1, ...base.map(rule => rule.weight));
|
|
207
|
+
const displays = new Set(base.filter(rule => rule.weight === top).map(rule => rule.display));
|
|
208
|
+
if (displays.size === 0)
|
|
209
|
+
displays.add(undefined);
|
|
210
|
+
for (const rule of matching) {
|
|
211
|
+
if (rule.media && rule.weight >= top)
|
|
212
|
+
displays.add(rule.display);
|
|
213
|
+
}
|
|
214
|
+
return displays;
|
|
215
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/sources/bulma-classes/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAoBH,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,CA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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,CA4iB9C"}
|
|
@@ -211,9 +211,10 @@ export function plan(facts) {
|
|
|
211
211
|
return refuse('attr', name, `\`${name}\` is also a bestax \`${target}\` prop, which would read it differently; rename or drop the attribute, then re-run`);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
// An attribute the target writes on this tag counts as one of its defaults
|
|
214
|
+
// An attribute the target writes on this tag counts as one of its defaults,
|
|
215
|
+
// unless what it writes is the tag's own implicit role.
|
|
215
216
|
const written = Object.entries(entry.writesAttr ?? {})
|
|
216
|
-
.filter(([, rule]) => rule.on.includes(tag))
|
|
217
|
+
.filter(([, rule]) => rule.on.includes(tag) && !rule.implicit)
|
|
217
218
|
.map(([name, rule]) => [name, rule.fallback]);
|
|
218
219
|
const naming = namingOf(entry, attributes);
|
|
219
220
|
// An attribute written out that stops the target's defaults, such as
|
|
@@ -322,7 +323,7 @@ export function plan(facts) {
|
|
|
322
323
|
if (!rule.on.includes(tag) || value === undefined)
|
|
323
324
|
continue;
|
|
324
325
|
if (typeof value !== 'string' || !rule.keeps.includes(value)) {
|
|
325
|
-
return refuse('attr', name, `bestax \`${target}\` keeps a <${tag}>'s \`${name}\` only as ${orList(rule.keeps)}, and writes \`${name}="${rule.fallback}"\` in place of anything else, so this one converts only as one of those, written out; keep this element as markup`);
|
|
326
|
+
return refuse('attr', name, `bestax \`${target}\` keeps a <${tag}>'s \`${name}\` only as ${orList(rule.keeps)}, and writes \`${name}="${rule.fallback}"\` in place of anything else, so this one converts only ${rule.implicit ? `with no \`${name}\` or as one of those` : 'as one of those, written out'}; keep this element as markup`);
|
|
326
327
|
}
|
|
327
328
|
}
|
|
328
329
|
for (const [name, tags] of Object.entries(entry.dropsAttr ?? {})) {
|
|
@@ -129,7 +129,7 @@ export const MAPPING = {
|
|
|
129
129
|
},
|
|
130
130
|
forwardRefAs: {
|
|
131
131
|
status: 'todo',
|
|
132
|
-
todo: '`forwardRefAs` is rbx-internal and has no counterpart. bestax forwards a ref from the form controls, plus `Avatar`, `Button`, `Carousel`, `CarouselItem`, `Dialog`, `Dropdown`, `EmptyState`, `Kbd`, `Kbd.Group`, `Link`, `LinkButton`, `Loader`, `Menu.Item`, `Modal`, `Navbar`, `Navbar.Burger`, `Navbar.Dropdown`, `Navbar.Item`, `Navbar.Link`, `SegmentedControl`, `SegmentedControl.Segment`, `Sidebar`, `Toast` and `ToggleButton` — pass `ref` directly on those, though not on the `Field`, `Field.Label`, `Field.Body`, `Checkboxes` and `Radios` wrappers, which forward none. Mind the `Navbar.Dropdown` collision: your rbx `Navbar.Dropdown` is the menu and becomes `Navbar.DropdownMenu`, which forwards no ref, while bestax `Navbar.Dropdown` — the container your `<Navbar.Item dropdown>` becomes — does. The rest, `Box` included, forward no ref: React 18 drops it with a warning, React 19 leaves it wherever the rest props go, so put the ref on a wrapping element you control',
|
|
132
|
+
todo: '`forwardRefAs` is rbx-internal and has no counterpart. bestax forwards a ref from the form controls, plus `Avatar`, `Button`, `Carousel`, `CarouselItem`, `Dialog`, `Dropdown`, `EmptyState`, `Kbd`, `Kbd.Group`, `Link`, `LinkButton`, `Loader`, `Menu.Item`, `Modal`, `Navbar`, `Navbar.Burger`, `Navbar.Dropdown`, `Navbar.Item`, `Navbar.Link`, `SegmentedControl`, `SegmentedControl.Segment`, `Sidebar`, `Timeline`, `Timeline.Item`, `Toast` and `ToggleButton` — pass `ref` directly on those, though not on the `Field`, `Field.Label`, `Field.Body`, `Checkboxes` and `Radios` wrappers, which forward none. Mind the `Navbar.Dropdown` collision: your rbx `Navbar.Dropdown` is the menu and becomes `Navbar.DropdownMenu`, which forwards no ref, while bestax `Navbar.Dropdown` — the container your `<Navbar.Item dropdown>` becomes — does. The rest, `Box` included, forward no ref: React 18 drops it with a warning, React 19 leaves it wherever the rest props go, so put the ref on a wrapping element you control',
|
|
133
133
|
},
|
|
134
134
|
// ---- elements -----------------------------------------------------------
|
|
135
135
|
Block: { status: 'mapped', target: 'Block' },
|
|
@@ -27,7 +27,7 @@ export const UNIVERSAL_PROPS = {
|
|
|
27
27
|
todo: 'this bestax component has no `as` prop; restructure the element instead',
|
|
28
28
|
},
|
|
29
29
|
domRef: {
|
|
30
|
-
todo: 'bestax-bulma has no `domRef`. The form controls, plus `Avatar`, `Button`, `Carousel`, `CarouselItem`, `Dialog`, `Dropdown`, `EmptyState`, `Kbd`, `Kbd.Group`, `Link`, `LinkButton`, `Loader`, `Menu.Item`, `Modal`, `Navbar`, `Navbar.Burger`, `Navbar.Dropdown`, `Navbar.Item`, `Navbar.Link`, `SegmentedControl`, `SegmentedControl.Segment`, `Sidebar`, `Toast` and `ToggleButton` forward a ref — on those, rename `domRef` to `ref`, though not on the `Field`, `Field.Label`, `Field.Body`, `Checkboxes` and `Radios` wrappers, which forward none. Mind the `Navbar.Dropdown` collision: the `Navbar.Item` that wrapped your dropdown became bestax `Navbar.Dropdown` and forwards one, while your `Navbar.Dropdown` became `Navbar.DropdownMenu` and does not. The rest forward no ref: React 18 drops it with a warning, React 19 leaves it wherever the rest props go, so put the ref on a DOM child or wrap the component',
|
|
30
|
+
todo: 'bestax-bulma has no `domRef`. The form controls, plus `Avatar`, `Button`, `Carousel`, `CarouselItem`, `Dialog`, `Dropdown`, `EmptyState`, `Kbd`, `Kbd.Group`, `Link`, `LinkButton`, `Loader`, `Menu.Item`, `Modal`, `Navbar`, `Navbar.Burger`, `Navbar.Dropdown`, `Navbar.Item`, `Navbar.Link`, `SegmentedControl`, `SegmentedControl.Segment`, `Sidebar`, `Timeline`, `Timeline.Item`, `Toast` and `ToggleButton` forward a ref — on those, rename `domRef` to `ref`, though not on the `Field`, `Field.Label`, `Field.Body`, `Checkboxes` and `Radios` wrappers, which forward none. Mind the `Navbar.Dropdown` collision: the `Navbar.Item` that wrapped your dropdown became bestax `Navbar.Dropdown` and forwards one, while your `Navbar.Dropdown` became `Navbar.DropdownMenu` and does not. The rest forward no ref: React 18 drops it with a warning, React 19 leaves it wherever the rest props go, so put the ref on a DOM child or wrap the component',
|
|
31
31
|
},
|
|
32
32
|
// ColorProps
|
|
33
33
|
backgroundColor: { rename: 'bgColor' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bestax-migrate",
|
|
3
|
-
"version": "2.25.
|
|
3
|
+
"version": "2.25.7",
|
|
4
4
|
"description": "Codemods for migrating existing React apps from other Bulma libraries to @allxsmith/bestax-bulma",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
"chalk": "^6.0.0",
|
|
39
39
|
"commander": "^15.0.0",
|
|
40
40
|
"jscodeshift": "^17.3.0",
|
|
41
|
-
"
|
|
41
|
+
"parse5": "^7.3.0",
|
|
42
|
+
"property-information": "^7.2.0",
|
|
43
|
+
"@allxsmith/bestax-bulma": "^5.36.1"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
46
|
"@jest/globals": "^30.0.0",
|