@wordpress/components 23.4.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 +54 -6
- 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 +46 -22
- 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 +51 -119
- 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/circular-option-picker/index.js +63 -14
- package/build/circular-option-picker/index.js.map +1 -1
- package/build/circular-option-picker/types.js +6 -0
- package/build/circular-option-picker/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/dropdown-menu/index.js +6 -2
- package/build/dropdown-menu/index.js.map +1 -1
- 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-constrained-tabbing/index.js +9 -0
- package/build/higher-order/with-constrained-tabbing/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/mobile/global-styles-context/utils.native.js +2 -1
- package/build/mobile/global-styles-context/utils.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 +1 -0
- 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/tools-panel/context.js +2 -0
- package/build/tools-panel/context.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +18 -12
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +14 -2
- package/build/tools-panel/tools-panel-item/hook.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/context-system-provider.js +8 -4
- package/build/ui/context/context-system-provider.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 +45 -24
- 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 +54 -122
- 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/circular-option-picker/index.js +59 -16
- package/build-module/circular-option-picker/index.js.map +1 -1
- package/build-module/circular-option-picker/types.js +2 -0
- package/build-module/circular-option-picker/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/dropdown-menu/index.js +6 -2
- package/build-module/dropdown-menu/index.js.map +1 -1
- 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-constrained-tabbing/index.js +9 -0
- package/build-module/higher-order/with-constrained-tabbing/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/mobile/global-styles-context/utils.native.js +2 -1
- package/build-module/mobile/global-styles-context/utils.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 +1 -0
- 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/tools-panel/context.js +2 -0
- package/build-module/tools-panel/context.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +18 -12
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +14 -2
- package/build-module/tools-panel/tools-panel-item/hook.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/context-system-provider.js +7 -4
- package/build-module/ui/context/context-system-provider.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 +15 -11
- package/build-style/style.css +15 -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/index.d.ts +56 -7
- package/build-types/circular-option-picker/index.d.ts.map +1 -1
- package/build-types/circular-option-picker/stories/index.d.ts +14 -0
- package/build-types/circular-option-picker/stories/index.d.ts.map +1 -0
- package/build-types/circular-option-picker/types.d.ts +49 -0
- package/build-types/circular-option-picker/types.d.ts.map +1 -0
- 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/dropdown-menu/index.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/stories/e2e/index.d.ts +9 -0
- package/build-types/h-stack/stories/e2e/index.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-constrained-tabbing/index.d.ts +10 -1
- package/build-types/higher-order/with-constrained-tabbing/index.d.ts.map +1 -1
- 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/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/stories/index.d.ts +1 -0
- package/build-types/tab-panel/stories/index.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/context.d.ts.map +1 -1
- package/build-types/tools-panel/test/index.d.ts +2 -0
- package/build-types/tools-panel/test/index.d.ts.map +1 -0
- package/build-types/tools-panel/tools-panel/hook.d.ts +3 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +1 -1
- package/build-types/tools-panel/tools-panel-item/component.d.ts +1 -0
- package/build-types/tools-panel/tools-panel-item/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +21 -19
- 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/context-system-provider.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/e2e/index.d.ts +9 -0
- package/build-types/v-stack/stories/e2e/index.d.ts.map +1 -0
- 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 +24 -22
- package/src/animate/index.js +3 -1
- package/src/autocomplete/README.md +51 -0
- package/src/autocomplete/autocompleter-ui.tsx +167 -0
- package/src/autocomplete/{get-default-use-items.js → get-default-use-items.tsx} +11 -6
- package/src/autocomplete/{index.js → index.tsx} +107 -141
- 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/README.md +141 -0
- package/src/circular-option-picker/{index.js → index.tsx} +74 -14
- package/src/circular-option-picker/stories/index.tsx +134 -0
- package/src/circular-option-picker/types.ts +69 -0
- package/src/color-palette/test/__snapshots__/index.tsx.snap +17 -15
- 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/dropdown-menu/index.js +6 -3
- 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/stories/e2e/index.tsx +36 -0
- 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/navigate-regions/style.scss +2 -1
- package/src/higher-order/with-constrained-tabbing/index.tsx +30 -0
- 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/global-styles-context/utils.native.js +1 -0
- 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 +7 -7
- 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/stories/index.tsx +41 -0
- package/src/tab-panel/test/index.tsx +794 -262
- 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/tools-panel/context.ts +2 -0
- package/src/tools-panel/test/{index.js → index.tsx} +171 -61
- package/src/tools-panel/tools-panel/hook.ts +30 -11
- package/src/tools-panel/tools-panel-item/hook.ts +18 -2
- package/src/tools-panel/types.ts +12 -9
- package/src/tooltip/index.js +11 -1
- package/src/tree-grid/test/__snapshots__/index.tsx.snap +1 -1
- package/src/tree-select/index.tsx +5 -2
- package/src/tree-select/types.ts +6 -13
- package/src/ui/context/context-system-provider.js +7 -4
- 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/e2e/index.tsx +36 -0
- 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/autocomplete/autocompleter-ui.js +0 -118
- package/src/dimension-control/index.js +0 -73
- package/src/higher-order/with-constrained-tabbing/index.js +0 -22
- 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
|
@@ -26,6 +26,8 @@ import {
|
|
|
26
26
|
insert,
|
|
27
27
|
isCollapsed,
|
|
28
28
|
getTextContent,
|
|
29
|
+
// Error expected because `@wordpress/rich-text` is not yet fully typed.
|
|
30
|
+
// @ts-expect-error
|
|
29
31
|
} from '@wordpress/rich-text';
|
|
30
32
|
import { speak } from '@wordpress/a11y';
|
|
31
33
|
|
|
@@ -34,100 +36,48 @@ import { speak } from '@wordpress/a11y';
|
|
|
34
36
|
*/
|
|
35
37
|
import { getAutoCompleterUI } from './autocompleter-ui';
|
|
36
38
|
import { escapeRegExp } from '../utils/strings';
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
* @callback FnGetOptionKeywords
|
|
52
|
-
* @param {CompleterOption} option a completer option.
|
|
53
|
-
*
|
|
54
|
-
* @return {string[]} list of key words to search.
|
|
55
|
-
*/
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* @callback FnIsOptionDisabled
|
|
59
|
-
* @param {CompleterOption} option a completer option.
|
|
60
|
-
*
|
|
61
|
-
* @return {string[]} whether or not the given option is disabled.
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* @callback FnGetOptionLabel
|
|
66
|
-
* @param {CompleterOption} option a completer option.
|
|
67
|
-
*
|
|
68
|
-
* @return {(string|Array.<(string|WPElement)>)} list of react components to render.
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* @callback FnAllowContext
|
|
73
|
-
* @param {string} before the string before the auto complete trigger and query.
|
|
74
|
-
* @param {string} after the string after the autocomplete trigger and query.
|
|
75
|
-
*
|
|
76
|
-
* @return {boolean} true if the completer can handle.
|
|
77
|
-
*/
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* @typedef {Object} OptionCompletion
|
|
81
|
-
* @property {'insert-at-caret'|'replace'} action the intended placement of the completion.
|
|
82
|
-
* @property {OptionCompletionValue} value the completion value.
|
|
83
|
-
*/
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* A completion value.
|
|
87
|
-
*
|
|
88
|
-
* @typedef {(string|WPElement|Object)} OptionCompletionValue
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* @callback FnGetOptionCompletion
|
|
93
|
-
* @param {CompleterOption} value the value of the completer option.
|
|
94
|
-
* @param {string} query the text value of the autocomplete query.
|
|
95
|
-
*
|
|
96
|
-
* @return {(OptionCompletion|OptionCompletionValue)} the completion for the given option. If an
|
|
97
|
-
* OptionCompletionValue is returned, the
|
|
98
|
-
* completion action defaults to `insert-at-caret`.
|
|
99
|
-
*/
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @typedef {Object} WPCompleter
|
|
103
|
-
* @property {string} name a way to identify a completer, useful for selective overriding.
|
|
104
|
-
* @property {?string} className A class to apply to the popup menu.
|
|
105
|
-
* @property {string} triggerPrefix the prefix that will display the menu.
|
|
106
|
-
* @property {(CompleterOption[]|FnGetOptions)} options the completer options or a function to get them.
|
|
107
|
-
* @property {?FnGetOptionKeywords} getOptionKeywords get the keywords for a given option.
|
|
108
|
-
* @property {?FnIsOptionDisabled} isOptionDisabled get whether or not the given option is disabled.
|
|
109
|
-
* @property {FnGetOptionLabel} getOptionLabel get the label for a given option.
|
|
110
|
-
* @property {?FnAllowContext} allowContext filter the context under which the autocomplete activates.
|
|
111
|
-
* @property {FnGetOptionCompletion} getOptionCompletion get the completion associated with a given option.
|
|
112
|
-
*/
|
|
113
|
-
|
|
114
|
-
function useAutocomplete( {
|
|
39
|
+
import type {
|
|
40
|
+
AutocompleteProps,
|
|
41
|
+
AutocompleterUIProps,
|
|
42
|
+
InsertOption,
|
|
43
|
+
KeyedOption,
|
|
44
|
+
OptionCompletion,
|
|
45
|
+
ReplaceOption,
|
|
46
|
+
UseAutocompleteProps,
|
|
47
|
+
WPCompleter,
|
|
48
|
+
} from './types';
|
|
49
|
+
|
|
50
|
+
const EMPTY_FILTERED_OPTIONS: KeyedOption[] = [];
|
|
51
|
+
|
|
52
|
+
export function useAutocomplete( {
|
|
115
53
|
record,
|
|
116
54
|
onChange,
|
|
117
55
|
onReplace,
|
|
118
56
|
completers,
|
|
119
57
|
contentRef,
|
|
120
|
-
} ) {
|
|
58
|
+
}: UseAutocompleteProps ) {
|
|
121
59
|
const debouncedSpeak = useDebounce( speak, 500 );
|
|
122
60
|
const instanceId = useInstanceId( useAutocomplete );
|
|
123
61
|
const [ selectedIndex, setSelectedIndex ] = useState( 0 );
|
|
124
|
-
|
|
125
|
-
const [
|
|
126
|
-
|
|
127
|
-
|
|
62
|
+
|
|
63
|
+
const [ filteredOptions, setFilteredOptions ] = useState<
|
|
64
|
+
Array< KeyedOption >
|
|
65
|
+
>( EMPTY_FILTERED_OPTIONS );
|
|
66
|
+
const [ filterValue, setFilterValue ] =
|
|
67
|
+
useState< AutocompleterUIProps[ 'filterValue' ] >( '' );
|
|
68
|
+
const [ autocompleter, setAutocompleter ] = useState< WPCompleter | null >(
|
|
69
|
+
null
|
|
70
|
+
);
|
|
71
|
+
const [ AutocompleterUI, setAutocompleterUI ] = useState<
|
|
72
|
+
( ( props: AutocompleterUIProps ) => JSX.Element | null ) | null
|
|
73
|
+
>( null );
|
|
74
|
+
|
|
128
75
|
const backspacing = useRef( false );
|
|
129
76
|
|
|
130
|
-
function insertCompletion( replacement ) {
|
|
77
|
+
function insertCompletion( replacement: React.ReactNode ) {
|
|
78
|
+
if ( autocompleter === null ) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
131
81
|
const end = record.start;
|
|
132
82
|
const start =
|
|
133
83
|
end - autocompleter.triggerPrefix.length - filterValue.length;
|
|
@@ -136,7 +86,7 @@ function useAutocomplete( {
|
|
|
136
86
|
onChange( insert( record, toInsert, start, end ) );
|
|
137
87
|
}
|
|
138
88
|
|
|
139
|
-
function select( option ) {
|
|
89
|
+
function select( option: KeyedOption ) {
|
|
140
90
|
const { getOptionCompletion } = autocompleter || {};
|
|
141
91
|
|
|
142
92
|
if ( option.isDisabled ) {
|
|
@@ -146,19 +96,33 @@ function useAutocomplete( {
|
|
|
146
96
|
if ( getOptionCompletion ) {
|
|
147
97
|
const completion = getOptionCompletion( option.value, filterValue );
|
|
148
98
|
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
99
|
+
const isCompletionObject = (
|
|
100
|
+
obj: OptionCompletion
|
|
101
|
+
): obj is InsertOption | ReplaceOption => {
|
|
102
|
+
return (
|
|
103
|
+
obj !== null &&
|
|
104
|
+
typeof obj === 'object' &&
|
|
105
|
+
'action' in obj &&
|
|
106
|
+
obj.action !== undefined &&
|
|
107
|
+
'value' in obj &&
|
|
108
|
+
obj.value !== undefined
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const completionObject = isCompletionObject( completion )
|
|
113
|
+
? completion
|
|
114
|
+
: ( {
|
|
115
|
+
action: 'insert-at-caret',
|
|
116
|
+
value: completion,
|
|
117
|
+
} as InsertOption );
|
|
154
118
|
|
|
155
|
-
if ( 'replace' === action ) {
|
|
156
|
-
onReplace( [ value ] );
|
|
119
|
+
if ( 'replace' === completionObject.action ) {
|
|
120
|
+
onReplace( [ completionObject.value ] );
|
|
157
121
|
// When replacing, the component will unmount, so don't reset
|
|
158
122
|
// state (below) on an unmounted component.
|
|
159
123
|
return;
|
|
160
|
-
} else if ( 'insert-at-caret' === action ) {
|
|
161
|
-
insertCompletion( value );
|
|
124
|
+
} else if ( 'insert-at-caret' === completionObject.action ) {
|
|
125
|
+
insertCompletion( completionObject.value );
|
|
162
126
|
}
|
|
163
127
|
}
|
|
164
128
|
|
|
@@ -169,13 +133,13 @@ function useAutocomplete( {
|
|
|
169
133
|
|
|
170
134
|
function reset() {
|
|
171
135
|
setSelectedIndex( 0 );
|
|
172
|
-
setFilteredOptions(
|
|
136
|
+
setFilteredOptions( EMPTY_FILTERED_OPTIONS );
|
|
173
137
|
setFilterValue( '' );
|
|
174
138
|
setAutocompleter( null );
|
|
175
139
|
setAutocompleterUI( null );
|
|
176
140
|
}
|
|
177
141
|
|
|
178
|
-
function announce( options ) {
|
|
142
|
+
function announce( options: Array< KeyedOption > ) {
|
|
179
143
|
if ( ! debouncedSpeak ) {
|
|
180
144
|
return;
|
|
181
145
|
}
|
|
@@ -202,7 +166,7 @@ function useAutocomplete( {
|
|
|
202
166
|
*
|
|
203
167
|
* @param {Array} options
|
|
204
168
|
*/
|
|
205
|
-
function onChangeOptions( options ) {
|
|
169
|
+
function onChangeOptions( options: Array< KeyedOption > ) {
|
|
206
170
|
setSelectedIndex(
|
|
207
171
|
options.length === filteredOptions.length ? selectedIndex : 0
|
|
208
172
|
);
|
|
@@ -210,7 +174,7 @@ function useAutocomplete( {
|
|
|
210
174
|
announce( options );
|
|
211
175
|
}
|
|
212
176
|
|
|
213
|
-
function handleKeyDown( event ) {
|
|
177
|
+
function handleKeyDown( event: KeyboardEvent ) {
|
|
214
178
|
backspacing.current = event.key === 'Backspace';
|
|
215
179
|
|
|
216
180
|
if ( ! autocompleter ) {
|
|
@@ -281,23 +245,19 @@ function useAutocomplete( {
|
|
|
281
245
|
|
|
282
246
|
useEffect( () => {
|
|
283
247
|
if ( ! textContent ) {
|
|
284
|
-
reset();
|
|
248
|
+
if ( autocompleter ) reset();
|
|
285
249
|
return;
|
|
286
250
|
}
|
|
287
251
|
|
|
288
|
-
const text = removeAccents( textContent );
|
|
289
|
-
const textAfterSelection = getTextContent(
|
|
290
|
-
slice( record, undefined, getTextContent( record ).length )
|
|
291
|
-
);
|
|
292
252
|
const completer = completers?.find(
|
|
293
253
|
( { triggerPrefix, allowContext } ) => {
|
|
294
|
-
const index =
|
|
254
|
+
const index = textContent.lastIndexOf( triggerPrefix );
|
|
295
255
|
|
|
296
256
|
if ( index === -1 ) {
|
|
297
257
|
return false;
|
|
298
258
|
}
|
|
299
259
|
|
|
300
|
-
const textWithoutTrigger =
|
|
260
|
+
const textWithoutTrigger = textContent.slice(
|
|
301
261
|
index + triggerPrefix.length
|
|
302
262
|
);
|
|
303
263
|
|
|
@@ -339,9 +299,16 @@ function useAutocomplete( {
|
|
|
339
299
|
return false;
|
|
340
300
|
}
|
|
341
301
|
|
|
302
|
+
const textAfterSelection = getTextContent(
|
|
303
|
+
slice( record, undefined, getTextContent( record ).length )
|
|
304
|
+
);
|
|
305
|
+
|
|
342
306
|
if (
|
|
343
307
|
allowContext &&
|
|
344
|
-
! allowContext(
|
|
308
|
+
! allowContext(
|
|
309
|
+
textContent.slice( 0, index ),
|
|
310
|
+
textAfterSelection
|
|
311
|
+
)
|
|
345
312
|
) {
|
|
346
313
|
return false;
|
|
347
314
|
}
|
|
@@ -358,11 +325,12 @@ function useAutocomplete( {
|
|
|
358
325
|
);
|
|
359
326
|
|
|
360
327
|
if ( ! completer ) {
|
|
361
|
-
reset();
|
|
328
|
+
if ( autocompleter ) reset();
|
|
362
329
|
return;
|
|
363
330
|
}
|
|
364
331
|
|
|
365
332
|
const safeTrigger = escapeRegExp( completer.triggerPrefix );
|
|
333
|
+
const text = removeAccents( textContent );
|
|
366
334
|
const match = text
|
|
367
335
|
.slice( text.lastIndexOf( completer.triggerPrefix ) )
|
|
368
336
|
.match( new RegExp( `${ safeTrigger }([\u0000-\uFFFF]*)$` ) );
|
|
@@ -374,7 +342,7 @@ function useAutocomplete( {
|
|
|
374
342
|
? getAutoCompleterUI( completer )
|
|
375
343
|
: AutocompleterUI
|
|
376
344
|
);
|
|
377
|
-
setFilterValue( query );
|
|
345
|
+
setFilterValue( query === null ? '' : query );
|
|
378
346
|
// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.
|
|
379
347
|
// See https://github.com/WordPress/gutenberg/pull/41820
|
|
380
348
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -385,7 +353,7 @@ function useAutocomplete( {
|
|
|
385
353
|
const isExpanded = !! autocompleter && filteredOptions.length > 0;
|
|
386
354
|
const listBoxId = isExpanded
|
|
387
355
|
? `components-autocomplete-listbox-${ instanceId }`
|
|
388
|
-
:
|
|
356
|
+
: undefined;
|
|
389
357
|
const activeId = isExpanded
|
|
390
358
|
? `components-autocomplete-item-${ instanceId }-${ selectedKey }`
|
|
391
359
|
: null;
|
|
@@ -412,53 +380,47 @@ function useAutocomplete( {
|
|
|
412
380
|
};
|
|
413
381
|
}
|
|
414
382
|
|
|
415
|
-
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
383
|
+
function useLastDifferentValue( value: UseAutocompleteProps[ 'record' ] ) {
|
|
384
|
+
const history = useRef< Set< typeof value > >( new Set() );
|
|
385
|
+
|
|
386
|
+
history.current.add( value );
|
|
387
|
+
|
|
388
|
+
// Keep the history size to 2.
|
|
389
|
+
if ( history.current.size > 2 ) {
|
|
390
|
+
history.current.delete( Array.from( history.current )[ 0 ] );
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
return Array.from( history.current )[ 0 ];
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export function useAutocompleteProps( options: UseAutocompleteProps ) {
|
|
397
|
+
const ref = useRef< HTMLElement >( null );
|
|
398
|
+
const onKeyDownRef = useRef< ( event: KeyboardEvent ) => void >();
|
|
399
|
+
const { record } = options;
|
|
400
|
+
const previousRecord = useLastDifferentValue( record );
|
|
420
401
|
const { popover, listBoxId, activeId, onKeyDown } = useAutocomplete( {
|
|
421
402
|
...options,
|
|
422
403
|
contentRef: ref,
|
|
423
404
|
} );
|
|
424
405
|
onKeyDownRef.current = onKeyDown;
|
|
425
406
|
|
|
426
|
-
useEffect( () => {
|
|
427
|
-
if ( isVisible ) {
|
|
428
|
-
if ( ! recordAfterInput.current ) {
|
|
429
|
-
recordAfterInput.current = options.record;
|
|
430
|
-
} else if (
|
|
431
|
-
recordAfterInput.current.start !== options.record.start ||
|
|
432
|
-
recordAfterInput.current.end !== options.record.end
|
|
433
|
-
) {
|
|
434
|
-
setIsVisible( false );
|
|
435
|
-
recordAfterInput.current = null;
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
439
|
-
}, [ options.record ] );
|
|
440
|
-
|
|
441
407
|
const mergedRefs = useMergeRefs( [
|
|
442
408
|
ref,
|
|
443
|
-
useRefEffect( ( element ) => {
|
|
444
|
-
function _onKeyDown( event ) {
|
|
445
|
-
onKeyDownRef.current( event );
|
|
446
|
-
}
|
|
447
|
-
function _onInput() {
|
|
448
|
-
// Only show auto complete UI if the user is inputting text.
|
|
449
|
-
setIsVisible( true );
|
|
450
|
-
recordAfterInput.current = null;
|
|
409
|
+
useRefEffect( ( element: HTMLElement ) => {
|
|
410
|
+
function _onKeyDown( event: KeyboardEvent ) {
|
|
411
|
+
onKeyDownRef.current?.( event );
|
|
451
412
|
}
|
|
452
413
|
element.addEventListener( 'keydown', _onKeyDown );
|
|
453
|
-
element.addEventListener( 'input', _onInput );
|
|
454
414
|
return () => {
|
|
455
415
|
element.removeEventListener( 'keydown', _onKeyDown );
|
|
456
|
-
element.removeEventListener( 'input', _onInput );
|
|
457
416
|
};
|
|
458
417
|
}, [] ),
|
|
459
418
|
] );
|
|
460
419
|
|
|
461
|
-
if
|
|
420
|
+
// We only want to show the popover if the user has typed something.
|
|
421
|
+
const didUserInput = record.text !== previousRecord?.text;
|
|
422
|
+
|
|
423
|
+
if ( ! didUserInput ) {
|
|
462
424
|
return { ref: mergedRefs };
|
|
463
425
|
}
|
|
464
426
|
|
|
@@ -471,7 +433,11 @@ export function useAutocompleteProps( options ) {
|
|
|
471
433
|
};
|
|
472
434
|
}
|
|
473
435
|
|
|
474
|
-
export default function Autocomplete( {
|
|
436
|
+
export default function Autocomplete( {
|
|
437
|
+
children,
|
|
438
|
+
isSelected,
|
|
439
|
+
...options
|
|
440
|
+
}: AutocompleteProps ) {
|
|
475
441
|
const { popover, ...props } = useAutocomplete( options );
|
|
476
442
|
return (
|
|
477
443
|
<>
|
|
@@ -14,6 +14,8 @@ import { useRef } from '@wordpress/element';
|
|
|
14
14
|
*/
|
|
15
15
|
import { getAutoCompleterUI } from '../autocompleter-ui';
|
|
16
16
|
|
|
17
|
+
type FruitOption = { visual: string; name: string; id: number };
|
|
18
|
+
|
|
17
19
|
describe( 'AutocompleterUI', () => {
|
|
18
20
|
describe( 'click outside behavior', () => {
|
|
19
21
|
it( 'should call reset function when a click on another element occurs', async () => {
|
|
@@ -23,25 +25,35 @@ describe( 'AutocompleterUI', () => {
|
|
|
23
25
|
|
|
24
26
|
const autocompleter = {
|
|
25
27
|
name: 'fruit',
|
|
28
|
+
options: [
|
|
29
|
+
{ visual: '🍎', name: 'Apple', id: 1 },
|
|
30
|
+
{ visual: '🍊', name: 'Orange', id: 2 },
|
|
31
|
+
{ visual: '🍇', name: 'Grapes', id: 3 },
|
|
32
|
+
],
|
|
26
33
|
// The prefix that triggers this completer
|
|
27
34
|
triggerPrefix: '~',
|
|
35
|
+
getOptionLabel: ( option: FruitOption ) => (
|
|
36
|
+
<span>
|
|
37
|
+
<span className="icon">{ option.visual }</span>
|
|
38
|
+
{ option.name }
|
|
39
|
+
</span>
|
|
40
|
+
),
|
|
28
41
|
// Mock useItems function to return a autocomplete item.
|
|
29
|
-
useItems: () => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
];
|
|
42
|
+
useItems: ( filterValue: string ) => {
|
|
43
|
+
const options = autocompleter.options;
|
|
44
|
+
const keyedOptions = options.map(
|
|
45
|
+
( optionData, optionIndex ) => ( {
|
|
46
|
+
key: `${ autocompleter.name }-${ optionIndex }`,
|
|
47
|
+
value: optionData,
|
|
48
|
+
label: autocompleter.getOptionLabel( optionData ),
|
|
49
|
+
keywords: [],
|
|
50
|
+
isDisabled: false,
|
|
51
|
+
} )
|
|
52
|
+
);
|
|
53
|
+
const filteredOptions = keyedOptions.filter( ( option ) =>
|
|
54
|
+
option.value.name.includes( filterValue )
|
|
55
|
+
);
|
|
56
|
+
return [ filteredOptions ] as const;
|
|
45
57
|
},
|
|
46
58
|
};
|
|
47
59
|
|
|
@@ -50,19 +62,18 @@ describe( 'AutocompleterUI', () => {
|
|
|
50
62
|
const OtherElement = <div>Other Element</div>;
|
|
51
63
|
|
|
52
64
|
const Container = () => {
|
|
53
|
-
const contentRef = useRef();
|
|
65
|
+
const contentRef = useRef< HTMLElement >( null );
|
|
54
66
|
|
|
55
67
|
return (
|
|
56
68
|
<div>
|
|
57
69
|
<AutocompleterUI
|
|
58
70
|
className={ 'test' }
|
|
59
|
-
filterValue={ '
|
|
60
|
-
instanceId={
|
|
71
|
+
filterValue={ 'Apple' }
|
|
72
|
+
instanceId={ 1 }
|
|
61
73
|
listBoxId={ '1' }
|
|
62
74
|
selectedIndex={ 0 }
|
|
63
75
|
onChangeOptions={ () => {} }
|
|
64
76
|
onSelect={ () => {} }
|
|
65
|
-
value={ { visual: '🍎', name: 'Apple', id: 1 } }
|
|
66
77
|
contentRef={ contentRef }
|
|
67
78
|
reset={ resetSpy }
|
|
68
79
|
/>
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { WPElement } from '@wordpress/element';
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
import type { useAutocomplete } from '.';
|
|
9
|
+
|
|
10
|
+
// Insert the `value` into the text.
|
|
11
|
+
export type InsertOption = {
|
|
12
|
+
action: 'insert-at-caret';
|
|
13
|
+
value: React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// Replace the current block with the block specified in the `value` property
|
|
17
|
+
export type ReplaceOption = { action: 'replace'; value: RichTextValue };
|
|
18
|
+
|
|
19
|
+
export type OptionCompletion = React.ReactNode | InsertOption | ReplaceOption;
|
|
20
|
+
|
|
21
|
+
type OptionLabel = string | WPElement | Array< string | WPElement >;
|
|
22
|
+
export type KeyedOption = {
|
|
23
|
+
key: string;
|
|
24
|
+
value: any;
|
|
25
|
+
label: OptionLabel;
|
|
26
|
+
keywords: Array< string >;
|
|
27
|
+
isDisabled: boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type WPCompleter< TCompleterOption = any > = {
|
|
31
|
+
/**
|
|
32
|
+
* The name of the completer. Useful for identifying a specific completer to
|
|
33
|
+
* be overridden via extensibility hooks.
|
|
34
|
+
*/
|
|
35
|
+
name: string;
|
|
36
|
+
/**
|
|
37
|
+
* The string prefix that should trigger the completer. For example,
|
|
38
|
+
* Gutenberg's block completer is triggered when the '/' character is
|
|
39
|
+
* entered.
|
|
40
|
+
*/
|
|
41
|
+
triggerPrefix: string;
|
|
42
|
+
/**
|
|
43
|
+
* The raw options for completion. May be an array, a function that returns
|
|
44
|
+
* an array, or a function that returns a promise for an array.
|
|
45
|
+
* Options may be of any type or shape. The completer declares how those
|
|
46
|
+
* options are rendered and what their completions should be when selected.
|
|
47
|
+
*/
|
|
48
|
+
options:
|
|
49
|
+
| ( (
|
|
50
|
+
query: string
|
|
51
|
+
) =>
|
|
52
|
+
| PromiseLike< readonly TCompleterOption[] >
|
|
53
|
+
| readonly TCompleterOption[] )
|
|
54
|
+
| readonly TCompleterOption[];
|
|
55
|
+
/**
|
|
56
|
+
* A function that returns the keywords for the specified option.
|
|
57
|
+
*/
|
|
58
|
+
getOptionKeywords?: ( option: TCompleterOption ) => Array< string >;
|
|
59
|
+
/**
|
|
60
|
+
* A function that returns whether or not the specified option is disabled.
|
|
61
|
+
* Disabled options cannot be selected.
|
|
62
|
+
*/
|
|
63
|
+
isOptionDisabled?: ( option: TCompleterOption ) => boolean;
|
|
64
|
+
/**
|
|
65
|
+
* A function that returns the label for a given option. A label may be a
|
|
66
|
+
* string or a mixed array of strings, elements, and components.
|
|
67
|
+
*/
|
|
68
|
+
getOptionLabel: ( option: TCompleterOption ) => OptionLabel;
|
|
69
|
+
/**
|
|
70
|
+
* A function that takes a Range before and a Range after the autocomplete
|
|
71
|
+
* trigger and query text and returns a boolean indicating whether the
|
|
72
|
+
* completer should be considered for that context.
|
|
73
|
+
*/
|
|
74
|
+
allowContext?: ( before: string, after: string ) => boolean;
|
|
75
|
+
/**
|
|
76
|
+
* A function that takes an option and returns how the option should
|
|
77
|
+
* be completed. By default, the result is a value to be inserted in the
|
|
78
|
+
* text.
|
|
79
|
+
* However, a completer may explicitly declare how a completion should be
|
|
80
|
+
* treated by returning an object with `action` and `value` properties. The
|
|
81
|
+
* `action` declares what should be done with the `value`.
|
|
82
|
+
*/
|
|
83
|
+
getOptionCompletion?: (
|
|
84
|
+
option: TCompleterOption,
|
|
85
|
+
query: string
|
|
86
|
+
) => OptionCompletion;
|
|
87
|
+
/**
|
|
88
|
+
* A function that returns an array of items to be displayed in the
|
|
89
|
+
* Autocomplete UI. These items have uniform shape and have been filtered by
|
|
90
|
+
* `AutocompleterUIProps.filterValue`.
|
|
91
|
+
*/
|
|
92
|
+
useItems?: ( filterValue: string ) => readonly [ Array< KeyedOption > ];
|
|
93
|
+
/**
|
|
94
|
+
* Whether or not changes to the `filterValue` should be debounced.
|
|
95
|
+
*/
|
|
96
|
+
isDebounced?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* A CSS class name to be applied to the completion menu.
|
|
99
|
+
*/
|
|
100
|
+
className?: string;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
type ContentRef = React.RefObject< HTMLElement >;
|
|
104
|
+
|
|
105
|
+
export type AutocompleterUIProps = {
|
|
106
|
+
/**
|
|
107
|
+
* The value to filter the options by.
|
|
108
|
+
*/
|
|
109
|
+
filterValue: string;
|
|
110
|
+
/**
|
|
111
|
+
* An id unique to each instance of the component, used in the IDs of the
|
|
112
|
+
* buttons generated for individual options.
|
|
113
|
+
*/
|
|
114
|
+
instanceId: number;
|
|
115
|
+
/**
|
|
116
|
+
* The id of to be applied to the listbox of options.
|
|
117
|
+
*/
|
|
118
|
+
listBoxId: string | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* The class to apply to the wrapper element.
|
|
121
|
+
*/
|
|
122
|
+
className?: string;
|
|
123
|
+
/**
|
|
124
|
+
* The index of the currently selected option.
|
|
125
|
+
*/
|
|
126
|
+
selectedIndex: number;
|
|
127
|
+
/**
|
|
128
|
+
* A function to be called when the filterValue changes.
|
|
129
|
+
*/
|
|
130
|
+
onChangeOptions: ( items: Array< KeyedOption > ) => void;
|
|
131
|
+
/**
|
|
132
|
+
* A function to be called when an option is selected.
|
|
133
|
+
*/
|
|
134
|
+
onSelect: ( option: KeyedOption ) => void;
|
|
135
|
+
/**
|
|
136
|
+
* A function to be called when the completer is reset
|
|
137
|
+
* (e.g. when the user hits the escape key).
|
|
138
|
+
*/
|
|
139
|
+
onReset?: () => void;
|
|
140
|
+
/**
|
|
141
|
+
* A function that defines the behavior of the completer when it is reset
|
|
142
|
+
*/
|
|
143
|
+
reset: ( event: Event ) => void;
|
|
144
|
+
// This is optional because it's still needed for mobile/native.
|
|
145
|
+
/**
|
|
146
|
+
* The rich text value object the autocompleter is being applied to.
|
|
147
|
+
*/
|
|
148
|
+
value?: RichTextValue;
|
|
149
|
+
/**
|
|
150
|
+
* A ref containing the editable element that will serve as the anchor for
|
|
151
|
+
* `Autocomplete`'s `Popover`.
|
|
152
|
+
*/
|
|
153
|
+
contentRef: ContentRef;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export type CancelablePromise< T = void > = Promise< T > & {
|
|
157
|
+
canceled?: boolean;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* When `@wordpress/rich-text` is fully typed, the following
|
|
162
|
+
* types should be moved to and imported from there
|
|
163
|
+
*
|
|
164
|
+
* @see /packages/rich-text/src/create.js
|
|
165
|
+
*/
|
|
166
|
+
type RichTextFormat = {
|
|
167
|
+
type: string;
|
|
168
|
+
};
|
|
169
|
+
type RichTextFormatList = Array< RichTextFormat >;
|
|
170
|
+
type RichTextValue = {
|
|
171
|
+
text: string;
|
|
172
|
+
formats?: Array< RichTextFormatList >;
|
|
173
|
+
replacements?: Array< RichTextFormat >;
|
|
174
|
+
start: number | undefined;
|
|
175
|
+
end: number | undefined;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export type UseAutocompleteProps = {
|
|
179
|
+
/**
|
|
180
|
+
* The rich text value object the autocompleter is being applied to.
|
|
181
|
+
*/
|
|
182
|
+
record: RichTextValue & {
|
|
183
|
+
start: NonNullable< RichTextValue[ 'start' ] >;
|
|
184
|
+
end: NonNullable< RichTextValue[ 'end' ] >;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* A function to be called when an option is selected to insert into the
|
|
188
|
+
* existing text.
|
|
189
|
+
*/
|
|
190
|
+
onChange: ( value: string ) => void;
|
|
191
|
+
/**
|
|
192
|
+
* A function to be called when an option is selected to replace the
|
|
193
|
+
* existing text.
|
|
194
|
+
*/
|
|
195
|
+
onReplace: ( values: RichTextValue[] ) => void;
|
|
196
|
+
/**
|
|
197
|
+
* An array of all of the completers to apply to the current element.
|
|
198
|
+
*/
|
|
199
|
+
completers: Array< WPCompleter >;
|
|
200
|
+
/**
|
|
201
|
+
* A ref containing the editable element that will serve as the anchor for
|
|
202
|
+
* `Autocomplete`'s `Popover`.
|
|
203
|
+
*/
|
|
204
|
+
contentRef: ContentRef;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export type AutocompleteProps = UseAutocompleteProps & {
|
|
208
|
+
/**
|
|
209
|
+
* A function that returns nodes to be rendered within the Autocomplete.
|
|
210
|
+
*/
|
|
211
|
+
children: (
|
|
212
|
+
props: Omit< ReturnType< typeof useAutocomplete >, 'popover' >
|
|
213
|
+
) => React.ReactNode;
|
|
214
|
+
/**
|
|
215
|
+
* Whether or not the Autocomplte componenet is selected, and if its
|
|
216
|
+
* `Popover`
|
|
217
|
+
* should be displayed.
|
|
218
|
+
*/
|
|
219
|
+
isSelected: boolean;
|
|
220
|
+
};
|