@wordpress/components 19.12.0 → 19.15.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 +116 -3
- package/CONTRIBUTING.md +94 -12
- package/build/alignment-matrix-control/index.js +3 -3
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/alignment-matrix-control/utils.js +1 -7
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/angle-picker-control/index.js +2 -2
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +4 -2
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.native.js +9 -3
- package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build/autocomplete/get-default-use-items.js +5 -1
- package/build/autocomplete/get-default-use-items.js.map +1 -1
- package/build/autocomplete/index.js +9 -3
- package/build/autocomplete/index.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js +2 -1
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js +2 -1
- package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build/border-box-control/utils.js.map +1 -1
- package/build/border-control/border-control/component.js +40 -4
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/box-control/all-input-control.js +6 -10
- package/build/box-control/all-input-control.js.map +1 -1
- package/build/box-control/axial-input-controls.js.map +1 -1
- package/build/box-control/index.js +4 -8
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-controls.js +6 -10
- package/build/box-control/input-controls.js.map +1 -1
- package/build/box-control/unit-control.js +4 -4
- package/build/box-control/unit-control.js.map +1 -1
- package/build/box-control/utils.js +3 -3
- package/build/box-control/utils.js.map +1 -1
- package/build/button/index.native.js +1 -3
- package/build/button/index.native.js.map +1 -1
- package/build/checkbox-control/index.js.map +1 -1
- package/build/color-indicator/index.js +27 -10
- package/build/color-indicator/index.js.map +1 -1
- package/build/color-indicator/types.js +6 -0
- package/build/color-indicator/types.js.map +1 -0
- package/build/color-palette/index.js +2 -1
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/component.js +6 -9
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/hex-input.js +5 -4
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/index.native.js +35 -34
- package/build/color-picker/index.native.js.map +1 -1
- package/build/color-picker/input-with-slider.js +4 -3
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/color-picker/styles.js +42 -36
- package/build/color-picker/styles.js.map +1 -1
- package/build/color-picker/use-deprecated-props.js +22 -31
- package/build/color-picker/use-deprecated-props.js.map +1 -1
- package/build/combobox-control/index.js +18 -8
- package/build/combobox-control/index.js.map +1 -1
- package/build/combobox-control/styles.js +39 -0
- package/build/combobox-control/styles.js.map +1 -0
- package/build/confirm-dialog/component.js.map +1 -1
- package/build/custom-gradient-bar/constants.js +1 -3
- package/build/custom-gradient-bar/constants.js.map +1 -1
- package/build/custom-gradient-bar/control-points.js +15 -8
- package/build/custom-gradient-bar/control-points.js.map +1 -1
- package/build/custom-gradient-bar/index.js +5 -5
- package/build/custom-gradient-bar/index.js.map +1 -1
- package/build/custom-gradient-bar/utils.js +5 -7
- package/build/custom-gradient-bar/utils.js.map +1 -1
- package/build/custom-gradient-picker/index.js +8 -8
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/custom-gradient-picker/index.native.js +8 -9
- package/build/custom-gradient-picker/index.native.js.map +1 -1
- package/build/custom-gradient-picker/serializer.js +4 -7
- package/build/custom-gradient-picker/serializer.js.map +1 -1
- package/build/custom-gradient-picker/utils.js.map +1 -1
- package/build/custom-select-control/index.js.map +1 -1
- package/build/date-time/date/index.js +7 -5
- package/build/date-time/date/index.js.map +1 -1
- package/build/date-time/date-time/index.js +6 -4
- package/build/date-time/date-time/index.js.map +1 -1
- package/build/dimension-control/index.js +1 -3
- package/build/dimension-control/index.js.map +1 -1
- package/build/divider/styles.js +5 -5
- package/build/divider/styles.js.map +1 -1
- package/build/draggable/index.js.map +1 -1
- package/build/draggable/index.native.js +6 -1
- package/build/draggable/index.native.js.map +1 -1
- package/build/drop-zone/provider.js.map +1 -1
- package/build/dropdown/index.js +2 -2
- package/build/dropdown/index.js.map +1 -1
- package/build/dropdown-menu/index.js +16 -5
- package/build/dropdown-menu/index.js.map +1 -1
- package/build/dropdown-menu/index.native.js +17 -6
- package/build/dropdown-menu/index.native.js.map +1 -1
- package/build/duotone-picker/duotone-picker.js +42 -29
- package/build/duotone-picker/duotone-picker.js.map +1 -1
- package/build/elevation/hook.js +14 -14
- package/build/elevation/hook.js.map +1 -1
- package/build/external-link/index.js +20 -10
- package/build/external-link/index.js.map +1 -1
- package/build/external-link/styles/external-link-styles.js +3 -3
- package/build/external-link/styles/external-link-styles.js.map +1 -1
- package/build/external-link/types.js +6 -0
- package/build/external-link/types.js.map +1 -0
- package/build/flex/flex/hook.js +9 -5
- package/build/flex/flex/hook.js.map +1 -1
- package/build/focal-point-picker/controls.js +3 -7
- package/build/focal-point-picker/controls.js.map +1 -1
- package/build/focal-point-picker/grid.js +2 -7
- package/build/focal-point-picker/grid.js.map +1 -1
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/index.native.js +12 -12
- package/build/focal-point-picker/index.native.js.map +1 -1
- package/build/focal-point-picker/media.js +4 -8
- package/build/focal-point-picker/media.js.map +1 -1
- package/build/focal-point-picker/tooltip/index.native.js +11 -12
- package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build/font-size-picker/index.js +1 -1
- package/build/font-size-picker/index.js.map +1 -1
- package/build/form-toggle/index.js +34 -9
- package/build/form-toggle/index.js.map +1 -1
- package/build/form-toggle/types.js +6 -0
- package/build/form-toggle/types.js.map +1 -0
- package/build/form-token-field/index.js +344 -360
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/styles.js +40 -0
- package/build/form-token-field/styles.js.map +1 -0
- package/build/form-token-field/suggestions-list.js +22 -21
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/form-token-field/token-input.js +39 -53
- package/build/form-token-field/token-input.js.map +1 -1
- package/build/form-token-field/token.js +3 -3
- package/build/form-token-field/token.js.map +1 -1
- package/build/form-token-field/types.js +6 -0
- package/build/form-token-field/types.js.map +1 -0
- package/build/gradient-picker/index.js.map +1 -1
- package/build/grid/component.js +7 -8
- package/build/grid/component.js.map +1 -1
- package/build/grid/hook.js +1 -5
- package/build/grid/hook.js.map +1 -1
- package/build/grid/index.js.map +1 -1
- package/build/grid/utils.js +4 -7
- package/build/grid/utils.js.map +1 -1
- package/build/h-stack/component.js +5 -9
- package/build/h-stack/component.js.map +1 -1
- package/build/h-stack/hook.js +8 -10
- package/build/h-stack/hook.js.map +1 -1
- package/build/h-stack/index.js.map +1 -1
- package/build/h-stack/utils.js +8 -19
- package/build/h-stack/utils.js.map +1 -1
- package/build/heading/component.js +0 -1
- package/build/heading/component.js.map +1 -1
- package/build/heading/hook.js.map +1 -1
- package/build/heading/types.js +6 -0
- package/build/heading/types.js.map +1 -0
- package/build/higher-order/navigate-regions/index.js.map +1 -1
- package/build/higher-order/with-focus-return/index.js.map +1 -1
- package/build/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build/icon/index.js.map +1 -1
- package/build/input-control/index.js +5 -5
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-field.js +10 -10
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/utils.js +1 -1
- package/build/input-control/utils.js.map +1 -1
- package/build/menu-item/index.js +1 -3
- package/build/menu-item/index.js.map +1 -1
- package/build/menu-items-choice/index.js +3 -7
- package/build/menu-items-choice/index.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -7
- package/build/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +0 -1
- package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
- package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/focal-point-settings-panel/index.native.js +1 -1
- package/build/mobile/focal-point-settings-panel/index.native.js.map +1 -1
- package/build/mobile/global-styles-context/index.native.js.map +1 -1
- package/build/mobile/gradient/index.native.js.map +1 -1
- package/build/mobile/html-text-input/index.native.js.map +1 -1
- package/build/mobile/image/index.native.js +4 -2
- package/build/mobile/image/index.native.js.map +1 -1
- package/build/mobile/inserter-button/index.native.js.map +1 -1
- package/build/mobile/link-picker/index.native.js +4 -4
- package/build/mobile/link-picker/index.native.js.map +1 -1
- package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
- package/build/mobile/media-edit/index.native.js.map +1 -1
- package/build/mobile/segmented-control/index.native.js +3 -5
- package/build/mobile/segmented-control/index.native.js.map +1 -1
- package/build/modal/index.js +18 -4
- package/build/modal/index.js.map +1 -1
- package/build/navigable-container/container.js +4 -2
- package/build/navigable-container/container.js.map +1 -1
- package/build/navigation/context.js +12 -16
- package/build/navigation/context.js.map +1 -1
- package/build/navigation/group/index.js +4 -7
- package/build/navigation/group/index.js.map +1 -1
- package/build/navigation/index.js +7 -4
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/item/base.js +6 -3
- package/build/navigation/item/base.js.map +1 -1
- package/build/navigation/item/index.js +3 -3
- package/build/navigation/item/index.js.map +1 -1
- package/build/navigation/item/use-navigation-tree-item.js +2 -1
- package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +1 -7
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/navigation/menu/search-no-results-found.js +1 -7
- package/build/navigation/menu/search-no-results-found.js.map +1 -1
- package/build/navigation/use-navigation-tree-nodes.js +18 -10
- package/build/navigation/use-navigation-tree-nodes.js.map +1 -1
- package/build/navigation/utils.js +4 -2
- package/build/navigation/utils.js.map +1 -1
- package/build/navigator/navigator-back-button/hook.js.map +1 -1
- package/build/navigator/navigator-button/hook.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +1 -1
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +1 -1
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/notice/index.js +5 -5
- package/build/notice/index.js.map +1 -1
- package/build/notice/list.js +4 -2
- package/build/notice/list.js.map +1 -1
- package/build/panel/body.js +3 -3
- package/build/panel/body.js.map +1 -1
- package/build/placeholder/index.js +26 -12
- package/build/placeholder/index.js.map +1 -1
- package/build/popover/index.js +4 -4
- package/build/popover/index.js.map +1 -1
- package/build/radio-control/index.js +43 -7
- package/build/radio-control/index.js.map +1 -1
- package/build/radio-control/types.js +6 -0
- package/build/radio-control/types.js.map +1 -0
- package/build/range-control/index.js +63 -47
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/input-range.js +11 -17
- package/build/range-control/input-range.js.map +1 -1
- package/build/range-control/mark.js +5 -7
- package/build/range-control/mark.js.map +1 -1
- package/build/range-control/rail.js +10 -16
- package/build/range-control/rail.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +62 -62
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/range-control/tooltip.js +5 -7
- package/build/range-control/tooltip.js.map +1 -1
- package/build/range-control/types.js +6 -0
- package/build/range-control/types.js.map +1 -0
- package/build/range-control/utils.js +27 -36
- package/build/range-control/utils.js.map +1 -1
- package/build/resizable-box/resize-tooltip/index.js +3 -3
- package/build/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js +5 -13
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/responsive-wrapper/index.js.map +1 -1
- package/build/scrollable/component.js +7 -8
- package/build/scrollable/component.js.map +1 -1
- package/build/scrollable/hook.js +0 -8
- package/build/scrollable/hook.js.map +1 -1
- package/build/scrollable/index.js.map +1 -1
- package/build/scrollable/styles.js +7 -7
- package/build/scrollable/styles.js.map +1 -1
- package/build/select-control/index.js +5 -3
- package/build/select-control/index.js.map +1 -1
- package/build/shortcut/index.js +2 -8
- package/build/shortcut/index.js.map +1 -1
- package/build/slot-fill/fill.js +1 -7
- package/build/slot-fill/fill.js.map +1 -1
- package/build/slot-fill/index.native.js +6 -8
- package/build/slot-fill/index.native.js.map +1 -1
- package/build/slot-fill/provider.js +4 -8
- package/build/slot-fill/provider.js.map +1 -1
- package/build/slot-fill/slot.js +17 -10
- package/build/slot-fill/slot.js.map +1 -1
- package/build/snackbar/index.js +7 -7
- package/build/snackbar/index.js.map +1 -1
- package/build/snackbar/list.js +3 -1
- package/build/snackbar/list.js.map +1 -1
- package/build/spacer/component.js +5 -5
- package/build/spacer/component.js.map +1 -1
- package/build/spacer/hook.js +2 -2
- package/build/spacer/hook.js.map +1 -1
- package/build/spacer/index.js.map +1 -1
- package/build/spinner/index.js +26 -13
- package/build/spinner/index.js.map +1 -1
- package/build/spinner/styles.js +10 -10
- package/build/spinner/styles.js.map +1 -1
- package/build/tab-panel/index.js +3 -1
- package/build/tab-panel/index.js.map +1 -1
- package/build/text/hook.js +4 -4
- package/build/text/hook.js.map +1 -1
- package/build/text/utils.js.map +1 -1
- package/build/text-highlight/index.js +22 -5
- package/build/text-highlight/index.js.map +1 -1
- package/build/text-highlight/types.js +6 -0
- package/build/text-highlight/types.js.map +1 -0
- package/build/tip/index.js +5 -11
- package/build/tip/index.js.map +1 -1
- package/build/tip/types.js +6 -0
- package/build/tip/types.js.map +1 -0
- package/build/toggle-control/index.js +1 -3
- package/build/toggle-control/index.js.map +1 -1
- package/build/toggle-control/index.native.js +1 -7
- package/build/toggle-control/index.native.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build/toolbar/index.js.map +1 -1
- package/build/toolbar-group/index.js +3 -3
- package/build/toolbar-group/index.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build/tooltip/index.js +2 -1
- package/build/tooltip/index.js.map +1 -1
- package/build/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build/tree-select/index.js +59 -6
- package/build/tree-select/index.js.map +1 -1
- package/build/tree-select/types.js +6 -0
- package/build/tree-select/types.js.map +1 -0
- package/build/truncate/component.js +7 -8
- package/build/truncate/component.js.map +1 -1
- package/build/truncate/hook.js +3 -10
- package/build/truncate/hook.js.map +1 -1
- package/build/truncate/index.js.map +1 -1
- package/build/truncate/styles.js +1 -1
- package/build/truncate/styles.js.map +1 -1
- package/build/truncate/utils.js +3 -16
- package/build/truncate/utils.js.map +1 -1
- package/build/ui/form-group/form-group-content.js.map +1 -1
- package/build/ui/utils/get-valid-children.js.map +1 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/utils/math.js +17 -7
- package/build/utils/math.js.map +1 -1
- package/build/utils/unit-values.js.map +1 -1
- package/build/utils/values.js.map +1 -1
- package/build/v-stack/component.js +9 -9
- package/build/v-stack/component.js.map +1 -1
- package/build/v-stack/hook.js +0 -5
- package/build/v-stack/hook.js.map +1 -1
- package/build/v-stack/index.js.map +1 -1
- package/build/visually-hidden/component.js +12 -13
- package/build/visually-hidden/component.js.map +1 -1
- package/build/visually-hidden/index.js.map +1 -1
- package/build/visually-hidden/styles.js +3 -1
- package/build/visually-hidden/styles.js.map +1 -1
- package/build/visually-hidden/types.js +6 -0
- package/build/visually-hidden/types.js.map +1 -0
- package/build/z-stack/component.js +22 -3
- package/build/z-stack/component.js.map +1 -1
- package/build/z-stack/types.js +6 -0
- package/build/z-stack/types.js.map +1 -0
- package/build-module/alignment-matrix-control/index.js +2 -1
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/alignment-matrix-control/utils.js +1 -6
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/angle-picker-control/index.js +1 -1
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +4 -2
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.native.js +9 -3
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/autocomplete/get-default-use-items.js +3 -2
- package/build-module/autocomplete/get-default-use-items.js.map +1 -1
- package/build-module/autocomplete/index.js +7 -4
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +2 -1
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js +2 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build-module/border-box-control/utils.js.map +1 -1
- package/build-module/border-control/border-control/component.js +38 -3
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/box-control/all-input-control.js +3 -5
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/axial-input-controls.js.map +1 -1
- package/build-module/box-control/index.js +3 -6
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-controls.js +3 -5
- package/build-module/box-control/input-controls.js.map +1 -1
- package/build-module/box-control/unit-control.js +3 -1
- package/build-module/box-control/unit-control.js.map +1 -1
- package/build-module/box-control/utils.js +4 -4
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/button/index.native.js +1 -2
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/color-indicator/index.js +29 -8
- package/build-module/color-indicator/index.js.map +1 -1
- package/build-module/color-indicator/types.js +2 -0
- package/build-module/color-indicator/types.js.map +1 -0
- package/build-module/color-palette/index.js +2 -1
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/component.js +7 -8
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/hex-input.js +4 -3
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/index.native.js +36 -35
- package/build-module/color-picker/index.native.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +4 -3
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/color-picker/styles.js +28 -31
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/color-picker/use-deprecated-props.js +22 -31
- package/build-module/color-picker/use-deprecated-props.js.map +1 -1
- package/build-module/combobox-control/index.js +18 -8
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/combobox-control/styles.js +27 -0
- package/build-module/combobox-control/styles.js.map +1 -0
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/custom-gradient-bar/constants.js +0 -1
- package/build-module/custom-gradient-bar/constants.js.map +1 -1
- package/build-module/custom-gradient-bar/control-points.js +16 -9
- package/build-module/custom-gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-gradient-bar/index.js +6 -6
- package/build-module/custom-gradient-bar/index.js.map +1 -1
- package/build-module/custom-gradient-bar/utils.js +6 -8
- package/build-module/custom-gradient-bar/utils.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +8 -7
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.native.js +8 -8
- package/build-module/custom-gradient-picker/index.native.js.map +1 -1
- package/build-module/custom-gradient-picker/serializer.js +4 -6
- package/build-module/custom-gradient-picker/serializer.js.map +1 -1
- package/build-module/custom-gradient-picker/utils.js.map +1 -1
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/date-time/date/index.js +7 -4
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date-time/index.js +5 -2
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/dimension-control/index.js +1 -2
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/divider/styles.js +5 -5
- package/build-module/divider/styles.js.map +1 -1
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/draggable/index.native.js +6 -1
- package/build-module/draggable/index.native.js.map +1 -1
- package/build-module/drop-zone/provider.js.map +1 -1
- package/build-module/dropdown/index.js +2 -2
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/dropdown-menu/index.js +16 -4
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js +16 -4
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/duotone-picker/duotone-picker.js +42 -29
- package/build-module/duotone-picker/duotone-picker.js.map +1 -1
- package/build-module/elevation/hook.js +13 -13
- package/build-module/elevation/hook.js.map +1 -1
- package/build-module/external-link/index.js +22 -8
- package/build-module/external-link/index.js.map +1 -1
- package/build-module/external-link/styles/external-link-styles.js +3 -3
- package/build-module/external-link/styles/external-link-styles.js.map +1 -1
- package/build-module/external-link/types.js +2 -0
- package/build-module/external-link/types.js.map +1 -0
- package/build-module/flex/flex/hook.js +7 -5
- package/build-module/flex/flex/hook.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +3 -5
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/grid.js +2 -6
- package/build-module/focal-point-picker/grid.js.map +1 -1
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/index.native.js +9 -9
- package/build-module/focal-point-picker/index.native.js.map +1 -1
- package/build-module/focal-point-picker/media.js +3 -5
- package/build-module/focal-point-picker/media.js.map +1 -1
- package/build-module/focal-point-picker/tooltip/index.native.js +11 -12
- package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build-module/font-size-picker/index.js +1 -1
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/form-toggle/index.js +31 -7
- package/build-module/form-toggle/index.js.map +1 -1
- package/build-module/form-toggle/types.js +2 -0
- package/build-module/form-toggle/types.js.map +1 -0
- package/build-module/form-token-field/index.js +345 -363
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/styles.js +28 -0
- package/build-module/form-token-field/styles.js.map +1 -0
- package/build-module/form-token-field/suggestions-list.js +27 -23
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/form-token-field/token-input.js +43 -58
- package/build-module/form-token-field/token-input.js.map +1 -1
- package/build-module/form-token-field/token.js +3 -1
- package/build-module/form-token-field/token.js.map +1 -1
- package/build-module/form-token-field/types.js +2 -0
- package/build-module/form-token-field/types.js.map +1 -0
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/grid/component.js +7 -8
- package/build-module/grid/component.js.map +1 -1
- package/build-module/grid/hook.js +1 -5
- package/build-module/grid/hook.js.map +1 -1
- package/build-module/grid/index.js.map +1 -1
- package/build-module/grid/utils.js +3 -8
- package/build-module/grid/utils.js.map +1 -1
- package/build-module/h-stack/component.js +3 -7
- package/build-module/h-stack/component.js.map +1 -1
- package/build-module/h-stack/hook.js +10 -12
- package/build-module/h-stack/hook.js.map +1 -1
- package/build-module/h-stack/index.js.map +1 -1
- package/build-module/h-stack/utils.js +8 -20
- package/build-module/h-stack/utils.js.map +1 -1
- package/build-module/heading/component.js +0 -1
- package/build-module/heading/component.js.map +1 -1
- package/build-module/heading/hook.js.map +1 -1
- package/build-module/heading/types.js +2 -0
- package/build-module/heading/types.js.map +1 -0
- package/build-module/higher-order/navigate-regions/index.js.map +1 -1
- package/build-module/higher-order/with-focus-return/index.js.map +1 -1
- package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build-module/icon/index.js.map +1 -1
- package/build-module/input-control/index.js +2 -1
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-field.js +2 -1
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/utils.js +1 -1
- package/build-module/input-control/utils.js.map +1 -1
- package/build-module/menu-item/index.js +1 -2
- package/build-module/menu-item/index.js.map +1 -1
- package/build-module/menu-items-choice/index.js +3 -5
- package/build-module/menu-items-choice/index.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -6
- package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +0 -1
- package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/focal-point-settings-panel/index.native.js +2 -2
- package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/html-text-input/index.native.js.map +1 -1
- package/build-module/mobile/image/index.native.js +3 -2
- package/build-module/mobile/image/index.native.js.map +1 -1
- package/build-module/mobile/inserter-button/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +4 -3
- package/build-module/mobile/link-picker/index.native.js.map +1 -1
- package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
- package/build-module/mobile/media-edit/index.native.js.map +1 -1
- package/build-module/mobile/segmented-control/index.native.js +3 -4
- package/build-module/mobile/segmented-control/index.native.js.map +1 -1
- package/build-module/modal/index.js +20 -6
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigable-container/container.js +5 -2
- package/build-module/navigable-container/container.js.map +1 -1
- package/build-module/navigation/context.js +3 -5
- package/build-module/navigation/context.js.map +1 -1
- package/build-module/navigation/group/index.js +3 -6
- package/build-module/navigation/group/index.js.map +1 -1
- package/build-module/navigation/index.js +7 -2
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/item/base.js +5 -2
- package/build-module/navigation/item/base.js.map +1 -1
- package/build-module/navigation/item/index.js +3 -1
- package/build-module/navigation/item/index.js.map +1 -1
- package/build-module/navigation/item/use-navigation-tree-item.js +2 -1
- package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +1 -6
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/navigation/menu/search-no-results-found.js +1 -6
- package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
- package/build-module/navigation/use-navigation-tree-nodes.js +18 -9
- package/build-module/navigation/use-navigation-tree-nodes.js.map +1 -1
- package/build-module/navigation/utils.js +2 -2
- package/build-module/navigation/utils.js.map +1 -1
- package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +1 -1
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +1 -1
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/notice/index.js +2 -1
- package/build-module/notice/index.js.map +1 -1
- package/build-module/notice/list.js +4 -1
- package/build-module/notice/list.js.map +1 -1
- package/build-module/panel/body.js +3 -1
- package/build-module/panel/body.js.map +1 -1
- package/build-module/placeholder/index.js +24 -11
- package/build-module/placeholder/index.js.map +1 -1
- package/build-module/popover/index.js +4 -4
- package/build-module/popover/index.js.map +1 -1
- package/build-module/radio-control/index.js +40 -7
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/radio-control/types.js +2 -0
- package/build-module/radio-control/types.js.map +1 -0
- package/build-module/range-control/index.js +57 -41
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/input-range.js +7 -11
- package/build-module/range-control/input-range.js.map +1 -1
- package/build-module/range-control/mark.js +5 -6
- package/build-module/range-control/mark.js.map +1 -1
- package/build-module/range-control/rail.js +10 -15
- package/build-module/range-control/rail.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +62 -64
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/range-control/tooltip.js +5 -6
- package/build-module/range-control/tooltip.js.map +1 -1
- package/build-module/range-control/types.js +2 -0
- package/build-module/range-control/types.js.map +1 -0
- package/build-module/range-control/utils.js +24 -32
- package/build-module/range-control/utils.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js +2 -1
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.js +5 -11
- package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build-module/responsive-wrapper/index.js.map +1 -1
- package/build-module/scrollable/component.js +7 -8
- package/build-module/scrollable/component.js.map +1 -1
- package/build-module/scrollable/hook.js +0 -8
- package/build-module/scrollable/hook.js.map +1 -1
- package/build-module/scrollable/index.js.map +1 -1
- package/build-module/scrollable/styles.js +7 -7
- package/build-module/scrollable/styles.js.map +1 -1
- package/build-module/select-control/index.js +3 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/shortcut/index.js +2 -7
- package/build-module/shortcut/index.js.map +1 -1
- package/build-module/slot-fill/fill.js +1 -6
- package/build-module/slot-fill/fill.js.map +1 -1
- package/build-module/slot-fill/index.native.js +6 -7
- package/build-module/slot-fill/index.native.js.map +1 -1
- package/build-module/slot-fill/provider.js +4 -7
- package/build-module/slot-fill/provider.js.map +1 -1
- package/build-module/slot-fill/slot.js +15 -8
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/snackbar/index.js +3 -1
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +4 -1
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/spacer/component.js +3 -4
- package/build-module/spacer/component.js.map +1 -1
- package/build-module/spacer/hook.js +2 -2
- package/build-module/spacer/hook.js.map +1 -1
- package/build-module/spacer/index.js.map +1 -1
- package/build-module/spinner/index.js +22 -13
- package/build-module/spinner/index.js.map +1 -1
- package/build-module/spinner/styles.js +10 -10
- package/build-module/spinner/styles.js.map +1 -1
- package/build-module/tab-panel/index.js +3 -1
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/text/hook.js +4 -4
- package/build-module/text/hook.js.map +1 -1
- package/build-module/text/utils.js.map +1 -1
- package/build-module/text-highlight/index.js +23 -6
- package/build-module/text-highlight/index.js.map +1 -1
- package/build-module/text-highlight/types.js +2 -0
- package/build-module/text-highlight/types.js.map +1 -0
- package/build-module/tip/index.js +6 -10
- package/build-module/tip/index.js.map +1 -1
- package/build-module/tip/types.js +2 -0
- package/build-module/tip/types.js.map +1 -0
- package/build-module/toggle-control/index.js +1 -2
- package/build-module/toggle-control/index.js.map +1 -1
- package/build-module/toggle-control/index.native.js +1 -6
- package/build-module/toggle-control/index.native.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build-module/toolbar/index.js.map +1 -1
- package/build-module/toolbar-group/index.js +3 -2
- package/build-module/toolbar-group/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build-module/tooltip/index.js +2 -1
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build-module/tree-select/index.js +56 -6
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/tree-select/types.js +2 -0
- package/build-module/tree-select/types.js.map +1 -0
- package/build-module/truncate/component.js +7 -8
- package/build-module/truncate/component.js.map +1 -1
- package/build-module/truncate/hook.js +3 -10
- package/build-module/truncate/hook.js.map +1 -1
- package/build-module/truncate/index.js.map +1 -1
- package/build-module/truncate/styles.js +1 -1
- package/build-module/truncate/styles.js.map +1 -1
- package/build-module/truncate/utils.js +3 -16
- package/build-module/truncate/utils.js.map +1 -1
- package/build-module/ui/form-group/form-group-content.js.map +1 -1
- package/build-module/ui/utils/get-valid-children.js.map +1 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/utils/math.js +15 -6
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/unit-values.js.map +1 -1
- package/build-module/utils/values.js.map +1 -1
- package/build-module/v-stack/component.js +9 -9
- package/build-module/v-stack/component.js.map +1 -1
- package/build-module/v-stack/hook.js +0 -5
- package/build-module/v-stack/hook.js.map +1 -1
- package/build-module/v-stack/index.js.map +1 -1
- package/build-module/visually-hidden/component.js +12 -13
- package/build-module/visually-hidden/component.js.map +1 -1
- package/build-module/visually-hidden/index.js.map +1 -1
- package/build-module/visually-hidden/styles.js +3 -1
- package/build-module/visually-hidden/styles.js.map +1 -1
- package/build-module/visually-hidden/types.js +2 -0
- package/build-module/visually-hidden/types.js.map +1 -0
- package/build-module/z-stack/component.js +21 -2
- package/build-module/z-stack/component.js.map +1 -1
- package/build-module/z-stack/types.js +2 -0
- package/build-module/z-stack/types.js.map +1 -0
- package/build-style/style-rtl.css +61 -22
- package/build-style/style.css +61 -23
- package/build-types/base-control/stories/index.d.ts.map +1 -1
- package/build-types/base-field/hook.d.ts +0 -1
- package/build-types/base-field/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +0 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +0 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +0 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +0 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
- package/build-types/border-box-control/utils.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +36 -2
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +1 -2
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +0 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-style-picker/hook.d.ts +0 -1
- package/build-types/border-control/border-control-style-picker/hook.d.ts.map +1 -1
- package/build-types/border-control/stories/index.d.ts +33 -0
- package/build-types/border-control/stories/index.d.ts.map +1 -0
- package/build-types/button-group/index.d.ts +1 -1
- package/build-types/button-group/index.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +0 -1
- package/build-types/card/card/hook.d.ts.map +1 -1
- package/build-types/card/card-body/hook.d.ts +0 -1
- package/build-types/card/card-body/hook.d.ts.map +1 -1
- package/build-types/card/card-divider/hook.d.ts +0 -1
- package/build-types/card/card-divider/hook.d.ts.map +1 -1
- package/build-types/card/card-footer/hook.d.ts +0 -1
- package/build-types/card/card-footer/hook.d.ts.map +1 -1
- package/build-types/card/card-header/hook.d.ts +0 -1
- package/build-types/card/card-header/hook.d.ts.map +1 -1
- package/build-types/card/card-media/hook.d.ts +0 -1
- package/build-types/card/card-media/hook.d.ts.map +1 -1
- package/build-types/checkbox-control/index.d.ts.map +1 -1
- package/build-types/checkbox-control/stories/index.d.ts.map +1 -1
- package/build-types/color-indicator/index.d.ts +16 -5
- package/build-types/color-indicator/index.d.ts.map +1 -1
- package/build-types/color-indicator/stories/index.d.ts +12 -0
- package/build-types/color-indicator/stories/index.d.ts.map +1 -0
- package/build-types/color-indicator/test/index.d.ts +2 -0
- package/build-types/color-indicator/test/index.d.ts.map +1 -0
- package/build-types/color-indicator/types.d.ts +12 -0
- package/build-types/color-indicator/types.d.ts.map +1 -0
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +4 -2
- package/build-types/color-palette/styles.d.ts.map +1 -1
- package/build-types/color-picker/component.d.ts.map +1 -1
- package/build-types/color-picker/hex-input.d.ts.map +1 -1
- package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +48 -32
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
- package/build-types/confirm-dialog/component.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts +1 -1
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/date-time/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/stories/date-time.d.ts.map +1 -1
- package/build-types/date-time/stories/date.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts +1 -1
- package/build-types/date-time/types.d.ts +6 -0
- package/build-types/date-time/types.d.ts.map +1 -1
- package/build-types/divider/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu/index.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +0 -1
- package/build-types/elevation/hook.d.ts.map +1 -1
- package/build-types/external-link/index.d.ts +17 -0
- package/build-types/external-link/index.d.ts.map +1 -0
- package/build-types/external-link/stories/index.d.ts +12 -0
- package/build-types/external-link/stories/index.d.ts.map +1 -0
- package/build-types/external-link/styles/external-link-styles.d.ts +10 -0
- package/build-types/external-link/styles/external-link-styles.d.ts.map +1 -0
- package/build-types/external-link/types.d.ts +15 -0
- package/build-types/external-link/types.d.ts.map +1 -0
- package/build-types/flex/flex/hook.d.ts +0 -1
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/flex/flex-block/hook.d.ts +0 -1
- package/build-types/flex/flex-block/hook.d.ts.map +1 -1
- package/build-types/flex/flex-item/hook.d.ts +0 -1
- package/build-types/flex/flex-item/hook.d.ts.map +1 -1
- package/build-types/form-toggle/index.d.ts +29 -0
- package/build-types/form-toggle/index.d.ts.map +1 -0
- package/build-types/form-toggle/stories/index.d.ts +12 -0
- package/build-types/form-toggle/stories/index.d.ts.map +1 -0
- package/build-types/form-toggle/test/index.d.ts +2 -0
- package/build-types/form-toggle/test/index.d.ts.map +1 -0
- package/build-types/form-toggle/types.d.ts +22 -0
- package/build-types/form-toggle/types.d.ts.map +1 -0
- package/build-types/form-token-field/index.d.ts +15 -0
- package/build-types/form-token-field/index.d.ts.map +1 -0
- package/build-types/form-token-field/stories/index.d.ts +13 -0
- package/build-types/form-token-field/stories/index.d.ts.map +1 -0
- package/build-types/form-token-field/styles.d.ts +14 -0
- package/build-types/form-token-field/styles.d.ts.map +1 -0
- package/build-types/form-token-field/suggestions-list.d.ts +10 -0
- package/build-types/form-token-field/suggestions-list.d.ts.map +1 -0
- package/build-types/form-token-field/test/lib/fixtures.d.ts +26 -0
- package/build-types/form-token-field/test/lib/fixtures.d.ts.map +1 -0
- package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts +21 -0
- package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts.map +1 -0
- package/build-types/form-token-field/token-input.d.ts +12 -0
- package/build-types/form-token-field/token-input.d.ts.map +1 -0
- package/build-types/form-token-field/token.d.ts +4 -0
- package/build-types/form-token-field/token.d.ts.map +1 -0
- package/build-types/form-token-field/types.d.ts +183 -0
- package/build-types/form-token-field/types.d.ts.map +1 -0
- package/build-types/grid/component.d.ts +3 -3
- package/build-types/grid/component.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +5 -3
- package/build-types/grid/hook.d.ts.map +1 -1
- package/build-types/grid/index.d.ts +2 -2
- package/build-types/grid/index.d.ts.map +1 -1
- package/build-types/grid/stories/index.d.ts +9 -0
- package/build-types/grid/stories/index.d.ts.map +1 -0
- package/build-types/grid/test/grid.d.ts +2 -0
- package/build-types/grid/test/grid.d.ts.map +1 -0
- package/build-types/grid/types.d.ts +16 -15
- package/build-types/grid/types.d.ts.map +1 -1
- package/build-types/grid/utils.d.ts +50 -69
- package/build-types/grid/utils.d.ts.map +1 -1
- package/build-types/h-stack/component.d.ts +3 -2
- package/build-types/h-stack/component.d.ts.map +1 -1
- package/build-types/h-stack/hook.d.ts +5 -4
- package/build-types/h-stack/hook.d.ts.map +1 -1
- package/build-types/h-stack/index.d.ts +2 -2
- package/build-types/h-stack/index.d.ts.map +1 -1
- package/build-types/h-stack/stories/index.d.ts +9 -0
- package/build-types/h-stack/stories/index.d.ts.map +1 -0
- package/build-types/h-stack/test/index.d.ts +2 -0
- package/build-types/h-stack/test/index.d.ts.map +1 -0
- package/build-types/h-stack/utils.d.ts +8 -4
- package/build-types/h-stack/utils.d.ts.map +1 -1
- package/build-types/heading/component.d.ts +1 -2
- package/build-types/heading/component.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts +1 -29
- package/build-types/heading/hook.d.ts.map +1 -1
- package/build-types/heading/stories/index.d.ts.map +1 -1
- package/build-types/heading/test/index.d.ts +2 -0
- package/build-types/heading/test/index.d.ts.map +1 -0
- package/build-types/heading/types.d.ts +16 -0
- package/build-types/heading/types.d.ts.map +1 -0
- package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
- package/build-types/icon/index.d.ts +1 -1
- package/build-types/icon/index.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts +1 -1
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
- package/build-types/input-control/stories/index.d.ts +5 -5
- package/build-types/input-control/stories/index.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +0 -1
- package/build-types/item-group/item/hook.d.ts.map +1 -1
- package/build-types/item-group/item-group/hook.d.ts +0 -1
- package/build-types/item-group/item-group/hook.d.ts.map +1 -1
- package/build-types/menu-item/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +0 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +0 -1
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/radio-control/index.d.ts +31 -0
- package/build-types/radio-control/index.d.ts.map +1 -0
- package/build-types/radio-control/stories/index.d.ts +12 -0
- package/build-types/radio-control/stories/index.d.ts.map +1 -0
- package/build-types/radio-control/types.d.ts +29 -0
- package/build-types/radio-control/types.d.ts.map +1 -0
- package/build-types/range-control/index.d.ts +54 -29
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/input-range.d.ts +7 -10
- package/build-types/range-control/input-range.d.ts.map +1 -1
- package/build-types/range-control/mark.d.ts +4 -7
- package/build-types/range-control/mark.d.ts.map +1 -1
- package/build-types/range-control/rail.d.ts +4 -9
- package/build-types/range-control/rail.d.ts.map +1 -1
- package/build-types/range-control/stories/index.d.ts +48 -0
- package/build-types/range-control/stories/index.d.ts.map +1 -0
- package/build-types/range-control/styles/range-control-styles.d.ts +32 -40
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/range-control/test/index.d.ts +2 -0
- package/build-types/range-control/test/index.d.ts.map +1 -0
- package/build-types/range-control/tooltip.d.ts +4 -11
- package/build-types/range-control/tooltip.d.ts.map +1 -1
- package/build-types/range-control/types.d.ts +302 -0
- package/build-types/range-control/types.d.ts.map +1 -0
- package/build-types/range-control/utils.d.ts +15 -33
- package/build-types/range-control/utils.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
- package/build-types/scrollable/component.d.ts +3 -3
- package/build-types/scrollable/component.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts +5 -3
- package/build-types/scrollable/hook.d.ts.map +1 -1
- package/build-types/scrollable/index.d.ts +2 -2
- package/build-types/scrollable/index.d.ts.map +1 -1
- package/build-types/scrollable/stories/index.d.ts +9 -0
- package/build-types/scrollable/stories/index.d.ts.map +1 -0
- package/build-types/scrollable/styles.d.ts +7 -7
- package/build-types/scrollable/styles.d.ts.map +1 -1
- package/build-types/scrollable/test/index.d.ts +2 -0
- package/build-types/scrollable/test/index.d.ts.map +1 -0
- package/build-types/scrollable/types.d.ts +9 -6
- package/build-types/scrollable/types.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +1 -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/shortcut/index.d.ts.map +1 -1
- package/build-types/slot-fill/fill.d.ts.map +1 -1
- package/build-types/slot-fill/provider.d.ts.map +1 -1
- package/build-types/slot-fill/slot.d.ts.map +1 -1
- package/build-types/spacer/component.d.ts +3 -4
- package/build-types/spacer/component.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +2 -3
- package/build-types/spacer/hook.d.ts.map +1 -1
- package/build-types/spacer/index.d.ts +1 -1
- package/build-types/spacer/index.d.ts.map +1 -1
- package/build-types/spacer/stories/index.d.ts +12 -0
- package/build-types/spacer/stories/index.d.ts.map +1 -0
- package/build-types/spacer/test/index.d.ts +2 -0
- package/build-types/spacer/test/index.d.ts.map +1 -0
- package/build-types/spacer/types.d.ts +41 -29
- package/build-types/spacer/types.d.ts.map +1 -1
- package/build-types/spinner/index.d.ts +16 -15
- package/build-types/spinner/index.d.ts.map +1 -1
- package/build-types/spinner/stories/index.d.ts +13 -0
- package/build-types/spinner/stories/index.d.ts.map +1 -0
- package/build-types/spinner/styles.d.ts +4 -3
- package/build-types/spinner/styles.d.ts.map +1 -1
- package/build-types/surface/hook.d.ts +0 -1
- package/build-types/surface/hook.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +0 -1
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/text/types.d.ts +1 -1
- package/build-types/text/types.d.ts.map +1 -1
- package/build-types/text/utils.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts +1 -1
- package/build-types/text-control/index.d.ts.map +1 -1
- package/build-types/text-control/stories/index.d.ts.map +1 -1
- package/build-types/text-highlight/index.d.ts +23 -0
- package/build-types/text-highlight/index.d.ts.map +1 -0
- package/build-types/text-highlight/stories/index.d.ts +12 -0
- package/build-types/text-highlight/stories/index.d.ts.map +1 -0
- package/build-types/text-highlight/test/index.d.ts +2 -0
- package/build-types/text-highlight/test/index.d.ts.map +1 -0
- package/build-types/text-highlight/types.d.ts +17 -0
- package/build-types/text-highlight/types.d.ts.map +1 -0
- package/build-types/tip/index.d.ts +5 -14
- package/build-types/tip/index.d.ts.map +1 -1
- package/build-types/tip/stories/index.d.ts +12 -0
- package/build-types/tip/stories/index.d.ts.map +1 -0
- package/build-types/tip/types.d.ts +11 -0
- package/build-types/tip/types.d.ts.map +1 -0
- package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +0 -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 +0 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +0 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tree-select/index.d.ts +53 -0
- package/build-types/tree-select/index.d.ts.map +1 -0
- package/build-types/tree-select/stories/index.d.ts +12 -0
- package/build-types/tree-select/stories/index.d.ts.map +1 -0
- package/build-types/tree-select/types.d.ts +30 -0
- package/build-types/tree-select/types.d.ts.map +1 -0
- package/build-types/truncate/component.d.ts +3 -3
- package/build-types/truncate/component.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +5 -3
- package/build-types/truncate/hook.d.ts.map +1 -1
- package/build-types/truncate/index.d.ts +2 -2
- package/build-types/truncate/index.d.ts.map +1 -1
- package/build-types/truncate/stories/index.d.ts +13 -0
- package/build-types/truncate/stories/index.d.ts.map +1 -0
- package/build-types/truncate/styles.d.ts +1 -1
- package/build-types/truncate/styles.d.ts.map +1 -1
- package/build-types/truncate/test/index.d.ts +2 -0
- package/build-types/truncate/test/index.d.ts.map +1 -0
- package/build-types/truncate/types.d.ts +22 -11
- package/build-types/truncate/types.d.ts.map +1 -1
- package/build-types/truncate/utils.d.ts +17 -28
- package/build-types/truncate/utils.d.ts.map +1 -1
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
- package/build-types/ui/control-group/hook.d.ts +0 -1
- package/build-types/ui/control-group/hook.d.ts.map +1 -1
- package/build-types/ui/control-label/hook.d.ts +0 -1
- package/build-types/ui/control-label/hook.d.ts.map +1 -1
- package/build-types/ui/form-group/form-group.d.ts +1 -1
- package/build-types/ui/form-group/types.d.ts +1 -1
- package/build-types/ui/form-group/types.d.ts.map +1 -1
- package/build-types/ui/form-group/use-form-group.d.ts +5 -7
- package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
- package/build-types/ui/utils/get-valid-children.d.ts +2 -2
- package/build-types/ui/utils/get-valid-children.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/stories/index.d.ts.map +1 -1
- package/build-types/utils/math.d.ts +10 -0
- package/build-types/utils/math.d.ts.map +1 -1
- package/build-types/utils/unit-values.d.ts.map +1 -1
- package/build-types/utils/values.d.ts.map +1 -1
- package/build-types/v-stack/component.d.ts +5 -4
- package/build-types/v-stack/component.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +5 -4
- package/build-types/v-stack/hook.d.ts.map +1 -1
- package/build-types/v-stack/index.d.ts +2 -2
- package/build-types/v-stack/index.d.ts.map +1 -1
- package/build-types/v-stack/stories/index.d.ts +9 -0
- package/build-types/v-stack/stories/index.d.ts.map +1 -0
- package/build-types/v-stack/test/index.d.ts +2 -0
- package/build-types/v-stack/test/index.d.ts.map +1 -0
- package/build-types/v-stack/types.d.ts +21 -1
- package/build-types/v-stack/types.d.ts.map +1 -1
- package/build-types/visually-hidden/component.d.ts +8 -10
- package/build-types/visually-hidden/component.d.ts.map +1 -1
- package/build-types/visually-hidden/index.d.ts +1 -1
- package/build-types/visually-hidden/index.d.ts.map +1 -1
- package/build-types/visually-hidden/stories/index.d.ts +14 -0
- package/build-types/visually-hidden/stories/index.d.ts.map +1 -0
- package/build-types/visually-hidden/styles.d.ts +5 -2
- package/build-types/visually-hidden/styles.d.ts.map +1 -1
- package/build-types/visually-hidden/test/index.d.ts +2 -0
- package/build-types/visually-hidden/test/index.d.ts.map +1 -0
- package/build-types/visually-hidden/types.d.ts +11 -0
- package/build-types/visually-hidden/types.d.ts.map +1 -0
- package/build-types/z-stack/component.d.ts +18 -28
- package/build-types/z-stack/component.d.ts.map +1 -1
- package/build-types/z-stack/stories/index.d.ts +6 -0
- package/build-types/z-stack/stories/index.d.ts.map +1 -0
- package/build-types/z-stack/types.d.ts +33 -0
- package/build-types/z-stack/types.d.ts.map +1 -0
- package/package.json +18 -17
- package/src/alignment-matrix-control/index.js +2 -1
- package/src/alignment-matrix-control/utils.js +1 -6
- package/src/angle-picker-control/index.js +1 -1
- package/src/autocomplete/autocompleter-ui.js +4 -1
- package/src/autocomplete/autocompleter-ui.native.js +8 -2
- package/src/autocomplete/get-default-use-items.js +3 -2
- package/src/autocomplete/index.js +7 -10
- package/src/base-control/stories/index.tsx +2 -3
- package/src/border-box-control/border-box-control/component.tsx +1 -0
- package/src/border-box-control/border-box-control-linked-button/component.tsx +2 -5
- package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -0
- package/src/border-box-control/utils.ts +5 -2
- package/src/border-control/border-control/component.tsx +41 -4
- package/src/border-control/border-control/hook.ts +3 -4
- package/src/border-control/stories/index.tsx +150 -0
- package/src/box-control/all-input-control.js +2 -4
- package/src/box-control/axial-input-controls.js +4 -6
- package/src/box-control/index.js +3 -6
- package/src/box-control/input-controls.js +33 -36
- package/src/box-control/unit-control.js +2 -1
- package/src/box-control/utils.js +4 -4
- package/src/button/README.md +1 -1
- package/src/button/index.native.js +1 -2
- package/src/card/stories/index.js +10 -5
- package/src/checkbox-control/index.tsx +2 -3
- package/src/checkbox-control/stories/index.tsx +2 -3
- package/src/checkbox-control/test/index.tsx +2 -1
- package/src/color-indicator/README.md +7 -9
- package/src/color-indicator/index.tsx +47 -0
- package/src/color-indicator/stories/index.tsx +37 -0
- package/src/color-indicator/test/__snapshots__/index.tsx.snap +11 -0
- package/src/color-indicator/test/{index.js → index.tsx} +4 -4
- package/src/color-indicator/types.ts +12 -0
- package/src/color-palette/index.js +5 -1
- package/src/color-picker/component.tsx +12 -11
- package/src/color-picker/hex-input.tsx +3 -2
- package/src/color-picker/index.native.js +27 -31
- package/src/color-picker/input-with-slider.tsx +4 -2
- package/src/color-picker/styles.ts +20 -6
- package/src/color-picker/use-deprecated-props.ts +24 -43
- package/src/combobox-control/index.js +18 -8
- package/src/combobox-control/stories/index.js +3 -2
- package/src/combobox-control/style.scss +1 -1
- package/src/combobox-control/styles.ts +27 -0
- package/src/confirm-dialog/component.tsx +7 -8
- package/src/custom-gradient-bar/constants.js +2 -2
- package/src/custom-gradient-bar/control-points.js +20 -16
- package/src/custom-gradient-bar/index.js +11 -11
- package/src/custom-gradient-bar/test/utils.js +79 -0
- package/src/custom-gradient-bar/utils.js +6 -18
- package/src/custom-gradient-picker/index.js +4 -11
- package/src/custom-gradient-picker/index.native.js +3 -11
- package/src/custom-gradient-picker/serializer.js +5 -11
- package/src/custom-gradient-picker/style.scss +1 -3
- package/src/custom-gradient-picker/utils.js +4 -3
- package/src/custom-select-control/index.js +2 -1
- package/src/custom-select-control/stories/index.js +1 -2
- package/src/date-time/README.md +7 -0
- package/src/date-time/date/index.tsx +4 -2
- package/src/date-time/date/style.scss +10 -0
- package/src/date-time/date/test/index.tsx +1 -1
- package/src/date-time/date-time/index.tsx +8 -8
- package/src/date-time/stories/date-time.tsx +4 -6
- package/src/date-time/stories/date.tsx +2 -3
- package/src/date-time/time/test/index.tsx +12 -12
- package/src/date-time/types.ts +7 -0
- package/src/dimension-control/README.md +5 -2
- package/src/dimension-control/index.js +1 -2
- package/src/dimension-control/test/index.test.js +7 -7
- package/src/divider/styles.ts +2 -3
- package/src/draggable/index.js +3 -3
- package/src/draggable/index.native.js +12 -4
- package/src/drop-zone/provider.js +1 -2
- package/src/dropdown/index.js +2 -2
- package/src/dropdown-menu/index.js +13 -4
- package/src/dropdown-menu/index.native.js +13 -5
- package/src/duotone-picker/duotone-picker.js +58 -37
- package/src/duotone-picker/style.scss +19 -0
- package/src/elevation/hook.js +11 -11
- package/src/external-link/README.md +18 -0
- package/src/external-link/{index.js → index.tsx} +35 -9
- package/src/external-link/stories/index.tsx +36 -0
- package/src/external-link/styles/{external-link-styles.js → external-link-styles.ts} +0 -0
- package/src/external-link/types.ts +15 -0
- package/src/flex/flex/README.md +5 -10
- package/src/flex/flex/hook.js +4 -1
- package/src/flex/flex-item/README.md +1 -1
- package/src/focal-point-picker/controls.js +1 -5
- package/src/focal-point-picker/grid.js +2 -5
- package/src/focal-point-picker/index.js +2 -8
- package/src/focal-point-picker/index.native.js +9 -9
- package/src/focal-point-picker/media.js +2 -5
- package/src/focal-point-picker/tooltip/index.native.js +10 -11
- package/src/font-size-picker/index.js +3 -1
- package/src/form-toggle/README.md +10 -11
- package/src/form-toggle/index.tsx +71 -0
- package/src/form-toggle/stories/index.tsx +52 -0
- package/src/form-toggle/test/__snapshots__/index.tsx.snap +54 -0
- package/src/form-toggle/test/index.tsx +102 -0
- package/src/form-toggle/types.ts +22 -0
- package/src/form-token-field/index.tsx +715 -0
- package/src/form-token-field/stories/index.tsx +103 -0
- package/src/form-token-field/style.scss +4 -8
- package/src/form-token-field/styles.ts +32 -0
- package/src/form-token-field/{suggestions-list.js → suggestions-list.tsx} +43 -29
- package/src/form-token-field/test/index.js +70 -40
- package/src/form-token-field/test/lib/token-field-wrapper.tsx +71 -0
- package/src/form-token-field/token-input.tsx +76 -0
- package/src/form-token-field/{token.js → token.tsx} +4 -2
- package/src/form-token-field/types.ts +185 -0
- package/src/gradient-picker/index.js +4 -3
- package/src/grid/README.md +33 -19
- package/src/grid/{component.js → component.tsx} +13 -9
- package/src/grid/{hook.js → hook.ts} +5 -5
- package/src/grid/{index.js → index.ts} +0 -0
- package/src/grid/stories/index.tsx +72 -0
- package/src/grid/test/{grid.js → grid.tsx} +4 -4
- package/src/grid/types.ts +16 -17
- package/src/grid/{utils.js → utils.ts} +9 -7
- package/src/guide/style.scss +1 -0
- package/src/h-stack/{component.js → component.tsx} +8 -8
- package/src/h-stack/{hook.js → hook.tsx} +21 -16
- package/src/h-stack/{index.js → index.ts} +0 -0
- package/src/h-stack/stories/index.tsx +92 -0
- package/src/h-stack/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/h-stack/test/{index.js → index.tsx} +0 -0
- package/src/h-stack/{utils.js → utils.ts} +16 -16
- package/src/heading/README.md +4 -3
- package/src/heading/component.tsx +2 -2
- package/src/heading/hook.ts +6 -46
- package/src/heading/stories/index.tsx +5 -1
- package/src/heading/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/heading/test/index.tsx +68 -0
- package/src/heading/types.ts +29 -0
- package/src/higher-order/navigate-regions/README.md +4 -1
- package/src/higher-order/navigate-regions/index.js +7 -5
- package/src/higher-order/with-filters/test/index.js +43 -36
- package/src/higher-order/with-focus-return/index.js +14 -13
- package/src/higher-order/with-spoken-messages/index.js +8 -7
- package/src/higher-order/with-spoken-messages/test/index.js +1 -1
- package/src/icon/index.tsx +3 -3
- package/src/input-control/index.tsx +2 -1
- package/src/input-control/input-field.tsx +2 -1
- package/src/input-control/reducer/reducer.ts +23 -21
- package/src/input-control/test/index.js +106 -31
- package/src/input-control/utils.ts +1 -1
- package/src/item-group/stories/index.js +2 -1
- package/src/menu-item/index.js +1 -2
- package/src/menu-item/test/index.js +2 -1
- package/src/menu-items-choice/index.js +2 -5
- package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +2 -4
- package/src/mobile/bottom-sheet/cell.native.js +2 -3
- package/src/mobile/bottom-sheet/cycle-picker-cell.native.js +3 -5
- package/src/mobile/bottom-sheet/index.native.js +14 -17
- package/src/mobile/bottom-sheet/keyboard-avoiding-view.native.js +2 -7
- package/src/mobile/bottom-sheet/picker-cell.native.js +2 -7
- package/src/mobile/bottom-sheet/stepper-cell/index.native.js +4 -6
- package/src/mobile/color-settings/index.native.js +2 -4
- package/src/mobile/focal-point-settings-panel/index.native.js +2 -2
- package/src/mobile/global-styles-context/index.native.js +8 -7
- package/src/mobile/gradient/index.native.js +12 -9
- package/src/mobile/gradient/test/index.native.js +1 -3
- package/src/mobile/html-text-input/index.native.js +2 -3
- package/src/mobile/image/index.native.js +3 -2
- package/src/mobile/inserter-button/index.native.js +2 -6
- package/src/mobile/link-picker/index.native.js +2 -3
- package/src/mobile/link-settings/image-link-destinations-screen.native.js +6 -2
- package/src/mobile/media-edit/index.native.js +2 -3
- package/src/mobile/segmented-control/index.native.js +9 -9
- package/src/mobile/utils/test/index.native.js +3 -12
- package/src/modal/index.js +22 -3
- package/src/modal/stories/index.js +17 -1
- package/src/modal/style.scss +9 -18
- package/src/navigable-container/container.js +3 -2
- package/src/navigable-container/test/menu.js +1 -2
- package/src/navigable-container/test/tabbable.js +1 -2
- package/src/navigation/context.js +2 -5
- package/src/navigation/group/index.js +8 -3
- package/src/navigation/index.js +5 -1
- package/src/navigation/item/base.js +5 -3
- package/src/navigation/item/index.js +2 -1
- package/src/navigation/item/use-navigation-tree-item.js +2 -0
- package/src/navigation/menu/menu-title-search.js +3 -6
- package/src/navigation/menu/search-no-results-found.js +3 -6
- package/src/navigation/stories/controlled-state.js +1 -1
- package/src/navigation/stories/more-examples.js +2 -3
- package/src/navigation/test/index.js +252 -52
- package/src/navigation/use-navigation-tree-nodes.js +11 -10
- package/src/navigation/utils.js +2 -2
- package/src/navigator/navigator-back-button/hook.ts +14 -12
- package/src/navigator/navigator-button/hook.ts +14 -13
- package/src/navigator/navigator-provider/component.tsx +2 -6
- package/src/navigator/navigator-screen/component.tsx +3 -3
- package/src/notice/index.js +2 -1
- package/src/notice/list.js +3 -1
- package/src/number-control/stories/index.js +24 -24
- package/src/panel/body.js +2 -1
- package/src/placeholder/README.md +7 -6
- package/src/placeholder/index.js +27 -10
- package/src/placeholder/style.scss +23 -0
- package/src/popover/README.md +2 -2
- package/src/popover/index.js +7 -4
- package/src/radio-control/README.md +17 -23
- package/src/radio-control/index.tsx +107 -0
- package/src/radio-control/stories/index.tsx +72 -0
- package/src/radio-control/types.ts +32 -0
- package/src/range-control/README.md +107 -79
- package/src/range-control/{index.js → index.tsx} +81 -49
- package/src/range-control/{input-range.js → input-range.tsx} +13 -12
- package/src/range-control/{mark.js → mark.tsx} +15 -9
- package/src/range-control/{rail.js → rail.tsx} +40 -23
- package/src/range-control/stories/index.tsx +244 -0
- package/src/range-control/styles/{range-control-styles.js → range-control-styles.ts} +28 -24
- package/src/range-control/test/index.tsx +311 -0
- package/src/range-control/{tooltip.js → tooltip.tsx} +19 -14
- package/src/range-control/types.ts +326 -0
- package/src/range-control/utils.ts +132 -0
- package/src/resizable-box/resize-tooltip/index.tsx +2 -1
- package/src/resizable-box/resize-tooltip/utils.ts +3 -8
- package/src/responsive-wrapper/index.js +2 -4
- package/src/sandbox/test/index.js +4 -6
- package/src/scrollable/README.md +14 -8
- package/src/scrollable/{component.js → component.tsx} +13 -10
- package/src/scrollable/{hook.js → hook.ts} +5 -7
- package/src/scrollable/{index.js → index.ts} +0 -0
- package/src/scrollable/stories/{index.js → index.tsx} +29 -34
- package/src/scrollable/{styles.js → styles.ts} +0 -0
- package/src/scrollable/test/__snapshots__/{index.js.snap → index.tsx.snap} +1 -0
- package/src/scrollable/test/index.tsx +34 -0
- package/src/scrollable/types.ts +10 -5
- package/src/select-control/index.tsx +3 -1
- package/src/select-control/stories/index.tsx +3 -4
- package/src/select-control/test/select-control.tsx +22 -15
- package/src/shortcut/index.js +2 -7
- package/src/slot-fill/fill.js +1 -5
- package/src/slot-fill/index.native.js +2 -7
- package/src/slot-fill/provider.js +3 -7
- package/src/slot-fill/slot.js +31 -24
- package/src/slot-fill/test/slot.js +2 -3
- package/src/snackbar/index.js +1 -1
- package/src/snackbar/list.js +2 -1
- package/src/spacer/README.md +43 -37
- package/src/spacer/component.tsx +5 -6
- package/src/spacer/hook.ts +4 -2
- package/src/spacer/index.ts +1 -1
- package/src/spacer/stories/index.tsx +70 -0
- package/src/spacer/test/__snapshots__/{index.js.snap → index.tsx.snap} +1 -0
- package/src/spacer/test/index.tsx +149 -0
- package/src/spacer/types.ts +41 -29
- package/src/spinner/{index.js → index.tsx} +23 -9
- package/src/spinner/stories/index.tsx +32 -0
- package/src/spinner/{styles.js → styles.ts} +0 -0
- package/src/style.scss +1 -0
- package/src/tab-panel/README.md +1 -1
- package/src/tab-panel/index.js +3 -1
- package/src/text/hook.js +4 -1
- package/src/text/types.ts +1 -1
- package/src/text/utils.js +2 -3
- package/src/text-control/stories/index.tsx +4 -6
- package/src/text-highlight/README.md +6 -6
- package/src/text-highlight/index.tsx +49 -0
- package/src/text-highlight/stories/index.tsx +33 -0
- package/src/text-highlight/test/index.tsx +93 -0
- package/src/text-highlight/types.ts +16 -0
- package/src/tip/index.tsx +22 -0
- package/src/tip/stories/index.tsx +33 -0
- package/src/tip/types.ts +11 -0
- package/src/toggle-control/index.js +1 -2
- package/src/toggle-control/index.native.js +2 -6
- package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +2 -4
- package/src/toolbar/index.js +1 -2
- package/src/toolbar-group/index.js +1 -2
- package/src/tools-panel/tools-panel/hook.ts +2 -4
- package/src/tools-panel/tools-panel-header/hook.ts +2 -5
- package/src/tooltip/index.js +1 -0
- package/src/tree-grid/roving-tab-index-item.js +2 -4
- package/src/tree-grid/test/index.js +2 -3
- package/src/tree-select/README.md +2 -2
- package/src/tree-select/index.tsx +99 -0
- package/src/tree-select/stories/index.tsx +80 -0
- package/src/tree-select/types.ts +35 -0
- package/src/truncate/README.md +16 -12
- package/src/truncate/{component.js → component.tsx} +13 -9
- package/src/truncate/{hook.js → hook.ts} +8 -10
- package/src/truncate/{index.js → index.ts} +0 -0
- package/src/truncate/stories/index.tsx +49 -0
- package/src/truncate/{styles.js → styles.ts} +0 -0
- package/src/truncate/test/{index.js → index.tsx} +4 -4
- package/src/truncate/types.ts +28 -10
- package/src/truncate/{utils.js → utils.ts} +19 -19
- package/src/ui/context/wordpress-component.ts +4 -5
- package/src/ui/form-group/form-group-content.js +4 -4
- package/src/ui/form-group/types.ts +1 -1
- package/src/ui/utils/get-valid-children.ts +4 -2
- package/src/unit-control/index.tsx +7 -9
- package/src/unit-control/stories/index.tsx +8 -12
- package/src/unit-control/test/index.tsx +4 -7
- package/src/utils/hooks/stories/use-cx.js +8 -7
- package/src/utils/hooks/test/use-controlled-state.js +2 -1
- package/src/utils/math.js +14 -5
- package/src/utils/test/math.js +22 -1
- package/src/utils/unit-values.ts +2 -1
- package/src/utils/values.js +2 -3
- package/src/v-stack/README.md +6 -18
- package/src/v-stack/{component.js → component.tsx} +15 -10
- package/src/v-stack/{hook.js → hook.ts} +5 -6
- package/src/v-stack/{index.js → index.ts} +0 -0
- package/src/v-stack/stories/index.tsx +41 -0
- package/src/v-stack/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/v-stack/test/{index.js → index.tsx} +0 -0
- package/src/v-stack/types.ts +21 -1
- package/src/visually-hidden/{component.js → component.tsx} +23 -15
- package/src/visually-hidden/{index.js → index.ts} +0 -0
- package/src/visually-hidden/stories/index.tsx +66 -0
- package/src/visually-hidden/{styles.js → styles.ts} +6 -2
- package/src/visually-hidden/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/visually-hidden/test/index.tsx +17 -0
- package/src/visually-hidden/types.ts +11 -0
- package/src/z-stack/README.md +14 -3
- package/src/z-stack/component.tsx +24 -29
- package/src/z-stack/stories/index.tsx +76 -0
- package/src/z-stack/types.ts +33 -0
- package/tsconfig.json +7 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/src/border-control/stories/index.js +0 -119
- package/src/color-indicator/index.js +0 -16
- package/src/color-indicator/stories/index.js +0 -22
- package/src/color-indicator/test/__snapshots__/index.js.snap +0 -13
- package/src/external-link/stories/index.js +0 -23
- package/src/form-toggle/index.js +0 -37
- package/src/form-toggle/stories/index.js +0 -28
- package/src/form-toggle/test/index.js +0 -75
- package/src/form-token-field/index.js +0 -725
- package/src/form-token-field/stories/index.js +0 -102
- package/src/form-token-field/test/lib/token-field-wrapper.js +0 -56
- package/src/form-token-field/token-input.js +0 -81
- package/src/grid/stories/index.js +0 -49
- package/src/h-stack/stories/index.js +0 -22
- package/src/heading/test/index.js +0 -67
- package/src/radio-control/index.js +0 -69
- package/src/radio-control/stories/index.js +0 -41
- package/src/range-control/stories/index.js +0 -180
- package/src/range-control/test/index.js +0 -320
- package/src/range-control/utils.js +0 -132
- package/src/scrollable/test/index.js +0 -31
- package/src/spacer/stories/index.js +0 -59
- package/src/spacer/test/index.js +0 -146
- package/src/spinner/stories/index.js +0 -43
- package/src/text-highlight/index.js +0 -28
- package/src/text-highlight/stories/index.js +0 -28
- package/src/text-highlight/test/index.js +0 -120
- package/src/tip/index.js +0 -24
- package/src/tip/stories/index.js +0 -26
- package/src/tree-select/index.js +0 -48
- package/src/tree-select/stories/index.js +0 -80
- package/src/truncate/stories/index.js +0 -38
- package/src/visually-hidden/stories/index.js +0 -42
- package/src/visually-hidden/test/index.js +0 -19
- package/src/z-stack/stories/index.js +0 -70
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/autocomplete/get-default-use-items.js"],"names":["filterOptions","search","options","maxResults","filtered","i","length","option","keywords","label","isMatch","some","keyword","test","push","getDefaultUseItems","autocompleter","filterValue","items","setItems","isDebounced","loadOptions","promise","Promise","resolve","then","optionsData","canceled","keyedOptions","map","optionData","optionIndex","key","name","value","getOptionLabel","getOptionKeywords","isDisabled","isOptionDisabled","RegExp","cancel"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/autocomplete/get-default-use-items.js"],"names":["filterOptions","search","options","maxResults","filtered","i","length","option","keywords","label","isMatch","some","keyword","test","push","getDefaultUseItems","autocompleter","filterValue","items","setItems","isDebounced","loadOptions","promise","Promise","resolve","then","optionsData","canceled","keyedOptions","map","optionData","optionIndex","key","name","value","getOptionLabel","getOptionKeywords","isDisabled","isOptionDisabled","RegExp","cancel"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,SAASA,aAAT,CAAwBC,MAAxB,EAAgE;AAAA,MAAhCC,OAAgC,uEAAtB,EAAsB;AAAA,MAAlBC,UAAkB,uEAAL,EAAK;AAC/D,QAAMC,QAAQ,GAAG,EAAjB;;AACA,OAAM,IAAIC,CAAC,GAAG,CAAd,EAAiBA,CAAC,GAAGH,OAAO,CAACI,MAA7B,EAAqCD,CAAC,EAAtC,EAA2C;AAC1C,UAAME,MAAM,GAAGL,OAAO,CAAEG,CAAF,CAAtB,CAD0C,CAG1C;;AACA,QAAI;AAAEG,MAAAA,QAAQ,GAAG;AAAb,QAAoBD,MAAxB;;AACA,QAAK,aAAa,OAAOA,MAAM,CAACE,KAAhC,EAAwC;AACvCD,MAAAA,QAAQ,GAAG,CAAE,GAAGA,QAAL,EAAeD,MAAM,CAACE,KAAtB,CAAX;AACA;;AAED,UAAMC,OAAO,GAAGF,QAAQ,CAACG,IAAT,CAAiBC,OAAF,IAC9BX,MAAM,CAACY,IAAP,CAAa,4BAAeD,OAAf,CAAb,CADe,CAAhB;;AAGA,QAAK,CAAEF,OAAP,EAAiB;AAChB;AACA;;AAEDN,IAAAA,QAAQ,CAACU,IAAT,CAAeP,MAAf,EAhB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CAAf;AAIAE,UAAAA,QAAQ,CAAEnB,aAAa,CAAEC,MAAF,EAAU2B,YAAV,CAAf,CAAR;AACA,SAlCe,CAAhB;AAoCA,eAAON,OAAP;AACA,OAvCkB,EAwCnBF,WAAW,GAAG,GAAH,GAAS,CAxCD,CAApB;AA2CA,YAAME,OAAO,GAAGD,WAAW,EAA3B;AAEA,aAAO,MAAM;AACZA,QAAAA,WAAW,CAACmB,MAAZ;;AACA,YAAKlB,OAAL,EAAe;AACdA,UAAAA,OAAO,CAACK,QAAR,GAAmB,IAAnB;AACA;AACD,OALD;AAMA,KArDD,EAqDG,CAAEV,WAAF,CArDH;AAuDA,WAAO,CAAEC,KAAF,CAAP;AACA,GArED;AAsEA","sourcesContent":["/**\n * External dependencies\n */\nimport { debounce, escapeRegExp } from 'lodash';\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport { useLayoutEffect, useState } from '@wordpress/element';\n\nfunction filterOptions( search, options = [], maxResults = 10 ) {\n\tconst filtered = [];\n\tfor ( let i = 0; i < options.length; i++ ) {\n\t\tconst option = options[ i ];\n\n\t\t// Merge label into keywords.\n\t\tlet { keywords = [] } = option;\n\t\tif ( 'string' === typeof option.label ) {\n\t\t\tkeywords = [ ...keywords, option.label ];\n\t\t}\n\n\t\tconst isMatch = keywords.some( ( keyword ) =>\n\t\t\tsearch.test( removeAccents( keyword ) )\n\t\t);\n\t\tif ( ! isMatch ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tfiltered.push( option );\n\n\t\t// Abort early if max reached.\n\t\tif ( filtered.length === maxResults ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn filtered;\n}\n\nexport default function getDefaultUseItems( autocompleter ) {\n\treturn ( filterValue ) => {\n\t\tconst [ items, setItems ] = useState( [] );\n\t\t/*\n\t\t * We support both synchronous and asynchronous retrieval of completer options\n\t\t * but internally treat all as async so we maintain a single, consistent code path.\n\t\t *\n\t\t * Because networks can be slow, and the internet is wonderfully unpredictable,\n\t\t * we don't want two promises updating the state at once. This ensures that only\n\t\t * the most recent promise will act on `optionsData`. This doesn't use the state\n\t\t * because `setState` is batched, and so there's no guarantee that setting\n\t\t * `activePromise` in the state would result in it actually being in `this.state`\n\t\t * before the promise resolves and we check to see if this is the active promise or not.\n\t\t */\n\t\tuseLayoutEffect( () => {\n\t\t\tconst { options, isDebounced } = autocompleter;\n\t\t\tconst loadOptions = debounce(\n\t\t\t\t() => {\n\t\t\t\t\tconst promise = Promise.resolve(\n\t\t\t\t\t\ttypeof options === 'function'\n\t\t\t\t\t\t\t? options( filterValue )\n\t\t\t\t\t\t\t: options\n\t\t\t\t\t).then( ( optionsData ) => {\n\t\t\t\t\t\tif ( promise.canceled ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst keyedOptions = optionsData.map(\n\t\t\t\t\t\t\t( optionData, optionIndex ) => ( {\n\t\t\t\t\t\t\t\tkey: `${ autocompleter.name }-${ optionIndex }`,\n\t\t\t\t\t\t\t\tvalue: optionData,\n\t\t\t\t\t\t\t\tlabel: autocompleter.getOptionLabel(\n\t\t\t\t\t\t\t\t\toptionData\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tkeywords: autocompleter.getOptionKeywords\n\t\t\t\t\t\t\t\t\t? autocompleter.getOptionKeywords(\n\t\t\t\t\t\t\t\t\t\t\toptionData\n\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\tisDisabled: autocompleter.isOptionDisabled\n\t\t\t\t\t\t\t\t\t? autocompleter.isOptionDisabled(\n\t\t\t\t\t\t\t\t\t\t\toptionData\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: false,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Create a regular expression to filter the options.\n\t\t\t\t\t\tconst search = new RegExp(\n\t\t\t\t\t\t\t'(?:\\\\b|\\\\s|^)' + escapeRegExp( filterValue ),\n\t\t\t\t\t\t\t'i'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tsetItems( filterOptions( search, keyedOptions ) );\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn promise;\n\t\t\t\t},\n\t\t\t\tisDebounced ? 250 : 0\n\t\t\t);\n\n\t\t\tconst promise = loadOptions();\n\n\t\t\treturn () => {\n\t\t\t\tloadOptions.cancel();\n\t\t\t\tif ( promise ) {\n\t\t\t\t\tpromise.canceled = true;\n\t\t\t\t}\n\t\t\t};\n\t\t}, [ filterValue ] );\n\n\t\treturn [ items ];\n\t};\n}\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -10,6 +12,8 @@ var _element = require("@wordpress/element");
|
|
|
10
12
|
|
|
11
13
|
var _lodash = require("lodash");
|
|
12
14
|
|
|
15
|
+
var _removeAccents = _interopRequireDefault(require("remove-accents"));
|
|
16
|
+
|
|
13
17
|
var _keycodes = require("@wordpress/keycodes");
|
|
14
18
|
|
|
15
19
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -265,7 +269,7 @@ function useAutocomplete(_ref) {
|
|
|
265
269
|
return;
|
|
266
270
|
}
|
|
267
271
|
|
|
268
|
-
const text = (0,
|
|
272
|
+
const text = (0, _removeAccents.default)(textContent);
|
|
269
273
|
const textAfterSelection = (0, _richText.getTextContent)((0, _richText.slice)(record, undefined, (0, _richText.getTextContent)(record).length));
|
|
270
274
|
const completer = (0, _lodash.find)(completers, _ref2 => {
|
|
271
275
|
let {
|
|
@@ -333,8 +337,10 @@ function useAutocomplete(_ref) {
|
|
|
333
337
|
const query = match && match[1];
|
|
334
338
|
setAutocompleter(completer);
|
|
335
339
|
setAutocompleterUI(() => completer !== autocompleter ? (0, _autocompleterUi.getAutoCompleterUI)(completer) : AutocompleterUI);
|
|
336
|
-
setFilterValue(query);
|
|
337
|
-
|
|
340
|
+
setFilterValue(query); // Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.
|
|
341
|
+
// See https://github.com/WordPress/gutenberg/pull/41820
|
|
342
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
343
|
+
}, [textContent]);
|
|
338
344
|
const {
|
|
339
345
|
key: selectedKey = ''
|
|
340
346
|
} = filteredOptions[selectedIndex] || {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/autocomplete/index.js"],"names":["useAutocomplete","record","onChange","onReplace","completers","contentRef","debouncedSpeak","speak","instanceId","selectedIndex","setSelectedIndex","filteredOptions","setFilteredOptions","filterValue","setFilterValue","autocompleter","setAutocompleter","AutocompleterUI","setAutocompleterUI","backspacing","insertCompletion","replacement","end","start","triggerPrefix","length","toInsert","html","select","option","getOptionCompletion","isDisabled","completion","value","action","undefined","reset","announce","options","onChangeOptions","handleKeyDown","event","current","keyCode","BACKSPACE","defaultPrevented","UP","DOWN","ESCAPE","preventDefault","ENTER","LEFT","RIGHT","textContent","text","textAfterSelection","completer","allowContext","index","lastIndexOf","textWithoutTrigger","slice","tooDistantFromTrigger","mismatch","wordsFromTrigger","split","hasOneTriggerWord","matchingWhileBackspacing","test","safeTrigger","match","RegExp","query","key","selectedKey","className","isExpanded","listBoxId","activeId","hasSelection","onKeyDown","popover","useAutocompleteProps","ref","onKeyDownRef","element","_onKeyDown","addEventListener","removeEventListener","children","Autocomplete","isSelected","props"],"mappings":";;;;;;;;AAQA;;AALA;;AAYA;;AASA;;AACA;;AAMA;;AAOA;;AAKA;;AA3CA;AACA;AACA;;AAGA;AACA;AACA;;AAiCA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;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;AACA,QAAMC,YAAY,GAAG,sBAArB;AACA,QAAM;AAAEH,IAAAA,OAAF;AAAWJ,IAAAA,SAAX;AAAsBC,IAAAA,QAAtB;AAAgCE,IAAAA;AAAhC,MAA8ChF,eAAe,CAAE,EACpE,GAAGsC,OADiE;AAEpEjC,IAAAA,UAAU,EAAE8E;AAFwD,GAAF,CAAnE;AAIAC,EAAAA,YAAY,CAAC1C,OAAb,GAAuBsC,SAAvB;AACA,SAAO;AACNG,IAAAA,GAAG,EAAE,2BAAc,CAClBA,GADkB,EAElB,2BAAgBE,OAAF,IAAe;AAC5B,eAASC,UAAT,CAAqB7C,KAArB,EAA6B;AAC5B2C,QAAAA,YAAY,CAAC1C,OAAb,CAAsBD,KAAtB;AACA;;AACD4C,MAAAA,OAAO,CAACE,gBAAR,CAA0B,SAA1B,EAAqCD,UAArC;AACA,aAAO,MAAM;AACZD,QAAAA,OAAO,CAACG,mBAAR,CAA6B,SAA7B,EAAwCF,UAAxC;AACA,OAFD;AAGA,KARD,EAQG,EARH,CAFkB,CAAd,CADC;AAaNG,IAAAA,QAAQ,EAAER,OAbJ;AAcN,yBAAqBJ,SAAS,GAAG,MAAH,GAAY1C,SAdpC;AAeN,iBAAa0C,SAfP;AAgBN,6BAAyBC;AAhBnB,GAAP;AAkBA;;AAEc,SAASY,YAAT,QAA8D;AAAA,MAAvC;AAAED,IAAAA,QAAF;AAAYE,IAAAA,UAAZ;AAAwB,OAAGrD;AAA3B,GAAuC;AAC5E,QAAM;AAAE2C,IAAAA,OAAF;AAAW,OAAGW;AAAd,MAAwB5F,eAAe,CAAEsC,OAAF,CAA7C;AACA,SACC,qDACGmD,QAAQ,CAAEG,KAAF,CADX,EAEGD,UAAU,IAAIV,OAFjB,CADD;AAMA","sourcesContent":["/**\n * External dependencies\n */\nimport { escapeRegExp, find, deburr } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseEffect,\n\tuseState,\n\tuseRef,\n\tuseMemo,\n} from '@wordpress/element';\nimport {\n\tENTER,\n\tESCAPE,\n\tUP,\n\tDOWN,\n\tLEFT,\n\tRIGHT,\n\tBACKSPACE,\n} from '@wordpress/keycodes';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tuseInstanceId,\n\tuseDebounce,\n\tuseMergeRefs,\n\tuseRefEffect,\n} from '@wordpress/compose';\nimport {\n\tcreate,\n\tslice,\n\tinsert,\n\tisCollapsed,\n\tgetTextContent,\n} from '@wordpress/rich-text';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { getAutoCompleterUI } from './autocompleter-ui';\n\n/**\n * A raw completer option.\n *\n * @typedef {*} CompleterOption\n */\n\n/**\n * @callback FnGetOptions\n *\n * @return {(CompleterOption[]|Promise.<CompleterOption[]>)} The completer options or a promise for them.\n */\n\n/**\n * @callback FnGetOptionKeywords\n * @param {CompleterOption} option a completer option.\n *\n * @return {string[]} list of key words to search.\n */\n\n/**\n * @callback FnIsOptionDisabled\n * @param {CompleterOption} option a completer option.\n *\n * @return {string[]} whether or not the given option is disabled.\n */\n\n/**\n * @callback FnGetOptionLabel\n * @param {CompleterOption} option a completer option.\n *\n * @return {(string|Array.<(string|WPElement)>)} list of react components to render.\n */\n\n/**\n * @callback FnAllowContext\n * @param {string} before the string before the auto complete trigger and query.\n * @param {string} after the string after the autocomplete trigger and query.\n *\n * @return {boolean} true if the completer can handle.\n */\n\n/**\n * @typedef {Object} OptionCompletion\n * @property {'insert-at-caret'|'replace'} action the intended placement of the completion.\n * @property {OptionCompletionValue} value the completion value.\n */\n\n/**\n * A completion value.\n *\n * @typedef {(string|WPElement|Object)} OptionCompletionValue\n */\n\n/**\n * @callback FnGetOptionCompletion\n * @param {CompleterOption} value the value of the completer option.\n * @param {string} query the text value of the autocomplete query.\n *\n * @return {(OptionCompletion|OptionCompletionValue)} the completion for the given option. If an\n * \t\t\t\t\t\t\t\t\t\t\t\t\t OptionCompletionValue is returned, the\n * \t\t\t\t\t\t\t\t\t\t\t\t\t completion action defaults to `insert-at-caret`.\n */\n\n/**\n * @typedef {Object} WPCompleter\n * @property {string} name a way to identify a completer, useful for selective overriding.\n * @property {?string} className A class to apply to the popup menu.\n * @property {string} triggerPrefix the prefix that will display the menu.\n * @property {(CompleterOption[]|FnGetOptions)} options the completer options or a function to get them.\n * @property {?FnGetOptionKeywords} getOptionKeywords get the keywords for a given option.\n * @property {?FnIsOptionDisabled} isOptionDisabled get whether or not the given option is disabled.\n * @property {FnGetOptionLabel} getOptionLabel get the label for a given option.\n * @property {?FnAllowContext} allowContext filter the context under which the autocomplete activates.\n * @property {FnGetOptionCompletion} getOptionCompletion get the completion associated with a given option.\n */\n\nfunction useAutocomplete( {\n\trecord,\n\tonChange,\n\tonReplace,\n\tcompleters,\n\tcontentRef,\n} ) {\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst instanceId = useInstanceId( useAutocomplete );\n\tconst [ selectedIndex, setSelectedIndex ] = useState( 0 );\n\tconst [ filteredOptions, setFilteredOptions ] = useState( [] );\n\tconst [ filterValue, setFilterValue ] = useState( '' );\n\tconst [ autocompleter, setAutocompleter ] = useState( null );\n\tconst [ AutocompleterUI, setAutocompleterUI ] = useState( null );\n\tconst backspacing = useRef( false );\n\n\tfunction insertCompletion( replacement ) {\n\t\tconst end = record.start;\n\t\tconst start =\n\t\t\tend - autocompleter.triggerPrefix.length - filterValue.length;\n\t\tconst toInsert = create( { html: renderToString( replacement ) } );\n\n\t\tonChange( insert( record, toInsert, start, end ) );\n\t}\n\n\tfunction select( option ) {\n\t\tconst { getOptionCompletion } = autocompleter || {};\n\n\t\tif ( option.isDisabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( getOptionCompletion ) {\n\t\t\tconst completion = getOptionCompletion( option.value, filterValue );\n\n\t\t\tconst { action, value } =\n\t\t\t\tundefined === completion.action ||\n\t\t\t\tundefined === completion.value\n\t\t\t\t\t? { action: 'insert-at-caret', value: completion }\n\t\t\t\t\t: completion;\n\n\t\t\tif ( 'replace' === action ) {\n\t\t\t\tonReplace( [ value ] );\n\t\t\t\t// When replacing, the component will unmount, so don't reset\n\t\t\t\t// state (below) on an unmounted component.\n\t\t\t\treturn;\n\t\t\t} else if ( 'insert-at-caret' === action ) {\n\t\t\t\tinsertCompletion( value );\n\t\t\t}\n\t\t}\n\n\t\t// Reset autocomplete state after insertion rather than before\n\t\t// so insertion events don't cause the completion menu to redisplay.\n\t\treset();\n\t}\n\n\tfunction reset() {\n\t\tsetSelectedIndex( 0 );\n\t\tsetFilteredOptions( [] );\n\t\tsetFilterValue( '' );\n\t\tsetAutocompleter( null );\n\t\tsetAutocompleterUI( null );\n\t}\n\n\tfunction announce( options ) {\n\t\tif ( ! debouncedSpeak ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( !! options.length ) {\n\t\t\tdebouncedSpeak(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\toptions.length\n\t\t\t\t\t),\n\t\t\t\t\toptions.length\n\t\t\t\t),\n\t\t\t\t'assertive'\n\t\t\t);\n\t\t} else {\n\t\t\tdebouncedSpeak( __( 'No results.' ), 'assertive' );\n\t\t}\n\t}\n\n\t/**\n\t * Load options for an autocompleter.\n\t *\n\t * @param {Array} options\n\t */\n\tfunction onChangeOptions( options ) {\n\t\tsetSelectedIndex(\n\t\t\toptions.length === filteredOptions.length ? selectedIndex : 0\n\t\t);\n\t\tsetFilteredOptions( options );\n\t\tannounce( options );\n\t}\n\n\tfunction handleKeyDown( event ) {\n\t\tbackspacing.current = event.keyCode === BACKSPACE;\n\n\t\tif ( ! autocompleter ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( filteredOptions.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\t\tswitch ( event.keyCode ) {\n\t\t\tcase UP:\n\t\t\t\tsetSelectedIndex(\n\t\t\t\t\t( selectedIndex === 0\n\t\t\t\t\t\t? filteredOptions.length\n\t\t\t\t\t\t: selectedIndex ) - 1\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase DOWN:\n\t\t\t\tsetSelectedIndex(\n\t\t\t\t\t( selectedIndex + 1 ) % filteredOptions.length\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase ESCAPE:\n\t\t\t\tsetAutocompleter( null );\n\t\t\t\tsetAutocompleterUI( null );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tbreak;\n\n\t\t\tcase ENTER:\n\t\t\t\tselect( filteredOptions[ selectedIndex ] );\n\t\t\t\tbreak;\n\n\t\t\tcase LEFT:\n\t\t\tcase RIGHT:\n\t\t\t\treset();\n\t\t\t\treturn;\n\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\t// Any handled keycode should prevent original behavior. This relies on\n\t\t// the early return in the default case.\n\t\tevent.preventDefault();\n\t}\n\n\t// textContent is a primitive (string), memoizing is not strictly necessary\n\t// but this is a preemptive performance improvement, since the autocompleter\n\t// is a potential bottleneck for the editor type metric.\n\tconst textContent = useMemo( () => {\n\t\tif ( isCollapsed( record ) ) {\n\t\t\treturn getTextContent( slice( record, 0 ) );\n\t\t}\n\t}, [ record ] );\n\n\tuseEffect( () => {\n\t\tif ( ! textContent ) {\n\t\t\treset();\n\t\t\treturn;\n\t\t}\n\n\t\tconst text = deburr( textContent );\n\t\tconst textAfterSelection = getTextContent(\n\t\t\tslice( record, undefined, getTextContent( record ).length )\n\t\t);\n\t\tconst completer = find(\n\t\t\tcompleters,\n\t\t\t( { triggerPrefix, allowContext } ) => {\n\t\t\t\tconst index = text.lastIndexOf( triggerPrefix );\n\n\t\t\t\tif ( index === -1 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst textWithoutTrigger = text.slice(\n\t\t\t\t\tindex + triggerPrefix.length\n\t\t\t\t);\n\n\t\t\t\tconst tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit.\n\t\t\t\t// This is a final barrier to prevent the effect from completing with\n\t\t\t\t// an extremely long string, which causes the editor to slow-down\n\t\t\t\t// significantly. This could happen, for example, if `matchingWhileBackspacing`\n\t\t\t\t// is true and one of the \"words\" end up being too long. If that's the case,\n\t\t\t\t// it will be caught by this guard.\n\t\t\t\tif ( tooDistantFromTrigger ) return false;\n\n\t\t\t\tconst mismatch = filteredOptions.length === 0;\n\t\t\t\tconst wordsFromTrigger = textWithoutTrigger.split( /\\s/ );\n\t\t\t\t// We need to allow the effect to run when not backspacing and if there\n\t\t\t\t// was a mismatch. i.e when typing a trigger + the match string or when\n\t\t\t\t// clicking in an existing trigger word on the page. We do that if we\n\t\t\t\t// detect that we have one word from trigger in the current textual context.\n\t\t\t\t//\n\t\t\t\t// Ex.: \"Some text @a\" <-- \"@a\" will be detected as the trigger word and\n\t\t\t\t// allow the effect to run. It will run until there's a mismatch.\n\t\t\t\tconst hasOneTriggerWord = wordsFromTrigger.length === 1;\n\t\t\t\t// This is used to allow the effect to run when backspacing and if\n\t\t\t\t// \"touching\" a word that \"belongs\" to a trigger. We consider a \"trigger\n\t\t\t\t// word\" any word up to the limit of 3 from the trigger character.\n\t\t\t\t// Anything beyond that is ignored if there's a mismatch. This allows\n\t\t\t\t// us to \"escape\" a mismatch when backspacing, but still imposing some\n\t\t\t\t// sane limits.\n\t\t\t\t//\n\t\t\t\t// Ex: \"Some text @marcelo sekkkk\" <--- \"kkkk\" caused a mismatch, but\n\t\t\t\t// if the user presses backspace here, it will show the completion popup again.\n\t\t\t\tconst matchingWhileBackspacing =\n\t\t\t\t\tbackspacing.current &&\n\t\t\t\t\ttextWithoutTrigger.split( /\\s/ ).length <= 3;\n\n\t\t\t\tif (\n\t\t\t\t\tmismatch &&\n\t\t\t\t\t! ( matchingWhileBackspacing || hasOneTriggerWord )\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tallowContext &&\n\t\t\t\t\t! allowContext( text.slice( 0, index ), textAfterSelection )\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t/^\\s/.test( textWithoutTrigger ) ||\n\t\t\t\t\t/\\s\\s+$/.test( textWithoutTrigger )\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn /[\\u0000-\\uFFFF]*$/.test( textWithoutTrigger );\n\t\t\t}\n\t\t);\n\n\t\tif ( ! completer ) {\n\t\t\treset();\n\t\t\treturn;\n\t\t}\n\n\t\tconst safeTrigger = escapeRegExp( completer.triggerPrefix );\n\t\tconst match = text\n\t\t\t.slice( text.lastIndexOf( completer.triggerPrefix ) )\n\t\t\t.match( new RegExp( `${ safeTrigger }([\\u0000-\\uFFFF]*)$` ) );\n\t\tconst query = match && match[ 1 ];\n\n\t\tsetAutocompleter( completer );\n\t\tsetAutocompleterUI( () =>\n\t\t\tcompleter !== autocompleter\n\t\t\t\t? getAutoCompleterUI( completer )\n\t\t\t\t: AutocompleterUI\n\t\t);\n\t\tsetFilterValue( query );\n\t}, [\n\t\ttextContent,\n\t\tAutocompleterUI,\n\t\tautocompleter,\n\t\tcompleters,\n\t\trecord,\n\t\tfilteredOptions.length,\n\t] );\n\n\tconst { key: selectedKey = '' } = filteredOptions[ selectedIndex ] || {};\n\tconst { className } = autocompleter || {};\n\tconst isExpanded = !! autocompleter && filteredOptions.length > 0;\n\tconst listBoxId = isExpanded\n\t\t? `components-autocomplete-listbox-${ instanceId }`\n\t\t: null;\n\tconst activeId = isExpanded\n\t\t? `components-autocomplete-item-${ instanceId }-${ selectedKey }`\n\t\t: null;\n\tconst hasSelection = record.start !== undefined;\n\n\treturn {\n\t\tlistBoxId,\n\t\tactiveId,\n\t\tonKeyDown: handleKeyDown,\n\t\tpopover: hasSelection && AutocompleterUI && (\n\t\t\t<AutocompleterUI\n\t\t\t\tclassName={ className }\n\t\t\t\tfilterValue={ filterValue }\n\t\t\t\tinstanceId={ instanceId }\n\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\tonChangeOptions={ onChangeOptions }\n\t\t\t\tonSelect={ select }\n\t\t\t\tvalue={ record }\n\t\t\t\tcontentRef={ contentRef }\n\t\t\t\treset={ reset }\n\t\t\t/>\n\t\t),\n\t};\n}\n\nexport function useAutocompleteProps( options ) {\n\tconst ref = useRef();\n\tconst onKeyDownRef = useRef();\n\tconst { popover, listBoxId, activeId, onKeyDown } = useAutocomplete( {\n\t\t...options,\n\t\tcontentRef: ref,\n\t} );\n\tonKeyDownRef.current = onKeyDown;\n\treturn {\n\t\tref: useMergeRefs( [\n\t\t\tref,\n\t\t\tuseRefEffect( ( element ) => {\n\t\t\t\tfunction _onKeyDown( event ) {\n\t\t\t\t\tonKeyDownRef.current( event );\n\t\t\t\t}\n\t\t\t\telement.addEventListener( 'keydown', _onKeyDown );\n\t\t\t\treturn () => {\n\t\t\t\t\telement.removeEventListener( 'keydown', _onKeyDown );\n\t\t\t\t};\n\t\t\t}, [] ),\n\t\t] ),\n\t\tchildren: popover,\n\t\t'aria-autocomplete': listBoxId ? 'list' : undefined,\n\t\t'aria-owns': listBoxId,\n\t\t'aria-activedescendant': activeId,\n\t};\n}\n\nexport default function Autocomplete( { children, isSelected, ...options } ) {\n\tconst { popover, ...props } = useAutocomplete( options );\n\treturn (\n\t\t<>\n\t\t\t{ children( props ) }\n\t\t\t{ isSelected && popover }\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/autocomplete/index.js"],"names":["useAutocomplete","record","onChange","onReplace","completers","contentRef","debouncedSpeak","speak","instanceId","selectedIndex","setSelectedIndex","filteredOptions","setFilteredOptions","filterValue","setFilterValue","autocompleter","setAutocompleter","AutocompleterUI","setAutocompleterUI","backspacing","insertCompletion","replacement","end","start","triggerPrefix","length","toInsert","html","select","option","getOptionCompletion","isDisabled","completion","value","action","undefined","reset","announce","options","onChangeOptions","handleKeyDown","event","current","keyCode","BACKSPACE","defaultPrevented","UP","DOWN","ESCAPE","preventDefault","ENTER","LEFT","RIGHT","textContent","text","textAfterSelection","completer","allowContext","index","lastIndexOf","textWithoutTrigger","slice","tooDistantFromTrigger","mismatch","wordsFromTrigger","split","hasOneTriggerWord","matchingWhileBackspacing","test","safeTrigger","match","RegExp","query","key","selectedKey","className","isExpanded","listBoxId","activeId","hasSelection","onKeyDown","popover","useAutocompleteProps","ref","onKeyDownRef","element","_onKeyDown","addEventListener","removeEventListener","children","Autocomplete","isSelected","props"],"mappings":";;;;;;;;;;AASA;;AANA;;AACA;;AAYA;;AASA;;AACA;;AAMA;;AAOA;;AAKA;;AA5CA;AACA;AACA;;AAIA;AACA;AACA;;AAiCA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,eAAT,OAMI;AAAA,MANsB;AACzBC,IAAAA,MADyB;AAEzBC,IAAAA,QAFyB;AAGzBC,IAAAA,SAHyB;AAIzBC,IAAAA,UAJyB;AAKzBC,IAAAA;AALyB,GAMtB;AACH,QAAMC,cAAc,GAAG,0BAAaC,WAAb,EAAoB,GAApB,CAAvB;AACA,QAAMC,UAAU,GAAG,4BAAeR,eAAf,CAAnB;AACA,QAAM,CAAES,aAAF,EAAiBC,gBAAj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B,EAAwCF,UAAxC;AACA,OAFD;AAGA,KARD,EAQG,EARH,CAFkB,CAAd,CADC;AAaNG,IAAAA,QAAQ,EAAER,OAbJ;AAcN,yBAAqBJ,SAAS,GAAG,MAAH,GAAY1C,SAdpC;AAeN,iBAAa0C,SAfP;AAgBN,6BAAyBC;AAhBnB,GAAP;AAkBA;;AAEc,SAASY,YAAT,QAA8D;AAAA,MAAvC;AAAED,IAAAA,QAAF;AAAYE,IAAAA,UAAZ;AAAwB,OAAGrD;AAA3B,GAAuC;AAC5E,QAAM;AAAE2C,IAAAA,OAAF;AAAW,OAAGW;AAAd,MAAwB5F,eAAe,CAAEsC,OAAF,CAA7C;AACA,SACC,qDACGmD,QAAQ,CAAEG,KAAF,CADX,EAEGD,UAAU,IAAIV,OAFjB,CADD;AAMA","sourcesContent":["/**\n * External dependencies\n */\nimport { escapeRegExp, find } from 'lodash';\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseEffect,\n\tuseState,\n\tuseRef,\n\tuseMemo,\n} from '@wordpress/element';\nimport {\n\tENTER,\n\tESCAPE,\n\tUP,\n\tDOWN,\n\tLEFT,\n\tRIGHT,\n\tBACKSPACE,\n} from '@wordpress/keycodes';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tuseInstanceId,\n\tuseDebounce,\n\tuseMergeRefs,\n\tuseRefEffect,\n} from '@wordpress/compose';\nimport {\n\tcreate,\n\tslice,\n\tinsert,\n\tisCollapsed,\n\tgetTextContent,\n} from '@wordpress/rich-text';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { getAutoCompleterUI } from './autocompleter-ui';\n\n/**\n * A raw completer option.\n *\n * @typedef {*} CompleterOption\n */\n\n/**\n * @callback FnGetOptions\n *\n * @return {(CompleterOption[]|Promise.<CompleterOption[]>)} The completer options or a promise for them.\n */\n\n/**\n * @callback FnGetOptionKeywords\n * @param {CompleterOption} option a completer option.\n *\n * @return {string[]} list of key words to search.\n */\n\n/**\n * @callback FnIsOptionDisabled\n * @param {CompleterOption} option a completer option.\n *\n * @return {string[]} whether or not the given option is disabled.\n */\n\n/**\n * @callback FnGetOptionLabel\n * @param {CompleterOption} option a completer option.\n *\n * @return {(string|Array.<(string|WPElement)>)} list of react components to render.\n */\n\n/**\n * @callback FnAllowContext\n * @param {string} before the string before the auto complete trigger and query.\n * @param {string} after the string after the autocomplete trigger and query.\n *\n * @return {boolean} true if the completer can handle.\n */\n\n/**\n * @typedef {Object} OptionCompletion\n * @property {'insert-at-caret'|'replace'} action the intended placement of the completion.\n * @property {OptionCompletionValue} value the completion value.\n */\n\n/**\n * A completion value.\n *\n * @typedef {(string|WPElement|Object)} OptionCompletionValue\n */\n\n/**\n * @callback FnGetOptionCompletion\n * @param {CompleterOption} value the value of the completer option.\n * @param {string} query the text value of the autocomplete query.\n *\n * @return {(OptionCompletion|OptionCompletionValue)} the completion for the given option. If an\n * \t\t\t\t\t\t\t\t\t\t\t\t\t OptionCompletionValue is returned, the\n * \t\t\t\t\t\t\t\t\t\t\t\t\t completion action defaults to `insert-at-caret`.\n */\n\n/**\n * @typedef {Object} WPCompleter\n * @property {string} name a way to identify a completer, useful for selective overriding.\n * @property {?string} className A class to apply to the popup menu.\n * @property {string} triggerPrefix the prefix that will display the menu.\n * @property {(CompleterOption[]|FnGetOptions)} options the completer options or a function to get them.\n * @property {?FnGetOptionKeywords} getOptionKeywords get the keywords for a given option.\n * @property {?FnIsOptionDisabled} isOptionDisabled get whether or not the given option is disabled.\n * @property {FnGetOptionLabel} getOptionLabel get the label for a given option.\n * @property {?FnAllowContext} allowContext filter the context under which the autocomplete activates.\n * @property {FnGetOptionCompletion} getOptionCompletion get the completion associated with a given option.\n */\n\nfunction useAutocomplete( {\n\trecord,\n\tonChange,\n\tonReplace,\n\tcompleters,\n\tcontentRef,\n} ) {\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst instanceId = useInstanceId( useAutocomplete );\n\tconst [ selectedIndex, setSelectedIndex ] = useState( 0 );\n\tconst [ filteredOptions, setFilteredOptions ] = useState( [] );\n\tconst [ filterValue, setFilterValue ] = useState( '' );\n\tconst [ autocompleter, setAutocompleter ] = useState( null );\n\tconst [ AutocompleterUI, setAutocompleterUI ] = useState( null );\n\tconst backspacing = useRef( false );\n\n\tfunction insertCompletion( replacement ) {\n\t\tconst end = record.start;\n\t\tconst start =\n\t\t\tend - autocompleter.triggerPrefix.length - filterValue.length;\n\t\tconst toInsert = create( { html: renderToString( replacement ) } );\n\n\t\tonChange( insert( record, toInsert, start, end ) );\n\t}\n\n\tfunction select( option ) {\n\t\tconst { getOptionCompletion } = autocompleter || {};\n\n\t\tif ( option.isDisabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( getOptionCompletion ) {\n\t\t\tconst completion = getOptionCompletion( option.value, filterValue );\n\n\t\t\tconst { action, value } =\n\t\t\t\tundefined === completion.action ||\n\t\t\t\tundefined === completion.value\n\t\t\t\t\t? { action: 'insert-at-caret', value: completion }\n\t\t\t\t\t: completion;\n\n\t\t\tif ( 'replace' === action ) {\n\t\t\t\tonReplace( [ value ] );\n\t\t\t\t// When replacing, the component will unmount, so don't reset\n\t\t\t\t// state (below) on an unmounted component.\n\t\t\t\treturn;\n\t\t\t} else if ( 'insert-at-caret' === action ) {\n\t\t\t\tinsertCompletion( value );\n\t\t\t}\n\t\t}\n\n\t\t// Reset autocomplete state after insertion rather than before\n\t\t// so insertion events don't cause the completion menu to redisplay.\n\t\treset();\n\t}\n\n\tfunction reset() {\n\t\tsetSelectedIndex( 0 );\n\t\tsetFilteredOptions( [] );\n\t\tsetFilterValue( '' );\n\t\tsetAutocompleter( null );\n\t\tsetAutocompleterUI( null );\n\t}\n\n\tfunction announce( options ) {\n\t\tif ( ! debouncedSpeak ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( !! options.length ) {\n\t\t\tdebouncedSpeak(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\toptions.length\n\t\t\t\t\t),\n\t\t\t\t\toptions.length\n\t\t\t\t),\n\t\t\t\t'assertive'\n\t\t\t);\n\t\t} else {\n\t\t\tdebouncedSpeak( __( 'No results.' ), 'assertive' );\n\t\t}\n\t}\n\n\t/**\n\t * Load options for an autocompleter.\n\t *\n\t * @param {Array} options\n\t */\n\tfunction onChangeOptions( options ) {\n\t\tsetSelectedIndex(\n\t\t\toptions.length === filteredOptions.length ? selectedIndex : 0\n\t\t);\n\t\tsetFilteredOptions( options );\n\t\tannounce( options );\n\t}\n\n\tfunction handleKeyDown( event ) {\n\t\tbackspacing.current = event.keyCode === BACKSPACE;\n\n\t\tif ( ! autocompleter ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( filteredOptions.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\t\tswitch ( event.keyCode ) {\n\t\t\tcase UP:\n\t\t\t\tsetSelectedIndex(\n\t\t\t\t\t( selectedIndex === 0\n\t\t\t\t\t\t? filteredOptions.length\n\t\t\t\t\t\t: selectedIndex ) - 1\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase DOWN:\n\t\t\t\tsetSelectedIndex(\n\t\t\t\t\t( selectedIndex + 1 ) % filteredOptions.length\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase ESCAPE:\n\t\t\t\tsetAutocompleter( null );\n\t\t\t\tsetAutocompleterUI( null );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tbreak;\n\n\t\t\tcase ENTER:\n\t\t\t\tselect( filteredOptions[ selectedIndex ] );\n\t\t\t\tbreak;\n\n\t\t\tcase LEFT:\n\t\t\tcase RIGHT:\n\t\t\t\treset();\n\t\t\t\treturn;\n\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\t// Any handled keycode should prevent original behavior. This relies on\n\t\t// the early return in the default case.\n\t\tevent.preventDefault();\n\t}\n\n\t// textContent is a primitive (string), memoizing is not strictly necessary\n\t// but this is a preemptive performance improvement, since the autocompleter\n\t// is a potential bottleneck for the editor type metric.\n\tconst textContent = useMemo( () => {\n\t\tif ( isCollapsed( record ) ) {\n\t\t\treturn getTextContent( slice( record, 0 ) );\n\t\t}\n\t}, [ record ] );\n\n\tuseEffect( () => {\n\t\tif ( ! textContent ) {\n\t\t\treset();\n\t\t\treturn;\n\t\t}\n\n\t\tconst text = removeAccents( textContent );\n\t\tconst textAfterSelection = getTextContent(\n\t\t\tslice( record, undefined, getTextContent( record ).length )\n\t\t);\n\t\tconst completer = find(\n\t\t\tcompleters,\n\t\t\t( { triggerPrefix, allowContext } ) => {\n\t\t\t\tconst index = text.lastIndexOf( triggerPrefix );\n\n\t\t\t\tif ( index === -1 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst textWithoutTrigger = text.slice(\n\t\t\t\t\tindex + triggerPrefix.length\n\t\t\t\t);\n\n\t\t\t\tconst tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit.\n\t\t\t\t// This is a final barrier to prevent the effect from completing with\n\t\t\t\t// an extremely long string, which causes the editor to slow-down\n\t\t\t\t// significantly. This could happen, for example, if `matchingWhileBackspacing`\n\t\t\t\t// is true and one of the \"words\" end up being too long. If that's the case,\n\t\t\t\t// it will be caught by this guard.\n\t\t\t\tif ( tooDistantFromTrigger ) return false;\n\n\t\t\t\tconst mismatch = filteredOptions.length === 0;\n\t\t\t\tconst wordsFromTrigger = textWithoutTrigger.split( /\\s/ );\n\t\t\t\t// We need to allow the effect to run when not backspacing and if there\n\t\t\t\t// was a mismatch. i.e when typing a trigger + the match string or when\n\t\t\t\t// clicking in an existing trigger word on the page. We do that if we\n\t\t\t\t// detect that we have one word from trigger in the current textual context.\n\t\t\t\t//\n\t\t\t\t// Ex.: \"Some text @a\" <-- \"@a\" will be detected as the trigger word and\n\t\t\t\t// allow the effect to run. It will run until there's a mismatch.\n\t\t\t\tconst hasOneTriggerWord = wordsFromTrigger.length === 1;\n\t\t\t\t// This is used to allow the effect to run when backspacing and if\n\t\t\t\t// \"touching\" a word that \"belongs\" to a trigger. We consider a \"trigger\n\t\t\t\t// word\" any word up to the limit of 3 from the trigger character.\n\t\t\t\t// Anything beyond that is ignored if there's a mismatch. This allows\n\t\t\t\t// us to \"escape\" a mismatch when backspacing, but still imposing some\n\t\t\t\t// sane limits.\n\t\t\t\t//\n\t\t\t\t// Ex: \"Some text @marcelo sekkkk\" <--- \"kkkk\" caused a mismatch, but\n\t\t\t\t// if the user presses backspace here, it will show the completion popup again.\n\t\t\t\tconst matchingWhileBackspacing =\n\t\t\t\t\tbackspacing.current &&\n\t\t\t\t\ttextWithoutTrigger.split( /\\s/ ).length <= 3;\n\n\t\t\t\tif (\n\t\t\t\t\tmismatch &&\n\t\t\t\t\t! ( matchingWhileBackspacing || hasOneTriggerWord )\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tallowContext &&\n\t\t\t\t\t! allowContext( text.slice( 0, index ), textAfterSelection )\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t/^\\s/.test( textWithoutTrigger ) ||\n\t\t\t\t\t/\\s\\s+$/.test( textWithoutTrigger )\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn /[\\u0000-\\uFFFF]*$/.test( textWithoutTrigger );\n\t\t\t}\n\t\t);\n\n\t\tif ( ! completer ) {\n\t\t\treset();\n\t\t\treturn;\n\t\t}\n\n\t\tconst safeTrigger = escapeRegExp( completer.triggerPrefix );\n\t\tconst match = text\n\t\t\t.slice( text.lastIndexOf( completer.triggerPrefix ) )\n\t\t\t.match( new RegExp( `${ safeTrigger }([\\u0000-\\uFFFF]*)$` ) );\n\t\tconst query = match && match[ 1 ];\n\n\t\tsetAutocompleter( completer );\n\t\tsetAutocompleterUI( () =>\n\t\t\tcompleter !== autocompleter\n\t\t\t\t? getAutoCompleterUI( completer )\n\t\t\t\t: AutocompleterUI\n\t\t);\n\t\tsetFilterValue( query );\n\t\t// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ textContent ] );\n\n\tconst { key: selectedKey = '' } = filteredOptions[ selectedIndex ] || {};\n\tconst { className } = autocompleter || {};\n\tconst isExpanded = !! autocompleter && filteredOptions.length > 0;\n\tconst listBoxId = isExpanded\n\t\t? `components-autocomplete-listbox-${ instanceId }`\n\t\t: null;\n\tconst activeId = isExpanded\n\t\t? `components-autocomplete-item-${ instanceId }-${ selectedKey }`\n\t\t: null;\n\tconst hasSelection = record.start !== undefined;\n\n\treturn {\n\t\tlistBoxId,\n\t\tactiveId,\n\t\tonKeyDown: handleKeyDown,\n\t\tpopover: hasSelection && AutocompleterUI && (\n\t\t\t<AutocompleterUI\n\t\t\t\tclassName={ className }\n\t\t\t\tfilterValue={ filterValue }\n\t\t\t\tinstanceId={ instanceId }\n\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\tonChangeOptions={ onChangeOptions }\n\t\t\t\tonSelect={ select }\n\t\t\t\tvalue={ record }\n\t\t\t\tcontentRef={ contentRef }\n\t\t\t\treset={ reset }\n\t\t\t/>\n\t\t),\n\t};\n}\n\nexport function useAutocompleteProps( options ) {\n\tconst ref = useRef();\n\tconst onKeyDownRef = useRef();\n\tconst { popover, listBoxId, activeId, onKeyDown } = useAutocomplete( {\n\t\t...options,\n\t\tcontentRef: ref,\n\t} );\n\tonKeyDownRef.current = onKeyDown;\n\treturn {\n\t\tref: useMergeRefs( [\n\t\t\tref,\n\t\t\tuseRefEffect( ( element ) => {\n\t\t\t\tfunction _onKeyDown( event ) {\n\t\t\t\t\tonKeyDownRef.current( event );\n\t\t\t\t}\n\t\t\t\telement.addEventListener( 'keydown', _onKeyDown );\n\t\t\t\treturn () => {\n\t\t\t\t\telement.removeEventListener( 'keydown', _onKeyDown );\n\t\t\t\t};\n\t\t\t}, [] ),\n\t\t] ),\n\t\tchildren: popover,\n\t\t'aria-autocomplete': listBoxId ? 'list' : undefined,\n\t\t'aria-owns': listBoxId,\n\t\t'aria-activedescendant': activeId,\n\t};\n}\n\nexport default function Autocomplete( { children, isSelected, ...options } ) {\n\tconst { popover, ...props } = useAutocomplete( options );\n\treturn (\n\t\t<>\n\t\t\t{ children( props ) }\n\t\t\t{ isSelected && popover }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -84,7 +84,8 @@ const BorderBoxControl = (props, forwardedRef) => {
|
|
|
84
84
|
const popoverProps = popoverPlacement ? {
|
|
85
85
|
placement: popoverPlacement,
|
|
86
86
|
offset: popoverOffset,
|
|
87
|
-
anchorRef: containerRef
|
|
87
|
+
anchorRef: containerRef,
|
|
88
|
+
__unstableShift: true
|
|
88
89
|
} : undefined;
|
|
89
90
|
return (0, _element.createElement)(_view.View, (0, _extends2.default)({
|
|
90
91
|
className: className
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/border-box-control/border-box-control/component.tsx"],"names":["BorderLabel","props","label","hideLabelFromVision","BorderBoxControl","forwardedRef","className","colors","disableCustomColors","enableAlpha","enableStyle","hasMixedBorders","isLinked","linkedControlClassName","linkedValue","onLinkedChange","onSplitChange","popoverPlacement","popoverOffset","splitValue","toggleLinked","__experimentalHasMultipleOrigins","__experimentalIsRenderedInSidebar","__next36pxDefaultSize","otherProps","containerRef","mergedRef","popoverProps","placement","offset","anchorRef","undefined","ConnectedBorderBoxControl"],"mappings":";;;;;;;;;AAIA;;;;AADA;;AAEA;;AAKA;;AACA;;A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/border-box-control/component.tsx"],"names":["BorderLabel","props","label","hideLabelFromVision","BorderBoxControl","forwardedRef","className","colors","disableCustomColors","enableAlpha","enableStyle","hasMixedBorders","isLinked","linkedControlClassName","linkedValue","onLinkedChange","onSplitChange","popoverPlacement","popoverOffset","splitValue","toggleLinked","__experimentalHasMultipleOrigins","__experimentalIsRenderedInSidebar","__next36pxDefaultSize","otherProps","containerRef","mergedRef","popoverProps","placement","offset","anchorRef","__unstableShift","undefined","ConnectedBorderBoxControl"],"mappings":";;;;;;;;;AAIA;;;;AADA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAKA;AACA;AACA;AAcA,MAAMA,WAAW,GAAKC,KAAF,IAAyB;AAC5C,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAiCF,KAAvC;;AAEA,MAAK,CAAEC,KAAP,EAAe;AACd,WAAO,IAAP;AACA;;AAED,SAAOC,mBAAmB,GACzB,4BAAC,8BAAD;AAAgB,IAAA,EAAE,EAAC;AAAnB,KAA6BD,KAA7B,CADyB,GAGzB,4BAAC,8BAAD,QAAeA,KAAf,CAHD;AAKA,CAZD;;AAcA,MAAME,gBAAgB,GAAG,CACxBH,KADwB,EAExBI,YAFwB,KAGpB;AACJ,QAAM;AACLC,IAAAA,SADK;AAELC,IAAAA,MAFK;AAGLC,IAAAA,mBAHK;AAILC,IAAAA,WAJK;AAKLC,IAAAA,WALK;AAMLC,IAAAA,eANK;AAOLR,IAAAA,mBAPK;AAQLS,IAAAA,QARK;AASLV,IAAAA,KATK;AAULW,IAAAA,sBAVK;AAWLC,IAAAA,WAXK;AAYLC,IAAAA,cAZK;AAaLC,IAAAA,aAbK;AAcLC,IAAAA,gBAdK;AAeLC,IAAAA,aAfK;AAgBLC,IAAAA,UAhBK;AAiBLC,IAAAA,YAjBK;AAkBLC,IAAAA,gCAlBK;AAmBLC,IAAAA,iCAnBK;AAoBLC,IAAAA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BF;AAqBC,IAAA,qBAAqB,EAAGC;AArBzB,IADS,GAyBT,4BAAC,sCAAD;AACC,IAAA,MAAM,EAAGhB,MADV;AAEC,IAAA,mBAAmB,EAAGC,mBAFvB;AAGC,IAAA,WAAW,EAAGC,WAHf;AAIC,IAAA,WAAW,EAAGC,WAJf;AAKC,IAAA,QAAQ,EAAGM,aALZ;AAMC,IAAA,gBAAgB,EAAGC,gBANpB;AAOC,IAAA,aAAa,EAAGC,aAPjB;AAQC,IAAA,KAAK,EAAGC,UART;AASC,IAAA,gCAAgC,EAC/BE,gCAVF;AAYC,IAAA,iCAAiC,EAChCC,iCAbF;AAeC,IAAA,qBAAqB,EAAGC;AAfzB,IA1BF,EA4CC,4BAAC,qCAAD;AACC,IAAA,OAAO,EAAGH,YADX;AAEC,IAAA,QAAQ,EAAGR,QAFZ;AAGC,IAAA,qBAAqB,EAAGW;AAHzB,IA5CD,CALD,CADD;AA0DA,CAhGD;;AAkGA,MAAMU,yBAAyB,GAAG,6BACjC7B,gBADiC,EAEjC,kBAFiC,CAAlC;eAKe6B,yB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BorderBoxControlLinkedButton from '../border-box-control-linked-button';\nimport BorderBoxControlSplitControls from '../border-box-control-split-controls';\nimport { BorderControl } from '../../border-control';\nimport { HStack } from '../../h-stack';\nimport { StyledLabel } from '../../base-control/styles/base-control-styles';\nimport { View } from '../../view';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { useBorderBoxControl } from './hook';\n\nimport type { BorderBoxControlProps } from '../types';\nimport type { LabelProps } from '../../border-control/types';\n\nconst BorderLabel = ( props: LabelProps ) => {\n\tconst { label, hideLabelFromVision } = props;\n\n\tif ( ! label ) {\n\t\treturn null;\n\t}\n\n\treturn hideLabelFromVision ? (\n\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t) : (\n\t\t<StyledLabel>{ label }</StyledLabel>\n\t);\n};\n\nconst BorderBoxControl = (\n\tprops: WordPressComponentProps< BorderBoxControlProps, 'div' >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\tclassName,\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\thasMixedBorders,\n\t\thideLabelFromVision,\n\t\tisLinked,\n\t\tlabel,\n\t\tlinkedControlClassName,\n\t\tlinkedValue,\n\t\tonLinkedChange,\n\t\tonSplitChange,\n\t\tpopoverPlacement,\n\t\tpopoverOffset,\n\t\tsplitValue,\n\t\ttoggleLinked,\n\t\t__experimentalHasMultipleOrigins,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t__next36pxDefaultSize = false,\n\t\t...otherProps\n\t} = useBorderBoxControl( props );\n\tconst containerRef = useRef();\n\tconst mergedRef = useMergeRefs( [ containerRef, forwardedRef ] );\n\tconst popoverProps = popoverPlacement\n\t\t? {\n\t\t\t\tplacement: popoverPlacement,\n\t\t\t\toffset: popoverOffset,\n\t\t\t\tanchorRef: containerRef,\n\t\t\t\t__unstableShift: true,\n\t\t }\n\t\t: undefined;\n\n\treturn (\n\t\t<View className={ className } { ...otherProps } ref={ mergedRef }>\n\t\t\t<BorderLabel\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t/>\n\t\t\t<HStack alignment={ 'start' } expanded={ true } spacing={ 0 }>\n\t\t\t\t{ isLinked ? (\n\t\t\t\t\t<BorderControl\n\t\t\t\t\t\tclassName={ linkedControlClassName }\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onLinkedChange }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\thasMixedBorders ? __( 'Mixed' ) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\t\t\tshouldSanitizeBorder={ false } // This component will handle that.\n\t\t\t\t\t\tvalue={ linkedValue }\n\t\t\t\t\t\twithSlider={ true }\n\t\t\t\t\t\twidth={ '110px' }\n\t\t\t\t\t\t__experimentalHasMultipleOrigins={\n\t\t\t\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BorderBoxControlSplitControls\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onSplitChange }\n\t\t\t\t\t\tpopoverPlacement={ popoverPlacement }\n\t\t\t\t\t\tpopoverOffset={ popoverOffset }\n\t\t\t\t\t\tvalue={ splitValue }\n\t\t\t\t\t\t__experimentalHasMultipleOrigins={\n\t\t\t\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<BorderBoxControlLinkedButton\n\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</View>\n\t);\n};\n\nconst ConnectedBorderBoxControl = contextConnect(\n\tBorderBoxControl,\n\t'BorderBoxControl'\n);\n\nexport default ConnectedBorderBoxControl;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/border-box-control/border-box-control-linked-button/component.tsx"],"names":["BorderBoxControlLinkedButton","props","forwardedRef","className","isLinked","buttonProps","label","link","linkOff","ConnectedBorderBoxControlLinkedButton"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;AASA,MAAMA,4BAA4B,GAAG,CACpCC,KADoC,EAEpCC,YAFoC,KAGhC;AACJ,QAAM;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/border-box-control/border-box-control-linked-button/component.tsx"],"names":["BorderBoxControlLinkedButton","props","forwardedRef","className","isLinked","buttonProps","label","link","linkOff","ConnectedBorderBoxControlLinkedButton"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;AASA,MAAMA,4BAA4B,GAAG,CACpCC,KADoC,EAEpCC,YAFoC,KAGhC;AACJ,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,QAAb;AAAuB,OAAGC;AAA1B,MACL,2CAAiCJ,KAAjC,CADD;AAEA,QAAMK,KAAK,GAAGF,QAAQ,GAAG,cAAI,cAAJ,CAAH,GAA0B,cAAI,YAAJ,CAAhD;AAEA,SACC,4BAAC,gBAAD;AAAS,IAAA,IAAI,EAAGE;AAAhB,KACC,4BAAC,UAAD;AAAM,IAAA,SAAS,EAAGH;AAAlB,KACC,4BAAC,eAAD,6BACME,WADN;AAEC,IAAA,OAAO,EAAGD,QAAQ,GAAG,SAAH,GAAe,WAFlC;AAGC,IAAA,OAAO,MAHR;AAIC,IAAA,IAAI,EAAGA,QAAQ,GAAGG,WAAH,GAAUC,cAJ1B;AAKC,IAAA,QAAQ,EAAG,EALZ;AAMC,kBAAaF,KANd;AAOC,IAAA,GAAG,EAAGJ;AAPP,KADD,CADD,CADD;AAeA,CAvBD;;AAyBA,MAAMO,qCAAqC,GAAG,6BAC7CT,4BAD6C,EAE7C,8BAF6C,CAA9C;eAIeS,qC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { link, linkOff } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport Tooltip from '../../tooltip';\nimport { View } from '../../view';\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { useBorderBoxControlLinkedButton } from './hook';\n\nimport type { LinkedButtonProps } from '../types';\n\nconst BorderBoxControlLinkedButton = (\n\tprops: WordPressComponentProps< LinkedButtonProps, 'div' >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst { className, isLinked, ...buttonProps } =\n\t\tuseBorderBoxControlLinkedButton( props );\n\tconst label = isLinked ? __( 'Unlink sides' ) : __( 'Link sides' );\n\n\treturn (\n\t\t<Tooltip text={ label }>\n\t\t\t<View className={ className }>\n\t\t\t\t<Button\n\t\t\t\t\t{ ...buttonProps }\n\t\t\t\t\tvariant={ isLinked ? 'primary' : 'secondary' }\n\t\t\t\t\tisSmall\n\t\t\t\t\ticon={ isLinked ? link : linkOff }\n\t\t\t\t\ticonSize={ 16 }\n\t\t\t\t\taria-label={ label }\n\t\t\t\t\tref={ forwardedRef }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</Tooltip>\n\t);\n};\n\nconst ConnectedBorderBoxControlLinkedButton = contextConnect(\n\tBorderBoxControlLinkedButton,\n\t'BorderBoxControlLinkedButton'\n);\nexport default ConnectedBorderBoxControlLinkedButton;\n"]}
|
|
@@ -54,7 +54,8 @@ const BorderBoxControlSplitControls = (props, forwardedRef) => {
|
|
|
54
54
|
const popoverProps = popoverPlacement ? {
|
|
55
55
|
placement: popoverPlacement,
|
|
56
56
|
offset: popoverOffset,
|
|
57
|
-
anchorRef: containerRef
|
|
57
|
+
anchorRef: containerRef,
|
|
58
|
+
__unstableShift: true
|
|
58
59
|
} : undefined;
|
|
59
60
|
const sharedBorderControlProps = {
|
|
60
61
|
colors,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/border-box-control/border-box-control-split-controls/component.tsx"],"names":["BorderBoxControlSplitControls","props","forwardedRef","centeredClassName","colors","disableCustomColors","enableAlpha","enableStyle","onChange","popoverPlacement","popoverOffset","rightAlignedClassName","value","__experimentalHasMultipleOrigins","__experimentalIsRenderedInSidebar","__next36pxDefaultSize","otherProps","containerRef","mergedRef","popoverProps","placement","offset","anchorRef","undefined","sharedBorderControlProps","isCompact","newBorder","top","left","right","bottom","ConnectedBorderBoxControlSplitControls"],"mappings":";;;;;;;;;AAIA;;;;AADA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAKA;AACA;AACA;AASA,MAAMA,6BAA6B,GAAG,CACrCC,KADqC,EAErCC,YAFqC,KAGjC;AACJ,QAAM;AACLC,IAAAA,iBADK;AAELC,IAAAA,MAFK;AAGLC,IAAAA,mBAHK;AAILC,IAAAA,WAJK;AAKLC,IAAAA,WALK;AAMLC,IAAAA,QANK;AAOLC,IAAAA,gBAPK;AAQLC,IAAAA,aARK;AASLC,IAAAA,qBATK;AAULC,IAAAA,KAVK;AAWLC,IAAAA,gCAXK;AAYLC,IAAAA,iCAZK;AAaLC,IAAAA,qBAbK;AAcL,OAAGC;AAdE,MAeF,4CAAkCf,KAAlC,CAfJ;AAgBA,QAAMgB,YAAY,GAAG,sBAArB;AACA,QAAMC,SAAS,GAAG,2BAAc,CAAED,YAAF,EAAgBf,YAAhB,CAAd,CAAlB;AACA,QAAMiB,YAAY,GAAGV,gBAAgB,GAClC;AACAW,IAAAA,SAAS,EAAEX,gBADX;AAEAY,IAAAA,MAAM,EAAEX,aAFR;AAGAY,IAAAA,SAAS,EAAEL;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/border-box-control/border-box-control-split-controls/component.tsx"],"names":["BorderBoxControlSplitControls","props","forwardedRef","centeredClassName","colors","disableCustomColors","enableAlpha","enableStyle","onChange","popoverPlacement","popoverOffset","rightAlignedClassName","value","__experimentalHasMultipleOrigins","__experimentalIsRenderedInSidebar","__next36pxDefaultSize","otherProps","containerRef","mergedRef","popoverProps","placement","offset","anchorRef","__unstableShift","undefined","sharedBorderControlProps","isCompact","newBorder","top","left","right","bottom","ConnectedBorderBoxControlSplitControls"],"mappings":";;;;;;;;;AAIA;;;;AADA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAKA;AACA;AACA;AASA,MAAMA,6BAA6B,GAAG,CACrCC,KADqC,EAErCC,YAFqC,KAGjC;AACJ,QAAM;AACLC,IAAAA,iBADK;AAELC,IAAAA,MAFK;AAGLC,IAAAA,mBAHK;AAILC,IAAAA,WAJK;AAKLC,IAAAA,WALK;AAMLC,IAAAA,QANK;AAOLC,IAAAA,gBAPK;AAQLC,IAAAA,aARK;AASLC,IAAAA,qBATK;AAULC,IAAAA,KAVK;AAWLC,IAAAA,gCAXK;AAYLC,IAAAA,iCAZK;AAaLC,IAAAA,qBAbK;AAcL,OAAGC;AAdE,MAeF,4CAAkCf,KAAlC,CAfJ;AAgBA,QAAMgB,YAAY,GAAG,sBAArB;AACA,QAAMC,SAAS,GAAG,2BAAc,CAAED,YAAF,EAAgBf,YAAhB,CAAd,CAAlB;AACA,QAAMiB,YAAY,GAAGV,gBAAgB,GAClC;AACAW,IAAAA,SAAS,EAAEX,gBADX;AAEAY,IAAAA,MAAM,EAAEX,aAFR;AAGAY,IAAAA,SAAS,EAAEL,YAHX;AAIAM,IAAAA,eAAe,EAAE;AAJjB,GADkC,GAOlCC,SAPH;AASA,QAAMC,wBAAwB,GAAG;AAChCrB,IAAAA,MADgC;AAEhCC,IAAAA,mBAFgC;AAGhCC,IAA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;AAMC,IAAA,KAAK,EAAGP,KAAH,aAAGA,KAAH,uBAAGA,KAAK,CAAEkB;AANhB,KAOML,wBAPN,EAtBD,EA+BC,4BAAC,4BAAD;AACC,IAAA,SAAS,EAAGtB,iBADb;AAEC,IAAA,mBAAmB,EAAG,IAFvB;AAGC,IAAA,KAAK,EAAG,cAAI,eAAJ,CAHT;AAIC,IAAA,QAAQ,EAAKwB,SAAF,IAAiBnB,QAAQ,CAAEmB,SAAF,EAAa,QAAb,CAJrC;AAKC,IAAA,sBAAsB,EAAGR,YAL1B;AAMC,IAAA,KAAK,EAAGP,KAAH,aAAGA,KAAH,uBAAGA,KAAK,CAAEmB;AANhB,KAOMN,wBAPN,EA/BD,CADD;AA2CA,CArFD;;AAuFA,MAAMO,sCAAsC,GAAG,6BAC9ChC,6BAD8C,EAE9C,+BAF8C,CAA/C;eAIegC,sC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BorderBoxControlVisualizer from '../border-box-control-visualizer';\nimport { BorderControl } from '../../border-control';\nimport { Grid } from '../../grid';\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { useBorderBoxControlSplitControls } from './hook';\n\nimport type { SplitControlsProps } from '../types';\n\nconst BorderBoxControlSplitControls = (\n\tprops: WordPressComponentProps< SplitControlsProps, 'div' >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\tcenteredClassName,\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\tonChange,\n\t\tpopoverPlacement,\n\t\tpopoverOffset,\n\t\trightAlignedClassName,\n\t\tvalue,\n\t\t__experimentalHasMultipleOrigins,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t__next36pxDefaultSize,\n\t\t...otherProps\n\t} = useBorderBoxControlSplitControls( props );\n\tconst containerRef = useRef();\n\tconst mergedRef = useMergeRefs( [ containerRef, forwardedRef ] );\n\tconst popoverProps = popoverPlacement\n\t\t? {\n\t\t\t\tplacement: popoverPlacement,\n\t\t\t\toffset: popoverOffset,\n\t\t\t\tanchorRef: containerRef,\n\t\t\t\t__unstableShift: true,\n\t\t }\n\t\t: undefined;\n\n\tconst sharedBorderControlProps = {\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\tisCompact: true,\n\t\t__experimentalHasMultipleOrigins,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t__next36pxDefaultSize,\n\t};\n\n\treturn (\n\t\t<Grid { ...otherProps } ref={ mergedRef } gap={ 4 }>\n\t\t\t<BorderBoxControlVisualizer\n\t\t\t\tvalue={ value }\n\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t/>\n\t\t\t<BorderControl\n\t\t\t\tclassName={ centeredClassName }\n\t\t\t\thideLabelFromVision={ true }\n\t\t\t\tlabel={ __( 'Top border' ) }\n\t\t\t\tonChange={ ( newBorder ) => onChange( newBorder, 'top' ) }\n\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\tvalue={ value?.top }\n\t\t\t\t{ ...sharedBorderControlProps }\n\t\t\t/>\n\t\t\t<BorderControl\n\t\t\t\thideLabelFromVision={ true }\n\t\t\t\tlabel={ __( 'Left border' ) }\n\t\t\t\tonChange={ ( newBorder ) => onChange( newBorder, 'left' ) }\n\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\tvalue={ value?.left }\n\t\t\t\t{ ...sharedBorderControlProps }\n\t\t\t/>\n\t\t\t<BorderControl\n\t\t\t\tclassName={ rightAlignedClassName }\n\t\t\t\thideLabelFromVision={ true }\n\t\t\t\tlabel={ __( 'Right border' ) }\n\t\t\t\tonChange={ ( newBorder ) => onChange( newBorder, 'right' ) }\n\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\tvalue={ value?.right }\n\t\t\t\t{ ...sharedBorderControlProps }\n\t\t\t/>\n\t\t\t<BorderControl\n\t\t\t\tclassName={ centeredClassName }\n\t\t\t\thideLabelFromVision={ true }\n\t\t\t\tlabel={ __( 'Bottom border' ) }\n\t\t\t\tonChange={ ( newBorder ) => onChange( newBorder, 'bottom' ) }\n\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\tvalue={ value?.bottom }\n\t\t\t\t{ ...sharedBorderControlProps }\n\t\t\t/>\n\t\t</Grid>\n\t);\n};\n\nconst ConnectedBorderBoxControlSplitControls = contextConnect(\n\tBorderBoxControlSplitControls,\n\t'BorderBoxControlSplitControls'\n);\nexport default ConnectedBorderBoxControlSplitControls;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/border-box-control/utils.ts"],"names":["sides","borderProps","isEmptyBorder","border","some","prop","undefined","isDefinedBorder","hasSplitBorders","allSidesEmpty","every","side","isCompleteBorder","Object","keys","indexOf","hasMixedBorders","borders","shorthandBorders","map","getShorthandBorderStyle","getSplitBorders","top","right","bottom","left","getBorderDiff","original","updated","diff","color","style","width","getCommonBorder","colors","styles","widths","forEach","push","allColorsMatch","value","allStylesMatch","allWidthsMatch","fallbackBorder","fallbackColor","fallbackStyle","fallbackWidth","hasVisibleBorder","borderStyle","filter","Boolean","join"],"mappings":";;;;;;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,KAAmB,GAAG,CAAE,KAAF,EAAS,OAAT,EAAkB,QAAlB,EAA4B,MAA5B,CAA5B;AACA,MAAMC,WAAyB,GAAG,CAAE,OAAF,EAAW,OAAX,EAAoB,OAApB,CAAlC;;AAEO,MAAMC,aAAa,GAAKC,MAAF,IAAuB;AACnD,MAAK,CAAEA,MAAP,EAAgB;AACf,WAAO,IAAP;AACA;;AACD,SAAO,CAAEF,WAAW,CAACG,IAAZ,CAAoBC,IAAF,IAAYF,MAAM,CAAEE,IAAF,CAAN,KAAmBC,SAAjD,CAAT;AACA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AO,CAAEN,IAAF,CAApB,mDAAa,eAAiBoB,KAA9B;AACAK,IAAAA,MAAM,CAACE,IAAP,mBAAarB,OAAO,CAAEN,IAAF,CAApB,mDAAa,eAAiBqB,KAA9B;AACA,GAJD;AAMA,QAAMO,cAAc,GAAGL,MAAM,CAACxB,KAAP,CAAgB8B,KAAF,IAAaA,KAAK,KAAKN,MAAM,CAAE,CAAF,CAA3C,CAAvB;AACA,QAAMO,cAAc,GAAGN,MAAM,CAACzB,KAAP,CAAgB8B,KAAF,IAAaA,KAAK,KAAKL,MAAM,CAAE,CAAF,CAA3C,CAAvB;AACA,QAAMO,cAAc,GAAGN,MAAM,CAAC1B,KAAP,CAAgB8B,KAAF,IAAaA,KAAK,KAAKJ,MAAM,CAAE,CAAF,CAA3C,CAAvB;AAEA,SAAO;AACNN,IAAAA,KAAK,EAAES,cAAc,GAAGL,MAAM,CAAE,CAAF,CAAT,GAAiB5B,SADhC;AAENyB,IAAAA,KAAK,EAAEU,cAAc,GAAGN,MAAM,CAAE,CAAF,CAAT,GAAiB7B,SAFhC;AAGN0B,IAAAA,KAAK,EAAEU,cAAc,GAAGN,MAAM,CAAE,CAAF,CAAT,GAAiB9B;AAHhC,GAAP;AAKA,CAxBM;;;;AA0BA,MAAMc,uBAAuB,GAAG,CACtCjB,MADsC,EAEtCwC,cAFsC,KAGlC;AACJ,MAAKzC,aAAa,CAAEC,MAAF,CAAlB,EAA+B;AAC9B,WAAOwC,cAAP;AACA;;AAED,QAAM;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/border-box-control/utils.ts"],"names":["sides","borderProps","isEmptyBorder","border","some","prop","undefined","isDefinedBorder","hasSplitBorders","allSidesEmpty","every","side","isCompleteBorder","Object","keys","indexOf","hasMixedBorders","borders","shorthandBorders","map","getShorthandBorderStyle","getSplitBorders","top","right","bottom","left","getBorderDiff","original","updated","diff","color","style","width","getCommonBorder","colors","styles","widths","forEach","push","allColorsMatch","value","allStylesMatch","allWidthsMatch","fallbackBorder","fallbackColor","fallbackStyle","fallbackWidth","hasVisibleBorder","borderStyle","filter","Boolean","join"],"mappings":";;;;;;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,KAAmB,GAAG,CAAE,KAAF,EAAS,OAAT,EAAkB,QAAlB,EAA4B,MAA5B,CAA5B;AACA,MAAMC,WAAyB,GAAG,CAAE,OAAF,EAAW,OAAX,EAAoB,OAApB,CAAlC;;AAEO,MAAMC,aAAa,GAAKC,MAAF,IAAuB;AACnD,MAAK,CAAEA,MAAP,EAAgB;AACf,WAAO,IAAP;AACA;;AACD,SAAO,CAAEF,WAAW,CAACG,IAAZ,CAAoBC,IAAF,IAAYF,MAAM,CAAEE,IAAF,CAAN,KAAmBC,SAAjD,CAAT;AACA,CALM;;;;AAOA,MAAMC,eAAe,GAAKJ,MAAF,IAAyB;AACvD;AACA,MAAK,CAAEA,MAAP,EAAgB;AACf,WAAO,KAAP;AACA,GAJsD,CAMvD;AACA;;;AACA,MAAKK,eAAe,CAAEL,MAAF,CAApB,EAAiC;AAChC,UAAMM,aAAa,GAAGT,KAAK,CAACU,KAAN,CAAeC,IAAF,IAClCT,aAAa,CAAIC,MAAF,CAAuBQ,IAAvB,CAAF,CADQ,CAAtB;AAIA,WAAO,CAAEF,aAAT;AACA,GAdsD,CAgBvD;AACA;AACA;AACA;;;AACA,SAAO,CAAEP,aAAa,CAAEC,MAAF,CAAtB;AACA,CArBM;;;;AAuBA,MAAMS,gBAAgB,GAAKT,MAAF,IAAuB;AACtD,MAAK,CAAEA,MAAP,EAAgB;AACf,WAAO,KAAP;AACA;;AAED,SAAOF,WAAW,CAACS,KAAZ,CAAqBL,IAAF,IAAYF,MAAM,CAAEE,IAAF,CAAN,KAAmBC,SAAlD,CAAP;AACA,CANM;;;;AAQA,MAAME,eAAe,GAAG,YAA8B;AAAA,MAA5BL,MAA4B,uEAAR,EAAQ;AAC5D,SAAOU,MAAM,CAACC,IAAP,CAAaX,MAAb,EAAsBC,IAAtB,CAC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BM;;;;AA0BA,MAAMc,uBAAuB,GAAG,CACtCjB,MADsC,EAEtCwC,cAFsC,KAGlC;AACJ,MAAKzC,aAAa,CAAEC,MAAF,CAAlB,EAA+B;AAC9B,WAAOwC,cAAP;AACA;;AAED,QAAM;AACLb,IAAAA,KAAK,EAAEc,aADF;AAELb,IAAAA,KAAK,EAAEc,aAFF;AAGLb,IAAAA,KAAK,EAAEc;AAHF,MAIFH,cAAc,IAAI,EAJtB;AAMA,QAAM;AACLb,IAAAA,KAAK,GAAGc,aADH;AAELb,IAAAA,KAAK,GAAGc,aAFH;AAGLb,IAAAA,KAAK,GAAGc;AAHH,MAIF3C,MAJJ;AAMA,QAAM4C,gBAAgB,GAAK,CAAC,CAAEf,KAAH,IAAYA,KAAK,KAAK,GAAxB,IAAiC,CAAC,CAAEF,KAA7D;AACA,QAAMkB,WAAW,GAAGD,gBAAgB,GAAGhB,KAAK,IAAI,OAAZ,GAAsBA,KAA1D;AAEA,SAAO,CAAEC,KAAF,EAASgB,WAAT,EAAsBlB,KAAtB,EAA8BmB,MAA9B,CAAsCC,OAAtC,EAAgDC,IAAhD,CAAsD,GAAtD,CAAP;AACA,CAxBM","sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { Border } from '../border-control/types';\nimport type { AnyBorder, Borders, BorderProp, BorderSide } from './types';\n\nconst sides: BorderSide[] = [ 'top', 'right', 'bottom', 'left' ];\nconst borderProps: BorderProp[] = [ 'color', 'style', 'width' ];\n\nexport const isEmptyBorder = ( border?: Border ) => {\n\tif ( ! border ) {\n\t\treturn true;\n\t}\n\treturn ! borderProps.some( ( prop ) => border[ prop ] !== undefined );\n};\n\nexport const isDefinedBorder = ( border: AnyBorder ) => {\n\t// No border, no worries :)\n\tif ( ! border ) {\n\t\treturn false;\n\t}\n\n\t// If we have individual borders per side within the border object we\n\t// need to check whether any of those side borders have been set.\n\tif ( hasSplitBorders( border ) ) {\n\t\tconst allSidesEmpty = sides.every( ( side ) =>\n\t\t\tisEmptyBorder( ( border as Borders )[ side ] )\n\t\t);\n\n\t\treturn ! allSidesEmpty;\n\t}\n\n\t// If we have a top-level border only, check if that is empty. e.g.\n\t// { color: undefined, style: undefined, width: undefined }\n\t// Border radius can still be set within the border object as it is\n\t// handled separately.\n\treturn ! isEmptyBorder( border as Border );\n};\n\nexport const isCompleteBorder = ( border?: Border ) => {\n\tif ( ! border ) {\n\t\treturn false;\n\t}\n\n\treturn borderProps.every( ( prop ) => border[ prop ] !== undefined );\n};\n\nexport const hasSplitBorders = ( border: AnyBorder = {} ) => {\n\treturn Object.keys( border ).some(\n\t\t( side ) => sides.indexOf( side as BorderSide ) !== -1\n\t);\n};\n\nexport const hasMixedBorders = ( borders: AnyBorder ) => {\n\tif ( ! hasSplitBorders( borders ) ) {\n\t\treturn false;\n\t}\n\n\tconst shorthandBorders = sides.map( ( side: BorderSide ) =>\n\t\tgetShorthandBorderStyle( ( borders as Borders )?.[ side ] )\n\t);\n\n\treturn ! shorthandBorders.every(\n\t\t( border ) => border === shorthandBorders[ 0 ]\n\t);\n};\n\nexport const getSplitBorders = ( border?: Border ) => {\n\tif ( ! border || isEmptyBorder( border ) ) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\ttop: border,\n\t\tright: border,\n\t\tbottom: border,\n\t\tleft: border,\n\t};\n};\n\nexport const getBorderDiff = ( original: Border, updated: Border ) => {\n\tconst diff: Border = {};\n\n\tif ( original.color !== updated.color ) {\n\t\tdiff.color = updated.color;\n\t}\n\n\tif ( original.style !== updated.style ) {\n\t\tdiff.style = updated.style;\n\t}\n\n\tif ( original.width !== updated.width ) {\n\t\tdiff.width = updated.width;\n\t}\n\n\treturn diff;\n};\n\nexport const getCommonBorder = ( borders?: Borders ) => {\n\tif ( ! borders ) {\n\t\treturn undefined;\n\t}\n\n\tconst colors: ( CSSProperties[ 'borderColor' ] | undefined )[] = [];\n\tconst styles: ( CSSProperties[ 'borderStyle' ] | undefined )[] = [];\n\tconst widths: ( CSSProperties[ 'borderWidth' ] | undefined )[] = [];\n\n\tsides.forEach( ( side ) => {\n\t\tcolors.push( borders[ side ]?.color );\n\t\tstyles.push( borders[ side ]?.style );\n\t\twidths.push( borders[ side ]?.width );\n\t} );\n\n\tconst allColorsMatch = colors.every( ( value ) => value === colors[ 0 ] );\n\tconst allStylesMatch = styles.every( ( value ) => value === styles[ 0 ] );\n\tconst allWidthsMatch = widths.every( ( value ) => value === widths[ 0 ] );\n\n\treturn {\n\t\tcolor: allColorsMatch ? colors[ 0 ] : undefined,\n\t\tstyle: allStylesMatch ? styles[ 0 ] : undefined,\n\t\twidth: allWidthsMatch ? widths[ 0 ] : undefined,\n\t};\n};\n\nexport const getShorthandBorderStyle = (\n\tborder?: Border,\n\tfallbackBorder?: Border\n) => {\n\tif ( isEmptyBorder( border ) ) {\n\t\treturn fallbackBorder;\n\t}\n\n\tconst {\n\t\tcolor: fallbackColor,\n\t\tstyle: fallbackStyle,\n\t\twidth: fallbackWidth,\n\t} = fallbackBorder || {};\n\n\tconst {\n\t\tcolor = fallbackColor,\n\t\tstyle = fallbackStyle,\n\t\twidth = fallbackWidth,\n\t} = border as Border;\n\n\tconst hasVisibleBorder = ( !! width && width !== '0' ) || !! color;\n\tconst borderStyle = hasVisibleBorder ? style || 'solid' : style;\n\n\treturn [ width, borderStyle, color ].filter( Boolean ).join( ' ' );\n};\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.BorderControl = void 0;
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
@@ -47,7 +47,7 @@ const BorderLabel = props => {
|
|
|
47
47
|
}, label) : (0, _element.createElement)(_baseControlStyles.StyledLabel, null, label);
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
const
|
|
50
|
+
const UnconnectedBorderControl = (props, forwardedRef) => {
|
|
51
51
|
const {
|
|
52
52
|
colors,
|
|
53
53
|
disableCustomColors,
|
|
@@ -114,8 +114,44 @@ const BorderControl = (props, forwardedRef) => {
|
|
|
114
114
|
withInputField: false
|
|
115
115
|
})));
|
|
116
116
|
};
|
|
117
|
+
/**
|
|
118
|
+
* The `BorderControl` brings together internal sub-components which allow users to
|
|
119
|
+
* set the various properties of a border. The first sub-component, a
|
|
120
|
+
* `BorderDropdown` contains options representing border color and style. The
|
|
121
|
+
* border width is controlled via a `UnitControl` and an optional `RangeControl`.
|
|
122
|
+
*
|
|
123
|
+
* Border radius is not covered by this control as it may be desired separate to
|
|
124
|
+
* color, style, and width. For example, the border radius may be absorbed under
|
|
125
|
+
* a "shape" abstraction.
|
|
126
|
+
*
|
|
127
|
+
* ```jsx
|
|
128
|
+
* import { __experimentalBorderControl as BorderControl } from '@wordpress/components';
|
|
129
|
+
* import { __ } from '@wordpress/i18n';
|
|
130
|
+
*
|
|
131
|
+
* const colors = [
|
|
132
|
+
* { name: 'Blue 20', color: '#72aee6' },
|
|
133
|
+
* // ...
|
|
134
|
+
* ];
|
|
135
|
+
*
|
|
136
|
+
* const MyBorderControl = () => {
|
|
137
|
+
* const [ border, setBorder ] = useState();
|
|
138
|
+
* const onChange = ( newBorder ) => setBorder( newBorder );
|
|
139
|
+
*
|
|
140
|
+
* return (
|
|
141
|
+
* <BorderControl
|
|
142
|
+
* colors={ colors }
|
|
143
|
+
* label={ __( 'Border' ) }
|
|
144
|
+
* onChange={ onChange }
|
|
145
|
+
* value={ border }
|
|
146
|
+
* />
|
|
147
|
+
* );
|
|
148
|
+
* };
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
|
|
117
152
|
|
|
118
|
-
const
|
|
119
|
-
|
|
153
|
+
const BorderControl = (0, _context.contextConnect)(UnconnectedBorderControl, 'BorderControl');
|
|
154
|
+
exports.BorderControl = BorderControl;
|
|
155
|
+
var _default = BorderControl;
|
|
120
156
|
exports.default = _default;
|
|
121
157
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/border-control/border-control/component.tsx"],"names":["BorderLabel","props","label","hideLabelFromVision","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/border-control/border-control/component.tsx"],"names":["BorderLabel","props","label","hideLabelFromVision","UnconnectedBorderControl","forwardedRef","colors","disableCustomColors","enableAlpha","enableStyle","innerWrapperClassName","onBorderChange","onSliderChange","onWidthChange","placeholder","__unstablePopoverProps","previousStyleSelection","showDropdownHeader","sliderClassName","value","border","widthControlClassName","widthUnit","widthValue","withSlider","__experimentalHasMultipleOrigins","__experimentalIsRenderedInSidebar","__next36pxDefaultSize","otherProps","width","includes","undefined","BorderControl"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;AAaA,MAAMA,WAAW,GAAKC,KAAF,IAAyB;AAC5C,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAiCF,KAAvC;;AAEA,MAAK,CAAEC,KAAP,EAAe;AACd,WAAO,IAAP;AACA;;AAED,SAAOC,mBAAmB,GACzB,4BAAC,8BAAD;AAAgB,IAAA,EAAE,EAAC;AAAnB,KAA6BD,KAA7B,CADyB,GAGzB,4BAAC,8BAAD,QAAeA,KAAf,CAHD;AAKA,CAZD;;AAcA,MAAME,wBAAwB,GAAG,CAChCH,KADgC,EAEhCI,YAFgC,KAG5B;AACJ,QAAM;AACLC,IAAAA,MADK;AAELC,IAAAA,mBAFK;AAGLC,IAAAA,WAHK;AAILC,IAAAA,WAAW,GAAG,IAJT;AAKLN,IAAAA,mBALK;AAMLO,IAAAA,qBANK;AAOLR,IAAAA,KAPK;AAQLS,IAAAA,cARK;AASLC,IAAAA,cATK;AAULC,IAAAA,aAVK;AAWL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AM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAES,KAAR,KAAiB,EAJ1B;AAKC,IAAA,WAAW,EAAGf;AALf,IAnBD,CADD,EA4BGU,UAAU,IACX,4BAAC,qBAAD;AACC,IAAA,SAAS,EAAGN,eADb;AAEC,IAAA,eAAe,EAAG,CAFnB;AAGC,IAAA,GAAG,EAAG,GAHP;AAIC,IAAA,GAAG,EAAG,CAJP;AAKC,IAAA,QAAQ,EAAGN,cALZ;AAMC,IAAA,IAAI,EAAG,CAAE,IAAF,EAAQ,GAAR,EAAckB,QAAd,CAAwBR,SAAxB,IAAsC,CAAtC,GAA0C,GANlD;AAOC,IAAA,KAAK,EAAGC,UAAU,IAAIQ,SAPvB;AAQC,IAAA,cAAc,EAAG;AARlB,IA7BF,CALD,CADD;AAiDA,CAhFD;AAkFA;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,MAAMC,aAAa,GAAG,6BAC5B5B,wBAD4B,EAE5B,eAF4B,CAAtB;;eAKQ4B,a","sourcesContent":["/**\n * Internal dependencies\n */\nimport BorderControlDropdown from '../border-control-dropdown';\nimport UnitControl from '../../unit-control';\nimport RangeControl from '../../range-control';\nimport { HStack } from '../../h-stack';\nimport { StyledLabel } from '../../base-control/styles/base-control-styles';\nimport { View } from '../../view';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { useBorderControl } from './hook';\n\nimport type { BorderControlProps, LabelProps } from '../types';\n\nconst BorderLabel = ( props: LabelProps ) => {\n\tconst { label, hideLabelFromVision } = props;\n\n\tif ( ! label ) {\n\t\treturn null;\n\t}\n\n\treturn hideLabelFromVision ? (\n\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t) : (\n\t\t<StyledLabel>{ label }</StyledLabel>\n\t);\n};\n\nconst UnconnectedBorderControl = (\n\tprops: WordPressComponentProps< BorderControlProps, 'div', false >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tenableAlpha,\n\t\tenableStyle = true,\n\t\thideLabelFromVision,\n\t\tinnerWrapperClassName,\n\t\tlabel,\n\t\tonBorderChange,\n\t\tonSliderChange,\n\t\tonWidthChange,\n\t\tplaceholder,\n\t\t__unstablePopoverProps,\n\t\tpreviousStyleSelection,\n\t\tshowDropdownHeader,\n\t\tsliderClassName,\n\t\tvalue: border,\n\t\twidthControlClassName,\n\t\twidthUnit,\n\t\twidthValue,\n\t\twithSlider,\n\t\t__experimentalHasMultipleOrigins,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t__next36pxDefaultSize,\n\t\t...otherProps\n\t} = useBorderControl( props );\n\n\treturn (\n\t\t<View { ...otherProps } ref={ forwardedRef }>\n\t\t\t<BorderLabel\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t/>\n\t\t\t<HStack spacing={ 3 }>\n\t\t\t\t<HStack className={ innerWrapperClassName } alignment=\"stretch\">\n\t\t\t\t\t<BorderControlDropdown\n\t\t\t\t\t\tborder={ border }\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\t__unstablePopoverProps={ __unstablePopoverProps }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onBorderChange }\n\t\t\t\t\t\tpreviousStyleSelection={ previousStyleSelection }\n\t\t\t\t\t\tshowDropdownHeader={ showDropdownHeader }\n\t\t\t\t\t\t__experimentalHasMultipleOrigins={\n\t\t\t\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t\t\t/>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tclassName={ widthControlClassName }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tonChange={ onWidthChange }\n\t\t\t\t\t\tvalue={ border?.width || '' }\n\t\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\t/>\n\t\t\t\t</HStack>\n\t\t\t\t{ withSlider && (\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\tclassName={ sliderClassName }\n\t\t\t\t\t\tinitialPosition={ 0 }\n\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tonChange={ onSliderChange }\n\t\t\t\t\t\tstep={ [ 'px', '%' ].includes( widthUnit ) ? 1 : 0.1 }\n\t\t\t\t\t\tvalue={ widthValue || undefined }\n\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</View>\n\t);\n};\n\n/**\n * The `BorderControl` brings together internal sub-components which allow users to\n * set the various properties of a border. The first sub-component, a\n * `BorderDropdown` contains options representing border color and style. The\n * border width is controlled via a `UnitControl` and an optional `RangeControl`.\n *\n * Border radius is not covered by this control as it may be desired separate to\n * color, style, and width. For example, the border radius may be absorbed under\n * a \"shape\" abstraction.\n *\n * ```jsx\n * import { __experimentalBorderControl as BorderControl } from '@wordpress/components';\n * import { __ } from '@wordpress/i18n';\n *\n * const colors = [\n * \t{ name: 'Blue 20', color: '#72aee6' },\n * \t// ...\n * ];\n *\n * const MyBorderControl = () => {\n * \tconst [ border, setBorder ] = useState();\n * \tconst onChange = ( newBorder ) => setBorder( newBorder );\n *\n * \treturn (\n * \t\t<BorderControl\n * \t\t\tcolors={ colors }\n * \t\t\tlabel={ __( 'Border' ) }\n * \t\t\tonChange={ onChange }\n * \t\t\tvalue={ border }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport const BorderControl = contextConnect(\n\tUnconnectedBorderControl,\n\t'BorderControl'\n);\n\nexport default BorderControl;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/border-control/border-control/hook.ts"],"names":["sanitizeBorder","border","hasNoWidth","width","undefined","hasNoColor","color","useBorderControl","props","className","isCompact","onChange","shouldSanitizeBorder","value","__next36pxDefaultSize","otherProps","widthValue","originalWidthUnit","widthUnit","hadPreviousZeroWidth","colorSelection","setColorSelection","styleSelection","setStyleSelection","onBorderChange","newBorder","onWidthChange","newWidth","newWidthValue","parsedValue","hasZeroWidth","updatedBorder","style","onSliderChange","cx","classes","styles","borderControl","innerWrapperClassName","wrapperWidth","widthStyle","heightStyle","wrapperHeight","innerWrapper","widthControlClassName","borderWidthControl","sliderClassName","borderSlider","previousStyleSelection"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;;;;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAQA,MAAMA,cAAc,GAAKC,MAAF,IAAuB;AAC7C,QAAMC,UAAU,GAAG,CAAAD,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEE,KAAR,MAAkBC,SAAlB,IAA+BH,MAAM,CAACE,KAAP,KAAiB,EAAnE;AACA,QAAME,UAAU,GAAG,CAAAJ,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEK,KAAR,MAAkBF,SAArC,CAF6C,CAI7C;;AACA,MAAKF,UAAU,IAAIG,UAAnB,EAAgC;AAC/B,WAAOD,SAAP;AACA;;AAED,SAAOH,MAAP;AACA,CAVD;;AAYO,SAASM,gBAAT,CACNC,KADM,EAEL;AACD,QAAM;AACLC,IAAAA,SADK;AAELC,IAAAA,SAFK;AAGLC,IAAAA,QAHK;AAILC,IAAAA,oBAAoB,GAAG,IAJlB;AAKLC,IAAAA,KAAK,EAAEZ,MALF;AAMLE,IAAAA,KANK;AAOLW,IAAAA,qBAAqB,GAAG,KAPnB;AAQL,OAAGC;AARE,MASF,+BAAkBP,KAAlB,EAAyB,eAAzB,CATJ;AAWA,QAAM,CAAEQ,UAAF,EAAcC,iBAAd,IAAoC,6CACzChB,MADyC,aACzCA,MADyC,uBACzCA,MAAM,CAAEE,KADiC,CAA1C;AAGA,QAAMe,SAAS,GAAGD,iBAAiB,IAAI,IAAvC;AACA,QAAME,oBAAoB,GAAGH,UAAU,KAAK,CAA5C;AAEA,QAAM,CAAEI,cAAF,EAAkBC,iBAAlB,IAAwC,wBAA9C;AACA,QAAM,CAAEC,cAAF,EAAkBC,iBAAlB,IAAwC,wBAA9C;AAEA,QAAMC,cAAc,GAAG,0BACpBC,SAAF,IAA0B;AACzB,QAAKb,oBAAL,EAA4B;AAC3B,aAAOD,QAAQ,CAAEX,cAAc,CAAEyB,SAAF,CAAhB,CAAf;AACA;;AAEDd,IAAAA,QAAQ,CAAEc,SAAF,CAAR;AACA,GAPqB,EAQtB,CAAEd,QAAF,EAAYC,oBAAZ,CARsB,CAAvB;AAWA,QAAMc,aAAa,GAAG,0BACnBC,QAAF,IAAyB;AACxB,UAAMC,aAAa,GAAGD,QAAQ,KAAK,EAAb,GAAkBvB,SAAlB,GAA8BuB,QAApD;AACA,UAAM,CAAEE,WAAF,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/border-control/border-control/hook.ts"],"names":["sanitizeBorder","border","hasNoWidth","width","undefined","hasNoColor","color","useBorderControl","props","className","isCompact","onChange","shouldSanitizeBorder","value","__next36pxDefaultSize","otherProps","widthValue","originalWidthUnit","widthUnit","hadPreviousZeroWidth","colorSelection","setColorSelection","styleSelection","setStyleSelection","onBorderChange","newBorder","onWidthChange","newWidth","newWidthValue","parsedValue","hasZeroWidth","updatedBorder","style","onSliderChange","cx","classes","styles","borderControl","innerWrapperClassName","wrapperWidth","widthStyle","heightStyle","wrapperHeight","innerWrapper","widthControlClass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M;AAINd,IAAAA,cAJM;AAKNS,IAAAA,cALM;AAMNP,IAAAA,aANM;AAONsB,IAAAA,sBAAsB,EAAE1B,cAPlB;AAQNwB,IAAAA,eARM;AASNjC,IAAAA,KAAK,EAAEZ,MATD;AAUN2C,IAAAA,qBAVM;AAWN1B,IAAAA,SAXM;AAYNF,IAAAA,UAZM;AAaNF,IAAAA;AAbM,GAAP;AAeA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport * as styles from '../styles';\nimport { parseQuantityAndUnitFromRawValue } from '../../unit-control/utils';\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\n\nimport type { Border, BorderControlProps } from '../types';\n\nconst sanitizeBorder = ( border?: Border ) => {\n\tconst hasNoWidth = border?.width === undefined || border.width === '';\n\tconst hasNoColor = border?.color === undefined;\n\n\t// If width and color are undefined, unset any style selection as well.\n\tif ( hasNoWidth && hasNoColor ) {\n\t\treturn undefined;\n\t}\n\n\treturn border;\n};\n\nexport function useBorderControl(\n\tprops: WordPressComponentProps< BorderControlProps, 'div' >\n) {\n\tconst {\n\t\tclassName,\n\t\tisCompact,\n\t\tonChange,\n\t\tshouldSanitizeBorder = true,\n\t\tvalue: border,\n\t\twidth,\n\t\t__next36pxDefaultSize = false,\n\t\t...otherProps\n\t} = useContextSystem( props, 'BorderControl' );\n\n\tconst [ widthValue, originalWidthUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tborder?.width\n\t);\n\tconst widthUnit = originalWidthUnit || 'px';\n\tconst hadPreviousZeroWidth = widthValue === 0;\n\n\tconst [ colorSelection, setColorSelection ] = useState< string >();\n\tconst [ styleSelection, setStyleSelection ] = useState< string >();\n\n\tconst onBorderChange = useCallback(\n\t\t( newBorder?: Border ) => {\n\t\t\tif ( shouldSanitizeBorder ) {\n\t\t\t\treturn onChange( sanitizeBorder( newBorder ) );\n\t\t\t}\n\n\t\t\tonChange( newBorder );\n\t\t},\n\t\t[ onChange, shouldSanitizeBorder ]\n\t);\n\n\tconst onWidthChange = useCallback(\n\t\t( newWidth?: string ) => {\n\t\t\tconst newWidthValue = newWidth === '' ? undefined : newWidth;\n\t\t\tconst [ parsedValue ] =\n\t\t\t\tparseQuantityAndUnitFromRawValue( newWidth );\n\t\t\tconst hasZeroWidth = parsedValue === 0;\n\n\t\t\tconst updatedBorder = { ...border, width: newWidthValue };\n\n\t\t\t// Setting the border width explicitly to zero will also set the\n\t\t\t// border style to `none` and clear the border color.\n\t\t\tif ( hasZeroWidth && ! hadPreviousZeroWidth ) {\n\t\t\t\t// Before clearing the color and style selections, keep track of\n\t\t\t\t// the current selections so they can be restored when the width\n\t\t\t\t// changes to a non-zero value.\n\t\t\t\tsetColorSelection( border?.color );\n\t\t\t\tsetStyleSelection( border?.style );\n\n\t\t\t\t// Clear the color and style border properties.\n\t\t\t\tupdatedBorder.color = undefined;\n\t\t\t\tupdatedBorder.style = 'none';\n\t\t\t}\n\n\t\t\t// Selection has changed from zero border width to non-zero width.\n\t\t\tif ( ! hasZeroWidth && hadPreviousZeroWidth ) {\n\t\t\t\t// Restore previous border color and style selections if width\n\t\t\t\t// is now not zero.\n\t\t\t\tif ( updatedBorder.color === undefined ) {\n\t\t\t\t\tupdatedBorder.color = colorSelection;\n\t\t\t\t}\n\t\t\t\tif ( updatedBorder.style === 'none' ) {\n\t\t\t\t\tupdatedBorder.style = styleSelection;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tonBorderChange( updatedBorder );\n\t\t},\n\t\t[\n\t\t\tborder,\n\t\t\thadPreviousZeroWidth,\n\t\t\tcolorSelection,\n\t\t\tstyleSelection,\n\t\t\tonBorderChange,\n\t\t]\n\t);\n\n\tconst onSliderChange = useCallback(\n\t\t( value?: number ) => {\n\t\t\tonWidthChange( `${ value }${ widthUnit }` );\n\t\t},\n\t\t[ onWidthChange, widthUnit ]\n\t);\n\n\t// Generate class names.\n\tconst cx = useCx();\n\tconst classes = useMemo( () => {\n\t\treturn cx( styles.borderControl, className );\n\t}, [ className, cx ] );\n\n\tconst innerWrapperClassName = useMemo( () => {\n\t\tconst wrapperWidth = isCompact ? '90px' : width;\n\t\tconst widthStyle =\n\t\t\t!! wrapperWidth && styles.wrapperWidth( wrapperWidth );\n\t\tconst heightStyle = styles.wrapperHeight( __next36pxDefaultSize );\n\n\t\treturn cx( styles.innerWrapper(), widthStyle, heightStyle );\n\t}, [ isCompact, width, cx, __next36pxDefaultSize ] );\n\n\tconst widthControlClassName = useMemo( () => {\n\t\treturn cx( styles.borderWidthControl() );\n\t}, [ cx ] );\n\n\tconst sliderClassName = useMemo( () => {\n\t\treturn cx( styles.borderSlider() );\n\t}, [ cx ] );\n\n\treturn {\n\t\t...otherProps,\n\t\tclassName: classes,\n\t\tinnerWrapperClassName,\n\t\tonBorderChange,\n\t\tonSliderChange,\n\t\tonWidthChange,\n\t\tpreviousStyleSelection: styleSelection,\n\t\tsliderClassName,\n\t\tvalue: border,\n\t\twidthControlClassName,\n\t\twidthUnit,\n\t\twidthValue,\n\t\t__next36pxDefaultSize,\n\t};\n}\n"]}
|
|
@@ -11,25 +11,21 @@ var _element = require("@wordpress/element");
|
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
14
|
-
var _lodash = require("lodash");
|
|
15
|
-
|
|
16
14
|
var _unitControl = _interopRequireDefault(require("./unit-control"));
|
|
17
15
|
|
|
18
16
|
var _utils = require("./utils");
|
|
19
17
|
|
|
20
|
-
/**
|
|
21
|
-
* External dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
18
|
/**
|
|
25
19
|
* Internal dependencies
|
|
26
20
|
*/
|
|
21
|
+
const noop = () => {};
|
|
22
|
+
|
|
27
23
|
function AllInputControl(_ref) {
|
|
28
24
|
let {
|
|
29
|
-
onChange =
|
|
30
|
-
onFocus =
|
|
31
|
-
onHoverOn =
|
|
32
|
-
onHoverOff =
|
|
25
|
+
onChange = noop,
|
|
26
|
+
onFocus = noop,
|
|
27
|
+
onHoverOn = noop,
|
|
28
|
+
onHoverOff = noop,
|
|
33
29
|
values,
|
|
34
30
|
sides,
|
|
35
31
|
selectedUnits,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/box-control/all-input-control.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/box-control/all-input-control.js"],"names":["noop","AllInputControl","onChange","onFocus","onHoverOn","onHoverOff","values","sides","selectedUnits","setSelectedUnits","props","allValue","hasValues","isMixed","allPlaceholder","LABELS","mixed","handleOnFocus","event","side","applyValueToSides","currentValues","newValue","newValues","length","forEach","top","bottom","left","right","ALL_SIDES","handleOnChange","next","isNumeric","isNaN","parseFloat","nextValue","undefined","nextValues","handleOnUnitChange","unit","newUnits","handleOnHoverOn","handleOnHoverOff"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAUA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEe,SAASC,eAAT,OAUX;AAAA,MAVqC;AACxCC,IAAAA,QAAQ,GAAGF,IAD6B;AAExCG,IAAAA,OAAO,GAAGH,IAF8B;AAGxCI,IAAAA,SAAS,GAAGJ,IAH4B;AAIxCK,IAAAA,UAAU,GAAGL,IAJ2B;AAKxCM,IAAAA,MALwC;AAMxCC,IAAAA,KANwC;AAOxCC,IAAAA,aAPwC;AAQxCC,IAAAA,gBARwC;AASxC,OAAGC;AATqC,GAUrC;AACH,QAAMC,QAAQ,GAAG,wBAAaL,MAAb,EAAqBE,aAArB,EAAoCD,KAApC,CAAjB;AACA,QAAMK,SAAS,GAAG,4BAAiBN,MAAjB,CAAlB;AACA,QAAMO,OAAO,GAAGD,SAAS,IAAI,0BAAeN,MAAf,EAAuBE,aAAvB,EAAsCD,KAAtC,CAA7B;AACA,QAAMO,cAAc,GAAGD,OAAO,GAAGE,cAAOC,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;AACA;;;AACA,QAAMC,kBAAkB,GAAKC,IAAF,IAAY;AACtC,UAAMC,QAAQ,GAAGrB,iBAAiB,CAAEZ,aAAF,EAAiBgC,IAAjB,CAAlC;AACA/B,IAAAA,gBAAgB,CAAEgC,QAAF,CAAhB;AACA,GAHD;;AAKA,QAAMC,eAAe,GAAG,MAAM;AAC7BtC,IAAAA,SAAS,CAAE;AACVsB,MAAAA,GAAG,EAAE,IADK;AAEVC,MAAAA,MAAM,EAAE,IAFE;AAGVC,MAAAA,IAAI,EAAE,IAHI;AAIVC,MAAAA,KAAK,EAAE;AAJG,KAAF,CAAT;AAMA,GAPD;;AASA,QAAMc,gBAAgB,GAAG,MAAM;AAC9BtC,IAAAA,UAAU,CAAE;AACXqB,MAAAA,GAAG,EAAE,KADM;AAEXC,MAAAA,MAAM,EAAE,KAFG;AAGXC,MAAAA,IAAI,EAAE,KAHK;AAIXC,MAAAA,KAAK,EAAE;AAJI,KAAF,CAAV;AAMA,GAPD;;AASA,SACC,4BAAC,oBAAD,6BACMnB,KADN;AAEC,IAAA,YAAY,EAAGG,OAFhB;AAGC,IAAA,MAAM,MAHP;AAIC,IAAA,KAAK,EAAGF,QAJT;AAKC,IAAA,QAAQ,EAAGoB,cALZ;AAMC,IAAA,YAAY,EAAGQ,kBANhB;AAOC,IAAA,OAAO,EAAGtB,aAPX;AAQC,IAAA,SAAS,EAAGyB,eARb;AASC,IAAA,UAAU,EAAGC,gBATd;AAUC,IAAA,WAAW,EAAG7B;AAVf,KADD;AAcA","sourcesContent":["/**\n * Internal dependencies\n */\nimport UnitControl from './unit-control';\nimport {\n\tALL_SIDES,\n\tLABELS,\n\tgetAllValue,\n\tisValuesMixed,\n\tisValuesDefined,\n} from './utils';\n\nconst noop = () => {};\n\nexport default function AllInputControl( {\n\tonChange = noop,\n\tonFocus = noop,\n\tonHoverOn = noop,\n\tonHoverOff = noop,\n\tvalues,\n\tsides,\n\tselectedUnits,\n\tsetSelectedUnits,\n\t...props\n} ) {\n\tconst allValue = getAllValue( values, selectedUnits, sides );\n\tconst hasValues = isValuesDefined( values );\n\tconst isMixed = hasValues && isValuesMixed( values, selectedUnits, sides );\n\tconst allPlaceholder = isMixed ? LABELS.mixed : null;\n\n\tconst handleOnFocus = ( event ) => {\n\t\tonFocus( event, { side: 'all' } );\n\t};\n\n\t// Applies a value to an object representing top, right, bottom and left\n\t// sides while taking into account any custom side configuration.\n\tconst applyValueToSides = ( currentValues, newValue ) => {\n\t\tconst newValues = { ...currentValues };\n\n\t\tif ( sides?.length ) {\n\t\t\tsides.forEach( ( side ) => {\n\t\t\t\tif ( side === 'vertical' ) {\n\t\t\t\t\tnewValues.top = newValue;\n\t\t\t\t\tnewValues.bottom = newValue;\n\t\t\t\t} else if ( side === 'horizontal' ) {\n\t\t\t\t\tnewValues.left = newValue;\n\t\t\t\t\tnewValues.right = newValue;\n\t\t\t\t} else {\n\t\t\t\t\tnewValues[ side ] = newValue;\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tALL_SIDES.forEach( ( side ) => ( newValues[ side ] = newValue ) );\n\t\t}\n\n\t\treturn newValues;\n\t};\n\n\tconst handleOnChange = ( next ) => {\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\t\tconst nextValues = applyValueToSides( values, nextValue );\n\n\t\tonChange( nextValues );\n\t};\n\n\t// Set selected unit so it can be used as fallback by unlinked controls\n\t// when individual sides do not have a value containing a unit.\n\tconst handleOnUnitChange = ( unit ) => {\n\t\tconst newUnits = applyValueToSides( selectedUnits, unit );\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\tconst handleOnHoverOn = () => {\n\t\tonHoverOn( {\n\t\t\ttop: true,\n\t\t\tbottom: true,\n\t\t\tleft: true,\n\t\t\tright: true,\n\t\t} );\n\t};\n\n\tconst handleOnHoverOff = () => {\n\t\tonHoverOff( {\n\t\t\ttop: false,\n\t\t\tbottom: false,\n\t\t\tleft: false,\n\t\t\tright: false,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<UnitControl\n\t\t\t{ ...props }\n\t\t\tdisableUnits={ isMixed }\n\t\t\tisOnly\n\t\t\tvalue={ allValue }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonUnitChange={ handleOnUnitChange }\n\t\t\tonFocus={ handleOnFocus }\n\t\t\tonHoverOn={ handleOnHoverOn }\n\t\t\tonHoverOff={ handleOnHoverOff }\n\t\t\tplaceholder={ allPlaceholder }\n\t\t/>\n\t);\n}\n"]}
|