@wordpress/components 23.5.0 → 23.6.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/CHANGELOG.md +40 -7
- package/build/animate/index.js +3 -1
- package/build/animate/index.js.map +1 -1
- package/build/animation/index.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +5 -5
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/get-default-use-items.js.map +1 -1
- package/build/autocomplete/index.js +25 -91
- package/build/autocomplete/index.js.map +1 -1
- package/build/autocomplete/types.js +6 -0
- package/build/autocomplete/types.js.map +1 -0
- package/build/custom-gradient-picker/gradient-bar/control-points.js +2 -0
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/index.js +2 -0
- package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/utils.js +2 -0
- package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
- package/build/custom-gradient-picker/index.js +2 -0
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/custom-gradient-picker/serializer.js +1 -0
- package/build/custom-gradient-picker/serializer.js.map +1 -1
- package/build/custom-gradient-picker/utils.js +2 -0
- package/build/custom-gradient-picker/utils.js.map +1 -1
- package/build/dimension-control/index.js +31 -5
- package/build/dimension-control/index.js.map +1 -1
- package/build/dimension-control/sizes.js +2 -4
- package/build/dimension-control/sizes.js.map +1 -1
- package/build/dimension-control/types.js +6 -0
- package/build/dimension-control/types.js.map +1 -0
- package/build/flex/flex/hook.js +3 -3
- package/build/flex/flex/hook.js.map +1 -1
- package/build/font-size-picker/index.js +2 -1
- package/build/font-size-picker/index.js.map +1 -1
- package/build/form-token-field/index.js +1 -1
- package/build/form-token-field/index.js.map +1 -1
- package/build/gradient-picker/index.js +2 -0
- package/build/gradient-picker/index.js.map +1 -1
- package/build/guide/icons.js.map +1 -1
- package/build/guide/index.js +46 -8
- package/build/guide/index.js.map +1 -1
- package/build/guide/page-control.js.map +1 -1
- package/build/guide/page.js.map +1 -1
- package/build/guide/types.js +6 -0
- package/build/guide/types.js.map +1 -0
- package/build/h-stack/utils.js +5 -5
- package/build/h-stack/utils.js.map +1 -1
- package/build/higher-order/navigate-regions/index.js +33 -3
- package/build/higher-order/navigate-regions/index.js.map +1 -1
- package/build/higher-order/with-fallback-styles/index.js +2 -2
- package/build/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build/higher-order/with-filters/index.js +31 -7
- package/build/higher-order/with-filters/index.js.map +1 -1
- package/build/higher-order/with-focus-return/index.js +10 -10
- package/build/higher-order/with-focus-return/index.js.map +1 -1
- package/build/higher-order/with-notices/index.js +28 -25
- package/build/higher-order/with-notices/index.js.map +1 -1
- package/build/higher-order/with-notices/types.js +6 -0
- package/build/higher-order/with-notices/types.js.map +1 -0
- package/build/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build/icon/index.js +1 -8
- package/build/icon/index.js.map +1 -1
- package/build/index.native.js +18 -9
- package/build/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +1 -1
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet-text-control/index.native.js +4 -3
- package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build/navigation/back-button/index.js +6 -5
- package/build/navigation/back-button/index.js.map +1 -1
- package/build/navigation/constants.js.map +1 -1
- package/build/navigation/context.js +7 -4
- package/build/navigation/context.js.map +1 -1
- package/build/navigation/group/context.js.map +1 -1
- package/build/navigation/group/index.js +5 -1
- package/build/navigation/group/index.js.map +1 -1
- package/build/navigation/index.js +49 -3
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/item/base-content.js +0 -1
- package/build/navigation/item/base-content.js.map +1 -1
- package/build/navigation/item/base.js.map +1 -1
- package/build/navigation/item/index.js +5 -1
- package/build/navigation/item/index.js.map +1 -1
- package/build/navigation/item/use-navigation-tree-item.js +1 -1
- package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
- package/build/navigation/menu/context.js.map +1 -1
- package/build/navigation/menu/index.js +5 -1
- package/build/navigation/menu/index.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +8 -6
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/navigation/menu/menu-title.js +4 -2
- package/build/navigation/menu/menu-title.js.map +1 -1
- package/build/navigation/menu/search-no-results-found.js.map +1 -1
- package/build/navigation/menu/use-navigation-tree-menu.js.map +1 -1
- package/build/navigation/styles/navigation-styles.js +36 -36
- package/build/navigation/styles/navigation-styles.js.map +1 -1
- package/build/navigation/types.js +6 -0
- package/build/navigation/types.js.map +1 -0
- package/build/navigation/use-create-navigation-tree.js +7 -0
- package/build/navigation/use-create-navigation-tree.js.map +1 -1
- package/build/navigation/use-navigation-tree-nodes.js +3 -5
- package/build/navigation/use-navigation-tree-nodes.js.map +1 -1
- package/build/navigation/utils.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +5 -3
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/number-control/index.js +1 -3
- package/build/number-control/index.js.map +1 -1
- package/build/palette-edit/index.js +67 -27
- package/build/palette-edit/index.js.map +1 -1
- package/build/palette-edit/types.js +6 -0
- package/build/palette-edit/types.js.map +1 -0
- package/build/panel/body.js +15 -17
- package/build/panel/body.js.map +1 -1
- package/build/placeholder/index.js.map +1 -1
- package/build/query-controls/author-select.js +0 -4
- package/build/query-controls/author-select.js.map +1 -1
- package/build/query-controls/category-select.js +0 -4
- package/build/query-controls/category-select.js.map +1 -1
- package/build/query-controls/terms.js +30 -15
- package/build/query-controls/terms.js.map +1 -1
- package/build/range-control/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build/responsive-wrapper/index.js +12 -13
- package/build/responsive-wrapper/index.js.map +1 -1
- package/build/select-control/index.js +19 -16
- package/build/select-control/index.js.map +1 -1
- package/build/toolbar/toolbar-button/index.js +32 -10
- package/build/toolbar/toolbar-button/index.js.map +1 -1
- package/build/toolbar/toolbar-button/toolbar-button-container.js +12 -4
- package/build/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
- package/build/toolbar/toolbar-button/types.js +6 -0
- package/build/toolbar/toolbar-button/types.js.map +1 -0
- package/build/toolbar/toolbar-context/index.js +4 -2
- package/build/toolbar/toolbar-context/index.js.map +1 -1
- package/build/tooltip/index.js +18 -6
- package/build/tooltip/index.js.map +1 -1
- package/build/tree-select/index.js.map +1 -1
- package/build/ui/context/get-styled-class-name-from-key.js +2 -2
- package/build/ui/context/get-styled-class-name-from-key.js.map +1 -1
- package/build/utils/font.js +3 -7
- package/build/utils/font.js.map +1 -1
- package/build/v-stack/hook.js +2 -0
- package/build/v-stack/hook.js.map +1 -1
- package/build-module/animate/index.js +3 -1
- package/build-module/animate/index.js.map +1 -1
- package/build-module/animation/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +6 -6
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/get-default-use-items.js.map +1 -1
- package/build-module/autocomplete/index.js +28 -94
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/autocomplete/types.js +2 -0
- package/build-module/autocomplete/types.js.map +1 -0
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +1 -0
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -0
- package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/utils.js +2 -0
- package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +1 -0
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/custom-gradient-picker/serializer.js +1 -0
- package/build-module/custom-gradient-picker/serializer.js.map +1 -1
- package/build-module/custom-gradient-picker/utils.js +2 -0
- package/build-module/custom-gradient-picker/utils.js.map +1 -1
- package/build-module/dimension-control/index.js +28 -3
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/dimension-control/sizes.js +6 -5
- package/build-module/dimension-control/sizes.js.map +1 -1
- package/build-module/dimension-control/types.js +2 -0
- package/build-module/dimension-control/types.js.map +1 -0
- package/build-module/flex/flex/hook.js +3 -3
- package/build-module/flex/flex/hook.js.map +1 -1
- package/build-module/font-size-picker/index.js +2 -1
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/form-token-field/index.js +1 -1
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/gradient-picker/index.js +1 -0
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/guide/icons.js.map +1 -1
- package/build-module/guide/index.js +45 -8
- package/build-module/guide/index.js.map +1 -1
- package/build-module/guide/page-control.js.map +1 -1
- package/build-module/guide/page.js +4 -0
- package/build-module/guide/page.js.map +1 -1
- package/build-module/guide/types.js +2 -0
- package/build-module/guide/types.js.map +1 -0
- package/build-module/h-stack/utils.js +5 -5
- package/build-module/h-stack/utils.js.map +1 -1
- package/build-module/higher-order/navigate-regions/index.js +33 -3
- package/build-module/higher-order/navigate-regions/index.js.map +1 -1
- package/build-module/higher-order/with-fallback-styles/index.js +2 -2
- package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build-module/higher-order/with-filters/index.js +31 -7
- package/build-module/higher-order/with-filters/index.js.map +1 -1
- package/build-module/higher-order/with-focus-return/index.js +10 -10
- package/build-module/higher-order/with-focus-return/index.js.map +1 -1
- package/build-module/higher-order/with-notices/index.js +29 -26
- package/build-module/higher-order/with-notices/index.js.map +1 -1
- package/build-module/higher-order/with-notices/types.js +2 -0
- package/build-module/higher-order/with-notices/types.js.map +1 -0
- package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build-module/icon/index.js +2 -9
- package/build-module/icon/index.js.map +1 -1
- package/build-module/index.native.js +1 -0
- package/build-module/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-text-control/index.native.js +4 -3
- package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build-module/navigation/back-button/index.js +4 -3
- package/build-module/navigation/back-button/index.js.map +1 -1
- package/build-module/navigation/constants.js.map +1 -1
- package/build-module/navigation/context.js +7 -4
- package/build-module/navigation/context.js.map +1 -1
- package/build-module/navigation/group/context.js +4 -0
- package/build-module/navigation/group/context.js.map +1 -1
- package/build-module/navigation/group/index.js +2 -1
- package/build-module/navigation/group/index.js.map +1 -1
- package/build-module/navigation/index.js +46 -3
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/item/base-content.js +0 -1
- package/build-module/navigation/item/base-content.js.map +1 -1
- package/build-module/navigation/item/base.js.map +1 -1
- package/build-module/navigation/item/index.js +2 -1
- package/build-module/navigation/item/index.js.map +1 -1
- package/build-module/navigation/item/use-navigation-tree-item.js +1 -1
- package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
- package/build-module/navigation/menu/context.js +4 -0
- package/build-module/navigation/menu/context.js.map +1 -1
- package/build-module/navigation/menu/index.js +2 -1
- package/build-module/navigation/menu/index.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +8 -6
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/navigation/menu/menu-title.js +4 -2
- package/build-module/navigation/menu/menu-title.js.map +1 -1
- package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
- package/build-module/navigation/menu/use-navigation-tree-menu.js.map +1 -1
- package/build-module/navigation/styles/navigation-styles.js +36 -36
- package/build-module/navigation/styles/navigation-styles.js.map +1 -1
- package/build-module/navigation/types.js +2 -0
- package/build-module/navigation/types.js.map +1 -0
- package/build-module/navigation/use-create-navigation-tree.js +7 -0
- package/build-module/navigation/use-create-navigation-tree.js.map +1 -1
- package/build-module/navigation/use-navigation-tree-nodes.js +2 -2
- package/build-module/navigation/use-navigation-tree-nodes.js.map +1 -1
- package/build-module/navigation/utils.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +5 -3
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/number-control/index.js +1 -3
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/palette-edit/index.js +65 -27
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/palette-edit/types.js +2 -0
- package/build-module/palette-edit/types.js.map +1 -0
- package/build-module/panel/body.js +12 -12
- package/build-module/panel/body.js.map +1 -1
- package/build-module/placeholder/index.js.map +1 -1
- package/build-module/query-controls/author-select.js +0 -4
- package/build-module/query-controls/author-select.js.map +1 -1
- package/build-module/query-controls/category-select.js +1 -5
- package/build-module/query-controls/category-select.js.map +1 -1
- package/build-module/query-controls/terms.js +29 -16
- package/build-module/query-controls/terms.js.map +1 -1
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +5 -5
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build-module/responsive-wrapper/index.js +12 -12
- package/build-module/responsive-wrapper/index.js.map +1 -1
- package/build-module/select-control/index.js +20 -17
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/toolbar/toolbar-button/index.js +32 -9
- package/build-module/toolbar/toolbar-button/index.js.map +1 -1
- package/build-module/toolbar/toolbar-button/toolbar-button-container.js +12 -4
- package/build-module/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
- package/build-module/toolbar/toolbar-button/types.js +2 -0
- package/build-module/toolbar/toolbar-button/types.js.map +1 -0
- package/build-module/toolbar/toolbar-context/index.js +4 -2
- package/build-module/toolbar/toolbar-context/index.js.map +1 -1
- package/build-module/tooltip/index.js +16 -6
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/ui/context/get-styled-class-name-from-key.js +1 -1
- package/build-module/ui/context/get-styled-class-name-from-key.js.map +1 -1
- package/build-module/utils/font.js +3 -6
- package/build-module/utils/font.js.map +1 -1
- package/build-module/v-stack/hook.js +2 -0
- package/build-module/v-stack/hook.js.map +1 -1
- package/build-style/style-rtl.css +14 -11
- package/build-style/style.css +14 -11
- package/build-types/alignment-matrix-control/types.d.ts +4 -4
- package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
- package/build-types/angle-picker-control/types.d.ts +2 -2
- package/build-types/angle-picker-control/types.d.ts.map +1 -1
- package/build-types/animate/index.d.ts +2 -2
- package/build-types/animate/index.d.ts.map +1 -1
- package/build-types/animation/index.d.ts +8 -1
- package/build-types/animation/index.d.ts.map +1 -1
- package/build-types/autocomplete/autocompleter-ui.d.ts +4 -0
- package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -0
- package/build-types/autocomplete/get-default-use-items.d.ts +3 -0
- package/build-types/autocomplete/get-default-use-items.d.ts.map +1 -0
- package/build-types/autocomplete/index.d.ts +23 -0
- package/build-types/autocomplete/index.d.ts.map +1 -0
- package/build-types/autocomplete/test/index.d.ts +2 -0
- package/build-types/autocomplete/test/index.d.ts.map +1 -0
- package/build-types/autocomplete/types.d.ts +201 -0
- package/build-types/autocomplete/types.d.ts.map +1 -0
- package/build-types/base-control/types.d.ts +2 -2
- package/build-types/base-control/types.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/styles.d.ts +3 -3
- package/build-types/border-box-control/styles.d.ts.map +1 -1
- package/build-types/border-box-control/types.d.ts +8 -8
- package/build-types/border-box-control/types.d.ts.map +1 -1
- package/build-types/border-box-control/utils.d.ts +5 -5
- package/build-types/border-box-control/utils.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +3 -3
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +2 -2
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/border-control/styles.d.ts +4 -4
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +6 -6
- package/build-types/border-control/types.d.ts.map +1 -1
- package/build-types/box-control/types.d.ts +6 -6
- package/build-types/box-control/types.d.ts.map +1 -1
- package/build-types/button/deprecated.d.ts +6 -6
- package/build-types/button/types.d.ts +10 -10
- package/build-types/button/types.d.ts.map +1 -1
- package/build-types/button-group/types.d.ts +1 -1
- package/build-types/button-group/types.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +1 -1
- package/build-types/card/card/hook.d.ts.map +1 -1
- package/build-types/card/types.d.ts +10 -10
- package/build-types/card/types.d.ts.map +1 -1
- package/build-types/checkbox-control/types.d.ts +1 -1
- package/build-types/checkbox-control/types.d.ts.map +1 -1
- package/build-types/circular-option-picker/types.d.ts +4 -4
- package/build-types/circular-option-picker/types.d.ts.map +1 -1
- package/build-types/color-indicator/types.d.ts +1 -1
- package/build-types/color-indicator/types.d.ts.map +1 -1
- package/build-types/color-list-picker/types.d.ts +2 -2
- package/build-types/color-list-picker/types.d.ts.map +1 -1
- package/build-types/color-palette/types.d.ts +7 -7
- package/build-types/color-palette/types.d.ts.map +1 -1
- package/build-types/color-palette/utils.d.ts +1 -1
- package/build-types/color-palette/utils.d.ts.map +1 -1
- package/build-types/color-picker/legacy-adapter.d.ts +1 -1
- package/build-types/color-picker/legacy-adapter.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +3 -3
- package/build-types/color-picker/types.d.ts +2 -2
- package/build-types/color-picker/types.d.ts.map +1 -1
- package/build-types/color-picker/use-deprecated-props.d.ts +2 -2
- package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
- package/build-types/combobox-control/types.d.ts +2 -2
- package/build-types/combobox-control/types.d.ts.map +1 -1
- package/build-types/confirm-dialog/component.d.ts +4 -4
- package/build-types/confirm-dialog/types.d.ts +5 -5
- package/build-types/confirm-dialog/types.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/constants.d.ts +25 -0
- package/build-types/custom-gradient-picker/constants.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/gradient-bar/constants.d.ts +8 -0
- package/build-types/custom-gradient-picker/gradient-bar/constants.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +25 -0
- package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +10 -0
- package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/gradient-bar/utils.d.ts +138 -0
- package/build-types/custom-gradient-picker/gradient-bar/utils.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/index.d.ts +7 -0
- package/build-types/custom-gradient-picker/index.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/serializer.d.ts +17 -0
- package/build-types/custom-gradient-picker/serializer.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts +11 -0
- package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/utils.d.ts +5 -0
- package/build-types/custom-gradient-picker/utils.d.ts.map +1 -0
- package/build-types/custom-select-control/styles.d.ts +1 -1
- package/build-types/custom-select-control/styles.d.ts.map +1 -1
- package/build-types/dashicon/types.d.ts +2 -2
- package/build-types/dashicon/types.d.ts.map +1 -1
- package/build-types/date-time/date-time/styles.d.ts +1 -4
- package/build-types/date-time/date-time/styles.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts +1 -1
- package/build-types/date-time/types.d.ts +4 -4
- package/build-types/date-time/types.d.ts.map +1 -1
- package/build-types/dimension-control/index.d.ts +28 -0
- package/build-types/dimension-control/index.d.ts.map +1 -0
- package/build-types/dimension-control/sizes.d.ts +26 -0
- package/build-types/dimension-control/sizes.d.ts.map +1 -0
- package/build-types/dimension-control/stories/index.d.ts +12 -0
- package/build-types/dimension-control/stories/index.d.ts.map +1 -0
- package/build-types/dimension-control/types.d.ts +47 -0
- package/build-types/dimension-control/types.d.ts.map +1 -0
- package/build-types/divider/types.d.ts +1 -1
- package/build-types/divider/types.d.ts.map +1 -1
- package/build-types/draggable/types.d.ts +1 -1
- package/build-types/draggable/types.d.ts.map +1 -1
- package/build-types/drop-zone/types.d.ts +2 -2
- package/build-types/drop-zone/types.d.ts.map +1 -1
- package/build-types/dropdown/types.d.ts +3 -3
- package/build-types/dropdown/types.d.ts.map +1 -1
- package/build-types/elevation/types.d.ts +1 -1
- package/build-types/elevation/types.d.ts.map +1 -1
- package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
- package/build-types/external-link/types.d.ts +1 -1
- package/build-types/external-link/types.d.ts.map +1 -1
- package/build-types/flex/types.d.ts +4 -4
- package/build-types/flex/types.d.ts.map +1 -1
- package/build-types/focal-point-picker/types.d.ts +7 -7
- package/build-types/focal-point-picker/types.d.ts.map +1 -1
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/stories/index.d.ts.map +1 -1
- package/build-types/font-size-picker/types.d.ts +9 -5
- package/build-types/font-size-picker/types.d.ts.map +1 -1
- package/build-types/form-file-upload/types.d.ts +1 -1
- package/build-types/form-file-upload/types.d.ts.map +1 -1
- package/build-types/form-toggle/types.d.ts +1 -1
- package/build-types/form-toggle/types.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/stories/index.d.ts +6 -0
- package/build-types/form-token-field/stories/index.d.ts.map +1 -1
- package/build-types/form-token-field/styles.d.ts +1 -1
- package/build-types/form-token-field/styles.d.ts.map +1 -1
- package/build-types/form-token-field/types.d.ts +1 -1
- package/build-types/form-token-field/types.d.ts.map +1 -1
- package/build-types/gradient-picker/index.d.ts +12 -0
- package/build-types/gradient-picker/index.d.ts.map +1 -0
- package/build-types/grid/types.d.ts +2 -2
- package/build-types/grid/types.d.ts.map +1 -1
- package/build-types/guide/icons.d.ts +5 -0
- package/build-types/guide/icons.d.ts.map +1 -0
- package/build-types/guide/index.d.ts +37 -0
- package/build-types/guide/index.d.ts.map +1 -0
- package/build-types/guide/page-control.d.ts +4 -0
- package/build-types/guide/page-control.d.ts.map +1 -0
- package/build-types/guide/page.d.ts +7 -0
- package/build-types/guide/page.d.ts.map +1 -0
- package/build-types/guide/stories/index.d.ts +9 -0
- package/build-types/guide/stories/index.d.ts.map +1 -0
- package/build-types/guide/test/index.d.ts +2 -0
- package/build-types/guide/test/index.d.ts.map +1 -0
- package/build-types/guide/types.d.ts +65 -0
- package/build-types/guide/types.d.ts.map +1 -0
- package/build-types/h-stack/types.d.ts +6 -6
- package/build-types/h-stack/types.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts +1 -1
- package/build-types/heading/types.d.ts +2 -2
- package/build-types/heading/types.d.ts.map +1 -1
- package/build-types/higher-order/navigate-regions/index.d.ts +46 -0
- package/build-types/higher-order/navigate-regions/index.d.ts.map +1 -0
- package/build-types/higher-order/with-fallback-styles/index.d.ts +44 -0
- package/build-types/higher-order/with-fallback-styles/index.d.ts.map +1 -0
- package/build-types/higher-order/with-filters/index.d.ts +89 -0
- package/build-types/higher-order/with-filters/index.d.ts.map +1 -0
- package/build-types/higher-order/with-filters/test/index.d.ts +2 -0
- package/build-types/higher-order/with-filters/test/index.d.ts.map +1 -0
- package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
- package/build-types/higher-order/with-focus-return/index.d.ts +20 -0
- package/build-types/higher-order/with-focus-return/index.d.ts.map +1 -0
- package/build-types/higher-order/with-focus-return/test/index.d.ts +2 -0
- package/build-types/higher-order/with-focus-return/test/index.d.ts.map +1 -0
- package/build-types/higher-order/with-notices/index.d.ts +37 -0
- package/build-types/higher-order/with-notices/index.d.ts.map +1 -0
- package/build-types/higher-order/with-notices/test/index.d.ts +2 -0
- package/build-types/higher-order/with-notices/test/index.d.ts.map +1 -0
- package/build-types/higher-order/with-notices/types.d.ts +34 -0
- package/build-types/higher-order/with-notices/types.d.ts.map +1 -0
- package/build-types/higher-order/with-spoken-messages/index.d.ts +13 -2
- package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -1
- package/build-types/higher-order/with-spoken-messages/test/index.d.ts +2 -0
- package/build-types/higher-order/with-spoken-messages/test/index.d.ts.map +1 -0
- package/build-types/icon/index.d.ts +10 -6
- package/build-types/icon/index.d.ts.map +1 -1
- package/build-types/icon/test/index.d.ts +2 -0
- package/build-types/icon/test/index.d.ts.map +1 -0
- package/build-types/input-control/reducer/actions.d.ts +15 -15
- package/build-types/input-control/reducer/actions.d.ts.map +1 -1
- package/build-types/input-control/reducer/state.d.ts +1 -1
- package/build-types/input-control/reducer/state.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +4 -4
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +7 -7
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +1 -1
- package/build-types/item-group/types.d.ts +2 -2
- package/build-types/item-group/types.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/types.d.ts +3 -3
- package/build-types/keyboard-shortcuts/types.d.ts.map +1 -1
- package/build-types/menu-group/types.d.ts +1 -1
- package/build-types/menu-group/types.d.ts.map +1 -1
- package/build-types/menu-item/index.d.ts +1 -1
- package/build-types/menu-items-choice/types.d.ts +2 -2
- package/build-types/menu-items-choice/types.d.ts.map +1 -1
- package/build-types/modal/types.d.ts +1 -1
- package/build-types/modal/types.d.ts.map +1 -1
- package/build-types/navigable-container/container.d.ts +1 -1
- package/build-types/navigable-container/menu.d.ts +1 -1
- package/build-types/navigable-container/tabbable.d.ts +1 -1
- package/build-types/navigation/back-button/index.d.ts +5 -0
- package/build-types/navigation/back-button/index.d.ts.map +1 -0
- package/build-types/navigation/constants.d.ts +3 -0
- package/build-types/navigation/constants.d.ts.map +1 -0
- package/build-types/navigation/context.d.ts +5 -0
- package/build-types/navigation/context.d.ts.map +1 -0
- package/build-types/navigation/group/context.d.ts +8 -0
- package/build-types/navigation/group/context.d.ts.map +1 -0
- package/build-types/navigation/group/index.d.ts +5 -0
- package/build-types/navigation/group/index.d.ts.map +1 -0
- package/build-types/navigation/index.d.ts +46 -0
- package/build-types/navigation/index.d.ts.map +1 -0
- package/build-types/navigation/item/base-content.d.ts +4 -0
- package/build-types/navigation/item/base-content.d.ts.map +1 -0
- package/build-types/navigation/item/base.d.ts +4 -0
- package/build-types/navigation/item/base.d.ts.map +1 -0
- package/build-types/navigation/item/index.d.ts +5 -0
- package/build-types/navigation/item/index.d.ts.map +1 -0
- package/build-types/navigation/item/use-navigation-tree-item.d.ts +3 -0
- package/build-types/navigation/item/use-navigation-tree-item.d.ts.map +1 -0
- package/build-types/navigation/menu/context.d.ts +8 -0
- package/build-types/navigation/menu/context.d.ts.map +1 -0
- package/build-types/navigation/menu/index.d.ts +5 -0
- package/build-types/navigation/menu/index.d.ts.map +1 -0
- package/build-types/navigation/menu/menu-title-search.d.ts +4 -0
- package/build-types/navigation/menu/menu-title-search.d.ts.map +1 -0
- package/build-types/navigation/menu/menu-title.d.ts +4 -0
- package/build-types/navigation/menu/menu-title.d.ts.map +1 -0
- package/build-types/navigation/menu/search-no-results-found.d.ts +4 -0
- package/build-types/navigation/menu/search-no-results-found.d.ts.map +1 -0
- package/build-types/navigation/menu/use-navigation-tree-menu.d.ts +3 -0
- package/build-types/navigation/menu/use-navigation-tree-menu.d.ts.map +1 -0
- package/build-types/navigation/stories/index.d.ts +18 -0
- package/build-types/navigation/stories/index.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/controlled-state.d.ts +7 -0
- package/build-types/navigation/stories/utils/controlled-state.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/default.d.ts +10 -0
- package/build-types/navigation/stories/utils/default.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/group.d.ts +10 -0
- package/build-types/navigation/stories/utils/group.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts +10 -0
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/more-examples.d.ts +10 -0
- package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/search.d.ts +10 -0
- package/build-types/navigation/stories/utils/search.d.ts.map +1 -0
- package/build-types/navigation/styles/navigation-styles.d.ts +58 -0
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -0
- package/build-types/navigation/test/index.d.ts +2 -0
- package/build-types/navigation/test/index.d.ts.map +1 -0
- package/build-types/navigation/types.d.ts +267 -0
- package/build-types/navigation/types.d.ts.map +1 -0
- package/build-types/navigation/use-create-navigation-tree.d.ts +15 -0
- package/build-types/navigation/use-create-navigation-tree.d.ts.map +1 -0
- package/build-types/navigation/use-navigation-tree-nodes.d.ts +11 -0
- package/build-types/navigation/use-navigation-tree-nodes.d.ts.map +1 -0
- package/build-types/navigation/utils.d.ts +3 -0
- package/build-types/navigation/utils.d.ts.map +1 -0
- package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -1
- package/build-types/navigator/types.d.ts +12 -12
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/notice/types.d.ts +7 -7
- package/build-types/notice/types.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/types.d.ts +1 -1
- package/build-types/number-control/types.d.ts.map +1 -1
- package/build-types/palette-edit/index.d.ts +37 -0
- package/build-types/palette-edit/index.d.ts.map +1 -0
- package/build-types/palette-edit/stories/index.d.ts +13 -0
- package/build-types/palette-edit/stories/index.d.ts.map +1 -0
- package/build-types/palette-edit/styles.d.ts +51 -0
- package/build-types/palette-edit/styles.d.ts.map +1 -0
- package/build-types/palette-edit/test/index.d.ts +2 -0
- package/build-types/palette-edit/test/index.d.ts.map +1 -0
- package/build-types/palette-edit/types.d.ts +114 -0
- package/build-types/palette-edit/types.d.ts.map +1 -0
- package/build-types/panel/body.d.ts +9 -0
- package/build-types/panel/body.d.ts.map +1 -0
- package/build-types/panel/stories/index.d.ts +19 -0
- package/build-types/panel/stories/index.d.ts.map +1 -0
- package/build-types/panel/test/body.d.ts +2 -0
- package/build-types/panel/test/body.d.ts.map +1 -0
- package/build-types/panel/types.d.ts +73 -3
- package/build-types/panel/types.d.ts.map +1 -1
- package/build-types/placeholder/index.d.ts +1 -1
- package/build-types/placeholder/index.d.ts.map +1 -1
- package/build-types/placeholder/types.d.ts +2 -2
- package/build-types/placeholder/types.d.ts.map +1 -1
- package/build-types/popover/limit-shift.d.ts +2 -2
- package/build-types/popover/limit-shift.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +10 -10
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/popover/utils.d.ts +2 -2
- package/build-types/popover/utils.d.ts.map +1 -1
- package/build-types/query-controls/author-select.d.ts.map +1 -1
- package/build-types/query-controls/category-select.d.ts.map +1 -1
- package/build-types/query-controls/terms.d.ts.map +1 -1
- package/build-types/query-controls/types.d.ts +12 -12
- package/build-types/query-controls/types.d.ts.map +1 -1
- package/build-types/radio-control/types.d.ts +1 -1
- package/build-types/radio-control/types.d.ts.map +1 -1
- package/build-types/radio-group/index.d.ts +1 -1
- package/build-types/radio-group/radio/index.d.ts +1 -1
- package/build-types/range-control/index.d.ts +2 -2
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/types.d.ts +17 -17
- package/build-types/range-control/types.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts +2 -2
- package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
- package/build-types/responsive-wrapper/index.d.ts.map +1 -1
- package/build-types/responsive-wrapper/stories/index.d.ts +10 -0
- package/build-types/responsive-wrapper/stories/index.d.ts.map +1 -1
- package/build-types/responsive-wrapper/types.d.ts +3 -3
- package/build-types/responsive-wrapper/types.d.ts.map +1 -1
- package/build-types/sandbox/types.d.ts +1 -1
- package/build-types/sandbox/types.d.ts.map +1 -1
- package/build-types/scrollable/types.d.ts +2 -2
- package/build-types/scrollable/types.d.ts.map +1 -1
- package/build-types/search-control/types.d.ts +1 -1
- package/build-types/search-control/types.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +2 -1
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.d.ts +3 -3
- package/build-types/select-control/stories/index.d.ts.map +1 -1
- package/build-types/select-control/types.d.ts +44 -20
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/shortcut/types.d.ts +1 -1
- package/build-types/shortcut/types.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
- package/build-types/slot-fill/provider.d.ts +1 -0
- package/build-types/slot-fill/provider.d.ts.map +1 -1
- package/build-types/snackbar/types.d.ts +3 -3
- package/build-types/snackbar/types.d.ts.map +1 -1
- package/build-types/spacer/types.d.ts +1 -1
- package/build-types/spacer/types.d.ts.map +1 -1
- package/build-types/spinner/index.d.ts +1 -1
- package/build-types/style-provider/types.d.ts +1 -1
- package/build-types/style-provider/types.d.ts.map +1 -1
- package/build-types/surface/types.d.ts +2 -2
- package/build-types/surface/types.d.ts.map +1 -1
- package/build-types/tab-panel/types.d.ts +5 -5
- package/build-types/tab-panel/types.d.ts.map +1 -1
- package/build-types/text/types.d.ts +3 -3
- package/build-types/text/types.d.ts.map +1 -1
- package/build-types/text-control/types.d.ts +1 -1
- package/build-types/text-control/types.d.ts.map +1 -1
- package/build-types/text-highlight/types.d.ts +1 -1
- package/build-types/text-highlight/types.d.ts.map +1 -1
- package/build-types/textarea-control/types.d.ts +1 -1
- package/build-types/textarea-control/types.d.ts.map +1 -1
- package/build-types/theme/types.d.ts +3 -3
- package/build-types/theme/types.d.ts.map +1 -1
- package/build-types/tip/types.d.ts +1 -1
- package/build-types/tip/types.d.ts.map +1 -1
- package/build-types/toggle-control/types.d.ts +1 -1
- package/build-types/toggle-control/types.d.ts.map +1 -1
- package/build-types/toggle-group-control/types.d.ts +10 -10
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/toolbar/toolbar/types.d.ts +1 -1
- package/build-types/toolbar/toolbar/types.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/index.d.ts +165 -11
- package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts +6 -1
- package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/types.d.ts +45 -0
- package/build-types/toolbar/toolbar-button/types.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-context/index.d.ts +6 -1
- package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts +1 -1
- package/build-types/toolbar/toolbar-item/index.d.ts +1 -1
- package/build-types/tools-panel/types.d.ts +11 -11
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tree-grid/types.d.ts +5 -5
- package/build-types/tree-grid/types.d.ts.map +1 -1
- package/build-types/tree-select/index.d.ts.map +1 -1
- package/build-types/tree-select/types.d.ts +4 -10
- package/build-types/tree-select/types.d.ts.map +1 -1
- package/build-types/truncate/types.d.ts +2 -2
- package/build-types/truncate/types.d.ts.map +1 -1
- package/build-types/ui/context/context-connect.d.ts +1 -1
- package/build-types/ui/context/context-connect.d.ts.map +1 -1
- package/build-types/ui/context/wordpress-component.d.ts +3 -3
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
- package/build-types/ui/control-group/types.d.ts +2 -2
- package/build-types/ui/control-group/types.d.ts.map +1 -1
- package/build-types/ui/control-label/types.d.ts +1 -1
- package/build-types/ui/control-label/types.d.ts.map +1 -1
- package/build-types/ui/form-group/form-group-content.d.ts +1 -1
- package/build-types/ui/form-group/form-group-help.d.ts +1 -1
- package/build-types/ui/form-group/form-group-label.d.ts +1 -1
- package/build-types/ui/form-group/types.d.ts +5 -5
- package/build-types/ui/form-group/types.d.ts.map +1 -1
- package/build-types/ui/form-group/use-form-group.d.ts +3 -3
- package/build-types/ui/spinner/component.d.ts +1 -1
- package/build-types/ui/tooltip/content.d.ts +1 -1
- package/build-types/ui/tooltip/types.d.ts +2 -2
- package/build-types/ui/tooltip/types.d.ts.map +1 -1
- package/build-types/ui/utils/font-size.d.ts +1 -1
- package/build-types/ui/utils/font-size.d.ts.map +1 -1
- package/build-types/ui/utils/space.d.ts +1 -1
- package/build-types/ui/utils/space.d.ts.map +1 -1
- package/build-types/ui/utils/types.d.ts +4 -4
- package/build-types/ui/utils/types.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +5 -5
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/utils/breakpoint-values.d.ts +1 -1
- package/build-types/utils/colors-values.d.ts +1 -1
- package/build-types/utils/config-values.d.ts +9 -9
- package/build-types/utils/events.d.ts +1 -1
- package/build-types/utils/events.d.ts.map +1 -1
- package/build-types/utils/font-values.d.ts +1 -1
- package/build-types/utils/font.d.ts.map +1 -1
- package/build-types/utils/hooks/use-controlled-value.d.ts +1 -1
- package/build-types/utils/hooks/use-controlled-value.d.ts.map +1 -1
- package/build-types/utils/types.d.ts +4 -4
- package/build-types/utils/types.d.ts.map +1 -1
- package/build-types/v-stack/component.d.ts +1 -4
- package/build-types/v-stack/component.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts.map +1 -1
- package/build-types/v-stack/stories/index.d.ts +1 -4
- package/build-types/v-stack/stories/index.d.ts.map +1 -1
- package/build-types/v-stack/types.d.ts +5 -3
- package/build-types/v-stack/types.d.ts.map +1 -1
- package/build-types/view/types.d.ts +1 -1
- package/build-types/view/types.d.ts.map +1 -1
- package/build-types/visually-hidden/types.d.ts +1 -1
- package/build-types/visually-hidden/types.d.ts.map +1 -1
- package/build-types/z-stack/types.d.ts +1 -1
- package/build-types/z-stack/types.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/animate/index.js +3 -1
- package/src/autocomplete/README.md +51 -0
- package/src/autocomplete/{autocompleter-ui.js → autocompleter-ui.tsx} +21 -10
- package/src/autocomplete/{get-default-use-items.js → get-default-use-items.tsx} +11 -6
- package/src/autocomplete/{index.js → index.tsx} +77 -111
- package/src/autocomplete/test/{index.js → index.tsx} +31 -20
- package/src/autocomplete/types.ts +220 -0
- package/src/border-control/test/index.js +0 -2
- package/src/button/style.scss +12 -1
- package/src/button/types.ts +2 -2
- package/src/circular-option-picker/types.ts +1 -1
- package/src/color-palette/test/__snapshots__/index.tsx.snap +16 -14
- package/src/custom-gradient-picker/gradient-bar/control-points.js +2 -0
- package/src/custom-gradient-picker/gradient-bar/index.js +2 -0
- package/src/custom-gradient-picker/gradient-bar/utils.js +2 -0
- package/src/custom-gradient-picker/index.js +2 -0
- package/src/custom-gradient-picker/serializer.js +2 -0
- package/src/custom-gradient-picker/utils.js +2 -0
- package/src/dimension-control/README.md +22 -55
- package/src/dimension-control/index.tsx +101 -0
- package/src/dimension-control/{sizes.js → sizes.ts} +8 -5
- package/src/dimension-control/stories/index.tsx +48 -0
- package/src/dimension-control/types.ts +48 -0
- package/src/flex/flex/hook.ts +2 -2
- package/src/font-size-picker/README.md +26 -20
- package/src/font-size-picker/index.tsx +2 -1
- package/src/font-size-picker/stories/index.tsx +1 -0
- package/src/font-size-picker/test/index.tsx +23 -0
- package/src/font-size-picker/types.ts +4 -0
- package/src/form-token-field/index.tsx +4 -1
- package/src/form-token-field/stories/index.tsx +13 -0
- package/src/form-token-field/test/index.tsx +80 -0
- package/src/gradient-picker/index.js +2 -0
- package/src/guide/README.md +17 -15
- package/src/guide/{icons.js → icons.tsx} +1 -1
- package/src/guide/{index.js → index.tsx} +47 -7
- package/src/guide/{page-control.js → page-control.tsx} +2 -1
- package/src/guide/{page.js → page.tsx} +8 -1
- package/src/guide/stories/{index.js → index.tsx} +11 -5
- package/src/guide/test/{index.js → index.tsx} +22 -4
- package/src/guide/types.ts +68 -0
- package/src/h-stack/README.md +2 -2
- package/src/h-stack/types.ts +2 -2
- package/src/h-stack/utils.ts +3 -3
- package/src/higher-order/navigate-regions/{index.js → index.tsx} +47 -11
- package/src/higher-order/with-fallback-styles/{index.js → index.tsx} +22 -5
- package/src/higher-order/with-filters/{index.js → index.tsx} +44 -12
- package/src/higher-order/with-filters/test/{index.js → index.tsx} +5 -1
- package/src/higher-order/with-focus-return/index.tsx +74 -0
- package/src/higher-order/with-focus-return/test/{index.js → index.tsx} +2 -2
- package/src/higher-order/with-notices/README.md +4 -1
- package/src/higher-order/with-notices/index.tsx +116 -0
- package/src/higher-order/with-notices/test/{index.js → index.tsx} +11 -6
- package/src/higher-order/with-notices/types.ts +35 -0
- package/src/higher-order/with-spoken-messages/test/{index.js → index.tsx} +2 -1
- package/src/icon/index.tsx +11 -15
- package/src/icon/test/{index.js → index.tsx} +6 -2
- package/src/index.native.js +1 -0
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +1 -1
- package/src/mobile/bottom-sheet/cell.native.js +1 -1
- package/src/mobile/bottom-sheet-text-control/README.md +8 -1
- package/src/mobile/bottom-sheet-text-control/index.native.js +2 -1
- package/src/mobile/link-settings/test/link-settings-navigation.native.js +1 -1
- package/src/navigation/README.md +16 -2
- package/src/navigation/back-button/{index.js → index.tsx} +22 -6
- package/src/navigation/{context.js → context.tsx} +8 -5
- package/src/navigation/group/context.tsx +15 -0
- package/src/navigation/group/{index.js → index.tsx} +9 -1
- package/src/navigation/{index.js → index.tsx} +63 -7
- package/src/navigation/item/{base-content.js → base-content.tsx} +5 -2
- package/src/navigation/item/{base.js → base.tsx} +3 -1
- package/src/navigation/item/{index.js → index.tsx} +8 -2
- package/src/navigation/item/{use-navigation-tree-item.js → use-navigation-tree-item.tsx} +9 -2
- package/src/navigation/menu/context.tsx +18 -0
- package/src/navigation/menu/{index.js → index.tsx} +5 -1
- package/src/navigation/menu/{menu-title-search.js → menu-title-search.tsx} +11 -7
- package/src/navigation/menu/{menu-title.js → menu-title.tsx} +5 -3
- package/src/navigation/menu/{search-no-results-found.js → search-no-results-found.tsx} +5 -1
- package/src/navigation/menu/{use-navigation-tree-menu.js → use-navigation-tree-menu.tsx} +3 -1
- package/src/navigation/stories/index.tsx +53 -0
- package/src/navigation/stories/utils/{controlled-state.js → controlled-state.tsx} +32 -13
- package/src/navigation/stories/utils/{default.js → default.tsx} +20 -6
- package/src/navigation/stories/utils/{group.js → group.tsx} +21 -7
- package/src/navigation/stories/utils/{hide-if-empty.js → hide-if-empty.tsx} +19 -6
- package/src/navigation/stories/utils/{more-examples.js → more-examples.tsx} +30 -12
- package/src/navigation/stories/utils/{search.js → search.tsx} +21 -7
- package/src/navigation/test/{index.js → index.tsx} +17 -4
- package/src/navigation/types.ts +325 -0
- package/src/navigation/{use-create-navigation-tree.js → use-create-navigation-tree.tsx} +37 -25
- package/src/navigation/{use-navigation-tree-nodes.js → use-navigation-tree-nodes.tsx} +10 -6
- package/src/navigation/{utils.js → utils.tsx} +2 -2
- package/src/navigator/navigator-screen/component.tsx +13 -7
- package/src/navigator/test/index.tsx +65 -22
- package/src/number-control/index.tsx +0 -2
- package/src/palette-edit/{index.js → index.tsx} +115 -48
- package/src/palette-edit/stories/index.tsx +82 -0
- package/src/palette-edit/test/{index.js → index.tsx} +15 -3
- package/src/palette-edit/types.ts +126 -0
- package/src/panel/README.md +53 -35
- package/src/panel/{body.js → body.tsx} +31 -17
- package/src/panel/stories/{index.js → index.tsx} +16 -6
- package/src/panel/test/{body.js → body.tsx} +12 -17
- package/src/panel/types.ts +78 -0
- package/src/placeholder/index.tsx +2 -6
- package/src/placeholder/test/index.tsx +1 -1
- package/src/placeholder/types.ts +2 -2
- package/src/popover/test/index.tsx +5 -2
- package/src/query-controls/author-select.tsx +1 -6
- package/src/query-controls/category-select.tsx +1 -6
- package/src/query-controls/terms.ts +29 -18
- package/src/range-control/index.tsx +2 -6
- package/src/range-control/types.ts +3 -3
- package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +2 -1
- package/src/responsive-wrapper/README.md +8 -2
- package/src/responsive-wrapper/index.tsx +18 -17
- package/src/responsive-wrapper/stories/index.tsx +41 -0
- package/src/responsive-wrapper/style.scss +5 -11
- package/src/responsive-wrapper/types.ts +2 -2
- package/src/select-control/index.tsx +16 -16
- package/src/select-control/stories/index.tsx +24 -12
- package/src/select-control/types.ts +68 -40
- package/src/tab-panel/types.ts +4 -4
- package/src/toolbar/toolbar-button/README.md +13 -1
- package/src/toolbar/toolbar-button/{index.js → index.tsx} +55 -20
- package/src/toolbar/toolbar-button/toolbar-button-container.tsx +13 -0
- package/src/toolbar/toolbar-button/types.ts +46 -0
- package/src/toolbar/toolbar-context/index.ts +15 -0
- package/src/tooltip/index.js +11 -1
- package/src/tree-select/index.tsx +5 -2
- package/src/tree-select/types.ts +6 -13
- package/src/ui/context/get-styled-class-name-from-key.ts +1 -1
- package/src/utils/font.js +1 -6
- package/src/v-stack/README.md +2 -2
- package/src/v-stack/hook.ts +6 -4
- package/src/v-stack/stories/index.tsx +28 -7
- package/src/v-stack/test/__snapshots__/index.tsx.snap +20 -18
- package/src/v-stack/types.ts +5 -3
- package/tsconfig.json +1 -14
- package/tsconfig.tsbuildinfo +1 -1
- package/src/dimension-control/index.js +0 -73
- package/src/higher-order/with-focus-return/index.js +0 -64
- package/src/higher-order/with-notices/index.js +0 -104
- package/src/navigation/group/context.js +0 -9
- package/src/navigation/menu/context.js +0 -11
- package/src/navigation/stories/index.js +0 -33
- package/src/toolbar/toolbar-button/toolbar-button-container.js +0 -6
- package/src/toolbar/toolbar-context/index.js +0 -10
- /package/src/animation/{index.js → index.tsx} +0 -0
- /package/src/higher-order/with-filters/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- /package/src/higher-order/with-spoken-messages/{index.js → index.tsx} +0 -0
- /package/src/navigation/{constants.js → constants.tsx} +0 -0
- /package/src/navigation/styles/{navigation-styles.js → navigation-styles.tsx} +0 -0
- /package/src/panel/test/__snapshots__/{body.js.snap → body.tsx.snap} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/index.native.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/index.native.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAUA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAmCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAlCA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AAIA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AAIA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AAOA;;AAMA;;AAMA","sourcesContent":["export {\n\tSVG,\n\tPath,\n\tCircle,\n\tPolygon,\n\tRect,\n\tG,\n\tHorizontalRule,\n\tBlockQuotation,\n} from '@wordpress/primitives';\nexport { default as ColorIndicator } from './color-indicator';\nexport { default as ColorPalette } from './color-palette';\nexport { ColorPicker } from './color-picker';\nexport { default as Dashicon } from './dashicon';\nexport { default as Dropdown } from './dropdown';\nexport { default as DropdownMenu } from './dropdown-menu';\nexport { default as FocalPointPicker } from './focal-point-picker';\nexport {\n\tToolbar,\n\tToolbarButton,\n\tToolbarContext as __experimentalToolbarContext,\n\tToolbarDropdownMenu,\n\tToolbarGroup,\n\tToolbarItem,\n} from './toolbar';\nexport { default as Tooltip } from './tooltip';\nexport { default as Icon } from './icon';\nexport { default as Spinner } from './spinner';\nexport {\n\tcreateSlotFill,\n\tSlot,\n\tFill,\n\tProvider as SlotFillProvider,\n} from './slot-fill';\n\nexport { default as __experimentalStyleProvider } from './style-provider';\nexport { default as BaseControl } from './base-control';\nexport { hasSplitBorders as __experimentalHasSplitBorders } from './border-box-control/utils';\nexport { default as TextareaControl } from './textarea-control';\nexport { default as PanelBody } from './panel/body';\nexport { default as PanelActions } from './panel/actions';\nexport { default as Button } from './button';\nexport { default as __experimentalText } from './text';\nexport { default as ExternalLink } from './external-link';\nexport { default as TextControl } from './text-control';\nexport { default as ToggleControl } from './toggle-control';\nexport { default as SandBox } from './sandbox';\nexport { default as SearchControl } from './search-control';\nexport { default as SelectControl } from './select-control';\nexport { default as RangeControl } from './range-control';\nexport { default as ResizableBox } from './resizable-box';\nexport { default as FooterMessageControl } from './footer-message-control';\nexport { default as ColorControl } from './color-control';\nexport { default as QueryControls } from './query-controls';\nexport { default as Notice } from './notice';\nexport { default as NoticeList } from './notice/list';\nexport { default as RadioControl } from './radio-control';\nexport {\n\tdefault as UnitControl,\n\tuseCustomUnits as __experimentalUseCustomUnits,\n} from './unit-control';\nexport {\n\tCSS_UNITS as CSS_UNITS,\n\tfilterUnitsWithSettings as filterUnitsWithSettings,\n} from './unit-control/utils';\nexport { default as Disabled } from './disabled';\nexport { default as Draggable, DraggableTrigger } from './draggable';\n\n// Higher-Order Components.\nexport { default as withConstrainedTabbing } from './higher-order/with-constrained-tabbing';\nexport { default as withFallbackStyles } from './higher-order/with-fallback-styles';\nexport { default as withFilters } from './higher-order/with-filters';\nexport { default as FontSizePicker } from './font-size-picker'; // Intentionally called after slot-fill and withFilters.\nexport { default as withFocusOutside } from './higher-order/with-focus-outside';\nexport { default as withFocusReturn } from './higher-order/with-focus-return';\nexport { default as withNotices } from './higher-order/with-notices';\nexport { default as withSpokenMessages } from './higher-order/with-spoken-messages';\nexport * from './text';\n\n// Mobile Components.\nexport {\n\t__unstableAutocompletionItemsFill,\n\t__unstableAutocompletionItemsSlot,\n} from './mobile/autocompletion-items';\nexport { default as Autocomplete } from './autocomplete';\nexport { default as BottomSheet } from './mobile/bottom-sheet';\nexport {\n\tBottomSheetConsumer,\n\tBottomSheetProvider,\n\tBottomSheetContext,\n} from './mobile/bottom-sheet/bottom-sheet-context';\nexport { default as BottomSheetSelectControl } from './mobile/bottom-sheet-select-control';\nexport { default as HTMLTextInput } from './mobile/html-text-input';\nexport { default as KeyboardAvoidingView } from './mobile/keyboard-avoiding-view';\nexport { default as KeyboardAwareFlatList } from './mobile/keyboard-aware-flat-list';\nexport { default as Picker } from './mobile/picker';\nexport { default as ReadableContentView } from './mobile/readable-content-view';\nexport { default as CycleSelectControl } from './mobile/cycle-select-control';\nexport { default as Gradient } from './mobile/gradient';\nexport { default as ColorSettings } from './mobile/color-settings';\nexport { default as SegmentedControls } from './mobile/segmented-control';\nexport { default as FocalPointSettingsPanel } from './mobile/focal-point-settings-panel';\nexport { default as BottomSheetTextControl } from './mobile/bottom-sheet-text-control';\nexport { default as FooterMessageLink } from './mobile/bottom-sheet/footer-message-link/footer-message-link';\nexport { LinkPicker } from './mobile/link-picker';\nexport { default as LinkPickerScreen } from './mobile/link-picker/link-picker-screen';\nexport { default as LinkSettings } from './mobile/link-settings';\nexport { default as LinkSettingsScreen } from './mobile/link-settings/link-settings-screen';\nexport { default as LinkSettingsNavigation } from './mobile/link-settings/link-settings-navigation';\nexport { default as ImageLinkDestinationsScreen } from './mobile/link-settings/image-link-destinations-screen';\nexport { default as SegmentedControl } from './mobile/segmented-control';\nexport { default as Image, IMAGE_DEFAULT_FOCAL_POINT } from './mobile/image';\nexport { default as ImageEditingButton } from './mobile/image/image-editing-button';\nexport { default as InserterButton } from './mobile/inserter-button';\nexport { setClipboard, getClipboard } from './mobile/clipboard';\nexport { default as AudioPlayer } from './mobile/audio-player';\nexport { default as Badge } from './mobile/badge';\nexport { default as Gridicons } from './mobile/gridicons';\n\n// Utils.\nexport { colorsUtils } from './mobile/color-settings/utils';\nexport {\n\tWIDE_ALIGNMENTS,\n\tALIGNMENT_BREAKPOINTS,\n\talignmentHelpers,\n} from './mobile/utils/alignments';\n\n// Hooks.\nexport {\n\tconvertUnitToMobile,\n\tuseConvertUnitToMobile,\n\tgetValueAndUnit,\n} from './mobile/utils/use-unit-converter-to-mobile';\n\nexport {\n\tdefault as GlobalStylesContext,\n\tuseGlobalStyles,\n\twithGlobalStyles,\n\tgetMergedGlobalStyles,\n} from './mobile/global-styles-context';\nexport {\n\tgetGlobalStyles,\n\tgetColorsAndGradients,\n\tuseMobileGlobalStylesColors,\n} from './mobile/global-styles-context/utils';\n"]}
|
|
@@ -208,7 +208,7 @@ class BottomSheetCell extends _element.Component {
|
|
|
208
208
|
// and the Text component to display it.
|
|
209
209
|
// We also show the TextInput to display placeholder.
|
|
210
210
|
|
|
211
|
-
const shouldShowPlaceholder =
|
|
211
|
+
const shouldShowPlaceholder = isInteractive && value === '';
|
|
212
212
|
return this.state.isEditingValue || shouldShowPlaceholder ? (0, _element.createElement)(_reactNative.TextInput, (0, _extends2.default)({
|
|
213
213
|
ref: c => this._valueTextInput = c,
|
|
214
214
|
numberOfLines: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/cell.native.js"],"names":["isIOS","Platform","OS","BottomSheetCell","Component","constructor","props","arguments","state","isEditingValue","autoFocus","isScreenReaderEnabled","handleScreenReaderToggled","bind","isCurrent","componentDidUpdate","prevProps","prevState","_valueTextInput","focus","componentDidMount","a11yInfoChangeSubscription","AccessibilityInfo","addEventListener","then","setState","componentWillUnmount","remove","typeToKeyboardType","type","step","keyboardType","Math","abs","render","accessible","accessibilityLabel","accessibilityHint","accessibilityRole","disabled","activeOpacity","onPress","onLongPress","label","subLabel","value","valuePlaceholder","icon","leftAlign","iconStyle","labelStyle","valueStyle","cellContainerStyle","cellRowContainerStyle","onChangeValue","onSubmit","children","editable","isSelected","separatorType","style","getStylesFromColorScheme","customActionButton","borderless","help","valueProps","showValue","undefined","isValueEditable","cellLabelStyle","styles","cellLabel","cellTextDark","cellLabelCenteredStyle","cellLabelCentered","cellLabelLeftAlignNoIconStyle","cellLabelLeftAlignNoIcon","defaultMissingIconAndValue","defaultLabelStyle","defaultSubLabelStyleText","cellSubLabelText","cellSubLabelTextDark","drawSeparator","separatorStyle","drawTopSeparator","cellContainerStyles","cellContainer","rowContainerStyles","cellRowContainer","isInteractive","onCellPress","startEditing","finishEditing","defaultSeparatorStyle","separator","separatorDark","cellSeparatorStyle","cellSeparator","cellSeparatorDark","leftMarginStyle","platformStyles","separatorMarginLeft","getValueComponent","styleRTL","I18nManager","isRTL","cellValueRTL","cellValueStyle","cellValue","finalStyle","shouldShowPlaceholder","c","getAccessibilityLabel","iconStyleBase","iconDark","resetButtonStyle","resetButton","resetButtonDark","cellHelpStyle","cellHelpLabel","cellHelpLabelIOS","containerPointerEvents","title","handler","opacity","clipToBounds","cellRowIcon","color","labelIconSeparator","check","placeholderColor"],"mappings":";;;;;;;;;AAmBA;;;;AAhBA;;AASA;;AAKA;;AACA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AA5BA;AACA;AACA;;AAYA;AACA;AACA;;AAOA;AACA;AACA;AAKA,MAAMA,KAAK,GAAGC,sBAASC,EAAT,KAAgB,KAA9B;;AACA,MAAMC,eAAN,SAA8BC,kBAA9B,CAAwC;AACvCC,EAAAA,WAAW,CAAEC,KAAF,EAAU;AACpB,UAAO,GAAGC,SAAV;AACA,SAAKC,KAAL,GAAa;AACZC,MAAAA,cAAc,EAAEH,KAAK,CAACI,SAAN,IAAmB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AFlC,MAjEF,EAsEG7D,SAAS,IAAIoC,iBAAiB,EAtEjC,EAuEG9C,QAvEH,CAtBD,EA+FGQ,IAAI,IACL,4BAAC,iBAAD;AAAM,MAAA,KAAK,EAAG,CAAEsD,aAAF,EAAiBhD,gBAAO4D,gBAAxB;AAAd,OACGlE,IADH,CAhGF,EAoGG,CAAEoB,gBAAF,IAAsB,4BAAC,iBAAD;AAAM,MAAA,KAAK,EAAGD,cAAc;AAA5B,MApGzB,CADD;AAwGA;;AAhZsC;;eAmZzB,uCAA0BhF,eAA1B,C","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tTouchableOpacity,\n\tText,\n\tView,\n\tTextInput,\n\tI18nManager,\n\tAccessibilityInfo,\n\tPlatform,\n} from 'react-native';\nimport { isEmpty, get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { check } from '@wordpress/icons';\nimport { Component } from '@wordpress/element';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport platformStyles from './cellStyles.scss';\nimport TouchableRipple from './ripple';\n\nconst isIOS = Platform.OS === 'ios';\nclass BottomSheetCell extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\tisEditingValue: props.autoFocus || false,\n\t\t\tisScreenReaderEnabled: false,\n\t\t};\n\n\t\tthis.handleScreenReaderToggled =\n\t\t\tthis.handleScreenReaderToggled.bind( this );\n\n\t\tthis.isCurrent = false;\n\t}\n\n\tcomponentDidUpdate( prevProps, prevState ) {\n\t\tif ( ! prevState.isEditingValue && this.state.isEditingValue ) {\n\t\t\tthis._valueTextInput.focus();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.isCurrent = true;\n\t\tthis.a11yInfoChangeSubscription = AccessibilityInfo.addEventListener(\n\t\t\t'screenReaderChanged',\n\t\t\tthis.handleScreenReaderToggled\n\t\t);\n\n\t\tAccessibilityInfo.isScreenReaderEnabled().then(\n\t\t\t( isScreenReaderEnabled ) => {\n\t\t\t\tif ( this.isCurrent && isScreenReaderEnabled ) {\n\t\t\t\t\tthis.setState( { isScreenReaderEnabled } );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.isCurrent = false;\n\t\tthis.a11yInfoChangeSubscription.remove();\n\t}\n\n\thandleScreenReaderToggled( isScreenReaderEnabled ) {\n\t\tthis.setState( { isScreenReaderEnabled } );\n\t}\n\n\ttypeToKeyboardType( type, step ) {\n\t\tlet keyboardType = `default`;\n\t\tif ( type === `number` ) {\n\t\t\tif ( step && Math.abs( step ) < 1 ) {\n\t\t\t\tkeyboardType = `decimal-pad`;\n\t\t\t} else {\n\t\t\t\tkeyboardType = `number-pad`;\n\t\t\t}\n\t\t}\n\t\treturn keyboardType;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\taccessible,\n\t\t\taccessibilityLabel,\n\t\t\taccessibilityHint,\n\t\t\taccessibilityRole,\n\t\t\tdisabled = false,\n\t\t\tactiveOpacity,\n\t\t\tonPress,\n\t\t\tonLongPress,\n\t\t\tlabel,\n\t\t\tsubLabel,\n\t\t\tvalue,\n\t\t\tvaluePlaceholder = '',\n\t\t\ticon,\n\t\t\tleftAlign,\n\t\t\ticonStyle = {},\n\t\t\tlabelStyle = {},\n\t\t\tvalueStyle = {},\n\t\t\tcellContainerStyle = {},\n\t\t\tcellRowContainerStyle = {},\n\t\t\tonChangeValue,\n\t\t\tonSubmit,\n\t\t\tchildren,\n\t\t\teditable = true,\n\t\t\tisSelected = false,\n\t\t\tseparatorType,\n\t\t\tstyle = {},\n\t\t\tgetStylesFromColorScheme,\n\t\t\tcustomActionButton,\n\t\t\ttype,\n\t\t\tstep,\n\t\t\tborderless,\n\t\t\thelp,\n\t\t\t...valueProps\n\t\t} = this.props;\n\n\t\tconst showValue = value !== undefined;\n\t\tconst isValueEditable = editable && onChangeValue !== undefined;\n\t\tconst cellLabelStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabel,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst cellLabelCenteredStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabelCentered,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst cellLabelLeftAlignNoIconStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabelLeftAlignNoIcon,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst defaultMissingIconAndValue = leftAlign\n\t\t\t? cellLabelLeftAlignNoIconStyle\n\t\t\t: cellLabelCenteredStyle;\n\t\tconst defaultLabelStyle =\n\t\t\tshowValue || customActionButton || icon\n\t\t\t\t? cellLabelStyle\n\t\t\t\t: defaultMissingIconAndValue;\n\n\t\tconst defaultSubLabelStyleText = getStylesFromColorScheme(\n\t\t\tstyles.cellSubLabelText,\n\t\t\tstyles.cellSubLabelTextDark\n\t\t);\n\n\t\tconst drawSeparator =\n\t\t\t( separatorType && separatorType !== 'none' ) ||\n\t\t\tseparatorStyle === undefined;\n\t\tconst drawTopSeparator =\n\t\t\tdrawSeparator && separatorType === 'topFullWidth';\n\n\t\tconst cellContainerStyles = [\n\t\t\tstyles.cellContainer,\n\t\t\tcellContainerStyle,\n\t\t];\n\t\tconst rowContainerStyles = [\n\t\t\tstyles.cellRowContainer,\n\t\t\tcellRowContainerStyle,\n\t\t];\n\n\t\tconst isInteractive =\n\t\t\tisValueEditable ||\n\t\t\tonPress !== undefined ||\n\t\t\tonLongPress !== undefined;\n\n\t\tconst onCellPress = () => {\n\t\t\tif ( isValueEditable ) {\n\t\t\t\tstartEditing();\n\t\t\t} else if ( onPress !== undefined ) {\n\t\t\t\tonPress();\n\t\t\t}\n\t\t};\n\n\t\tconst finishEditing = () => {\n\t\t\tthis.setState( { isEditingValue: false } );\n\t\t};\n\n\t\tconst startEditing = () => {\n\t\t\tif ( this.state.isEditingValue === false ) {\n\t\t\t\tthis.setState( { isEditingValue: true } );\n\t\t\t}\n\t\t};\n\n\t\tconst separatorStyle = () => {\n\t\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\t\tconst defaultSeparatorStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.separator,\n\t\t\t\tstyles.separatorDark\n\t\t\t);\n\t\t\tconst cellSeparatorStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.cellSeparator,\n\t\t\t\tstyles.cellSeparatorDark\n\t\t\t);\n\t\t\tconst leftMarginStyle = {\n\t\t\t\t...cellSeparatorStyle,\n\t\t\t\t...platformStyles.separatorMarginLeft,\n\t\t\t};\n\t\t\tswitch ( separatorType ) {\n\t\t\t\tcase 'leftMargin':\n\t\t\t\t\treturn leftMarginStyle;\n\t\t\t\tcase 'fullWidth':\n\t\t\t\tcase 'topFullWidth':\n\t\t\t\t\treturn defaultSeparatorStyle;\n\t\t\t\tcase 'none':\n\t\t\t\t\treturn undefined;\n\t\t\t\tcase undefined:\n\t\t\t\t\tif ( showValue && icon ) {\n\t\t\t\t\t\treturn leftMarginStyle;\n\t\t\t\t\t}\n\t\t\t\t\treturn defaultSeparatorStyle;\n\t\t\t}\n\t\t};\n\n\t\tconst getValueComponent = () => {\n\t\t\tconst styleRTL = I18nManager.isRTL && styles.cellValueRTL;\n\t\t\tconst cellValueStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.cellValue,\n\t\t\t\tstyles.cellTextDark\n\t\t\t);\n\t\t\tconst finalStyle = {\n\t\t\t\t...cellValueStyle,\n\t\t\t\t...valueStyle,\n\t\t\t\t...styleRTL,\n\t\t\t};\n\n\t\t\t// To be able to show the `middle` ellipsizeMode on editable cells\n\t\t\t// we show the TextInput just when the user wants to edit the value,\n\t\t\t// and the Text component to display it.\n\t\t\t// We also show the TextInput to display placeholder.\n\t\t\tconst shouldShowPlaceholder = isValueEditable && value === '';\n\t\t\treturn this.state.isEditingValue || shouldShowPlaceholder ? (\n\t\t\t\t<TextInput\n\t\t\t\t\tref={ ( c ) => ( this._valueTextInput = c ) }\n\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\tstyle={ finalStyle }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tplaceholder={ valuePlaceholder }\n\t\t\t\t\tplaceholderTextColor={ '#87a6bc' }\n\t\t\t\t\tonChangeText={ onChangeValue }\n\t\t\t\t\teditable={ isValueEditable }\n\t\t\t\t\tpointerEvents={\n\t\t\t\t\t\tthis.state.isEditingValue ? 'auto' : 'none'\n\t\t\t\t\t}\n\t\t\t\t\tonFocus={ startEditing }\n\t\t\t\t\tonBlur={ finishEditing }\n\t\t\t\t\tonSubmitEditing={ onSubmit }\n\t\t\t\t\tkeyboardType={ this.typeToKeyboardType( type, step ) }\n\t\t\t\t\t{ ...valueProps }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Text\n\t\t\t\t\tstyle={ { ...cellValueStyle, ...valueStyle } }\n\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\tellipsizeMode={ 'middle' }\n\t\t\t\t>\n\t\t\t\t\t{ value }\n\t\t\t\t</Text>\n\t\t\t);\n\t\t};\n\n\t\tconst getAccessibilityLabel = () => {\n\t\t\tif ( accessible === false ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( accessibilityLabel || ! showValue ) {\n\t\t\t\treturn accessibilityLabel || label;\n\t\t\t}\n\n\t\t\tif ( isEmpty( value ) ) {\n\t\t\t\treturn isEmpty( help )\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: accessibility text. Empty state of a inline textinput cell. %s: The cell's title */\n\t\t\t\t\t\t\t_x( '%s. Empty', 'inline textinput cell' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t )\n\t\t\t\t\t: // Separating by ',' is necessary to make a pause on urls (non-capitalized text)\n\t\t\t\t\t sprintf(\n\t\t\t\t\t\t\t/* translators: accessibility text. Empty state of a inline textinput cell. %1: Cell title, %2: cell help. */\n\t\t\t\t\t\t\t_x( '%1$s, %2$s. Empty', 'inline textinput cell' ),\n\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\thelp\n\t\t\t\t\t );\n\t\t\t}\n\t\t\treturn isEmpty( help )\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. Inline textinput title and value.%1: Cell title, %2: cell value. */\n\t\t\t\t\t\t_x( '%1$s, %2$s', 'inline textinput cell' ),\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tvalue\n\t\t\t\t ) // Separating by ',' is necessary to make a pause on urls (non-capitalized text)\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. Inline textinput title, value and help text.%1: Cell title, %2: cell value, , %3: cell help. */\n\t\t\t\t\t\t_x( '%1$s, %2$s, %3$s', 'inline textinput cell' ),\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\thelp\n\t\t\t\t );\n\t\t};\n\n\t\tconst iconStyleBase = getStylesFromColorScheme(\n\t\t\tstyles.icon,\n\t\t\tstyles.iconDark\n\t\t);\n\t\tconst resetButtonStyle = getStylesFromColorScheme(\n\t\t\tstyles.resetButton,\n\t\t\tstyles.resetButtonDark\n\t\t);\n\t\tconst cellHelpStyle = [\n\t\t\tstyles.cellHelpLabel,\n\t\t\tisIOS && styles.cellHelpLabelIOS,\n\t\t];\n\t\tconst containerPointerEvents =\n\t\t\tthis.state.isScreenReaderEnabled && accessible ? 'none' : 'auto';\n\t\tconst { title, handler } = customActionButton || {};\n\n\t\tconst opacity =\n\t\t\tactiveOpacity !== undefined\n\t\t\t\t? activeOpacity\n\t\t\t\t: get( platformStyles, 'activeOpacity.opacity' );\n\n\t\treturn (\n\t\t\t<TouchableRipple\n\t\t\t\taccessible={\n\t\t\t\t\taccessible !== undefined\n\t\t\t\t\t\t? accessible\n\t\t\t\t\t\t: ! this.state.isEditingValue\n\t\t\t\t}\n\t\t\t\taccessibilityLabel={ getAccessibilityLabel() }\n\t\t\t\taccessibilityRole={ accessibilityRole || 'button' }\n\t\t\t\taccessibilityHint={\n\t\t\t\t\tisValueEditable\n\t\t\t\t\t\t? /* translators: accessibility text */\n\t\t\t\t\t\t __( 'Double tap to edit this value' )\n\t\t\t\t\t\t: accessibilityHint\n\t\t\t\t}\n\t\t\t\tdisabled={ disabled || ! isInteractive }\n\t\t\t\tactiveOpacity={ opacity }\n\t\t\t\tonPress={ onCellPress }\n\t\t\t\tonLongPress={ onLongPress }\n\t\t\t\tstyle={ [ styles.clipToBounds, style ] }\n\t\t\t\tborderless={ borderless }\n\t\t\t>\n\t\t\t\t{ drawTopSeparator && <View style={ separatorStyle() } /> }\n\t\t\t\t<View\n\t\t\t\t\tstyle={ cellContainerStyles }\n\t\t\t\t\tpointerEvents={ containerPointerEvents }\n\t\t\t\t>\n\t\t\t\t\t<View style={ rowContainerStyles }>\n\t\t\t\t\t\t<View style={ styles.cellRowContainer }>\n\t\t\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t\tstyles.cellRowContainer,\n\t\t\t\t\t\t\t\t\t\tstyles.cellRowIcon,\n\t\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\t\t\tfill={\n\t\t\t\t\t\t\t\t\t\t\ticonStyle.color ||\n\t\t\t\t\t\t\t\t\t\t\ticonStyleBase.color\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tstyle={ iconStyle }\n\t\t\t\t\t\t\t\t\t\tisPressed={ false }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\t\t\tplatformStyles.labelIconSeparator\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ subLabel && label && (\n\t\t\t\t\t\t\t\t<View>\n\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t\t\tdefaultLabelStyle,\n\t\t\t\t\t\t\t\t\t\t\tlabelStyle,\n\t\t\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t<Text style={ defaultSubLabelStyleText }>\n\t\t\t\t\t\t\t\t\t\t{ subLabel }\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ ! subLabel && label && (\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\tstyle={ [ defaultLabelStyle, labelStyle ] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t\t{ customActionButton && (\n\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\tonPress={ handler }\n\t\t\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Text style={ resetButtonStyle }>\n\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\t\tfill={ platformStyles.isSelected.color }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showValue && getValueComponent() }\n\t\t\t\t\t{ children }\n\t\t\t\t</View>\n\t\t\t\t{ help && (\n\t\t\t\t\t<Text style={ [ cellHelpStyle, styles.placeholderColor ] }>\n\t\t\t\t\t\t{ help }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t\t{ ! drawTopSeparator && <View style={ separatorStyle() } /> }\n\t\t\t</TouchableRipple>\n\t\t);\n\t}\n}\n\nexport default withPreferredColorScheme( BottomSheetCell );\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/cell.native.js"],"names":["isIOS","Platform","OS","BottomSheetCell","Component","constructor","props","arguments","state","isEditingValue","autoFocus","isScreenReaderEnabled","handleScreenReaderToggled","bind","isCurrent","componentDidUpdate","prevProps","prevState","_valueTextInput","focus","componentDidMount","a11yInfoChangeSubscription","AccessibilityInfo","addEventListener","then","setState","componentWillUnmount","remove","typeToKeyboardType","type","step","keyboardType","Math","abs","render","accessible","accessibilityLabel","accessibilityHint","accessibilityRole","disabled","activeOpacity","onPress","onLongPress","label","subLabel","value","valuePlaceholder","icon","leftAlign","iconStyle","labelStyle","valueStyle","cellContainerStyle","cellRowContainerStyle","onChangeValue","onSubmit","children","editable","isSelected","separatorType","style","getStylesFromColorScheme","customActionButton","borderless","help","valueProps","showValue","undefined","isValueEditable","cellLabelStyle","styles","cellLabel","cellTextDark","cellLabelCenteredStyle","cellLabelCentered","cellLabelLeftAlignNoIconStyle","cellLabelLeftAlignNoIcon","defaultMissingIconAndValue","defaultLabelStyle","defaultSubLabelStyleText","cellSubLabelText","cellSubLabelTextDark","drawSeparator","separatorStyle","drawTopSeparator","cellContainerStyles","cellContainer","rowContainerStyles","cellRowContainer","isInteractive","onCellPress","startEditing","finishEditing","defaultSeparatorStyle","separator","separatorDark","cellSeparatorStyle","cellSeparator","cellSeparatorDark","leftMarginStyle","platformStyles","separatorMarginLeft","getValueComponent","styleRTL","I18nManager","isRTL","cellValueRTL","cellValueStyle","cellValue","finalStyle","shouldShowPlaceholder","c","getAccessibilityLabel","iconStyleBase","iconDark","resetButtonStyle","resetButton","resetButtonDark","cellHelpStyle","cellHelpLabel","cellHelpLabelIOS","containerPointerEvents","title","handler","opacity","clipToBounds","cellRowIcon","color","labelIconSeparator","check","placeholderColor"],"mappings":";;;;;;;;;AAmBA;;;;AAhBA;;AASA;;AAKA;;AACA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AA5BA;AACA;AACA;;AAYA;AACA;AACA;;AAOA;AACA;AACA;AAKA,MAAMA,KAAK,GAAGC,sBAASC,EAAT,KAAgB,KAA9B;;AACA,MAAMC,eAAN,SAA8BC,kBAA9B,CAAwC;AACvCC,EAAAA,WAAW,CAAEC,KAAF,EAAU;AACpB,UAAO,GAAGC,SAAV;AACA,SAAKC,KAAL,GAAa;AACZC,MAAAA,cAAc,EAAEH,KAAK,CAACI,SAAN,IAAmB,KADvB;AAEZC,MAAAA,qBAAqB,EAAE;AAFX,KAAb;AAKA,SAAKC,yBAAL,GACC,KAAKA,yBAAL,CAA+BC,IAA/B,CAAqC,IAArC,CADD;AAGA,SAAKC,SAAL,GAAiB,KAAjB;AACA;;AAEDC,EAAAA,kBAAkB,CAAEC,SAAF,EAAaC,SAAb,EAAyB;AAC1C,QAAK,CAAEA,SAAS,CAACR,cAAZ,IAA8B,KAAKD,KAAL,CAAWC,cAA9C,EAA+D;AAC9D,WAAKS,eAAL,CAAqBC,KAArB;AACA;AACD;;AAEDC,EAAAA,iBAAiB,GAAG;AACnB,SAAKN,SAAL,GAAiB,IAAjB;AACA,SAAKO,0BAAL,GAAkCC,+BAAkBC,gBAAlB,CACjC,qBADiC,EAEjC,KAAKX,yBAF4B,CAAlC;;AAKAU,mCAAkBX,qBAAlB,GAA0Ca,IAA1C,CACGb,qBAAF,IAA6B;AAC5B,UAAK,KAAKG,SAAL,IAAkBH,qBAAvB,EAA+C;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4BAAC,iBAAD,QACC,4BAAC,iBAAD;AACC,MAAA,KAAK,EAAG,CACPmC,iBADO,EAEP5B,UAFO;AADT,OAMGP,KANH,CADD,EASC,4BAAC,iBAAD;AAAM,MAAA,KAAK,EAAGoC;AAAd,OACGnC,QADH,CATD,CA1BF,EAwCG,CAAEA,QAAF,IAAcD,KAAd,IACD,4BAAC,iBAAD;AACC,MAAA,KAAK,EAAG,CAAEmC,iBAAF,EAAqB5B,UAArB;AADT,OAGGP,KAHH,CAzCF,CADD,EAiDGmB,kBAAkB,IACnB,4BAAC,6BAAD;AACC,MAAA,OAAO,EAAG6D,OADX;AAEC,MAAA,iBAAiB,EAAG;AAFrB,OAIC,4BAAC,iBAAD;AAAM,MAAA,KAAK,EAAGR;AAAd,OACGO,KADH,CAJD,CAlDF,CAJD,EAgEGhE,UAAU,IACX,4BAAC,gBAAD;AACC,MAAA,IAAI,EAAGuE,YADR;AAEC,MAAA,IAAI,EAAG7B,oBAAe1C,UAAf,CAA0BqE;AAFlC,MAjEF,EAsEG7D,SAAS,IAAIoC,iBAAiB,EAtEjC,EAuEG9C,QAvEH,CAtBD,EA+FGQ,IAAI,IACL,4BAAC,iBAAD;AAAM,MAAA,KAAK,EAAG,CAAEsD,aAAF,EAAiBhD,gBAAO4D,gBAAxB;AAAd,OACGlE,IADH,CAhGF,EAoGG,CAAEoB,gBAAF,IAAsB,4BAAC,iBAAD;AAAM,MAAA,KAAK,EAAGD,cAAc;AAA5B,MApGzB,CADD;AAwGA;;AAhZsC;;eAmZzB,uCAA0BhF,eAA1B,C","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tTouchableOpacity,\n\tText,\n\tView,\n\tTextInput,\n\tI18nManager,\n\tAccessibilityInfo,\n\tPlatform,\n} from 'react-native';\nimport { isEmpty, get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { check } from '@wordpress/icons';\nimport { Component } from '@wordpress/element';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport platformStyles from './cellStyles.scss';\nimport TouchableRipple from './ripple';\n\nconst isIOS = Platform.OS === 'ios';\nclass BottomSheetCell extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\tisEditingValue: props.autoFocus || false,\n\t\t\tisScreenReaderEnabled: false,\n\t\t};\n\n\t\tthis.handleScreenReaderToggled =\n\t\t\tthis.handleScreenReaderToggled.bind( this );\n\n\t\tthis.isCurrent = false;\n\t}\n\n\tcomponentDidUpdate( prevProps, prevState ) {\n\t\tif ( ! prevState.isEditingValue && this.state.isEditingValue ) {\n\t\t\tthis._valueTextInput.focus();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.isCurrent = true;\n\t\tthis.a11yInfoChangeSubscription = AccessibilityInfo.addEventListener(\n\t\t\t'screenReaderChanged',\n\t\t\tthis.handleScreenReaderToggled\n\t\t);\n\n\t\tAccessibilityInfo.isScreenReaderEnabled().then(\n\t\t\t( isScreenReaderEnabled ) => {\n\t\t\t\tif ( this.isCurrent && isScreenReaderEnabled ) {\n\t\t\t\t\tthis.setState( { isScreenReaderEnabled } );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.isCurrent = false;\n\t\tthis.a11yInfoChangeSubscription.remove();\n\t}\n\n\thandleScreenReaderToggled( isScreenReaderEnabled ) {\n\t\tthis.setState( { isScreenReaderEnabled } );\n\t}\n\n\ttypeToKeyboardType( type, step ) {\n\t\tlet keyboardType = `default`;\n\t\tif ( type === `number` ) {\n\t\t\tif ( step && Math.abs( step ) < 1 ) {\n\t\t\t\tkeyboardType = `decimal-pad`;\n\t\t\t} else {\n\t\t\t\tkeyboardType = `number-pad`;\n\t\t\t}\n\t\t}\n\t\treturn keyboardType;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\taccessible,\n\t\t\taccessibilityLabel,\n\t\t\taccessibilityHint,\n\t\t\taccessibilityRole,\n\t\t\tdisabled = false,\n\t\t\tactiveOpacity,\n\t\t\tonPress,\n\t\t\tonLongPress,\n\t\t\tlabel,\n\t\t\tsubLabel,\n\t\t\tvalue,\n\t\t\tvaluePlaceholder = '',\n\t\t\ticon,\n\t\t\tleftAlign,\n\t\t\ticonStyle = {},\n\t\t\tlabelStyle = {},\n\t\t\tvalueStyle = {},\n\t\t\tcellContainerStyle = {},\n\t\t\tcellRowContainerStyle = {},\n\t\t\tonChangeValue,\n\t\t\tonSubmit,\n\t\t\tchildren,\n\t\t\teditable = true,\n\t\t\tisSelected = false,\n\t\t\tseparatorType,\n\t\t\tstyle = {},\n\t\t\tgetStylesFromColorScheme,\n\t\t\tcustomActionButton,\n\t\t\ttype,\n\t\t\tstep,\n\t\t\tborderless,\n\t\t\thelp,\n\t\t\t...valueProps\n\t\t} = this.props;\n\n\t\tconst showValue = value !== undefined;\n\t\tconst isValueEditable = editable && onChangeValue !== undefined;\n\t\tconst cellLabelStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabel,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst cellLabelCenteredStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabelCentered,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst cellLabelLeftAlignNoIconStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabelLeftAlignNoIcon,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst defaultMissingIconAndValue = leftAlign\n\t\t\t? cellLabelLeftAlignNoIconStyle\n\t\t\t: cellLabelCenteredStyle;\n\t\tconst defaultLabelStyle =\n\t\t\tshowValue || customActionButton || icon\n\t\t\t\t? cellLabelStyle\n\t\t\t\t: defaultMissingIconAndValue;\n\n\t\tconst defaultSubLabelStyleText = getStylesFromColorScheme(\n\t\t\tstyles.cellSubLabelText,\n\t\t\tstyles.cellSubLabelTextDark\n\t\t);\n\n\t\tconst drawSeparator =\n\t\t\t( separatorType && separatorType !== 'none' ) ||\n\t\t\tseparatorStyle === undefined;\n\t\tconst drawTopSeparator =\n\t\t\tdrawSeparator && separatorType === 'topFullWidth';\n\n\t\tconst cellContainerStyles = [\n\t\t\tstyles.cellContainer,\n\t\t\tcellContainerStyle,\n\t\t];\n\t\tconst rowContainerStyles = [\n\t\t\tstyles.cellRowContainer,\n\t\t\tcellRowContainerStyle,\n\t\t];\n\n\t\tconst isInteractive =\n\t\t\tisValueEditable ||\n\t\t\tonPress !== undefined ||\n\t\t\tonLongPress !== undefined;\n\n\t\tconst onCellPress = () => {\n\t\t\tif ( isValueEditable ) {\n\t\t\t\tstartEditing();\n\t\t\t} else if ( onPress !== undefined ) {\n\t\t\t\tonPress();\n\t\t\t}\n\t\t};\n\n\t\tconst finishEditing = () => {\n\t\t\tthis.setState( { isEditingValue: false } );\n\t\t};\n\n\t\tconst startEditing = () => {\n\t\t\tif ( this.state.isEditingValue === false ) {\n\t\t\t\tthis.setState( { isEditingValue: true } );\n\t\t\t}\n\t\t};\n\n\t\tconst separatorStyle = () => {\n\t\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\t\tconst defaultSeparatorStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.separator,\n\t\t\t\tstyles.separatorDark\n\t\t\t);\n\t\t\tconst cellSeparatorStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.cellSeparator,\n\t\t\t\tstyles.cellSeparatorDark\n\t\t\t);\n\t\t\tconst leftMarginStyle = {\n\t\t\t\t...cellSeparatorStyle,\n\t\t\t\t...platformStyles.separatorMarginLeft,\n\t\t\t};\n\t\t\tswitch ( separatorType ) {\n\t\t\t\tcase 'leftMargin':\n\t\t\t\t\treturn leftMarginStyle;\n\t\t\t\tcase 'fullWidth':\n\t\t\t\tcase 'topFullWidth':\n\t\t\t\t\treturn defaultSeparatorStyle;\n\t\t\t\tcase 'none':\n\t\t\t\t\treturn undefined;\n\t\t\t\tcase undefined:\n\t\t\t\t\tif ( showValue && icon ) {\n\t\t\t\t\t\treturn leftMarginStyle;\n\t\t\t\t\t}\n\t\t\t\t\treturn defaultSeparatorStyle;\n\t\t\t}\n\t\t};\n\n\t\tconst getValueComponent = () => {\n\t\t\tconst styleRTL = I18nManager.isRTL && styles.cellValueRTL;\n\t\t\tconst cellValueStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.cellValue,\n\t\t\t\tstyles.cellTextDark\n\t\t\t);\n\t\t\tconst finalStyle = {\n\t\t\t\t...cellValueStyle,\n\t\t\t\t...valueStyle,\n\t\t\t\t...styleRTL,\n\t\t\t};\n\n\t\t\t// To be able to show the `middle` ellipsizeMode on editable cells\n\t\t\t// we show the TextInput just when the user wants to edit the value,\n\t\t\t// and the Text component to display it.\n\t\t\t// We also show the TextInput to display placeholder.\n\t\t\tconst shouldShowPlaceholder = isInteractive && value === '';\n\t\t\treturn this.state.isEditingValue || shouldShowPlaceholder ? (\n\t\t\t\t<TextInput\n\t\t\t\t\tref={ ( c ) => ( this._valueTextInput = c ) }\n\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\tstyle={ finalStyle }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tplaceholder={ valuePlaceholder }\n\t\t\t\t\tplaceholderTextColor={ '#87a6bc' }\n\t\t\t\t\tonChangeText={ onChangeValue }\n\t\t\t\t\teditable={ isValueEditable }\n\t\t\t\t\tpointerEvents={\n\t\t\t\t\t\tthis.state.isEditingValue ? 'auto' : 'none'\n\t\t\t\t\t}\n\t\t\t\t\tonFocus={ startEditing }\n\t\t\t\t\tonBlur={ finishEditing }\n\t\t\t\t\tonSubmitEditing={ onSubmit }\n\t\t\t\t\tkeyboardType={ this.typeToKeyboardType( type, step ) }\n\t\t\t\t\t{ ...valueProps }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Text\n\t\t\t\t\tstyle={ { ...cellValueStyle, ...valueStyle } }\n\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\tellipsizeMode={ 'middle' }\n\t\t\t\t>\n\t\t\t\t\t{ value }\n\t\t\t\t</Text>\n\t\t\t);\n\t\t};\n\n\t\tconst getAccessibilityLabel = () => {\n\t\t\tif ( accessible === false ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( accessibilityLabel || ! showValue ) {\n\t\t\t\treturn accessibilityLabel || label;\n\t\t\t}\n\n\t\t\tif ( isEmpty( value ) ) {\n\t\t\t\treturn isEmpty( help )\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: accessibility text. Empty state of a inline textinput cell. %s: The cell's title */\n\t\t\t\t\t\t\t_x( '%s. Empty', 'inline textinput cell' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t )\n\t\t\t\t\t: // Separating by ',' is necessary to make a pause on urls (non-capitalized text)\n\t\t\t\t\t sprintf(\n\t\t\t\t\t\t\t/* translators: accessibility text. Empty state of a inline textinput cell. %1: Cell title, %2: cell help. */\n\t\t\t\t\t\t\t_x( '%1$s, %2$s. Empty', 'inline textinput cell' ),\n\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\thelp\n\t\t\t\t\t );\n\t\t\t}\n\t\t\treturn isEmpty( help )\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. Inline textinput title and value.%1: Cell title, %2: cell value. */\n\t\t\t\t\t\t_x( '%1$s, %2$s', 'inline textinput cell' ),\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tvalue\n\t\t\t\t ) // Separating by ',' is necessary to make a pause on urls (non-capitalized text)\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. Inline textinput title, value and help text.%1: Cell title, %2: cell value, , %3: cell help. */\n\t\t\t\t\t\t_x( '%1$s, %2$s, %3$s', 'inline textinput cell' ),\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\thelp\n\t\t\t\t );\n\t\t};\n\n\t\tconst iconStyleBase = getStylesFromColorScheme(\n\t\t\tstyles.icon,\n\t\t\tstyles.iconDark\n\t\t);\n\t\tconst resetButtonStyle = getStylesFromColorScheme(\n\t\t\tstyles.resetButton,\n\t\t\tstyles.resetButtonDark\n\t\t);\n\t\tconst cellHelpStyle = [\n\t\t\tstyles.cellHelpLabel,\n\t\t\tisIOS && styles.cellHelpLabelIOS,\n\t\t];\n\t\tconst containerPointerEvents =\n\t\t\tthis.state.isScreenReaderEnabled && accessible ? 'none' : 'auto';\n\t\tconst { title, handler } = customActionButton || {};\n\n\t\tconst opacity =\n\t\t\tactiveOpacity !== undefined\n\t\t\t\t? activeOpacity\n\t\t\t\t: get( platformStyles, 'activeOpacity.opacity' );\n\n\t\treturn (\n\t\t\t<TouchableRipple\n\t\t\t\taccessible={\n\t\t\t\t\taccessible !== undefined\n\t\t\t\t\t\t? accessible\n\t\t\t\t\t\t: ! this.state.isEditingValue\n\t\t\t\t}\n\t\t\t\taccessibilityLabel={ getAccessibilityLabel() }\n\t\t\t\taccessibilityRole={ accessibilityRole || 'button' }\n\t\t\t\taccessibilityHint={\n\t\t\t\t\tisValueEditable\n\t\t\t\t\t\t? /* translators: accessibility text */\n\t\t\t\t\t\t __( 'Double tap to edit this value' )\n\t\t\t\t\t\t: accessibilityHint\n\t\t\t\t}\n\t\t\t\tdisabled={ disabled || ! isInteractive }\n\t\t\t\tactiveOpacity={ opacity }\n\t\t\t\tonPress={ onCellPress }\n\t\t\t\tonLongPress={ onLongPress }\n\t\t\t\tstyle={ [ styles.clipToBounds, style ] }\n\t\t\t\tborderless={ borderless }\n\t\t\t>\n\t\t\t\t{ drawTopSeparator && <View style={ separatorStyle() } /> }\n\t\t\t\t<View\n\t\t\t\t\tstyle={ cellContainerStyles }\n\t\t\t\t\tpointerEvents={ containerPointerEvents }\n\t\t\t\t>\n\t\t\t\t\t<View style={ rowContainerStyles }>\n\t\t\t\t\t\t<View style={ styles.cellRowContainer }>\n\t\t\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t\tstyles.cellRowContainer,\n\t\t\t\t\t\t\t\t\t\tstyles.cellRowIcon,\n\t\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\t\t\tfill={\n\t\t\t\t\t\t\t\t\t\t\ticonStyle.color ||\n\t\t\t\t\t\t\t\t\t\t\ticonStyleBase.color\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tstyle={ iconStyle }\n\t\t\t\t\t\t\t\t\t\tisPressed={ false }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\t\t\tplatformStyles.labelIconSeparator\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ subLabel && label && (\n\t\t\t\t\t\t\t\t<View>\n\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t\t\tdefaultLabelStyle,\n\t\t\t\t\t\t\t\t\t\t\tlabelStyle,\n\t\t\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t<Text style={ defaultSubLabelStyleText }>\n\t\t\t\t\t\t\t\t\t\t{ subLabel }\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ ! subLabel && label && (\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\tstyle={ [ defaultLabelStyle, labelStyle ] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t\t{ customActionButton && (\n\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\tonPress={ handler }\n\t\t\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Text style={ resetButtonStyle }>\n\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\t\tfill={ platformStyles.isSelected.color }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showValue && getValueComponent() }\n\t\t\t\t\t{ children }\n\t\t\t\t</View>\n\t\t\t\t{ help && (\n\t\t\t\t\t<Text style={ [ cellHelpStyle, styles.placeholderColor ] }>\n\t\t\t\t\t\t{ help }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t\t{ ! drawTopSeparator && <View style={ separatorStyle() } /> }\n\t\t\t</TouchableRipple>\n\t\t);\n\t}\n}\n\nexport default withPreferredColorScheme( BottomSheetCell );\n"]}
|
|
@@ -39,7 +39,8 @@ const BottomSheetTextControl = _ref => {
|
|
|
39
39
|
placeholder,
|
|
40
40
|
label,
|
|
41
41
|
icon,
|
|
42
|
-
footerNote
|
|
42
|
+
footerNote,
|
|
43
|
+
cellPlaceholder
|
|
43
44
|
} = _ref;
|
|
44
45
|
const [showSubSheet, setShowSubSheet] = (0, _element.useState)(false);
|
|
45
46
|
const navigation = (0, _native.useNavigation)();
|
|
@@ -59,10 +60,10 @@ const BottomSheetTextControl = _ref => {
|
|
|
59
60
|
return (0, _element.createElement)(_components.BottomSheet.SubSheet, {
|
|
60
61
|
navigationButton: (0, _element.createElement)(_components.BottomSheet.Cell, {
|
|
61
62
|
icon: icon,
|
|
62
|
-
placeholder: placeholder,
|
|
63
63
|
label: label,
|
|
64
64
|
onPress: openSubSheet,
|
|
65
|
-
value: initialValue || ''
|
|
65
|
+
value: initialValue || '',
|
|
66
|
+
placeholder: cellPlaceholder || placeholder || ''
|
|
66
67
|
}, (0, _element.createElement)(_icons.Icon, {
|
|
67
68
|
icon: _icons.chevronRight
|
|
68
69
|
})),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet-text-control/index.native.js"],"names":["BottomSheetTextControl","initialValue","onChange","placeholder","label","icon","footerNote","showSubSheet","setShowSubSheet","navigation","goBack","openSubSheet","navigate","BottomSheet","SubSheet","screenName","horizontalBorderStyle","styles","horizontalBorder","horizontalBorderDark","textEditorStyle","textEditor","textEditorDark","chevronRight","text","textFooternote"],"mappings":";;;;;;;;;AASA;;AANA;;AACA;;AAMA;;AACA;;AACA;;AASA;;AArBA;AACA;AACA;;AAIA;AACA;AACA;;AAUA;AACA;AACA;AAGA,MAAMA,sBAAsB,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet-text-control/index.native.js"],"names":["BottomSheetTextControl","initialValue","onChange","placeholder","label","icon","footerNote","cellPlaceholder","showSubSheet","setShowSubSheet","navigation","goBack","openSubSheet","navigate","BottomSheet","SubSheet","screenName","horizontalBorderStyle","styles","horizontalBorder","horizontalBorderDark","textEditorStyle","textEditor","textEditorDark","chevronRight","text","textFooternote"],"mappings":";;;;;;;;;AASA;;AANA;;AACA;;AAMA;;AACA;;AACA;;AASA;;AArBA;AACA;AACA;;AAIA;AACA;AACA;;AAUA;AACA;AACA;AAGA,MAAMA,s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IADD,EAEC,4BAAC,uBAAD,CAAa,MAAb,CAAoB,OAApB,QACGP,KADH,CAFD,CADD,EAOC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAGa;AAAnB,KACC,4BAAC,sBAAD;AACC,IAAA,KAAK,EAAGb,KADT;AAEC,IAAA,YAAY,EAAKqB,IAAF,IAAYvB,QAAQ,CAAEuB,IAAF,CAFpC;AAGC,IAAA,YAAY,EAAGxB,YAHhB;AAIC,IAAA,SAAS,EAAG,IAJb;AAKC,IAAA,WAAW,EAAGE,WALf;AAMC,IAAA,oBAAoB,EAAG,SANxB;AAOC,IAAA,KAAK,EAAGkB,eAPT;AAQC,IAAA,iBAAiB,EAAG;AARrB,IADD,CAPD,CAdD,EAmCGf,UAAU,IACX,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAGY,gBAAOQ;AAA1B,KACC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAGpB,UADT;AAEC,IAAA,SAAS,EAAC;AAFX,IADD,CApCF,CADD;AA8CA,CA9ED;;eAgFeN,sB","sourcesContent":["/**\n * External dependencies\n */\nimport { TextInput } from 'react-native';\nimport { useNavigation } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { Icon, chevronRight } from '@wordpress/icons';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport {\n\tBottomSheet,\n\tPanelBody,\n\tFooterMessageControl,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\n\nconst BottomSheetTextControl = ( {\n\tinitialValue,\n\tonChange,\n\tplaceholder,\n\tlabel,\n\ticon,\n\tfooterNote,\n\tcellPlaceholder,\n} ) => {\n\tconst [ showSubSheet, setShowSubSheet ] = useState( false );\n\tconst navigation = useNavigation();\n\n\tconst goBack = () => {\n\t\tsetShowSubSheet( false );\n\t\tnavigation.goBack();\n\t};\n\n\tconst openSubSheet = () => {\n\t\tnavigation.navigate( BottomSheet.SubSheet.screenName );\n\t\tsetShowSubSheet( true );\n\t};\n\n\tconst horizontalBorderStyle = usePreferredColorSchemeStyle(\n\t\tstyles.horizontalBorder,\n\t\tstyles.horizontalBorderDark\n\t);\n\n\tconst textEditorStyle = usePreferredColorSchemeStyle(\n\t\tstyles.textEditor,\n\t\tstyles.textEditorDark\n\t);\n\n\treturn (\n\t\t<BottomSheet.SubSheet\n\t\t\tnavigationButton={\n\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonPress={ openSubSheet }\n\t\t\t\t\tvalue={ initialValue || '' }\n\t\t\t\t\tplaceholder={ cellPlaceholder || placeholder || '' }\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={ chevronRight }></Icon>\n\t\t\t\t</BottomSheet.Cell>\n\t\t\t}\n\t\t\tshowSheet={ showSubSheet }\n\t\t>\n\t\t\t<>\n\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t<BottomSheet.NavBar.BackButton onPress={ goBack } />\n\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t<PanelBody style={ horizontalBorderStyle }>\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tonChangeText={ ( text ) => onChange( text ) }\n\t\t\t\t\t\tdefaultValue={ initialValue }\n\t\t\t\t\t\tmultiline={ true }\n\t\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\t\tplaceholderTextColor={ '#87a6bc' }\n\t\t\t\t\t\tstyle={ textEditorStyle }\n\t\t\t\t\t\ttextAlignVertical={ 'top' }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</>\n\n\t\t\t{ footerNote && (\n\t\t\t\t<PanelBody style={ styles.textFooternote }>\n\t\t\t\t\t<FooterMessageControl\n\t\t\t\t\t\tlabel={ footerNote }\n\t\t\t\t\t\ttextAlign=\"left\"\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t) }\n\t\t</BottomSheet.SubSheet>\n\t);\n};\n\nexport default BottomSheetTextControl;\n"]}
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = void 0;
|
|
8
|
+
exports.default = exports.NavigationBackButton = void 0;
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
@@ -30,7 +30,7 @@ var _navigationStyles = require("../styles/navigation-styles");
|
|
|
30
30
|
/**
|
|
31
31
|
* Internal dependencies
|
|
32
32
|
*/
|
|
33
|
-
function
|
|
33
|
+
function UnforwardedNavigationBackButton(_ref, ref) {
|
|
34
34
|
var _navigationTree$getMe;
|
|
35
35
|
|
|
36
36
|
let {
|
|
@@ -45,7 +45,7 @@ function NavigationBackButton(_ref, ref) {
|
|
|
45
45
|
navigationTree
|
|
46
46
|
} = (0, _context.useNavigationContext)();
|
|
47
47
|
const classes = (0, _classnames.default)('components-navigation__back-button', className);
|
|
48
|
-
const parentMenuTitle = (_navigationTree$getMe = navigationTree.getMenu(parentMenu)) === null || _navigationTree$getMe === void 0 ? void 0 : _navigationTree$getMe.title;
|
|
48
|
+
const parentMenuTitle = parentMenu !== undefined ? (_navigationTree$getMe = navigationTree.getMenu(parentMenu)) === null || _navigationTree$getMe === void 0 ? void 0 : _navigationTree$getMe.title : undefined;
|
|
49
49
|
|
|
50
50
|
const handleOnClick = event => {
|
|
51
51
|
if (typeof onClick === 'function') {
|
|
@@ -71,7 +71,8 @@ function NavigationBackButton(_ref, ref) {
|
|
|
71
71
|
}), backButtonLabel || parentMenuTitle || (0, _i18n.__)('Back'));
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
const NavigationBackButton = (0, _element.forwardRef)(UnforwardedNavigationBackButton);
|
|
75
|
+
exports.NavigationBackButton = NavigationBackButton;
|
|
76
|
+
var _default = NavigationBackButton;
|
|
76
77
|
exports.default = _default;
|
|
77
78
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigation/back-button/index.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigation/back-button/index.tsx"],"names":["UnforwardedNavigationBackButton","ref","backButtonLabel","className","href","onClick","parentMenu","setActiveMenu","navigationTree","classes","parentMenuTitle","undefined","getMenu","title","handleOnClick","event","animationDirection","defaultPrevented","icon","chevronRight","chevronLeft","NavigationBackButton"],"mappings":";;;;;;;;;AAOA;;AAJA;;AAKA;;AACA;;AAKA;;AACA;;AAfA;AACA;AACA;;AAEA;AACA;AACA;;AAKA;AACA;AACA;AAMA,SAASA,+BAAT,OAQCC,GARD,EASE;AAAA;;AAAA,MARD;AACCC,IAAAA,eADD;AAECC,IAAAA,SAFD;AAGCC,IAAAA,IAHD;AAICC,IAAAA,OAJD;AAKCC,IAAAA;AALD,GAQC;AACD,QAAM;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MAAoC,oCAA1C;AAEA,QAAMC,OAAO,GAAG,yBACf,oCADe,EAEfN,SAFe,CAAhB;AAKA,QAAMO,eAAe,GACpBJ,UAAU,KAAKK,SAAf,4BACGH,cAAc,CAACI,OAAf,CAAwBN,UAAxB,CADH,0DACG,sBAAsCO,KADzC,GAEGF,SAHJ;;AAKA,QAAMG,aAAqD,GAAKC,KAAF,IAAa;AAC1E,QAAK,OAAOV,OAAP,KAAmB,UAAxB,EAAqC;AACpCA,MAAAA,OAAO,CAAEU,KAAF,CAAP;AACA;;AAED,UAAMC,kBAAkB,GAAG,qBAAU,MAAV,GAAmB,OAA9C;;AACA,QAAKV,UAAU,IAAI,CAAES,KAAK,CAACE,gBAA3B,EAA8C;AAC7CV,MAAAA,aAAa,CAAED,UAAF,EAAcU,kBAAd,CAAb;AACA;AACD,GATD;;AAUA,QAAME,IAAI,GAAG,qBAAUC,mBAAV,GAAyBC,kBAAtC;AACA,SACC,4BAAC,kCAAD;AACC,IAAA,SAAS,EAAGX,OADb;AAEC,IAAA,IAAI,EAAGL,IAFR;AAGC,IAAA,OAAO,EAAC,UAHT;AAIC,IAAA,GAAG,EAAGH,GAJP;AAKC,IAAA,OAAO,EAAGa;AALX,KAOC,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGI;AAAb,IAPD,EAQGhB,eAAe,IAAIQ,eAAnB,IAAsC,cAAI,MAAJ,CARzC,CADD;AAYA;;AAEM,MAAMW,oBAAoB,GAAG,yBACnCrB,+BADmC,CAA7B;;eAIQqB,oB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Icon, chevronLeft, chevronRight } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useNavigationContext } from '../context';\nimport { MenuBackButtonUI } from '../styles/navigation-styles';\n\nimport type { NavigationBackButtonProps } from '../types';\n\nfunction UnforwardedNavigationBackButton(\n\t{\n\t\tbackButtonLabel,\n\t\tclassName,\n\t\thref,\n\t\tonClick,\n\t\tparentMenu,\n\t}: NavigationBackButtonProps,\n\tref: React.ForwardedRef< HTMLAnchorElement | HTMLButtonElement >\n) {\n\tconst { setActiveMenu, navigationTree } = useNavigationContext();\n\n\tconst classes = classnames(\n\t\t'components-navigation__back-button',\n\t\tclassName\n\t);\n\n\tconst parentMenuTitle =\n\t\tparentMenu !== undefined\n\t\t\t? navigationTree.getMenu( parentMenu )?.title\n\t\t\t: undefined;\n\n\tconst handleOnClick: React.MouseEventHandler< HTMLElement > = ( event ) => {\n\t\tif ( typeof onClick === 'function' ) {\n\t\t\tonClick( event );\n\t\t}\n\n\t\tconst animationDirection = isRTL() ? 'left' : 'right';\n\t\tif ( parentMenu && ! event.defaultPrevented ) {\n\t\t\tsetActiveMenu( parentMenu, animationDirection );\n\t\t}\n\t};\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\treturn (\n\t\t<MenuBackButtonUI\n\t\t\tclassName={ classes }\n\t\t\thref={ href }\n\t\t\tvariant=\"tertiary\"\n\t\t\tref={ ref }\n\t\t\tonClick={ handleOnClick }\n\t\t>\n\t\t\t<Icon icon={ icon } />\n\t\t\t{ backButtonLabel || parentMenuTitle || __( 'Back' ) }\n\t\t</MenuBackButtonUI>\n\t);\n}\n\nexport const NavigationBackButton = forwardRef(\n\tUnforwardedNavigationBackButton\n);\n\nexport default NavigationBackButton;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigation/constants.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigation/constants.tsx"],"names":["ROOT_MENU","SEARCH_FOCUS_DELAY"],"mappings":";;;;;;AAAO,MAAMA,SAAS,GAAG,MAAlB;;AACA,MAAMC,kBAAkB,GAAG,GAA3B","sourcesContent":["export const ROOT_MENU = 'root';\nexport const SEARCH_FOCUS_DELAY = 100;\n"]}
|
|
@@ -18,23 +18,26 @@ var _constants = require("./constants");
|
|
|
18
18
|
*/
|
|
19
19
|
const noop = () => {};
|
|
20
20
|
|
|
21
|
+
const defaultIsEmpty = () => false;
|
|
22
|
+
|
|
23
|
+
const defaultGetter = () => undefined;
|
|
24
|
+
|
|
21
25
|
const NavigationContext = (0, _element.createContext)({
|
|
22
26
|
activeItem: undefined,
|
|
23
27
|
activeMenu: _constants.ROOT_MENU,
|
|
24
28
|
setActiveMenu: noop,
|
|
25
|
-
isMenuEmpty: noop,
|
|
26
29
|
navigationTree: {
|
|
27
30
|
items: {},
|
|
28
|
-
getItem:
|
|
31
|
+
getItem: defaultGetter,
|
|
29
32
|
addItem: noop,
|
|
30
33
|
removeItem: noop,
|
|
31
34
|
menus: {},
|
|
32
|
-
getMenu:
|
|
35
|
+
getMenu: defaultGetter,
|
|
33
36
|
addMenu: noop,
|
|
34
37
|
removeMenu: noop,
|
|
35
38
|
childMenu: {},
|
|
36
39
|
traverseMenu: noop,
|
|
37
|
-
isMenuEmpty:
|
|
40
|
+
isMenuEmpty: defaultIsEmpty
|
|
38
41
|
}
|
|
39
42
|
});
|
|
40
43
|
exports.NavigationContext = NavigationContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigation/context.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigation/context.tsx"],"names":["noop","defaultIsEmpty","defaultGetter","undefined","NavigationContext","activeItem","activeMenu","ROOT_MENU","setActiveMenu","navigationTree","items","getItem","addItem","removeItem","menus","getMenu","addMenu","removeMenu","childMenu","traverseMenu","isMenuEmpty","useNavigationContext"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAKA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AACA,MAAMC,cAAc,GAAG,MAAM,KAA7B;;AACA,MAAMC,aAAa,GAAG,MAAMC,SAA5B;;AAEO,MAAMC,iBAAiB,GAAG,4BAAwC;AACxEC,EAAAA,UAAU,EAAEF,SAD4D;AAExEG,EAAAA,UAAU,EAAEC,oBAF4D;AAGxEC,EAAAA,aAAa,EAAER,IAHyD;AAKxES,EAAAA,cAAc,EAAE;AACfC,IAAAA,KAAK,EAAE,EADQ;AAEfC,IAAAA,OAAO,EAAET,aAFM;AAGfU,IAAAA,OAAO,EAAEZ,IAHM;AAIfa,IAAAA,UAAU,EAAEb,IAJG;AAMfc,IAAAA,KAAK,EAAE,EANQ;AAOfC,IAAAA,OAAO,EAAEb,aAPM;AAQfc,IAAAA,OAAO,EAAEhB,IARM;AASfiB,IAAAA,UAAU,EAAEjB,IATG;AAUfkB,IAAAA,SAAS,EAAE,EAVI;AAWfC,IAAAA,YAAY,EAAEnB,IAXC;AAYfoB,IAAAA,WAAW,EAAEnB;AAZE;AALwD,CAAxC,CAA1B;;;AAoBA,MAAMoB,oBAAoB,GAAG,MAAM,yBAAYjB,iBAAZ,CAAnC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ROOT_MENU } from './constants';\n\nimport type { NavigationContext as NavigationContextType } from './types';\n\nconst noop = () => {};\nconst defaultIsEmpty = () => false;\nconst defaultGetter = () => undefined;\n\nexport const NavigationContext = createContext< NavigationContextType >( {\n\tactiveItem: undefined,\n\tactiveMenu: ROOT_MENU,\n\tsetActiveMenu: noop,\n\n\tnavigationTree: {\n\t\titems: {},\n\t\tgetItem: defaultGetter,\n\t\taddItem: noop,\n\t\tremoveItem: noop,\n\n\t\tmenus: {},\n\t\tgetMenu: defaultGetter,\n\t\taddMenu: noop,\n\t\tremoveMenu: noop,\n\t\tchildMenu: {},\n\t\ttraverseMenu: noop,\n\t\tisMenuEmpty: defaultIsEmpty,\n\t},\n} );\nexport const useNavigationContext = () => useContext( NavigationContext );\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigation/group/context.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigation/group/context.tsx"],"names":["NavigationGroupContext","group","undefined","useNavigationGroupContext"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAQO,MAAMA,sBAAsB,GAClC,4BAA6C;AAAEC,EAAAA,KAAK,EAAEC;AAAT,CAA7C,CADM;;;AAGA,MAAMC,yBAAyB,GAAG,MACxC,yBAAYH,sBAAZ,CADM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { NavigationGroupContext as NavigationGroupContextType } from '../types';\n\nexport const NavigationGroupContext =\n\tcreateContext< NavigationGroupContextType >( { group: undefined } );\n\nexport const useNavigationGroupContext = () =>\n\tuseContext( NavigationGroupContext );\n"]}
|
|
@@ -5,7 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.NavigationGroup = NavigationGroup;
|
|
9
|
+
exports.default = void 0;
|
|
9
10
|
|
|
10
11
|
var _element = require("@wordpress/element");
|
|
11
12
|
|
|
@@ -67,4 +68,7 @@ function NavigationGroup(_ref) {
|
|
|
67
68
|
role: "group"
|
|
68
69
|
}, children)));
|
|
69
70
|
}
|
|
71
|
+
|
|
72
|
+
var _default = NavigationGroup;
|
|
73
|
+
exports.default = _default;
|
|
70
74
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigation/group/index.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigation/group/index.tsx"],"names":["uniqueId","NavigationGroup","children","className","title","groupId","navigationTree","items","context","group","Object","values","some","item","_isVisible","groupTitleId","classes"],"mappings":";;;;;;;;;;AAQA;;AALA;;AAUA;;AACA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAOA,IAAIA,QAAQ,GAAG,CAAf;;AAEO,SAASC,eAAT,OAImB;AAAA,MAJO;AAChCC,IAAAA,QADgC;AAEhCC,IAAAA,SAFgC;AAGhCC,IAAAA;AAHgC,GAIP;AACzB,QAAM,CAAEC,OAAF,IAAc,uBAAW,SAAS,EAAEL,QAAU,EAAhC,CAApB;AACA,QAAM;AACLM,IAAAA,cAAc,EAAE;AAAEC,MAAAA;AAAF;AADX,MAEF,qCAFJ;AAIA,QAAMC,OAAO,GAAG;AAAEC,IAAAA,KAAK,EAAEJ;AAAT,GAAhB,CANyB,CAQzB;;AACA,MACC,CAAEK,MAAM,CAACC,MAAP,CAAeJ,KAAf,EAAuBK,IAAvB,CACCC,IAAF,IAAYA,IAAI,CAACJ,KAAL,KAAeJ,OAAf,IAA0BQ,IAAI,CAACC,UAD1C,CADH,EAIE;AACD,WACC,4BAAC,+BAAD,CAAwB,QAAxB;AAAiC,MAAA,KAAK,EAAGN;AAAzC,OACGN,QADH,CADD;AAKA;;AAED,QAAMa,YAAY,GAAI,sCAAsCV,OAAS,EAArE;AACA,QAAMW,OAAO,GAAG,yBAAY,8BAAZ,EAA4Cb,SAA5C,CAAhB;AAEA,SACC,4BAAC,+BAAD,CAAwB,QAAxB;AAAiC,IAAA,KAAK,EAAGK;AAAzC,KACC;AAAI,IAAA,SAAS,EAAGQ;AAAhB,KACGZ,KAAK,IACN,4BAAC,8BAAD;AACC,IAAA,SAAS,EAAC,oCADX;AAEC,IAAA,EAAE,EAAGW,YAFN;AAGC,IAAA,KAAK,EAAG;AAHT,KAKGX,KALH,CAFF,EAUC;AAAI,uBAAkBW,YAAtB;AAAqC,IAAA,IAAI,EAAC;AAA1C,KACGb,QADH,CAVD,CADD,CADD;AAkBA;;eAEcD,e","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { NavigationGroupContext } from './context';\nimport { GroupTitleUI } from '../styles/navigation-styles';\nimport { useNavigationContext } from '../context';\n\nimport type { NavigationGroupProps } from '../types';\n\nlet uniqueId = 0;\n\nexport function NavigationGroup( {\n\tchildren,\n\tclassName,\n\ttitle,\n}: NavigationGroupProps ) {\n\tconst [ groupId ] = useState( `group-${ ++uniqueId }` );\n\tconst {\n\t\tnavigationTree: { items },\n\t} = useNavigationContext();\n\n\tconst context = { group: groupId };\n\n\t// Keep the children rendered to make sure invisible items are included in the navigation tree.\n\tif (\n\t\t! Object.values( items ).some(\n\t\t\t( item ) => item.group === groupId && item._isVisible\n\t\t)\n\t) {\n\t\treturn (\n\t\t\t<NavigationGroupContext.Provider value={ context }>\n\t\t\t\t{ children }\n\t\t\t</NavigationGroupContext.Provider>\n\t\t);\n\t}\n\n\tconst groupTitleId = `components-navigation__group-title-${ groupId }`;\n\tconst classes = classnames( 'components-navigation__group', className );\n\n\treturn (\n\t\t<NavigationGroupContext.Provider value={ context }>\n\t\t\t<li className={ classes }>\n\t\t\t\t{ title && (\n\t\t\t\t\t<GroupTitleUI\n\t\t\t\t\t\tclassName=\"components-navigation__group-title\"\n\t\t\t\t\t\tid={ groupTitleId }\n\t\t\t\t\t\tlevel={ 3 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</GroupTitleUI>\n\t\t\t\t) }\n\t\t\t\t<ul aria-labelledby={ groupTitleId } role=\"group\">\n\t\t\t\t\t{ children }\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t</NavigationGroupContext.Provider>\n\t);\n}\n\nexport default NavigationGroup;\n"]}
|
|
@@ -5,7 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.Navigation = Navigation;
|
|
9
|
+
exports.default = void 0;
|
|
9
10
|
|
|
10
11
|
var _element = require("@wordpress/element");
|
|
11
12
|
|
|
@@ -35,6 +36,48 @@ var _useCreateNavigationTree = require("./use-create-navigation-tree");
|
|
|
35
36
|
* Internal dependencies
|
|
36
37
|
*/
|
|
37
38
|
const noop = () => {};
|
|
39
|
+
/**
|
|
40
|
+
* Render a navigation list with optional groupings and hierarchy.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```jsx
|
|
44
|
+
* import {
|
|
45
|
+
* __experimentalNavigation as Navigation,
|
|
46
|
+
* __experimentalNavigationGroup as NavigationGroup,
|
|
47
|
+
* __experimentalNavigationItem as NavigationItem,
|
|
48
|
+
* __experimentalNavigationMenu as NavigationMenu,
|
|
49
|
+
* } from '@wordpress/components';
|
|
50
|
+
*
|
|
51
|
+
* const MyNavigation = () => (
|
|
52
|
+
* <Navigation>
|
|
53
|
+
* <NavigationMenu title="Home">
|
|
54
|
+
* <NavigationGroup title="Group 1">
|
|
55
|
+
* <NavigationItem item="item-1" title="Item 1" />
|
|
56
|
+
* <NavigationItem item="item-2" title="Item 2" />
|
|
57
|
+
* </NavigationGroup>
|
|
58
|
+
* <NavigationGroup title="Group 2">
|
|
59
|
+
* <NavigationItem
|
|
60
|
+
* item="item-3"
|
|
61
|
+
* navigateToMenu="category"
|
|
62
|
+
* title="Category"
|
|
63
|
+
* />
|
|
64
|
+
* </NavigationGroup>
|
|
65
|
+
* </NavigationMenu>
|
|
66
|
+
*
|
|
67
|
+
* <NavigationMenu
|
|
68
|
+
* backButtonLabel="Home"
|
|
69
|
+
* menu="category"
|
|
70
|
+
* parentMenu="root"
|
|
71
|
+
* title="Category"
|
|
72
|
+
* >
|
|
73
|
+
* <NavigationItem badge="1" item="child-1" title="Child 1" />
|
|
74
|
+
* <NavigationItem item="child-2" title="Child 2" />
|
|
75
|
+
* </NavigationMenu>
|
|
76
|
+
* </Navigation>
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
|
|
38
81
|
|
|
39
82
|
function Navigation(_ref) {
|
|
40
83
|
let {
|
|
@@ -91,11 +134,14 @@ function Navigation(_ref) {
|
|
|
91
134
|
className: classes
|
|
92
135
|
}, (0, _element.createElement)("div", {
|
|
93
136
|
key: menu,
|
|
94
|
-
className: (0, _classnames.default)({
|
|
137
|
+
className: animateClassName ? (0, _classnames.default)({
|
|
95
138
|
[animateClassName]: isMounted.current && slideOrigin
|
|
96
|
-
})
|
|
139
|
+
}) : undefined
|
|
97
140
|
}, (0, _element.createElement)(_context.NavigationContext.Provider, {
|
|
98
141
|
value: context
|
|
99
142
|
}, children)));
|
|
100
143
|
}
|
|
144
|
+
|
|
145
|
+
var _default = Navigation;
|
|
146
|
+
exports.default = _default;
|
|
101
147
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigation/index.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigation/index.tsx"],"names":["noop","Navigation","activeItem","activeMenu","ROOT_MENU","children","className","onActivateMenu","menu","setMenu","slideOrigin","setSlideOrigin","navigationTree","defaultSlideOrigin","setActiveMenu","menuId","slideInOrigin","getMenu","isMounted","current","context","classes","animateClassName","type","origin","undefined"],"mappings":";;;;;;;;;;AAQA;;AALA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAYA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,UAAT,OAMc;AAAA,MANO;AAC3BC,IAAAA,UAD2B;AAE3BC,IAAAA,UAAU,GAAGC,oBAFc;AAG3BC,IAAAA,QAH2B;AAI3BC,IAAAA,SAJ2B;AAK3BC,IAAAA,cAAc,GAAGP;AALU,GAMP;AACpB,QAAM,CAAEQ,IAAF,EAAQC,OAAR,IAAoB,uBAAUN,UAAV,CAA1B;AACA,QAAM,CAAEO,WAAF,EAAeC,cAAf,IAAkC,wBAAxC;AACA,QAAMC,cAAc,GAAG,uDAAvB;AACA,QAAMC,kBAAkB,GAAG,qBAAU,OAAV,GAAoB,MAA/C;;AAEA,QAAMC,aAAuD,GAAG,UAC/DC,MAD+D,EAG3D;AAAA,QADJC,aACI,uEADYH,kBACZ;;AACJ,QAAK,CAAED,cAAc,CAACK,OAAf,CAAwBF,MAAxB,CAAP,EAA0C;AACzC;AACA;;AAEDJ,IAAAA,cAAc,CAAEK,aAAF,CAAd;AACAP,IAAAA,OAAO,CAAEM,MAAF,CAAP;AACAR,IAAAA,cAAc,CAAEQ,MAAF,CAAd;AACA,GAXD,CANoB,CAmBpB;;;AACA,QAAMG,SAAS,GAAG,qBAAQ,KAAR,CAAlB;AACA,0BAAW,MAAM;AAChB,QAAK,CAAEA,SAAS,CAACC,OAAjB,EAA2B;AAC1BD,MAAAA,SAAS,CAACC,OAAV,GAAoB,IAApB;AACA;AACD,GAJD,EAIG,EAJH;AAMA,0BAAW,MAAM;AAChB,QAAKhB,UAAU,KAAKK,IAApB,EAA2B;AAC1BM,MAAAA,aAAa,CAAEX,UAAF,CAAb;AACA,KAHe,CAIhB;AACA;AACA;;AACA,GAPD,EAOG,CAAEA,UAAF,CAPH;AASA,QAAMiB,OAAO,GAAG;AACflB,IAAAA,UADe;AAEfC,IAAAA,UAAU,EAAEK,IAFG;AAGfM,IAAAA,aAHe;AAIfF,IAAAA;AAJe,GAAhB;AAOA,QAAMS,OAAO,GAAG,yBAAY,uBAAZ,EAAqCf,SAArC,CAAhB;AACA,QAAMgB,gBAAgB,GAAG,kCAAqB;AAC7CC,IAAAA,IAAI,EAAE,UADuC;AAE7CC,IAAAA,MAAM,EAAEd;AAFqC,GAArB,CAAzB;AAKA,SACC,4BAAC,8BAAD;AAAc,IAAA,SAAS,EAAGW;AAA1B,KACC;AACC,IAAA,GAAG,EAAGb,IADP;AAEC,IAAA,SAAS,EACRc,gBAAgB,GACb,yBAAY;AACZ,OAAEA,gBAAF,GACCJ,SAAS,CAACC,OAAV,IAAqBT;AAFV,KAAZ,CADa,GAKbe;AARL,KAWC,4BAAC,0BAAD,CAAmB,QAAnB;AAA4B,IAAA,KAAK,EAAGL;AAApC,KACGf,QADH,CAXD,CADD,CADD;AAmBA;;eAEcJ,U","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getAnimateClassName } from '../animate';\nimport { ROOT_MENU } from './constants';\nimport { NavigationContext } from './context';\nimport { NavigationUI } from './styles/navigation-styles';\nimport { useCreateNavigationTree } from './use-create-navigation-tree';\n\nimport type {\n\tNavigationProps,\n\tNavigationContext as NavigationContextType,\n} from './types';\n\nconst noop = () => {};\n\n/**\n * Render a navigation list with optional groupings and hierarchy.\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigation as Navigation,\n * __experimentalNavigationGroup as NavigationGroup,\n * __experimentalNavigationItem as NavigationItem,\n * __experimentalNavigationMenu as NavigationMenu,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <Navigation>\n * <NavigationMenu title=\"Home\">\n * <NavigationGroup title=\"Group 1\">\n * <NavigationItem item=\"item-1\" title=\"Item 1\" />\n * <NavigationItem item=\"item-2\" title=\"Item 2\" />\n * </NavigationGroup>\n * <NavigationGroup title=\"Group 2\">\n * <NavigationItem\n * item=\"item-3\"\n * navigateToMenu=\"category\"\n * title=\"Category\"\n * />\n * </NavigationGroup>\n * </NavigationMenu>\n *\n * <NavigationMenu\n * backButtonLabel=\"Home\"\n * menu=\"category\"\n * parentMenu=\"root\"\n * title=\"Category\"\n * >\n * <NavigationItem badge=\"1\" item=\"child-1\" title=\"Child 1\" />\n * <NavigationItem item=\"child-2\" title=\"Child 2\" />\n * </NavigationMenu>\n * </Navigation>\n * );\n * ```\n */\nexport function Navigation( {\n\tactiveItem,\n\tactiveMenu = ROOT_MENU,\n\tchildren,\n\tclassName,\n\tonActivateMenu = noop,\n}: NavigationProps ) {\n\tconst [ menu, setMenu ] = useState( activeMenu );\n\tconst [ slideOrigin, setSlideOrigin ] = useState< 'left' | 'right' >();\n\tconst navigationTree = useCreateNavigationTree();\n\tconst defaultSlideOrigin = isRTL() ? 'right' : 'left';\n\n\tconst setActiveMenu: NavigationContextType[ 'setActiveMenu' ] = (\n\t\tmenuId,\n\t\tslideInOrigin = defaultSlideOrigin\n\t) => {\n\t\tif ( ! navigationTree.getMenu( menuId ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetSlideOrigin( slideInOrigin );\n\t\tsetMenu( menuId );\n\t\tonActivateMenu( menuId );\n\t};\n\n\t// Used to prevent the sliding animation on mount\n\tconst isMounted = useRef( false );\n\tuseEffect( () => {\n\t\tif ( ! isMounted.current ) {\n\t\t\tisMounted.current = true;\n\t\t}\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( activeMenu !== menu ) {\n\t\t\tsetActiveMenu( activeMenu );\n\t\t}\n\t\t// Ignore exhaustive-deps here, as it would require either a larger refactor or some questionable workarounds.\n\t\t// See https://github.com/WordPress/gutenberg/pull/41612 for context.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ activeMenu ] );\n\n\tconst context = {\n\t\tactiveItem,\n\t\tactiveMenu: menu,\n\t\tsetActiveMenu,\n\t\tnavigationTree,\n\t};\n\n\tconst classes = classnames( 'components-navigation', className );\n\tconst animateClassName = getAnimateClassName( {\n\t\ttype: 'slide-in',\n\t\torigin: slideOrigin,\n\t} );\n\n\treturn (\n\t\t<NavigationUI className={ classes }>\n\t\t\t<div\n\t\t\t\tkey={ menu }\n\t\t\t\tclassName={\n\t\t\t\t\tanimateClassName\n\t\t\t\t\t\t? classnames( {\n\t\t\t\t\t\t\t\t[ animateClassName ]:\n\t\t\t\t\t\t\t\t\tisMounted.current && slideOrigin,\n\t\t\t\t\t\t } )\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<NavigationContext.Provider value={ context }>\n\t\t\t\t\t{ children }\n\t\t\t\t</NavigationContext.Provider>\n\t\t\t</div>\n\t\t</NavigationUI>\n\t);\n}\n\nexport default Navigation;\n"]}
|
|
@@ -19,7 +19,6 @@ function NavigationItemBaseContent(props) {
|
|
|
19
19
|
} = props;
|
|
20
20
|
return (0, _element.createElement)(_element.Fragment, null, title && (0, _element.createElement)(_navigationStyles.ItemTitleUI, {
|
|
21
21
|
className: "components-navigation__item-title",
|
|
22
|
-
variant: "body.small",
|
|
23
22
|
as: "span"
|
|
24
23
|
}, title), badge && (0, _element.createElement)(_navigationStyles.ItemBadgeUI, {
|
|
25
24
|
className: "components-navigation__item-badge"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigation/item/base-content.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigation/item/base-content.tsx"],"names":["NavigationItemBaseContent","props","badge","title"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAKe,SAASA,yBAAT,CACdC,KADc,EAEb;AACD,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAmBF,KAAzB;AAEA,SACC,qDACGE,KAAK,IACN,4BAAC,6BAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,EAAE,EAAC;AAFJ,KAIGA,KAJH,CAFF,EAUGD,KAAK,IACN,4BAAC,6BAAD;AAAa,IAAA,SAAS,EAAC;AAAvB,KACGA,KADH,CAXF,CADD;AAkBA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { ItemBadgeUI, ItemTitleUI } from '../styles/navigation-styles';\n\nimport type { NavigationItemBaseContentProps } from '../types';\n\nexport default function NavigationItemBaseContent(\n\tprops: NavigationItemBaseContentProps\n) {\n\tconst { badge, title } = props;\n\n\treturn (\n\t\t<>\n\t\t\t{ title && (\n\t\t\t\t<ItemTitleUI\n\t\t\t\t\tclassName=\"components-navigation__item-title\"\n\t\t\t\t\tas=\"span\"\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</ItemTitleUI>\n\t\t\t) }\n\n\t\t\t{ badge && (\n\t\t\t\t<ItemBadgeUI className=\"components-navigation__item-badge\">\n\t\t\t\t\t{ badge }\n\t\t\t\t</ItemBadgeUI>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigation/item/base.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigation/item/base.tsx"],"names":["uniqueId","NavigationItemBase","props","children","className","title","href","restProps","itemId","navigationTree","getItem","_isVisible","classes"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAUA;;AACA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAOA,IAAIA,QAAQ,GAAG,CAAf;;AAEe,SAASC,kBAAT,CAA6BC,KAA7B,EAA8D;AAAA;;AAC5E;AACA,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA,KAAvB;AAA8BC,IAAAA,IAA9B;AAAoC,OAAGC;AAAvC,MAAqDL,KAA3D;AAEA,QAAM,CAAEM,MAAF,IAAa,uBAAW,QAAQ,EAAER,QAAU,EAA/B,CAAnB;AAEA,oDAAuBQ,MAAvB,EAA+BN,KAA/B;AACA,QAAM;AAAEO,IAAAA;AAAF,MAAqB,oCAA3B;;AAEA,MAAK,2BAAEA,cAAc,CAACC,OAAf,CAAwBF,MAAxB,CAAF,kDAAE,sBAAkCG,UAApC,CAAL,EAAsD;AACrD,WAAO,IAAP;AACA;;AAED,QAAMC,OAAO,GAAG,yBAAY,6BAAZ,EAA2CR,SAA3C,CAAhB;AAEA,SACC,4BAAC,4BAAD;AAAY,IAAA,SAAS,EAAGQ;AAAxB,KAAuCL,SAAvC,GACGJ,QADH,CADD;AAKA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useNavigationContext } from '../context';\nimport { useNavigationTreeItem } from './use-navigation-tree-item';\nimport { ItemBaseUI } from '../styles/navigation-styles';\n\nimport type { NavigationItemBaseProps } from '../types';\n\nlet uniqueId = 0;\n\nexport default function NavigationItemBase( props: NavigationItemBaseProps ) {\n\t// Also avoid to pass the `title` and `href` props to the ItemBaseUI styled component.\n\tconst { children, className, title, href, ...restProps } = props;\n\n\tconst [ itemId ] = useState( `item-${ ++uniqueId }` );\n\n\tuseNavigationTreeItem( itemId, props );\n\tconst { navigationTree } = useNavigationContext();\n\n\tif ( ! navigationTree.getItem( itemId )?._isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst classes = classnames( 'components-navigation__item', className );\n\n\treturn (\n\t\t<ItemBaseUI className={ classes } { ...restProps }>\n\t\t\t{ children }\n\t\t</ItemBaseUI>\n\t);\n}\n"]}
|
|
@@ -5,7 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.NavigationItem = NavigationItem;
|
|
9
|
+
exports.default = void 0;
|
|
9
10
|
|
|
10
11
|
var _element = require("@wordpress/element");
|
|
11
12
|
|
|
@@ -104,4 +105,7 @@ function NavigationItem(props) {
|
|
|
104
105
|
icon: navigationIcon
|
|
105
106
|
})));
|
|
106
107
|
}
|
|
108
|
+
|
|
109
|
+
var _default = NavigationItem;
|
|
110
|
+
exports.default = _default;
|
|
107
111
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigation/item/index.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigation/item/index.tsx"],"names":["noop","NavigationItem","props","badge","children","className","href","item","navigateToMenu","onClick","title","icon","hideIfTargetMenuEmpty","isText","restProps","activeItem","setActiveMenu","navigationTree","isMenuEmpty","isActive","classes","onItemClick","event","navigationIcon","chevronLeft","chevronRight","baseProps","undefined","itemProps","as","Button"],"mappings":";;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AASA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;A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AALH,GAFH;AAUA,SACC,4BAAC,aAAD,6BAAyBY,SAAzB;AAAqC,IAAA,SAAS,EAAGN;AAAjD,MACGhB,QAAQ,IACT,4BAAC,wBAAD,EAAawB,SAAb,EACGjB,IAAI,IACL,4BAAC,4BAAD,QACC,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGA;AAAb,IADD,CAFF,EAOC,4BAAC,oBAAD;AACC,IAAA,KAAK,EAAGD,KADT;AAEC,IAAA,KAAK,EAAGP;AAFT,IAPD,EAYGK,cAAc,IAAI,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGe;AAAb,IAZrB,CAFF,CADD;AAoBA;;eAEctB,c","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Icon, chevronLeft, chevronRight } from '@wordpress/icons';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport { useNavigationContext } from '../context';\nimport { ItemUI, ItemIconUI } from '../styles/navigation-styles';\nimport NavigationItemBaseContent from './base-content';\nimport NavigationItemBase from './base';\n\nimport type { NavigationItemProps } from '../types';\n\nconst noop = () => {};\n\nexport function NavigationItem( props: NavigationItemProps ) {\n\tconst {\n\t\tbadge,\n\t\tchildren,\n\t\tclassName,\n\t\thref,\n\t\titem,\n\t\tnavigateToMenu,\n\t\tonClick = noop,\n\t\ttitle,\n\t\ticon,\n\t\thideIfTargetMenuEmpty,\n\t\tisText,\n\t\t...restProps\n\t} = props;\n\n\tconst {\n\t\tactiveItem,\n\t\tsetActiveMenu,\n\t\tnavigationTree: { isMenuEmpty },\n\t} = useNavigationContext();\n\n\t// If hideIfTargetMenuEmpty prop is true\n\t// And the menu we are supposed to navigate to\n\t// Is marked as empty, then we skip rendering the item.\n\tif (\n\t\thideIfTargetMenuEmpty &&\n\t\tnavigateToMenu &&\n\t\tisMenuEmpty( navigateToMenu )\n\t) {\n\t\treturn null;\n\t}\n\n\tconst isActive = item && activeItem === item;\n\n\tconst classes = classnames( className, {\n\t\t'is-active': isActive,\n\t} );\n\n\tconst onItemClick: React.MouseEventHandler<\n\t\tHTMLButtonElement | HTMLAnchorElement\n\t> = ( event ) => {\n\t\tif ( navigateToMenu ) {\n\t\t\tsetActiveMenu( navigateToMenu );\n\t\t}\n\n\t\tonClick( event );\n\t};\n\tconst navigationIcon = isRTL() ? chevronLeft : chevronRight;\n\tconst baseProps = children ? props : { ...props, onClick: undefined };\n\tconst itemProps = isText\n\t\t? restProps\n\t\t: {\n\t\t\t\tas: Button,\n\t\t\t\thref,\n\t\t\t\tonClick: onItemClick,\n\t\t\t\t'aria-current': isActive ? 'page' : undefined,\n\t\t\t\t...restProps,\n\t\t };\n\n\treturn (\n\t\t<NavigationItemBase { ...baseProps } className={ classes }>\n\t\t\t{ children || (\n\t\t\t\t<ItemUI { ...itemProps }>\n\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t<ItemIconUI>\n\t\t\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t\t\t</ItemIconUI>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<NavigationItemBaseContent\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\tbadge={ badge }\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ navigateToMenu && <Icon icon={ navigationIcon } /> }\n\t\t\t\t</ItemUI>\n\t\t\t) }\n\t\t</NavigationItemBase>\n\t);\n}\n\nexport default NavigationItem;\n"]}
|
|
@@ -39,7 +39,7 @@ const useNavigationTreeItem = (itemId, props) => {
|
|
|
39
39
|
} = (0, _context3.useNavigationMenuContext)();
|
|
40
40
|
(0, _element.useEffect)(() => {
|
|
41
41
|
const isMenuActive = activeMenu === menu;
|
|
42
|
-
const isItemVisible = !search || (0, _utils.normalizedSearch)(props.title, search);
|
|
42
|
+
const isItemVisible = !search || props.title !== undefined && (0, _utils.normalizedSearch)(props.title, search);
|
|
43
43
|
addItem(itemId, { ...props,
|
|
44
44
|
group,
|
|
45
45
|
menu,
|