@mui/codemod 5.10.12 → 5.10.14
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/node/util/getJSExports.js +0 -6
- package/node/util/memoize.js +0 -4
- package/node/util/propsToObject.js +0 -6
- package/node/util/readFile.js +0 -6
- package/node/util/renameClassKey.js +0 -2
- package/node/util/renameProps.js +0 -1
- package/node/v0.15.0/import-path.js +0 -6
- package/node/v0.15.0/import-path.test/actual.js +0 -5
- package/node/v0.15.0/import-path.test/expected.js +0 -5
- package/node/v1.0.0/color-imports.js +12 -17
- package/node/v1.0.0/color-imports.test/actual.js +0 -3
- package/node/v1.0.0/color-imports.test/expected.js +0 -9
- package/node/v1.0.0/import-path.js +4 -8
- package/node/v1.0.0/import-path.test/actual.js +0 -28
- package/node/v1.0.0/import-path.test/expected.js +0 -61
- package/node/v1.0.0/menu-item-primary-text.js +0 -2
- package/node/v1.0.0/menu-item-primary-text.test/actual.js +1 -3
- package/node/v1.0.0/menu-item-primary-text.test/expected.js +1 -3
- package/node/v1.0.0/svg-icon-imports.js +6 -7
- package/node/v1.0.0/svg-icon-imports.test/actual.js +0 -4
- package/node/v1.0.0/svg-icon-imports.test/expected.js +0 -4
- package/node/v4.0.0/optimal-imports.js +0 -26
- package/node/v4.0.0/optimal-imports.test/actual.js +0 -64
- package/node/v4.0.0/optimal-imports.test/expected.js +0 -62
- package/node/v4.0.0/theme-spacing-api.js +7 -19
- package/node/v4.0.0/theme-spacing-api.test/actual.js +0 -11
- package/node/v4.0.0/theme-spacing-api.test/actual_destructured.js +0 -9
- package/node/v4.0.0/theme-spacing-api.test/expected.js +0 -11
- package/node/v4.0.0/theme-spacing-api.test/expected_destructured.js +0 -9
- package/node/v4.0.0/top-level-imports.js +2 -22
- package/node/v4.0.0/top-level-imports.test/actual.js +0 -58
- package/node/v4.0.0/top-level-imports.test/expected.js +0 -3
- package/node/v5.0.0/adapter-v4.js +3 -11
- package/node/v5.0.0/adapter-v4.test/actual.js +0 -1
- package/node/v5.0.0/adapter-v4.test/core-import.actual.js +0 -2
- package/node/v5.0.0/adapter-v4.test/core-import.expected.js +0 -2
- package/node/v5.0.0/adapter-v4.test/expected.js +0 -1
- package/node/v5.0.0/adapter-v4.test/no-styles-import.actual.js +0 -2
- package/node/v5.0.0/adapter-v4.test/no-styles-import.expected.js +0 -3
- package/node/v5.0.0/autocomplete-rename-closeicon.js +0 -3
- package/node/v5.0.0/autocomplete-rename-closeicon.test/actual.js +1 -3
- package/node/v5.0.0/autocomplete-rename-closeicon.test/expected.js +1 -3
- package/node/v5.0.0/autocomplete-rename-option.js +0 -3
- package/node/v5.0.0/autocomplete-rename-option.test/actual.js +1 -3
- package/node/v5.0.0/autocomplete-rename-option.test/expected.js +1 -3
- package/node/v5.0.0/avatar-circle-circular.js +0 -4
- package/node/v5.0.0/avatar-circle-circular.test/actual.js +1 -3
- package/node/v5.0.0/avatar-circle-circular.test/expected.js +1 -3
- package/node/v5.0.0/badge-overlap-value.js +0 -6
- package/node/v5.0.0/badge-overlap-value.test/actual.js +1 -5
- package/node/v5.0.0/badge-overlap-value.test/expected.js +1 -5
- package/node/v5.0.0/base-rename-components-to-slots.js +1 -11
- package/node/v5.0.0/base-rename-components-to-slots.test/actual.js +3 -9
- package/node/v5.0.0/base-rename-components-to-slots.test/expected.js +3 -9
- package/node/v5.0.0/box-borderradius-values.js +2 -2
- package/node/v5.0.0/box-borderradius-values.test/actual.js +1 -3
- package/node/v5.0.0/box-borderradius-values.test/expected.js +1 -3
- package/node/v5.0.0/box-rename-css.js +0 -3
- package/node/v5.0.0/box-rename-css.test/actual.js +1 -3
- package/node/v5.0.0/box-rename-css.test/expected.js +1 -3
- package/node/v5.0.0/box-rename-gap.js +0 -3
- package/node/v5.0.0/box-rename-gap.test/actual.js +1 -3
- package/node/v5.0.0/box-rename-gap.test/expected.js +1 -3
- package/node/v5.0.0/box-sx-prop.js +1 -5
- package/node/v5.0.0/box-sx-prop.test/actual.js +0 -10
- package/node/v5.0.0/box-sx-prop.test/alias-actual.js +0 -5
- package/node/v5.0.0/box-sx-prop.test/alias-expected.js +0 -4
- package/node/v5.0.0/box-sx-prop.test/expected.js +0 -10
- package/node/v5.0.0/button-color-prop.js +0 -2
- package/node/v5.0.0/button-color-prop.test/actual.js +1 -3
- package/node/v5.0.0/button-color-prop.test/expected.js +1 -3
- package/node/v5.0.0/chip-variant-prop.js +0 -2
- package/node/v5.0.0/chip-variant-prop.test/actual.js +1 -3
- package/node/v5.0.0/chip-variant-prop.test/expected.js +1 -3
- package/node/v5.0.0/circularprogress-variant.js +0 -4
- package/node/v5.0.0/circularprogress-variant.test/actual.js +1 -3
- package/node/v5.0.0/circularprogress-variant.test/expected.js +1 -3
- package/node/v5.0.0/collapse-rename-collapsedheight.js +0 -4
- package/node/v5.0.0/collapse-rename-collapsedheight.test/actual.js +1 -3
- package/node/v5.0.0/collapse-rename-collapsedheight.test/expected.js +1 -3
- package/node/v5.0.0/component-rename-prop.js +0 -3
- package/node/v5.0.0/component-rename-prop.test/actual.js +1 -3
- package/node/v5.0.0/component-rename-prop.test/expected.js +1 -3
- package/node/v5.0.0/core-styles-import.js +0 -3
- package/node/v5.0.0/core-styles-import.test/actual.js +0 -4
- package/node/v5.0.0/create-theme.js +0 -5
- package/node/v5.0.0/create-theme.test/actual.js +0 -2
- package/node/v5.0.0/create-theme.test/core-import.actual.js +0 -1
- package/node/v5.0.0/create-theme.test/core-import.expected.js +0 -1
- package/node/v5.0.0/create-theme.test/custom-fn.actual.js +0 -6
- package/node/v5.0.0/create-theme.test/custom-fn.expected.js +0 -6
- package/node/v5.0.0/create-theme.test/expected.js +0 -2
- package/node/v5.0.0/date-pickers-moved-to-x.js +1 -10
- package/node/v5.0.0/date-pickers-moved-to-x.test/actual-sub-module.js +0 -31
- package/node/v5.0.0/date-pickers-moved-to-x.test/expected-root-community.js +0 -1
- package/node/v5.0.0/date-pickers-moved-to-x.test/expected-root-pro.js +0 -1
- package/node/v5.0.0/date-pickers-moved-to-x.test/expected-sub-module.js +0 -29
- package/node/v5.0.0/dialog-props.js +0 -1
- package/node/v5.0.0/dialog-props.test/actual.js +1 -3
- package/node/v5.0.0/dialog-props.test/expected.js +1 -3
- package/node/v5.0.0/dialog-title-props.js +0 -1
- package/node/v5.0.0/dialog-title-props.test/actual.js +1 -3
- package/node/v5.0.0/dialog-title-props.test/expected.js +1 -3
- package/node/v5.0.0/emotion-prepend-cache.js +0 -3
- package/node/v5.0.0/emotion-prepend-cache.test/custom-naming.actual.js +0 -2
- package/node/v5.0.0/emotion-prepend-cache.test/custom-naming.expected.js +0 -2
- package/node/v5.0.0/emotion-prepend-cache.test/default-naming.actual.js +0 -2
- package/node/v5.0.0/emotion-prepend-cache.test/default-naming.expected.js +0 -2
- package/node/v5.0.0/emotion-prepend-cache.test/replace-existing-prepend.actual.js +0 -2
- package/node/v5.0.0/emotion-prepend-cache.test/replace-existing-prepend.expected.js +0 -2
- package/node/v5.0.0/expansion-panel-component.js +0 -1
- package/node/v5.0.0/expansion-panel-component.test/actual.js +1 -8
- package/node/v5.0.0/expansion-panel-component.test/expected.js +1 -8
- package/node/v5.0.0/fab-variant.js +0 -4
- package/node/v5.0.0/fab-variant.test/actual.js +1 -3
- package/node/v5.0.0/fab-variant.test/expected.js +1 -3
- package/node/v5.0.0/fade-rename-alpha.js +0 -3
- package/node/v5.0.0/fade-rename-alpha.test/actual.js +0 -2
- package/node/v5.0.0/fade-rename-alpha.test/expected.js +0 -2
- package/node/v5.0.0/grid-justify-justifycontent.js +0 -3
- package/node/v5.0.0/grid-justify-justifycontent.test/actual.js +1 -3
- package/node/v5.0.0/grid-justify-justifycontent.test/expected.js +1 -3
- package/node/v5.0.0/grid-list-component.js +0 -1
- package/node/v5.0.0/grid-list-component.test/actual.js +1 -7
- package/node/v5.0.0/grid-list-component.test/expected.js +1 -7
- package/node/v5.0.0/hidden-down-props.js +0 -3
- package/node/v5.0.0/icon-button-size.js +0 -2
- package/node/v5.0.0/icon-button-size.test/actual.js +1 -3
- package/node/v5.0.0/icon-button-size.test/expected.js +1 -3
- package/node/v5.0.0/jss-to-styled.js +20 -102
- package/node/v5.0.0/jss-to-styled.test/Anonymous.actual.js +0 -9
- package/node/v5.0.0/jss-to-styled.test/Anonymous.expected.js +0 -8
- package/node/v5.0.0/jss-to-styled.test/eighth.actual.js +0 -30
- package/node/v5.0.0/jss-to-styled.test/eighth.expected.js +2 -31
- package/node/v5.0.0/jss-to-styled.test/eleventh.actual.js +0 -7
- package/node/v5.0.0/jss-to-styled.test/eleventh.expected.js +0 -7
- package/node/v5.0.0/jss-to-styled.test/exportClass.actual.js +0 -8
- package/node/v5.0.0/jss-to-styled.test/exportClass.expected.js +0 -10
- package/node/v5.0.0/jss-to-styled.test/exportFunction.actual.js +0 -8
- package/node/v5.0.0/jss-to-styled.test/exportFunction.expected.js +0 -9
- package/node/v5.0.0/jss-to-styled.test/fifth.actual.js +0 -12
- package/node/v5.0.0/jss-to-styled.test/fifth.expected.js +0 -12
- package/node/v5.0.0/jss-to-styled.test/first.actual.js +1 -32
- package/node/v5.0.0/jss-to-styled.test/first.expected.js +1 -32
- package/node/v5.0.0/jss-to-styled.test/fourth.actual.js +0 -11
- package/node/v5.0.0/jss-to-styled.test/fourth.expected.js +0 -12
- package/node/v5.0.0/jss-to-styled.test/multipleWithStyles.actual.js +0 -9
- package/node/v5.0.0/jss-to-styled.test/multipleWithStyles.expected.js +2 -9
- package/node/v5.0.0/jss-to-styled.test/nineth.actual.js +0 -8
- package/node/v5.0.0/jss-to-styled.test/nineth.expected.js +2 -8
- package/node/v5.0.0/jss-to-styled.test/second.actual.js +0 -13
- package/node/v5.0.0/jss-to-styled.test/second.expected.js +0 -13
- package/node/v5.0.0/jss-to-styled.test/seventh.actual.js +3 -27
- package/node/v5.0.0/jss-to-styled.test/seventh.expected.js +3 -26
- package/node/v5.0.0/jss-to-styled.test/sixth.actual.js +2 -23
- package/node/v5.0.0/jss-to-styled.test/sixth.expected.js +2 -22
- package/node/v5.0.0/jss-to-styled.test/tenth.actual.js +0 -6
- package/node/v5.0.0/jss-to-styled.test/tenth.expected.js +2 -7
- package/node/v5.0.0/jss-to-styled.test/third.actual.js +0 -11
- package/node/v5.0.0/jss-to-styled.test/third.expected.js +0 -12
- package/node/v5.0.0/jss-to-styled.test/twelfth.actual.js +0 -7
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles.actual.js +0 -11
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles.expected.js +0 -10
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles1.actual.js +0 -12
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles1.expected.js +0 -10
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles2.actual.js +0 -12
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles2.expected.js +0 -10
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles3.actual.js +0 -11
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles3.expected.js +0 -10
- package/node/v5.0.0/jss-to-tss-react.js +0 -70
- package/node/v5.0.0/jss-to-tss-react.test/actual-from-material-ui-core-styles.js +1 -8
- package/node/v5.0.0/jss-to-tss-react.test/actual-from-material-ui-core.js +0 -9
- package/node/v5.0.0/jss-to-tss-react.test/actual-from-mui-styles-makeStyles.js +0 -8
- package/node/v5.0.0/jss-to-tss-react.test/actual-from-mui-styles.js +0 -8
- package/node/v5.0.0/jss-to-tss-react.test/actual-mixins-pattern.js +1 -10
- package/node/v5.0.0/jss-to-tss-react.test/actual-todo-comments.js +0 -12
- package/node/v5.0.0/jss-to-tss-react.test/actual-typescript-docs-example-params.js +0 -7
- package/node/v5.0.0/jss-to-tss-react.test/actual-typescript-docs-example.js +0 -10
- package/node/v5.0.0/jss-to-tss-react.test/actual-typescript.js +1 -9
- package/node/v5.0.0/jss-to-tss-react.test/actual-withStyles.js +0 -16
- package/node/v5.0.0/jss-to-tss-react.test/expected-from-material-ui-core-styles.js +1 -8
- package/node/v5.0.0/jss-to-tss-react.test/expected-from-material-ui-core.js +0 -8
- package/node/v5.0.0/jss-to-tss-react.test/expected-from-mui-styles-makeStyles.js +0 -8
- package/node/v5.0.0/jss-to-tss-react.test/expected-from-mui-styles.js +0 -8
- package/node/v5.0.0/jss-to-tss-react.test/expected-mixins-pattern.js +1 -9
- package/node/v5.0.0/jss-to-tss-react.test/expected-todo-comments.js +13 -18
- package/node/v5.0.0/jss-to-tss-react.test/expected-typescript-docs-example-params.js +0 -5
- package/node/v5.0.0/jss-to-tss-react.test/expected-typescript-docs-example.js +0 -8
- package/node/v5.0.0/jss-to-tss-react.test/expected-typescript.js +1 -9
- package/node/v5.0.0/jss-to-tss-react.test/expected-withStyles.js +0 -17
- package/node/v5.0.0/link-underline-hover.js +1 -4
- package/node/v5.0.0/link-underline-hover.test/actual.js +1 -7
- package/node/v5.0.0/link-underline-hover.test/expected.js +1 -7
- package/node/v5.0.0/material-ui-styles.js +7 -11
- package/node/v5.0.0/material-ui-styles.test/core-import.actual.js +0 -1
- package/node/v5.0.0/material-ui-styles.test/core-import.expected.js +0 -12
- package/node/v5.0.0/material-ui-styles.test/expected.js +0 -12
- package/node/v5.0.0/material-ui-styles.test/single-import.expected.js +0 -1
- package/node/v5.0.0/material-ui-styles.test/types-import.actual.js +0 -1
- package/node/v5.0.0/material-ui-styles.test/types-import.expected.js +0 -2
- package/node/v5.0.0/material-ui-types.js +0 -5
- package/node/v5.0.0/modal-props.js +0 -7
- package/node/v5.0.0/modal-props.test/actual.js +1 -3
- package/node/v5.0.0/modal-props.test/expected.js +2 -3
- package/node/v5.0.0/moved-lab-modules.js +1 -4
- package/node/v5.0.0/moved-lab-modules.test/actual.js +0 -3
- package/node/v5.0.0/moved-lab-modules.test/expected.js +0 -3
- package/node/v5.0.0/mui-replace.js +0 -1
- package/node/v5.0.0/mui-replace.test/actual.js +12 -24
- package/node/v5.0.0/mui-replace.test/expected.js +12 -24
- package/node/v5.0.0/optimal-imports.js +0 -28
- package/node/v5.0.0/optimal-imports.test/actual.js +0 -11
- package/node/v5.0.0/optimal-imports.test/expected.js +0 -8
- package/node/v5.0.0/pagination-round-circular.js +0 -5
- package/node/v5.0.0/pagination-round-circular.test/actual.js +1 -3
- package/node/v5.0.0/pagination-round-circular.test/expected.js +1 -3
- package/node/v5.0.0/preset-safe.js +2 -53
- package/node/v5.0.0/preset-safe.test/actual.js +0 -41
- package/node/v5.0.0/preset-safe.test/expected.js +0 -43
- package/node/v5.0.0/root-ref.js +0 -1
- package/node/v5.0.0/root-ref.test/actual.js +1 -4
- package/node/v5.0.0/root-ref.test/expected.js +1 -2
- package/node/v5.0.0/skeleton-variant.js +0 -6
- package/node/v5.0.0/skeleton-variant.test/actual.js +1 -3
- package/node/v5.0.0/skeleton-variant.test/expected.js +1 -3
- package/node/v5.0.0/styled-engine-provider.js +1 -8
- package/node/v5.0.0/styled-engine-provider.test/mui-theme-provider.actual.js +0 -9
- package/node/v5.0.0/styled-engine-provider.test/mui-theme-provider.expected.js +0 -9
- package/node/v5.0.0/styled-engine-provider.test/theme-provider.actual.js +0 -9
- package/node/v5.0.0/styled-engine-provider.test/theme-provider.expected.js +0 -9
- package/node/v5.0.0/table-props.js +0 -6
- package/node/v5.0.0/table-props.test/actual.js +1 -5
- package/node/v5.0.0/table-props.test/expected.js +1 -5
- package/node/v5.0.0/tabs-scroll-buttons.js +0 -4
- package/node/v5.0.0/tabs-scroll-buttons.test/actual.js +1 -3
- package/node/v5.0.0/tabs-scroll-buttons.test/expected.js +1 -3
- package/node/v5.0.0/textarea-minmax-rows.js +0 -3
- package/node/v5.0.0/textarea-minmax-rows.test/actual.js +1 -3
- package/node/v5.0.0/textarea-minmax-rows.test/expected.js +1 -3
- package/node/v5.0.0/theme-augment.js +1 -8
- package/node/v5.0.0/theme-breakpoints-width.js +0 -1
- package/node/v5.0.0/theme-breakpoints.js +1 -3
- package/node/v5.0.0/theme-options.js +0 -1
- package/node/v5.0.0/theme-options.test/actual.js +0 -1
- package/node/v5.0.0/theme-options.test/expected.js +0 -1
- package/node/v5.0.0/theme-palette-mode.js +0 -1
- package/node/v5.0.0/theme-provider.js +0 -4
- package/node/v5.0.0/theme-provider.test/actual.js +0 -3
- package/node/v5.0.0/theme-provider.test/core-import.actual.js +0 -3
- package/node/v5.0.0/theme-provider.test/core-import.expected.js +0 -3
- package/node/v5.0.0/theme-provider.test/expected.js +0 -3
- package/node/v5.0.0/theme-spacing.js +12 -8
- package/node/v5.0.0/theme-spacing.test/actual.js +0 -1
- package/node/v5.0.0/theme-spacing.test/expected.js +0 -2
- package/node/v5.0.0/theme-spacing.test/large-actual.js +5 -56
- package/node/v5.0.0/theme-spacing.test/large-expected.js +5 -56
- package/node/v5.0.0/theme-typography-round.js +0 -1
- package/node/v5.0.0/top-level-imports.js +0 -22
- package/node/v5.0.0/top-level-imports.test/actual.js +0 -60
- package/node/v5.0.0/top-level-imports.test/expected.js +0 -4
- package/node/v5.0.0/transitions.js +0 -6
- package/node/v5.0.0/transitions.test/actual.js +1 -4
- package/node/v5.0.0/transitions.test/expected.js +2 -4
- package/node/v5.0.0/use-autocomplete.js +0 -3
- package/node/v5.0.0/use-autocomplete.test/actual.js +0 -1
- package/node/v5.0.0/use-autocomplete.test/expected.js +0 -3
- package/node/v5.0.0/use-transitionprops.js +1 -4
- package/node/v5.0.0/use-transitionprops.test/actual.js +1 -3
- package/node/v5.0.0/use-transitionprops.test/expected.js +1 -3
- package/node/v5.0.0/variant-prop.js +0 -4
- package/node/v5.0.0/variant-prop.test/actual.js +0 -15
- package/node/v5.0.0/variant-prop.test/expected.js +0 -15
- package/node/v5.0.0/with-mobile-dialog.js +0 -5
- package/node/v5.0.0/with-mobile-dialog.test/actual.js +0 -9
- package/node/v5.0.0/with-mobile-dialog.test/expected.js +2 -11
- package/node/v5.0.0/with-width.js +0 -4
- package/node/v5.0.0/with-width.test/actual.js +0 -9
- package/node/v5.0.0/with-width.test/expected.js +2 -11
- package/package.json +6 -6
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _styles = require("@material-ui/core/styles");
|
|
13
|
-
|
|
14
10
|
var _contexts = require("./contexts");
|
|
15
|
-
|
|
16
11
|
var _pages = _interopRequireDefault(require("./pages"));
|
|
17
|
-
|
|
18
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
|
|
20
13
|
var _OtherProvider;
|
|
21
|
-
|
|
22
14
|
const App = () => {
|
|
23
15
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledEngineProvider, {
|
|
24
16
|
injectFirst: true,
|
|
@@ -30,6 +22,5 @@ const App = () => {
|
|
|
30
22
|
})
|
|
31
23
|
});
|
|
32
24
|
};
|
|
33
|
-
|
|
34
25
|
var _default = App;
|
|
35
26
|
exports.default = _default;
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = transformer;
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* @param {import('jscodeshift').FileInfo} file
|
|
10
9
|
* @param {import('jscodeshift').API} api
|
|
@@ -17,14 +16,12 @@ function transformer(file, api, options) {
|
|
|
17
16
|
node
|
|
18
17
|
}) => {
|
|
19
18
|
var _node$openingElement$;
|
|
20
|
-
|
|
21
19
|
return (_node$openingElement$ = node.openingElement.name.name) == null ? void 0 : _node$openingElement$.match(/^(Table|TableCell)$/);
|
|
22
20
|
}).forEach(({
|
|
23
21
|
node
|
|
24
22
|
}) => {
|
|
25
23
|
node.openingElement.attributes.forEach(attr => {
|
|
26
24
|
var _attr$name, _attr$value, _attr$value2, _attr$value2$expressi;
|
|
27
|
-
|
|
28
25
|
if (((_attr$name = attr.name) == null ? void 0 : _attr$name.name) === 'padding' && (((_attr$value = attr.value) == null ? void 0 : _attr$value.value) === 'default' || ((_attr$value2 = attr.value) == null ? void 0 : (_attr$value2$expressi = _attr$value2.expression) == null ? void 0 : _attr$value2$expressi.value) === 'default')) {
|
|
29
26
|
attr.value = j.literal('normal');
|
|
30
27
|
}
|
|
@@ -35,15 +32,12 @@ function transformer(file, api, options) {
|
|
|
35
32
|
}) => {
|
|
36
33
|
node.openingElement.attributes.forEach(attr => {
|
|
37
34
|
var _attr$name2, _attr$name3;
|
|
38
|
-
|
|
39
35
|
if (attr.type === 'JSXAttribute' && attr.name.name === 'onChangeRowsPerPage') {
|
|
40
36
|
attr.name.name = 'onRowsPerPageChange';
|
|
41
37
|
}
|
|
42
|
-
|
|
43
38
|
if (attr.type === 'JSXAttribute' && ((_attr$name2 = attr.name) == null ? void 0 : _attr$name2.name) === 'onChangePage') {
|
|
44
39
|
attr.name.name = 'onPageChange';
|
|
45
40
|
}
|
|
46
|
-
|
|
47
41
|
if (attr.type === 'JSXAttribute' && ((_attr$name3 = attr.name) == null ? void 0 : _attr$name3.name) === 'classes') {
|
|
48
42
|
(attr.value.expression.properties || []).forEach(subNode => {
|
|
49
43
|
if (subNode.key.name === 'input') {
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
6
|
-
|
|
7
5
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
|
|
9
|
-
/*#__PURE__*/
|
|
10
|
-
(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
6
|
+
/*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
11
7
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(TablePagination, {
|
|
12
8
|
onChangeRowsPerPage: () => {},
|
|
13
9
|
onChangePage: () => {}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
6
|
-
|
|
7
5
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
|
|
9
|
-
/*#__PURE__*/
|
|
10
|
-
(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
6
|
+
/*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
11
7
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(TablePagination, {
|
|
12
8
|
onRowsPerPageChange: () => {},
|
|
13
9
|
onPageChange: () => {}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = transformer;
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* @param {import('jscodeshift').FileInfo} file
|
|
10
9
|
* @param {import('jscodeshift').API} api
|
|
@@ -21,9 +20,7 @@ function transformer(file, api, options) {
|
|
|
21
20
|
if (attr.name && attr.name.name === 'scrollButtons') {
|
|
22
21
|
if (attr.value) {
|
|
23
22
|
var _attr$value$expressio, _attr$value$expressio2, _attr$value$expressio3, _attr$value$expressio4;
|
|
24
|
-
|
|
25
23
|
prevScrollButtonValue = attr.value.value || ((_attr$value$expressio = attr.value.expression) == null ? void 0 : _attr$value$expressio.value);
|
|
26
|
-
|
|
27
24
|
if (attr.value.value === 'on' || ((_attr$value$expressio2 = attr.value.expression) == null ? void 0 : _attr$value$expressio2.value) === 'on') {
|
|
28
25
|
delete attr.value;
|
|
29
26
|
} else if (attr.value.value === 'desktop' || ((_attr$value$expressio3 = attr.value.expression) == null ? void 0 : _attr$value$expressio3.value) === 'desktop') {
|
|
@@ -34,7 +31,6 @@ function transformer(file, api, options) {
|
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
33
|
});
|
|
37
|
-
|
|
38
34
|
if (prevScrollButtonValue === 'on') {
|
|
39
35
|
node.openingElement.attributes.push(j.jsxAttribute(j.jsxIdentifier('allowScrollButtonsMobile')));
|
|
40
36
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
|
|
5
|
-
/*#__PURE__*/
|
|
6
|
-
(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
4
|
+
/*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
7
5
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs, {
|
|
8
6
|
scrollButtons: "on"
|
|
9
7
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs, {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
|
|
5
|
-
/*#__PURE__*/
|
|
6
|
-
(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
4
|
+
/*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
7
5
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs, {
|
|
8
6
|
scrollButtons: true,
|
|
9
7
|
allowScrollButtonsMobile: true
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = transformer;
|
|
9
|
-
|
|
10
8
|
var _renameProps = _interopRequireDefault(require("../util/renameProps"));
|
|
11
|
-
|
|
12
9
|
/**
|
|
13
10
|
* @param {import('jscodeshift').FileInfo} file
|
|
14
11
|
* @param {import('jscodeshift').API} api
|
|
@@ -4,25 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = transformer;
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* @param {import('jscodeshift').FileInfo} file
|
|
10
9
|
* @param {import('jscodeshift').API} api
|
|
11
10
|
*/
|
|
11
|
+
|
|
12
12
|
const template = `
|
|
13
13
|
declare module '@material-ui/styles/defaultTheme' {
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
15
15
|
interface DefaultTheme extends Theme {}
|
|
16
16
|
}
|
|
17
17
|
`;
|
|
18
|
-
|
|
19
18
|
function transformer(file, api, options) {
|
|
20
19
|
const j = api.jscodeshift;
|
|
21
20
|
const root = j(file.source);
|
|
22
21
|
const printOptions = options.printOptions || {
|
|
23
22
|
quote: 'single'
|
|
24
23
|
};
|
|
25
|
-
|
|
26
24
|
if (file.path.endsWith('.tsx')) {
|
|
27
25
|
let hasTheme = false;
|
|
28
26
|
let isRootFile = false;
|
|
@@ -32,12 +30,10 @@ function transformer(file, api, options) {
|
|
|
32
30
|
if (node.imported.name === 'Theme') {
|
|
33
31
|
hasTheme = true;
|
|
34
32
|
}
|
|
35
|
-
|
|
36
33
|
if (node.imported.name === 'ThemeProvider' || node.imported.nmae === 'MuiThemeProvider') {
|
|
37
34
|
isRootFile = true;
|
|
38
35
|
}
|
|
39
36
|
});
|
|
40
|
-
|
|
41
37
|
if (!hasTheme) {
|
|
42
38
|
root.find(j.ImportSpecifier).filter(({
|
|
43
39
|
node
|
|
@@ -45,7 +41,6 @@ function transformer(file, api, options) {
|
|
|
45
41
|
path.insertAfter(j.importSpecifier(j.identifier('Theme')));
|
|
46
42
|
});
|
|
47
43
|
}
|
|
48
|
-
|
|
49
44
|
if (!file.source.match(/declare module ['"]@material-ui\/styles\/defaultTheme['"]/gm)) {
|
|
50
45
|
root.find(j.ImportDeclaration).at(-1).forEach(path => {
|
|
51
46
|
if (isRootFile) {
|
|
@@ -53,9 +48,7 @@ function transformer(file, api, options) {
|
|
|
53
48
|
}
|
|
54
49
|
});
|
|
55
50
|
}
|
|
56
|
-
|
|
57
51
|
return root.toSource(printOptions);
|
|
58
52
|
}
|
|
59
|
-
|
|
60
53
|
return file.source;
|
|
61
54
|
}
|
|
@@ -11,11 +11,11 @@ const map = {
|
|
|
11
11
|
lg: 'xl',
|
|
12
12
|
xl: 'xl'
|
|
13
13
|
};
|
|
14
|
+
|
|
14
15
|
/**
|
|
15
16
|
* @param {import('jscodeshift').FileInfo} file
|
|
16
17
|
* @param {import('jscodeshift').API} api
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
19
|
function transformer(file, api, options) {
|
|
20
20
|
const j = api.jscodeshift;
|
|
21
21
|
const root = j(file.source);
|
|
@@ -38,7 +38,6 @@ function transformer(file, api, options) {
|
|
|
38
38
|
}).forEach(path => {
|
|
39
39
|
path.node.arguments.forEach(node => {
|
|
40
40
|
const replacementValue = map[node.value];
|
|
41
|
-
|
|
42
41
|
if (replacementValue !== undefined) {
|
|
43
42
|
node.value = replacementValue;
|
|
44
43
|
}
|
|
@@ -60,7 +59,6 @@ function transformer(file, api, options) {
|
|
|
60
59
|
}).forEach(path => {
|
|
61
60
|
const node = path.node.arguments[1];
|
|
62
61
|
const replacementValue = map[node.value];
|
|
63
|
-
|
|
64
62
|
if (replacementValue !== undefined) {
|
|
65
63
|
node.value = replacementValue;
|
|
66
64
|
}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = transformer;
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* @param {import('jscodeshift').FileInfo} file
|
|
10
9
|
* @param {import('jscodeshift').API} api
|
|
@@ -25,20 +24,17 @@ function transformer(file, api, options) {
|
|
|
25
24
|
previousVarName = node.local.name;
|
|
26
25
|
node.local.name = 'ThemeProvider';
|
|
27
26
|
}
|
|
28
|
-
|
|
29
27
|
if (node.imported && node.imported.name === 'MuiThemeProvider') {
|
|
30
28
|
previousVarName = node.local.name;
|
|
31
29
|
node.local = null;
|
|
32
30
|
node.imported.name = 'ThemeProvider';
|
|
33
31
|
}
|
|
34
32
|
});
|
|
35
|
-
|
|
36
33
|
if (previousVarName) {
|
|
37
34
|
root.findJSXElements(previousVarName).forEach(({
|
|
38
35
|
node
|
|
39
36
|
}) => {
|
|
40
37
|
node.openingElement.name.name = 'ThemeProvider';
|
|
41
|
-
|
|
42
38
|
if (node.closingElement) {
|
|
43
39
|
node.closingElement.name.name = 'ThemeProvider';
|
|
44
40
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _styles = require("@material-ui/core/styles");
|
|
4
|
-
|
|
5
4
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
-
|
|
7
5
|
var _div;
|
|
8
|
-
|
|
9
6
|
function App() {
|
|
10
7
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.MuiThemeProvider, {
|
|
11
8
|
theme: (0, _styles.createTheme)(),
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _styles = require("@material-ui/core/styles");
|
|
4
|
-
|
|
5
4
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
-
|
|
7
5
|
var _div;
|
|
8
|
-
|
|
9
6
|
function App() {
|
|
10
7
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ThemeProvider, {
|
|
11
8
|
theme: (0, _styles.createTheme)(),
|
|
@@ -4,19 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = transformer;
|
|
7
|
-
|
|
8
7
|
/* eslint-disable no-template-curly-in-string */
|
|
9
|
-
|
|
10
8
|
/**
|
|
11
9
|
* @param {import('jscodeshift').FileInfo} file
|
|
12
10
|
*/
|
|
13
11
|
function transformer(file) {
|
|
14
|
-
return file.source.replace(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
return file.source.replace(
|
|
13
|
+
// handle cases like: `-${theme.spacing(1)}px`
|
|
14
|
+
/`(-?)\${(-?)(theme\.spacing|spacing)\(([^{}]*)\)}px`/gm, '$3($1$2$4)').replace(
|
|
15
|
+
// handle cases like: theme.spacing(gap) + 'px'
|
|
16
|
+
/((theme\.spacing|spacing)\(.*\))\s*\+\s*'px'/gm, '$1').replace(
|
|
17
|
+
// handle cases like: theme.spacing(gap) + "px"
|
|
18
|
+
/((theme\.spacing|spacing)\(.*\))\s*\+\s*"px"/gm, '$1').replace(
|
|
19
|
+
// handle cases like: `calc(${theme.spacing(2)} - 1px) 0`
|
|
20
|
+
/\${(theme\.spacing|spacing)(\([^)]+\))\s*([+-])\s*([\d.]+)\s*}px/gm, 'calc(${$1$2} $3 $4px)').replace(
|
|
21
|
+
// handle cases like: calc(${theme.spacing(itemHorzPadding)} * 0.3)
|
|
22
|
+
/\${(theme\.spacing|spacing)(\([^)]+\))\s*([*/])\s*([\d.]+)\s*}px/gm, 'calc(${$1$2} $3 $4)').replace(
|
|
23
|
+
// handle common cases like:
|
|
20
24
|
// `${theme.spacing(2)}px`
|
|
21
25
|
// `${theme.spacing(2)}px ${theme.spacing(1)}px ${theme.spacing(2)}px ${theme.spacing(2)}px`
|
|
22
26
|
/(spacing\([^)]+\)\})px(.)/gm, '$1$2');
|
|
@@ -5,5 +5,4 @@ theme.spacing(gap) + 'px';
|
|
|
5
5
|
spacing(gap) + 'px';
|
|
6
6
|
theme.spacing(gap) + "px";
|
|
7
7
|
spacing(gap) + "px"`calc(100% - ${spacing(itemHorzPadding * 2)}px)``calc(100% - ${theme.spacing(itemHorzPadding * 2)}px)`;
|
|
8
|
-
|
|
9
8
|
padding: `${theme.spacing(2) - 1}px 0``calc(100% - ${theme.spacing(itemHorzPadding) * 0.3}px)``${-theme.spacing(1)}px``-${theme.spacing(1)}px``${theme.spacing(2)}px ${theme.spacing(1)}px ${theme.spacing(2)}px ${theme.spacing(2)}px`;
|
|
@@ -8,8 +8,6 @@ theme.spacing(gap);
|
|
|
8
8
|
spacing(gap);
|
|
9
9
|
theme.spacing(gap);
|
|
10
10
|
spacing(gap)`calc(100% - ${spacing(itemHorzPadding * 2)})``calc(100% - ${theme.spacing(itemHorzPadding * 2)})`;
|
|
11
|
-
|
|
12
11
|
padding: `calc(${theme.spacing(2)} - 1px) 0``calc(100% - calc(${theme.spacing(itemHorzPadding)} * 0.3))`;
|
|
13
|
-
|
|
14
12
|
theme.spacing(-1);
|
|
15
13
|
theme.spacing(-1)`${theme.spacing(2)} ${theme.spacing(1)} ${theme.spacing(2)} ${theme.spacing(2)}`;
|
|
@@ -1,66 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = AppSearch;
|
|
9
|
-
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
9
|
var React = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
10
|
var _reactDom = require("react-dom");
|
|
15
|
-
|
|
16
11
|
var _helpers = require("docs/src/modules/utils/helpers");
|
|
17
|
-
|
|
18
12
|
var _server = _interopRequireDefault(require("react-dom/server"));
|
|
19
|
-
|
|
20
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
|
-
|
|
22
14
|
var _link = _interopRequireDefault(require("next/link"));
|
|
23
|
-
|
|
24
15
|
var _router = require("next/router");
|
|
25
|
-
|
|
26
16
|
var _react2 = require("@docsearch/react");
|
|
27
|
-
|
|
28
17
|
var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
|
|
29
|
-
|
|
30
18
|
var _ArticleRounded = _interopRequireDefault(require("@mui/icons-material/ArticleRounded"));
|
|
31
|
-
|
|
32
19
|
var _ToggleOffRounded = _interopRequireDefault(require("@mui/icons-material/ToggleOffRounded"));
|
|
33
|
-
|
|
34
20
|
var _EditRounded = _interopRequireDefault(require("@mui/icons-material/EditRounded"));
|
|
35
|
-
|
|
36
21
|
var _HandymanRounded = _interopRequireDefault(require("@mui/icons-material/HandymanRounded"));
|
|
37
|
-
|
|
38
22
|
var _KeyboardArrowRightRounded = _interopRequireDefault(require("@mui/icons-material/KeyboardArrowRightRounded"));
|
|
39
|
-
|
|
40
23
|
var _Search = _interopRequireDefault(require("@mui/icons-material/Search"));
|
|
41
|
-
|
|
42
24
|
var _GlobalStyles = _interopRequireDefault(require("@mui/material/GlobalStyles"));
|
|
43
|
-
|
|
44
25
|
var _styles = require("@mui/material/styles");
|
|
45
|
-
|
|
46
26
|
var _constants = require("docs/src/modules/constants");
|
|
47
|
-
|
|
48
27
|
var _Link = _interopRequireDefault(require("docs/src/modules/components/Link"));
|
|
49
|
-
|
|
50
28
|
var _i18n = require("docs/src/modules/utils/i18n");
|
|
51
|
-
|
|
52
29
|
var _useLazyCSS = _interopRequireDefault(require("docs/src/modules/utils/useLazyCSS"));
|
|
53
|
-
|
|
54
30
|
var _getUrlProduct = _interopRequireDefault(require("docs/src/modules/utils/getUrlProduct"));
|
|
55
|
-
|
|
56
31
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
57
|
-
|
|
58
32
|
var _ArticleRoundedIcon, _ToggleOffRoundedIcon, _EditRoundedIcon, _HandymanRoundedIcon, _KeyboardArrowRightRo, _NewStartScreen;
|
|
59
|
-
|
|
60
33
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
61
|
-
|
|
62
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
63
|
-
|
|
64
35
|
const SearchButton = (0, _styles.styled)('button')(({
|
|
65
36
|
theme
|
|
66
37
|
}) => {
|
|
@@ -119,7 +90,6 @@ const Shortcut = (0, _styles.styled)('div')(({
|
|
|
119
90
|
borderRadius: 5
|
|
120
91
|
};
|
|
121
92
|
});
|
|
122
|
-
|
|
123
93
|
const NewStartScreen = () => {
|
|
124
94
|
const startScreenOptions = [{
|
|
125
95
|
category: {
|
|
@@ -216,34 +186,27 @@ const NewStartScreen = () => {
|
|
|
216
186
|
}, category.name))
|
|
217
187
|
});
|
|
218
188
|
};
|
|
219
|
-
|
|
220
189
|
function DocSearcHit(props) {
|
|
221
190
|
const {
|
|
222
191
|
children,
|
|
223
192
|
hit
|
|
224
193
|
} = props;
|
|
225
|
-
|
|
226
194
|
function displayTag(pathname) {
|
|
227
195
|
// does not need to show product label for MUI X because they are grouped by the product name in the search
|
|
228
196
|
// ie. Data Grid, Date Picker
|
|
229
197
|
if (!pathname.match(/^\/(material-ui|joy-ui|base)\//)) {
|
|
230
198
|
return null;
|
|
231
199
|
}
|
|
232
|
-
|
|
233
200
|
let text = '';
|
|
234
|
-
|
|
235
201
|
if (pathname.startsWith('/material-ui/')) {
|
|
236
202
|
text = 'Material UI';
|
|
237
203
|
}
|
|
238
|
-
|
|
239
204
|
if (pathname.startsWith('/joy-ui/')) {
|
|
240
205
|
text = 'Joy UI';
|
|
241
206
|
}
|
|
242
|
-
|
|
243
207
|
if (pathname.startsWith('/base/')) {
|
|
244
208
|
text = 'MUI Base';
|
|
245
209
|
}
|
|
246
|
-
|
|
247
210
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, {
|
|
248
211
|
label: text,
|
|
249
212
|
size: "small",
|
|
@@ -253,7 +216,6 @@ function DocSearcHit(props) {
|
|
|
253
216
|
}
|
|
254
217
|
});
|
|
255
218
|
}
|
|
256
|
-
|
|
257
219
|
if (hit.pathname) {
|
|
258
220
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Link.default, {
|
|
259
221
|
href: hit.pathname,
|
|
@@ -267,25 +229,22 @@ function DocSearcHit(props) {
|
|
|
267
229
|
},
|
|
268
230
|
children: [children, displayTag(hit.pathname)]
|
|
269
231
|
});
|
|
270
|
-
}
|
|
271
|
-
// hit.pathname won't be defined for them.
|
|
272
|
-
|
|
232
|
+
}
|
|
273
233
|
|
|
234
|
+
// DocSearch stores the old results in its cache
|
|
235
|
+
// hit.pathname won't be defined for them.
|
|
274
236
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Link.default, {
|
|
275
237
|
href: hit.url,
|
|
276
238
|
children: children
|
|
277
239
|
});
|
|
278
240
|
}
|
|
279
|
-
|
|
280
241
|
process.env.NODE_ENV !== "production" ? DocSearcHit.propTypes = {
|
|
281
242
|
children: _propTypes.default.node,
|
|
282
243
|
hit: _propTypes.default.object.isRequired
|
|
283
244
|
} : void 0;
|
|
284
|
-
|
|
285
245
|
function AppSearch() {
|
|
286
246
|
(0, _useLazyCSS.default)('https://cdn.jsdelivr.net/npm/@docsearch/css@3.0.0-alpha.40/dist/style.min.css', '#app-search');
|
|
287
247
|
const FADE_DURATION = 100; // ms
|
|
288
|
-
|
|
289
248
|
const t = (0, _i18n.useTranslate)();
|
|
290
249
|
const userLanguage = (0, _i18n.useUserLanguage)();
|
|
291
250
|
const searchButtonRef = React.useRef(null);
|
|
@@ -305,16 +264,13 @@ function AppSearch() {
|
|
|
305
264
|
const as = item.userLanguage !== 'en' ? `/${item.userLanguage}${item.as}` : item.as;
|
|
306
265
|
router.push(item.pathname, as);
|
|
307
266
|
}
|
|
308
|
-
|
|
309
267
|
};
|
|
310
268
|
const onClose = React.useCallback(() => {
|
|
311
269
|
const modal = document.querySelector('.DocSearch-Container');
|
|
312
|
-
|
|
313
270
|
if (modal) {
|
|
314
271
|
// fade out transition
|
|
315
272
|
modal.style.opacity = 0;
|
|
316
273
|
}
|
|
317
|
-
|
|
318
274
|
setIsOpen(false); // DO NOT call setIsOpen inside a timeout (it causes scroll issue).
|
|
319
275
|
}, [setIsOpen]);
|
|
320
276
|
const onInput = React.useCallback(event => {
|
|
@@ -332,38 +288,31 @@ function AppSearch() {
|
|
|
332
288
|
const addStartScreen = () => {
|
|
333
289
|
const dropDown = document.querySelector('.DocSearch-Dropdown');
|
|
334
290
|
const isExisting = document.querySelector('.DocSearch-NewStartScreen');
|
|
335
|
-
|
|
336
291
|
if (dropDown && !isExisting) {
|
|
337
292
|
dropDown.insertAdjacentHTML('beforeend', _server.default.renderToStaticMarkup(_NewStartScreen || (_NewStartScreen = /*#__PURE__*/(0, _jsxRuntime.jsx)(NewStartScreen, {}))));
|
|
338
293
|
}
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
|
|
294
|
+
};
|
|
295
|
+
// add transition to Modal
|
|
342
296
|
if (isOpen) {
|
|
343
297
|
const modal = document.querySelector('.DocSearch-Container');
|
|
344
298
|
const searchInput = document.querySelector('.DocSearch-Input');
|
|
345
|
-
|
|
346
299
|
if (modal) {
|
|
347
300
|
modal.style.opacity = 1;
|
|
348
301
|
addStartScreen();
|
|
349
302
|
}
|
|
350
|
-
|
|
351
303
|
if (searchInput) {
|
|
352
304
|
const handleInput = event => {
|
|
353
305
|
const newStartScreen = document.querySelector('.DocSearch-NewStartScreen');
|
|
354
|
-
|
|
355
306
|
if (newStartScreen) {
|
|
356
307
|
newStartScreen.style.display = event.target.value !== '' ? 'none' : 'grid';
|
|
357
308
|
}
|
|
358
309
|
};
|
|
359
|
-
|
|
360
310
|
searchInput.addEventListener('input', handleInput);
|
|
361
311
|
return () => {
|
|
362
312
|
searchInput.removeEventListener('input', handleInput);
|
|
363
313
|
};
|
|
364
314
|
}
|
|
365
315
|
}
|
|
366
|
-
|
|
367
316
|
return () => {};
|
|
368
317
|
}, [isOpen]);
|
|
369
318
|
const search = `${t('algoliaSearch')}…`;
|