bestax-migrate 2.38.1 → 2.38.2
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/bloomer/mapping.d.ts.map +1 -1
- package/dist/sources/bloomer/mapping.js +3 -10
- package/dist/sources/bloomer/specials.d.ts +1 -1
- package/dist/sources/bloomer/specials.d.ts.map +1 -1
- package/dist/sources/bloomer/specials.js +60 -2
- package/dist/sources/bulma-classes/class-map.d.ts +8 -2
- package/dist/sources/bulma-classes/class-map.d.ts.map +1 -1
- package/dist/sources/bulma-classes/class-map.js +33 -5
- package/dist/sources/bulma-classes/plan.js +10 -5
- package/dist/sources/rbx/specials.d.ts.map +1 -1
- package/dist/sources/rbx/specials.js +7 -9
- package/dist/sources/react-bulma-components/specials.d.ts.map +1 -1
- package/dist/sources/react-bulma-components/specials.js +7 -4
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../../src/sources/bloomer/mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAkBnE;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,UAEzB,CAAC;AA8CF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAsBtD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAG1D,CAAC;AAEF;;;;;GAKG;AACH;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,aAG/B,CAAC;AAEH,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../../src/sources/bloomer/mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAkBnE;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,UAEzB,CAAC;AA8CF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAsBtD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAG1D,CAAC;AAEF;;;;;GAKG;AACH;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,aAG/B,CAAC;AAEH,eAAO,MAAM,kBAAkB,aAoB7B,CAAC;AAEH,8EAA8E;AAC9E,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAC3C,MAAM,GAAG,IAAI,CA0Bf;AAED,iFAAiF;AACjF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOlD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CA4nBpD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAiIpD,CAAC;AAEF,sDAAsD;AACtD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,GAAG,SAAS,CAM3E"}
|
|
@@ -148,7 +148,6 @@ export const HELPERLESS_TARGETS = new Set([
|
|
|
148
148
|
'Panel.Heading',
|
|
149
149
|
'Panel.Tabs',
|
|
150
150
|
'Panel.Block',
|
|
151
|
-
'Tabs.List',
|
|
152
151
|
'Tabs.Item',
|
|
153
152
|
'Message.Header',
|
|
154
153
|
'Message.Body',
|
|
@@ -759,15 +758,9 @@ export const MAPPING = {
|
|
|
759
758
|
isFullWidth: FULLWIDTH,
|
|
760
759
|
},
|
|
761
760
|
},
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
props: {
|
|
766
|
-
isAlign: {
|
|
767
|
-
todo: "Bulma aligns tabs on the `.tabs` container, not the list (bloomer's `is-center` on the <ul> did nothing); set `align` on the `<Tabs>` instead",
|
|
768
|
-
},
|
|
769
|
-
},
|
|
770
|
-
},
|
|
761
|
+
// A plain <ul>, as bloomer rendered: bestax's `Tabs.List` renders
|
|
762
|
+
// `role="tablist"`, which the `Tabs.Item`s inside are not the tabs of (#1961).
|
|
763
|
+
TabList: { status: 'mapped', special: 'tab-list' },
|
|
771
764
|
// bestax's `Tabs.Tab` is the controlled API and requires an `index`;
|
|
772
765
|
// `Tabs.Item` is the plain <li> that bloomer's Tab actually is.
|
|
773
766
|
Tab: { status: 'mapped', target: 'Tabs.Item', props: { isActive: active } },
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* `hasDropdown`), wrappers bestax renders itself (Page, whose Pagination.Link
|
|
5
5
|
* child renders its own <li>), replacement with plain HTML where bestax has
|
|
6
6
|
* no component (Help, Label, Heading, BreadcrumbItem, PanelTab, TabLink,
|
|
7
|
-
* HeroVideo), and the two props whose bloomer shape has no single bestax
|
|
7
|
+
* HeroVideo) or where its part would add a role (TabList), and the two props whose bloomer shape has no single bestax
|
|
8
8
|
* prop (Icon's className, Control's hasIcons).
|
|
9
9
|
*
|
|
10
10
|
* A handler may return a `target` override for the rename step, or mark the
|
|
@@ -1 +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;
|
|
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;AAO3C,OAAO,EAUL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAWL,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EAAE,aAAa,EAAE,CAAC;AAmtC9B,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"}
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* `hasDropdown`), wrappers bestax renders itself (Page, whose Pagination.Link
|
|
5
5
|
* child renders its own <li>), replacement with plain HTML where bestax has
|
|
6
6
|
* no component (Help, Label, Heading, BreadcrumbItem, PanelTab, TabLink,
|
|
7
|
-
* HeroVideo), and the two props whose bloomer shape has no single bestax
|
|
7
|
+
* HeroVideo) or where its part would add a role (TabList), and the two props whose bloomer shape has no single bestax
|
|
8
8
|
* prop (Icon's className, Control's hasIcons).
|
|
9
9
|
*
|
|
10
10
|
* A handler may return a `target` override for the rename step, or mark the
|
|
11
11
|
* element `replaced` when it substituted the node itself.
|
|
12
12
|
*/
|
|
13
|
-
import { RENDER_TODO, RESPONSIVE_PROPS, UNIVERSAL_PROPS } from './mapping.js';
|
|
13
|
+
import { helperClassHint, RENDER_TODO, RESPONSIVE_PROPS, UNIVERSAL_PROPS, } from './mapping.js';
|
|
14
14
|
import { addAttr, attrSource, addTodo, attributesOf, findAttr, literalValueOf, makeAttr, removeAttr, resolveBooleanish, } from '../_shared/jsx-utils.js';
|
|
15
15
|
import { applyPropAction } from '../_shared/props.js';
|
|
16
16
|
import { aTag } from '../_shared/articles.js';
|
|
@@ -810,6 +810,64 @@ const SPECIALS = {
|
|
|
810
810
|
const tag = plainTag(ctx, path, element, 'tag', 'a', 'PanelTab');
|
|
811
811
|
return replaceWithPlain(ctx, path, element, tag, cls, 'PanelTab');
|
|
812
812
|
},
|
|
813
|
+
/**
|
|
814
|
+
* bloomer's TabList is the tabs' <ul>, and stays one: bestax's `Tabs.List`
|
|
815
|
+
* renders `role="tablist"`, which the `Tabs.Item`s inside are not the tabs
|
|
816
|
+
* of (#1961).
|
|
817
|
+
*/
|
|
818
|
+
'tab-list'(ctx, path, element) {
|
|
819
|
+
const align = findAttr(element, 'isAlign');
|
|
820
|
+
if (align) {
|
|
821
|
+
removeAttr(element, align);
|
|
822
|
+
ctx.dirty = true;
|
|
823
|
+
addTodo(ctx, path, 'prop:isAlign', "`isAlign` — Bulma aligns tabs on the `.tabs` container, not the list (bloomer's `is-center` on the <ul> did nothing); set `align` on the `<Tabs>` instead");
|
|
824
|
+
}
|
|
825
|
+
// A helper whose literal value stands for one Bulma class becomes that
|
|
826
|
+
// class, as it did when this was a `Tabs.List`, a part that takes no
|
|
827
|
+
// helper props. Any other helper is left to `replaceWithPlain`, which
|
|
828
|
+
// drops it with a `plain-element` TODO, as on every plain element.
|
|
829
|
+
const classes = [];
|
|
830
|
+
for (const attr of attributesOf(element)) {
|
|
831
|
+
const literal = literalValueOf(attr);
|
|
832
|
+
if (literal.kind !== 'string' && literal.kind !== 'boolean')
|
|
833
|
+
continue;
|
|
834
|
+
const cls = helperClassHint(attr.name.name, literal.value);
|
|
835
|
+
if (!cls)
|
|
836
|
+
continue;
|
|
837
|
+
// A helper set to false did nothing in bloomer, and a bare boolean on
|
|
838
|
+
// one that takes a value hints a placeholder rather than a class.
|
|
839
|
+
if (literal.value !== false && cls.includes('<'))
|
|
840
|
+
continue;
|
|
841
|
+
removeAttr(element, attr);
|
|
842
|
+
ctx.dirty = true;
|
|
843
|
+
if (literal.value !== false)
|
|
844
|
+
classes.push(cls);
|
|
845
|
+
}
|
|
846
|
+
// A dynamic `className` stays as written. `replaceWithPlain` would drop
|
|
847
|
+
// it, since it can merge only a literal one with a class of its own.
|
|
848
|
+
const className = findAttr(element, 'className');
|
|
849
|
+
const dynamic = className && literalValueOf(className).kind !== 'string'
|
|
850
|
+
? className
|
|
851
|
+
: undefined;
|
|
852
|
+
const attrs = element.openingElement.attributes ?? [];
|
|
853
|
+
const before = dynamic ? attrs.slice(0, attrs.indexOf(dynamic)) : [];
|
|
854
|
+
if (dynamic) {
|
|
855
|
+
removeAttr(element, dynamic);
|
|
856
|
+
if (classes.length > 0) {
|
|
857
|
+
addTodo(ctx, path, 'prop:className', `dynamic TabList className; merge it with the \`${classes.join(' ')}\` class by hand`);
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
const tag = plainTag(ctx, path, element, 'tag', 'ul', 'TabList');
|
|
861
|
+
const result = replaceWithPlain(ctx, path, element, tag, dynamic ? undefined : join(...classes), 'TabList');
|
|
862
|
+
if (dynamic) {
|
|
863
|
+
// Back in its place: after the last attribute before it that the
|
|
864
|
+
// plain element kept, so a spread keeps the precedence it had.
|
|
865
|
+
const now = path.node.openingElement.attributes;
|
|
866
|
+
const anchor = [...before].reverse().find(a => now.includes(a));
|
|
867
|
+
now.splice(anchor ? now.indexOf(anchor) + 1 : 0, 0, dynamic);
|
|
868
|
+
}
|
|
869
|
+
return result;
|
|
870
|
+
},
|
|
813
871
|
/** bestax's Tabs.Item is the <li>; the anchor inside it is plain markup. */
|
|
814
872
|
'tab-link'(ctx, path, element) {
|
|
815
873
|
const tag = plainTag(ctx, path, element, 'tag', 'a', 'TabLink');
|
|
@@ -205,12 +205,18 @@ export interface RootEntry {
|
|
|
205
205
|
/**
|
|
206
206
|
* What the target renders in place of `defaults` once the element names
|
|
207
207
|
* itself through one of `by`, set to anything but an empty string (`Icon`
|
|
208
|
-
* makes a named icon an image and hides any other
|
|
209
|
-
*
|
|
208
|
+
* makes a named icon an image and hides any other, and a pagination link
|
|
209
|
+
* with an `href` is a link, and a button without one). A name given as an
|
|
210
|
+
* expression may render as none, so the element then sets both. `what`
|
|
211
|
+
* says what one of `by` gives the element, in the TODO for that case:
|
|
212
|
+
* `a name` unless it says otherwise. With `emptyCounts`, an empty value
|
|
213
|
+
* gives it too: `href=""` is still a link.
|
|
210
214
|
*/
|
|
211
215
|
readonly namedDefaults?: {
|
|
212
216
|
readonly by: readonly string[];
|
|
213
217
|
readonly defaults: Readonly<Record<string, string>>;
|
|
218
|
+
readonly what?: string;
|
|
219
|
+
readonly emptyCounts?: boolean;
|
|
214
220
|
};
|
|
215
221
|
/**
|
|
216
222
|
* Attributes that stop the target rendering `defaults` when the element sets
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-map.d.ts","sourceRoot":"","sources":["../../../src/sources/bulma-classes/class-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;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,EAAE,OAAO,CAAC;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,SA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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,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAKrE;AAsBD,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG7D;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE5D;AAED,4DAA4D;AAC5D,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"}
|
|
@@ -1766,7 +1766,8 @@ export const ROOTS = {
|
|
|
1766
1766
|
ownProps: ['textColor', 'color', 'bgColor'],
|
|
1767
1767
|
},
|
|
1768
1768
|
// The previous and next links write `tabIndex` before the props they're
|
|
1769
|
-
// given, and take no helper props.
|
|
1769
|
+
// given, and take no helper props. Without an `href` each is a button, and
|
|
1770
|
+
// writes `role="button"` too.
|
|
1770
1771
|
'pagination-previous': {
|
|
1771
1772
|
status: 'mapped',
|
|
1772
1773
|
target: 'Pagination.Previous',
|
|
@@ -1774,7 +1775,13 @@ export const ROOTS = {
|
|
|
1774
1775
|
textColor: null,
|
|
1775
1776
|
bgColor: null,
|
|
1776
1777
|
noHelpers: true,
|
|
1777
|
-
defaults: { tabIndex: '0' },
|
|
1778
|
+
defaults: { tabIndex: '0', role: 'button' },
|
|
1779
|
+
namedDefaults: {
|
|
1780
|
+
by: ['href'],
|
|
1781
|
+
defaults: { tabIndex: '0' },
|
|
1782
|
+
what: 'an `href`',
|
|
1783
|
+
emptyCounts: true,
|
|
1784
|
+
},
|
|
1778
1785
|
omits: {
|
|
1779
1786
|
'is-disabled': '`disabled` also writes `aria-disabled` and `tabIndex="-1"`',
|
|
1780
1787
|
},
|
|
@@ -1787,7 +1794,13 @@ export const ROOTS = {
|
|
|
1787
1794
|
textColor: null,
|
|
1788
1795
|
bgColor: null,
|
|
1789
1796
|
noHelpers: true,
|
|
1790
|
-
defaults: { tabIndex: '0' },
|
|
1797
|
+
defaults: { tabIndex: '0', role: 'button' },
|
|
1798
|
+
namedDefaults: {
|
|
1799
|
+
by: ['href'],
|
|
1800
|
+
defaults: { tabIndex: '0' },
|
|
1801
|
+
what: 'an `href`',
|
|
1802
|
+
emptyCounts: true,
|
|
1803
|
+
},
|
|
1791
1804
|
omits: {
|
|
1792
1805
|
'is-disabled': '`disabled` also writes `aria-disabled` and `tabIndex="-1"`',
|
|
1793
1806
|
},
|
|
@@ -1796,6 +1809,7 @@ export const ROOTS = {
|
|
|
1796
1809
|
// A page link and the ellipsis each render the bare `<li>` around them, so
|
|
1797
1810
|
// each converts in its `<li>`'s place. A link writes `tabIndex` before the
|
|
1798
1811
|
// props it's given, and `active` writes `aria-current="page"` the same way.
|
|
1812
|
+
// Without an `href` it's a button, and writes `role="button"` too.
|
|
1799
1813
|
'pagination-link': {
|
|
1800
1814
|
...BASE,
|
|
1801
1815
|
target: 'Pagination.Link',
|
|
@@ -1807,7 +1821,13 @@ export const ROOTS = {
|
|
|
1807
1821
|
needsAttr: { name: 'aria-current', value: 'page' },
|
|
1808
1822
|
},
|
|
1809
1823
|
},
|
|
1810
|
-
defaults: { tabIndex: '0' },
|
|
1824
|
+
defaults: { tabIndex: '0', role: 'button' },
|
|
1825
|
+
namedDefaults: {
|
|
1826
|
+
by: ['href'],
|
|
1827
|
+
defaults: { tabIndex: '0' },
|
|
1828
|
+
what: 'an `href`',
|
|
1829
|
+
emptyCounts: true,
|
|
1830
|
+
},
|
|
1811
1831
|
omits: {
|
|
1812
1832
|
'is-disabled': '`disabled` also writes `aria-disabled` and `tabIndex="-1"`',
|
|
1813
1833
|
},
|
|
@@ -1868,7 +1888,15 @@ export const ROOTS = {
|
|
|
1868
1888
|
textColor: null,
|
|
1869
1889
|
bgColor: null,
|
|
1870
1890
|
noHelpers: true,
|
|
1871
|
-
|
|
1891
|
+
// `active` writes `aria-current="page"` unless the block has its own, the
|
|
1892
|
+
// way `Navbar.Item` does, so `is-active` converts only beside one and
|
|
1893
|
+
// stays a class otherwise.
|
|
1894
|
+
modifiers: {
|
|
1895
|
+
'is-active': {
|
|
1896
|
+
writes: [{ prop: 'active' }],
|
|
1897
|
+
needsAttr: { name: 'aria-current', value: 'page' },
|
|
1898
|
+
},
|
|
1899
|
+
},
|
|
1872
1900
|
// The anchor attributes, and `rel`, reach only an <a>, and the label's
|
|
1873
1901
|
// only a <label> (`STRIP_FROM_NON_ANCHOR` and `STRIP_FROM_NON_LABEL` in
|
|
1874
1902
|
// bulma-ui's Panel.tsx).
|
|
@@ -560,13 +560,16 @@ function planElement(facts) {
|
|
|
560
560
|
if (counts && !counted) {
|
|
561
561
|
return refuse('children', target, `bestax \`${target}\` renders this element's children itself, \`${counts.prop}\` bare, empty <${counts.tag}>s, so it converts only when its children are just that; keep it as markup`);
|
|
562
562
|
}
|
|
563
|
-
|
|
563
|
+
// An attribute the target writes alike with a name and without one is no
|
|
564
|
+
// question of the name, so the plain TODO below asks for it.
|
|
565
|
+
const varies = ([name]) => entry.namedDefaults?.defaults[name] !== entry.defaults?.[name];
|
|
566
|
+
if (naming === 'unsure' && missing.some(varies)) {
|
|
564
567
|
const list = (set = {}) => Object.entries(set)
|
|
565
568
|
.map(([name, value]) => `\`${name}="${value}"\``)
|
|
566
569
|
.join(' and ');
|
|
567
570
|
const by = entry.namedDefaults.by.find(name => attributes.has(name));
|
|
568
571
|
const add = missing.map(([name]) => `\`${name}\``).join(' and ');
|
|
569
|
-
return refuse('defaults', target, `bestax \`${target}\` renders ${list(entry.namedDefaults.defaults)} when it has a name and ${list(entry.defaults)} when it has none, and this element's \`${by}\` is an expression that may render as either; set ${add} here to what you want
|
|
572
|
+
return refuse('defaults', target, `bestax \`${target}\` renders ${list(entry.namedDefaults.defaults)} when it has ${entry.namedDefaults.what ?? 'a name'} and ${list(entry.defaults)} when it has none, and this element's \`${by}\` is an expression that may render as either; set ${add} here to what you want and re-run, or convert it by hand`);
|
|
570
573
|
}
|
|
571
574
|
if (missing.length > 0) {
|
|
572
575
|
const list = missing.map(([name, value]) => `\`${name}="${value}"\``);
|
|
@@ -794,14 +797,16 @@ function buildFile(children, entry, hasName) {
|
|
|
794
797
|
/**
|
|
795
798
|
* Whether the element names itself through one of `entry.namedDefaults.by`,
|
|
796
799
|
* which picks the defaults its target renders: a string written out names
|
|
797
|
-
* it unless empty
|
|
798
|
-
* not. An entry with no `namedDefaults`
|
|
800
|
+
* it unless empty (or even then, with `emptyCounts`), as a bare attribute
|
|
801
|
+
* does, and an expression may or may not. An entry with no `namedDefaults`
|
|
802
|
+
* is never named.
|
|
799
803
|
*/
|
|
800
804
|
function namingOf(entry, attributes) {
|
|
801
805
|
const given = (entry.namedDefaults?.by ?? [])
|
|
802
806
|
.filter(name => attributes.has(name))
|
|
803
807
|
.map(name => attributes.get(name));
|
|
804
|
-
|
|
808
|
+
const emptyCounts = entry.namedDefaults?.emptyCounts ?? false;
|
|
809
|
+
if (given.some(value => value === true || (value !== null && (value !== '' || emptyCounts)))) {
|
|
805
810
|
return 'named';
|
|
806
811
|
}
|
|
807
812
|
return given.includes(null) ? 'unsure' : 'unnamed';
|
|
@@ -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;AAQ3C,OAAO,
|
|
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;AAQ3C,OAAO,EAWL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAeL,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EAAE,aAAa,EAAE,CAAC;AAq8B9B,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,EAClB,OAAO,EAAE,GAAG,GACX,aAAa,CAIf"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* element `replaced` when it substituted the node itself.
|
|
15
15
|
*/
|
|
16
16
|
import { BADGE_PROPS, RESPONSIVE_BREAKPOINTS, resolveMapping, TOOLTIP_PROPS, UNIVERSAL_PROPS, } from './mapping.js';
|
|
17
|
-
import { addAttr, addTodo,
|
|
17
|
+
import { addAttr, addTodo, attributesOf, findAttr, jsxNameParts, literalValueOf, makeAttr, plainElement, removeAttr, resolveBooleanish, } from '../_shared/jsx-utils.js';
|
|
18
18
|
import { alignTarget, applyIconProps, dropLinkAttrsForPlainTag, FIELD_SCOPED, flagDroppedHeading, keepTitleLevel, makeStripModifierProps, makeStructuralHelpers, mergeClassName, modifierClass, parseIconClasses, plainTag, restrictAsToTargets, } from '../_shared/specials-utils.js';
|
|
19
19
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
20
20
|
const stripModifierProps = makeStripModifierProps(UNIVERSAL_PROPS, RESPONSIVE_BREAKPOINTS, 'innerRef');
|
|
@@ -701,9 +701,11 @@ const SPECIALS = {
|
|
|
701
701
|
},
|
|
702
702
|
/**
|
|
703
703
|
* rbx's `Tab.Group` renders `div.tabs > ul > li`; bestax's `Tabs` renders
|
|
704
|
-
* only the `div.tabs
|
|
705
|
-
*
|
|
706
|
-
*
|
|
704
|
+
* only the `div.tabs`. Renaming straight across put the `<li>` items
|
|
705
|
+
* directly inside the div, which is not valid Bulma tabs markup, so the
|
|
706
|
+
* children go in a plain `<ul>`. Not a `Tabs.List`: it renders
|
|
707
|
+
* `role="tablist"`, which the migrated `Tabs.Item`s are not the tabs of
|
|
708
|
+
* (#1961). A `.List` the caller already put there is left alone.
|
|
707
709
|
*/
|
|
708
710
|
'tab-group'(ctx, _path, element) {
|
|
709
711
|
const children = element.children ?? [];
|
|
@@ -714,11 +716,7 @@ const SPECIALS = {
|
|
|
714
716
|
/(^|\.)List$/.test((jsxNameParts(solid[0].openingElement?.name) ?? []).join('.'));
|
|
715
717
|
if (solid.length === 0 || alreadyList)
|
|
716
718
|
return { target: 'Tabs' };
|
|
717
|
-
|
|
718
|
-
const listName = `${local}.List`;
|
|
719
|
-
element.children = [
|
|
720
|
-
ctx.j.jsxElement(ctx.j.jsxOpeningElement(buildJsxName(ctx.j, listName), [], false), ctx.j.jsxClosingElement(buildJsxName(ctx.j, listName)), children),
|
|
721
|
-
];
|
|
719
|
+
element.children = [plainElement(ctx.j, 'ul', undefined, [], children)];
|
|
722
720
|
ctx.dirty = true;
|
|
723
721
|
return { target: 'Tabs' };
|
|
724
722
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specials.d.ts","sourceRoot":"","sources":["../../../src/sources/react-bulma-components/specials.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAWL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAYL,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EAAE,aAAa,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"specials.d.ts","sourceRoot":"","sources":["../../../src/sources/react-bulma-components/specials.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAWL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAYL,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EAAE,aAAa,EAAE,CAAC;AA86B9B,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,EAClB,OAAO,EAAE,GAAG,GACX,aAAa,CAIf;AAED,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,QAAQ,CAGjE,CAAC"}
|
|
@@ -643,16 +643,19 @@ const SPECIALS = {
|
|
|
643
643
|
ctx.dirty = true;
|
|
644
644
|
return {};
|
|
645
645
|
},
|
|
646
|
-
/**
|
|
646
|
+
/**
|
|
647
|
+
* RBC's Tabs renders `div.tabs > ul` around its children, and bestax's
|
|
648
|
+
* renders only the `div.tabs`, so the children go in a plain `<ul>`.
|
|
649
|
+
* Not a `Tabs.List`: it renders `role="tablist"`, which the migrated
|
|
650
|
+
* `Tabs.Item`s, plain `<li>`s, are not the tabs of (#1961).
|
|
651
|
+
*/
|
|
647
652
|
tabs(ctx, _path, element) {
|
|
648
653
|
const children = element.children ?? [];
|
|
649
654
|
const hasContent = children.some((c) => c.type !== 'JSXText' || c.value.trim() !== '');
|
|
650
655
|
if (!hasContent)
|
|
651
656
|
return {};
|
|
652
657
|
const j = ctx.j;
|
|
653
|
-
const
|
|
654
|
-
const listName = () => j.jsxMemberExpression(j.jsxIdentifier(tabsLocal), j.jsxIdentifier('List'));
|
|
655
|
-
const list = j.jsxElement(j.jsxOpeningElement(listName(), []), j.jsxClosingElement(listName()), children);
|
|
658
|
+
const list = plainElement(j, 'ul', undefined, [], children);
|
|
656
659
|
element.children = [j.jsxText('\n'), list, j.jsxText('\n')];
|
|
657
660
|
ctx.dirty = true;
|
|
658
661
|
return {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bestax-migrate",
|
|
3
|
-
"version": "2.38.
|
|
3
|
+
"version": "2.38.2",
|
|
4
4
|
"description": "Codemods for migrating existing React apps from other Bulma libraries to @allxsmith/bestax-bulma",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"jscodeshift": "^17.3.0",
|
|
41
41
|
"parse5": "^8.1.1",
|
|
42
42
|
"property-information": "^7.2.0",
|
|
43
|
-
"@allxsmith/bestax-bulma": "^5.
|
|
43
|
+
"@allxsmith/bestax-bulma": "^5.73.7"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/jscodeshift": "^17.3.0",
|