@carto/ps-react-ui 5.3.0 → 6.1.0
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/actions-BWlS5tpP.js +1150 -0
- package/dist/actions-BWlS5tpP.js.map +1 -0
- package/dist/category-alzjKzvQ.js +839 -0
- package/dist/category-alzjKzvQ.js.map +1 -0
- package/dist/chat.js +548 -526
- package/dist/chat.js.map +1 -1
- package/dist/{components-FED-ArwH.js → components-CTUpdQuj.js} +1526 -1782
- package/dist/components-CTUpdQuj.js.map +1 -0
- package/dist/components.js +4 -5
- package/dist/{download-DGgFOaXj.js → download-B4sykOFm.js} +33 -23
- package/dist/download-B4sykOFm.js.map +1 -0
- package/dist/{echart-CwzbPElc.js → echart-CV8F50gn.js} +9 -9
- package/dist/echart-CV8F50gn.js.map +1 -0
- package/dist/formula-DJS-JLpk.js +276 -0
- package/dist/formula-DJS-JLpk.js.map +1 -0
- package/dist/legend.js +263 -258
- package/dist/legend.js.map +1 -1
- package/dist/{markdown-oo9mnJun.js → markdown-Bn2nKCbn.js} +13 -19
- package/dist/markdown-Bn2nKCbn.js.map +1 -0
- package/dist/{markdown-content-BWUqwx9F.js → markdown-content-kYNLOX0T.js} +2 -2
- package/dist/markdown-content-kYNLOX0T.js.map +1 -0
- package/dist/{chart-config-B_fdIcD3.js → option-builders-DQivvvbb.js} +10 -56
- package/dist/option-builders-DQivvvbb.js.map +1 -0
- package/dist/{range-BCMAl5xf.js → range-BpU2zBmq.js} +8 -8
- package/dist/range-BpU2zBmq.js.map +1 -0
- package/dist/smart-tooltip-Dc_rHhyI.js +51 -0
- package/dist/smart-tooltip-Dc_rHhyI.js.map +1 -0
- package/dist/{spread-CgCTKPQD.js → spread-CQwFIwuz.js} +12 -18
- package/dist/spread-CQwFIwuz.js.map +1 -0
- package/dist/{stores-tiFePP0A.js → stores-DcBOZlU3.js} +40 -34
- package/dist/stores-DcBOZlU3.js.map +1 -0
- package/dist/stores-mad-9yFn.js.map +1 -1
- package/dist/styles-BCEBm7xh.js +146 -0
- package/dist/styles-BCEBm7xh.js.map +1 -0
- package/dist/{table-lb5momun.js → table-DEdW_fDj.js} +17 -23
- package/dist/table-DEdW_fDj.js.map +1 -0
- package/dist/types/chat/bubbles/chat-suggestion-button.d.ts +1 -1
- package/dist/types/chat/types.d.ts +5 -2
- package/dist/types/components/index.d.ts +1 -3
- package/dist/types/components/lasso-tool/geometry-toolbar.d.ts +1 -1
- package/dist/types/components/lasso-tool/toolbar/context.d.ts +1 -1
- package/dist/types/components/types.d.ts +15 -0
- package/dist/types/legend/components/legend-actions/legend-actions.d.ts +2 -2
- package/dist/types/legend/components/legend-swatch/legend-swatch.d.ts +2 -1
- package/dist/types/legend/index.d.ts +1 -1
- package/dist/types/legend/provider/legend-provider.d.ts +2 -2
- package/dist/types/migration/v4/classes.d.ts +16 -0
- package/dist/types/migration/v4/icons.d.ts +31 -0
- package/dist/types/migration/v4/index.d.ts +17 -0
- package/dist/types/migration/v4/rules.d.ts +42 -0
- package/dist/types/migration/v4/transform.d.ts +4 -0
- package/dist/types/migration/v4/transforms/helpers.d.ts +97 -0
- package/dist/types/migration/v4/transforms/meridian-5.d.ts +22 -0
- package/dist/types/migration/v4/transforms/ps-react-ui.d.ts +20 -0
- package/dist/types/migration/v4/transforms/v5-v6.d.ts +27 -0
- package/dist/types/migration/v4/transforms/v6-v7.d.ts +54 -0
- package/dist/types/migration/v4/transforms/v7-v9-dom.d.ts +63 -0
- package/dist/types/migration/v4/transforms/v7-v9-props.d.ts +64 -0
- package/dist/types/migration/v4/widgets-v1.d.ts +12 -0
- package/dist/types/widgets/actions/brush-toggle/brush-toggle.d.ts +51 -24
- package/dist/types/widgets/actions/brush-toggle/style.d.ts +7 -16
- package/dist/types/widgets/actions/change-column/change-column-icon.d.ts +2 -1
- package/dist/types/widgets/actions/change-column/change-column.d.ts +26 -17
- package/dist/types/widgets/actions/change-column/sortable-column-item.d.ts +10 -5
- package/dist/types/widgets/actions/change-column/types.d.ts +9 -18
- package/dist/types/widgets/actions/download/download.d.ts +18 -13
- package/dist/types/widgets/actions/download/exports.d.ts +33 -17
- package/dist/types/{widgets-v2 → widgets}/actions/download/index.d.ts +1 -0
- package/dist/types/{widgets-v2 → widgets}/actions/download/png-item.d.ts +1 -1
- package/dist/types/widgets/actions/download/types.d.ts +41 -16
- package/dist/types/widgets/actions/download/widget-download.d.ts +26 -0
- package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +80 -10
- package/dist/types/widgets/actions/fullscreen/types.d.ts +13 -20
- package/dist/types/widgets/actions/index.d.ts +10 -20
- package/dist/types/widgets/actions/lock-selection/lock-selection.d.ts +54 -16
- package/dist/types/widgets/actions/relative-data/relative-data.d.ts +36 -21
- package/dist/types/{widgets-v2 → widgets}/actions/relative-data/transforms.d.ts +2 -2
- package/dist/types/widgets/actions/searcher/searcher-toggle.d.ts +24 -16
- package/dist/types/widgets/actions/searcher/searcher.d.ts +9 -19
- package/dist/types/widgets/actions/stack-toggle/stack-toggle.d.ts +10 -17
- package/dist/types/widgets/actions/zoom-toggle/style.d.ts +7 -8
- package/dist/types/widgets/actions/zoom-toggle/zoom-toggle.d.ts +31 -22
- package/dist/types/widgets/bar/download.d.ts +10 -0
- package/dist/types/widgets/bar/index.d.ts +3 -2
- package/dist/types/widgets/bar/skeleton.d.ts +5 -0
- package/dist/types/widgets/bar/types.d.ts +46 -9
- package/dist/types/widgets/category/category-ui.d.ts +94 -3
- package/dist/types/{widgets-v2 → widgets}/category/components/category-bar-stacked.d.ts +2 -1
- package/dist/types/widgets/category/components/category-bar.d.ts +18 -4
- package/dist/types/widgets/category/components/category-legend.d.ts +30 -4
- package/dist/types/widgets/category/components/category-row-multi.d.ts +27 -10
- package/dist/types/widgets/category/components/category-row-other.d.ts +19 -2
- package/dist/types/widgets/category/components/category-row-single.d.ts +23 -9
- package/dist/types/{widgets-v2 → widgets}/category/components/category-row-stacked.d.ts +2 -1
- package/dist/types/widgets/category/download.d.ts +11 -0
- package/dist/types/widgets/category/helpers.d.ts +10 -0
- package/dist/types/widgets/category/index.d.ts +10 -14
- package/dist/types/widgets/category/skeleton.d.ts +11 -1
- package/dist/types/widgets/category/style.d.ts +155 -83
- package/dist/types/widgets/category/types.d.ts +49 -29
- package/dist/types/widgets/echart/echart-ui.d.ts +44 -9
- package/dist/types/widgets/echart/echart.d.ts +80 -5
- package/dist/types/widgets/echart/index.d.ts +4 -5
- package/dist/types/widgets/echart/shared-resize-observer.d.ts +2 -9
- package/dist/types/widgets/formula/download.d.ts +10 -0
- package/dist/types/widgets/formula/formula-ui.d.ts +18 -3
- package/dist/types/widgets/formula/index.d.ts +11 -11
- package/dist/types/{widgets-v2 → widgets}/formula/series.d.ts +2 -1
- package/dist/types/widgets/formula/skeleton.d.ts +4 -1
- package/dist/types/widgets/formula/style.d.ts +20 -12
- package/dist/types/widgets/formula/types.d.ts +41 -39
- package/dist/types/{widgets-v2 → widgets}/formula/value.d.ts +2 -1
- package/dist/types/widgets/histogram/download.d.ts +12 -0
- package/dist/types/widgets/histogram/index.d.ts +5 -4
- package/dist/types/widgets/histogram/skeleton.d.ts +9 -1
- package/dist/types/widgets/histogram/types.d.ts +60 -12
- package/dist/types/{widgets-v2 → widgets}/index.d.ts +2 -2
- package/dist/types/widgets/markdown/download.d.ts +10 -0
- package/dist/types/widgets/markdown/index.d.ts +5 -4
- package/dist/types/widgets/markdown/markdown-ui.d.ts +10 -7
- package/dist/types/widgets/markdown/markdown.d.ts +4 -3
- package/dist/types/widgets/markdown/skeleton.d.ts +4 -1
- package/dist/types/widgets/markdown/style.d.ts +61 -2
- package/dist/types/widgets/markdown/types.d.ts +2 -16
- package/dist/types/widgets/note/style.d.ts +14 -16
- package/dist/types/widgets/pie/download.d.ts +12 -0
- package/dist/types/widgets/pie/index.d.ts +4 -3
- package/dist/types/widgets/pie/skeleton.d.ts +13 -1
- package/dist/types/widgets/pie/types.d.ts +57 -9
- package/dist/types/widgets/range/index.d.ts +4 -6
- package/dist/types/widgets/range/range-ui.d.ts +25 -3
- package/dist/types/widgets/range/skeleton.d.ts +9 -1
- package/dist/types/widgets/range/style.d.ts +40 -2
- package/dist/types/widgets/range/types.d.ts +26 -22
- package/dist/types/widgets/scatterplot/download.d.ts +11 -0
- package/dist/types/widgets/scatterplot/index.d.ts +5 -3
- package/dist/types/widgets/scatterplot/skeleton.d.ts +12 -1
- package/dist/types/widgets/scatterplot/types.d.ts +54 -9
- package/dist/types/widgets/selection-summary/selection-summary.d.ts +26 -10
- package/dist/types/widgets/selection-summary/style.d.ts +32 -3
- package/dist/types/widgets/spread/download.d.ts +9 -0
- package/dist/types/widgets/spread/index.d.ts +7 -9
- package/dist/types/widgets/spread/skeleton.d.ts +9 -1
- package/dist/types/widgets/spread/spread-ui.d.ts +16 -3
- package/dist/types/widgets/spread/types.d.ts +20 -35
- package/dist/types/widgets/stores/index.d.ts +8 -3
- package/dist/types/widgets/stores/types.d.ts +45 -172
- package/dist/types/{widgets-v2 → widgets}/stores/widget-store-registry.d.ts +14 -0
- package/dist/types/widgets/subheader/style.d.ts +5 -14
- package/dist/types/widgets/subheader/subheader.d.ts +9 -11
- package/dist/types/widgets/table/download.d.ts +12 -0
- package/dist/types/widgets/table/helpers.d.ts +28 -34
- package/dist/types/widgets/table/index.d.ts +8 -17
- package/dist/types/widgets/table/skeleton.d.ts +17 -5
- package/dist/types/widgets/table/style.d.ts +21 -14
- package/dist/types/widgets/table/table-ui.d.ts +41 -29
- package/dist/types/widgets/table/types.d.ts +34 -182
- package/dist/types/widgets/timeseries/download.d.ts +12 -0
- package/dist/types/widgets/timeseries/index.d.ts +4 -2
- package/dist/types/widgets/timeseries/skeleton.d.ts +7 -0
- package/dist/types/widgets/timeseries/types.d.ts +60 -9
- package/dist/types/{widgets-v2 → widgets}/types.d.ts +7 -6
- package/dist/types/widgets/utils/index.d.ts +3 -7
- package/dist/types/widgets/wrapper/index.d.ts +4 -6
- package/dist/types/{widgets-v2 → widgets}/wrapper/style.d.ts +2 -31
- package/dist/types/{widgets-v2 → widgets}/wrapper/widget-actions.d.ts +2 -2
- package/dist/types/{widgets-v2 → widgets}/wrapper/widget-wrapper.d.ts +2 -2
- package/dist/{utils-Dr6gf3vD.js → utils-C-eWwOhE.js} +5 -5
- package/dist/utils-C-eWwOhE.js.map +1 -0
- package/dist/widgets/actions.js +4 -2
- package/dist/widgets/bar.js +196 -132
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/category.js +2 -450
- package/dist/widgets/echart.js +2 -3
- package/dist/widgets/formula.js +2 -3
- package/dist/widgets/histogram.js +257 -160
- package/dist/widgets/histogram.js.map +1 -1
- package/dist/widgets/markdown.js +3 -148
- package/dist/widgets/pie.js +311 -197
- package/dist/widgets/pie.js.map +1 -1
- package/dist/widgets/range.js +2 -233
- package/dist/widgets/scatterplot.js +294 -196
- package/dist/widgets/scatterplot.js.map +1 -1
- package/dist/widgets/spread.js +2 -158
- package/dist/widgets/stores.js +2 -3
- package/dist/widgets/table.js +2 -599
- package/dist/widgets/timeseries.js +244 -136
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets/utils.js +2 -18
- package/dist/widgets.js +911 -0
- package/dist/widgets.js.map +1 -0
- package/dist/{zoom-toggle-IsF8BnAp.js → zoom-toggle-MmLjMTEw.js} +5 -5
- package/dist/zoom-toggle-MmLjMTEw.js.map +1 -0
- package/package.json +43 -129
- package/src/chat/bubbles/chat-agent-message-markdown.tsx +1 -1
- package/src/chat/bubbles/chat-error-message.tsx +9 -3
- package/src/chat/bubbles/chat-suggestion-button.tsx +8 -3
- package/src/chat/containers/chat-footer.tsx +6 -2
- package/src/chat/containers/chat-starter.tsx +6 -4
- package/src/chat/feedback/chat-tool-full-view-dialog.tsx +3 -1
- package/src/chat/feedback/chat-tool-group.test.tsx +1 -1
- package/src/chat/feedback/chat-tool-group.tsx +40 -9
- package/src/chat/feedback/chat-tool-trace.tsx +55 -19
- package/src/chat/types.ts +5 -2
- package/src/components/basemaps/header.tsx +6 -1
- package/src/components/index.ts +2 -3
- package/src/components/lasso-tool/geometry-toolbar.tsx +1 -1
- package/src/components/lasso-tool/lasso-tool-inline.tsx +12 -4
- package/src/components/lasso-tool/lasso-tool.tsx +26 -15
- package/src/components/lasso-tool/layer-filters.tsx +36 -11
- package/src/components/lasso-tool/options-sections.test.tsx +13 -2
- package/src/components/lasso-tool/options-sections.tsx +17 -7
- package/src/components/lasso-tool/toolbar/connected.tsx +1 -1
- package/src/components/lasso-tool/toolbar/context.tsx +1 -1
- package/src/components/measurement-tools/measurement-tools.tsx +28 -13
- package/src/components/no-data-alert/no-data-alert.tsx +12 -2
- package/src/components/responsive-drawer/responsive-drawer.tsx +0 -1
- package/src/components/types.ts +17 -0
- package/src/components/zoom-controls/zoom-controls.tsx +3 -1
- package/src/legend/components/legend-actions/legend-actions.tsx +2 -2
- package/src/legend/components/legend-category/legend-category-ui.tsx +7 -3
- package/src/legend/components/legend-config-select/legend-config-select.tsx +6 -2
- package/src/legend/components/legend-group/legend-group.tsx +6 -2
- package/src/legend/components/legend-group/styles.ts +1 -1
- package/src/legend/components/legend-icon/legend-icon-ui.tsx +7 -3
- package/src/legend/components/legend-opacity/legend-opacity.tsx +9 -3
- package/src/legend/components/legend-proportion/legend-proportion-ui.tsx +19 -3
- package/src/legend/components/legend-ramp/legend-ramp-ui.tsx +31 -7
- package/src/legend/components/legend-row/legend-row.tsx +2 -2
- package/src/legend/components/legend-row/styles.ts +1 -1
- package/src/legend/components/legend-sortable/legend-sortable.tsx +7 -3
- package/src/legend/components/legend-swatch/legend-swatch.tsx +2 -1
- package/src/legend/components/legend-visible-layers/legend-visible-layers.tsx +18 -9
- package/src/legend/index.ts +1 -1
- package/src/legend/provider/legend-provider.tsx +2 -2
- package/src/legend/stores/legend-store-registry.ts +1 -1
- package/src/migration/v4/classes.ts +56 -0
- package/src/migration/v4/icons.ts +56 -0
- package/src/migration/v4/index.ts +17 -0
- package/src/migration/v4/migration.test.ts +772 -0
- package/src/migration/v4/rules.ts +444 -0
- package/src/migration/v4/transform.ts +92 -0
- package/src/migration/v4/transforms/helpers.ts +369 -0
- package/src/migration/v4/transforms/meridian-5.ts +163 -0
- package/src/migration/v4/transforms/ps-react-ui.ts +99 -0
- package/src/migration/v4/transforms/v5-v6.ts +161 -0
- package/src/migration/v4/transforms/v6-v7.ts +342 -0
- package/src/migration/v4/transforms/v7-v9-dom.ts +403 -0
- package/src/migration/v4/transforms/v7-v9-props.ts +529 -0
- package/src/migration/v4/widgets-v1.ts +199 -0
- package/src/{widgets-v2 → widgets}/PERFORMANCE.md +5 -5
- package/src/widgets/actions/brush-toggle/brush-toggle.test.tsx +144 -172
- package/src/widgets/actions/brush-toggle/brush-toggle.tsx +129 -108
- package/src/widgets/actions/brush-toggle/style.ts +5 -40
- package/src/widgets/actions/change-column/change-column-icon.tsx +14 -10
- package/src/widgets/actions/change-column/change-column.test.tsx +57 -288
- package/src/widgets/actions/change-column/change-column.tsx +116 -145
- package/src/widgets/actions/change-column/sortable-column-item.tsx +29 -17
- package/src/widgets/actions/change-column/types.ts +9 -18
- package/src/widgets/actions/download/download.test.tsx +290 -289
- package/src/widgets/actions/download/download.tsx +103 -89
- package/src/widgets/actions/download/exports.test.tsx +157 -247
- package/src/{widgets-v2 → widgets}/actions/download/exports.ts +1 -1
- package/src/{widgets-v2 → widgets}/actions/download/index.ts +1 -0
- package/src/{widgets-v2 → widgets}/actions/download/png-item.tsx +2 -2
- package/src/widgets/actions/download/types.ts +40 -15
- package/src/widgets/actions/download/widget-download.test.ts +30 -0
- package/src/widgets/actions/download/widget-download.ts +41 -0
- package/src/widgets/actions/fullscreen/fullscreen.test.tsx +162 -221
- package/src/widgets/actions/fullscreen/fullscreen.tsx +383 -76
- package/src/widgets/actions/fullscreen/types.ts +14 -31
- package/src/widgets/actions/index.ts +93 -68
- package/src/widgets/actions/lock-selection/lock-selection.test.tsx +259 -156
- package/src/widgets/actions/lock-selection/lock-selection.tsx +162 -102
- package/src/widgets/actions/relative-data/relative-data.test.tsx +65 -536
- package/src/widgets/actions/relative-data/relative-data.tsx +82 -163
- package/src/{widgets-v2 → widgets}/actions/relative-data/transforms.ts +2 -2
- package/src/widgets/actions/searcher/searcher-toggle.tsx +82 -55
- package/src/widgets/actions/searcher/searcher.tsx +96 -169
- package/src/widgets/actions/stack-toggle/stack-toggle.test.tsx +49 -402
- package/src/widgets/actions/stack-toggle/stack-toggle.tsx +39 -114
- package/src/widgets/actions/zoom-toggle/style.ts +5 -8
- package/src/widgets/actions/zoom-toggle/zoom-toggle.test.tsx +88 -303
- package/src/widgets/actions/zoom-toggle/zoom-toggle.tsx +87 -199
- package/src/widgets/bar/download.tsx +36 -0
- package/src/widgets/bar/index.ts +6 -5
- package/src/{widgets-v2 → widgets}/bar/options.ts +1 -1
- package/src/widgets/bar/skeleton.tsx +61 -52
- package/src/widgets/bar/types.ts +46 -11
- package/src/widgets/category/category-ui.test.tsx +846 -317
- package/src/widgets/category/category-ui.tsx +456 -127
- package/src/{widgets-v2 → widgets}/category/category.tsx +4 -4
- package/src/{widgets-v2 → widgets}/category/components/category-bar-stacked.tsx +2 -1
- package/src/widgets/category/components/category-bar.tsx +31 -12
- package/src/{widgets-v2 → widgets}/category/components/category-legend.test.tsx +7 -3
- package/src/widgets/category/components/category-legend.tsx +67 -18
- package/src/widgets/category/components/category-row-multi.tsx +66 -36
- package/src/widgets/category/components/category-row-other.tsx +63 -5
- package/src/widgets/category/components/category-row-single.tsx +48 -25
- package/src/{widgets-v2 → widgets}/category/components/category-row-stacked.tsx +2 -1
- package/src/widgets/category/download.ts +37 -0
- package/src/widgets/category/helpers.test.ts +17 -0
- package/src/widgets/category/helpers.ts +16 -0
- package/src/widgets/category/index.ts +25 -22
- package/src/widgets/category/skeleton.tsx +60 -10
- package/src/widgets/category/style.ts +267 -72
- package/src/widgets/category/types.ts +52 -32
- package/src/widgets/echart/echart-ui.test.tsx +250 -446
- package/src/widgets/echart/echart-ui.tsx +210 -52
- package/src/widgets/echart/echart.test.tsx +203 -518
- package/src/widgets/echart/echart.tsx +195 -52
- package/src/widgets/echart/index.ts +21 -15
- package/src/widgets/echart/shared-resize-observer.ts +30 -19
- package/src/{widgets-v2 → widgets}/echart/style.ts +3 -3
- package/src/{widgets-v2 → widgets}/formula/download.tsx +8 -29
- package/src/widgets/formula/formula-ui.test.tsx +68 -376
- package/src/widgets/formula/formula-ui.tsx +58 -22
- package/src/widgets/formula/index.ts +14 -21
- package/src/{widgets-v2 → widgets}/formula/note.tsx +8 -2
- package/src/{widgets-v2 → widgets}/formula/series.tsx +8 -25
- package/src/widgets/formula/skeleton.tsx +21 -4
- package/src/widgets/formula/style.ts +20 -12
- package/src/widgets/formula/types.ts +44 -45
- package/src/{widgets-v2 → widgets}/formula/value.tsx +2 -1
- package/src/{widgets-v2 → widgets}/histogram/download.ts +11 -25
- package/src/widgets/histogram/index.ts +10 -10
- package/src/{widgets-v2 → widgets}/histogram/options.ts +1 -1
- package/src/widgets/histogram/skeleton.tsx +63 -45
- package/src/widgets/histogram/types.ts +59 -18
- package/src/{widgets-v2 → widgets}/index.ts +3 -3
- package/src/{widgets-v2 → widgets}/markdown/download.tsx +9 -25
- package/src/widgets/markdown/index.ts +5 -13
- package/src/widgets/markdown/markdown-ui.test.tsx +53 -319
- package/src/widgets/markdown/markdown-ui.tsx +43 -47
- package/src/widgets/markdown/markdown.tsx +12 -15
- package/src/widgets/markdown/skeleton.tsx +26 -6
- package/src/widgets/markdown/style.ts +48 -23
- package/src/widgets/markdown/types.ts +2 -26
- package/src/widgets/note/style.ts +14 -17
- package/src/{widgets-v2 → widgets}/note/widget-note.tsx +15 -2
- package/src/{widgets-v2 → widgets}/pie/download.ts +10 -24
- package/src/widgets/pie/index.ts +7 -5
- package/src/{widgets-v2 → widgets}/pie/options.ts +1 -1
- package/src/widgets/pie/skeleton.tsx +84 -60
- package/src/widgets/pie/types.ts +57 -11
- package/src/widgets/range/index.ts +4 -16
- package/src/widgets/range/range-ui.test.tsx +115 -182
- package/src/widgets/range/range-ui.tsx +274 -8
- package/src/widgets/range/skeleton.tsx +41 -8
- package/src/widgets/range/style.ts +16 -12
- package/src/widgets/range/types.ts +26 -28
- package/src/widgets/scatterplot/download.ts +37 -0
- package/src/widgets/scatterplot/index.ts +11 -5
- package/src/{widgets-v2 → widgets}/scatterplot/options.ts +1 -1
- package/src/widgets/scatterplot/skeleton.tsx +76 -51
- package/src/widgets/scatterplot/types.ts +54 -12
- package/src/widgets/selection-summary/selection-summary.tsx +64 -39
- package/src/widgets/selection-summary/style.ts +30 -2
- package/src/widgets/spread/download.ts +41 -0
- package/src/widgets/spread/index.ts +11 -23
- package/src/widgets/spread/skeleton.tsx +32 -4
- package/src/widgets/spread/spread-ui.test.tsx +98 -358
- package/src/widgets/spread/spread-ui.tsx +44 -24
- package/src/widgets/spread/types.ts +21 -41
- package/src/{widgets-v2 → widgets}/state/widget-state.tsx +13 -3
- package/src/widgets/stores/index.ts +48 -10
- package/src/{widgets-v2 → widgets}/stores/transforms.ts +1 -1
- package/src/widgets/stores/types.ts +42 -181
- package/src/{widgets-v2 → widgets}/stores/use-transform.ts +1 -1
- package/src/{widgets-v2 → widgets}/stores/widget-store-registry.test.ts +25 -0
- package/src/{widgets-v2 → widgets}/stores/widget-store-registry.ts +24 -2
- package/src/widgets/subheader/style.ts +5 -13
- package/src/widgets/subheader/subheader.test.tsx +22 -37
- package/src/widgets/subheader/subheader.tsx +11 -30
- package/src/widgets/table/download.ts +29 -0
- package/src/widgets/table/helpers.test.ts +197 -208
- package/src/widgets/table/helpers.ts +108 -84
- package/src/widgets/table/index.ts +23 -54
- package/src/widgets/table/skeleton.tsx +38 -21
- package/src/widgets/table/style.ts +23 -14
- package/src/widgets/table/table-ui.tsx +348 -44
- package/src/widgets/table/types.ts +37 -205
- package/src/{widgets-v2 → widgets}/test-utils.ts +1 -1
- package/src/{widgets-v2 → widgets}/timeseries/download.ts +14 -28
- package/src/widgets/timeseries/index.ts +8 -5
- package/src/{widgets-v2 → widgets}/timeseries/options.ts +1 -1
- package/src/widgets/timeseries/skeleton.tsx +67 -46
- package/src/widgets/timeseries/types.ts +60 -12
- package/src/{widgets-v2 → widgets}/types.ts +8 -6
- package/src/widgets/utils/index.ts +3 -26
- package/src/widgets/wrapper/index.ts +14 -16
- package/src/{widgets-v2 → widgets}/wrapper/style.ts +2 -38
- package/src/{widgets-v2 → widgets}/wrapper/widget-actions.tsx +2 -2
- package/src/{widgets-v2 → widgets}/wrapper/widget-wrapper.test.tsx +2 -32
- package/src/{widgets-v2 → widgets}/wrapper/widget-wrapper.tsx +36 -58
- package/dist/actions-CGJD6q0t.js +0 -1318
- package/dist/actions-CGJD6q0t.js.map +0 -1
- package/dist/actions-Dhlz_adK.js +0 -1167
- package/dist/actions-Dhlz_adK.js.map +0 -1
- package/dist/category-D01ruG-l.js +0 -842
- package/dist/category-D01ruG-l.js.map +0 -1
- package/dist/chart-config-B_fdIcD3.js.map +0 -1
- package/dist/cjs-CBrZjPCj.js +0 -75
- package/dist/cjs-CBrZjPCj.js.map +0 -1
- package/dist/components-FED-ArwH.js.map +0 -1
- package/dist/copy-button-TTlZONkX.js +0 -34
- package/dist/copy-button-TTlZONkX.js.map +0 -1
- package/dist/csv-modifiers-D6HGC24b.js +0 -26
- package/dist/csv-modifiers-D6HGC24b.js.map +0 -1
- package/dist/download-DGgFOaXj.js.map +0 -1
- package/dist/echart-BkaV3V5G.js +0 -133
- package/dist/echart-BkaV3V5G.js.map +0 -1
- package/dist/echart-CwzbPElc.js.map +0 -1
- package/dist/formatter-wVO81tYk.js +0 -6
- package/dist/formatter-wVO81tYk.js.map +0 -1
- package/dist/formula-BIxJr1P3.js +0 -285
- package/dist/formula-BIxJr1P3.js.map +0 -1
- package/dist/formula-YfZmmuYX.js +0 -190
- package/dist/formula-YfZmmuYX.js.map +0 -1
- package/dist/hooks-zf5gKZYq.js +0 -22
- package/dist/hooks-zf5gKZYq.js.map +0 -1
- package/dist/markdown-content-BWUqwx9F.js.map +0 -1
- package/dist/markdown-oo9mnJun.js.map +0 -1
- package/dist/range-BCMAl5xf.js.map +0 -1
- package/dist/row-CvVGBuy_.js +0 -35
- package/dist/row-CvVGBuy_.js.map +0 -1
- package/dist/shared-resize-observer-BEiP2rQt.js +0 -157
- package/dist/shared-resize-observer-BEiP2rQt.js.map +0 -1
- package/dist/smart-tooltip-CwGHCqab.js +0 -34
- package/dist/smart-tooltip-CwGHCqab.js.map +0 -1
- package/dist/spread-CgCTKPQD.js.map +0 -1
- package/dist/stores-tiFePP0A.js.map +0 -1
- package/dist/styles-Y-qGBELO.js +0 -13
- package/dist/styles-Y-qGBELO.js.map +0 -1
- package/dist/table-lb5momun.js.map +0 -1
- package/dist/tooltip-DJUGNZxY.js +0 -23
- package/dist/tooltip-DJUGNZxY.js.map +0 -1
- package/dist/types/components/list-data/list-data-skeleton.d.ts +0 -5
- package/dist/types/components/list-data/list-data.d.ts +0 -19
- package/dist/types/components/list-data/styles.d.ts +0 -34
- package/dist/types/components/list-data/types.d.ts +0 -23
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/hooks/use-skeleton.d.ts +0 -1
- package/dist/types/hooks/use-widget-ref.d.ts +0 -21
- package/dist/types/widgets/actions/brush-toggle/brush-overlay.d.ts +0 -24
- package/dist/types/widgets/actions/brush-toggle/hit-test.d.ts +0 -19
- package/dist/types/widgets/actions/brush-toggle/types.d.ts +0 -73
- package/dist/types/widgets/actions/fullscreen/styles.d.ts +0 -16
- package/dist/types/widgets/actions/lock-selection/types.d.ts +0 -38
- package/dist/types/widgets/actions/relative-data/types.d.ts +0 -29
- package/dist/types/widgets/actions/relative-data/utils.d.ts +0 -9
- package/dist/types/widgets/actions/searcher/types.d.ts +0 -64
- package/dist/types/widgets/actions/shared/styles.d.ts +0 -11
- package/dist/types/widgets/actions/stack-toggle/grouped-bar-chart-icon.d.ts +0 -1
- package/dist/types/widgets/actions/stack-toggle/types.d.ts +0 -25
- package/dist/types/widgets/actions/zoom-toggle/types.d.ts +0 -41
- package/dist/types/widgets/bar/config.d.ts +0 -9
- package/dist/types/widgets/bar/style.d.ts +0 -37
- package/dist/types/widgets/category/config.d.ts +0 -20
- package/dist/types/widgets/echart/const.d.ts +0 -1
- package/dist/types/widgets/echart/options.d.ts +0 -9
- package/dist/types/widgets/echart/types.d.ts +0 -38
- package/dist/types/widgets/echart/utils.d.ts +0 -128
- package/dist/types/widgets/error/error.d.ts +0 -12
- package/dist/types/widgets/error/index.d.ts +0 -2
- package/dist/types/widgets/error/types.d.ts +0 -20
- package/dist/types/widgets/formula/components/item.d.ts +0 -5
- package/dist/types/widgets/formula/components/prefix.d.ts +0 -5
- package/dist/types/widgets/formula/components/row.d.ts +0 -5
- package/dist/types/widgets/formula/components/series.d.ts +0 -5
- package/dist/types/widgets/formula/components/suffix.d.ts +0 -5
- package/dist/types/widgets/formula/components/value.d.ts +0 -5
- package/dist/types/widgets/formula/config.d.ts +0 -15
- package/dist/types/widgets/formula/serializer.d.ts +0 -16
- package/dist/types/widgets/histogram/config.d.ts +0 -21
- package/dist/types/widgets/histogram/style.d.ts +0 -15
- package/dist/types/widgets/loader/index.d.ts +0 -3
- package/dist/types/widgets/loader/loader.d.ts +0 -24
- package/dist/types/widgets/loader/types.d.ts +0 -9
- package/dist/types/widgets/loader/utils.d.ts +0 -35
- package/dist/types/widgets/markdown/config.d.ts +0 -14
- package/dist/types/widgets/no-data/index.d.ts +0 -2
- package/dist/types/widgets/no-data/no-data.d.ts +0 -36
- package/dist/types/widgets/no-data/style.d.ts +0 -6
- package/dist/types/widgets/no-data/types.d.ts +0 -71
- package/dist/types/widgets/note/index.d.ts +0 -2
- package/dist/types/widgets/note/note.d.ts +0 -12
- package/dist/types/widgets/note/types.d.ts +0 -8
- package/dist/types/widgets/pie/config.d.ts +0 -9
- package/dist/types/widgets/pie/style.d.ts +0 -15
- package/dist/types/widgets/range/components/range-item.d.ts +0 -5
- package/dist/types/widgets/range/config.d.ts +0 -7
- package/dist/types/widgets/range/serializer.d.ts +0 -16
- package/dist/types/widgets/scatterplot/config.d.ts +0 -9
- package/dist/types/widgets/scatterplot/style.d.ts +0 -24
- package/dist/types/widgets/selection-summary/index.d.ts +0 -2
- package/dist/types/widgets/selection-summary/types.d.ts +0 -13
- package/dist/types/widgets/skeleton-loader/index.d.ts +0 -2
- package/dist/types/widgets/skeleton-loader/skeleton-loader.d.ts +0 -12
- package/dist/types/widgets/skeleton-loader/types.d.ts +0 -7
- package/dist/types/widgets/spread/components/max-value.d.ts +0 -5
- package/dist/types/widgets/spread/components/min-value.d.ts +0 -5
- package/dist/types/widgets/spread/components/separator.d.ts +0 -5
- package/dist/types/widgets/spread/config.d.ts +0 -16
- package/dist/types/widgets/spread/style.d.ts +0 -21
- package/dist/types/widgets/stores/use-widget-selector.d.ts +0 -35
- package/dist/types/widgets/stores/widget-store.d.ts +0 -60
- package/dist/types/widgets/subheader/index.d.ts +0 -2
- package/dist/types/widgets/subheader/types.d.ts +0 -10
- package/dist/types/widgets/table/components/cell-header.d.ts +0 -5
- package/dist/types/widgets/table/components/cell.d.ts +0 -18
- package/dist/types/widgets/table/components/pagination-actions.d.ts +0 -5
- package/dist/types/widgets/table/components/pagination.d.ts +0 -5
- package/dist/types/widgets/table/components/row.d.ts +0 -5
- package/dist/types/widgets/table/config.d.ts +0 -21
- package/dist/types/widgets/table/hooks/use-pagination.d.ts +0 -41
- package/dist/types/widgets/table/hooks/use-selection.d.ts +0 -39
- package/dist/types/widgets/table/hooks/use-sort.d.ts +0 -30
- package/dist/types/widgets/table/serializer.d.ts +0 -16
- package/dist/types/widgets/timeseries/config.d.ts +0 -9
- package/dist/types/widgets/timeseries/style.d.ts +0 -38
- package/dist/types/widgets/toolbar-actions/index.d.ts +0 -2
- package/dist/types/widgets/toolbar-actions/styles.d.ts +0 -37
- package/dist/types/widgets/toolbar-actions/toolbar-actions.d.ts +0 -17
- package/dist/types/widgets/toolbar-actions/types.d.ts +0 -52
- package/dist/types/widgets/utils/chart-config/config-factory.d.ts +0 -38
- package/dist/types/widgets/utils/chart-config/csv-modifiers.d.ts +0 -19
- package/dist/types/widgets/utils/chart-config/download-config.d.ts +0 -3
- package/dist/types/widgets/utils/chart-config/index.d.ts +0 -9
- package/dist/types/widgets/utils/formatter.d.ts +0 -2
- package/dist/types/widgets/utils/skeleton/index.d.ts +0 -4
- package/dist/types/widgets/utils/skeleton/styles.d.ts +0 -19
- package/dist/types/widgets/wrapper/components/actions.d.ts +0 -5
- package/dist/types/widgets/wrapper/components/options.d.ts +0 -5
- package/dist/types/widgets/wrapper/components/title.d.ts +0 -9
- package/dist/types/widgets/wrapper/styles.d.ts +0 -89
- package/dist/types/widgets/wrapper/types.d.ts +0 -37
- package/dist/types/widgets/wrapper/wrapper-ui.d.ts +0 -16
- package/dist/types/widgets/wrapper/wrapper.d.ts +0 -16
- package/dist/types/widgets-v2/actions/brush-toggle/brush-toggle.d.ts +0 -56
- package/dist/types/widgets-v2/actions/change-column/change-column-icon.d.ts +0 -2
- package/dist/types/widgets-v2/actions/change-column/change-column.d.ts +0 -29
- package/dist/types/widgets-v2/actions/change-column/sortable-column-item.d.ts +0 -14
- package/dist/types/widgets-v2/actions/change-column/types.d.ts +0 -10
- package/dist/types/widgets-v2/actions/download/download.d.ts +0 -18
- package/dist/types/widgets-v2/actions/download/exports.d.ts +0 -37
- package/dist/types/widgets-v2/actions/download/types.d.ts +0 -46
- package/dist/types/widgets-v2/actions/fullscreen/fullscreen.d.ts +0 -85
- package/dist/types/widgets-v2/actions/fullscreen/types.d.ts +0 -14
- package/dist/types/widgets-v2/actions/index.d.ts +0 -10
- package/dist/types/widgets-v2/actions/lock-selection/lock-selection.d.ts +0 -57
- package/dist/types/widgets-v2/actions/relative-data/relative-data.d.ts +0 -39
- package/dist/types/widgets-v2/actions/searcher/searcher-toggle.d.ts +0 -23
- package/dist/types/widgets-v2/actions/searcher/searcher.d.ts +0 -11
- package/dist/types/widgets-v2/actions/stack-toggle/stack-toggle.d.ts +0 -10
- package/dist/types/widgets-v2/actions/stack-toggle/style.d.ts +0 -12
- package/dist/types/widgets-v2/actions/zoom-toggle/style.d.ts +0 -12
- package/dist/types/widgets-v2/actions/zoom-toggle/zoom-toggle.d.ts +0 -35
- package/dist/types/widgets-v2/bar/download.d.ts +0 -24
- package/dist/types/widgets-v2/bar/index.d.ts +0 -4
- package/dist/types/widgets-v2/bar/skeleton.d.ts +0 -6
- package/dist/types/widgets-v2/bar/types.d.ts +0 -46
- package/dist/types/widgets-v2/category/category-ui.d.ts +0 -96
- package/dist/types/widgets-v2/category/components/category-bar.d.ts +0 -23
- package/dist/types/widgets-v2/category/components/category-legend.d.ts +0 -34
- package/dist/types/widgets-v2/category/components/category-row-multi.d.ts +0 -31
- package/dist/types/widgets-v2/category/components/category-row-other.d.ts +0 -26
- package/dist/types/widgets-v2/category/components/category-row-single.d.ts +0 -28
- package/dist/types/widgets-v2/category/download.d.ts +0 -16
- package/dist/types/widgets-v2/category/index.d.ts +0 -10
- package/dist/types/widgets-v2/category/skeleton.d.ts +0 -11
- package/dist/types/widgets-v2/category/style.d.ts +0 -193
- package/dist/types/widgets-v2/category/types.d.ts +0 -55
- package/dist/types/widgets-v2/echart/echart-ui.d.ts +0 -44
- package/dist/types/widgets-v2/echart/echart.d.ts +0 -83
- package/dist/types/widgets-v2/echart/index.d.ts +0 -4
- package/dist/types/widgets-v2/echart/shared-resize-observer.d.ts +0 -5
- package/dist/types/widgets-v2/formula/download.d.ts +0 -20
- package/dist/types/widgets-v2/formula/formula-ui.d.ts +0 -20
- package/dist/types/widgets-v2/formula/index.d.ts +0 -11
- package/dist/types/widgets-v2/formula/skeleton.d.ts +0 -4
- package/dist/types/widgets-v2/formula/style.d.ts +0 -29
- package/dist/types/widgets-v2/formula/types.d.ts +0 -43
- package/dist/types/widgets-v2/histogram/download.d.ts +0 -17
- package/dist/types/widgets-v2/histogram/index.d.ts +0 -5
- package/dist/types/widgets-v2/histogram/skeleton.d.ts +0 -9
- package/dist/types/widgets-v2/histogram/types.d.ts +0 -60
- package/dist/types/widgets-v2/markdown/download.d.ts +0 -16
- package/dist/types/widgets-v2/markdown/index.d.ts +0 -6
- package/dist/types/widgets-v2/markdown/markdown-ui.d.ts +0 -12
- package/dist/types/widgets-v2/markdown/markdown.d.ts +0 -6
- package/dist/types/widgets-v2/markdown/skeleton.d.ts +0 -4
- package/dist/types/widgets-v2/markdown/style.d.ts +0 -61
- package/dist/types/widgets-v2/markdown/types.d.ts +0 -4
- package/dist/types/widgets-v2/note/style.d.ts +0 -26
- package/dist/types/widgets-v2/pie/download.d.ts +0 -17
- package/dist/types/widgets-v2/pie/index.d.ts +0 -4
- package/dist/types/widgets-v2/pie/skeleton.d.ts +0 -13
- package/dist/types/widgets-v2/pie/types.d.ts +0 -57
- package/dist/types/widgets-v2/range/index.d.ts +0 -4
- package/dist/types/widgets-v2/range/range-ui.d.ts +0 -27
- package/dist/types/widgets-v2/range/skeleton.d.ts +0 -9
- package/dist/types/widgets-v2/range/style.d.ts +0 -40
- package/dist/types/widgets-v2/range/types.d.ts +0 -37
- package/dist/types/widgets-v2/scatterplot/download.d.ts +0 -16
- package/dist/types/widgets-v2/scatterplot/index.d.ts +0 -5
- package/dist/types/widgets-v2/scatterplot/skeleton.d.ts +0 -12
- package/dist/types/widgets-v2/scatterplot/types.d.ts +0 -54
- package/dist/types/widgets-v2/selection-summary/selection-summary.d.ts +0 -29
- package/dist/types/widgets-v2/selection-summary/style.d.ts +0 -38
- package/dist/types/widgets-v2/spread/download.d.ts +0 -15
- package/dist/types/widgets-v2/spread/index.d.ts +0 -7
- package/dist/types/widgets-v2/spread/skeleton.d.ts +0 -9
- package/dist/types/widgets-v2/spread/spread-ui.d.ts +0 -18
- package/dist/types/widgets-v2/spread/types.d.ts +0 -25
- package/dist/types/widgets-v2/stores/index.d.ts +0 -8
- package/dist/types/widgets-v2/stores/types.d.ts +0 -55
- package/dist/types/widgets-v2/subheader/style.d.ts +0 -10
- package/dist/types/widgets-v2/subheader/subheader.d.ts +0 -11
- package/dist/types/widgets-v2/table/download.d.ts +0 -18
- package/dist/types/widgets-v2/table/helpers.d.ts +0 -32
- package/dist/types/widgets-v2/table/index.d.ts +0 -8
- package/dist/types/widgets-v2/table/skeleton.d.ts +0 -22
- package/dist/types/widgets-v2/table/style.d.ts +0 -40
- package/dist/types/widgets-v2/table/table-ui.d.ts +0 -44
- package/dist/types/widgets-v2/table/types.d.ts +0 -48
- package/dist/types/widgets-v2/timeseries/download.d.ts +0 -17
- package/dist/types/widgets-v2/timeseries/index.d.ts +0 -5
- package/dist/types/widgets-v2/timeseries/skeleton.d.ts +0 -8
- package/dist/types/widgets-v2/timeseries/types.d.ts +0 -60
- package/dist/types/widgets-v2/utils/index.d.ts +0 -3
- package/dist/types/widgets-v2/wrapper/index.d.ts +0 -4
- package/dist/use-widget-selector-VSPhfhNm.js +0 -12
- package/dist/use-widget-selector-VSPhfhNm.js.map +0 -1
- package/dist/utils-Dr6gf3vD.js.map +0 -1
- package/dist/widget-store-BFPKYm4R.js +0 -187
- package/dist/widget-store-BFPKYm4R.js.map +0 -1
- package/dist/widgets/category.js.map +0 -1
- package/dist/widgets/error.js +0 -30
- package/dist/widgets/error.js.map +0 -1
- package/dist/widgets/loader.js +0 -66
- package/dist/widgets/loader.js.map +0 -1
- package/dist/widgets/markdown.js.map +0 -1
- package/dist/widgets/no-data.js +0 -55
- package/dist/widgets/no-data.js.map +0 -1
- package/dist/widgets/note.js +0 -127
- package/dist/widgets/note.js.map +0 -1
- package/dist/widgets/range.js.map +0 -1
- package/dist/widgets/selection-summary.js +0 -41
- package/dist/widgets/selection-summary.js.map +0 -1
- package/dist/widgets/skeleton-loader.js +0 -24
- package/dist/widgets/skeleton-loader.js.map +0 -1
- package/dist/widgets/spread.js.map +0 -1
- package/dist/widgets/subheader.js +0 -51
- package/dist/widgets/subheader.js.map +0 -1
- package/dist/widgets/table.js.map +0 -1
- package/dist/widgets/toolbar-actions.js +0 -145
- package/dist/widgets/toolbar-actions.js.map +0 -1
- package/dist/widgets/utils.js.map +0 -1
- package/dist/widgets/wrapper.js +0 -273
- package/dist/widgets/wrapper.js.map +0 -1
- package/dist/widgets-v2/actions.js +0 -4
- package/dist/widgets-v2/bar.js +0 -260
- package/dist/widgets-v2/bar.js.map +0 -1
- package/dist/widgets-v2/category.js +0 -2
- package/dist/widgets-v2/echart.js +0 -2
- package/dist/widgets-v2/formula.js +0 -2
- package/dist/widgets-v2/histogram.js +0 -297
- package/dist/widgets-v2/histogram.js.map +0 -1
- package/dist/widgets-v2/markdown.js +0 -3
- package/dist/widgets-v2/pie.js +0 -373
- package/dist/widgets-v2/pie.js.map +0 -1
- package/dist/widgets-v2/range.js +0 -2
- package/dist/widgets-v2/scatterplot.js +0 -330
- package/dist/widgets-v2/scatterplot.js.map +0 -1
- package/dist/widgets-v2/spread.js +0 -2
- package/dist/widgets-v2/stores.js +0 -2
- package/dist/widgets-v2/table.js +0 -2
- package/dist/widgets-v2/timeseries.js +0 -294
- package/dist/widgets-v2/timeseries.js.map +0 -1
- package/dist/widgets-v2/utils.js +0 -2
- package/dist/widgets-v2.js +0 -952
- package/dist/widgets-v2.js.map +0 -1
- package/dist/zoom-toggle-IsF8BnAp.js.map +0 -1
- package/src/components/list-data/list-data-skeleton.test.tsx +0 -10
- package/src/components/list-data/list-data-skeleton.tsx +0 -40
- package/src/components/list-data/list-data.test.tsx +0 -167
- package/src/components/list-data/list-data.tsx +0 -124
- package/src/components/list-data/styles.ts +0 -37
- package/src/components/list-data/types.ts +0 -25
- package/src/hooks/index.ts +0 -1
- package/src/hooks/use-skeleton.test.tsx +0 -32
- package/src/hooks/use-skeleton.ts +0 -19
- package/src/hooks/use-widget-ref.ts +0 -34
- package/src/widgets/README.md +0 -277
- package/src/widgets/actions/brush-toggle/brush-overlay.test.tsx +0 -465
- package/src/widgets/actions/brush-toggle/brush-overlay.tsx +0 -408
- package/src/widgets/actions/brush-toggle/hit-test.test.ts +0 -65
- package/src/widgets/actions/brush-toggle/hit-test.ts +0 -45
- package/src/widgets/actions/brush-toggle/types.ts +0 -78
- package/src/widgets/actions/change-column/change-column-dnd.test.tsx +0 -193
- package/src/widgets/actions/change-column/sortable-column-item.test.tsx +0 -124
- package/src/widgets/actions/download/exports.tsx +0 -118
- package/src/widgets/actions/fullscreen/styles.ts +0 -17
- package/src/widgets/actions/lock-selection/types.ts +0 -43
- package/src/widgets/actions/relative-data/types.ts +0 -33
- package/src/widgets/actions/relative-data/utils.test.ts +0 -223
- package/src/widgets/actions/relative-data/utils.ts +0 -58
- package/src/widgets/actions/searcher/searcher-toggle.test.tsx +0 -354
- package/src/widgets/actions/searcher/types.ts +0 -72
- package/src/widgets/actions/shared/styles.ts +0 -12
- package/src/widgets/actions/stack-toggle/grouped-bar-chart-icon.tsx +0 -14
- package/src/widgets/actions/stack-toggle/types.ts +0 -29
- package/src/widgets/actions/zoom-toggle/types.ts +0 -44
- package/src/widgets/bar/config.ts +0 -140
- package/src/widgets/bar/style.ts +0 -33
- package/src/widgets/category/components/category-rows.test.tsx +0 -213
- package/src/widgets/category/config.ts +0 -86
- package/src/widgets/echart/const.ts +0 -1
- package/src/widgets/echart/options.ts +0 -57
- package/src/widgets/echart/types.ts +0 -45
- package/src/widgets/echart/utils.test.ts +0 -277
- package/src/widgets/echart/utils.ts +0 -244
- package/src/widgets/error/error.test.tsx +0 -331
- package/src/widgets/error/error.tsx +0 -51
- package/src/widgets/error/index.ts +0 -2
- package/src/widgets/error/types.ts +0 -24
- package/src/widgets/formula/components/item.test.tsx +0 -249
- package/src/widgets/formula/components/item.tsx +0 -21
- package/src/widgets/formula/components/prefix.test.tsx +0 -341
- package/src/widgets/formula/components/prefix.tsx +0 -19
- package/src/widgets/formula/components/row.test.tsx +0 -364
- package/src/widgets/formula/components/row.tsx +0 -24
- package/src/widgets/formula/components/series.tsx +0 -35
- package/src/widgets/formula/components/suffix.test.tsx +0 -383
- package/src/widgets/formula/components/suffix.tsx +0 -29
- package/src/widgets/formula/components/value.test.tsx +0 -329
- package/src/widgets/formula/components/value.tsx +0 -24
- package/src/widgets/formula/config.test.ts +0 -37
- package/src/widgets/formula/config.ts +0 -38
- package/src/widgets/formula/serializer.test.tsx +0 -144
- package/src/widgets/formula/serializer.ts +0 -28
- package/src/widgets/histogram/config.ts +0 -230
- package/src/widgets/histogram/style.ts +0 -8
- package/src/widgets/loader/index.ts +0 -4
- package/src/widgets/loader/loader.tsx +0 -92
- package/src/widgets/loader/types.ts +0 -13
- package/src/widgets/loader/utils.test.ts +0 -112
- package/src/widgets/loader/utils.ts +0 -57
- package/src/widgets/markdown/config.ts +0 -28
- package/src/widgets/no-data/index.ts +0 -2
- package/src/widgets/no-data/no-data.test.tsx +0 -497
- package/src/widgets/no-data/no-data.tsx +0 -112
- package/src/widgets/no-data/style.ts +0 -18
- package/src/widgets/no-data/types.ts +0 -76
- package/src/widgets/note/index.ts +0 -2
- package/src/widgets/note/note.test.tsx +0 -391
- package/src/widgets/note/note.tsx +0 -124
- package/src/widgets/note/types.ts +0 -9
- package/src/widgets/pie/config.ts +0 -245
- package/src/widgets/pie/style.ts +0 -8
- package/src/widgets/range/components/range-item.test.tsx +0 -243
- package/src/widgets/range/components/range-item.tsx +0 -214
- package/src/widgets/range/config.ts +0 -10
- package/src/widgets/range/serializer.test.ts +0 -70
- package/src/widgets/range/serializer.ts +0 -27
- package/src/widgets/scatterplot/config.ts +0 -136
- package/src/widgets/scatterplot/style.ts +0 -21
- package/src/widgets/selection-summary/index.ts +0 -6
- package/src/widgets/selection-summary/types.ts +0 -14
- package/src/widgets/skeleton-loader/index.ts +0 -2
- package/src/widgets/skeleton-loader/skeleton-loader.test.tsx +0 -139
- package/src/widgets/skeleton-loader/skeleton-loader.tsx +0 -35
- package/src/widgets/skeleton-loader/types.ts +0 -8
- package/src/widgets/spread/components/max-value.tsx +0 -29
- package/src/widgets/spread/components/min-value.tsx +0 -29
- package/src/widgets/spread/components/separator.tsx +0 -9
- package/src/widgets/spread/config.ts +0 -39
- package/src/widgets/spread/style.ts +0 -22
- package/src/widgets/stores/use-widget-selector.ts +0 -47
- package/src/widgets/stores/widget-store-branches.test.ts +0 -275
- package/src/widgets/stores/widget-store-performance.test.ts +0 -750
- package/src/widgets/stores/widget-store.test.ts +0 -942
- package/src/widgets/stores/widget-store.ts +0 -484
- package/src/widgets/subheader/index.ts +0 -3
- package/src/widgets/subheader/types.ts +0 -11
- package/src/widgets/table/components/cell-header.tsx +0 -58
- package/src/widgets/table/components/cell.tsx +0 -82
- package/src/widgets/table/components/pagination-actions.tsx +0 -67
- package/src/widgets/table/components/pagination.tsx +0 -41
- package/src/widgets/table/components/row.tsx +0 -65
- package/src/widgets/table/config.test.ts +0 -65
- package/src/widgets/table/config.ts +0 -75
- package/src/widgets/table/hooks/use-pagination.test.ts +0 -294
- package/src/widgets/table/hooks/use-pagination.ts +0 -148
- package/src/widgets/table/hooks/use-selection.test.ts +0 -504
- package/src/widgets/table/hooks/use-selection.ts +0 -194
- package/src/widgets/table/hooks/use-sort.test.ts +0 -296
- package/src/widgets/table/hooks/use-sort.ts +0 -131
- package/src/widgets/table/serializer.ts +0 -54
- package/src/widgets/timeseries/config.ts +0 -136
- package/src/widgets/timeseries/style.ts +0 -36
- package/src/widgets/toolbar-actions/index.ts +0 -6
- package/src/widgets/toolbar-actions/styles.ts +0 -38
- package/src/widgets/toolbar-actions/toolbar-actions.test.tsx +0 -691
- package/src/widgets/toolbar-actions/toolbar-actions.tsx +0 -145
- package/src/widgets/toolbar-actions/types.ts +0 -60
- package/src/widgets/utils/chart-config/config-factory.ts +0 -67
- package/src/widgets/utils/chart-config/csv-modifiers.ts +0 -56
- package/src/widgets/utils/chart-config/download-config.ts +0 -22
- package/src/widgets/utils/chart-config/index.ts +0 -29
- package/src/widgets/utils/formatter.ts +0 -2
- package/src/widgets/utils/skeleton/index.ts +0 -5
- package/src/widgets/utils/skeleton/styles.ts +0 -20
- package/src/widgets/wrapper/components/actions.test.tsx +0 -105
- package/src/widgets/wrapper/components/actions.tsx +0 -35
- package/src/widgets/wrapper/components/options.test.tsx +0 -331
- package/src/widgets/wrapper/components/options.tsx +0 -81
- package/src/widgets/wrapper/components/title.test.tsx +0 -126
- package/src/widgets/wrapper/components/title.tsx +0 -35
- package/src/widgets/wrapper/styles.ts +0 -98
- package/src/widgets/wrapper/types.ts +0 -55
- package/src/widgets/wrapper/wrapper-ui.test.tsx +0 -232
- package/src/widgets/wrapper/wrapper-ui.tsx +0 -72
- package/src/widgets/wrapper/wrapper.test.tsx +0 -365
- package/src/widgets/wrapper/wrapper.tsx +0 -60
- package/src/widgets-v2/actions/brush-toggle/brush-toggle.test.tsx +0 -180
- package/src/widgets-v2/actions/brush-toggle/brush-toggle.tsx +0 -154
- package/src/widgets-v2/actions/change-column/change-column-icon.tsx +0 -14
- package/src/widgets-v2/actions/change-column/change-column.test.tsx +0 -59
- package/src/widgets-v2/actions/change-column/change-column.tsx +0 -189
- package/src/widgets-v2/actions/change-column/sortable-column-item.tsx +0 -63
- package/src/widgets-v2/actions/change-column/types.ts +0 -11
- package/src/widgets-v2/actions/download/download.test.tsx +0 -327
- package/src/widgets-v2/actions/download/download.tsx +0 -146
- package/src/widgets-v2/actions/download/exports.test.tsx +0 -198
- package/src/widgets-v2/actions/download/types.ts +0 -46
- package/src/widgets-v2/actions/fullscreen/fullscreen.test.tsx +0 -210
- package/src/widgets-v2/actions/fullscreen/fullscreen.tsx +0 -416
- package/src/widgets-v2/actions/fullscreen/types.ts +0 -15
- package/src/widgets-v2/actions/index.ts +0 -96
- package/src/widgets-v2/actions/lock-selection/lock-selection.test.tsx +0 -301
- package/src/widgets-v2/actions/lock-selection/lock-selection.tsx +0 -188
- package/src/widgets-v2/actions/relative-data/relative-data.test.tsx +0 -71
- package/src/widgets-v2/actions/relative-data/relative-data.tsx +0 -107
- package/src/widgets-v2/actions/searcher/searcher-toggle.tsx +0 -96
- package/src/widgets-v2/actions/searcher/searcher.tsx +0 -127
- package/src/widgets-v2/actions/stack-toggle/stack-toggle.test.tsx +0 -61
- package/src/widgets-v2/actions/stack-toggle/stack-toggle.tsx +0 -54
- package/src/widgets-v2/actions/stack-toggle/style.ts +0 -11
- package/src/widgets-v2/actions/zoom-toggle/style.ts +0 -11
- package/src/widgets-v2/actions/zoom-toggle/zoom-toggle.test.tsx +0 -107
- package/src/widgets-v2/actions/zoom-toggle/zoom-toggle.tsx +0 -106
- package/src/widgets-v2/bar/download.tsx +0 -61
- package/src/widgets-v2/bar/index.ts +0 -10
- package/src/widgets-v2/bar/skeleton.tsx +0 -69
- package/src/widgets-v2/bar/types.ts +0 -51
- package/src/widgets-v2/category/category-ui.test.tsx +0 -909
- package/src/widgets-v2/category/category-ui.tsx +0 -490
- package/src/widgets-v2/category/components/category-bar.tsx +0 -49
- package/src/widgets-v2/category/components/category-legend.tsx +0 -82
- package/src/widgets-v2/category/components/category-row-multi.tsx +0 -86
- package/src/widgets-v2/category/components/category-row-other.tsx +0 -84
- package/src/widgets-v2/category/components/category-row-single.tsx +0 -76
- package/src/widgets-v2/category/download.ts +0 -51
- package/src/widgets-v2/category/index.ts +0 -32
- package/src/widgets-v2/category/skeleton.tsx +0 -74
- package/src/widgets-v2/category/style.ts +0 -329
- package/src/widgets-v2/category/types.ts +0 -61
- package/src/widgets-v2/echart/echart-ui.test.tsx +0 -330
- package/src/widgets-v2/echart/echart-ui.tsx +0 -236
- package/src/widgets-v2/echart/echart.test.tsx +0 -229
- package/src/widgets-v2/echart/echart.tsx +0 -209
- package/src/widgets-v2/echart/index.ts +0 -22
- package/src/widgets-v2/echart/shared-resize-observer.ts +0 -56
- package/src/widgets-v2/formula/formula-ui.test.tsx +0 -91
- package/src/widgets-v2/formula/formula-ui.tsx +0 -66
- package/src/widgets-v2/formula/index.ts +0 -17
- package/src/widgets-v2/formula/skeleton.tsx +0 -27
- package/src/widgets-v2/formula/style.ts +0 -31
- package/src/widgets-v2/formula/types.ts +0 -48
- package/src/widgets-v2/histogram/index.ts +0 -13
- package/src/widgets-v2/histogram/skeleton.tsx +0 -70
- package/src/widgets-v2/histogram/types.ts +0 -64
- package/src/widgets-v2/markdown/index.ts +0 -6
- package/src/widgets-v2/markdown/markdown-ui.test.tsx +0 -75
- package/src/widgets-v2/markdown/markdown-ui.tsx +0 -55
- package/src/widgets-v2/markdown/markdown.tsx +0 -17
- package/src/widgets-v2/markdown/skeleton.tsx +0 -32
- package/src/widgets-v2/markdown/style.ts +0 -53
- package/src/widgets-v2/markdown/types.ts +0 -4
- package/src/widgets-v2/note/style.ts +0 -26
- package/src/widgets-v2/pie/index.ts +0 -10
- package/src/widgets-v2/pie/skeleton.tsx +0 -94
- package/src/widgets-v2/pie/types.ts +0 -62
- package/src/widgets-v2/range/index.ts +0 -4
- package/src/widgets-v2/range/range-ui.test.tsx +0 -136
- package/src/widgets-v2/range/range-ui.tsx +0 -278
- package/src/widgets-v2/range/skeleton.tsx +0 -47
- package/src/widgets-v2/range/style.ts +0 -41
- package/src/widgets-v2/range/types.ts +0 -37
- package/src/widgets-v2/scatterplot/download.ts +0 -51
- package/src/widgets-v2/scatterplot/index.ts +0 -14
- package/src/widgets-v2/scatterplot/skeleton.tsx +0 -84
- package/src/widgets-v2/scatterplot/types.ts +0 -59
- package/src/widgets-v2/selection-summary/selection-summary.tsx +0 -82
- package/src/widgets-v2/selection-summary/style.ts +0 -38
- package/src/widgets-v2/spread/download.ts +0 -56
- package/src/widgets-v2/spread/index.ts +0 -11
- package/src/widgets-v2/spread/skeleton.tsx +0 -38
- package/src/widgets-v2/spread/spread-ui.test.tsx +0 -108
- package/src/widgets-v2/spread/spread-ui.tsx +0 -52
- package/src/widgets-v2/spread/types.ts +0 -27
- package/src/widgets-v2/stores/index.ts +0 -49
- package/src/widgets-v2/stores/types.ts +0 -64
- package/src/widgets-v2/subheader/style.ts +0 -12
- package/src/widgets-v2/subheader/subheader.test.tsx +0 -30
- package/src/widgets-v2/subheader/subheader.tsx +0 -16
- package/src/widgets-v2/table/download.ts +0 -44
- package/src/widgets-v2/table/helpers.test.ts +0 -233
- package/src/widgets-v2/table/helpers.ts +0 -131
- package/src/widgets-v2/table/index.ts +0 -24
- package/src/widgets-v2/table/skeleton.tsx +0 -65
- package/src/widgets-v2/table/style.ts +0 -43
- package/src/widgets-v2/table/table-ui.tsx +0 -364
- package/src/widgets-v2/table/types.ts +0 -55
- package/src/widgets-v2/timeseries/index.ts +0 -11
- package/src/widgets-v2/timeseries/skeleton.tsx +0 -76
- package/src/widgets-v2/timeseries/types.ts +0 -65
- package/src/widgets-v2/utils/index.ts +0 -3
- package/src/widgets-v2/wrapper/index.ts +0 -14
- /package/dist/types/{widgets-v2 → widgets}/actions/brush-toggle/index.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/brush-toggle/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/brush-toggle/transforms.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/change-column/index.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/change-column/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/change-column/style.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/download/constants.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/download/csv-item.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/download/icons.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/download/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/download/style.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/fullscreen/index.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/fullscreen/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/fullscreen/style.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/lock-selection/index.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/lock-selection/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2/actions/brush-toggle → widgets/actions/lock-selection}/style.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/lock-selection/transforms.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/relative-data/index.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/relative-data/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2/actions/lock-selection → widgets/actions/relative-data}/style.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/searcher/filter.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/searcher/index.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/searcher/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/searcher/style.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/show-all/index.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/show-all/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/show-all/show-all.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/show-all/style.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/stack-toggle/index.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/stack-toggle/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2/actions/relative-data → widgets/actions/stack-toggle}/style.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/stack-toggle/transforms.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/zoom-toggle/index.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/zoom-toggle/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/actions/zoom-toggle/transforms.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/bar/options.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/category/category.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/echart/edge-label-clamp.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/echart/style.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/echart/use-chart-selection.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/formula/delta.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/formula/formula.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/formula/note.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/formula/prefix.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/formula/suffix.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/histogram/options.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/histogram/transforms.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/markdown/markdown-content.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/note/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/note/widget-note.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/pie/options.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/provider/widget-provider.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/range/range.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/scatterplot/options.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/scatterplot/transforms.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/selection-summary/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/spread/band.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/spread/separator.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/spread/spread.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/state/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/state/style.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/state/widget-state.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/stores/pipeline-middleware.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/stores/transforms.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/stores/use-echart-instance.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/stores/use-transform-enabled.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/stores/use-transform.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/stores/widget-context.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/table/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/table/table.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/table/transforms.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/timeseries/options.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/timeseries/transforms.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/toolbox/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/toolbox/style.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/toolbox/toolbox.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/utils/data-zoom-layout.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/utils/merge-options.d.ts +0 -0
- /package/dist/types/widgets/utils/{chart-config/option-builders.d.ts → option-builders.d.ts} +0 -0
- /package/dist/types/{widgets-v2 → widgets}/utils/resolve-theme-color.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/wrapper/labels.d.ts +0 -0
- /package/dist/types/{widgets-v2 → widgets}/wrapper/widget-content.d.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/brush-toggle/index.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/brush-toggle/labels.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/brush-toggle/transforms.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/brush-toggle/transforms.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/change-column/index.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/change-column/labels.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/change-column/style.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/download/constants.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/download/csv-item.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/actions/download/csv-item.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/actions/download/icons.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/actions/download/labels.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/download/png-item.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/actions/download/style.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/fullscreen/fullscreen-store.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/actions/fullscreen/index.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/fullscreen/labels.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/fullscreen/style.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/lock-selection/index.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/lock-selection/labels.ts +0 -0
- /package/src/{widgets-v2/actions/brush-toggle → widgets/actions/lock-selection}/style.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/lock-selection/transforms.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/relative-data/index.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/relative-data/labels.ts +0 -0
- /package/src/{widgets-v2/actions/lock-selection → widgets/actions/relative-data}/style.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/relative-data/transforms.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/searcher/filter.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/searcher/filter.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/searcher/index.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/searcher/labels.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/searcher/searcher.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/actions/searcher/style.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/show-all/index.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/show-all/labels.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/show-all/show-all.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/actions/show-all/show-all.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/actions/show-all/style.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/stack-toggle/index.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/stack-toggle/labels.ts +0 -0
- /package/src/{widgets-v2/actions/relative-data → widgets/actions/stack-toggle}/style.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/stack-toggle/transforms.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/stack-toggle/transforms.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/zoom-toggle/index.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/zoom-toggle/labels.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/zoom-toggle/transforms.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/actions/zoom-toggle/transforms.ts +0 -0
- /package/src/{widgets-v2 → widgets}/bar/download.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/bar/options.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/bar/skeleton.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/category/category.relative-data.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/category/category.stack-toggle.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/category/category.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/category/components/category-bar-stacked.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/category/components/category-bar.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/category/components/category-row-other.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/category/components/category-row-stacked.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/category/download.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/category/skeleton.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/echart/edge-label-clamp.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/echart/edge-label-clamp.ts +0 -0
- /package/src/{widgets-v2 → widgets}/echart/shared-resize-observer.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/echart/use-chart-selection.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/echart/use-chart-selection.ts +0 -0
- /package/src/{widgets-v2 → widgets}/formula/delta.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/formula/download.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/formula/formula.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/formula/formula.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/formula/prefix.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/formula/skeleton.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/formula/subcomponents.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/formula/suffix.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/histogram/download.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/histogram/options.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/histogram/skeleton.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/histogram/transforms.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/histogram/transforms.ts +0 -0
- /package/src/{widgets-v2 → widgets}/markdown/download.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/markdown/markdown-content.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/markdown/markdown-content.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/markdown/markdown.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/markdown/skeleton.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/note/labels.ts +0 -0
- /package/src/{widgets-v2 → widgets}/note/widget-note.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/pie/download.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/pie/options.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/pie/skeleton.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/provider/widget-provider.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/provider/widget-provider.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/range/range.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/range/range.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/range/skeleton.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/scatterplot/download.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/scatterplot/options.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/scatterplot/skeleton.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/scatterplot/transforms.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/scatterplot/transforms.ts +0 -0
- /package/src/{widgets-v2 → widgets}/selection-summary/labels.ts +0 -0
- /package/src/{widgets-v2 → widgets}/selection-summary/selection-summary.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/spread/band.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/spread/band.ts +0 -0
- /package/src/{widgets-v2 → widgets}/spread/download.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/spread/separator.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/spread/skeleton.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/spread/spread.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/spread/spread.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/state/labels.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/state/labels.ts +0 -0
- /package/src/{widgets-v2 → widgets}/state/style.ts +0 -0
- /package/src/{widgets-v2 → widgets}/state/widget-state.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/stores/pipeline-middleware.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/stores/pipeline-middleware.ts +0 -0
- /package/src/{widgets-v2 → widgets}/stores/transforms.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/stores/use-echart-instance.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/stores/use-echart-instance.ts +0 -0
- /package/src/{widgets-v2 → widgets}/stores/use-transform-enabled.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/stores/use-transform-enabled.ts +0 -0
- /package/src/{widgets-v2 → widgets}/stores/use-transform.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/stores/widget-context.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/stores/widget-context.ts +0 -0
- /package/src/{widgets-v2 → widgets}/table/download.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/table/labels.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/table/skeleton.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/table/table-ui.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/table/table.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/table/table.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/table/transforms.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/table/transforms.ts +0 -0
- /package/src/{widgets-v2 → widgets}/timeseries/download.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/timeseries/options.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/timeseries/skeleton.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/timeseries/transforms.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/timeseries/transforms.ts +0 -0
- /package/src/{widgets-v2 → widgets}/toolbox/labels.ts +0 -0
- /package/src/{widgets-v2 → widgets}/toolbox/style.ts +0 -0
- /package/src/{widgets-v2 → widgets}/toolbox/toolbox.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/toolbox/toolbox.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/utils/data-zoom-layout.ts +0 -0
- /package/src/{widgets-v2 → widgets}/utils/merge-options.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/utils/merge-options.ts +0 -0
- /package/src/widgets/utils/{chart-config/option-builders.test.ts → option-builders.test.ts} +0 -0
- /package/src/widgets/utils/{chart-config/option-builders.ts → option-builders.ts} +0 -0
- /package/src/{widgets-v2 → widgets}/utils/resolve-theme-color.test.ts +0 -0
- /package/src/{widgets-v2 → widgets}/utils/resolve-theme-color.ts +0 -0
- /package/src/{widgets-v2 → widgets}/wrapper/labels.ts +0 -0
- /package/src/{widgets-v2 → widgets}/wrapper/widget-actions.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/wrapper/widget-content.test.tsx +0 -0
- /package/src/{widgets-v2 → widgets}/wrapper/widget-content.tsx +0 -0
|
@@ -0,0 +1,772 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { readFileSync } from 'node:fs'
|
|
3
|
+
import { join } from 'node:path'
|
|
4
|
+
import jscodeshift from 'jscodeshift'
|
|
5
|
+
import type { API, Options } from 'jscodeshift'
|
|
6
|
+
import { RULES, JUMPS, jumpsFor } from './rules'
|
|
7
|
+
import { REMOVED_OUTLINE_ICONS, replacementFor } from './icons'
|
|
8
|
+
import { consolidateClassName, consolidateSelectors } from './classes'
|
|
9
|
+
import transform from './transform'
|
|
10
|
+
|
|
11
|
+
const DOCS = join(import.meta.dirname, '../../../../../docs/migration')
|
|
12
|
+
|
|
13
|
+
const j = jscodeshift.withParser('tsx')
|
|
14
|
+
|
|
15
|
+
/** jscodeshift's stats and report only matter to its CLI output. */
|
|
16
|
+
const noop = (): void => undefined
|
|
17
|
+
|
|
18
|
+
const api = {
|
|
19
|
+
jscodeshift: j,
|
|
20
|
+
j,
|
|
21
|
+
stats: noop,
|
|
22
|
+
report: noop,
|
|
23
|
+
} as unknown as API
|
|
24
|
+
|
|
25
|
+
/** Runs the codemod the way jscodeshift would, and returns what it printed. */
|
|
26
|
+
function run(
|
|
27
|
+
source: string,
|
|
28
|
+
options: Options = {},
|
|
29
|
+
path = 'src/component.tsx',
|
|
30
|
+
): string {
|
|
31
|
+
return transform({ path, source }, api, options) ?? source
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
describe('rule set', () => {
|
|
35
|
+
it('has unique ids', () => {
|
|
36
|
+
const ids = RULES.map((rule) => rule.id)
|
|
37
|
+
expect(new Set(ids).size).toBe(ids.length)
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
it('gives every rule something to do', () => {
|
|
41
|
+
// A rule with neither an `apply` nor an `applyText` would be documented
|
|
42
|
+
// and then silently skipped — the failure mode this codemod replaced.
|
|
43
|
+
for (const rule of RULES) {
|
|
44
|
+
expect(rule.apply ?? rule.applyText, rule.id).toBeDefined()
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it('says what it does about every rule', () => {
|
|
49
|
+
// The `action` is what a reader sees next to a rule id in a diff or in
|
|
50
|
+
// the exported data, so an empty one makes the rule undocumented in
|
|
51
|
+
// practice even though the guide covers its jump.
|
|
52
|
+
for (const rule of RULES) {
|
|
53
|
+
expect(rule.action.length, rule.id).toBeGreaterThan(20)
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it('covers every jump in the guide', () => {
|
|
58
|
+
const guide = readFileSync(join(DOCS, 'mui-9-meridian-5.md'), 'utf8')
|
|
59
|
+
for (const heading of [
|
|
60
|
+
'Jump 1 — Material UI v5 → v6',
|
|
61
|
+
'Jump 2 — Material UI v6 → v7',
|
|
62
|
+
'Jump 3 — Material UI v7 → v9',
|
|
63
|
+
'Jump 4 — Meridian 2.14 → 5.1.1',
|
|
64
|
+
'Jump 5 — `@carto/ps-react-ui` widgets v1 is removed',
|
|
65
|
+
]) {
|
|
66
|
+
expect(guide).toContain(heading)
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
it('runs the Grid rules in an order that composes', () => {
|
|
71
|
+
// `grid-legacy` renames the element so `grid-item-prop` can convert its
|
|
72
|
+
// props; the other order leaves a migrated name with v1 props.
|
|
73
|
+
const ids = RULES.filter((rule) => rule.jump === 'v6-v7').map(
|
|
74
|
+
(rule) => rule.id,
|
|
75
|
+
)
|
|
76
|
+
expect(ids.indexOf('grid-legacy')).toBeLessThan(
|
|
77
|
+
ids.indexOf('grid-item-prop'),
|
|
78
|
+
)
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
describe('jumpsFor', () => {
|
|
83
|
+
it('routes a v5 + Meridian 2 codebase through every jump', () => {
|
|
84
|
+
expect(jumpsFor(5, 2)).toEqual([
|
|
85
|
+
'v5-v6',
|
|
86
|
+
'v6-v7',
|
|
87
|
+
'v7-v9',
|
|
88
|
+
'meridian-5',
|
|
89
|
+
'ps-react-ui',
|
|
90
|
+
])
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
it('skips the jumps already done', () => {
|
|
94
|
+
expect(jumpsFor(7, 2)).toEqual(['v7-v9', 'meridian-5', 'ps-react-ui'])
|
|
95
|
+
expect(jumpsFor(9, 2)).toEqual(['meridian-5', 'ps-react-ui'])
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
// The widgets move ships in the same major, whatever MUI the app is on.
|
|
99
|
+
it('leaves only the ps-react-ui jump once on v9 + Meridian 5', () => {
|
|
100
|
+
expect(jumpsFor(9, 5)).toEqual(['ps-react-ui'])
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
// There is no @mui/material v8; 7 upgrades straight to 9.
|
|
104
|
+
it('does not invent a v8 step', () => {
|
|
105
|
+
expect(jumpsFor(7, 5)).toEqual(['v7-v9', 'ps-react-ui'])
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
describe('the transform entry point', () => {
|
|
110
|
+
it('leaves a file it did not change completely alone', () => {
|
|
111
|
+
// This is what keeps the codemod from having the defect it documents in
|
|
112
|
+
// MUI's: recast reprints whatever it prints, and a run that prints every
|
|
113
|
+
// file it parsed buries its real changes in added semicolons.
|
|
114
|
+
const source = 'const a = 1\nexport default a\n'
|
|
115
|
+
expect(transform({ path: 'src/a.ts', source }, api, {})).toBeUndefined()
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
it('runs only the requested jump', () => {
|
|
119
|
+
const source = "<Typography color='text.secondary' />"
|
|
120
|
+
expect(run(source, { jump: 'v5-v6' })).toBe(source)
|
|
121
|
+
expect(run(source, { jump: 'v7-v9' })).toContain('sx=')
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
it('rejects a jump that does not exist', () => {
|
|
125
|
+
expect(() => run('const a = 1', { jump: 'v7-v8' })).toThrow(/Unknown jump/)
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
it('rewrites a stylesheet it cannot parse', () => {
|
|
129
|
+
const css = '.MuiButton-textPrimary { color: red; }'
|
|
130
|
+
expect(run(css, {}, 'src/app.css')).toBe(
|
|
131
|
+
'.MuiButton-text.MuiButton-colorPrimary { color: red; }',
|
|
132
|
+
)
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
it('rewrites the icons in documentation, which no codemod touches', () => {
|
|
136
|
+
const mdx = "import { ErrorOutline } from '@mui/icons-material'"
|
|
137
|
+
expect(run(mdx, {}, 'docs/icons.mdx')).toContain('ErrorOutlineOutlined')
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
describe('jump 1 — v5 to v6', () => {
|
|
142
|
+
it('turns a ListItem with removed props into a ListItemButton', () => {
|
|
143
|
+
const output = run(
|
|
144
|
+
[
|
|
145
|
+
"import { ListItem } from '@mui/material'",
|
|
146
|
+
'const A = () => <ListItem button selected>x</ListItem>',
|
|
147
|
+
].join('\n'),
|
|
148
|
+
{ jump: 'v5-v6' },
|
|
149
|
+
)
|
|
150
|
+
expect(output).toContain('<ListItemButton selected>')
|
|
151
|
+
expect(output).toContain('</ListItemButton>')
|
|
152
|
+
expect(output).toContain('ListItemButton')
|
|
153
|
+
expect(output).not.toContain('<ListItem ')
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
it("moves Typography's color callback into sx and leaves the dot path", () => {
|
|
157
|
+
const callback = run(
|
|
158
|
+
'<Typography color={(theme) => theme.palette.text.secondary} />',
|
|
159
|
+
{ jump: 'v5-v6' },
|
|
160
|
+
)
|
|
161
|
+
expect(callback).toContain('sx={{')
|
|
162
|
+
expect(callback).toContain('color: (theme) => theme.palette.text.secondary')
|
|
163
|
+
|
|
164
|
+
// The dot-path spelling survives until v9; touching it here would be a
|
|
165
|
+
// change the reader cannot explain at this jump.
|
|
166
|
+
const dotPath = "<Typography color='text.secondary' />"
|
|
167
|
+
expect(run(dotPath, { jump: 'v5-v6' })).toBe(dotPath)
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
it('rewrites an hr query a vertical Divider no longer answers', () => {
|
|
171
|
+
const output = run(
|
|
172
|
+
"expect(container.querySelectorAll('hr')).toHaveLength(2)",
|
|
173
|
+
{ jump: 'v5-v6' },
|
|
174
|
+
)
|
|
175
|
+
expect(output).toContain(".querySelectorAll('.MuiDivider-root')")
|
|
176
|
+
})
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
describe('jump 2 — v6 to v7', () => {
|
|
180
|
+
it('converts Grid breakpoints into size', () => {
|
|
181
|
+
const output = run('<Grid container><Grid item xs={12} md={8} /></Grid>', {
|
|
182
|
+
jump: 'v6-v7',
|
|
183
|
+
})
|
|
184
|
+
expect(output).toContain('size={{')
|
|
185
|
+
expect(output).toContain('xs: 12')
|
|
186
|
+
expect(output).toContain('md: 8')
|
|
187
|
+
expect(output).not.toContain('item')
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
it('collapses a single breakpoint instead of writing an object', () => {
|
|
191
|
+
expect(run('<Grid item xs={8} />', { jump: 'v6-v7' })).toContain('size={8}')
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
it('reads a bare breakpoint as the v7 grow', () => {
|
|
195
|
+
expect(run('<Grid item xs />', { jump: 'v6-v7' })).toContain(
|
|
196
|
+
"size={'grow'}",
|
|
197
|
+
)
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
it('renames GridLegacy and migrates its props in the same run', () => {
|
|
201
|
+
const output = run(
|
|
202
|
+
[
|
|
203
|
+
"import { GridLegacy } from '@mui/material'",
|
|
204
|
+
'const A = () => <GridLegacy item xs={6} />',
|
|
205
|
+
].join('\n'),
|
|
206
|
+
{ jump: 'v6-v7' },
|
|
207
|
+
)
|
|
208
|
+
expect(output).not.toContain('GridLegacy')
|
|
209
|
+
expect(output).toContain('size={6}')
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
it('flags a Grid container that sets no width of its own', () => {
|
|
213
|
+
const output = run('<Grid container spacing={2} />', { jump: 'v6-v7' })
|
|
214
|
+
expect(output).toContain('TODO(mui9)')
|
|
215
|
+
expect(output).toContain('shrinks to its content')
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
it('leaves a Grid container that already sets a width alone', () => {
|
|
219
|
+
const output = run("<Grid container sx={{ width: '100%' }} />", {
|
|
220
|
+
jump: 'v6-v7',
|
|
221
|
+
})
|
|
222
|
+
expect(output).not.toContain('TODO(mui9)')
|
|
223
|
+
})
|
|
224
|
+
|
|
225
|
+
it('sends a named deep import to the package root, and renames Variant', () => {
|
|
226
|
+
const output = run(
|
|
227
|
+
"import type { Variant } from '@mui/material/styles/createTypography'",
|
|
228
|
+
{ jump: 'v6-v7' },
|
|
229
|
+
)
|
|
230
|
+
expect(output).toContain("from '@mui/material'")
|
|
231
|
+
expect(output).toContain('TypographyVariant')
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
it('keeps a default deep import on its own entry point', () => {
|
|
235
|
+
// `@mui/material` has no default export to take `Box` from.
|
|
236
|
+
const output = run("import Box from '@mui/material/Box/Box'", {
|
|
237
|
+
jump: 'v6-v7',
|
|
238
|
+
})
|
|
239
|
+
expect(output).toContain("from '@mui/material/Box'")
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
it('does not strand a named type on a component entry point', () => {
|
|
243
|
+
// `@mui/material/TablePagination` does not re-export this; the root does.
|
|
244
|
+
const output = run(
|
|
245
|
+
"import type { TablePaginationActionsProps } from '@mui/material/TablePagination/TablePaginationActions'",
|
|
246
|
+
{ jump: 'v6-v7' },
|
|
247
|
+
)
|
|
248
|
+
expect(output).toContain("from '@mui/material'")
|
|
249
|
+
})
|
|
250
|
+
|
|
251
|
+
it('moves the graduated lab imports to core and leaves Timeline behind', () => {
|
|
252
|
+
const output = run("import { Alert, Timeline } from '@mui/lab'", {
|
|
253
|
+
jump: 'v6-v7',
|
|
254
|
+
})
|
|
255
|
+
expect(output).toMatch(/import \{\s*Alert\s*\} from '@mui\/material'/)
|
|
256
|
+
expect(output).toMatch(/Timeline.*from '@mui\/lab'/)
|
|
257
|
+
})
|
|
258
|
+
|
|
259
|
+
it('keeps a lab import type-only when it was type-only', () => {
|
|
260
|
+
// Landing `import type { AlertProps }` as a value import creates a
|
|
261
|
+
// runtime binding for something that only exists in the type system.
|
|
262
|
+
const output = run("import type { AlertProps } from '@mui/lab'", {
|
|
263
|
+
jump: 'v6-v7',
|
|
264
|
+
})
|
|
265
|
+
expect(output).toMatch(
|
|
266
|
+
/import type \{[^}]*AlertProps[^}]*\} from '@mui\/material'/,
|
|
267
|
+
)
|
|
268
|
+
})
|
|
269
|
+
|
|
270
|
+
it('removes both spellings of the dead Slider narrowing', () => {
|
|
271
|
+
const cast = run('<Slider onChange={(_, v) => setWidth(v as number)} />', {
|
|
272
|
+
jump: 'v6-v7',
|
|
273
|
+
})
|
|
274
|
+
expect(cast).toContain('setWidth(v)')
|
|
275
|
+
|
|
276
|
+
const guard = run(
|
|
277
|
+
'<Slider onChange={(_, v) => setWidth(Array.isArray(v) ? v[0]! : v)} />',
|
|
278
|
+
{ jump: 'v6-v7' },
|
|
279
|
+
)
|
|
280
|
+
expect(guard).toContain('setWidth(v)')
|
|
281
|
+
})
|
|
282
|
+
})
|
|
283
|
+
|
|
284
|
+
describe('jump 3 — v7 to v9', () => {
|
|
285
|
+
it('moves system props into sx', () => {
|
|
286
|
+
const output = run("<Box display='flex' mt={2} />", { jump: 'v7-v9' })
|
|
287
|
+
expect(output).toContain('sx={{')
|
|
288
|
+
expect(output).toContain("display: 'flex'")
|
|
289
|
+
expect(output).toContain('mt: 2')
|
|
290
|
+
})
|
|
291
|
+
|
|
292
|
+
it('merges into an sx that is already there without overwriting it', () => {
|
|
293
|
+
const output = run("<Box display='flex' sx={{ mt: 4 }} />", {
|
|
294
|
+
jump: 'v7-v9',
|
|
295
|
+
})
|
|
296
|
+
expect(output).toContain('mt: 4')
|
|
297
|
+
expect(output).toContain("display: 'flex'")
|
|
298
|
+
})
|
|
299
|
+
|
|
300
|
+
it('flags a palette path written into an inline style', () => {
|
|
301
|
+
const output = run("<div style={{ backgroundColor: 'primary.main' }} />", {
|
|
302
|
+
jump: 'v7-v9',
|
|
303
|
+
})
|
|
304
|
+
expect(output).toContain('TODO(mui9)')
|
|
305
|
+
expect(output).toContain('primary.main')
|
|
306
|
+
// Annotated, never rewritten: only the author knows whether the element
|
|
307
|
+
// should take `sx` instead or resolve the path before painting.
|
|
308
|
+
expect(output).toContain("style={{ backgroundColor: 'primary.main' }}")
|
|
309
|
+
})
|
|
310
|
+
|
|
311
|
+
it('leaves an inline style holding a real CSS colour alone', () => {
|
|
312
|
+
const source =
|
|
313
|
+
"<div style={{ backgroundColor: '#ff0000', color: color }} />"
|
|
314
|
+
expect(run(source, { jump: 'v7-v9' })).not.toContain('TODO(mui9)')
|
|
315
|
+
})
|
|
316
|
+
|
|
317
|
+
it('folds prop bags into slotProps', () => {
|
|
318
|
+
const output = run('<Dialog PaperProps={{ elevation: 0 }} />', {
|
|
319
|
+
jump: 'v7-v9',
|
|
320
|
+
})
|
|
321
|
+
expect(output).toContain('slotProps={{')
|
|
322
|
+
expect(output).toContain('paper:')
|
|
323
|
+
expect(output).not.toContain('PaperProps')
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
it('renames inputProps to the htmlInput slot, not to input', () => {
|
|
327
|
+
// The two are different slots and the names invite the wrong mapping.
|
|
328
|
+
const output = run('<TextField inputProps={{ maxLength: 3 }} />', {
|
|
329
|
+
jump: 'v7-v9',
|
|
330
|
+
})
|
|
331
|
+
expect(output).toContain('htmlInput:')
|
|
332
|
+
})
|
|
333
|
+
|
|
334
|
+
it('renames components and componentsProps', () => {
|
|
335
|
+
const output = run(
|
|
336
|
+
'<Badge components={{ Root: R }} componentsProps={{}} />',
|
|
337
|
+
{
|
|
338
|
+
jump: 'v7-v9',
|
|
339
|
+
},
|
|
340
|
+
)
|
|
341
|
+
expect(output).toContain('slots={{')
|
|
342
|
+
expect(output).toContain('slotProps={{}}')
|
|
343
|
+
})
|
|
344
|
+
|
|
345
|
+
it('moves a dot-path color into sx and leaves the component prop alone', () => {
|
|
346
|
+
expect(run("<Chip color='text.secondary' />", { jump: 'v7-v9' })).toContain(
|
|
347
|
+
'sx=',
|
|
348
|
+
)
|
|
349
|
+
const ownProp = "<Chip color='primary' />"
|
|
350
|
+
expect(run(ownProp, { jump: 'v7-v9' })).toBe(ownProp)
|
|
351
|
+
})
|
|
352
|
+
|
|
353
|
+
it('removes disableEscapeKeyDown, and says so where behaviour changes', () => {
|
|
354
|
+
const silent = run('<Popover disableEscapeKeyDown />', { jump: 'v7-v9' })
|
|
355
|
+
expect(silent).not.toContain('disableEscapeKeyDown')
|
|
356
|
+
expect(silent).not.toContain('TODO(mui9)')
|
|
357
|
+
|
|
358
|
+
const behavioural = run('<Dialog disableEscapeKeyDown onClose={close} />', {
|
|
359
|
+
jump: 'v7-v9',
|
|
360
|
+
})
|
|
361
|
+
expect(behavioural).not.toContain('disableEscapeKeyDown')
|
|
362
|
+
expect(behavioural).toContain('escapeKeyDown')
|
|
363
|
+
})
|
|
364
|
+
|
|
365
|
+
it('writes a file whose only change is an annotation', () => {
|
|
366
|
+
// A rule that cannot rewrite falls back to a comment. If that fallback
|
|
367
|
+
// does not count as a change, `transform` returns undefined and the
|
|
368
|
+
// comment is dropped on the floor — the rule reports nothing and the
|
|
369
|
+
// breakage ships. One case per fallback:
|
|
370
|
+
const fallbacks = [
|
|
371
|
+
"<Typography fontWeight='medium' sx={styles.noWrap}>hi</Typography>",
|
|
372
|
+
'<Dialog PaperProps={{ elevation: 0 }} slotProps={other} />',
|
|
373
|
+
"<Chip color='text.secondary' sx={styles.chip} />",
|
|
374
|
+
]
|
|
375
|
+
|
|
376
|
+
for (const source of fallbacks) {
|
|
377
|
+
expect(run(source, { jump: 'v7-v9' })).toContain('TODO(mui9)')
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
expect(
|
|
381
|
+
run('<Typography color={(t) => t.palette.error.main} sx={styles.x} />', {
|
|
382
|
+
jump: 'v5-v6',
|
|
383
|
+
}),
|
|
384
|
+
).toContain('TODO(mui9)')
|
|
385
|
+
})
|
|
386
|
+
|
|
387
|
+
it('leaves a lookalike prop bag on a third-party component alone', () => {
|
|
388
|
+
const source = [
|
|
389
|
+
"import { LassoToolsUI } from '@carto/ps-react-ui'",
|
|
390
|
+
'<LassoToolsUI PaperProps={{ elevation: 0 }} />',
|
|
391
|
+
].join('\n')
|
|
392
|
+
const output = run(source, { jump: 'v7-v9' })
|
|
393
|
+
expect(output).toContain('PaperProps=')
|
|
394
|
+
expect(output).not.toContain('slotProps')
|
|
395
|
+
expect(output).not.toContain('TODO(mui9)')
|
|
396
|
+
})
|
|
397
|
+
|
|
398
|
+
it('flags a slot rewrite that landed off Material UI', () => {
|
|
399
|
+
const thirdParty = [
|
|
400
|
+
"import { LassoToolsUI } from '@carto/ps-react-ui'",
|
|
401
|
+
'<LassoToolsUI slotProps={{ paper: { elevation: 0 } }} />',
|
|
402
|
+
].join('\n')
|
|
403
|
+
const flagged = run(thirdParty, { jump: 'v7-v9' })
|
|
404
|
+
expect(flagged).toContain('TODO(mui9)')
|
|
405
|
+
expect(flagged).toContain('@carto/ps-react-ui')
|
|
406
|
+
|
|
407
|
+
// The same prop on a real MUI component is the rewrite working.
|
|
408
|
+
const mui = [
|
|
409
|
+
"import { Dialog } from '@mui/material'",
|
|
410
|
+
'<Dialog slotProps={{ paper: { elevation: 0 } }} />',
|
|
411
|
+
].join('\n')
|
|
412
|
+
expect(run(mui, { jump: 'v7-v9' })).not.toContain('TODO(mui9)')
|
|
413
|
+
|
|
414
|
+
// A locally defined component is the author's on both sides.
|
|
415
|
+
const local = [
|
|
416
|
+
"import { Panel } from './panel'",
|
|
417
|
+
'<Panel slotProps={{ paper: {} }} />',
|
|
418
|
+
].join('\n')
|
|
419
|
+
expect(run(local, { jump: 'v7-v9' })).toContain('TODO(mui9)')
|
|
420
|
+
})
|
|
421
|
+
|
|
422
|
+
it('turns TablePagination slots.actions back into ActionsComponent', () => {
|
|
423
|
+
const output = run('<TablePagination slots={{ actions: Actions }} />', {
|
|
424
|
+
jump: 'v7-v9',
|
|
425
|
+
})
|
|
426
|
+
expect(output).toContain('ActionsComponent={Actions}')
|
|
427
|
+
expect(output).not.toContain('slots=')
|
|
428
|
+
})
|
|
429
|
+
|
|
430
|
+
it('renames the Autocomplete tag renderer and its component props', () => {
|
|
431
|
+
const output = run(
|
|
432
|
+
'<Autocomplete renderTags={render} PaperComponent={P} />',
|
|
433
|
+
{ jump: 'v7-v9' },
|
|
434
|
+
)
|
|
435
|
+
expect(output).toContain('renderValue=')
|
|
436
|
+
expect(output).toContain('paper: P')
|
|
437
|
+
})
|
|
438
|
+
|
|
439
|
+
it('splits a consolidated class name in a selector', () => {
|
|
440
|
+
const output = run(
|
|
441
|
+
"const S = styled(Box)({ '& .MuiButton-textPrimary': { color: 'red' } })",
|
|
442
|
+
{ jump: 'v7-v9' },
|
|
443
|
+
)
|
|
444
|
+
expect(output).toContain('.MuiButton-text.MuiButton-colorPrimary')
|
|
445
|
+
})
|
|
446
|
+
|
|
447
|
+
it('flags a styled() wrapper aimed at MUI internals', () => {
|
|
448
|
+
const output = run(
|
|
449
|
+
"const S = styled(Box)({ '& .MuiListItemIcon-root': { minWidth: 56 } })",
|
|
450
|
+
{ jump: 'v7-v9' },
|
|
451
|
+
)
|
|
452
|
+
expect(output).toContain('TODO(mui9)')
|
|
453
|
+
})
|
|
454
|
+
|
|
455
|
+
it('does not flag a styled() wrapper that owns all its selectors', () => {
|
|
456
|
+
const output = run("const S = styled(Box)({ color: 'red' })", {
|
|
457
|
+
jump: 'v7-v9',
|
|
458
|
+
})
|
|
459
|
+
expect(output).not.toContain('TODO(mui9)')
|
|
460
|
+
})
|
|
461
|
+
|
|
462
|
+
it('renames a removed icon to the one with identical path data', () => {
|
|
463
|
+
const output = run(
|
|
464
|
+
"import { ErrorOutline } from '@mui/icons-material'\nconst A = () => <ErrorOutline />",
|
|
465
|
+
{ jump: 'v7-v9' },
|
|
466
|
+
)
|
|
467
|
+
expect(output).toContain('ErrorOutlineOutlined')
|
|
468
|
+
// NOT `ErrorOutlined`, which compiles and draws a filled circle.
|
|
469
|
+
expect(output).not.toMatch(/\bErrorOutlined\b/)
|
|
470
|
+
})
|
|
471
|
+
|
|
472
|
+
it('renames the data-testid that goes with the icon', () => {
|
|
473
|
+
expect(
|
|
474
|
+
run("screen.getByTestId('DeleteOutlineIcon')", { jump: 'v7-v9' }),
|
|
475
|
+
).toContain('DeleteOutlineOutlinedIcon')
|
|
476
|
+
})
|
|
477
|
+
|
|
478
|
+
it('flags a removed icon that has no equivalent instead of guessing', () => {
|
|
479
|
+
const output = run("import { PeopleOutline } from '@mui/icons-material'", {
|
|
480
|
+
jump: 'v7-v9',
|
|
481
|
+
})
|
|
482
|
+
expect(output).toContain('TODO(mui9)')
|
|
483
|
+
expect(output).toContain('PeopleOutline')
|
|
484
|
+
})
|
|
485
|
+
|
|
486
|
+
it('asks about a name that looks like a naive rename', () => {
|
|
487
|
+
const output = run("import { ErrorOutlined } from '@mui/icons-material'", {
|
|
488
|
+
jump: 'v7-v9',
|
|
489
|
+
})
|
|
490
|
+
expect(output).toContain('TODO(mui9)')
|
|
491
|
+
expect(output).toContain('is NOT ErrorOutline')
|
|
492
|
+
})
|
|
493
|
+
|
|
494
|
+
it('turns a role attribute selector into a role query', () => {
|
|
495
|
+
expect(
|
|
496
|
+
run('page.locator(\'[role="button"]\')', { jump: 'v7-v9' }),
|
|
497
|
+
).toContain("getByRole('button')")
|
|
498
|
+
})
|
|
499
|
+
|
|
500
|
+
it('flags a MenuItem mounted bare in a test', () => {
|
|
501
|
+
const bare = run('render(<MenuItem />)', { jump: 'v7-v9' })
|
|
502
|
+
expect(bare).toContain('TODO(mui9)')
|
|
503
|
+
|
|
504
|
+
const wrapped = run('render(<MenuList><MenuItem /></MenuList>)', {
|
|
505
|
+
jump: 'v7-v9',
|
|
506
|
+
})
|
|
507
|
+
expect(wrapped).not.toContain('TODO(mui9)')
|
|
508
|
+
})
|
|
509
|
+
})
|
|
510
|
+
|
|
511
|
+
describe('jump 4 — Meridian 5', () => {
|
|
512
|
+
it('reads the exported theme and drops the cast', () => {
|
|
513
|
+
const output = run(
|
|
514
|
+
[
|
|
515
|
+
"import { cartoThemeOptions } from '@carto/meridian-ds/theme'",
|
|
516
|
+
'const t = cartoThemeOptions as unknown as Theme',
|
|
517
|
+
].join('\n'),
|
|
518
|
+
{ jump: 'meridian-5' },
|
|
519
|
+
)
|
|
520
|
+
expect(output).toContain('theme')
|
|
521
|
+
expect(output).not.toContain('cartoThemeOptions')
|
|
522
|
+
expect(output).not.toContain('as unknown as')
|
|
523
|
+
})
|
|
524
|
+
|
|
525
|
+
it('aliases the import when the file already binds `theme`', () => {
|
|
526
|
+
// A consumer that re-exports its own `theme` is the normal case, so the
|
|
527
|
+
// import has to come in under another name and every reference has to
|
|
528
|
+
// follow it.
|
|
529
|
+
const output = run(
|
|
530
|
+
[
|
|
531
|
+
"import { cartoThemeOptions } from '@carto/meridian-ds/theme'",
|
|
532
|
+
'export const theme = createTheme(cartoThemeOptions as ThemeOptions)',
|
|
533
|
+
].join('\n'),
|
|
534
|
+
{ jump: 'meridian-5' },
|
|
535
|
+
)
|
|
536
|
+
expect(output).toContain('theme as cartoTheme')
|
|
537
|
+
expect(output).toContain('cartoTheme as ThemeOptions')
|
|
538
|
+
expect(output).toContain('export const theme =')
|
|
539
|
+
})
|
|
540
|
+
|
|
541
|
+
it('drops the `Theme` import the removed cast was the only user of', () => {
|
|
542
|
+
const output = run(
|
|
543
|
+
[
|
|
544
|
+
"import { createTheme, type Theme } from '@mui/material'",
|
|
545
|
+
"import { cartoThemeOptions } from '@carto/meridian-ds/theme'",
|
|
546
|
+
'const t = createTheme(cartoThemeOptions as unknown as Theme)',
|
|
547
|
+
].join('\n'),
|
|
548
|
+
{ jump: 'meridian-5' },
|
|
549
|
+
)
|
|
550
|
+
expect(output).not.toMatch(/type Theme/)
|
|
551
|
+
expect(output).toContain('createTheme')
|
|
552
|
+
})
|
|
553
|
+
|
|
554
|
+
it('keeps `Theme` when something else still uses it', () => {
|
|
555
|
+
const output = run(
|
|
556
|
+
[
|
|
557
|
+
"import { type Theme } from '@mui/material'",
|
|
558
|
+
"import { cartoThemeOptions } from '@carto/meridian-ds/theme'",
|
|
559
|
+
'const t = cartoThemeOptions as unknown as Theme',
|
|
560
|
+
'export function use(x: Theme): Theme { return x }',
|
|
561
|
+
].join('\n'),
|
|
562
|
+
{ jump: 'meridian-5' },
|
|
563
|
+
)
|
|
564
|
+
expect(output).toContain('Theme')
|
|
565
|
+
})
|
|
566
|
+
|
|
567
|
+
it('renames the Meridian 3 API', () => {
|
|
568
|
+
expect(
|
|
569
|
+
run("import { AiTool } from '@carto/meridian-ds'", {
|
|
570
|
+
jump: 'meridian-5',
|
|
571
|
+
}),
|
|
572
|
+
).toContain('McpTool')
|
|
573
|
+
})
|
|
574
|
+
|
|
575
|
+
it('flags a removed widget only when it comes from Meridian', () => {
|
|
576
|
+
const fromMeridian = run(
|
|
577
|
+
"import { PieWidgetUI } from '@carto/meridian-ds'",
|
|
578
|
+
{ jump: 'meridian-5' },
|
|
579
|
+
)
|
|
580
|
+
expect(fromMeridian).toContain('TODO(mui9)')
|
|
581
|
+
|
|
582
|
+
const ownComponent = "import { PieWidgetUI } from './widgets'"
|
|
583
|
+
expect(run(ownComponent, { jump: 'meridian-5' })).toBe(ownComponent)
|
|
584
|
+
})
|
|
585
|
+
})
|
|
586
|
+
|
|
587
|
+
describe('ps-react-ui', () => {
|
|
588
|
+
const jump = 'ps-react-ui'
|
|
589
|
+
|
|
590
|
+
it('moves every widgets-v2 specifier, mocks and dynamic imports too', () => {
|
|
591
|
+
const output = run(
|
|
592
|
+
[
|
|
593
|
+
"import { Widget } from '@carto/ps-react-ui/widgets-v2'",
|
|
594
|
+
"import { BarSkeleton } from '@carto/ps-react-ui/widgets-v2/bar'",
|
|
595
|
+
"vi.mock('@carto/ps-react-ui/widgets-v2/stores')",
|
|
596
|
+
"const pie = () => import('@carto/ps-react-ui/widgets-v2/pie')",
|
|
597
|
+
].join('\n'),
|
|
598
|
+
{ jump },
|
|
599
|
+
)
|
|
600
|
+
expect(output).not.toContain('widgets-v2')
|
|
601
|
+
expect(output).toContain("from '@carto/ps-react-ui/widgets'")
|
|
602
|
+
expect(output).toContain("from '@carto/ps-react-ui/widgets/bar'")
|
|
603
|
+
expect(output).toContain("vi.mock('@carto/ps-react-ui/widgets/stores')")
|
|
604
|
+
expect(output).toContain("import('@carto/ps-react-ui/widgets/pie')")
|
|
605
|
+
})
|
|
606
|
+
|
|
607
|
+
it('moves the specifier in docs as well', () => {
|
|
608
|
+
const mdx =
|
|
609
|
+
"```tsx\nimport { Widget } from '@carto/ps-react-ui/widgets-v2'\n```"
|
|
610
|
+
expect(run(mdx, { jump }, 'docs/widgets.mdx')).toBe(
|
|
611
|
+
"```tsx\nimport { Widget } from '@carto/ps-react-ui/widgets'\n```",
|
|
612
|
+
)
|
|
613
|
+
})
|
|
614
|
+
|
|
615
|
+
it('flags a name only v1 exported, and says which', () => {
|
|
616
|
+
const output = run(
|
|
617
|
+
"import { barConfig, BarSkeleton } from '@carto/ps-react-ui/widgets/bar'",
|
|
618
|
+
{ jump },
|
|
619
|
+
)
|
|
620
|
+
expect(output).toMatch(/TODO\(mui9\).*`barConfig`/)
|
|
621
|
+
expect(output).not.toMatch(/TODO\(mui9\).*BarSkeleton/)
|
|
622
|
+
})
|
|
623
|
+
|
|
624
|
+
it('flags a v1 re-export too', () => {
|
|
625
|
+
const output = run(
|
|
626
|
+
"export { WidgetWrapper } from '@carto/ps-react-ui/widgets'",
|
|
627
|
+
{ jump },
|
|
628
|
+
)
|
|
629
|
+
expect(output).toContain('TODO(mui9)')
|
|
630
|
+
})
|
|
631
|
+
|
|
632
|
+
it('leaves v2 imports alone, before and after the rename', () => {
|
|
633
|
+
// A second run sees v2 on the `widgets` paths; flagging it there would
|
|
634
|
+
// bury the real v1 leftovers.
|
|
635
|
+
const v2 = "import { Widget } from '@carto/ps-react-ui/widgets-v2'"
|
|
636
|
+
const once = run(v2, { jump })
|
|
637
|
+
expect(once).not.toContain('TODO')
|
|
638
|
+
expect(run(once, { jump })).toBe(once)
|
|
639
|
+
})
|
|
640
|
+
|
|
641
|
+
it('ignores the same names from any other module', () => {
|
|
642
|
+
const own = "import { WidgetWrapper } from './widgets'"
|
|
643
|
+
expect(run(own, { jump })).toBe(own)
|
|
644
|
+
})
|
|
645
|
+
})
|
|
646
|
+
|
|
647
|
+
describe('annotations', () => {
|
|
648
|
+
const STYLED =
|
|
649
|
+
"export const S = styled(Box)({ '& .MuiListItemIcon-root': { minWidth: 56 } })"
|
|
650
|
+
|
|
651
|
+
it('comments above the export, not between export and const', () => {
|
|
652
|
+
const output = run(STYLED, { jump: 'v7-v9' })
|
|
653
|
+
expect(output).toMatch(/TODO\(mui9\)[\s\S]*export const S/)
|
|
654
|
+
expect(output).not.toMatch(/export\s*\/\/ TODO/)
|
|
655
|
+
})
|
|
656
|
+
|
|
657
|
+
it('does not stack a second comment on a second run', () => {
|
|
658
|
+
// The codemod is run again after a jump is fixed up, and an annotation
|
|
659
|
+
// that re-anchors on a different node each time multiplies.
|
|
660
|
+
const once = run(STYLED, { jump: 'v7-v9' })
|
|
661
|
+
const twice = run(once, { jump: 'v7-v9' })
|
|
662
|
+
expect(twice).toBe(once)
|
|
663
|
+
expect(once.match(/TODO\(mui9\)/g)).toHaveLength(1)
|
|
664
|
+
})
|
|
665
|
+
})
|
|
666
|
+
|
|
667
|
+
describe('names that collide with Object.prototype', () => {
|
|
668
|
+
// Every lookup table here is keyed by a name read out of the source. A
|
|
669
|
+
// plain object indexed that way answers for `toString`, `valueOf`,
|
|
670
|
+
// `constructor` and friends with whatever `Object.prototype` holds — and
|
|
671
|
+
// the function it returns is truthy, so a rename rule accepted it and
|
|
672
|
+
// printed its source into the file. `value.toString()` came out as
|
|
673
|
+
// `value.function toString() { [native code] }()`, which does not parse.
|
|
674
|
+
const COLLIDING = [
|
|
675
|
+
'toString',
|
|
676
|
+
'valueOf',
|
|
677
|
+
'constructor',
|
|
678
|
+
'hasOwnProperty',
|
|
679
|
+
'propertyIsEnumerable',
|
|
680
|
+
]
|
|
681
|
+
|
|
682
|
+
it('leaves them alone at every jump', () => {
|
|
683
|
+
for (const name of COLLIDING) {
|
|
684
|
+
for (const jump of JUMPS) {
|
|
685
|
+
const source = `const a = value.${name}()`
|
|
686
|
+
expect(run(source, { jump }), `${name} at ${jump}`).toBe(source)
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
})
|
|
690
|
+
|
|
691
|
+
it('reports no replacement for one in the icon table', () => {
|
|
692
|
+
for (const name of COLLIDING) {
|
|
693
|
+
expect(replacementFor(name), name).toBeUndefined()
|
|
694
|
+
}
|
|
695
|
+
})
|
|
696
|
+
})
|
|
697
|
+
|
|
698
|
+
describe('class consolidation', () => {
|
|
699
|
+
it('splits a compound class into slot plus modifier', () => {
|
|
700
|
+
expect(consolidateClassName('MuiButton-textPrimary')).toEqual([
|
|
701
|
+
'MuiButton-text',
|
|
702
|
+
'MuiButton-colorPrimary',
|
|
703
|
+
])
|
|
704
|
+
expect(consolidateClassName('MuiChip-labelSmall')).toEqual([
|
|
705
|
+
'MuiChip-label',
|
|
706
|
+
'MuiChip-sizeSmall',
|
|
707
|
+
])
|
|
708
|
+
})
|
|
709
|
+
|
|
710
|
+
it('handles both spellings of the size modifier', () => {
|
|
711
|
+
// `textSizeSmall` on Button, plain `labelSmall` on Chip.
|
|
712
|
+
expect(consolidateClassName('MuiButton-textSizeSmall')).toEqual([
|
|
713
|
+
'MuiButton-text',
|
|
714
|
+
'MuiButton-sizeSmall',
|
|
715
|
+
])
|
|
716
|
+
})
|
|
717
|
+
|
|
718
|
+
it('leaves a class that is already a v9 one alone', () => {
|
|
719
|
+
// These are the RESULT of the consolidation; splitting them again would
|
|
720
|
+
// produce `MuiButton-color`, which does not exist.
|
|
721
|
+
expect(consolidateClassName('MuiButton-colorPrimary')).toBeNull()
|
|
722
|
+
expect(consolidateClassName('MuiChip-sizeSmall')).toBeNull()
|
|
723
|
+
expect(consolidateClassName('MuiButton-root')).toBeNull()
|
|
724
|
+
})
|
|
725
|
+
|
|
726
|
+
it('keeps the separator a selector needs and a class list needs', () => {
|
|
727
|
+
expect(consolidateSelectors('.MuiButton-textPrimary')).toBe(
|
|
728
|
+
'.MuiButton-text.MuiButton-colorPrimary',
|
|
729
|
+
)
|
|
730
|
+
expect(consolidateSelectors('MuiButton-textPrimary')).toBe(
|
|
731
|
+
'MuiButton-text MuiButton-colorPrimary',
|
|
732
|
+
)
|
|
733
|
+
})
|
|
734
|
+
})
|
|
735
|
+
|
|
736
|
+
describe('the removed icon table', () => {
|
|
737
|
+
it('appends Outlined to the whole name, never swapping the suffix', () => {
|
|
738
|
+
for (const [removed, replacement] of Object.entries(
|
|
739
|
+
REMOVED_OUTLINE_ICONS,
|
|
740
|
+
)) {
|
|
741
|
+
if (replacement === null) continue
|
|
742
|
+
expect(replacement, removed).toBe(`${removed}Outlined`)
|
|
743
|
+
}
|
|
744
|
+
})
|
|
745
|
+
|
|
746
|
+
it('admits the four glyphs v9 has no equivalent for', () => {
|
|
747
|
+
const missing = Object.entries(REMOVED_OUTLINE_ICONS)
|
|
748
|
+
.filter(([, replacement]) => replacement === null)
|
|
749
|
+
.map(([name]) => name)
|
|
750
|
+
expect(missing).toEqual([
|
|
751
|
+
'CheckCircleOutline',
|
|
752
|
+
'DoneOutline',
|
|
753
|
+
'ModeEditOutline',
|
|
754
|
+
'PeopleOutline',
|
|
755
|
+
])
|
|
756
|
+
})
|
|
757
|
+
|
|
758
|
+
it('covers all 17 removed icons', () => {
|
|
759
|
+
expect(Object.keys(REMOVED_OUTLINE_ICONS)).toHaveLength(17)
|
|
760
|
+
})
|
|
761
|
+
})
|
|
762
|
+
|
|
763
|
+
describe('the jump list', () => {
|
|
764
|
+
it('has a rule for every jump', () => {
|
|
765
|
+
for (const jump of JUMPS) {
|
|
766
|
+
expect(
|
|
767
|
+
RULES.some((rule) => rule.jump === jump),
|
|
768
|
+
jump,
|
|
769
|
+
).toBe(true)
|
|
770
|
+
}
|
|
771
|
+
})
|
|
772
|
+
})
|