@wordpress/components 25.0.0 → 25.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/build/alignment-matrix-control/cell.js +5 -6
- package/build/alignment-matrix-control/cell.js.map +1 -1
- package/build/alignment-matrix-control/icon.js +8 -9
- package/build/alignment-matrix-control/icon.js.map +1 -1
- package/build/alignment-matrix-control/index.js +10 -11
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +6 -8
- package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +1 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +6 -8
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build/alignment-matrix-control/utils.js +1 -2
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js +6 -9
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/angle-picker-control/styles/angle-picker-control-styles.js +3 -4
- package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
- package/build/animate/index.js +5 -6
- package/build/animate/index.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +29 -33
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.native.js +15 -22
- package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build/autocomplete/background-view.android.js +3 -4
- package/build/autocomplete/background-view.android.js.map +1 -1
- package/build/autocomplete/background-view.ios.js +3 -4
- package/build/autocomplete/background-view.ios.js.map +1 -1
- package/build/autocomplete/get-default-use-items.js +1 -3
- package/build/autocomplete/get-default-use-items.js.map +1 -1
- package/build/autocomplete/index.js +18 -23
- package/build/autocomplete/index.js.map +1 -1
- package/build/base-control/index.js +14 -16
- package/build/base-control/index.js.map +1 -1
- package/build/base-control/index.native.js +5 -6
- package/build/base-control/index.native.js.map +1 -1
- package/build/base-control/styles/base-control-styles.js +6 -8
- package/build/base-control/styles/base-control-styles.js.map +1 -1
- package/build/border-box-control/border-box-control/hook.js +5 -5
- package/build/border-box-control/border-box-control/hook.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js +4 -4
- package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build/border-box-control/styles.js +3 -3
- package/build/border-box-control/styles.js.map +1 -1
- package/build/border-box-control/utils.js +5 -8
- package/build/border-box-control/utils.js.map +1 -1
- package/build/border-control/border-control/component.js +1 -1
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js +5 -5
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +70 -67
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/hook.js +4 -4
- package/build/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build/box-control/all-input-control.js +11 -12
- package/build/box-control/all-input-control.js.map +1 -1
- package/build/box-control/axial-input-controls.js +12 -14
- package/build/box-control/axial-input-controls.js.map +1 -1
- package/build/box-control/icon.js +7 -9
- package/build/box-control/icon.js.map +1 -1
- package/build/box-control/index.js +22 -24
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-controls.js +15 -18
- package/build/box-control/input-controls.js.map +1 -1
- package/build/box-control/linked-button.js +4 -5
- package/build/box-control/linked-button.js.map +1 -1
- package/build/box-control/styles/box-control-icon-styles.js +3 -4
- package/build/box-control/styles/box-control-icon-styles.js.map +1 -1
- package/build/box-control/styles/box-control-styles.js +9 -12
- package/build/box-control/styles/box-control-styles.js.map +1 -1
- package/build/box-control/styles/box-control-visualizer-styles.js +7 -11
- package/build/box-control/styles/box-control-visualizer-styles.js.map +1 -1
- package/build/box-control/unit-control.js +18 -22
- package/build/box-control/unit-control.js.map +1 -1
- package/build/box-control/utils.js +4 -10
- package/build/box-control/utils.js.map +1 -1
- package/build/button/deprecated.js +7 -8
- package/build/button/deprecated.js.map +1 -1
- package/build/button/index.js +15 -16
- package/build/button/index.js.map +1 -1
- package/build/button/index.native.js +5 -7
- package/build/button/index.native.js.map +1 -1
- package/build/card/card/hook.js +5 -6
- package/build/card/card/hook.js.map +1 -1
- package/build/circular-option-picker/index.js +27 -33
- package/build/circular-option-picker/index.js.map +1 -1
- package/build/clipboard-button/index.js +8 -9
- package/build/clipboard-button/index.js.map +1 -1
- package/build/color-control/index.native.js +7 -8
- package/build/color-control/index.native.js.map +1 -1
- package/build/color-indicator/index.native.js +10 -12
- package/build/color-indicator/index.native.js.map +1 -1
- package/build/color-palette/index.js +63 -72
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/index.native.js +33 -47
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-palette/utils.js +2 -5
- package/build/color-palette/utils.js.map +1 -1
- package/build/color-picker/color-input.js +6 -7
- package/build/color-picker/color-input.js.map +1 -1
- package/build/color-picker/hex-input.js +8 -12
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/hsl-input.js +5 -6
- package/build/color-picker/hsl-input.js.map +1 -1
- package/build/color-picker/index.native.js +23 -30
- package/build/color-picker/index.native.js.map +1 -1
- package/build/color-picker/input-with-slider.js +8 -10
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/color-picker/picker.js +5 -6
- package/build/color-picker/picker.js.map +1 -1
- package/build/color-picker/rgb-input.js +5 -6
- package/build/color-picker/rgb-input.js.map +1 -1
- package/build/color-picker/use-deprecated-props.js +1 -3
- package/build/color-picker/use-deprecated-props.js.map +1 -1
- package/build/combobox-control/index.js +3 -6
- package/build/combobox-control/index.js.map +1 -1
- package/build/combobox-control/styles.js +3 -6
- package/build/combobox-control/styles.js.map +1 -1
- package/build/confirm-dialog/component.js +1 -1
- package/build/confirm-dialog/component.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js +116 -131
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/index.js +12 -14
- package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/utils.js +4 -6
- package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
- package/build/custom-gradient-picker/index.js +19 -22
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/custom-gradient-picker/index.native.js +7 -8
- package/build/custom-gradient-picker/index.native.js.map +1 -1
- package/build/custom-gradient-picker/serializer.js +15 -21
- package/build/custom-gradient-picker/serializer.js.map +1 -1
- package/build/custom-gradient-picker/utils.js +6 -9
- package/build/custom-gradient-picker/utils.js.map +1 -1
- package/build/custom-select-control/index.js +14 -21
- package/build/custom-select-control/index.js.map +1 -1
- package/build/dashicon/index.js +7 -8
- package/build/dashicon/index.js.map +1 -1
- package/build/dashicon/index.native.js +4 -5
- package/build/dashicon/index.native.js.map +1 -1
- package/build/date-time/date/index.js +24 -26
- package/build/date-time/date/index.js.map +1 -1
- package/build/date-time/date-time/index.js +9 -10
- package/build/date-time/date-time/index.js.map +1 -1
- package/build/date-time/time/index.js +11 -14
- package/build/date-time/time/index.js.map +1 -1
- package/build/dimension-control/index.js +8 -11
- package/build/dimension-control/index.js.map +1 -1
- package/build/disabled/index.js +6 -7
- package/build/disabled/index.js.map +1 -1
- package/build/disabled/index.native.js +3 -4
- package/build/disabled/index.native.js.map +1 -1
- package/build/divider/styles.js +21 -29
- package/build/divider/styles.js.map +1 -1
- package/build/draggable/index.js +14 -19
- package/build/draggable/index.js.map +1 -1
- package/build/draggable/index.native.js +17 -19
- package/build/draggable/index.native.js.map +1 -1
- package/build/drop-zone/index.js +11 -16
- package/build/drop-zone/index.js.map +1 -1
- package/build/drop-zone/provider.js +3 -4
- package/build/drop-zone/provider.js.map +1 -1
- package/build/dropdown/index.js +19 -23
- package/build/dropdown/index.js.map +1 -1
- package/build/dropdown/styles.js +3 -4
- package/build/dropdown/styles.js.map +1 -1
- package/build/dropdown-menu/index.js +9 -15
- package/build/dropdown-menu/index.js.map +1 -1
- package/build/dropdown-menu/index.native.js +22 -30
- package/build/dropdown-menu/index.native.js.map +1 -1
- package/build/dropdown-menu-v2/index.js +92 -57
- package/build/dropdown-menu-v2/index.js.map +1 -1
- package/build/dropdown-menu-v2/styles.js +25 -17
- package/build/dropdown-menu-v2/styles.js.map +1 -1
- package/build/duotone-picker/color-list-picker/index.js +16 -18
- package/build/duotone-picker/color-list-picker/index.js.map +1 -1
- package/build/duotone-picker/custom-duotone-bar.js +4 -5
- package/build/duotone-picker/custom-duotone-bar.js.map +1 -1
- package/build/duotone-picker/duotone-picker.js +15 -17
- package/build/duotone-picker/duotone-picker.js.map +1 -1
- package/build/duotone-picker/duotone-swatch.js +3 -4
- package/build/duotone-picker/duotone-swatch.js.map +1 -1
- package/build/duotone-picker/utils.js +14 -27
- package/build/duotone-picker/utils.js.map +1 -1
- package/build/external-link/index.js +1 -1
- package/build/external-link/index.js.map +1 -1
- package/build/external-link/index.native.js +4 -5
- package/build/external-link/index.native.js.map +1 -1
- package/build/focal-point-picker/controls.js +11 -10
- package/build/focal-point-picker/controls.js.map +1 -1
- package/build/focal-point-picker/focal-point.js +5 -6
- package/build/focal-point-picker/focal-point.js.map +1 -1
- package/build/focal-point-picker/focal-point.native.js +5 -6
- package/build/focal-point-picker/focal-point.native.js.map +1 -1
- package/build/focal-point-picker/grid.js +4 -5
- package/build/focal-point-picker/grid.js.map +1 -1
- package/build/focal-point-picker/index.js +33 -37
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/index.native.js +10 -12
- package/build/focal-point-picker/index.native.js.map +1 -1
- package/build/focal-point-picker/media.js +11 -13
- package/build/focal-point-picker/media.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-picker-style.js +9 -14
- package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-style.js +3 -6
- package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build/focal-point-picker/tooltip/index.native.js +16 -21
- package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build/focal-point-picker/utils.js +2 -4
- package/build/focal-point-picker/utils.js.map +1 -1
- package/build/focusable-iframe/index.js +4 -5
- package/build/focusable-iframe/index.js.map +1 -1
- package/build/font-size-picker/font-size-picker-select.js +3 -5
- package/build/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build/font-size-picker/index.js +13 -19
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/index.native.js +6 -7
- package/build/font-size-picker/index.native.js.map +1 -1
- package/build/font-size-picker/styles.js +24 -8
- package/build/font-size-picker/styles.js.map +1 -1
- package/build/footer-message-control/index.native.js +2 -3
- package/build/footer-message-control/index.native.js.map +1 -1
- package/build/form-file-upload/index.js +10 -13
- package/build/form-file-upload/index.js.map +1 -1
- package/build/form-token-field/index.js +4 -19
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/styles.js +4 -7
- package/build/form-token-field/styles.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +14 -15
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/form-token-field/token-input.js +2 -2
- package/build/form-token-field/token-input.js.map +1 -1
- package/build/form-token-field/token.js +14 -15
- package/build/form-token-field/token.js.map +1 -1
- package/build/gradient-picker/index.js +51 -58
- package/build/gradient-picker/index.js.map +1 -1
- package/build/guide/icons.js +13 -16
- package/build/guide/icons.js.map +1 -1
- package/build/guide/index.js +9 -12
- package/build/guide/index.js.map +1 -1
- package/build/guide/page-control.js +5 -6
- package/build/guide/page-control.js.map +1 -1
- package/build/h-stack/utils.js +1 -3
- package/build/h-stack/utils.js.map +1 -1
- package/build/higher-order/navigate-regions/index.js +16 -22
- package/build/higher-order/navigate-regions/index.js.map +1 -1
- package/build/higher-order/with-focus-outside/index.js +1 -1
- package/build/higher-order/with-focus-outside/index.js.map +1 -1
- package/build/higher-order/with-focus-outside/index.native.js +1 -1
- package/build/higher-order/with-focus-outside/index.native.js.map +1 -1
- package/build/higher-order/with-focus-return/index.js +13 -17
- package/build/higher-order/with-focus-return/index.js.map +1 -1
- package/build/icon/index.js +5 -7
- package/build/icon/index.js.map +1 -1
- package/build/input-control/backdrop.js +4 -5
- package/build/input-control/backdrop.js.map +1 -1
- package/build/input-control/index.js +22 -23
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js +16 -17
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/input-field.js +26 -29
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/label.js +6 -7
- package/build/input-control/label.js.map +1 -1
- package/build/input-control/reducer/reducer.js +2 -6
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +32 -41
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/input-control/utils.js +1 -3
- package/build/input-control/utils.js.map +1 -1
- package/build/keyboard-shortcuts/index.js +21 -26
- package/build/keyboard-shortcuts/index.js.map +1 -1
- package/build/menu-items-choice/index.js +6 -7
- package/build/menu-items-choice/index.js.map +1 -1
- package/build/mobile/audio-player/index.native.js +7 -8
- package/build/mobile/audio-player/index.native.js.map +1 -1
- package/build/mobile/badge/index.native.js +5 -6
- package/build/mobile/badge/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +10 -12
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +10 -13
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build/mobile/bottom-sheet/button.native.js +18 -21
- package/build/mobile/bottom-sheet/button.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +8 -4
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/color-cell.native.js +3 -1
- package/build/mobile/bottom-sheet/color-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/footer-message-cell.native.js +4 -5
- package/build/mobile/bottom-sheet/footer-message-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js +4 -5
- package/build/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.native.js +19 -30
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/link-cell.native.js +6 -7
- package/build/mobile/bottom-sheet/link-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +5 -6
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/lock-icon/index.native.js +33 -0
- package/build/mobile/bottom-sheet/lock-icon/index.native.js.map +1 -0
- package/build/mobile/bottom-sheet/nav-bar/action-button.native.js +6 -7
- package/build/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
- package/build/mobile/bottom-sheet/nav-bar/apply-button.native.js +3 -4
- package/build/mobile/bottom-sheet/nav-bar/apply-button.native.js.map +1 -1
- package/build/mobile/bottom-sheet/nav-bar/back-button.native.js +12 -15
- package/build/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
- package/build/mobile/bottom-sheet/nav-bar/heading.native.js +3 -4
- package/build/mobile/bottom-sheet/nav-bar/heading.native.js.map +1 -1
- package/build/mobile/bottom-sheet/nav-bar/index.native.js +3 -4
- package/build/mobile/bottom-sheet/nav-bar/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/radio-cell.native.js +4 -3
- package/build/mobile/bottom-sheet/radio-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-cell.native.js +5 -2
- package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-text-input.native.js +5 -6
- package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
- package/build/mobile/bottom-sheet/ripple.native.js +10 -11
- package/build/mobile/bottom-sheet/ripple.native.js.map +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js +1 -2
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/stepper.android.js +11 -12
- package/build/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/stepper.ios.js +11 -12
- package/build/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
- package/build/mobile/bottom-sheet/sub-sheet/index.native.js +6 -7
- package/build/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet-select-control/index.native.js +9 -10
- package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet-text-control/index.native.js +11 -12
- package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js +12 -13
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/color-settings/utils.native.js +2 -2
- package/build/mobile/color-settings/utils.native.js.map +1 -1
- package/build/mobile/cycle-select-control/index.native.js +11 -12
- package/build/mobile/cycle-select-control/index.native.js.map +1 -1
- package/build/mobile/focal-point-settings-panel/index.native.js +6 -7
- package/build/mobile/focal-point-settings-panel/index.native.js.map +1 -1
- package/build/mobile/global-styles-context/index.native.js +6 -14
- package/build/mobile/global-styles-context/index.native.js.map +1 -1
- package/build/mobile/global-styles-context/utils.native.js +69 -112
- package/build/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build/mobile/gradient/index.native.js +26 -33
- package/build/mobile/gradient/index.native.js.map +1 -1
- package/build/mobile/html-text-input/index.native.js +3 -3
- package/build/mobile/html-text-input/index.native.js.map +1 -1
- package/build/mobile/image/image-editing-button.native.js +22 -26
- package/build/mobile/image/image-editing-button.native.js.map +1 -1
- package/build/mobile/image/index.native.js +31 -34
- package/build/mobile/image/index.native.js.map +1 -1
- package/build/mobile/keyboard-avoiding-view/index.ios.js +22 -29
- package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.android.js +5 -6
- package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.ios.js +9 -10
- package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/use-keyboard-offset.native.js +9 -14
- package/build/mobile/keyboard-aware-flat-list/use-keyboard-offset.native.js.map +1 -1
- package/build/mobile/layout-animation/index.native.js +1 -3
- package/build/mobile/layout-animation/index.native.js.map +1 -1
- package/build/mobile/link-picker/index.native.js +12 -16
- package/build/mobile/link-picker/index.native.js.map +1 -1
- package/build/mobile/link-picker/link-picker-results.native.js +34 -48
- package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build/mobile/link-picker/link-picker-screen.native.js +7 -10
- package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
- package/build/mobile/link-settings/image-link-destinations-screen.native.js +8 -9
- package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
- package/build/mobile/link-settings/index.native.js +57 -58
- package/build/mobile/link-settings/index.native.js.map +1 -1
- package/build/mobile/media-edit/index.native.js +2 -2
- package/build/mobile/media-edit/index.native.js.map +1 -1
- package/build/mobile/picker/index.ios.js +3 -6
- package/build/mobile/picker/index.ios.js.map +1 -1
- package/build/mobile/segmented-control/index.native.js +16 -20
- package/build/mobile/segmented-control/index.native.js.map +1 -1
- package/build/mobile/utils/alignments.native.js +2 -6
- package/build/mobile/utils/alignments.native.js.map +1 -1
- package/build/mobile/utils/index.native.js +1 -2
- package/build/mobile/utils/index.native.js.map +1 -1
- package/build/mobile/utils/use-unit-converter-to-mobile.native.js +4 -7
- package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build/modal/index.js +2 -2
- package/build/modal/index.js.map +1 -1
- package/build/navigable-container/container.js +2 -6
- package/build/navigable-container/container.js.map +1 -1
- package/build/navigable-container/menu.js +5 -7
- package/build/navigable-container/menu.js.map +1 -1
- package/build/navigable-container/tabbable.js +4 -6
- package/build/navigable-container/tabbable.js.map +1 -1
- package/build/navigation/back-button/index.js +8 -11
- package/build/navigation/back-button/index.js.map +1 -1
- package/build/navigation/group/index.js +5 -6
- package/build/navigation/group/index.js.map +1 -1
- package/build/navigation/index.js +8 -11
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/item/base.js +1 -3
- package/build/navigation/item/base.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +11 -14
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/navigation/menu/menu-title.js +8 -11
- package/build/navigation/menu/menu-title.js.map +1 -1
- package/build/navigation/menu/search-no-results-found.js +3 -4
- package/build/navigation/menu/search-no-results-found.js.map +1 -1
- package/build/navigator/navigator-back-button/hook.js +1 -1
- package/build/navigator/navigator-back-button/hook.js.map +1 -1
- package/build/navigator/navigator-button/hook.js +1 -1
- package/build/navigator/navigator-button/hook.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +2 -6
- 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 +25 -29
- package/build/notice/index.js.map +1 -1
- package/build/notice/index.native.js +13 -18
- package/build/notice/index.native.js.map +1 -1
- package/build/notice/list.js +6 -8
- package/build/notice/list.js.map +1 -1
- package/build/number-control/index.js +24 -26
- package/build/number-control/index.js.map +1 -1
- package/build/number-control/styles/number-control-styles.js +6 -10
- package/build/number-control/styles/number-control-styles.js.map +1 -1
- package/build/palette-edit/index.js +83 -94
- package/build/palette-edit/index.js.map +1 -1
- package/build/panel/actions.native.js +8 -10
- package/build/panel/actions.native.js.map +1 -1
- package/build/panel/body.js +7 -10
- package/build/panel/body.js.map +1 -1
- package/build/panel/body.native.js +6 -7
- package/build/panel/body.native.js.map +1 -1
- package/build/panel/bottom-separator-cover.native.js +3 -4
- package/build/panel/bottom-separator-cover.native.js.map +1 -1
- package/build/panel/header.js +4 -5
- package/build/panel/header.js.map +1 -1
- package/build/panel/index.js +5 -6
- package/build/panel/index.js.map +1 -1
- package/build/panel/row.js +4 -5
- package/build/panel/row.js.map +1 -1
- package/build/popover/index.js +27 -31
- package/build/popover/index.js.map +1 -1
- package/build/popover/limit-shift.js +70 -75
- package/build/popover/limit-shift.js.map +1 -1
- package/build/popover/overlay-middlewares.js +7 -9
- package/build/popover/overlay-middlewares.js.map +1 -1
- package/build/popover/utils.js +26 -34
- package/build/popover/utils.js.map +1 -1
- package/build/private-apis.js +3 -0
- package/build/private-apis.js.map +1 -1
- package/build/query-controls/author-select.js +7 -8
- package/build/query-controls/author-select.js.map +1 -1
- package/build/query-controls/category-select.js +8 -9
- package/build/query-controls/category-select.js.map +1 -1
- package/build/query-controls/index.js +16 -17
- package/build/query-controls/index.js.map +1 -1
- package/build/query-controls/index.native.js +13 -14
- package/build/query-controls/index.native.js.map +1 -1
- package/build/radio-control/index.js +1 -1
- package/build/radio-control/index.js.map +1 -1
- package/build/radio-control/index.native.js +6 -7
- package/build/radio-control/index.native.js.map +1 -1
- package/build/radio-group/index.js +8 -9
- package/build/radio-group/index.js.map +1 -1
- package/build/radio-group/radio/index.js +5 -6
- package/build/radio-group/radio/index.js.map +1 -1
- package/build/range-control/index.js +1 -3
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/index.native.js +19 -21
- package/build/range-control/index.native.js.map +1 -1
- package/build/range-control/rail.js +7 -9
- package/build/range-control/rail.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +37 -52
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/range-control/tooltip.js +4 -5
- package/build/range-control/tooltip.js.map +1 -1
- package/build/resizable-box/index.js +8 -9
- package/build/resizable-box/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/index.js +12 -13
- package/build/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/label.js +6 -7
- package/build/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js +16 -19
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/responsive-wrapper/index.js +6 -8
- package/build/responsive-wrapper/index.js.map +1 -1
- package/build/sandbox/index.js +16 -23
- package/build/sandbox/index.js.map +1 -1
- package/build/sandbox/index.native.js +20 -26
- package/build/sandbox/index.native.js.map +1 -1
- package/build/search-control/index.js +14 -17
- package/build/search-control/index.js.map +1 -1
- package/build/search-control/index.native.js +7 -8
- package/build/search-control/index.native.js.map +1 -1
- package/build/select-control/index.js +9 -19
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/index.native.js +11 -12
- package/build/select-control/index.native.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +19 -25
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/fill.js +4 -5
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +4 -7
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot.js +6 -7
- package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build/slot-fill/fill.js +4 -5
- package/build/slot-fill/fill.js.map +1 -1
- package/build/slot-fill/index.js +8 -11
- package/build/slot-fill/index.js.map +1 -1
- package/build/slot-fill/index.native.js +4 -5
- package/build/slot-fill/index.native.js.map +1 -1
- package/build/slot-fill/provider.js +2 -2
- package/build/slot-fill/provider.js.map +1 -1
- package/build/slot-fill/slot.js +9 -12
- package/build/slot-fill/slot.js.map +1 -1
- package/build/snackbar/index.js +26 -31
- package/build/snackbar/index.js.map +1 -1
- package/build/snackbar/list.js +9 -8
- package/build/snackbar/list.js.map +1 -1
- package/build/spinner/index.js +4 -5
- package/build/spinner/index.js.map +1 -1
- package/build/style-provider/index.native.js +3 -4
- package/build/style-provider/index.native.js.map +1 -1
- package/build/surface/styles.js +6 -7
- package/build/surface/styles.js.map +1 -1
- package/build/tab-panel/index.js +35 -40
- package/build/tab-panel/index.js.map +1 -1
- package/build/text/styles/text-mixins.native.js +1 -3
- package/build/text/styles/text-mixins.native.js.map +1 -1
- package/build/text/utils.js +16 -17
- package/build/text/utils.js.map +1 -1
- package/build/text-control/index.native.js +12 -13
- package/build/text-control/index.native.js.map +1 -1
- package/build/textarea-control/index.native.js +7 -8
- package/build/textarea-control/index.native.js.map +1 -1
- package/build/theme/color-algorithms.js +1 -2
- package/build/theme/color-algorithms.js.map +1 -1
- package/build/theme/index.js +6 -7
- package/build/theme/index.js.map +1 -1
- package/build/theme/styles.js +4 -8
- package/build/theme/styles.js.map +1 -1
- package/build/toggle-control/index.js +9 -11
- package/build/toggle-control/index.js.map +1 -1
- package/build/toggle-control/index.native.js +9 -10
- package/build/toggle-control/index.native.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-button-group.js +9 -10
- package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js +9 -10
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +5 -8
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +7 -8
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js +5 -7
- package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js +11 -15
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build/toolbar/toolbar/index.js +23 -9
- package/build/toolbar/toolbar/index.js.map +1 -1
- package/build/toolbar/toolbar/toolbar-container.js +4 -5
- package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
- package/build/toolbar/toolbar/toolbar-container.native.js +3 -6
- package/build/toolbar/toolbar/toolbar-container.native.js.map +1 -1
- package/build/toolbar/toolbar-button/index.js +10 -11
- package/build/toolbar/toolbar-button/index.js.map +1 -1
- package/build/toolbar/toolbar-button/toolbar-button-container.js +6 -9
- package/build/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
- package/build/toolbar/toolbar-group/index.js +9 -12
- package/build/toolbar/toolbar-group/index.js.map +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.js +5 -6
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js +6 -7
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js.map +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-container.js +7 -10
- package/build/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-container.native.js +7 -10
- package/build/toolbar/toolbar-group/toolbar-group-container.native.js.map +1 -1
- package/build/toolbar/toolbar-item/index.js +5 -6
- package/build/toolbar/toolbar-item/index.js.map +1 -1
- package/build/toolbar/toolbar-item/index.native.js +4 -6
- package/build/toolbar/toolbar-item/index.native.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +17 -25
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +14 -24
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +5 -7
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/tooltip/index.js +36 -43
- package/build/tooltip/index.js.map +1 -1
- package/build/tooltip/index.native.js +14 -19
- package/build/tooltip/index.native.js.map +1 -1
- package/build/tree-grid/cell.js +5 -6
- package/build/tree-grid/cell.js.map +1 -1
- package/build/tree-grid/index.js +12 -15
- package/build/tree-grid/index.js.map +1 -1
- package/build/tree-grid/item.js +4 -5
- package/build/tree-grid/item.js.map +1 -1
- package/build/tree-grid/roving-tab-index-item.js +6 -7
- package/build/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build/tree-grid/roving-tab-index.js +3 -4
- package/build/tree-grid/roving-tab-index.js.map +1 -1
- package/build/tree-grid/row.js +8 -9
- package/build/tree-grid/row.js.map +1 -1
- package/build/tree-select/index.js +9 -11
- package/build/tree-select/index.js.map +1 -1
- package/build/truncate/utils.js +1 -3
- package/build/truncate/utils.js.map +1 -1
- package/build/ui/context/context-connect.js +1 -1
- package/build/ui/context/context-connect.js.map +1 -1
- package/build/ui/context/context-system-provider.js +7 -9
- package/build/ui/context/context-system-provider.js.map +1 -1
- package/build/ui/context/index.js +7 -0
- package/build/ui/context/index.js.map +1 -1
- package/build/ui/context/use-context-system.js +1 -1
- package/build/ui/context/use-context-system.js.map +1 -1
- package/build/ui/control-group/hook.js +1 -1
- package/build/ui/control-group/hook.js.map +1 -1
- package/build/ui/form-group/form-group-content.js +12 -13
- package/build/ui/form-group/form-group-content.js.map +1 -1
- package/build/ui/form-group/form-group-help.js +3 -4
- package/build/ui/form-group/form-group-help.js.map +1 -1
- package/build/ui/form-group/form-group-label.js +7 -8
- package/build/ui/form-group/form-group-label.js.map +1 -1
- package/build/ui/tooltip/component.js +1 -1
- package/build/ui/tooltip/component.js.map +1 -1
- package/build/ui/utils/colors.js +1 -3
- package/build/ui/utils/colors.js.map +1 -1
- package/build/ui/utils/font-size.js +2 -6
- package/build/ui/utils/font-size.js.map +1 -1
- package/build/ui/utils/get-high-dpi.js +1 -5
- package/build/ui/utils/get-high-dpi.js.map +1 -1
- package/build/ui/utils/space.js +1 -3
- package/build/ui/utils/space.js.map +1 -1
- package/build/ui/utils/use-responsive-value.js +2 -4
- package/build/ui/utils/use-responsive-value.js.map +1 -1
- package/build/unit-control/index.js +8 -8
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/index.native.js +22 -23
- package/build/unit-control/index.native.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +6 -8
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/unit-control/unit-select-control.js +11 -13
- package/build/unit-control/unit-select-control.js.map +1 -1
- package/build/unit-control/utils.js +12 -19
- package/build/unit-control/utils.js.map +1 -1
- package/build/utils/browsers.js +2 -10
- package/build/utils/browsers.js.map +1 -1
- package/build/utils/colors.js +1 -3
- package/build/utils/colors.js.map +1 -1
- package/build/utils/config-values.js +1 -0
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/hooks/use-controlled-state.js +1 -2
- package/build/utils/hooks/use-controlled-state.js.map +1 -1
- package/build/utils/hooks/use-controlled-value.js +5 -6
- package/build/utils/hooks/use-controlled-value.js.map +1 -1
- package/build/utils/hooks/use-cx.js +1 -5
- package/build/utils/hooks/use-cx.js.map +1 -1
- package/build/utils/math.js +5 -17
- package/build/utils/math.js.map +1 -1
- package/build/utils/reduce-motion.js +1 -2
- package/build/utils/reduce-motion.js.map +1 -1
- package/build/utils/rtl.js +3 -9
- package/build/utils/rtl.js.map +1 -1
- package/build/utils/values.js +2 -6
- package/build/utils/values.js.map +1 -1
- package/build/z-stack/styles.js +14 -23
- package/build/z-stack/styles.js.map +1 -1
- package/build-module/alignment-matrix-control/cell.js +5 -6
- package/build-module/alignment-matrix-control/cell.js.map +1 -1
- package/build-module/alignment-matrix-control/icon.js +8 -9
- package/build-module/alignment-matrix-control/icon.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +10 -11
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +6 -8
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +1 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +6 -8
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build-module/alignment-matrix-control/utils.js +1 -2
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js +6 -9
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +3 -4
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
- package/build-module/animate/index.js +5 -6
- package/build-module/animate/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +29 -33
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.native.js +15 -22
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/autocomplete/background-view.android.js +3 -4
- package/build-module/autocomplete/background-view.android.js.map +1 -1
- package/build-module/autocomplete/background-view.ios.js +3 -4
- package/build-module/autocomplete/background-view.ios.js.map +1 -1
- package/build-module/autocomplete/get-default-use-items.js +1 -3
- package/build-module/autocomplete/get-default-use-items.js.map +1 -1
- package/build-module/autocomplete/index.js +18 -23
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/base-control/index.js +14 -16
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/base-control/index.native.js +5 -6
- package/build-module/base-control/index.native.js.map +1 -1
- package/build-module/base-control/styles/base-control-styles.js +6 -8
- package/build-module/base-control/styles/base-control-styles.js.map +1 -1
- package/build-module/border-box-control/border-box-control/hook.js +5 -5
- package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js +4 -4
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build-module/border-box-control/styles.js +3 -3
- package/build-module/border-box-control/styles.js.map +1 -1
- package/build-module/border-box-control/utils.js +5 -8
- package/build-module/border-box-control/utils.js.map +1 -1
- package/build-module/border-control/border-control/component.js +1 -1
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js +5 -5
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +70 -67
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/hook.js +4 -4
- package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build-module/box-control/all-input-control.js +11 -12
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/axial-input-controls.js +12 -14
- package/build-module/box-control/axial-input-controls.js.map +1 -1
- package/build-module/box-control/icon.js +7 -9
- package/build-module/box-control/icon.js.map +1 -1
- package/build-module/box-control/index.js +22 -24
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-controls.js +15 -18
- package/build-module/box-control/input-controls.js.map +1 -1
- package/build-module/box-control/linked-button.js +4 -5
- package/build-module/box-control/linked-button.js.map +1 -1
- package/build-module/box-control/styles/box-control-icon-styles.js +3 -4
- package/build-module/box-control/styles/box-control-icon-styles.js.map +1 -1
- package/build-module/box-control/styles/box-control-styles.js +9 -12
- package/build-module/box-control/styles/box-control-styles.js.map +1 -1
- package/build-module/box-control/styles/box-control-visualizer-styles.js +7 -11
- package/build-module/box-control/styles/box-control-visualizer-styles.js.map +1 -1
- package/build-module/box-control/unit-control.js +18 -22
- package/build-module/box-control/unit-control.js.map +1 -1
- package/build-module/box-control/utils.js +4 -10
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/button/deprecated.js +7 -8
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/index.js +15 -16
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/index.native.js +5 -7
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/card/card/hook.js +5 -6
- package/build-module/card/card/hook.js.map +1 -1
- package/build-module/circular-option-picker/index.js +27 -33
- package/build-module/circular-option-picker/index.js.map +1 -1
- package/build-module/clipboard-button/index.js +8 -9
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/color-control/index.native.js +7 -8
- package/build-module/color-control/index.native.js.map +1 -1
- package/build-module/color-indicator/index.native.js +10 -12
- package/build-module/color-indicator/index.native.js.map +1 -1
- package/build-module/color-palette/index.js +63 -72
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +33 -47
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-palette/utils.js +2 -5
- package/build-module/color-palette/utils.js.map +1 -1
- package/build-module/color-picker/color-input.js +6 -7
- package/build-module/color-picker/color-input.js.map +1 -1
- package/build-module/color-picker/hex-input.js +8 -12
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/hsl-input.js +5 -6
- package/build-module/color-picker/hsl-input.js.map +1 -1
- package/build-module/color-picker/index.native.js +23 -30
- package/build-module/color-picker/index.native.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +8 -10
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/color-picker/picker.js +5 -6
- package/build-module/color-picker/picker.js.map +1 -1
- package/build-module/color-picker/rgb-input.js +5 -6
- package/build-module/color-picker/rgb-input.js.map +1 -1
- package/build-module/color-picker/use-deprecated-props.js +1 -3
- package/build-module/color-picker/use-deprecated-props.js.map +1 -1
- package/build-module/combobox-control/index.js +3 -6
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/combobox-control/styles.js +3 -6
- package/build-module/combobox-control/styles.js.map +1 -1
- package/build-module/confirm-dialog/component.js +1 -1
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +114 -129
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/index.js +12 -14
- package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/utils.js +4 -6
- package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +19 -22
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.native.js +7 -8
- package/build-module/custom-gradient-picker/index.native.js.map +1 -1
- package/build-module/custom-gradient-picker/serializer.js +15 -21
- package/build-module/custom-gradient-picker/serializer.js.map +1 -1
- package/build-module/custom-gradient-picker/utils.js +6 -9
- package/build-module/custom-gradient-picker/utils.js.map +1 -1
- package/build-module/custom-select-control/index.js +14 -21
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/dashicon/index.js +7 -8
- package/build-module/dashicon/index.js.map +1 -1
- package/build-module/dashicon/index.native.js +4 -5
- package/build-module/dashicon/index.native.js.map +1 -1
- package/build-module/date-time/date/index.js +24 -26
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date-time/index.js +9 -10
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/date-time/time/index.js +11 -14
- package/build-module/date-time/time/index.js.map +1 -1
- package/build-module/dimension-control/index.js +8 -11
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/disabled/index.js +6 -7
- package/build-module/disabled/index.js.map +1 -1
- package/build-module/disabled/index.native.js +3 -4
- package/build-module/disabled/index.native.js.map +1 -1
- package/build-module/divider/styles.js +21 -29
- package/build-module/divider/styles.js.map +1 -1
- package/build-module/draggable/index.js +14 -19
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/draggable/index.native.js +17 -19
- package/build-module/draggable/index.native.js.map +1 -1
- package/build-module/drop-zone/index.js +11 -16
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/drop-zone/provider.js +3 -4
- package/build-module/drop-zone/provider.js.map +1 -1
- package/build-module/dropdown/index.js +19 -23
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/dropdown/styles.js +3 -4
- package/build-module/dropdown/styles.js.map +1 -1
- package/build-module/dropdown-menu/index.js +9 -15
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js +22 -30
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/dropdown-menu-v2/index.js +91 -58
- package/build-module/dropdown-menu-v2/index.js.map +1 -1
- package/build-module/dropdown-menu-v2/styles.js +26 -18
- package/build-module/dropdown-menu-v2/styles.js.map +1 -1
- package/build-module/duotone-picker/color-list-picker/index.js +16 -18
- package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
- package/build-module/duotone-picker/custom-duotone-bar.js +4 -5
- package/build-module/duotone-picker/custom-duotone-bar.js.map +1 -1
- package/build-module/duotone-picker/duotone-picker.js +15 -17
- package/build-module/duotone-picker/duotone-picker.js.map +1 -1
- package/build-module/duotone-picker/duotone-swatch.js +3 -4
- package/build-module/duotone-picker/duotone-swatch.js.map +1 -1
- package/build-module/duotone-picker/utils.js +14 -27
- package/build-module/duotone-picker/utils.js.map +1 -1
- package/build-module/external-link/index.js +1 -1
- package/build-module/external-link/index.js.map +1 -1
- package/build-module/external-link/index.native.js +4 -5
- package/build-module/external-link/index.native.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +11 -10
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/focal-point.js +5 -6
- package/build-module/focal-point-picker/focal-point.js.map +1 -1
- package/build-module/focal-point-picker/focal-point.native.js +5 -6
- package/build-module/focal-point-picker/focal-point.native.js.map +1 -1
- package/build-module/focal-point-picker/grid.js +4 -5
- package/build-module/focal-point-picker/grid.js.map +1 -1
- package/build-module/focal-point-picker/index.js +33 -37
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/index.native.js +10 -12
- package/build-module/focal-point-picker/index.native.js.map +1 -1
- package/build-module/focal-point-picker/media.js +11 -13
- package/build-module/focal-point-picker/media.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js +9 -14
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-style.js +3 -6
- package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build-module/focal-point-picker/tooltip/index.native.js +16 -21
- package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build-module/focal-point-picker/utils.js +2 -4
- package/build-module/focal-point-picker/utils.js.map +1 -1
- package/build-module/focusable-iframe/index.js +4 -5
- package/build-module/focusable-iframe/index.js.map +1 -1
- package/build-module/font-size-picker/font-size-picker-select.js +3 -5
- package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build-module/font-size-picker/index.js +14 -18
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/index.native.js +6 -7
- package/build-module/font-size-picker/index.native.js.map +1 -1
- package/build-module/font-size-picker/styles.js +20 -7
- package/build-module/font-size-picker/styles.js.map +1 -1
- package/build-module/footer-message-control/index.native.js +2 -3
- package/build-module/footer-message-control/index.native.js.map +1 -1
- package/build-module/form-file-upload/index.js +10 -13
- package/build-module/form-file-upload/index.js.map +1 -1
- package/build-module/form-token-field/index.js +4 -19
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/styles.js +4 -7
- package/build-module/form-token-field/styles.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +14 -15
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/form-token-field/token-input.js +2 -2
- package/build-module/form-token-field/token-input.js.map +1 -1
- package/build-module/form-token-field/token.js +14 -15
- package/build-module/form-token-field/token.js.map +1 -1
- package/build-module/gradient-picker/index.js +51 -58
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/guide/icons.js +13 -16
- package/build-module/guide/icons.js.map +1 -1
- package/build-module/guide/index.js +9 -12
- package/build-module/guide/index.js.map +1 -1
- package/build-module/guide/page-control.js +5 -6
- package/build-module/guide/page-control.js.map +1 -1
- package/build-module/h-stack/utils.js +1 -3
- package/build-module/h-stack/utils.js.map +1 -1
- package/build-module/higher-order/navigate-regions/index.js +16 -22
- package/build-module/higher-order/navigate-regions/index.js.map +1 -1
- package/build-module/higher-order/with-focus-outside/index.js +1 -1
- package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
- package/build-module/higher-order/with-focus-outside/index.native.js +1 -1
- package/build-module/higher-order/with-focus-outside/index.native.js.map +1 -1
- package/build-module/higher-order/with-focus-return/index.js +13 -17
- package/build-module/higher-order/with-focus-return/index.js.map +1 -1
- package/build-module/icon/index.js +5 -7
- package/build-module/icon/index.js.map +1 -1
- package/build-module/input-control/backdrop.js +4 -5
- package/build-module/input-control/backdrop.js.map +1 -1
- package/build-module/input-control/index.js +22 -23
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +16 -17
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/input-field.js +26 -29
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/label.js +6 -7
- package/build-module/input-control/label.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js +2 -6
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +32 -41
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/input-control/utils.js +1 -3
- package/build-module/input-control/utils.js.map +1 -1
- package/build-module/keyboard-shortcuts/index.js +21 -26
- package/build-module/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/menu-items-choice/index.js +6 -7
- package/build-module/menu-items-choice/index.js.map +1 -1
- package/build-module/mobile/audio-player/index.native.js +7 -8
- package/build-module/mobile/audio-player/index.native.js.map +1 -1
- package/build-module/mobile/badge/index.native.js +5 -6
- package/build-module/mobile/badge/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +10 -12
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +10 -13
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/button.native.js +18 -21
- package/build-module/mobile/bottom-sheet/button.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +7 -4
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/color-cell.native.js +3 -1
- package/build-module/mobile/bottom-sheet/color-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/footer-message-cell.native.js +4 -5
- package/build-module/mobile/bottom-sheet/footer-message-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js +4 -5
- package/build-module/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js +19 -30
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/link-cell.native.js +6 -7
- package/build-module/mobile/bottom-sheet/link-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +5 -6
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/lock-icon/index.native.js +21 -0
- package/build-module/mobile/bottom-sheet/lock-icon/index.native.js.map +1 -0
- package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js +6 -7
- package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/nav-bar/apply-button.native.js +3 -4
- package/build-module/mobile/bottom-sheet/nav-bar/apply-button.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +12 -15
- package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/nav-bar/heading.native.js +3 -4
- package/build-module/mobile/bottom-sheet/nav-bar/heading.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/nav-bar/index.native.js +3 -4
- package/build-module/mobile/bottom-sheet/nav-bar/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/radio-cell.native.js +3 -2
- package/build-module/mobile/bottom-sheet/radio-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-cell.native.js +4 -2
- package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-text-input.native.js +5 -6
- package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/ripple.native.js +10 -11
- package/build-module/mobile/bottom-sheet/ripple.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +1 -2
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js +11 -12
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js +11 -12
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
- package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +6 -7
- package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-select-control/index.native.js +9 -10
- package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-text-control/index.native.js +11 -12
- package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +12 -13
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/utils.native.js +2 -2
- package/build-module/mobile/color-settings/utils.native.js.map +1 -1
- package/build-module/mobile/cycle-select-control/index.native.js +11 -12
- package/build-module/mobile/cycle-select-control/index.native.js.map +1 -1
- package/build-module/mobile/focal-point-settings-panel/index.native.js +6 -7
- package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/index.native.js +6 -14
- package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +69 -112
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/mobile/gradient/index.native.js +26 -33
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/html-text-input/index.native.js +3 -3
- package/build-module/mobile/html-text-input/index.native.js.map +1 -1
- package/build-module/mobile/image/image-editing-button.native.js +22 -26
- package/build-module/mobile/image/image-editing-button.native.js.map +1 -1
- package/build-module/mobile/image/index.native.js +31 -34
- package/build-module/mobile/image/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js +22 -29
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js +5 -6
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +9 -10
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/use-keyboard-offset.native.js +9 -14
- package/build-module/mobile/keyboard-aware-flat-list/use-keyboard-offset.native.js.map +1 -1
- package/build-module/mobile/layout-animation/index.native.js +1 -2
- package/build-module/mobile/layout-animation/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +12 -16
- package/build-module/mobile/link-picker/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-results.native.js +34 -48
- package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-screen.native.js +7 -9
- package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
- package/build-module/mobile/link-settings/image-link-destinations-screen.native.js +8 -9
- package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
- package/build-module/mobile/link-settings/index.native.js +57 -58
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/mobile/media-edit/index.native.js +2 -2
- package/build-module/mobile/media-edit/index.native.js.map +1 -1
- package/build-module/mobile/picker/index.ios.js +3 -6
- package/build-module/mobile/picker/index.ios.js.map +1 -1
- package/build-module/mobile/segmented-control/index.native.js +16 -20
- package/build-module/mobile/segmented-control/index.native.js.map +1 -1
- package/build-module/mobile/utils/alignments.native.js +2 -6
- package/build-module/mobile/utils/alignments.native.js.map +1 -1
- package/build-module/mobile/utils/index.native.js +1 -2
- package/build-module/mobile/utils/index.native.js.map +1 -1
- package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js +4 -7
- package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build-module/modal/index.js +2 -2
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigable-container/container.js +2 -6
- package/build-module/navigable-container/container.js.map +1 -1
- package/build-module/navigable-container/menu.js +5 -7
- package/build-module/navigable-container/menu.js.map +1 -1
- package/build-module/navigable-container/tabbable.js +4 -6
- package/build-module/navigable-container/tabbable.js.map +1 -1
- package/build-module/navigation/back-button/index.js +8 -11
- package/build-module/navigation/back-button/index.js.map +1 -1
- package/build-module/navigation/group/index.js +5 -6
- package/build-module/navigation/group/index.js.map +1 -1
- package/build-module/navigation/index.js +8 -11
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/item/base.js +1 -3
- package/build-module/navigation/item/base.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +11 -14
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/navigation/menu/menu-title.js +8 -11
- package/build-module/navigation/menu/menu-title.js.map +1 -1
- package/build-module/navigation/menu/search-no-results-found.js +3 -4
- package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
- package/build-module/navigator/navigator-back-button/hook.js +1 -1
- package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-button/hook.js +1 -1
- package/build-module/navigator/navigator-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +2 -6
- 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 +25 -29
- package/build-module/notice/index.js.map +1 -1
- package/build-module/notice/index.native.js +13 -18
- package/build-module/notice/index.native.js.map +1 -1
- package/build-module/notice/list.js +6 -8
- package/build-module/notice/list.js.map +1 -1
- package/build-module/number-control/index.js +24 -26
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/number-control/styles/number-control-styles.js +6 -10
- package/build-module/number-control/styles/number-control-styles.js.map +1 -1
- package/build-module/palette-edit/index.js +83 -94
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/panel/actions.native.js +8 -10
- package/build-module/panel/actions.native.js.map +1 -1
- package/build-module/panel/body.js +7 -10
- package/build-module/panel/body.js.map +1 -1
- package/build-module/panel/body.native.js +6 -7
- package/build-module/panel/body.native.js.map +1 -1
- package/build-module/panel/bottom-separator-cover.native.js +3 -4
- package/build-module/panel/bottom-separator-cover.native.js.map +1 -1
- package/build-module/panel/header.js +4 -5
- package/build-module/panel/header.js.map +1 -1
- package/build-module/panel/index.js +5 -6
- package/build-module/panel/index.js.map +1 -1
- package/build-module/panel/row.js +4 -5
- package/build-module/panel/row.js.map +1 -1
- package/build-module/popover/index.js +25 -31
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/limit-shift.js +66 -71
- package/build-module/popover/limit-shift.js.map +1 -1
- package/build-module/popover/overlay-middlewares.js +7 -9
- package/build-module/popover/overlay-middlewares.js.map +1 -1
- package/build-module/popover/utils.js +26 -34
- package/build-module/popover/utils.js.map +1 -1
- package/build-module/private-apis.js +2 -0
- package/build-module/private-apis.js.map +1 -1
- package/build-module/query-controls/author-select.js +7 -8
- package/build-module/query-controls/author-select.js.map +1 -1
- package/build-module/query-controls/category-select.js +8 -9
- package/build-module/query-controls/category-select.js.map +1 -1
- package/build-module/query-controls/index.js +16 -17
- package/build-module/query-controls/index.js.map +1 -1
- package/build-module/query-controls/index.native.js +13 -14
- package/build-module/query-controls/index.native.js.map +1 -1
- package/build-module/radio-control/index.js +1 -1
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/radio-control/index.native.js +6 -7
- package/build-module/radio-control/index.native.js.map +1 -1
- package/build-module/radio-group/index.js +8 -9
- package/build-module/radio-group/index.js.map +1 -1
- package/build-module/radio-group/radio/index.js +5 -6
- package/build-module/radio-group/radio/index.js.map +1 -1
- package/build-module/range-control/index.js +1 -3
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/index.native.js +19 -21
- package/build-module/range-control/index.native.js.map +1 -1
- package/build-module/range-control/rail.js +7 -9
- package/build-module/range-control/rail.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +37 -52
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/range-control/tooltip.js +4 -5
- package/build-module/range-control/tooltip.js.map +1 -1
- package/build-module/resizable-box/index.js +8 -9
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js +12 -13
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/label.js +6 -7
- package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.js +16 -19
- package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build-module/responsive-wrapper/index.js +6 -8
- package/build-module/responsive-wrapper/index.js.map +1 -1
- package/build-module/sandbox/index.js +16 -23
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/sandbox/index.native.js +20 -26
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/search-control/index.js +14 -17
- package/build-module/search-control/index.js.map +1 -1
- package/build-module/search-control/index.native.js +7 -8
- package/build-module/search-control/index.native.js.map +1 -1
- package/build-module/select-control/index.js +9 -19
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/index.native.js +11 -12
- package/build-module/select-control/index.native.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +19 -25
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js +4 -5
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +4 -7
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot.js +6 -7
- package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build-module/slot-fill/fill.js +4 -5
- package/build-module/slot-fill/fill.js.map +1 -1
- package/build-module/slot-fill/index.js +8 -11
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/slot-fill/index.native.js +4 -5
- package/build-module/slot-fill/index.native.js.map +1 -1
- package/build-module/slot-fill/provider.js +2 -2
- package/build-module/slot-fill/provider.js.map +1 -1
- package/build-module/slot-fill/slot.js +9 -12
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/snackbar/index.js +26 -31
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +9 -8
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/spinner/index.js +4 -5
- package/build-module/spinner/index.js.map +1 -1
- package/build-module/style-provider/index.native.js +3 -4
- package/build-module/style-provider/index.native.js.map +1 -1
- package/build-module/surface/styles.js +6 -7
- package/build-module/surface/styles.js.map +1 -1
- package/build-module/tab-panel/index.js +36 -40
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/text/styles/text-mixins.native.js +1 -3
- package/build-module/text/styles/text-mixins.native.js.map +1 -1
- package/build-module/text/utils.js +16 -17
- package/build-module/text/utils.js.map +1 -1
- package/build-module/text-control/index.native.js +12 -13
- package/build-module/text-control/index.native.js.map +1 -1
- package/build-module/textarea-control/index.native.js +7 -8
- package/build-module/textarea-control/index.native.js.map +1 -1
- package/build-module/theme/color-algorithms.js +1 -2
- package/build-module/theme/color-algorithms.js.map +1 -1
- package/build-module/theme/index.js +6 -7
- package/build-module/theme/index.js.map +1 -1
- package/build-module/theme/styles.js +4 -8
- package/build-module/theme/styles.js.map +1 -1
- package/build-module/toggle-control/index.js +9 -11
- package/build-module/toggle-control/index.js.map +1 -1
- package/build-module/toggle-control/index.native.js +9 -10
- package/build-module/toggle-control/index.native.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-button-group.js +9 -10
- package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +9 -10
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +5 -8
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +7 -8
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +5 -7
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +11 -15
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build-module/toolbar/toolbar/index.js +20 -8
- package/build-module/toolbar/toolbar/index.js.map +1 -1
- package/build-module/toolbar/toolbar/toolbar-container.js +4 -5
- package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
- package/build-module/toolbar/toolbar/toolbar-container.native.js +3 -6
- package/build-module/toolbar/toolbar/toolbar-container.native.js.map +1 -1
- package/build-module/toolbar/toolbar-button/index.js +10 -11
- package/build-module/toolbar/toolbar-button/index.js.map +1 -1
- package/build-module/toolbar/toolbar-button/toolbar-button-container.js +6 -9
- package/build-module/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
- package/build-module/toolbar/toolbar-group/index.js +9 -12
- package/build-module/toolbar/toolbar-group/index.js.map +1 -1
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js +5 -6
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.native.js +6 -7
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.native.js.map +1 -1
- package/build-module/toolbar/toolbar-group/toolbar-group-container.js +7 -10
- package/build-module/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
- package/build-module/toolbar/toolbar-group/toolbar-group-container.native.js +7 -10
- package/build-module/toolbar/toolbar-group/toolbar-group-container.native.js.map +1 -1
- package/build-module/toolbar/toolbar-item/index.js +5 -6
- package/build-module/toolbar/toolbar-item/index.js.map +1 -1
- package/build-module/toolbar/toolbar-item/index.native.js +4 -6
- package/build-module/toolbar/toolbar-item/index.native.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +17 -25
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +14 -24
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +5 -7
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/tooltip/index.js +36 -43
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tooltip/index.native.js +14 -19
- package/build-module/tooltip/index.native.js.map +1 -1
- package/build-module/tree-grid/cell.js +5 -6
- package/build-module/tree-grid/cell.js.map +1 -1
- package/build-module/tree-grid/index.js +12 -15
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/tree-grid/item.js +4 -5
- package/build-module/tree-grid/item.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-item.js +6 -7
- package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index.js +3 -4
- package/build-module/tree-grid/roving-tab-index.js.map +1 -1
- package/build-module/tree-grid/row.js +8 -9
- package/build-module/tree-grid/row.js.map +1 -1
- package/build-module/tree-select/index.js +9 -11
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/truncate/utils.js +1 -3
- package/build-module/truncate/utils.js.map +1 -1
- package/build-module/ui/context/context-connect.js +1 -1
- package/build-module/ui/context/context-connect.js.map +1 -1
- package/build-module/ui/context/context-system-provider.js +7 -9
- package/build-module/ui/context/context-system-provider.js.map +1 -1
- package/build-module/ui/context/index.js +1 -1
- package/build-module/ui/context/index.js.map +1 -1
- package/build-module/ui/context/use-context-system.js +1 -1
- package/build-module/ui/context/use-context-system.js.map +1 -1
- package/build-module/ui/control-group/hook.js +1 -1
- package/build-module/ui/control-group/hook.js.map +1 -1
- package/build-module/ui/form-group/form-group-content.js +12 -13
- package/build-module/ui/form-group/form-group-content.js.map +1 -1
- package/build-module/ui/form-group/form-group-help.js +3 -4
- package/build-module/ui/form-group/form-group-help.js.map +1 -1
- package/build-module/ui/form-group/form-group-label.js +7 -8
- package/build-module/ui/form-group/form-group-label.js.map +1 -1
- package/build-module/ui/tooltip/component.js +1 -1
- package/build-module/ui/tooltip/component.js.map +1 -1
- package/build-module/ui/utils/colors.js +1 -3
- package/build-module/ui/utils/colors.js.map +1 -1
- package/build-module/ui/utils/font-size.js +2 -6
- package/build-module/ui/utils/font-size.js.map +1 -1
- package/build-module/ui/utils/get-high-dpi.js +1 -5
- package/build-module/ui/utils/get-high-dpi.js.map +1 -1
- package/build-module/ui/utils/space.js +1 -3
- package/build-module/ui/utils/space.js.map +1 -1
- package/build-module/ui/utils/use-responsive-value.js +2 -4
- package/build-module/ui/utils/use-responsive-value.js.map +1 -1
- package/build-module/unit-control/index.js +8 -8
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/index.native.js +22 -23
- package/build-module/unit-control/index.native.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +6 -8
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/unit-control/unit-select-control.js +11 -13
- package/build-module/unit-control/unit-select-control.js.map +1 -1
- package/build-module/unit-control/utils.js +12 -19
- package/build-module/unit-control/utils.js.map +1 -1
- package/build-module/utils/browsers.js +2 -10
- package/build-module/utils/browsers.js.map +1 -1
- package/build-module/utils/colors.js +1 -3
- package/build-module/utils/colors.js.map +1 -1
- package/build-module/utils/config-values.js +1 -0
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/hooks/use-controlled-state.js +1 -2
- package/build-module/utils/hooks/use-controlled-state.js.map +1 -1
- package/build-module/utils/hooks/use-controlled-value.js +5 -6
- package/build-module/utils/hooks/use-controlled-value.js.map +1 -1
- package/build-module/utils/hooks/use-cx.js +1 -5
- package/build-module/utils/hooks/use-cx.js.map +1 -1
- package/build-module/utils/math.js +5 -17
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/reduce-motion.js +1 -2
- package/build-module/utils/reduce-motion.js.map +1 -1
- package/build-module/utils/rtl.js +3 -9
- package/build-module/utils/rtl.js.map +1 -1
- package/build-module/utils/values.js +2 -6
- package/build-module/utils/values.js.map +1 -1
- package/build-module/z-stack/styles.js +14 -23
- package/build-module/z-stack/styles.js.map +1 -1
- package/build-style/style-rtl.css +46 -13
- package/build-style/style.css +48 -15
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/button/deprecated.d.ts +6 -0
- package/build-types/button/deprecated.d.ts.map +1 -1
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/button/stories/e2e/index.d.ts +14 -0
- package/build-types/button/stories/e2e/index.d.ts.map +1 -0
- package/build-types/button/types.d.ts +9 -0
- package/build-types/button/types.d.ts.map +1 -1
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/index.d.ts +1 -1
- package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/stories/index.d.ts +2 -4
- package/build-types/dropdown-menu-v2/stories/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/styles.d.ts +4 -3
- package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/types.d.ts +11 -1
- package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
- package/build-types/focal-point-picker/controls.d.ts.map +1 -1
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/styles.d.ts +11 -0
- package/build-types/font-size-picker/styles.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +1 -0
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +1 -0
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +1 -0
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +1 -0
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -0
- package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
- package/build-types/popover/index.d.ts +6 -0
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/snackbar/list.d.ts.map +1 -1
- package/build-types/tab-panel/index.d.ts +1 -38
- package/build-types/tab-panel/index.d.ts.map +1 -1
- package/build-types/tab-panel/stories/index.d.ts +4 -3
- package/build-types/tab-panel/stories/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/index.d.ts +6 -0
- package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
- package/build-types/ui/context/index.d.ts +1 -1
- package/build-types/ui/context/index.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +1 -0
- package/package.json +19 -19
- package/src/border-control/border-control-dropdown/component.tsx +23 -12
- package/src/border-control/test/index.js +6 -6
- package/src/button/index.tsx +2 -0
- package/src/button/stories/e2e/index.tsx +58 -0
- package/src/button/style.scss +12 -3
- package/src/button/types.ts +9 -0
- package/src/color-palette/index.tsx +47 -46
- package/src/color-palette/style.scss +57 -19
- package/src/color-palette/test/__snapshots__/index.tsx.snap +66 -50
- package/src/color-palette/test/index.tsx +76 -13
- package/src/dropdown-menu-v2/README.md +1 -1
- package/src/dropdown-menu-v2/index.tsx +79 -27
- package/src/dropdown-menu-v2/stories/index.tsx +28 -4
- package/src/dropdown-menu-v2/styles.ts +42 -29
- package/src/dropdown-menu-v2/types.ts +16 -1
- package/src/focal-point-picker/controls.tsx +2 -0
- package/src/focal-point-picker/test/index.js +9 -3
- package/src/font-size-picker/index.tsx +5 -5
- package/src/font-size-picker/styles.ts +9 -0
- package/src/mobile/bottom-sheet/cell.native.js +8 -0
- package/src/mobile/bottom-sheet/color-cell.native.js +3 -2
- package/src/mobile/bottom-sheet/lock-icon/index.native.js +19 -0
- package/src/mobile/bottom-sheet/lock-icon/styles.native.scss +8 -0
- package/src/mobile/bottom-sheet/radio-cell.native.js +2 -1
- package/src/mobile/bottom-sheet/range-cell.native.js +3 -0
- package/src/mobile/bottom-sheet/styles.native.scss +5 -3
- package/src/mobile/bottom-sheet-select-control/index.native.js +1 -1
- package/src/mobile/bottom-sheet-text-control/index.native.js +1 -1
- package/src/popover/index.tsx +1 -1
- package/src/private-apis.ts +2 -0
- package/src/slot-fill/README.md +26 -1
- package/src/snackbar/list.tsx +1 -0
- package/src/tab-panel/index.tsx +18 -12
- package/src/toolbar/toolbar/index.tsx +24 -7
- package/src/ui/context/index.ts +1 -0
- package/src/utils/config-values.js +1 -0
- package/src/view/README.md +2 -2
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -35,17 +35,16 @@ function getRowFocusables(rowElement) {
|
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
function UnforwardedTreeGrid(
|
|
38
|
+
function UnforwardedTreeGrid({
|
|
39
|
+
children,
|
|
40
|
+
onExpandRow = () => {},
|
|
41
|
+
onCollapseRow = () => {},
|
|
42
|
+
onFocusRow = () => {},
|
|
43
|
+
applicationAriaLabel,
|
|
44
|
+
...props
|
|
45
|
+
},
|
|
39
46
|
/** A ref to the underlying DOM table element. */
|
|
40
47
|
ref) {
|
|
41
|
-
let {
|
|
42
|
-
children,
|
|
43
|
-
onExpandRow = () => {},
|
|
44
|
-
onCollapseRow = () => {},
|
|
45
|
-
onFocusRow = () => {},
|
|
46
|
-
applicationAriaLabel,
|
|
47
|
-
...props
|
|
48
|
-
} = _ref;
|
|
49
48
|
const onKeyDown = useCallback(event => {
|
|
50
49
|
const {
|
|
51
50
|
keyCode,
|
|
@@ -99,7 +98,7 @@ ref) {
|
|
|
99
98
|
|
|
100
99
|
if (canExpandCollapse) {
|
|
101
100
|
if (keyCode === LEFT) {
|
|
102
|
-
var _activeRow$getAttribu
|
|
101
|
+
var _activeRow$getAttribu;
|
|
103
102
|
|
|
104
103
|
// Left:
|
|
105
104
|
// If a row is focused, and it is expanded, collapses the current row.
|
|
@@ -110,7 +109,7 @@ ref) {
|
|
|
110
109
|
} // If a row is focused, and it is collapsed, moves to the parent row (if there is one).
|
|
111
110
|
|
|
112
111
|
|
|
113
|
-
const level = Math.max(parseInt((_activeRow$getAttribu = activeRow
|
|
112
|
+
const level = Math.max(parseInt((_activeRow$getAttribu = activeRow?.getAttribute('aria-level')) !== null && _activeRow$getAttribu !== void 0 ? _activeRow$getAttribu : '1', 10) - 1, 1);
|
|
114
113
|
const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
|
|
115
114
|
let parentRow = activeRow;
|
|
116
115
|
const currentRowIndex = rows.indexOf(activeRow);
|
|
@@ -124,7 +123,7 @@ ref) {
|
|
|
124
123
|
}
|
|
125
124
|
}
|
|
126
125
|
|
|
127
|
-
|
|
126
|
+
getRowFocusables(parentRow)?.[0]?.focus();
|
|
128
127
|
}
|
|
129
128
|
|
|
130
129
|
if (keyCode === RIGHT) {
|
|
@@ -140,9 +139,7 @@ ref) {
|
|
|
140
139
|
const focusableItems = getRowFocusables(activeRow);
|
|
141
140
|
|
|
142
141
|
if (focusableItems.length > 0) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
(_focusableItems$nextI = focusableItems[nextIndex]) === null || _focusableItems$nextI === void 0 ? void 0 : _focusableItems$nextI.focus();
|
|
142
|
+
focusableItems[nextIndex]?.focus();
|
|
146
143
|
}
|
|
147
144
|
} // Prevent key use for anything else. For example, Voiceover
|
|
148
145
|
// will start reading text on continued use of left/right arrow
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-grid/index.tsx"],"names":["focus","forwardRef","useCallback","UP","DOWN","LEFT","RIGHT","HOME","END","RovingTabIndexContainer","getRowFocusables","rowElement","focusablesInRow","focusable","find","sequential","filter","closest","UnforwardedTreeGrid","ref","children","onExpandRow","onCollapseRow","onFocusRow","applicationAriaLabel","props","onKeyDown","event","keyCode","metaKey","ctrlKey","altKey","hasModifierKeyPressed","includes","stopPropagation","activeElement","document","currentTarget","treeGridElement","contains","activeRow","currentColumnIndex","indexOf","canExpandCollapse","cannotFocusNextColumn","getAttribute","nextIndex","Math","max","min","length","preventDefault","level","parseInt","rows","Array","from","querySelectorAll","parentRow","currentRowIndex","i","ariaLevel","focusableItems","nextRowIndex","focusablesInNextRow","TreeGrid","default","TreeGridRow","TreeGridCell","TreeGridItem"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,KAAT,QAAsB,gBAAtB;AACA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,oBAAxC;AACA,SAASC,EAAT,EAAaC,IAAb,EAAmBC,IAAnB,EAAyBC,KAAzB,EAAgCC,IAAhC,EAAsCC,GAAtC,QAAiD,qBAAjD;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,oBAApC;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAT,CAA2BC,UAA3B,EAAqD;AACpD,QAAMC,eAAe,GAAGZ,KAAK,CAACa,SAAN,CAAgBC,IAAhB,CAAsBH,UAAtB,EAAkC;AACzDI,IAAAA,UAAU,EAAE;AAD6C,GAAlC,CAAxB;AAIA,SAAOH,eAAe,CAACI,MAAhB,CAA0BH,SAAF,IAAiB;AAC/C,WAAOA,SAAS,CAACI,OAAV,CAAmB,cAAnB,MAAwCN,UAA/C;AACA,GAFM,CAAP;AAGA;AAED;AACA;AACA;AACA;;;AACA,SAASO,mBAAT;AASC;AACAC,GAVD,EAWE;AAAA,MAVD;AACCC,IAAAA,QADD;AAECC,IAAAA,WAAW,GAAG,MAAM,CAAE,CAFvB;AAGCC,IAAAA,aAAa,GAAG,MAAM,CAAE,CAHzB;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IAAA,SAAS,EAAGC,SAHb;AAIC,IAAA,GAAG,EAAGP;AAJP,MAMC,6BAASC,QAAT,CAND,CADD,CAND,CADD;AAmBA;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,MAAM6C,QAAQ,GAAGhE,UAAU,CAAEiB,mBAAF,CAA3B;AAEP,eAAe+C,QAAf;AACA,SAASC,OAAO,IAAIC,WAApB,QAAuC,OAAvC;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,QAAxC;AACA,SAASF,OAAO,IAAIG,YAApB,QAAwC,QAAxC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { forwardRef, useCallback } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT, HOME, END } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexContainer from './roving-tab-index';\nimport type { TreeGridProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * Return focusables in a row element, excluding those from other branches\n * nested within the row.\n *\n * @param rowElement The DOM element representing the row.\n *\n * @return The array of focusables in the row.\n */\nfunction getRowFocusables( rowElement: HTMLElement ) {\n\tconst focusablesInRow = focus.focusable.find( rowElement, {\n\t\tsequential: true,\n\t} );\n\n\treturn focusablesInRow.filter( ( focusable ) => {\n\t\treturn focusable.closest( '[role=\"row\"]' ) === rowElement;\n\t} );\n}\n\n/**\n * Renders both a table and tbody element, used to create a tree hierarchy.\n *\n */\nfunction UnforwardedTreeGrid(\n\t{\n\t\tchildren,\n\t\tonExpandRow = () => {},\n\t\tonCollapseRow = () => {},\n\t\tonFocusRow = () => {},\n\t\tapplicationAriaLabel,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridProps, 'table', false >,\n\t/** A ref to the underlying DOM table element. */\n\tref: React.ForwardedRef< HTMLTableElement >\n) {\n\tconst onKeyDown = useCallback(\n\t\t( event: React.KeyboardEvent< HTMLTableElement > ) => {\n\t\t\tconst { keyCode, metaKey, ctrlKey, altKey } = event;\n\n\t\t\t// The shift key is intentionally absent from the following list,\n\t\t\t// to enable shift + up/down to select items from the list.\n\t\t\tconst hasModifierKeyPressed = metaKey || ctrlKey || altKey;\n\n\t\t\tif (\n\t\t\t\thasModifierKeyPressed ||\n\t\t\t\t! ( [ UP, DOWN, LEFT, RIGHT, HOME, END ] as number[] ).includes(\n\t\t\t\t\tkeyCode\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The event will be handled, stop propagation.\n\t\t\tevent.stopPropagation();\n\n\t\t\tconst { activeElement } = document;\n\t\t\tconst { currentTarget: treeGridElement } = event;\n\n\t\t\tif (\n\t\t\t\t! activeElement ||\n\t\t\t\t! treeGridElement.contains( activeElement )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Calculate the columnIndex of the active element.\n\t\t\tconst activeRow =\n\t\t\t\tactiveElement.closest< HTMLElement >( '[role=\"row\"]' );\n\n\t\t\tif ( ! activeRow ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst focusablesInRow = getRowFocusables( activeRow );\n\t\t\tconst currentColumnIndex = focusablesInRow.indexOf(\n\t\t\t\tactiveElement as HTMLElement\n\t\t\t);\n\t\t\tconst canExpandCollapse = 0 === currentColumnIndex;\n\t\t\tconst cannotFocusNextColumn =\n\t\t\t\tcanExpandCollapse &&\n\t\t\t\t( activeRow.getAttribute( 'data-expanded' ) === 'false' ||\n\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'false' ) &&\n\t\t\t\tkeyCode === RIGHT;\n\n\t\t\tif ( ( [ LEFT, RIGHT ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate to the next element.\n\t\t\t\tlet nextIndex;\n\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\tnextIndex = Math.max( 0, currentColumnIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextIndex = Math.min(\n\t\t\t\t\t\tcurrentColumnIndex + 1,\n\t\t\t\t\t\tfocusablesInRow.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is at the left most column.\n\t\t\t\tif ( canExpandCollapse ) {\n\t\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\t\t// Left:\n\t\t\t\t\t\t// If a row is focused, and it is expanded, collapses the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'data-expanded' ) ===\n\t\t\t\t\t\t\t\t'true' ||\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'true'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonCollapseRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, moves to the parent row (if there is one).\n\t\t\t\t\t\tconst level = Math.max(\n\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\tactiveRow?.getAttribute( 'aria-level' ) ?? '1',\n\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t) - 1,\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rows = Array.from(\n\t\t\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet parentRow = activeRow;\n\t\t\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\t\t\tfor ( let i = currentRowIndex; i >= 0; i-- ) {\n\t\t\t\t\t\t\tconst ariaLevel =\n\t\t\t\t\t\t\t\trows[ i ].getAttribute( 'aria-level' );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tariaLevel !== null &&\n\t\t\t\t\t\t\t\tparseInt( ariaLevel, 10 ) === level\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tparentRow = rows[ i ];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowFocusables( parentRow )?.[ 0 ]?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( keyCode === RIGHT ) {\n\t\t\t\t\t\t// Right:\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, expands the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'data-expanded' ) ===\n\t\t\t\t\t\t\t\t'false' ||\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) ===\n\t\t\t\t\t\t\t\t'false'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonExpandRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is expanded, focuses the next cell in the row.\n\t\t\t\t\t\tconst focusableItems = getRowFocusables( activeRow );\n\t\t\t\t\t\tif ( focusableItems.length > 0 ) {\n\t\t\t\t\t\t\tfocusableItems[ nextIndex ]?.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start reading text on continued use of left/right arrow\n\t\t\t\t\t// keys.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Focus the next element. If at most left column and row is collapsed, moving right is not allowed as this will expand. However, if row is collapsed, moving left is allowed.\n\t\t\t\tif ( cannotFocusNextColumn ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfocusablesInRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( ( [ UP, DOWN ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === UP ) {\n\t\t\t\t\tnextRowIndex = Math.max( 0, currentRowIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = Math.min(\n\t\t\t\t\t\tcurrentRowIndex + 1,\n\t\t\t\t\t\trows.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( ( [ HOME, END ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === HOME ) {\n\t\t\t\t\tnextRowIndex = 0;\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = rows.length - 1;\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ onExpandRow, onCollapseRow, onFocusRow ]\n\t);\n\n\t/* Disable reason: A treegrid is implemented using a table element. */\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n\treturn (\n\t\t<RovingTabIndexContainer>\n\t\t\t{\n\t\t\t\t// Prevent browser mode from triggering in NVDA by wrapping List View\n\t\t\t\t// in a role=application wrapper.\n\t\t\t\t// see: https://github.com/WordPress/gutenberg/issues/43729\n\t\t\t }\n\t\t\t<div role=\"application\" aria-label={ applicationAriaLabel }>\n\t\t\t\t<table\n\t\t\t\t\t{ ...props }\n\t\t\t\t\trole=\"treegrid\"\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t\tref={ ref }\n\t\t\t\t>\n\t\t\t\t\t<tbody>{ children }</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t</RovingTabIndexContainer>\n\t);\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */\n}\n\n/**\n * `TreeGrid` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * A tree grid is a hierarchical 2 dimensional UI component, for example it could be\n * used to implement a file system browser.\n *\n * A tree grid allows the user to navigate using arrow keys.\n * Up/down to navigate vertically across rows, and left/right to navigate horizontally\n * between focusables in a row.\n *\n * The `TreeGrid` renders both a `table` and `tbody` element, and is intended to be used\n * with `TreeGridRow` (`tr`) and `TreeGridCell` (`td`) to build out a grid.\n *\n * ```jsx\n * function TreeMenu() {\n * \treturn (\n * \t\t<TreeGrid>\n * \t\t\t<TreeGridRow level={ 1 } positionInSet={ 1 } setSize={ 2 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t\t<TreeGridRow level={ 1 } positionInSet={ 2 } setSize={ 2 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t\t<TreeGridRow level={ 2 } positionInSet={ 1 } setSize={ 1 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t</TreeGrid>\n * \t);\n * }\n * ```\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGrid = forwardRef( UnforwardedTreeGrid );\n\nexport default TreeGrid;\nexport { default as TreeGridRow } from './row';\nexport { default as TreeGridCell } from './cell';\nexport { default as TreeGridItem } from './item';\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-grid/index.tsx"],"names":["focus","forwardRef","useCallback","UP","DOWN","LEFT","RIGHT","HOME","END","RovingTabIndexContainer","getRowFocusables","rowElement","focusablesInRow","focusable","find","sequential","filter","closest","UnforwardedTreeGrid","children","onExpandRow","onCollapseRow","onFocusRow","applicationAriaLabel","props","ref","onKeyDown","event","keyCode","metaKey","ctrlKey","altKey","hasModifierKeyPressed","includes","stopPropagation","activeElement","document","currentTarget","treeGridElement","contains","activeRow","currentColumnIndex","indexOf","canExpandCollapse","cannotFocusNextColumn","getAttribute","nextIndex","Math","max","min","length","preventDefault","level","parseInt","rows","Array","from","querySelectorAll","parentRow","currentRowIndex","i","ariaLevel","focusableItems","nextRowIndex","focusablesInNextRow","TreeGrid","default","TreeGridRow","TreeGridCell","TreeGridItem"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,KAAT,QAAsB,gBAAtB;AACA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,oBAAxC;AACA,SAASC,EAAT,EAAaC,IAAb,EAAmBC,IAAnB,EAAyBC,KAAzB,EAAgCC,IAAhC,EAAsCC,GAAtC,QAAiD,qBAAjD;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,oBAApC;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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c,MAAAA,mBAAmB,CAAElB,SAAF,CAAnB,CAAiC9C,KAAjC,GA5C+D,CA8C/D;AACA;;AACAsB,MAAAA,UAAU,CAAEK,KAAF,EAASa,SAAT,EAAoBc,IAAI,CAAES,YAAF,CAAxB,CAAV,CAhD+D,CAkD/D;AACA;;AACApC,MAAAA,KAAK,CAACwB,cAAN;AACA;AACD,GAzP2B,EA0P5B,CAAE/B,WAAF,EAAeC,aAAf,EAA8BC,UAA9B,CA1P4B,CAA7B;AA6PA;;AACA;;AACA,SACC,cAAC,uBAAD,QAMC;AAAK,IAAA,IAAI,EAAC,aAAV;AAAwB,kBAAaC;AAArC,KACC,oCACMC,KADN;AAEC,IAAA,IAAI,EAAC,UAFN;AAGC,IAAA,SAAS,EAAGE,SAHb;AAIC,IAAA,GAAG,EAAGD;AAJP,MAMC,6BAASN,QAAT,CAND,CADD,CAND,CADD;AAmBA;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,MAAM8C,QAAQ,GAAGhE,UAAU,CAAEiB,mBAAF,CAA3B;AAEP,eAAe+C,QAAf;AACA,SAASC,OAAO,IAAIC,WAApB,QAAuC,OAAvC;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,QAAxC;AACA,SAASF,OAAO,IAAIG,YAApB,QAAwC,QAAxC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { forwardRef, useCallback } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT, HOME, END } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexContainer from './roving-tab-index';\nimport type { TreeGridProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * Return focusables in a row element, excluding those from other branches\n * nested within the row.\n *\n * @param rowElement The DOM element representing the row.\n *\n * @return The array of focusables in the row.\n */\nfunction getRowFocusables( rowElement: HTMLElement ) {\n\tconst focusablesInRow = focus.focusable.find( rowElement, {\n\t\tsequential: true,\n\t} );\n\n\treturn focusablesInRow.filter( ( focusable ) => {\n\t\treturn focusable.closest( '[role=\"row\"]' ) === rowElement;\n\t} );\n}\n\n/**\n * Renders both a table and tbody element, used to create a tree hierarchy.\n *\n */\nfunction UnforwardedTreeGrid(\n\t{\n\t\tchildren,\n\t\tonExpandRow = () => {},\n\t\tonCollapseRow = () => {},\n\t\tonFocusRow = () => {},\n\t\tapplicationAriaLabel,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridProps, 'table', false >,\n\t/** A ref to the underlying DOM table element. */\n\tref: React.ForwardedRef< HTMLTableElement >\n) {\n\tconst onKeyDown = useCallback(\n\t\t( event: React.KeyboardEvent< HTMLTableElement > ) => {\n\t\t\tconst { keyCode, metaKey, ctrlKey, altKey } = event;\n\n\t\t\t// The shift key is intentionally absent from the following list,\n\t\t\t// to enable shift + up/down to select items from the list.\n\t\t\tconst hasModifierKeyPressed = metaKey || ctrlKey || altKey;\n\n\t\t\tif (\n\t\t\t\thasModifierKeyPressed ||\n\t\t\t\t! ( [ UP, DOWN, LEFT, RIGHT, HOME, END ] as number[] ).includes(\n\t\t\t\t\tkeyCode\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The event will be handled, stop propagation.\n\t\t\tevent.stopPropagation();\n\n\t\t\tconst { activeElement } = document;\n\t\t\tconst { currentTarget: treeGridElement } = event;\n\n\t\t\tif (\n\t\t\t\t! activeElement ||\n\t\t\t\t! treeGridElement.contains( activeElement )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Calculate the columnIndex of the active element.\n\t\t\tconst activeRow =\n\t\t\t\tactiveElement.closest< HTMLElement >( '[role=\"row\"]' );\n\n\t\t\tif ( ! activeRow ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst focusablesInRow = getRowFocusables( activeRow );\n\t\t\tconst currentColumnIndex = focusablesInRow.indexOf(\n\t\t\t\tactiveElement as HTMLElement\n\t\t\t);\n\t\t\tconst canExpandCollapse = 0 === currentColumnIndex;\n\t\t\tconst cannotFocusNextColumn =\n\t\t\t\tcanExpandCollapse &&\n\t\t\t\t( activeRow.getAttribute( 'data-expanded' ) === 'false' ||\n\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'false' ) &&\n\t\t\t\tkeyCode === RIGHT;\n\n\t\t\tif ( ( [ LEFT, RIGHT ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate to the next element.\n\t\t\t\tlet nextIndex;\n\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\tnextIndex = Math.max( 0, currentColumnIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextIndex = Math.min(\n\t\t\t\t\t\tcurrentColumnIndex + 1,\n\t\t\t\t\t\tfocusablesInRow.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is at the left most column.\n\t\t\t\tif ( canExpandCollapse ) {\n\t\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\t\t// Left:\n\t\t\t\t\t\t// If a row is focused, and it is expanded, collapses the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'data-expanded' ) ===\n\t\t\t\t\t\t\t\t'true' ||\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'true'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonCollapseRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, moves to the parent row (if there is one).\n\t\t\t\t\t\tconst level = Math.max(\n\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\tactiveRow?.getAttribute( 'aria-level' ) ?? '1',\n\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t) - 1,\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rows = Array.from(\n\t\t\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet parentRow = activeRow;\n\t\t\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\t\t\tfor ( let i = currentRowIndex; i >= 0; i-- ) {\n\t\t\t\t\t\t\tconst ariaLevel =\n\t\t\t\t\t\t\t\trows[ i ].getAttribute( 'aria-level' );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tariaLevel !== null &&\n\t\t\t\t\t\t\t\tparseInt( ariaLevel, 10 ) === level\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tparentRow = rows[ i ];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowFocusables( parentRow )?.[ 0 ]?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( keyCode === RIGHT ) {\n\t\t\t\t\t\t// Right:\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, expands the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'data-expanded' ) ===\n\t\t\t\t\t\t\t\t'false' ||\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) ===\n\t\t\t\t\t\t\t\t'false'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonExpandRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is expanded, focuses the next cell in the row.\n\t\t\t\t\t\tconst focusableItems = getRowFocusables( activeRow );\n\t\t\t\t\t\tif ( focusableItems.length > 0 ) {\n\t\t\t\t\t\t\tfocusableItems[ nextIndex ]?.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start reading text on continued use of left/right arrow\n\t\t\t\t\t// keys.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Focus the next element. If at most left column and row is collapsed, moving right is not allowed as this will expand. However, if row is collapsed, moving left is allowed.\n\t\t\t\tif ( cannotFocusNextColumn ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfocusablesInRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( ( [ UP, DOWN ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === UP ) {\n\t\t\t\t\tnextRowIndex = Math.max( 0, currentRowIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = Math.min(\n\t\t\t\t\t\tcurrentRowIndex + 1,\n\t\t\t\t\t\trows.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( ( [ HOME, END ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === HOME ) {\n\t\t\t\t\tnextRowIndex = 0;\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = rows.length - 1;\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ onExpandRow, onCollapseRow, onFocusRow ]\n\t);\n\n\t/* Disable reason: A treegrid is implemented using a table element. */\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n\treturn (\n\t\t<RovingTabIndexContainer>\n\t\t\t{\n\t\t\t\t// Prevent browser mode from triggering in NVDA by wrapping List View\n\t\t\t\t// in a role=application wrapper.\n\t\t\t\t// see: https://github.com/WordPress/gutenberg/issues/43729\n\t\t\t }\n\t\t\t<div role=\"application\" aria-label={ applicationAriaLabel }>\n\t\t\t\t<table\n\t\t\t\t\t{ ...props }\n\t\t\t\t\trole=\"treegrid\"\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t\tref={ ref }\n\t\t\t\t>\n\t\t\t\t\t<tbody>{ children }</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t</RovingTabIndexContainer>\n\t);\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */\n}\n\n/**\n * `TreeGrid` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * A tree grid is a hierarchical 2 dimensional UI component, for example it could be\n * used to implement a file system browser.\n *\n * A tree grid allows the user to navigate using arrow keys.\n * Up/down to navigate vertically across rows, and left/right to navigate horizontally\n * between focusables in a row.\n *\n * The `TreeGrid` renders both a `table` and `tbody` element, and is intended to be used\n * with `TreeGridRow` (`tr`) and `TreeGridCell` (`td`) to build out a grid.\n *\n * ```jsx\n * function TreeMenu() {\n * \treturn (\n * \t\t<TreeGrid>\n * \t\t\t<TreeGridRow level={ 1 } positionInSet={ 1 } setSize={ 2 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t\t<TreeGridRow level={ 1 } positionInSet={ 2 } setSize={ 2 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t\t<TreeGridRow level={ 2 } positionInSet={ 1 } setSize={ 1 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t</TreeGrid>\n * \t);\n * }\n * ```\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGrid = forwardRef( UnforwardedTreeGrid );\n\nexport default TreeGrid;\nexport { default as TreeGridRow } from './row';\nexport { default as TreeGridCell } from './cell';\nexport { default as TreeGridItem } from './item';\n"]}
|
|
@@ -11,11 +11,10 @@ import { forwardRef } from '@wordpress/element';
|
|
|
11
11
|
|
|
12
12
|
import RovingTabIndexItem from './roving-tab-index-item';
|
|
13
13
|
|
|
14
|
-
function UnforwardedTreeGridItem(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = _ref;
|
|
14
|
+
function UnforwardedTreeGridItem({
|
|
15
|
+
children,
|
|
16
|
+
...props
|
|
17
|
+
}, ref) {
|
|
19
18
|
return createElement(RovingTabIndexItem, _extends({
|
|
20
19
|
ref: ref
|
|
21
20
|
}, props), children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-grid/item.tsx"],"names":["forwardRef","RovingTabIndexItem","UnforwardedTreeGridItem","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-grid/item.tsx"],"names":["forwardRef","RovingTabIndexItem","UnforwardedTreeGridItem","children","props","ref","TreeGridItem"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;;AAGA,SAASC,uBAAT,CACC;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CADD,EAECC,GAFD,EAGE;AACD,SACC,cAAC,kBAAD;AAAoB,IAAA,GAAG,EAAGA;AAA1B,KAAqCD,KAArC,GACGD,QADH,CADD;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,MAAMG,YAAY,GAAGN,UAAU,CAAEE,uBAAF,CAA/B;AAEP,eAAeI,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexItem from './roving-tab-index-item';\nimport type { RovingTabIndexItemProps } from './types';\n\nfunction UnforwardedTreeGridItem(\n\t{ children, ...props }: RovingTabIndexItemProps,\n\tref: React.ForwardedRef< any >\n) {\n\treturn (\n\t\t<RovingTabIndexItem ref={ ref } { ...props }>\n\t\t\t{ children }\n\t\t</RovingTabIndexItem>\n\t);\n}\n\n/**\n * `TreeGridItem` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridItem = forwardRef( UnforwardedTreeGridItem );\n\nexport default TreeGridItem;\n"]}
|
|
@@ -9,12 +9,11 @@ import { useRef, forwardRef } from '@wordpress/element';
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { useRovingTabIndexContext } from './roving-tab-index-context';
|
|
12
|
-
export const RovingTabIndexItem = forwardRef(function UnforwardedRovingTabIndexItem(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = _ref;
|
|
12
|
+
export const RovingTabIndexItem = forwardRef(function UnforwardedRovingTabIndexItem({
|
|
13
|
+
children,
|
|
14
|
+
as: Component,
|
|
15
|
+
...props
|
|
16
|
+
}, forwardedRef) {
|
|
18
17
|
const localRef = useRef();
|
|
19
18
|
const ref = forwardedRef || localRef; // @ts-expect-error - We actually want to throw an error if this is undefined.
|
|
20
19
|
|
|
@@ -32,7 +31,7 @@ export const RovingTabIndexItem = forwardRef(function UnforwardedRovingTabIndexI
|
|
|
32
31
|
'current' in ref ? ref.current : undefined) ? 0 : -1;
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
const onFocus = event => setLastFocusedElement
|
|
34
|
+
const onFocus = event => setLastFocusedElement?.(event.target);
|
|
36
35
|
|
|
37
36
|
const allProps = {
|
|
38
37
|
ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-grid/roving-tab-index-item.tsx"],"names":["useRef","forwardRef","useRovingTabIndexContext","RovingTabIndexItem","UnforwardedRovingTabIndexItem","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-grid/roving-tab-index-item.tsx"],"names":["useRef","forwardRef","useRovingTabIndexContext","RovingTabIndexItem","UnforwardedRovingTabIndexItem","children","as","Component","props","forwardedRef","localRef","ref","lastFocusedElement","setLastFocusedElement","tabIndex","current","undefined","onFocus","event","target","allProps"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,EAAiBC,UAAjB,QAAmC,oBAAnC;AAEA;AACA;AACA;;AACA,SAASC,wBAAT,QAAyC,4BAAzC;AAGA,OAAO,MAAMC,kBAAkB,GAAGF,UAAU,CAC3C,SAASG,6BAAT,CACC;AAAEC,EAAAA,QAAF;AAAYC,EAAAA,EAAE,EAAEC,SAAhB;AAA2B,KAAGC;AAA9B,CADD,EAECC,YAFD,EAGE;AACD,QAAMC,QAAQ,GAAGV,MAAM,EAAvB;AACA,QAAMW,GAAG,GAAGF,YAAY,IAAIC,QAA5B,CAFC,CAGD;;AACA,QAAM;AAAEE,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,MACLX,wBAAwB,EADzB;AAEA,MAAIY,QAAJ;;AAEA,MAAKF,kBAAL,EAA0B;AACzBE,IAAAA,QAAQ,GACPF,kBAAkB,OAClB;AACA;AACA;AACA;AACE,iBAAaD,GAAb,GAAmBA,GAAG,CAACI,OAAvB,GAAiCC,SALjB,CAAlB,GAMG,CANH,GAOG,CAAC,CARL;AASA;;AAED,QAAMC,OAA+C,GAAKC,KAAF,IACvDL,qBAAqB,GAAIK,KAAK,CAACC,MAAV,CADtB;;AAEA,QAAMC,QAAQ,GAAG;AAAET,IAAAA,GAAF;AAAOG,IAAAA,QAAP;AAAiBG,IAAAA,OAAjB;AAA0B,OAAGT;AAA7B,GAAjB;;AAEA,MAAK,OAAOH,QAAP,KAAoB,UAAzB,EAAsC;AACrC,WAAOA,QAAQ,CAAEe,QAAF,CAAf;AACA;;AAED,MAAK,CAAEb,SAAP,EAAmB,OAAO,IAAP;AAEnB,SAAO,cAAC,SAAD,EAAgBa,QAAhB,EAA6Bf,QAA7B,CAAP;AACA,CAnC0C,CAArC;AAsCP,eAAeF,kBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useRovingTabIndexContext } from './roving-tab-index-context';\nimport type { RovingTabIndexItemProps } from './types';\n\nexport const RovingTabIndexItem = forwardRef(\n\tfunction UnforwardedRovingTabIndexItem(\n\t\t{ children, as: Component, ...props }: RovingTabIndexItemProps,\n\t\tforwardedRef: React.ForwardedRef< any >\n\t) {\n\t\tconst localRef = useRef< any >();\n\t\tconst ref = forwardedRef || localRef;\n\t\t// @ts-expect-error - We actually want to throw an error if this is undefined.\n\t\tconst { lastFocusedElement, setLastFocusedElement } =\n\t\t\tuseRovingTabIndexContext();\n\t\tlet tabIndex;\n\n\t\tif ( lastFocusedElement ) {\n\t\t\ttabIndex =\n\t\t\t\tlastFocusedElement ===\n\t\t\t\t// TODO: The original implementation simply used `ref.current` here, assuming\n\t\t\t\t// that a forwarded ref would always be an object, which is not necessarily true.\n\t\t\t\t// This workaround maintains the original runtime behavior in a type-safe way,\n\t\t\t\t// but should be revisited.\n\t\t\t\t( 'current' in ref ? ref.current : undefined )\n\t\t\t\t\t? 0\n\t\t\t\t\t: -1;\n\t\t}\n\n\t\tconst onFocus: React.FocusEventHandler< HTMLElement > = ( event ) =>\n\t\t\tsetLastFocusedElement?.( event.target );\n\t\tconst allProps = { ref, tabIndex, onFocus, ...props };\n\n\t\tif ( typeof children === 'function' ) {\n\t\t\treturn children( allProps );\n\t\t}\n\n\t\tif ( ! Component ) return null;\n\n\t\treturn <Component { ...allProps }>{ children }</Component>;\n\t}\n);\n\nexport default RovingTabIndexItem;\n"]}
|
|
@@ -15,10 +15,9 @@ import { RovingTabIndexProvider } from './roving-tab-index-context';
|
|
|
15
15
|
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
export default function RovingTabIndex(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} = _ref;
|
|
18
|
+
export default function RovingTabIndex({
|
|
19
|
+
children
|
|
20
|
+
}) {
|
|
22
21
|
const [lastFocusedElement, setLastFocusedElement] = useState(); // Use `useMemo` to avoid creation of a new object for the providerValue
|
|
23
22
|
// on every render. Only create a new object when the `lastFocusedElement`
|
|
24
23
|
// value changes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-grid/roving-tab-index.tsx"],"names":["useState","useMemo","RovingTabIndexProvider","RovingTabIndex","children","lastFocusedElement","setLastFocusedElement","providerValue"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,OAAnB,QAAkC,oBAAlC;AAEA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,4BAAvC;AAEA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,cAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-grid/roving-tab-index.tsx"],"names":["useState","useMemo","RovingTabIndexProvider","RovingTabIndex","children","lastFocusedElement","setLastFocusedElement","providerValue"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,OAAnB,QAAkC,oBAAlC;AAEA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,4BAAvC;AAEA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,cAAT,CAAyB;AACvCC,EAAAA;AADuC,CAAzB,EAIX;AACH,QAAM,CAAEC,kBAAF,EAAsBC,qBAAtB,IACLN,QAAQ,EADT,CADG,CAIH;AACA;AACA;;AACA,QAAMO,aAAa,GAAGN,OAAO,CAC5B,OAAQ;AAAEI,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,GAAR,CAD4B,EAE5B,CAAED,kBAAF,CAF4B,CAA7B;AAKA,SACC,cAAC,sBAAD;AAAwB,IAAA,KAAK,EAAGE;AAAhC,KACGH,QADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { RovingTabIndexProvider } from './roving-tab-index-context';\n\n/**\n * Provider for adding roving tab index behaviors to tree grid structures.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md\n */\nexport default function RovingTabIndex( {\n\tchildren,\n}: {\n\tchildren: React.ReactNode;\n} ) {\n\tconst [ lastFocusedElement, setLastFocusedElement ] =\n\t\tuseState< HTMLElement >();\n\n\t// Use `useMemo` to avoid creation of a new object for the providerValue\n\t// on every render. Only create a new object when the `lastFocusedElement`\n\t// value changes.\n\tconst providerValue = useMemo(\n\t\t() => ( { lastFocusedElement, setLastFocusedElement } ),\n\t\t[ lastFocusedElement ]\n\t);\n\n\treturn (\n\t\t<RovingTabIndexProvider value={ providerValue }>\n\t\t\t{ children }\n\t\t</RovingTabIndexProvider>\n\t);\n}\n"]}
|
|
@@ -9,15 +9,14 @@ import { forwardRef } from '@wordpress/element';
|
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
function UnforwardedTreeGridRow(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = _ref;
|
|
12
|
+
function UnforwardedTreeGridRow({
|
|
13
|
+
children,
|
|
14
|
+
level,
|
|
15
|
+
positionInSet,
|
|
16
|
+
setSize,
|
|
17
|
+
isExpanded,
|
|
18
|
+
...props
|
|
19
|
+
}, ref) {
|
|
21
20
|
return createElement("tr", _extends({}, props, {
|
|
22
21
|
ref: ref,
|
|
23
22
|
role: "row",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-grid/row.tsx"],"names":["forwardRef","UnforwardedTreeGridRow","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-grid/row.tsx"],"names":["forwardRef","UnforwardedTreeGridRow","children","level","positionInSet","setSize","isExpanded","props","ref","TreeGridRow"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AAIA,SAASC,sBAAT,CACC;AACCC,EAAAA,QADD;AAECC,EAAAA,KAFD;AAGCC,EAAAA,aAHD;AAICC,EAAAA,OAJD;AAKCC,EAAAA,UALD;AAMC,KAAGC;AANJ,CADD,EASCC,GATD,EAUE;AACD,SACC,iCACMD,KADN;AAEC,IAAA,GAAG,EAAGC,GAFP;AAGC,IAAA,IAAI,EAAC,KAHN;AAIC,kBAAaL,KAJd;AAKC,qBAAgBC,aALjB;AAMC,oBAAeC,OANhB;AAOC,qBAAgBC;AAPjB,MASGJ,QATH,CADD;AAaA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,MAAMO,WAAW,GAAGT,UAAU,CAAEC,sBAAF,CAA9B;AAEP,eAAeQ,WAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { TreeGridRowProps } from './types';\n\nfunction UnforwardedTreeGridRow(\n\t{\n\t\tchildren,\n\t\tlevel,\n\t\tpositionInSet,\n\t\tsetSize,\n\t\tisExpanded,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridRowProps, 'tr', false >,\n\tref: React.ForwardedRef< HTMLTableRowElement >\n) {\n\treturn (\n\t\t<tr\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\trole=\"row\"\n\t\t\taria-level={ level }\n\t\t\taria-posinset={ positionInSet }\n\t\t\taria-setsize={ setSize }\n\t\t\taria-expanded={ isExpanded }\n\t\t>\n\t\t\t{ children }\n\t\t</tr>\n\t);\n}\n\n/**\n * `TreeGridRow` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridRow = forwardRef( UnforwardedTreeGridRow );\n\nexport default TreeGridRow;\n"]}
|
|
@@ -12,8 +12,7 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
12
12
|
|
|
13
13
|
import { SelectControl } from '../select-control';
|
|
14
14
|
|
|
15
|
-
function getSelectOptions(tree) {
|
|
16
|
-
let level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
15
|
+
function getSelectOptions(tree, level = 0) {
|
|
17
16
|
return tree.flatMap(treeNode => [{
|
|
18
17
|
value: treeNode.id,
|
|
19
18
|
label: '\u00A0'.repeat(level * 3) + decodeEntities(treeNode.name)
|
|
@@ -69,15 +68,14 @@ function getSelectOptions(tree) {
|
|
|
69
68
|
*/
|
|
70
69
|
|
|
71
70
|
|
|
72
|
-
export function TreeSelect(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
} = _ref;
|
|
71
|
+
export function TreeSelect({
|
|
72
|
+
label,
|
|
73
|
+
noOptionLabel,
|
|
74
|
+
onChange,
|
|
75
|
+
selectedId,
|
|
76
|
+
tree = [],
|
|
77
|
+
...props
|
|
78
|
+
}) {
|
|
81
79
|
const options = useMemo(() => {
|
|
82
80
|
return [noOptionLabel && {
|
|
83
81
|
value: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-select/index.tsx"],"names":["useMemo","decodeEntities","SelectControl","getSelectOptions","tree","level","flatMap","treeNode","value","id","label","repeat","name","children","TreeSelect","noOptionLabel","onChange","selectedId","props","options","filter","option"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AACA,SAASC,cAAT,QAA+B,0BAA/B;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,mBAA9B;;AAGA,SAASC,gBAAT,CACCC,IADD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-select/index.tsx"],"names":["useMemo","decodeEntities","SelectControl","getSelectOptions","tree","level","flatMap","treeNode","value","id","label","repeat","name","children","TreeSelect","noOptionLabel","onChange","selectedId","props","options","filter","option"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AACA,SAASC,cAAT,QAA+B,0BAA/B;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,mBAA9B;;AAGA,SAASC,gBAAT,CACCC,IADD,EAECC,KAAK,GAAG,CAFT,EAG+C;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f","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { SelectControl } from '../select-control';\nimport type { TreeSelectProps, Tree, Truthy } from './types';\n\nfunction getSelectOptions(\n\ttree: Tree[],\n\tlevel = 0\n): NonNullable< TreeSelectProps[ 'options' ] > {\n\treturn tree.flatMap( ( treeNode ) => [\n\t\t{\n\t\t\tvalue: treeNode.id,\n\t\t\tlabel:\n\t\t\t\t'\\u00A0'.repeat( level * 3 ) + decodeEntities( treeNode.name ),\n\t\t},\n\t\t...getSelectOptions( treeNode.children || [], level + 1 ),\n\t] );\n}\n\n/**\n * TreeSelect component is used to generate select input fields.\n *\n * @example\n * ```jsx\n * import { TreeSelect } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTreeSelect = () => {\n * \tconst [ page, setPage ] = useState( 'p21' );\n *\n * \treturn (\n * \t\t<TreeSelect\n * \t\t\tlabel=\"Parent page\"\n * \t\t\tnoOptionLabel=\"No parent page\"\n * \t\t\tonChange={ ( newPage ) => setPage( newPage ) }\n * \t\t\tselectedId={ page }\n * \t\t\ttree={ [\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 1',\n * \t\t\t\t\tid: 'p1',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{ name: 'Descend 1 of page 1', id: 'p11' },\n * \t\t\t\t\t\t{ name: 'Descend 2 of page 1', id: 'p12' },\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 2',\n * \t\t\t\t\tid: 'p2',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{\n * \t\t\t\t\t\t\tname: 'Descend 1 of page 2',\n * \t\t\t\t\t\t\tid: 'p21',\n * \t\t\t\t\t\t\tchildren: [\n * \t\t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\t\tname: 'Descend 1 of Descend 1 of page 2',\n * \t\t\t\t\t\t\t\t\tid: 'p211',\n * \t\t\t\t\t\t\t\t},\n * \t\t\t\t\t\t\t],\n * \t\t\t\t\t\t},\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t] }\n * \t\t/>\n * \t);\n * }\n * ```\n */\n\nexport function TreeSelect( {\n\tlabel,\n\tnoOptionLabel,\n\tonChange,\n\tselectedId,\n\ttree = [],\n\t...props\n}: TreeSelectProps ) {\n\tconst options = useMemo( () => {\n\t\treturn [\n\t\t\tnoOptionLabel && { value: '', label: noOptionLabel },\n\t\t\t...getSelectOptions( tree ),\n\t\t].filter( < T, >( option: T ): option is Truthy< T > => !! option );\n\t}, [ noOptionLabel, tree ] );\n\n\treturn (\n\t\t<SelectControl\n\t\t\t{ ...{ label, options, onChange } }\n\t\t\tvalue={ selectedId }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default TreeSelect;\n"]}
|
|
@@ -42,9 +42,7 @@ export function truncateMiddle(word, headLength, tailLength, ellipsis) {
|
|
|
42
42
|
|
|
43
43
|
return word.slice(0, frontLength) + truncateStr + word.slice(wordLength - backLength);
|
|
44
44
|
}
|
|
45
|
-
export function truncateContent() {
|
|
46
|
-
let words = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
47
|
-
let props = arguments.length > 1 ? arguments[1] : undefined;
|
|
45
|
+
export function truncateContent(words = '', props) {
|
|
48
46
|
const mergedProps = { ...TRUNCATE_DEFAULT_PROPS,
|
|
49
47
|
...props
|
|
50
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/truncate/utils.ts"],"names":["isValueDefined","TRUNCATE_ELLIPSIS","TRUNCATE_TYPE","auto","head","middle","tail","none","TRUNCATE_DEFAULT_PROPS","ellipsis","ellipsizeMode","limit","numberOfLines","truncateMiddle","word","headLength","tailLength","wordLength","length","frontLength","backLength","truncateStr","slice","truncateContent","words","props","mergedProps","truncateHead","truncateTail","Math","floor","tru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;;AACD,SACCP,IAAI,CAACQ,KAAL,CAAY,CAAZ,EAAeH,WAAf,IACAE,WADA,GAEAP,IAAI,CAACQ,KAAL,CAAYL,UAAU,GAAGG,UAAzB,CAHD;AAKA;AAED,OAAO,SAASG,eAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/truncate/utils.ts"],"names":["isValueDefined","TRUNCATE_ELLIPSIS","TRUNCATE_TYPE","auto","head","middle","tail","none","TRUNCATE_DEFAULT_PROPS","ellipsis","ellipsizeMode","limit","numberOfLines","truncateMiddle","word","headLength","tailLength","wordLength","length","frontLength","backLength","truncateStr","slice","truncateContent","words","props","mergedProps","truncateHead","truncateTail","Math","floor","truncatedContent"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAT,QAA+B,iBAA/B;AAGA,OAAO,MAAMC,iBAAiB,GAAG,GAA1B;AACP,OAAO,MAAMC,aAAa,GAAG;AAC5BC,EAAAA,IAAI,EAAE,MADsB;AAE5BC,EAAAA,IAAI,EAAE,MAFsB;AAG5BC,EAAAA,MAAM,EAAE,QAHoB;AAI5BC,EAAAA,IAAI,EAAE,MAJsB;AAK5BC,EAAAA,IAAI,EAAE;AALsB,CAAtB;AAQP,OAAO,MAAMC,sBAAsB,GAAG;AACrCC,EAAAA,QAAQ,EAAER,iBAD2B;AAErCS,EAAAA,aAAa,EAAER,aAAa,CAACC,IAFQ;AAGrCQ,EAAAA,KAAK,EAAE,CAH8B;AAIrCC,EAAAA,aAAa,EAAE;AAJsB,CAA/B,C,CAOP;AACA;;AACA,OAAO,SAASC,cAAT,CACNC,IADM,EAENC,UAFM,EAGNC,UAHM,EAINP,QAJM,EAKL;AACD,MAAK,OAAOK,IAAP,KAAgB,QAArB,EAAgC;AAC/B,WAAO,EAAP;AACA;;AACD,QAAMG,UAAU,GAAGH,IAAI,CAACI,MAAxB,CAJC,CAKD;AACA;;AACA,QAAMC,WAAW,GAAG,CAAC,CAACJ,UAAtB,CAPC,CAOiC;AAClC;;AACA,QAAMK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D;AACCgB,MAAAA,YAAY,GAAGhB,KAAf;AACAiB,MAAAA,YAAY,GAAG,CAAf;AAXF;;AAcA,QAAMG,gBAAgB,GACrBrB,aAAa,KAAKR,aAAa,CAACC,IAAhC,GACGU,cAAc,CAAEW,KAAF,EAASG,YAAT,EAAuBC,YAAvB,EAAqCnB,QAArC,CADjB,GAEGe,KAHJ;AAKA,SAAOO,gBAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { isValueDefined } from '../utils/values';\nimport type { TruncateProps } from './types';\n\nexport const TRUNCATE_ELLIPSIS = '…';\nexport const TRUNCATE_TYPE = {\n\tauto: 'auto',\n\thead: 'head',\n\tmiddle: 'middle',\n\ttail: 'tail',\n\tnone: 'none',\n} as const;\n\nexport const TRUNCATE_DEFAULT_PROPS = {\n\tellipsis: TRUNCATE_ELLIPSIS,\n\tellipsizeMode: TRUNCATE_TYPE.auto,\n\tlimit: 0,\n\tnumberOfLines: 0,\n};\n\n// Source\n// https://github.com/kahwee/truncate-middle\nexport function truncateMiddle(\n\tword: string,\n\theadLength: number,\n\ttailLength: number,\n\tellipsis: string\n) {\n\tif ( typeof word !== 'string' ) {\n\t\treturn '';\n\t}\n\tconst wordLength = word.length;\n\t// Setting default values\n\t// eslint-disable-next-line no-bitwise\n\tconst frontLength = ~~headLength; // Will cast to integer\n\t// eslint-disable-next-line no-bitwise\n\tconst backLength = ~~tailLength;\n\t/* istanbul ignore next */\n\tconst truncateStr = isValueDefined( ellipsis )\n\t\t? ellipsis\n\t\t: TRUNCATE_ELLIPSIS;\n\n\tif (\n\t\t( frontLength === 0 && backLength === 0 ) ||\n\t\tfrontLength >= wordLength ||\n\t\tbackLength >= wordLength ||\n\t\tfrontLength + backLength >= wordLength\n\t) {\n\t\treturn word;\n\t} else if ( backLength === 0 ) {\n\t\treturn word.slice( 0, frontLength ) + truncateStr;\n\t}\n\treturn (\n\t\tword.slice( 0, frontLength ) +\n\t\ttruncateStr +\n\t\tword.slice( wordLength - backLength )\n\t);\n}\n\nexport function truncateContent(\n\twords: string = '',\n\tprops: Omit< TruncateProps, 'children' >\n) {\n\tconst mergedProps = { ...TRUNCATE_DEFAULT_PROPS, ...props };\n\tconst { ellipsis, ellipsizeMode, limit } = mergedProps;\n\n\tif ( ellipsizeMode === TRUNCATE_TYPE.none ) {\n\t\treturn words;\n\t}\n\n\tlet truncateHead: number;\n\tlet truncateTail: number;\n\n\tswitch ( ellipsizeMode ) {\n\t\tcase TRUNCATE_TYPE.head:\n\t\t\ttruncateHead = 0;\n\t\t\ttruncateTail = limit;\n\t\t\tbreak;\n\t\tcase TRUNCATE_TYPE.middle:\n\t\t\ttruncateHead = Math.floor( limit / 2 );\n\t\t\ttruncateTail = Math.floor( limit / 2 );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\ttruncateHead = limit;\n\t\t\ttruncateTail = 0;\n\t}\n\n\tconst truncatedContent =\n\t\tellipsizeMode !== TRUNCATE_TYPE.auto\n\t\t\t? truncateMiddle( words, truncateHead, truncateTail, ellipsis )\n\t\t\t: words;\n\n\treturn truncatedContent;\n}\n"]}
|
|
@@ -43,7 +43,7 @@ export function contextConnectWithoutRef(Component, namespace) {
|
|
|
43
43
|
// component wrappers.
|
|
44
44
|
|
|
45
45
|
function _contextConnect(Component, namespace, options) {
|
|
46
|
-
const WrappedComponent = options
|
|
46
|
+
const WrappedComponent = options?.forwardsRef ? forwardRef(Component) : Component;
|
|
47
47
|
|
|
48
48
|
if (typeof namespace === 'undefined') {
|
|
49
49
|
typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? warn('contextConnect: Please provide a namespace') : void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/context/context-connect.ts"],"names":["forwardRef","warn","CONNECT_STATIC_NAMESPACE","getStyledClassNameFromKey","contextConnect","Component","namespace","_contextConnect","forwardsRef","contextConnectWithoutRef","options","WrappedComponent","mergedNamespace","Array","isArray","Object","assign","Set","displayName","selector","getConnectNamespace","namespaces","type","hasConnectNamespace","match","includes","some","result"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,oBAA3B;AACA,OAAOC,IAAP,MAAiB,oBAAjB;AAEA;AACA;AACA;;AACA,SAASC,wBAAT,QAAyC,aAAzC;AACA,SAASC,yBAAT,QAA0C,kCAA1C;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAT,CAGNC,SAHM,EAQNC,SARM,EASL;AACD,SAAOC,eAAe,CAAEF,SAAF,EAAaC,SAAb,EAAwB;AAAEE,IAAAA,WAAW,EAAE;AAAf,GAAxB,CAAtB;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,wBAAT,CACNJ,SADM,EAENC,SAFM,EAGL;AACD,SAAOC,eAAe,CAAEF,SAAF,EAAaC,SAAb,CAAtB;AACA,C,CAED;AACA;AACA;;AACA,SAASC,eAAT,CAICF,SAJD,EAKCC,SALD,EAMCI,OAND,EAUE;AACD,QAAMC,gBAAgB,GAAGD,OAAO,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/ui/context/context-connect.ts"],"names":["forwardRef","warn","CONNECT_STATIC_NAMESPACE","getStyledClassNameFromKey","contextConnect","Component","namespace","_contextConnect","forwardsRef","contextConnectWithoutRef","options","WrappedComponent","mergedNamespace","Array","isArray","Object","assign","Set","displayName","selector","getConnectNamespace","namespaces","type","hasConnectNamespace","match","includes","some","result"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,oBAA3B;AACA,OAAOC,IAAP,MAAiB,oBAAjB;AAEA;AACA;AACA;;AACA,SAASC,wBAAT,QAAyC,aAAzC;AACA,SAASC,yBAAT,QAA0C,kCAA1C;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAT,CAGNC,SAHM,EAQNC,SARM,EASL;AACD,SAAOC,eAA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,CAAEA,SAAP,EAAmB,OAAO,EAAP;AAEnB,MAAIgB,UAAU,GAAG,EAAjB,CAHW,CAKX;;AACA,MAAKhB,SAAS,CAAEH,wBAAF,CAAd,EAA6C;AAC5C;AACAmB,IAAAA,UAAU,GAAGhB,SAAS,CAAEH,wBAAF,CAAtB;AACA,GATU,CAWX;;;AACA,MAAKG,SAAS,CAACiB,IAAV,IAAkBjB,SAAS,CAACiB,IAAV,CAAgBpB,wBAAhB,CAAvB,EAAoE;AACnE;AACAmB,IAAAA,UAAU,GAAGhB,SAAS,CAACiB,IAAV,CAAgBpB,wBAAhB,CAAb;AACA;;AAED,SAAOmB,UAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,mBAAT,CACNlB,SADM,EAENmB,KAFM,EAGI;AACV,MAAK,CAAEnB,SAAP,EAAmB,OAAO,KAAP;;AAEnB,MAAK,OAAOmB,KAAP,KAAiB,QAAtB,EAAiC;AAChC,WAAOJ,mBAAmB,CAAEf,SAAF,CAAnB,CAAiCoB,QAAjC,CAA2CD,KAA3C,CAAP;AACA;;AACD,MAAKX,KAAK,CAACC,OAAN,CAAeU,KAAf,CAAL,EAA8B;AAC7B,WAAOA,KAAK,CAACE,IAAN,CAAcC,MAAF,IAClBP,mBAAmB,CAAEf,SAAF,CAAnB,CAAiCoB,QAAjC,CAA2CE,MAA3C,CADM,CAAP;AAGA;;AAED,SAAO,KAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, ReactChild, ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { CONNECT_STATIC_NAMESPACE } from './constants';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport type { WordPressComponentFromProps } from '.';\n\ntype AcceptsTwoArgs<\n\tF extends ( ...args: any ) => any,\n\tErrorMessage = never\n> = Parameters< F >[ 'length' ] extends 2 ? {} : ErrorMessage;\n\ntype ContextConnectOptions = {\n\tforwardsRef?: boolean;\n};\n\n/**\n * Forwards ref (React.ForwardRef) and \"Connects\" (or registers) a component\n * within the Context system under a specified namespace.\n *\n * @param Component The component to register into the Context system.\n * @param namespace The namespace to register the component under.\n * @return The connected WordPressComponent\n */\nexport function contextConnect<\n\tC extends ( props: any, ref: ForwardedRef< any > ) => JSX.Element | null\n>(\n\tComponent: C &\n\t\tAcceptsTwoArgs<\n\t\t\tC,\n\t\t\t'Warning: Your component function does not take a ref as the second argument. Did you mean to use `contextConnectWithoutRef`?'\n\t\t>,\n\tnamespace: string\n) {\n\treturn _contextConnect( Component, namespace, { forwardsRef: true } );\n}\n\n/**\n * \"Connects\" (or registers) a component within the Context system under a specified namespace.\n * Does not forward a ref.\n *\n * @param Component The component to register into the Context system.\n * @param namespace The namespace to register the component under.\n * @return The connected WordPressComponent\n */\nexport function contextConnectWithoutRef< P >(\n\tComponent: ( props: P ) => JSX.Element | null,\n\tnamespace: string\n) {\n\treturn _contextConnect( Component, namespace );\n}\n\n// This is an (experimental) evolution of the initial connect() HOC.\n// The hope is that we can improve render performance by removing functional\n// component wrappers.\nfunction _contextConnect<\n\tC extends ( props: any, ref: ForwardedRef< any > ) => JSX.Element | null,\n\tO extends ContextConnectOptions\n>(\n\tComponent: C,\n\tnamespace: string,\n\toptions?: O\n): WordPressComponentFromProps<\n\tParameters< C >[ 0 ],\n\tO[ 'forwardsRef' ] extends true ? true : false\n> {\n\tconst WrappedComponent = options?.forwardsRef\n\t\t? forwardRef< any, Parameters< C >[ 0 ] >( Component )\n\t\t: Component;\n\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'contextConnect: Please provide a namespace' );\n\t}\n\n\t// @ts-expect-error internal property\n\tlet mergedNamespace = WrappedComponent[ CONNECT_STATIC_NAMESPACE ] || [\n\t\tnamespace,\n\t];\n\n\t/**\n\t * Consolidate (merge) namespaces before attaching it to the WrappedComponent.\n\t */\n\tif ( Array.isArray( namespace ) ) {\n\t\tmergedNamespace = [ ...mergedNamespace, ...namespace ];\n\t}\n\tif ( typeof namespace === 'string' ) {\n\t\tmergedNamespace = [ ...mergedNamespace, namespace ];\n\t}\n\n\t// @ts-expect-error We can't rely on inferred types here because of the\n\t// `as` prop polymorphism we're handling in https://github.com/WordPress/gutenberg/blob/9620bae6fef4fde7cc2b7833f416e240207cda29/packages/components/src/ui/context/wordpress-component.ts#L32-L33\n\treturn Object.assign( WrappedComponent, {\n\t\t[ CONNECT_STATIC_NAMESPACE ]: [ ...new Set( mergedNamespace ) ],\n\t\tdisplayName: namespace,\n\t\tselector: `.${ getStyledClassNameFromKey( namespace ) }`,\n\t} );\n}\n\n/**\n * Attempts to retrieve the connected namespace from a component.\n *\n * @param Component The component to retrieve a namespace from.\n * @return The connected namespaces.\n */\nexport function getConnectNamespace(\n\tComponent: ReactChild | undefined | {}\n): string[] {\n\tif ( ! Component ) return [];\n\n\tlet namespaces = [];\n\n\t// @ts-ignore internal property\n\tif ( Component[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore internal property\n\t\tnamespaces = Component[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\t// @ts-ignore\n\tif ( Component.type && Component.type[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore\n\t\tnamespaces = Component.type[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\treturn namespaces;\n}\n\n/**\n * Checks to see if a component is connected within the Context system.\n *\n * @param Component The component to retrieve a namespace from.\n * @param match The namespace to check.\n */\nexport function hasConnectNamespace(\n\tComponent: ReactNode,\n\tmatch: string[] | string\n): boolean {\n\tif ( ! Component ) return false;\n\n\tif ( typeof match === 'string' ) {\n\t\treturn getConnectNamespace( Component ).includes( match );\n\t}\n\tif ( Array.isArray( match ) ) {\n\t\treturn match.some( ( result ) =>\n\t\t\tgetConnectNamespace( Component ).includes( result )\n\t\t);\n\t}\n\n\treturn false;\n}\n"]}
|
|
@@ -31,10 +31,9 @@ export const useComponentsContext = () => useContext(ComponentsContext);
|
|
|
31
31
|
* @return {Record<string, any>} The consolidated value.
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
|
-
function useContextSystemBridge(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref;
|
|
34
|
+
function useContextSystemBridge({
|
|
35
|
+
value
|
|
36
|
+
}) {
|
|
38
37
|
const parentContext = useComponentsContext();
|
|
39
38
|
const valueRef = useRef(value);
|
|
40
39
|
useUpdateEffect(() => {
|
|
@@ -83,11 +82,10 @@ function useContextSystemBridge(_ref) {
|
|
|
83
82
|
*/
|
|
84
83
|
|
|
85
84
|
|
|
86
|
-
const BaseContextSystemProvider =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} = _ref2;
|
|
85
|
+
const BaseContextSystemProvider = ({
|
|
86
|
+
children,
|
|
87
|
+
value
|
|
88
|
+
}) => {
|
|
91
89
|
const contextValue = useContextSystemBridge({
|
|
92
90
|
value
|
|
93
91
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/context/context-system-provider.js"],"names":["deepmerge","fastDeepEqual","isPlainObject","createContext","useContext","useRef","useMemo","memo","warn","useUpdateEffect","ComponentsContext","useComponentsContext","useContextSystemBridge","value","parentContext","valueRef","current","JSON","stringify","config","isMergeableObject","BaseContextSystemProvider","children","contextValue","ContextSystemProvider"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,SAAP,MAAsB,WAAtB;AACA,OAAOC,aAAP,MAA0B,qBAA1B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA;AACA;AACA;;AACA,SACCC,aADD,EAECC,UAFD,EAGCC,MAHD,EAICC,OAJD,EAKCC,IALD,QAMO,oBANP;AAOA,OAAOC,IAAP,MAAiB,oBAAjB;AAEA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,aAAhC;AAEA,OAAO,MAAMC,iBAAiB,GAAGP,aAAa;AAC7C;AAAqC,EADQ,CAAvC;AAGP,OAAO,MAAMQ,oBAAoB,GAAG,MAAMP,UAAU,CAAEM,iBAAF,CAA7C;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASE,sBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/ui/context/context-system-provider.js"],"names":["deepmerge","fastDeepEqual","isPlainObject","createContext","useContext","useRef","useMemo","memo","warn","useUpdateEffect","ComponentsContext","useComponentsContext","useContextSystemBridge","value","parentContext","valueRef","current","JSON","stringify","config","isMergeableObject","BaseContextSystemProvider","children","contextValue","ContextSystemProvider"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,SAAP,MAAsB,WAAtB;AACA,OAAOC,aAAP,MAA0B,qBAA1B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA;AACA;AACA;;AACA,SACCC,aADD,EAECC,UAFD,EAGCC,MAHD,EAICC,OAJD,EAKCC,IALD,QAMO,oBANP;AAOA,OAAOC,IAAP,MAAiB,oBAAjB;AAEA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,aAAhC;AAEA,OAAO,MAAMC,iBAAiB,GAAGP,aAAa;AAC7C;AAAqC,EADQ,CAAvC;AAGP,OAAO,MAAMQ,oBAAoB,GAAG,MAAMP,UAAU,CAAEM,iBAAF,CAA7C;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASE,sBAAT,CAAiC;AAAEC,EAAAA;AAAF,CAAjC,EAA6C;AAC5C,QAAMC,aAAa,GAAGH,oBAAoB,EAA1C;AAEA,QAAMI,QAAQ,GAAGV,MAAM,CAAEQ,KAAF,CAAvB;AAEAJ,EAAAA,eAAe,CAAE,MAAM;AACtB,SACC;AACAR,IAAAA,aAAa,CAAEc,QAAQ,CAACC,OAAX,EAAoBH,KAApB,CAAb,IACA;AACAE,IAAAA,QAAQ,CAACC,OAAT,KAAqBH,KAJtB,EAKE;AACD,+FAAAL,IAAI,CAAG,gCAAgCS,IAAI,CAACC,SAAL,CAAgBL,KAAhB,CAAyB,EAA5D,CAAJ;AACA;AACD,GATc,EASZ,CAAEA,KAAF,CATY,CAAf,CAL4C,CAgB5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,QAAMM,MAAM,GAAGb,OAAO,CAAE,MAAM;AAC7B;AACA,WAAON,SAAS,CAAEc,aAAF,aAAEA,aAAF,cAAEA,aAAF,GAAmB,EAAnB,EAAuBD,KAAvB,aAAuBA,KAAvB,cAAuBA,KAAvB,GAAgC,EAAhC,EAAoC;AACnDO,MAAAA,iBAAiB,EAAElB;AADgC,KAApC,CAAhB;AAGA,GALqB,EAKnB,CAAEY,aAAF,EAAiBD,KAAjB,CALmB,CAAtB;AAOA,SAAOM,MAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,yBAAyB,GAAG,CAAE;AAAEC,EAAAA,QAAF;AAAYT,EAAAA;AAAZ,CAAF,KAA2B;AAC5D,QAAMU,YAAY,GAAGX,sBAAsB,CAAE;AAAEC,IAAAA;AAAF,GAAF,CAA3C;AAEA,SACC,cAAC,iBAAD,CAAmB,QAAnB;AAA4B,IAAA,KAAK,EAAGU;AAApC,KACGD,QADH,CADD;AAKA,CARD;;AAUA,OAAO,MAAME,qBAAqB,GAAGjB,IAAI,CAAEc,yBAAF,CAAlC","sourcesContent":["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport fastDeepEqual from 'fast-deep-equal/es6';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseRef,\n\tuseMemo,\n\tmemo,\n} from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useUpdateEffect } from '../../utils';\n\nexport const ComponentsContext = createContext(\n\t/** @type {Record<string, any>} */ ( {} )\n);\nexport const useComponentsContext = () => useContext( ComponentsContext );\n\n/**\n * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.\n *\n * Note: This function will warn if it detects an un-memoized `value`\n *\n * @param {Object} props\n * @param {Record<string, any>} props.value\n * @return {Record<string, any>} The consolidated value.\n */\nfunction useContextSystemBridge( { value } ) {\n\tconst parentContext = useComponentsContext();\n\n\tconst valueRef = useRef( value );\n\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\t// Objects are equivalent.\n\t\t\tfastDeepEqual( valueRef.current, value ) &&\n\t\t\t// But not the same reference.\n\t\t\tvalueRef.current !== value\n\t\t) {\n\t\t\twarn( `Please memoize your context: ${ JSON.stringify( value ) }` );\n\t\t}\n\t}, [ value ] );\n\n\t// `parentContext` will always be memoized (i.e., the result of this hook itself)\n\t// or the default value from when the `ComponentsContext` was originally\n\t// initialized (which will never change, it's a static variable)\n\t// so this memoization will prevent `deepmerge()` from rerunning unless\n\t// the references to `value` change OR the `parentContext` has an actual material change\n\t// (because again, it's guaranteed to be memoized or a static reference to the empty object\n\t// so we know that the only changes for `parentContext` are material ones... i.e., why we\n\t// don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only\n\t// need to bother with the `value`). The `useUpdateEffect` above will ensure that we are\n\t// correctly warning when the `value` isn't being properly memoized. All of that to say\n\t// that this should be super safe to assume that `useMemo` will only run on actual\n\t// changes to the two dependencies, therefore saving us calls to `deepmerge()`!\n\tconst config = useMemo( () => {\n\t\t// Deep clone `parentContext` to avoid mutating it later.\n\t\treturn deepmerge( parentContext ?? {}, value ?? {}, {\n\t\t\tisMergeableObject: isPlainObject,\n\t\t} );\n\t}, [ parentContext, value ] );\n\n\treturn config;\n}\n\n/**\n * A Provider component that can modify props for connected components within\n * the Context system.\n *\n * @example\n * ```jsx\n * <ContextSystemProvider value={{ Button: { size: 'small' }}}>\n * <Button>...</Button>\n * </ContextSystemProvider>\n * ```\n *\n * @template {Record<string, any>} T\n * @param {Object} options\n * @param {import('react').ReactNode} options.children Children to render.\n * @param {T} options.value Props to render into connected components.\n * @return {JSX.Element} A Provider wrapped component.\n */\nconst BaseContextSystemProvider = ( { children, value } ) => {\n\tconst contextValue = useContextSystemBridge( { value } );\n\n\treturn (\n\t\t<ComponentsContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</ComponentsContext.Provider>\n\t);\n};\n\nexport const ContextSystemProvider = memo( BaseContextSystemProvider );\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ContextSystemProvider, useComponentsContext } from './context-system-provider';
|
|
2
|
-
export { contextConnect, hasConnectNamespace, getConnectNamespace } from './context-connect';
|
|
2
|
+
export { contextConnect, contextConnectWithoutRef, hasConnectNamespace, getConnectNamespace } from './context-connect';
|
|
3
3
|
export { useContextSystem } from './use-context-system';
|
|
4
4
|
export * from './wordpress-component';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/context/index.ts"],"names":["ContextSystemProvider","useComponentsContext","contextConnect","hasConnectNamespace","getConnectNamespace","useContextSystem"],"mappings":"AAAA,SACCA,qBADD,EAECC,oBAFD,QAGO,2BAHP;AAIA,SACCC,cADD,EAECC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/ui/context/index.ts"],"names":["ContextSystemProvider","useComponentsContext","contextConnect","contextConnectWithoutRef","hasConnectNamespace","getConnectNamespace","useContextSystem"],"mappings":"AAAA,SACCA,qBADD,EAECC,oBAFD,QAGO,2BAHP;AAIA,SACCC,cADD,EAECC,wBAFD,EAGCC,mBAHD,EAICC,mBAJD,QAKO,mBALP;AAMA,SAASC,gBAAT,QAAiC,sBAAjC;AACA,cAAc,uBAAd","sourcesContent":["export {\n\tContextSystemProvider,\n\tuseComponentsContext,\n} from './context-system-provider';\nexport {\n\tcontextConnect,\n\tcontextConnectWithoutRef,\n\thasConnectNamespace,\n\tgetConnectNamespace,\n} from './context-connect';\nexport { useContextSystem } from './use-context-system';\nexport * from './wordpress-component';\n"]}
|
|
@@ -32,7 +32,7 @@ export function useContextSystem(props, namespace) {
|
|
|
32
32
|
typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? warn('useContextSystem: Please provide a namespace') : void 0;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
const contextProps =
|
|
35
|
+
const contextProps = contextSystemProps?.[namespace] || {};
|
|
36
36
|
/* eslint-disable jsdoc/no-undefined-types */
|
|
37
37
|
|
|
38
38
|
/** @type {ConnectedProps<P>} */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/context/use-context-system.js"],"names":["warn","useComponentsContext","getNamespace","getConnectedNamespace","getStyledClassNameFromKey","useCx","useContextSystem","props","namespace","contextSystemProps","contextProps","finalComponentProps","_overrides","overrideProps","otherContextProps","initialMergedProps","Object","entries","length","assign","cx","classes","className","rendered","renderChildren","children","key","undefined"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAP,MAAiB,oBAAjB;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,2BAArC;AACA,SAASC,YAAT,EAAuBC,qBAAvB,QAAoD,SAApD;AACA,SAASC,yBAAT,QAA0C,kCAA1C;AACA,SAASC,KAAT,QAAsB,0BAAtB;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CAA2BC,KAA3B,EAAkCC,SAAlC,EAA8C;AACpD,QAAMC,kBAAkB,GAAGR,oBAAoB,EAA/C;;AACA,MAAK,OAAOO,SAAP,KAAqB,WAA1B,EAAwC;AACvC,6FAAAR,IAAI,CAAE,8CAAF,CAAJ;AACA;;AAED,QAAMU,YAAY,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/ui/context/use-context-system.js"],"names":["warn","useComponentsContext","getNamespace","getConnectedNamespace","getStyledClassNameFromKey","useCx","useContextSystem","props","namespace","contextSystemProps","contextProps","finalComponentProps","_overrides","overrideProps","otherContextProps","initialMergedProps","Object","entries","length","assign","cx","classes","className","rendered","renderChildren","children","key","undefined"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAP,MAAiB,oBAAjB;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,2BAArC;AACA,SAASC,YAAT,EAAuBC,qBAAvB,QAAoD,SAApD;AACA,SAASC,yBAAT,QAA0C,kCAA1C;AACA,SAASC,KAAT,QAAsB,0BAAtB;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CAA2BC,KAA3B,EAAkCC,SAAlC,EAA8C;AACpD,QAAMC,kBAAkB,GAAGR,oBAAoB,EAA/C;;AACA,MAAK,OAAOO,SAAP,KAAqB,WAA1B,EAAwC;AACvC,6FAAAR,IAAI,CAAE,8CAAF,CAAJ;AACA;;AAED,QAAMU,YAAY,GAAGD,kBAAkB,GAAID,SAAJ,CAAlB,IAAqC,EAA1D;AAEA;;AACA;AACA;;AACA,QAAMG,mBAAmB,GAAG,EAC3B,GAAGR,qBAAqB,EADG;AAE3B,OAAGD,YAAY,CAAEM,SAAF;AAFY,GAA5B;AAIA;;AAEA,QAAM;AAAEI,IAAAA,UAAU,EAAEC,aAAd;AAA6B,OAAGC;AAAhC,MAAsDJ,YAA5D;AAEA,QAAMK,kBAAkB,GAAGC,MAAM,CAACC,OAAP,CAAgBH,iBAAhB,EAAoCI,MAApC,GACxBF,MAAM,CAACG,MAAP,CAAe,EAAf,EAAmBL,iBAAnB,EAAsCP,KAAtC,CADwB,GAExBA,KAFH;AAIA,QAAMa,EAAE,GAAGf,KAAK,EAAhB;AAEA,QAAMgB,OAAO,GAAGD,EAAE,CACjBhB,yBAAyB,CAAEI,SAAF,CADR,EAEjBD,KAAK,CAACe,SAFW,CAAlB,CAzBoD,CA8BpD;;AACA,QAAMC,QAAQ,GACb,OAAOR,kBAAkB,CAACS,cAA1B,KAA6C,UAA7C,GACGT,kBAAkB,CAACS,cAAnB,CAAmCT,kBAAnC,CADH,GAEGA,kBAAkB,CAACU,QAHvB;;AAKA,OAAM,MAAMC,GAAZ,IAAmBX,kBAAnB,EAAwC;AACvC;AACAJ,IAAAA,mBAAmB,CAAEe,GAAF,CAAnB,GAA6BX,kBAAkB,CAAEW,GAAF,CAA/C;AACA;;AAED,OAAM,MAAMA,GAAZ,IAAmBb,aAAnB,EAAmC;AAClC;AACAF,IAAAA,mBAAmB,CAAEe,GAAF,CAAnB,GAA6Bb,aAAa,CAAEa,GAAF,CAA1C;AACA,GA5CmD,CA8CpD;AACA;;;AACA,MAAKH,QAAQ,KAAKI,SAAlB,EAA8B;AAC7B;AACAhB,IAAAA,mBAAmB,CAACc,QAApB,GAA+BF,QAA/B;AACA;;AAEDZ,EAAAA,mBAAmB,CAACW,SAApB,GAAgCD,OAAhC;AAEA,SAAOV,mBAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useComponentsContext } from './context-system-provider';\nimport { getNamespace, getConnectedNamespace } from './utils';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport { useCx } from '../../utils/hooks/use-cx';\n\n/**\n * @template TProps\n * @typedef {TProps & { className: string }} ConnectedProps\n */\n\n/**\n * Custom hook that derives registered props from the Context system.\n * These derived props are then consolidated with incoming component props.\n *\n * @template {{ className?: string }} P\n * @param {P} props Incoming props from the component.\n * @param {string} namespace The namespace to register and to derive context props from.\n * @return {ConnectedProps<P>} The connected props.\n */\nexport function useContextSystem( props, namespace ) {\n\tconst contextSystemProps = useComponentsContext();\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'useContextSystem: Please provide a namespace' );\n\t}\n\n\tconst contextProps = contextSystemProps?.[ namespace ] || {};\n\n\t/* eslint-disable jsdoc/no-undefined-types */\n\t/** @type {ConnectedProps<P>} */\n\t// @ts-ignore We fill in the missing properties below\n\tconst finalComponentProps = {\n\t\t...getConnectedNamespace(),\n\t\t...getNamespace( namespace ),\n\t};\n\t/* eslint-enable jsdoc/no-undefined-types */\n\n\tconst { _overrides: overrideProps, ...otherContextProps } = contextProps;\n\n\tconst initialMergedProps = Object.entries( otherContextProps ).length\n\t\t? Object.assign( {}, otherContextProps, props )\n\t\t: props;\n\n\tconst cx = useCx();\n\n\tconst classes = cx(\n\t\tgetStyledClassNameFromKey( namespace ),\n\t\tprops.className\n\t);\n\n\t// Provides the ability to customize the render of the component.\n\tconst rendered =\n\t\ttypeof initialMergedProps.renderChildren === 'function'\n\t\t\t? initialMergedProps.renderChildren( initialMergedProps )\n\t\t\t: initialMergedProps.children;\n\n\tfor ( const key in initialMergedProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = initialMergedProps[ key ];\n\t}\n\n\tfor ( const key in overrideProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = overrideProps[ key ];\n\t}\n\n\t// Setting an `undefined` explicitly can cause unintended overwrites\n\t// when a `cloneElement()` is involved.\n\tif ( rendered !== undefined ) {\n\t\t// @ts-ignore\n\t\tfinalComponentProps.children = rendered;\n\t}\n\n\tfinalComponentProps.className = classes;\n\n\treturn finalComponentProps;\n}\n"]}
|
|
@@ -31,7 +31,7 @@ export function useControlGroup(props) {
|
|
|
31
31
|
const isOnly = isFirst && isLast;
|
|
32
32
|
const isMiddle = !isFirst && !isLast; // @ts-ignore
|
|
33
33
|
|
|
34
|
-
const _key =
|
|
34
|
+
const _key = child?.key || index;
|
|
35
35
|
/** @type {import('@emotion/react').SerializedStyles | undefined} */
|
|
36
36
|
|
|
37
37
|
|