bestax-migrate 2.2.2 → 2.3.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.
- package/README.md +12 -10
- package/dist/sources/_shared/imports.d.ts +28 -0
- package/dist/sources/_shared/imports.d.ts.map +1 -1
- package/dist/sources/_shared/imports.js +62 -0
- package/dist/sources/_shared/jsx-utils.d.ts +17 -0
- package/dist/sources/_shared/jsx-utils.d.ts.map +1 -1
- package/dist/sources/_shared/jsx-utils.js +49 -1
- package/dist/sources/_shared/props.d.ts +17 -0
- package/dist/sources/_shared/props.d.ts.map +1 -1
- package/dist/sources/_shared/props.js +72 -3
- package/dist/sources/_shared/specials-utils.d.ts +49 -3
- package/dist/sources/_shared/specials-utils.d.ts.map +1 -1
- package/dist/sources/_shared/specials-utils.js +165 -5
- package/dist/sources/_shared/viewports.d.ts +17 -0
- package/dist/sources/_shared/viewports.d.ts.map +1 -0
- package/dist/sources/_shared/viewports.js +32 -0
- package/dist/sources/bloomer/deps.d.ts +17 -0
- package/dist/sources/bloomer/deps.d.ts.map +1 -0
- package/dist/sources/bloomer/deps.js +119 -0
- package/dist/sources/bloomer/index.d.ts +3 -0
- package/dist/sources/bloomer/index.d.ts.map +1 -0
- package/dist/sources/bloomer/index.js +10 -0
- package/dist/sources/bloomer/mapping.d.ts +84 -0
- package/dist/sources/bloomer/mapping.d.ts.map +1 -0
- package/dist/sources/bloomer/mapping.js +988 -0
- package/dist/sources/bloomer/responsive.d.ts +39 -0
- package/dist/sources/bloomer/responsive.d.ts.map +1 -0
- package/dist/sources/bloomer/responsive.js +259 -0
- package/dist/sources/bloomer/specials.d.ts +19 -0
- package/dist/sources/bloomer/specials.d.ts.map +1 -0
- package/dist/sources/bloomer/specials.js +774 -0
- package/dist/sources/bloomer/styles.d.ts +13 -0
- package/dist/sources/bloomer/styles.d.ts.map +1 -0
- package/dist/sources/bloomer/styles.js +17 -0
- package/dist/sources/bloomer/transform.d.ts +27 -0
- package/dist/sources/bloomer/transform.d.ts.map +1 -0
- package/dist/sources/bloomer/transform.js +826 -0
- package/dist/sources/rbx/responsive.d.ts.map +1 -1
- package/dist/sources/rbx/responsive.js +1 -31
- package/dist/sources/rbx/specials.d.ts.map +1 -1
- package/dist/sources/rbx/specials.js +14 -91
- package/dist/sources/rbx/transform.d.ts.map +1 -1
- package/dist/sources/rbx/transform.js +168 -78
- package/dist/sources/react-bulma-components/responsive.d.ts.map +1 -1
- package/dist/sources/react-bulma-components/responsive.js +2 -14
- package/dist/sources/react-bulma-components/specials.d.ts.map +1 -1
- package/dist/sources/react-bulma-components/specials.js +33 -17
- package/dist/sources/react-bulma-components/transform.d.ts.map +1 -1
- package/dist/sources/react-bulma-components/transform.js +168 -78
- package/dist/sources/registry.d.ts.map +1 -1
- package/dist/sources/registry.js +2 -0
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -5
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flattens bloomer's three-shape helper props into bestax-bulma's flat
|
|
3
|
+
* per-viewport props. Every bloomer component takes these (they come from the
|
|
4
|
+
* `withHelpersModifiers` HOC), and none of them has a bestax prop of the same
|
|
5
|
+
* name — so the attribute is always removed, whatever could be converted, and
|
|
6
|
+
* each entry that could not be carried over gets its own TODO. A leftover
|
|
7
|
+
* would not be a harmless no-op: bestax has no `isDisplay`, so it is an
|
|
8
|
+
* excess-property type error on every migrated component.
|
|
9
|
+
*
|
|
10
|
+
* 1. `isDisplay` — a display, optionally suffixed with a viewport; an array
|
|
11
|
+
* of those; or an object keyed by display whose values are viewports:
|
|
12
|
+
* <Box isDisplay="flex-tablet" /> → displayTablet="flex"
|
|
13
|
+
* <Box isDisplay={['flex', 'block-mobile']} /> → display="flex" displayMobile="block"
|
|
14
|
+
* <Box isDisplay={{ flex: ['default', 'desktop'] }} />
|
|
15
|
+
* → display="flex" displayDesktop="flex"
|
|
16
|
+
* 2. `isHidden` — a boolean, a viewport, or an array of viewports:
|
|
17
|
+
* <Box isHidden /> → visibility="hidden"
|
|
18
|
+
* <Box isHidden="touch" /> → visibilityTouch="hidden"
|
|
19
|
+
* <Box isHidden={['mobile', 'desktop-only']} />
|
|
20
|
+
* → visibilityMobile="hidden" visibilityDesktopOnly="hidden"
|
|
21
|
+
* 3. Column `isSize` / `isOffset` — a number, a fraction, a width word, or
|
|
22
|
+
* an object keyed by breakpoint:
|
|
23
|
+
* <Column isSize="1/2" isOffset={2} /> → size="half" offset={2}
|
|
24
|
+
* <Column isSize={{ default: 4, mobile: 8 }} /> → size={4} sizeMobile={8}
|
|
25
|
+
* <Column isSize="narrow" /> → isNarrow
|
|
26
|
+
*
|
|
27
|
+
* bestax declares every one of Bulma's nine viewports for `display*` and
|
|
28
|
+
* `visibility*` (including `-only` and `touch`), so those convert one-to-one.
|
|
29
|
+
* Column sizes exist for the five breakpoints Bulma sizes columns at, plus
|
|
30
|
+
* `isNarrowTouch` — `sizeTouch`/`offsetTouch` do not exist and become TODOs.
|
|
31
|
+
*/
|
|
32
|
+
import type { ASTPath } from 'jscodeshift';
|
|
33
|
+
import { type TransformContext } from '../_shared/jsx-utils.js';
|
|
34
|
+
export type ResponsiveKind = 'generic' | 'column';
|
|
35
|
+
/** Which specials opt their element into the extra breakpoint shapes. */
|
|
36
|
+
export declare const RESPONSIVE_KINDS: Record<string, ResponsiveKind>;
|
|
37
|
+
/** Run every helper-flattening pass that applies to this element. */
|
|
38
|
+
export declare function flattenResponsiveProps(ctx: TransformContext, path: ASTPath<any>, element: any, kind: ResponsiveKind): void;
|
|
39
|
+
//# sourceMappingURL=responsive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responsive.d.ts","sourceRoot":"","sources":["../../../src/sources/bloomer/responsive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EAWL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAKjC,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,CAAC;AAElD,yEAAyE;AACzE,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAE3D,CAAC;AAmSF,qEAAqE;AACrE,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,EAClB,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,cAAc,GACnB,IAAI,CAIN"}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flattens bloomer's three-shape helper props into bestax-bulma's flat
|
|
3
|
+
* per-viewport props. Every bloomer component takes these (they come from the
|
|
4
|
+
* `withHelpersModifiers` HOC), and none of them has a bestax prop of the same
|
|
5
|
+
* name — so the attribute is always removed, whatever could be converted, and
|
|
6
|
+
* each entry that could not be carried over gets its own TODO. A leftover
|
|
7
|
+
* would not be a harmless no-op: bestax has no `isDisplay`, so it is an
|
|
8
|
+
* excess-property type error on every migrated component.
|
|
9
|
+
*
|
|
10
|
+
* 1. `isDisplay` — a display, optionally suffixed with a viewport; an array
|
|
11
|
+
* of those; or an object keyed by display whose values are viewports:
|
|
12
|
+
* <Box isDisplay="flex-tablet" /> → displayTablet="flex"
|
|
13
|
+
* <Box isDisplay={['flex', 'block-mobile']} /> → display="flex" displayMobile="block"
|
|
14
|
+
* <Box isDisplay={{ flex: ['default', 'desktop'] }} />
|
|
15
|
+
* → display="flex" displayDesktop="flex"
|
|
16
|
+
* 2. `isHidden` — a boolean, a viewport, or an array of viewports:
|
|
17
|
+
* <Box isHidden /> → visibility="hidden"
|
|
18
|
+
* <Box isHidden="touch" /> → visibilityTouch="hidden"
|
|
19
|
+
* <Box isHidden={['mobile', 'desktop-only']} />
|
|
20
|
+
* → visibilityMobile="hidden" visibilityDesktopOnly="hidden"
|
|
21
|
+
* 3. Column `isSize` / `isOffset` — a number, a fraction, a width word, or
|
|
22
|
+
* an object keyed by breakpoint:
|
|
23
|
+
* <Column isSize="1/2" isOffset={2} /> → size="half" offset={2}
|
|
24
|
+
* <Column isSize={{ default: 4, mobile: 8 }} /> → size={4} sizeMobile={8}
|
|
25
|
+
* <Column isSize="narrow" /> → isNarrow
|
|
26
|
+
*
|
|
27
|
+
* bestax declares every one of Bulma's nine viewports for `display*` and
|
|
28
|
+
* `visibility*` (including `-only` and `touch`), so those convert one-to-one.
|
|
29
|
+
* Column sizes exist for the five breakpoints Bulma sizes columns at, plus
|
|
30
|
+
* `isNarrowTouch` — `sizeTouch`/`offsetTouch` do not exist and become TODOs.
|
|
31
|
+
*/
|
|
32
|
+
import { COLUMN_SIZE_MAP } from './mapping.js';
|
|
33
|
+
import { VIEWPORT_SUFFIX } from '../_shared/viewports.js';
|
|
34
|
+
import { addTodo, arrayExpressionOf, attrValue, findAttr, literalOf, literalValueOf, makeAttr, objectExpressionOf, propKey, removeAttr, } from '../_shared/jsx-utils.js';
|
|
35
|
+
import { addAttrOnce, addConverted } from '../_shared/props.js';
|
|
36
|
+
/** Which specials opt their element into the extra breakpoint shapes. */
|
|
37
|
+
export const RESPONSIVE_KINDS = {
|
|
38
|
+
column: 'column',
|
|
39
|
+
};
|
|
40
|
+
/** Longest alternatives first, so `inline-block` is not read as `inline`. */
|
|
41
|
+
const DISPLAY_RE = /^(inline-block|inline-flex|inline|flex|block)(?:-(mobile|tablet-only|tablet|touch|desktop-only|desktop|widescreen-only|widescreen|fullhd))?$/;
|
|
42
|
+
const DISPLAYS = new Set([
|
|
43
|
+
'flex',
|
|
44
|
+
'block',
|
|
45
|
+
'inline',
|
|
46
|
+
'inline-block',
|
|
47
|
+
'inline-flex',
|
|
48
|
+
]);
|
|
49
|
+
/** The breakpoints bestax's `size*`/`offset*` Column props exist for. */
|
|
50
|
+
const COLUMN_VIEWPORTS = {
|
|
51
|
+
mobile: 'Mobile',
|
|
52
|
+
tablet: 'Tablet',
|
|
53
|
+
desktop: 'Desktop',
|
|
54
|
+
widescreen: 'Widescreen',
|
|
55
|
+
fullhd: 'Fullhd',
|
|
56
|
+
};
|
|
57
|
+
/** Non-whitespace children of an array literal, or null for a non-array. */
|
|
58
|
+
function arrayItems(node) {
|
|
59
|
+
if (node?.type !== 'ArrayExpression')
|
|
60
|
+
return null;
|
|
61
|
+
return (node.elements ?? []).filter((e) => e != null);
|
|
62
|
+
}
|
|
63
|
+
// ---- 1. isDisplay ----------------------------------------------------------
|
|
64
|
+
function flattenDisplay(ctx, path, element) {
|
|
65
|
+
const attr = findAttr(element, 'isDisplay');
|
|
66
|
+
if (!attr)
|
|
67
|
+
return;
|
|
68
|
+
const { j } = ctx;
|
|
69
|
+
const todo = (message) => addTodo(ctx, path, 'prop:isDisplay', message);
|
|
70
|
+
/** `display` + optional viewport → `display<Suffix>="…"`. */
|
|
71
|
+
const emit = (display, viewport) => {
|
|
72
|
+
if (viewport === undefined || viewport === 'default') {
|
|
73
|
+
addConverted(ctx, path, element, 'isDisplay', 'display', display);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const suffix = VIEWPORT_SUFFIX[viewport];
|
|
77
|
+
if (suffix === undefined) {
|
|
78
|
+
todo(`\`isDisplay\` names \`${viewport}\`, which is not a Bulma viewport; set the matching \`display*\` prop by hand`);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
addConverted(ctx, path, element, 'isDisplay', `display${suffix}`, display);
|
|
82
|
+
};
|
|
83
|
+
/** A `'flex-tablet'`-style string. */
|
|
84
|
+
const fromString = (value) => {
|
|
85
|
+
const m = DISPLAY_RE.exec(value);
|
|
86
|
+
if (!m) {
|
|
87
|
+
todo(`\`isDisplay="${value}"\` is not a display bloomer's helpers produce; set \`display\` (and a viewport suffix) by hand`);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
emit(m[1], m[2]);
|
|
91
|
+
};
|
|
92
|
+
/** One node inside an array or object form. */
|
|
93
|
+
const fromNode = (node, describe, display) => {
|
|
94
|
+
const literal = literalOf(node);
|
|
95
|
+
if (typeof literal === 'string') {
|
|
96
|
+
if (display)
|
|
97
|
+
emit(display, literal);
|
|
98
|
+
else
|
|
99
|
+
fromString(literal);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
todo(`\`isDisplay\` ${describe} has a dynamic value; set the matching \`display*\` prop conditionally by hand`);
|
|
103
|
+
};
|
|
104
|
+
const value = attr.value;
|
|
105
|
+
const literal = literalValueOf(attr);
|
|
106
|
+
if (literal.kind === 'string') {
|
|
107
|
+
fromString(literal.value);
|
|
108
|
+
}
|
|
109
|
+
else if (arrayExpressionOf(value)) {
|
|
110
|
+
for (const item of arrayItems(arrayExpressionOf(value)) ?? []) {
|
|
111
|
+
fromNode(item, 'entry');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
else if (objectExpressionOf(value)) {
|
|
115
|
+
for (const prop of objectExpressionOf(value).properties) {
|
|
116
|
+
const key = propKey(prop);
|
|
117
|
+
if (!key || !DISPLAYS.has(key)) {
|
|
118
|
+
todo(`\`isDisplay.${String(key)}\` is not a display bloomer's helpers know; convert it by hand`);
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
const items = arrayItems(prop.value);
|
|
122
|
+
if (items) {
|
|
123
|
+
for (const item of items)
|
|
124
|
+
fromNode(item, `\`${key}\` entry`, key);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
fromNode(prop.value, `\`${key}\``, key);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
todo('dropped `isDisplay`: it must be a string, array or object literal to flatten to bestax `display*` props, and bestax has no `isDisplay` — reapply it by hand');
|
|
133
|
+
}
|
|
134
|
+
removeAttr(element, attr);
|
|
135
|
+
ctx.dirty = true;
|
|
136
|
+
void j;
|
|
137
|
+
}
|
|
138
|
+
// ---- 2. isHidden -----------------------------------------------------------
|
|
139
|
+
function flattenHidden(ctx, path, element) {
|
|
140
|
+
const attr = findAttr(element, 'isHidden');
|
|
141
|
+
if (!attr)
|
|
142
|
+
return;
|
|
143
|
+
const todo = (message) => addTodo(ctx, path, 'prop:isHidden', message);
|
|
144
|
+
const emit = (viewport) => {
|
|
145
|
+
const suffix = VIEWPORT_SUFFIX[viewport];
|
|
146
|
+
if (suffix === undefined) {
|
|
147
|
+
todo(`\`isHidden="${viewport}"\` is not a Bulma viewport; set the matching \`visibility*="hidden"\` prop by hand`);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
addConverted(ctx, path, element, 'isHidden', `visibility${suffix}`, 'hidden');
|
|
151
|
+
};
|
|
152
|
+
const literal = literalValueOf(attr);
|
|
153
|
+
if (literal.kind === 'boolean') {
|
|
154
|
+
if (literal.value) {
|
|
155
|
+
addConverted(ctx, path, element, 'isHidden', 'visibility', 'hidden');
|
|
156
|
+
}
|
|
157
|
+
// `isHidden={false}` is a no-op — drop it.
|
|
158
|
+
}
|
|
159
|
+
else if (literal.kind === 'string') {
|
|
160
|
+
emit(literal.value);
|
|
161
|
+
}
|
|
162
|
+
else if (arrayExpressionOf(attr.value)) {
|
|
163
|
+
for (const item of arrayItems(arrayExpressionOf(attr.value)) ?? []) {
|
|
164
|
+
const value = literalOf(item);
|
|
165
|
+
if (typeof value === 'string')
|
|
166
|
+
emit(value);
|
|
167
|
+
else {
|
|
168
|
+
todo('`isHidden` entry has a dynamic value; set the matching `visibility*="hidden"` prop conditionally by hand');
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
todo('`isHidden` has a dynamic value; set `visibility="hidden"` (or a per-viewport `visibility*`) conditionally by hand');
|
|
174
|
+
}
|
|
175
|
+
removeAttr(element, attr);
|
|
176
|
+
ctx.dirty = true;
|
|
177
|
+
}
|
|
178
|
+
// ---- 3. Column isSize / isOffset ------------------------------------------
|
|
179
|
+
function flattenColumnSizes(ctx, path, element) {
|
|
180
|
+
const { j } = ctx;
|
|
181
|
+
for (const [prop, base] of [
|
|
182
|
+
['isSize', 'size'],
|
|
183
|
+
['isOffset', 'offset'],
|
|
184
|
+
]) {
|
|
185
|
+
const attr = findAttr(element, prop);
|
|
186
|
+
if (!attr)
|
|
187
|
+
continue;
|
|
188
|
+
const todo = (message) => addTodo(ctx, path, `prop:${prop}`, message);
|
|
189
|
+
/** One size value, for the unsuffixed prop or a breakpoint's. */
|
|
190
|
+
const convert = (node, suffix, where) => {
|
|
191
|
+
const literal = literalOf(node);
|
|
192
|
+
if (typeof literal === 'number') {
|
|
193
|
+
// Column sizes take numbers; reuse the node.
|
|
194
|
+
addAttrOnce(ctx, path, element, prop, j.jsxAttribute(j.jsxIdentifier(`${base}${suffix}`), attrValue(j, node)));
|
|
195
|
+
}
|
|
196
|
+
else if (typeof literal === 'string') {
|
|
197
|
+
if (literal === 'narrow') {
|
|
198
|
+
if (base === 'size') {
|
|
199
|
+
addAttrOnce(ctx, path, element, prop, makeAttr(j, `isNarrow${suffix}`));
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
todo(`\`${where}="narrow"\` is not an offset; drop it`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else if (COLUMN_SIZE_MAP[literal]) {
|
|
206
|
+
addAttrOnce(ctx, path, element, prop, makeAttr(j, `${base}${suffix}`, COLUMN_SIZE_MAP[literal]));
|
|
207
|
+
}
|
|
208
|
+
else if (/^(?:[1-9]|1[0-2])$/.test(literal)) {
|
|
209
|
+
addAttrOnce(ctx, path, element, prop, makeAttr(j, `${base}${suffix}`, literal));
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
todo(`\`${where}="${literal}"\` is not a column size bloomer's helpers know (1–12, a fraction like "1/2", "full" or "narrow"); set \`${base}${suffix}\` by hand`);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
todo(`\`${where}\` has a dynamic value; set \`${base}${suffix}\` by hand (bestax takes numbers or the named sizes: "half", "one-third", …)`);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
const objectExpr = objectExpressionOf(attr.value);
|
|
220
|
+
if (objectExpr) {
|
|
221
|
+
for (const bpProp of objectExpr.properties) {
|
|
222
|
+
const key = propKey(bpProp);
|
|
223
|
+
if (key === 'default') {
|
|
224
|
+
convert(bpProp.value, '', `${prop}.default`);
|
|
225
|
+
}
|
|
226
|
+
else if (key !== undefined && COLUMN_VIEWPORTS[key]) {
|
|
227
|
+
convert(bpProp.value, COLUMN_VIEWPORTS[key], `${prop}.${key}`);
|
|
228
|
+
}
|
|
229
|
+
else if (key === 'touch') {
|
|
230
|
+
// bestax's Column has `isNarrowTouch` but no `sizeTouch`/`offsetTouch`.
|
|
231
|
+
const literal = literalOf(bpProp.value);
|
|
232
|
+
if (base === 'size' && literal === 'narrow') {
|
|
233
|
+
addAttrOnce(ctx, path, element, prop, makeAttr(j, 'isNarrowTouch'));
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
todo(`bestax \`Column\` has no \`${base}Touch\` prop (Bulma keeps the \`is-*-touch\` classes); add the class by hand`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
todo(`\`${prop}.${String(key)}\` is not a breakpoint bloomer's helpers know; convert it by hand`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
convert(attr.value?.type === 'JSXExpressionContainer'
|
|
246
|
+
? attr.value.expression
|
|
247
|
+
: attr.value, '', prop);
|
|
248
|
+
}
|
|
249
|
+
removeAttr(element, attr);
|
|
250
|
+
ctx.dirty = true;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/** Run every helper-flattening pass that applies to this element. */
|
|
254
|
+
export function flattenResponsiveProps(ctx, path, element, kind) {
|
|
255
|
+
flattenDisplay(ctx, path, element);
|
|
256
|
+
flattenHidden(ctx, path, element);
|
|
257
|
+
if (kind === 'column')
|
|
258
|
+
flattenColumnSizes(ctx, path, element);
|
|
259
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural handlers for bloomer → bestax conversions a rename table cannot
|
|
3
|
+
* express: targets chosen by a prop's value (PageControl `isNext`, NavbarItem
|
|
4
|
+
* `hasDropdown`), wrappers bestax renders itself (Page, whose Pagination.Link
|
|
5
|
+
* child renders its own <li>), replacement with plain HTML where bestax has
|
|
6
|
+
* no component (Help, Label, Heading, BreadcrumbItem, PanelTab, TabLink,
|
|
7
|
+
* HeroVideo), and the two props whose bloomer shape has no single bestax
|
|
8
|
+
* prop (Icon's className, Control's hasIcons).
|
|
9
|
+
*
|
|
10
|
+
* A handler may return a `target` override for the rename step, or mark the
|
|
11
|
+
* element `replaced` when it substituted the node itself.
|
|
12
|
+
*/
|
|
13
|
+
import type { ASTPath } from 'jscodeshift';
|
|
14
|
+
import { type TransformContext } from '../_shared/jsx-utils.js';
|
|
15
|
+
import { type SpecialResult } from '../_shared/specials-utils.js';
|
|
16
|
+
export type { SpecialResult };
|
|
17
|
+
export declare function runSpecial(name: string, ctx: TransformContext, path: ASTPath<any>, element: any): SpecialResult;
|
|
18
|
+
export declare const SPECIAL_NAMES: string[];
|
|
19
|
+
//# sourceMappingURL=specials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specials.d.ts","sourceRoot":"","sources":["../../../src/sources/bloomer/specials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EASL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAQL,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EAAE,aAAa,EAAE,CAAC;AAuiC9B,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,EAClB,OAAO,EAAE,GAAG,GACX,aAAa,CAQf;AAED,eAAO,MAAM,aAAa,UAAwB,CAAC"}
|