@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
|
@@ -32,14 +32,13 @@ var _constants = require("../constants");
|
|
|
32
32
|
/**
|
|
33
33
|
* Internal dependencies
|
|
34
34
|
*/
|
|
35
|
-
function NavigationMenuTitle(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} = _ref;
|
|
35
|
+
function NavigationMenuTitle({
|
|
36
|
+
hasSearch,
|
|
37
|
+
onSearch,
|
|
38
|
+
search,
|
|
39
|
+
title,
|
|
40
|
+
titleAction
|
|
41
|
+
}) {
|
|
43
42
|
const [isSearching, setIsSearching] = (0, _element.useState)(false);
|
|
44
43
|
const {
|
|
45
44
|
menu
|
|
@@ -55,9 +54,7 @@ function NavigationMenuTitle(_ref) {
|
|
|
55
54
|
// eslint-disable-next-line @wordpress/react-no-unsafe-timeout
|
|
56
55
|
|
|
57
56
|
setTimeout(() => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(_searchButtonRef$curr = searchButtonRef.current) === null || _searchButtonRef$curr === void 0 ? void 0 : _searchButtonRef$curr.focus();
|
|
57
|
+
searchButtonRef.current?.focus();
|
|
61
58
|
}, _constants.SEARCH_FOCUS_DELAY);
|
|
62
59
|
};
|
|
63
60
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigation/menu/menu-title.tsx"],"names":["NavigationMenuTitle","hasSearch","onSearch","search","title","titleAction","isSearching","setIsSearching","menu","searchButtonRef","onCloseSearch","setTimeout","current","focus","SEARCH_FOCUS_DELAY","menuTitleId","searchButtonLabel","searchIcon","type","origin"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAnBA;AACA;AACA;;AAKA;AACA;AACA;AAce,SAASA,mBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigation/menu/menu-title.tsx"],"names":["NavigationMenuTitle","hasSearch","onSearch","search","title","titleAction","isSearching","setIsSearching","menu","searchButtonRef","onCloseSearch","setTimeout","current","focus","SEARCH_FOCUS_DELAY","menuTitleId","searchButtonLabel","searchIcon","type","origin"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAnBA;AACA;AACA;;AAKA;AACA;AACA;AAce,SAASA,mBAAT,CAA8B;AAC5CC,EAAAA,SAD4C;AAE5CC,EAAAA,QAF4C;AAG5CC,EAAAA,MAH4C;AAI5CC,EAAAA,KAJ4C;AAK5CC,EAAAA;AAL4C,CAA9B,EAMe;AAC7B,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkC,uBAAU,KAAV,CAAxC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAW,wCAAjB;AACA,QAAMC,eAAe,GAAG,qBAAuB,IAAvB,CAAxB;;AAEA,MAAK,CAAEL,KAAP,EAAe;AACd,WAAO,IAAP;AACA;;AAED,QAAMM,aAAa,GAAG,MAAM;AAC3BH,IAAAA,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wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Icon, search as searchIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { getAnimateClassName } from '../../animate';\nimport Button from '../../button';\nimport MenuTitleSearch from './menu-title-search';\nimport {\n\tGroupTitleUI,\n\tMenuTitleActionsUI,\n\tMenuTitleUI,\n} from '../styles/navigation-styles';\nimport { useNavigationMenuContext } from './context';\nimport { SEARCH_FOCUS_DELAY } from '../constants';\n\nimport type { NavigationMenuTitleProps } from '../types';\n\nexport default function NavigationMenuTitle( {\n\thasSearch,\n\tonSearch,\n\tsearch,\n\ttitle,\n\ttitleAction,\n}: NavigationMenuTitleProps ) {\n\tconst [ isSearching, setIsSearching ] = useState( false );\n\tconst { menu } = useNavigationMenuContext();\n\tconst searchButtonRef = useRef< HTMLElement >( null );\n\n\tif ( ! title ) {\n\t\treturn null;\n\t}\n\n\tconst onCloseSearch = () => {\n\t\tsetIsSearching( false );\n\n\t\t// Wait for the slide-in animation to complete before focusing the search button.\n\t\t// eslint-disable-next-line @wordpress/react-no-unsafe-timeout\n\t\tsetTimeout( () => {\n\t\t\tsearchButtonRef.current?.focus();\n\t\t}, SEARCH_FOCUS_DELAY );\n\t};\n\n\tconst menuTitleId = `components-navigation__menu-title-${ menu }`;\n\t/* translators: search button label for menu search box. %s: menu title */\n\tconst searchButtonLabel = sprintf( __( 'Search in %s' ), title );\n\n\treturn (\n\t\t<MenuTitleUI className=\"components-navigation__menu-title\">\n\t\t\t{ ! isSearching && (\n\t\t\t\t<GroupTitleUI\n\t\t\t\t\tas=\"h2\"\n\t\t\t\t\tclassName=\"components-navigation__menu-title-heading\"\n\t\t\t\t\tlevel={ 3 }\n\t\t\t\t>\n\t\t\t\t\t<span id={ menuTitleId }>{ title }</span>\n\n\t\t\t\t\t{ ( hasSearch || titleAction ) && (\n\t\t\t\t\t\t<MenuTitleActionsUI>\n\t\t\t\t\t\t\t{ titleAction }\n\n\t\t\t\t\t\t\t{ hasSearch && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\tlabel={ searchButtonLabel }\n\t\t\t\t\t\t\t\t\tonClick={ () => setIsSearching( true ) }\n\t\t\t\t\t\t\t\t\tref={ searchButtonRef }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Icon icon={ searchIcon } />\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</MenuTitleActionsUI>\n\t\t\t\t\t) }\n\t\t\t\t</GroupTitleUI>\n\t\t\t) }\n\n\t\t\t{ isSearching && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ getAnimateClassName( {\n\t\t\t\t\t\ttype: 'slide-in',\n\t\t\t\t\t\torigin: 'left',\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t<MenuTitleSearch\n\t\t\t\t\t\tonCloseSearch={ onCloseSearch }\n\t\t\t\t\t\tonSearch={ onSearch }\n\t\t\t\t\t\tsearch={ search }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</MenuTitleUI>\n\t);\n}\n"]}
|
|
@@ -20,10 +20,9 @@ var _navigationStyles = require("../styles/navigation-styles");
|
|
|
20
20
|
/**
|
|
21
21
|
* Internal dependencies
|
|
22
22
|
*/
|
|
23
|
-
function NavigationSearchNoResultsFound(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} = _ref;
|
|
23
|
+
function NavigationSearchNoResultsFound({
|
|
24
|
+
search
|
|
25
|
+
}) {
|
|
27
26
|
const {
|
|
28
27
|
navigationTree: {
|
|
29
28
|
items
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigation/menu/search-no-results-found.tsx"],"names":["NavigationSearchNoResultsFound","search","navigationTree","items","resultsCount","Object","values","filter","item","_isVisible","length"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAMe,SAASA,8BAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigation/menu/search-no-results-found.tsx"],"names":["NavigationSearchNoResultsFound","search","navigationTree","items","resultsCount","Object","values","filter","item","_isVisible","length"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAMe,SAASA,8BAAT,CAAyC;AACvDC,EAAAA;AADuD,CAAzC,EAE0B;AACxC,QAAM;AACLC,IAAAA,cAAc,EAAE;AAAEC,MAAAA;AAAF;AADX,MAEF,oCAFJ;AAIA,QAAMC,YAAY,GAAGC,MAAM,CAACC,MAAP,CAAeH,KAAf,EAAuBI,MAAvB,CAClBC,IAAF,IAAYA,IAAI,CAACC,UADG,EAEnBC,MAFF;;AAIA,MAAK,CAAET,MAAF,IAAY,CAAC,CAAEG,YAApB,EAAmC;AAClC,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,4BAAD,QACC,4BAAC,wBAAD,QAAU,cAAI,mBAAJ,CAAV,MADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useNavigationContext } from '../context';\nimport { ItemBaseUI, ItemUI } from '../styles/navigation-styles';\n\nimport type { NavigationSearchNoResultsFoundProps } from '../types';\n\nexport default function NavigationSearchNoResultsFound( {\n\tsearch,\n}: NavigationSearchNoResultsFoundProps ) {\n\tconst {\n\t\tnavigationTree: { items },\n\t} = useNavigationContext();\n\n\tconst resultsCount = Object.values( items ).filter(\n\t\t( item ) => item._isVisible\n\t).length;\n\n\tif ( ! search || !! resultsCount ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ItemBaseUI>\n\t\t\t<ItemUI>{ __( 'No results found.' ) } </ItemUI>\n\t\t</ItemBaseUI>\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigator/navigator-back-button/hook.ts"],"names":["useNavigatorBackButton","props","onClick","as","Button","goToParent","goToParentProp","otherProps","goBack","handleClick","e","preventDefault"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAMO,SAASA,sBAAT,CACNC,KADM,EAEL;AACD,QAAM;AACLC,IAAAA,OADK;AAELC,IAAAA,EAAE,GAAGC,eAFA;AAGLC,IAAAA,UAAU,EAAEC,cAAc,GAAG,KAHxB;AAIL,OAAGC;AAJE,MAKF,+BAAkBN,KAAlB,EAAyB,qBAAzB,CALJ;AAOA,QAAM;AAAEO,IAAAA,MAAF;AAAUH,IAAAA;AAAV,MAAyB,4BAA/B;AACA,QAAMI,WAAyD,GAC9D,0BACGC,CAAF,IAAS;AACRA,IAAAA,CAAC,CAACC,cAAF;;AACA,QAAKL,cAAL,EAAsB;AACrBD,MAAAA,UAAU;AACV,KAFD,MAEO;AACNG,MAAAA,MAAM;AACN;;AACDN,IAAAA,OAAO,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigator/navigator-back-button/hook.ts"],"names":["useNavigatorBackButton","props","onClick","as","Button","goToParent","goToParentProp","otherProps","goBack","handleClick","e","preventDefault"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAMO,SAASA,sBAAT,CACNC,KADM,EAEL;AACD,QAAM;AACLC,IAAAA,OADK;AAELC,IAAAA,EAAE,GAAGC,eAFA;AAGLC,IAAAA,UAAU,EAAEC,cAAc,GAAG,KAHxB;AAIL,OAAGC;AAJE,MAKF,+BAAkBN,KAAlB,EAAyB,qBAAzB,CALJ;AAOA,QAAM;AAAEO,IAAAA,MAAF;AAAUH,IAAAA;AAAV,MAAyB,4BAA/B;AACA,QAAMI,WAAyD,GAC9D,0BACGC,CAAF,IAAS;AACRA,IAAAA,CAAC,CAACC,cAAF;;AACA,QAAKL,cAAL,EAAsB;AACrBD,MAAAA,UAAU;AACV,KAFD,MAEO;AACNG,MAAAA,MAAM;AACN;;AACDN,IAAAA,OAAO,GAAIQ,CAAJ,CAAP;AACA,GATF,EAUC,CAAEJ,cAAF,EAAkBD,UAAlB,EAA8BG,MAA9B,EAAsCN,OAAtC,CAVD,CADD;AAcA,SAAO;AACNC,IAAAA,EADM;AAEND,IAAAA,OAAO,EAAEO,WAFH;AAGN,OAAGF;AAHG,GAAP;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport Button from '../../button';\nimport useNavigator from '../use-navigator';\nimport type { NavigatorBackButtonHookProps } from '../types';\n\nexport function useNavigatorBackButton(\n\tprops: WordPressComponentProps< NavigatorBackButtonHookProps, 'button' >\n) {\n\tconst {\n\t\tonClick,\n\t\tas = Button,\n\t\tgoToParent: goToParentProp = false,\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorBackButton' );\n\n\tconst { goBack, goToParent } = useNavigator();\n\tconst handleClick: React.MouseEventHandler< HTMLButtonElement > =\n\t\tuseCallback(\n\t\t\t( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tif ( goToParentProp ) {\n\t\t\t\t\tgoToParent();\n\t\t\t\t} else {\n\t\t\t\t\tgoBack();\n\t\t\t\t}\n\t\t\t\tonClick?.( e );\n\t\t\t},\n\t\t\t[ goToParentProp, goToParent, goBack, onClick ]\n\t\t);\n\n\treturn {\n\t\tas,\n\t\tonClick: handleClick,\n\t\t...otherProps,\n\t};\n}\n"]}
|
|
@@ -43,7 +43,7 @@ function useNavigatorButton(props) {
|
|
|
43
43
|
goTo(escapedPath, {
|
|
44
44
|
focusTargetSelector: cssSelectorForAttribute(attributeName, escapedPath)
|
|
45
45
|
});
|
|
46
|
-
onClick
|
|
46
|
+
onClick?.(e);
|
|
47
47
|
}, [goTo, onClick, attributeName, escapedPath]);
|
|
48
48
|
return {
|
|
49
49
|
as,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigator/navigator-button/hook.ts"],"names":["cssSelectorForAttribute","attrName","attrValue","useNavigatorButton","props","path","onClick","as","Button","attributeName","otherProps","escapedPath","goTo","handleClick","e","preventDefault","focusTargetSelector"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAXA;AACA;AACA;;AAIA;AACA;AACA;AAMA,MAAMA,uBAAuB,GAAG,CAAEC,QAAF,EAAoBC,SAApB,KAC9B,IAAID,QAAU,KAAKC,SAAW,IADhC;;AAGO,SAASC,kBAAT,CACNC,KADM,EAEL;AACD,QAAM;AACLC,IAAAA,IADK;AAELC,IAAAA,OAFK;AAGLC,IAAAA,EAAE,GAAGC,eAHA;AAILC,IAAAA,aAAa,GAAG,IAJX;AAKL,OAAGC;AALE,MAMF,+BAAkBN,KAAlB,EAAyB,iBAAzB,CANJ;AAQA,QAAMO,WAAW,GAAG,iCAAiBN,IAAjB,CAApB;AAEA,QAAM;AAAEO,IAAAA;AAAF,MAAW,4BAAjB;AACA,QAAMC,WAAyD,GAC9D,0BACGC,CAAF,IAAS;AACRA,IAAAA,CAAC,CAACC,cAAF;AACAH,IAAAA,IAAI,CAAED,WAAF,EAAe;AAClBK,MAAAA,mBAAmB,EAAEhB,uBAAuB,CAC3CS,aAD2C,EAE3CE,WAF2C;AAD1B,KAAf,CAAJ;AAMAL,IAAAA,OAAO,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigator/navigator-button/hook.ts"],"names":["cssSelectorForAttribute","attrName","attrValue","useNavigatorButton","props","path","onClick","as","Button","attributeName","otherProps","escapedPath","goTo","handleClick","e","preventDefault","focusTargetSelector"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAXA;AACA;AACA;;AAIA;AACA;AACA;AAMA,MAAMA,uBAAuB,GAAG,CAAEC,QAAF,EAAoBC,SAApB,KAC9B,IAAID,QAAU,KAAKC,SAAW,IADhC;;AAGO,SAASC,kBAAT,CACNC,KADM,EAEL;AACD,QAAM;AACLC,IAAAA,IADK;AAELC,IAAAA,OAFK;AAGLC,IAAAA,EAAE,GAAGC,eAHA;AAILC,IAAAA,aAAa,GAAG,IAJX;AAKL,OAAGC;AALE,MAMF,+BAAkBN,KAAlB,EAAyB,iBAAzB,CANJ;AAQA,QAAMO,WAAW,GAAG,iCAAiBN,IAAjB,CAApB;AAEA,QAAM;AAAEO,IAAAA;AAAF,MAAW,4BAAjB;AACA,QAAMC,WAAyD,GAC9D,0BACGC,CAAF,IAAS;AACRA,IAAAA,CAAC,CAACC,cAAF;AACAH,IAAAA,IAAI,CAAED,WAAF,EAAe;AAClBK,MAAAA,mBAAmB,EAAEhB,uBAAuB,CAC3CS,aAD2C,EAE3CE,WAF2C;AAD1B,KAAf,CAAJ;AAMAL,IAAAA,OAAO,GAAIQ,CAAJ,CAAP;AACA,GAVF,EAWC,CAAEF,IAAF,EAAQN,OAAR,EAAiBG,aAAjB,EAAgCE,WAAhC,CAXD,CADD;AAeA,SAAO;AACNJ,IAAAA,EADM;AAEND,IAAAA,OAAO,EAAEO,WAFH;AAGN,OAAGH,UAHG;AAIN,KAAED,aAAF,GAAmBE;AAJb,GAAP;AAMA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport Button from '../../button';\nimport useNavigator from '../use-navigator';\nimport type { NavigatorButtonProps } from '../types';\n\nconst cssSelectorForAttribute = ( attrName: string, attrValue: string ) =>\n\t`[${ attrName }=\"${ attrValue }\"]`;\n\nexport function useNavigatorButton(\n\tprops: WordPressComponentProps< NavigatorButtonProps, 'button' >\n) {\n\tconst {\n\t\tpath,\n\t\tonClick,\n\t\tas = Button,\n\t\tattributeName = 'id',\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorButton' );\n\n\tconst escapedPath = escapeAttribute( path );\n\n\tconst { goTo } = useNavigator();\n\tconst handleClick: React.MouseEventHandler< HTMLButtonElement > =\n\t\tuseCallback(\n\t\t\t( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tgoTo( escapedPath, {\n\t\t\t\t\tfocusTargetSelector: cssSelectorForAttribute(\n\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\tescapedPath\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t\tonClick?.( e );\n\t\t\t},\n\t\t\t[ goTo, onClick, attributeName, escapedPath ]\n\t\t);\n\n\treturn {\n\t\tas,\n\t\tonClick: handleClick,\n\t\t...otherProps,\n\t\t[ attributeName ]: escapedPath,\n\t};\n}\n"]}
|
|
@@ -29,10 +29,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
29
29
|
|
|
30
30
|
const MAX_HISTORY_LENGTH = 50;
|
|
31
31
|
|
|
32
|
-
function screensReducer() {
|
|
33
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
34
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
35
|
-
|
|
32
|
+
function screensReducer(state = [], action) {
|
|
36
33
|
switch (action.type) {
|
|
37
34
|
case 'add':
|
|
38
35
|
return [...state, action.screen];
|
|
@@ -117,8 +114,7 @@ function UnconnectedNavigatorProvider(props, forwardedRef) {
|
|
|
117
114
|
}];
|
|
118
115
|
});
|
|
119
116
|
}, []);
|
|
120
|
-
const goTo = (0, _element.useCallback)(
|
|
121
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
117
|
+
const goTo = (0, _element.useCallback)((path, options = {}) => {
|
|
122
118
|
const {
|
|
123
119
|
focusTargetSelector,
|
|
124
120
|
isBack = false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigator/navigator-provider/component.tsx"],"names":["MAX_HISTORY_LENGTH","screensReducer","state","action","type","screen","filter","s","id","UnconnectedNavigatorProvider","props","forwardedRef","initialPath","children","className","otherProps","locationHistory","setLocationHistory","path","currentLocationHistory","screens","dispatch","currentScreens","current","currentMatch","matchedPath","currentPath","length","undefined","resolvePath","newMatch","params","addScreen","removeScreen","goBack","prevLocationHistory","slice","isBack","hasRestoredFocus","goTo","options","focusTargetSelector","skipFocus","restOptions","isNavigatingToPreviousPath","newLocation","goToParent","parentPath","navigatorContextValue","location","isInitial","match","cx","classes","NavigatorProvider"],"mappings":";;;;;;;;;AASA;;;;AALA;;AAaA;;AAKA;;AAKA;;AACA;;AACA;;AAOA;;;;AAKA,MAAMA,kBAAkB,GAAG,EAA3B;;AAEA,SAASC,cAAT,GAGY;AAAA,MAFXC,KAEW,uEAFO,EAEP;AAAA,MADXC,MACW;;AACX,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,KAAL;AACC,aAAO,CAAE,GAAGF,KAAL,EAAYC,MAAM,CAACE,MAAnB,CAAP;;AACD,SAAK,QAAL;AACC,aAAOH,KAAK,CAACI,MAAN,CAAgBC,CAAF,IAAiBA,CAAC,CAACC,EAAF,KAASL,MAAM,CAACE,MAAP,CAAcG,EAAtD,CAAP;AAJF;;AAOA,SAAON,KAAP;AACA;;;;;;;;;;;;AAED,SAASO,4BAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AAAEC,IAAAA,WAAF;AAAeC,IAAAA,QAAf;AAAyBC,IAAAA,SAAzB;AAAoC,OAAGC;AAAvC,MACL,+BAAkBL,KAAlB,EAAyB,mBAAzB,CADD;AAGA,QAAM,CAAEM,eAAF,EAAmBC,kBAAnB,IAA0C,uBAE7C,CACF;AACCC,IAAAA,IAAI,EAAEN;AADP,GADE,CAF6C,CAAhD;AAOA,QAAMO,sBAAsB,GAAG,qBAA+B,EAA/B,CAA/B;AACA,QAAM,CAAEC,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AAhB,GAAyB,CAA3B,CADT;AAETuB,MAAAA,SAAS,EAAElC,eAAe,CAACW,MAAhB,KAA2B;AAF7B,KADH;AAKPI,IAAAA,MAAM,EAAEN,WAAW,GAAGA,WAAW,CAACM,MAAf,GAAwB,EALpC;AAMPoB,IAAAA,KAAK,EAAE1B,WAAW,GAAGA,WAAW,CAACjB,EAAf,GAAoBoB,SAN/B;AAOPW,IAAAA,IAPO;AAQPL,IAAAA,MARO;AASPY,IAAAA,UATO;AAUPd,IAAAA,SAVO;AAWPC,IAAAA;AAXO,GAAR,CADmD,EAcnD,CACCjB,eADD,EAECS,WAFD,EAGCc,IAHD,EAICL,MAJD,EAKCY,UALD,EAMCd,SAND,EAOCC,YAPD,CAdmD,CAApD;AAyBA,QAAMmB,EAAE,GAAG,mBAAX;AACA,QAAMC,OAAO,GAAG,uBACf;AACA,QAAMD,EAAE,OAAkCtC,SAAlC,CAFO,EAGf,CAAEA,SAAF,EAAasC,EAAb,CAHe,CAAhB;AAMA,SACC,4BAAC,UAAD;AAAM,IAAA,GAAG,EAAGzC,YAAZ;AAA2B,IAAA,SAAS,EAAG0C;AAAvC,KAAsDtC,UAAtD,GACC,4BAAC,0BAAD,CAAkB,QAAlB;AAA2B,IAAA,KAAK,EAAGiC;AAAnC,KACGnC,QADH,CADD,CADD;AAOA;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;;;AACO,MAAMyC,iBAAiB,GAAG,6BAChC7C,4BADgC,EAEhC,mBAFgC,CAA1B;;eAKQ6C,iB","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tuseReducer,\n\tuseRef,\n\tuseEffect,\n} from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type {\n\tNavigatorProviderProps,\n\tNavigatorLocation,\n\tNavigatorContext as NavigatorContextType,\n\tScreen,\n} from '../types';\nimport { patternMatch, findParent } from '../utils/router';\n\ntype MatchedPath = ReturnType< typeof patternMatch >;\ntype ScreenAction = { type: string; screen: Screen };\n\nconst MAX_HISTORY_LENGTH = 50;\n\nfunction screensReducer(\n\tstate: Screen[] = [],\n\taction: ScreenAction\n): Screen[] {\n\tswitch ( action.type ) {\n\t\tcase 'add':\n\t\t\treturn [ ...state, action.screen ];\n\t\tcase 'remove':\n\t\t\treturn state.filter( ( s: Screen ) => s.id !== action.screen.id );\n\t}\n\n\treturn state;\n}\n\nfunction UnconnectedNavigatorProvider(\n\tprops: WordPressComponentProps< NavigatorProviderProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { initialPath, children, className, ...otherProps } =\n\t\tuseContextSystem( props, 'NavigatorProvider' );\n\n\tconst [ locationHistory, setLocationHistory ] = useState<\n\t\tNavigatorLocation[]\n\t>( [\n\t\t{\n\t\t\tpath: initialPath,\n\t\t},\n\t] );\n\tconst currentLocationHistory = useRef< NavigatorLocation[] >( [] );\n\tconst [ screens, dispatch ] = useReducer( screensReducer, [] );\n\tconst currentScreens = useRef< Screen[] >( [] );\n\tuseEffect( () => {\n\t\tcurrentScreens.current = screens;\n\t}, [ screens ] );\n\tuseEffect( () => {\n\t\tcurrentLocationHistory.current = locationHistory;\n\t}, [ locationHistory ] );\n\tconst currentMatch = useRef< MatchedPath >();\n\tconst matchedPath = useMemo( () => {\n\t\tlet currentPath: string | undefined;\n\t\tif (\n\t\t\tlocationHistory.length === 0 ||\n\t\t\t( currentPath =\n\t\t\t\tlocationHistory[ locationHistory.length - 1 ].path ) ===\n\t\t\t\tundefined\n\t\t) {\n\t\t\tcurrentMatch.current = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst resolvePath = ( path: string ) => {\n\t\t\tconst newMatch = patternMatch( path, screens );\n\n\t\t\t// If the new match is the same as the current match,\n\t\t\t// return the previous one for performance reasons.\n\t\t\tif (\n\t\t\t\tcurrentMatch.current &&\n\t\t\t\tnewMatch &&\n\t\t\t\tisShallowEqual(\n\t\t\t\t\tnewMatch.params,\n\t\t\t\t\tcurrentMatch.current.params\n\t\t\t\t) &&\n\t\t\t\tnewMatch.id === currentMatch.current.id\n\t\t\t) {\n\t\t\t\treturn currentMatch.current;\n\t\t\t}\n\n\t\t\treturn newMatch;\n\t\t};\n\n\t\tconst newMatch = resolvePath( currentPath );\n\t\tcurrentMatch.current = newMatch;\n\t\treturn newMatch;\n\t}, [ screens, locationHistory ] );\n\n\tconst addScreen = useCallback(\n\t\t( screen: Screen ) => dispatch( { type: 'add', screen } ),\n\t\t[]\n\t);\n\n\tconst removeScreen = useCallback(\n\t\t( screen: Screen ) => dispatch( { type: 'remove', screen } ),\n\t\t[]\n\t);\n\n\tconst goBack: NavigatorContextType[ 'goBack' ] = useCallback( () => {\n\t\tsetLocationHistory( ( prevLocationHistory ) => {\n\t\t\tif ( prevLocationHistory.length <= 1 ) {\n\t\t\t\treturn prevLocationHistory;\n\t\t\t}\n\t\t\treturn [\n\t\t\t\t...prevLocationHistory.slice( 0, -2 ),\n\t\t\t\t{\n\t\t\t\t\t...prevLocationHistory[ prevLocationHistory.length - 2 ],\n\t\t\t\t\tisBack: true,\n\t\t\t\t\thasRestoredFocus: false,\n\t\t\t\t},\n\t\t\t];\n\t\t} );\n\t}, [] );\n\n\tconst goTo: NavigatorContextType[ 'goTo' ] = useCallback(\n\t\t( path, options = {} ) => {\n\t\t\tconst {\n\t\t\t\tfocusTargetSelector,\n\t\t\t\tisBack = false,\n\t\t\t\tskipFocus = false,\n\t\t\t\t...restOptions\n\t\t\t} = options;\n\n\t\t\tconst isNavigatingToPreviousPath =\n\t\t\t\tisBack &&\n\t\t\t\tcurrentLocationHistory.current.length > 1 &&\n\t\t\t\tcurrentLocationHistory.current[\n\t\t\t\t\tcurrentLocationHistory.current.length - 2\n\t\t\t\t].path === path;\n\n\t\t\tif ( isNavigatingToPreviousPath ) {\n\t\t\t\tgoBack();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetLocationHistory( ( prevLocationHistory ) => {\n\t\t\t\tconst newLocation = {\n\t\t\t\t\t...restOptions,\n\t\t\t\t\tpath,\n\t\t\t\t\tisBack,\n\t\t\t\t\thasRestoredFocus: false,\n\t\t\t\t\tskipFocus,\n\t\t\t\t};\n\n\t\t\t\tif ( prevLocationHistory.length < 1 ) {\n\t\t\t\t\treturn [ newLocation ];\n\t\t\t\t}\n\n\t\t\t\treturn [\n\t\t\t\t\t...prevLocationHistory.slice(\n\t\t\t\t\t\tprevLocationHistory.length > MAX_HISTORY_LENGTH - 1\n\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t: 0,\n\t\t\t\t\t\t-1\n\t\t\t\t\t),\n\t\t\t\t\t// Assign `focusTargetSelector` to the previous location in history\n\t\t\t\t\t// (the one we just navigated from).\n\t\t\t\t\t{\n\t\t\t\t\t\t...prevLocationHistory[\n\t\t\t\t\t\t\tprevLocationHistory.length - 1\n\t\t\t\t\t\t],\n\t\t\t\t\t\tfocusTargetSelector,\n\t\t\t\t\t},\n\t\t\t\t\tnewLocation,\n\t\t\t\t];\n\t\t\t} );\n\t\t},\n\t\t[ goBack ]\n\t);\n\n\tconst goToParent: NavigatorContextType[ 'goToParent' ] =\n\t\tuseCallback( () => {\n\t\t\tconst currentPath =\n\t\t\t\tcurrentLocationHistory.current[\n\t\t\t\t\tcurrentLocationHistory.current.length - 1\n\t\t\t\t].path;\n\t\t\tif ( currentPath === undefined ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst parentPath = findParent(\n\t\t\t\tcurrentPath,\n\t\t\t\tcurrentScreens.current\n\t\t\t);\n\t\t\tif ( parentPath === undefined ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgoTo( parentPath, { isBack: true } );\n\t\t}, [ goTo ] );\n\n\tconst navigatorContextValue: NavigatorContextType = useMemo(\n\t\t() => ( {\n\t\t\tlocation: {\n\t\t\t\t...locationHistory[ locationHistory.length - 1 ],\n\t\t\t\tisInitial: locationHistory.length === 1,\n\t\t\t},\n\t\t\tparams: matchedPath ? matchedPath.params : {},\n\t\t\tmatch: matchedPath ? matchedPath.id : undefined,\n\t\t\tgoTo,\n\t\t\tgoBack,\n\t\t\tgoToParent,\n\t\t\taddScreen,\n\t\t\tremoveScreen,\n\t\t} ),\n\t\t[\n\t\t\tlocationHistory,\n\t\t\tmatchedPath,\n\t\t\tgoTo,\n\t\t\tgoBack,\n\t\t\tgoToParent,\n\t\t\taddScreen,\n\t\t\tremoveScreen,\n\t\t]\n\t);\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t// Prevents horizontal overflow while animating screen transitions.\n\t\t() => cx( css( { overflowX: 'hidden' } ), className ),\n\t\t[ className, cx ]\n\t);\n\n\treturn (\n\t\t<View ref={ forwardedRef } className={ classes } { ...otherProps }>\n\t\t\t<NavigatorContext.Provider value={ navigatorContextValue }>\n\t\t\t\t{ children }\n\t\t\t</NavigatorContext.Provider>\n\t\t</View>\n\t);\n}\n\n/**\n * The `NavigatorProvider` component allows rendering nested views/panels/menus\n * (via the `NavigatorScreen` component and navigate between these different\n * view (via the `NavigatorButton` and `NavigatorBackButton` components or the\n * `useNavigator` hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorBackButton as NavigatorBackButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>\n * Go back\n * </NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nexport const NavigatorProvider = contextConnect(\n\tUnconnectedNavigatorProvider,\n\t'NavigatorProvider'\n);\n\nexport default NavigatorProvider;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigator/navigator-provider/component.tsx"],"names":["MAX_HISTORY_LENGTH","screensReducer","state","action","type","screen","filter","s","id","UnconnectedNavigatorProvider","props","forwardedRef","initialPath","children","className","otherProps","locationHistory","setLocationHistory","path","currentLocationHistory","screens","dispatch","currentScreens","current","currentMatch","matchedPath","currentPath","length","undefined","resolvePath","newMatch","params","addScreen","removeScreen","goBack","prevLocationHistory","slice","isBack","hasRestoredFocus","goTo","options","focusTargetSelector","skipFocus","restOptions","isNavigatingToPreviousPath","newLocation","goToParent","parentPath","navigatorContextValue","location","isInitial","match","cx","classes","NavigatorProvider"],"mappings":";;;;;;;;;AASA;;;;AALA;;AAaA;;AAKA;;AAKA;;AACA;;AACA;;AAOA;;;;AAKA,MAAMA,kBAAkB,GAAG,EAA3B;;AAEA,SAASC,cAAT,CACCC,KAAe,GAAG,EADnB,EAECC,MAFD,EAGY;AACX,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,KAAL;AACC,aAAO,CAAE,GAAGF,KAAL,EAAYC,MAAM,CAACE,MAAnB,CAAP;;AACD,SAAK,QAAL;AACC,aAAOH,KAAK,CAACI,MAAN,CAAgBC,CAAF,IAAiBA,CAAC,CAACC,EAAF,KAASL,MAAM,CAACE,MAAP,CAAcG,EAAtD,CAAP;AAJF;;AAOA,SAAON,KAAP;AACA;;;;;;;;;;;;AAED,SAASO,4BAAT,CACCC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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMyC,iBAAiB,GAAG,6BAChC7C,4BADgC,EAEhC,mBAFgC,CAA1B;;eAKQ6C,iB","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tuseReducer,\n\tuseRef,\n\tuseEffect,\n} from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type {\n\tNavigatorProviderProps,\n\tNavigatorLocation,\n\tNavigatorContext as NavigatorContextType,\n\tScreen,\n} from '../types';\nimport { patternMatch, findParent } from '../utils/router';\n\ntype MatchedPath = ReturnType< typeof patternMatch >;\ntype ScreenAction = { type: string; screen: Screen };\n\nconst MAX_HISTORY_LENGTH = 50;\n\nfunction screensReducer(\n\tstate: Screen[] = [],\n\taction: ScreenAction\n): Screen[] {\n\tswitch ( action.type ) {\n\t\tcase 'add':\n\t\t\treturn [ ...state, action.screen ];\n\t\tcase 'remove':\n\t\t\treturn state.filter( ( s: Screen ) => s.id !== action.screen.id );\n\t}\n\n\treturn state;\n}\n\nfunction UnconnectedNavigatorProvider(\n\tprops: WordPressComponentProps< NavigatorProviderProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { initialPath, children, className, ...otherProps } =\n\t\tuseContextSystem( props, 'NavigatorProvider' );\n\n\tconst [ locationHistory, setLocationHistory ] = useState<\n\t\tNavigatorLocation[]\n\t>( [\n\t\t{\n\t\t\tpath: initialPath,\n\t\t},\n\t] );\n\tconst currentLocationHistory = useRef< NavigatorLocation[] >( [] );\n\tconst [ screens, dispatch ] = useReducer( screensReducer, [] );\n\tconst currentScreens = useRef< Screen[] >( [] );\n\tuseEffect( () => {\n\t\tcurrentScreens.current = screens;\n\t}, [ screens ] );\n\tuseEffect( () => {\n\t\tcurrentLocationHistory.current = locationHistory;\n\t}, [ locationHistory ] );\n\tconst currentMatch = useRef< MatchedPath >();\n\tconst matchedPath = useMemo( () => {\n\t\tlet currentPath: string | undefined;\n\t\tif (\n\t\t\tlocationHistory.length === 0 ||\n\t\t\t( currentPath =\n\t\t\t\tlocationHistory[ locationHistory.length - 1 ].path ) ===\n\t\t\t\tundefined\n\t\t) {\n\t\t\tcurrentMatch.current = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst resolvePath = ( path: string ) => {\n\t\t\tconst newMatch = patternMatch( path, screens );\n\n\t\t\t// If the new match is the same as the current match,\n\t\t\t// return the previous one for performance reasons.\n\t\t\tif (\n\t\t\t\tcurrentMatch.current &&\n\t\t\t\tnewMatch &&\n\t\t\t\tisShallowEqual(\n\t\t\t\t\tnewMatch.params,\n\t\t\t\t\tcurrentMatch.current.params\n\t\t\t\t) &&\n\t\t\t\tnewMatch.id === currentMatch.current.id\n\t\t\t) {\n\t\t\t\treturn currentMatch.current;\n\t\t\t}\n\n\t\t\treturn newMatch;\n\t\t};\n\n\t\tconst newMatch = resolvePath( currentPath );\n\t\tcurrentMatch.current = newMatch;\n\t\treturn newMatch;\n\t}, [ screens, locationHistory ] );\n\n\tconst addScreen = useCallback(\n\t\t( screen: Screen ) => dispatch( { type: 'add', screen } ),\n\t\t[]\n\t);\n\n\tconst removeScreen = useCallback(\n\t\t( screen: Screen ) => dispatch( { type: 'remove', screen } ),\n\t\t[]\n\t);\n\n\tconst goBack: NavigatorContextType[ 'goBack' ] = useCallback( () => {\n\t\tsetLocationHistory( ( prevLocationHistory ) => {\n\t\t\tif ( prevLocationHistory.length <= 1 ) {\n\t\t\t\treturn prevLocationHistory;\n\t\t\t}\n\t\t\treturn [\n\t\t\t\t...prevLocationHistory.slice( 0, -2 ),\n\t\t\t\t{\n\t\t\t\t\t...prevLocationHistory[ prevLocationHistory.length - 2 ],\n\t\t\t\t\tisBack: true,\n\t\t\t\t\thasRestoredFocus: false,\n\t\t\t\t},\n\t\t\t];\n\t\t} );\n\t}, [] );\n\n\tconst goTo: NavigatorContextType[ 'goTo' ] = useCallback(\n\t\t( path, options = {} ) => {\n\t\t\tconst {\n\t\t\t\tfocusTargetSelector,\n\t\t\t\tisBack = false,\n\t\t\t\tskipFocus = false,\n\t\t\t\t...restOptions\n\t\t\t} = options;\n\n\t\t\tconst isNavigatingToPreviousPath =\n\t\t\t\tisBack &&\n\t\t\t\tcurrentLocationHistory.current.length > 1 &&\n\t\t\t\tcurrentLocationHistory.current[\n\t\t\t\t\tcurrentLocationHistory.current.length - 2\n\t\t\t\t].path === path;\n\n\t\t\tif ( isNavigatingToPreviousPath ) {\n\t\t\t\tgoBack();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetLocationHistory( ( prevLocationHistory ) => {\n\t\t\t\tconst newLocation = {\n\t\t\t\t\t...restOptions,\n\t\t\t\t\tpath,\n\t\t\t\t\tisBack,\n\t\t\t\t\thasRestoredFocus: false,\n\t\t\t\t\tskipFocus,\n\t\t\t\t};\n\n\t\t\t\tif ( prevLocationHistory.length < 1 ) {\n\t\t\t\t\treturn [ newLocation ];\n\t\t\t\t}\n\n\t\t\t\treturn [\n\t\t\t\t\t...prevLocationHistory.slice(\n\t\t\t\t\t\tprevLocationHistory.length > MAX_HISTORY_LENGTH - 1\n\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t: 0,\n\t\t\t\t\t\t-1\n\t\t\t\t\t),\n\t\t\t\t\t// Assign `focusTargetSelector` to the previous location in history\n\t\t\t\t\t// (the one we just navigated from).\n\t\t\t\t\t{\n\t\t\t\t\t\t...prevLocationHistory[\n\t\t\t\t\t\t\tprevLocationHistory.length - 1\n\t\t\t\t\t\t],\n\t\t\t\t\t\tfocusTargetSelector,\n\t\t\t\t\t},\n\t\t\t\t\tnewLocation,\n\t\t\t\t];\n\t\t\t} );\n\t\t},\n\t\t[ goBack ]\n\t);\n\n\tconst goToParent: NavigatorContextType[ 'goToParent' ] =\n\t\tuseCallback( () => {\n\t\t\tconst currentPath =\n\t\t\t\tcurrentLocationHistory.current[\n\t\t\t\t\tcurrentLocationHistory.current.length - 1\n\t\t\t\t].path;\n\t\t\tif ( currentPath === undefined ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst parentPath = findParent(\n\t\t\t\tcurrentPath,\n\t\t\t\tcurrentScreens.current\n\t\t\t);\n\t\t\tif ( parentPath === undefined ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgoTo( parentPath, { isBack: true } );\n\t\t}, [ goTo ] );\n\n\tconst navigatorContextValue: NavigatorContextType = useMemo(\n\t\t() => ( {\n\t\t\tlocation: {\n\t\t\t\t...locationHistory[ locationHistory.length - 1 ],\n\t\t\t\tisInitial: locationHistory.length === 1,\n\t\t\t},\n\t\t\tparams: matchedPath ? matchedPath.params : {},\n\t\t\tmatch: matchedPath ? matchedPath.id : undefined,\n\t\t\tgoTo,\n\t\t\tgoBack,\n\t\t\tgoToParent,\n\t\t\taddScreen,\n\t\t\tremoveScreen,\n\t\t} ),\n\t\t[\n\t\t\tlocationHistory,\n\t\t\tmatchedPath,\n\t\t\tgoTo,\n\t\t\tgoBack,\n\t\t\tgoToParent,\n\t\t\taddScreen,\n\t\t\tremoveScreen,\n\t\t]\n\t);\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t// Prevents horizontal overflow while animating screen transitions.\n\t\t() => cx( css( { overflowX: 'hidden' } ), className ),\n\t\t[ className, cx ]\n\t);\n\n\treturn (\n\t\t<View ref={ forwardedRef } className={ classes } { ...otherProps }>\n\t\t\t<NavigatorContext.Provider value={ navigatorContextValue }>\n\t\t\t\t{ children }\n\t\t\t</NavigatorContext.Provider>\n\t\t</View>\n\t);\n}\n\n/**\n * The `NavigatorProvider` component allows rendering nested views/panels/menus\n * (via the `NavigatorScreen` component and navigate between these different\n * view (via the `NavigatorButton` and `NavigatorBackButton` components or the\n * `useNavigator` hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorBackButton as NavigatorBackButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>\n * Go back\n * </NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nexport const NavigatorProvider = contextConnect(\n\tUnconnectedNavigatorProvider,\n\t'NavigatorProvider'\n);\n\nexport default NavigatorProvider;\n"]}
|
|
@@ -103,7 +103,7 @@ function UnconnectedNavigatorScreen(props, forwardedRef) {
|
|
|
103
103
|
let elementToFocus = null; // When navigating back, if a selector is provided, use it to look for the
|
|
104
104
|
// target element (assumed to be a node inside the current NavigatorScreen)
|
|
105
105
|
|
|
106
|
-
if (location.isBack && location
|
|
106
|
+
if (location.isBack && location?.focusTargetSelector) {
|
|
107
107
|
elementToFocus = wrapperRef.current.querySelector(location.focusTargetSelector);
|
|
108
108
|
} // If the previous query didn't run or find any element to focus, fallback
|
|
109
109
|
// to the first tabbable element in the screen (or the screen itself).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"names":["animationEnterDelay","animationEnterDuration","animationExitDuration","animationExitDelay","UnconnectedNavigatorScreen","props","forwardedRef","screenId","children","className","path","otherProps","prefersReducedMotion","location","match","addScreen","removeScreen","NavigatorContext","isMatch","wrapperRef","screen","id","cx","classes","locationRef","current","isInitialLocation","isInitial","isBack","hasRestoredFocus","skipFocus","activeElement","ownerDocument","contains","elementToFocus","focusTargetSelector","querySelector","firstTabbable","focus","tabbable","find","mergedWrapperRef","animate","opacity","transition","delay","duration","ease","x","initial","exit","animatedProps","NavigatorScreen"],"mappings":";;;;;;;;;AAYA;;;;AAPA;;AACA;;AAKA;;AAQA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;;;AAGA,MAAMA,mBAAmB,GAAG,CAA5B;AACA,MAAMC,sBAAsB,GAAG,IAA/B;AACA,MAAMC,qBAAqB,GAAG,IAA9B;AACA,MAAMC,kBAAkB,GAAG,CAA3B,C,CAEA;AACA;;;;;;;;;;;;AAMA,SAASC,0BAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,QAAQ,GAAG,qBAAjB;AACA,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA,IAAvB;AAA6B,OAAGC;AAAhC,MAA+C,+BACpDN,KADoD,EAEpD,iBAFoD,CAArD;AAKA,QAAMO,oBAAoB,GAAG,gCAA7B;AACA,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,KAAZ;AAAmBC,IAAAA,SAAnB;AAA8BC,IAAAA;AAA9B,MACL,yBAAYC,0BAAZ,CADD;AAEA,QAAMC,OAAO,GAAGJ,KAAK,KAAKP,QAA1B;AACA,QAAMY,UAAU,GAAG,qBAA0B,IAA1B,CAAnB;AAEA,0BAAW,MAAM;AAChB,UAAMC,MAAM,GAAG;AACdC,MAAAA,EAAE,EAAEd,QADU;AAEdG,MAAAA,IAAI,EAAE,iCAAiBA,IAAjB;AAFQ,KAAf;AAIAK,IAAAA,SAAS,CAAEK,MAAF,CAAT;AACA,WAAO,MAAMJ,YAAY,CAAEI,MAAF,CAAzB;AACA,GAPD,EAOG,CAAEb,QAAF,EAAYG,IAAZ,EAAkBK,SA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AAA,CAAC,EACE,CAAE,kBAAF,IAAanC,QAAQ,CAACe,MAAxB,IAAsC,sBAAW,CAAEf,QAAQ,CAACe,MAA5D,GACG,EADH,GAEG,CAAC,EANO;AAOZgB,IAAAA,UAAU,EAAE;AACXE,MAAAA,QAAQ,EAAE5C,qBADC;AAEX6C,MAAAA,IAAI,EAAE;AAFK;AAPA,GAAb;AAaA,QAAMI,aAAa,GAAG;AACrBT,IAAAA,OADqB;AAErBQ,IAAAA,IAFqB;AAGrBD,IAAAA;AAHqB,GAAtB;AAMA,SACC,4BAAC,oBAAD,CAAQ,GAAR;AACC,IAAA,GAAG,EAAGR,gBADP;AAEC,IAAA,SAAS,EAAGlB;AAFb,KAGMZ,UAHN,EAIMwC,aAJN,GAMG3C,QANH,CADD;AAUA;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;;;AACO,MAAM4C,eAAe,GAAG,6BAC9BhD,0BAD8B,EAE9B,iBAF8B,CAAxB;;eAKQgD,e","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport { motion, MotionProps } from 'framer-motion';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport {\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseId,\n} from '@wordpress/element';\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type { NavigatorScreenProps } from '../types';\n\nconst animationEnterDelay = 0;\nconst animationEnterDuration = 0.14;\nconst animationExitDuration = 0.14;\nconst animationExitDelay = 0;\n\n// Props specific to `framer-motion` can't be currently passed to `NavigatorScreen`,\n// as some of them would overlap with HTML props (e.g. `onAnimationStart`, ...)\ntype Props = Omit<\n\tWordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tExclude< keyof MotionProps, 'style' | 'children' >\n>;\n\nfunction UnconnectedNavigatorScreen(\n\tprops: Props,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst screenId = useId();\n\tconst { children, className, path, ...otherProps } = useContextSystem(\n\t\tprops,\n\t\t'NavigatorScreen'\n\t);\n\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst { location, match, addScreen, removeScreen } =\n\t\tuseContext( NavigatorContext );\n\tconst isMatch = match === screenId;\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\n\tuseEffect( () => {\n\t\tconst screen = {\n\t\t\tid: screenId,\n\t\t\tpath: escapeAttribute( path ),\n\t\t};\n\t\taddScreen( screen );\n\t\treturn () => removeScreen( screen );\n\t}, [ screenId, path, addScreen, removeScreen ] );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tcss( {\n\t\t\t\t\t// Ensures horizontal overflow is visually accessible.\n\t\t\t\t\toverflowX: 'auto',\n\t\t\t\t\t// In case the root has a height, it should not be exceeded.\n\t\t\t\t\tmaxHeight: '100%',\n\t\t\t\t} ),\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ className, cx ]\n\t);\n\n\tconst locationRef = useRef( location );\n\n\tuseEffect( () => {\n\t\tlocationRef.current = location;\n\t}, [ location ] );\n\n\t// Focus restoration\n\tconst isInitialLocation = location.isInitial && ! location.isBack;\n\tuseEffect( () => {\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\t// - if focus hasn't already been restored for the current location\n\t\t// - if the `skipFocus` option is not set to `true`. This is useful when we trigger the navigation outside of NavigatorScreen.\n\t\tif (\n\t\t\tisInitialLocation ||\n\t\t\t! isMatch ||\n\t\t\t! wrapperRef.current ||\n\t\t\tlocationRef.current.hasRestoredFocus ||\n\t\t\tlocation.skipFocus\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = wrapperRef.current.ownerDocument.activeElement;\n\n\t\t// If an element is already focused within the wrapper do not focus the\n\t\t// element. This prevents inputs or buttons from losing focus unnecessarily.\n\t\tif ( wrapperRef.current.contains( activeElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( location.isBack && location?.focusTargetSelector ) {\n\t\t\telementToFocus = wrapperRef.current.querySelector(\n\t\t\t\tlocation.focusTargetSelector\n\t\t\t);\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst firstTabbable = (\n\t\t\t\tfocus.tabbable.find( wrapperRef.current ) as HTMLElement[]\n\t\t\t )[ 0 ];\n\t\t\telementToFocus = firstTabbable ?? wrapperRef.current;\n\t\t}\n\n\t\tlocationRef.current.hasRestoredFocus = true;\n\t\telementToFocus.focus();\n\t}, [\n\t\tisInitialLocation,\n\t\tisMatch,\n\t\tlocation.isBack,\n\t\tlocation.focusTargetSelector,\n\t\tlocation.skipFocus,\n\t] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\tif ( ! isMatch ) {\n\t\treturn null;\n\t}\n\n\tif ( prefersReducedMotion ) {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tref={ mergedWrapperRef }\n\t\t\t\tclassName={ classes }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst animate = {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\tdelay: animationEnterDelay,\n\t\t\tduration: animationEnterDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t\tx: 0,\n\t};\n\t// Disable the initial animation if the screen is the very first screen to be\n\t// rendered within the current `NavigatorProvider`.\n\tconst initial =\n\t\tlocation.isInitial && ! location.isBack\n\t\t\t? false\n\t\t\t: {\n\t\t\t\t\topacity: 0,\n\t\t\t\t\tx:\n\t\t\t\t\t\t( isRTL() && location.isBack ) ||\n\t\t\t\t\t\t( ! isRTL() && ! location.isBack )\n\t\t\t\t\t\t\t? 50\n\t\t\t\t\t\t\t: -50,\n\t\t\t };\n\tconst exit = {\n\t\tdelay: animationExitDelay,\n\t\topacity: 0,\n\t\tx:\n\t\t\t( ! isRTL() && location.isBack ) || ( isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t\ttransition: {\n\t\t\tduration: animationExitDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t};\n\n\tconst animatedProps = {\n\t\tanimate,\n\t\texit,\n\t\tinitial,\n\t};\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...otherProps }\n\t\t\t{ ...animatedProps }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n}\n\n/**\n * The `NavigatorScreen` component represents a single view/screen/panel and\n * should be used in combination with the `NavigatorProvider`, the\n * `NavigatorButton` and the `NavigatorBackButton` components (or the `useNavigator`\n * hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorBackButton as NavigatorBackButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>\n * Go back\n * </NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nexport const NavigatorScreen = contextConnect(\n\tUnconnectedNavigatorScreen,\n\t'NavigatorScreen'\n);\n\nexport default NavigatorScreen;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"names":["animationEnterDelay","animationEnterDuration","animationExitDuration","animationExitDelay","UnconnectedNavigatorScreen","props","forwardedRef","screenId","children","className","path","otherProps","prefersReducedMotion","location","match","addScreen","removeScreen","NavigatorContext","isMatch","wrapperRef","screen","id","cx","classes","locationRef","current","isInitialLocation","isInitial","isBack","hasRestoredFocus","skipFocus","activeElement","ownerDocument","contains","elementToFocus","focusTargetSelector","querySelector","firstTabbable","focus","tabbable","find","mergedWrapperRef","animate","opacity","transition","delay","duration","ease","x","initial","exit","animatedProps","NavigatorScreen"],"mappings":";;;;;;;;;AAYA;;;;AAPA;;AACA;;AAKA;;AAQA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;;;AAGA,MAAMA,mBAAmB,GAAG,CAA5B;AACA,MAAMC,sBAAsB,GAAG,IAA/B;AACA,MAAMC,qBAAqB,GAAG,IAA9B;AACA,MAAMC,kBAAkB,GAAG,CAA3B,C,CAEA;AACA;;;;;;;;;;;;AAMA,SAASC,0BAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,QAAQ,GAAG,qBAAjB;AACA,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA,IAAvB;AAA6B,OAAGC;AAAhC,MAA+C,+BACpDN,KADoD,EAEpD,iBAFoD,CAArD;AAK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ent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport { motion, MotionProps } from 'framer-motion';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport {\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseId,\n} from '@wordpress/element';\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type { NavigatorScreenProps } from '../types';\n\nconst animationEnterDelay = 0;\nconst animationEnterDuration = 0.14;\nconst animationExitDuration = 0.14;\nconst animationExitDelay = 0;\n\n// Props specific to `framer-motion` can't be currently passed to `NavigatorScreen`,\n// as some of them would overlap with HTML props (e.g. `onAnimationStart`, ...)\ntype Props = Omit<\n\tWordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tExclude< keyof MotionProps, 'style' | 'children' >\n>;\n\nfunction UnconnectedNavigatorScreen(\n\tprops: Props,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst screenId = useId();\n\tconst { children, className, path, ...otherProps } = useContextSystem(\n\t\tprops,\n\t\t'NavigatorScreen'\n\t);\n\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst { location, match, addScreen, removeScreen } =\n\t\tuseContext( NavigatorContext );\n\tconst isMatch = match === screenId;\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\n\tuseEffect( () => {\n\t\tconst screen = {\n\t\t\tid: screenId,\n\t\t\tpath: escapeAttribute( path ),\n\t\t};\n\t\taddScreen( screen );\n\t\treturn () => removeScreen( screen );\n\t}, [ screenId, path, addScreen, removeScreen ] );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tcss( {\n\t\t\t\t\t// Ensures horizontal overflow is visually accessible.\n\t\t\t\t\toverflowX: 'auto',\n\t\t\t\t\t// In case the root has a height, it should not be exceeded.\n\t\t\t\t\tmaxHeight: '100%',\n\t\t\t\t} ),\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ className, cx ]\n\t);\n\n\tconst locationRef = useRef( location );\n\n\tuseEffect( () => {\n\t\tlocationRef.current = location;\n\t}, [ location ] );\n\n\t// Focus restoration\n\tconst isInitialLocation = location.isInitial && ! location.isBack;\n\tuseEffect( () => {\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\t// - if focus hasn't already been restored for the current location\n\t\t// - if the `skipFocus` option is not set to `true`. This is useful when we trigger the navigation outside of NavigatorScreen.\n\t\tif (\n\t\t\tisInitialLocation ||\n\t\t\t! isMatch ||\n\t\t\t! wrapperRef.current ||\n\t\t\tlocationRef.current.hasRestoredFocus ||\n\t\t\tlocation.skipFocus\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = wrapperRef.current.ownerDocument.activeElement;\n\n\t\t// If an element is already focused within the wrapper do not focus the\n\t\t// element. This prevents inputs or buttons from losing focus unnecessarily.\n\t\tif ( wrapperRef.current.contains( activeElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( location.isBack && location?.focusTargetSelector ) {\n\t\t\telementToFocus = wrapperRef.current.querySelector(\n\t\t\t\tlocation.focusTargetSelector\n\t\t\t);\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst firstTabbable = (\n\t\t\t\tfocus.tabbable.find( wrapperRef.current ) as HTMLElement[]\n\t\t\t )[ 0 ];\n\t\t\telementToFocus = firstTabbable ?? wrapperRef.current;\n\t\t}\n\n\t\tlocationRef.current.hasRestoredFocus = true;\n\t\telementToFocus.focus();\n\t}, [\n\t\tisInitialLocation,\n\t\tisMatch,\n\t\tlocation.isBack,\n\t\tlocation.focusTargetSelector,\n\t\tlocation.skipFocus,\n\t] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\tif ( ! isMatch ) {\n\t\treturn null;\n\t}\n\n\tif ( prefersReducedMotion ) {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tref={ mergedWrapperRef }\n\t\t\t\tclassName={ classes }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst animate = {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\tdelay: animationEnterDelay,\n\t\t\tduration: animationEnterDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t\tx: 0,\n\t};\n\t// Disable the initial animation if the screen is the very first screen to be\n\t// rendered within the current `NavigatorProvider`.\n\tconst initial =\n\t\tlocation.isInitial && ! location.isBack\n\t\t\t? false\n\t\t\t: {\n\t\t\t\t\topacity: 0,\n\t\t\t\t\tx:\n\t\t\t\t\t\t( isRTL() && location.isBack ) ||\n\t\t\t\t\t\t( ! isRTL() && ! location.isBack )\n\t\t\t\t\t\t\t? 50\n\t\t\t\t\t\t\t: -50,\n\t\t\t };\n\tconst exit = {\n\t\tdelay: animationExitDelay,\n\t\topacity: 0,\n\t\tx:\n\t\t\t( ! isRTL() && location.isBack ) || ( isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t\ttransition: {\n\t\t\tduration: animationExitDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t};\n\n\tconst animatedProps = {\n\t\tanimate,\n\t\texit,\n\t\tinitial,\n\t};\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...otherProps }\n\t\t\t{ ...animatedProps }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n}\n\n/**\n * The `NavigatorScreen` component represents a single view/screen/panel and\n * should be used in combination with the `NavigatorProvider`, the\n * `NavigatorButton` and the `NavigatorBackButton` components (or the `useNavigator`\n * hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorBackButton as NavigatorBackButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>\n * Go back\n * </NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nexport const NavigatorScreen = contextConnect(\n\tUnconnectedNavigatorScreen,\n\t'NavigatorScreen'\n);\n\nexport default NavigatorScreen;\n"]}
|
package/build/notice/index.js
CHANGED
|
@@ -71,22 +71,21 @@ function getDefaultPoliteness(status) {
|
|
|
71
71
|
*/
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
function Notice(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
} = _ref;
|
|
74
|
+
function Notice({
|
|
75
|
+
className,
|
|
76
|
+
status = 'info',
|
|
77
|
+
children,
|
|
78
|
+
spokenMessage = children,
|
|
79
|
+
onRemove = noop,
|
|
80
|
+
isDismissible = true,
|
|
81
|
+
actions = [],
|
|
82
|
+
politeness = getDefaultPoliteness(status),
|
|
83
|
+
__unstableHTML,
|
|
84
|
+
// onDismiss is a callback executed when the notice is dismissed.
|
|
85
|
+
// It is distinct from onRemove, which _looks_ like a callback but is
|
|
86
|
+
// actually the function to call to remove the notice from the UI.
|
|
87
|
+
onDismiss = noop
|
|
88
|
+
}) {
|
|
90
89
|
useSpokenMessage(spokenMessage, politeness);
|
|
91
90
|
const classes = (0, _classnames.default)(className, 'components-notice', 'is-' + status, {
|
|
92
91
|
'is-dismissible': isDismissible
|
|
@@ -97,9 +96,7 @@ function Notice(_ref) {
|
|
|
97
96
|
}
|
|
98
97
|
|
|
99
98
|
const onDismissNotice = event => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
event === null || event === void 0 ? void 0 : (_event$preventDefault = event.preventDefault) === null || _event$preventDefault === void 0 ? void 0 : _event$preventDefault.call(event);
|
|
99
|
+
event?.preventDefault?.();
|
|
103
100
|
onDismiss();
|
|
104
101
|
onRemove();
|
|
105
102
|
};
|
|
@@ -110,16 +107,15 @@ function Notice(_ref) {
|
|
|
110
107
|
className: "components-notice__content"
|
|
111
108
|
}, children, (0, _element.createElement)("div", {
|
|
112
109
|
className: "components-notice__actions"
|
|
113
|
-
}, actions.map((
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
} = _ref2;
|
|
110
|
+
}, actions.map(({
|
|
111
|
+
className: buttonCustomClasses,
|
|
112
|
+
label,
|
|
113
|
+
isPrimary,
|
|
114
|
+
variant,
|
|
115
|
+
noDefaultClasses = false,
|
|
116
|
+
onClick,
|
|
117
|
+
url
|
|
118
|
+
}, index) => {
|
|
123
119
|
let computedVariant = variant;
|
|
124
120
|
|
|
125
121
|
if (variant !== 'primary' && !noDefaultClasses) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/notice/index.tsx"],"names":["noop","useSpokenMessage","message","politeness","spokenMessage","getDefaultPoliteness","status","Notice","className","children","onRemove","isDismissible","actions","__unstableHTML","onDismiss","classes","onDismissNotice","event","preventDefault","map","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/notice/index.tsx"],"names":["noop","useSpokenMessage","message","politeness","spokenMessage","getDefaultPoliteness","status","Notice","className","children","onRemove","isDismissible","actions","__unstableHTML","onDismiss","classes","onDismissNotice","event","preventDefault","map","buttonCustomClasses","label","isPrimary","variant","noDefaultClasses","onClick","url","index","computedVariant","undefined","close"],"mappings":";;;;;;;;;AASA;;AANA;;AAKA;;AAEA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAMA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;AAEA;AACA;AACA;AACA;;;AACA,SAASC,gBAAT,CACCC,OADD,EAECC,UAFD,EAGE;AACD,QAAMC,aAAa,GAClB,OAAOF,OAAP,KAAmB,QAAnB,GAA8BA,OAA9B,GAAwC,6BAAgBA,OAAhB,CADzC;AAGA,0BAAW,MAAM;AAChB,QAAKE,aAAL,EAAqB;AACpB,uBAAOA,aAAP,EAAsBD,UAAtB;AACA;AACD,GAJD,EAIG,CAAEC,aAAF,EAAiBD,UAAjB,CAJH;AAKA;;AAED,SAASE,oBAAT,CAA+BC,MAA/B,EAAiE;AAChE,UAASA,MAAT;AACC,SAAK,SAAL;AACA,SAAK,SAAL;AACA,SAAK,MAAL;AACC,aAAO,QAAP;;AAED,SAAK,OAAL;AACA;AACC,aAAO,WAAP;AARF;AAUA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,MAAT,CAAiB;AAChBC,EAAAA,SADgB;AAEhBF,EAAAA,MAAM,GAAG,MAFO;AAGhBG,EAAAA,QAHgB;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OE,eAAP,KAA2B,WAA3B,IACAN,SAFD,EAGE;AACDM,MAAAA,eAAe,GAAG,SAAlB;AACA;;AAED,WACC,4BAAC,eAAD;AACC,MAAA,GAAG,EAAGD,KADP;AAEC,MAAA,IAAI,EAAGD,GAFR;AAGC,MAAA,OAAO,EAAGE,eAHX;AAIC,MAAA,OAAO,EAAGF,GAAG,GAAGG,SAAH,GAAeJ,OAJ7B;AAKC,MAAA,SAAS,EAAG,yBACX,2BADW,EAEXL,mBAFW;AALb,OAUGC,KAVH,CADD;AAcA,GA1CA,CADH,CAFD,CADD,EAkDGV,aAAa,IACd,4BAAC,eAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,IAAI,EAAGmB,YAFR;AAGC,IAAA,KAAK,EAAG,cAAI,qBAAJ,CAHT;AAIC,IAAA,OAAO,EAAGd,eAJX;AAKC,IAAA,WAAW,EAAG;AALf,IAnDF,CADD;AA8DA;;eAEcT,M","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { RawHTML, useEffect, renderToString } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\nimport { close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { NoticeAction, NoticeProps } from './types';\nimport type { SyntheticEvent } from 'react';\nimport type { DeprecatedButtonProps } from '../button/types';\n\nconst noop = () => {};\n\n/**\n * Custom hook which announces the message with the given politeness, if a\n * valid message is provided.\n */\nfunction useSpokenMessage(\n\tmessage: NoticeProps[ 'spokenMessage' ],\n\tpoliteness: NoticeProps[ 'politeness' ]\n) {\n\tconst spokenMessage =\n\t\ttypeof message === 'string' ? message : renderToString( message );\n\n\tuseEffect( () => {\n\t\tif ( spokenMessage ) {\n\t\t\tspeak( spokenMessage, politeness );\n\t\t}\n\t}, [ spokenMessage, politeness ] );\n}\n\nfunction getDefaultPoliteness( status: NoticeProps[ 'status' ] ) {\n\tswitch ( status ) {\n\t\tcase 'success':\n\t\tcase 'warning':\n\t\tcase 'info':\n\t\t\treturn 'polite';\n\n\t\tcase 'error':\n\t\tdefault:\n\t\t\treturn 'assertive';\n\t}\n}\n\n/**\n * `Notice` is a component used to communicate feedback to the user.\n *\n *```jsx\n * import { Notice } from `@wordpress/components`;\n *\n * const MyNotice = () => (\n * <Notice status=\"error\">An unknown error occurred.</Notice>\n * );\n * ```\n */\nfunction Notice( {\n\tclassName,\n\tstatus = 'info',\n\tchildren,\n\tspokenMessage = children,\n\tonRemove = noop,\n\tisDismissible = true,\n\tactions = [],\n\tpoliteness = getDefaultPoliteness( status ),\n\t__unstableHTML,\n\t// onDismiss is a callback executed when the notice is dismissed.\n\t// It is distinct from onRemove, which _looks_ like a callback but is\n\t// actually the function to call to remove the notice from the UI.\n\tonDismiss = noop,\n}: NoticeProps ) {\n\tuseSpokenMessage( spokenMessage, politeness );\n\n\tconst classes = classnames(\n\t\tclassName,\n\t\t'components-notice',\n\t\t'is-' + status,\n\t\t{\n\t\t\t'is-dismissible': isDismissible,\n\t\t}\n\t);\n\n\tif ( __unstableHTML && typeof children === 'string' ) {\n\t\tchildren = <RawHTML>{ children }</RawHTML>;\n\t}\n\n\tconst onDismissNotice = ( event: SyntheticEvent ) => {\n\t\tevent?.preventDefault?.();\n\t\tonDismiss();\n\t\tonRemove();\n\t};\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t<div className=\"components-notice__content\">\n\t\t\t\t{ children }\n\t\t\t\t<div className=\"components-notice__actions\">\n\t\t\t\t\t{ actions.map(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclassName: buttonCustomClasses,\n\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\tisPrimary,\n\t\t\t\t\t\t\t\tvariant,\n\t\t\t\t\t\t\t\tnoDefaultClasses = false,\n\t\t\t\t\t\t\t\tonClick,\n\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t}: NoticeAction &\n\t\t\t\t\t\t\t\t// `isPrimary` is a legacy prop included for\n\t\t\t\t\t\t\t\t// backcompat, but `variant` should be used\n\t\t\t\t\t\t\t\t// instead.\n\t\t\t\t\t\t\t\tPick< DeprecatedButtonProps, 'isPrimary' >,\n\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\tlet computedVariant = variant;\n\t\t\t\t\t\t\tif ( variant !== 'primary' && ! noDefaultClasses ) {\n\t\t\t\t\t\t\t\tcomputedVariant = ! url ? 'secondary' : 'link';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\ttypeof computedVariant === 'undefined' &&\n\t\t\t\t\t\t\t\tisPrimary\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcomputedVariant = 'primary';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\thref={ url }\n\t\t\t\t\t\t\t\t\tvariant={ computedVariant }\n\t\t\t\t\t\t\t\t\tonClick={ url ? undefined : onClick }\n\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t'components-notice__action',\n\t\t\t\t\t\t\t\t\t\tbuttonCustomClasses\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t</Button>\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</div>\n\t\t\t</div>\n\t\t\t{ isDismissible && (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"components-notice__dismiss\"\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tlabel={ __( 'Dismiss this notice' ) }\n\t\t\t\t\tonClick={ onDismissNotice }\n\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default Notice;\n"]}
|
|
@@ -30,13 +30,12 @@ var _style = _interopRequireDefault(require("./style.scss"));
|
|
|
30
30
|
*/
|
|
31
31
|
const HIDE_TIMER = 3000;
|
|
32
32
|
|
|
33
|
-
const Notice =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} = _ref;
|
|
33
|
+
const Notice = ({
|
|
34
|
+
onNoticeHidden,
|
|
35
|
+
content,
|
|
36
|
+
id,
|
|
37
|
+
status
|
|
38
|
+
}) => {
|
|
40
39
|
const {
|
|
41
40
|
width
|
|
42
41
|
} = (0, _reactNative.useWindowDimensions)();
|
|
@@ -49,11 +48,9 @@ const Notice = _ref => {
|
|
|
49
48
|
duration: 300,
|
|
50
49
|
useNativeDriver: true,
|
|
51
50
|
easing: _reactNative.Easing.out(_reactNative.Easing.quad)
|
|
52
|
-
}).start(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
} = _ref2;
|
|
56
|
-
|
|
51
|
+
}).start(({
|
|
52
|
+
finished
|
|
53
|
+
}) => {
|
|
57
54
|
if (finished && onNoticeHidden) {
|
|
58
55
|
timer.current = setTimeout(() => {
|
|
59
56
|
onHide();
|
|
@@ -62,7 +59,7 @@ const Notice = _ref => {
|
|
|
62
59
|
});
|
|
63
60
|
|
|
64
61
|
return () => {
|
|
65
|
-
clearTimeout(timer
|
|
62
|
+
clearTimeout(timer?.current);
|
|
66
63
|
};
|
|
67
64
|
}, [animationValue, onHide, onNoticeHidden]);
|
|
68
65
|
const onHide = (0, _element.useCallback)(() => {
|
|
@@ -71,11 +68,9 @@ const Notice = _ref => {
|
|
|
71
68
|
duration: 150,
|
|
72
69
|
useNativeDriver: true,
|
|
73
70
|
easing: _reactNative.Easing.out(_reactNative.Easing.quad)
|
|
74
|
-
}).start(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
} = _ref3;
|
|
78
|
-
|
|
71
|
+
}).start(({
|
|
72
|
+
finished
|
|
73
|
+
}) => {
|
|
79
74
|
if (finished && onNoticeHidden) {
|
|
80
75
|
onNoticeHidden(id);
|
|
81
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/notice/index.native.js"],"names":["HIDE_TIMER","Notice","onNoticeHidden","content","id","status","width","animationValue","Animated","Value","current","timer","timing","toValue","duration","useNativeDriver","easing","Easing","out","quad","start","finished","setTimeout","onHide","clearTimeout","noticeSolidStyles","styles","noticeSolid","noticeSolidDark","successTextStyles","successText","successTextDark","errorTextStyles","errorText","errorTextDark","textStyles","containerStyles","notice","Platform","isIOS","transform","translateY","interpolate","inputRange","outputRange","noticeContent","blurBackground"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAQA;;AAMA;;AAKA;;AAtBA;AACA;AACA;;AAWA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,UAAU,GAAG,IAAnB;;AAEA,MAAMC,MAAM,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/notice/index.native.js"],"names":["HIDE_TIMER","Notice","onNoticeHidden","content","id","status","width","animationValue","Animated","Value","current","timer","timing","toValue","duration","useNativeDriver","easing","Easing","out","quad","start","finished","setTimeout","onHide","clearTimeout","noticeSolidStyles","styles","noticeSolid","noticeSolidDark","successTextStyles","successText","successTextDark","errorTextStyles","errorText","errorTextDark","textStyles","containerStyles","notice","Platform","isIOS","transform","translateY","interpolate","inputRange","outputRange","noticeContent","blurBackground"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAQA;;AAMA;;AAKA;;AAtBA;AACA;AACA;;AAWA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,UAAU,GAAG,IAAnB;;AAEA,MAAMC,MAAM,GAAG,CAAE;AAAEC,EAAAA,cAAF;AAAkBC,EAAAA,OAAlB;AAA2BC,EAAAA,EAA3B;AAA+BC,EAAAA;AAA/B,CAAF,KAA+C;AAC7D,QAAM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d,IATF,CADD,CADD;AAoBA,CA9FD;;eAgGe7C,M","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tAnimated,\n\tEasing,\n\tText,\n\tTouchableWithoutFeedback,\n\tView,\n\tuseWindowDimensions,\n} from 'react-native';\nimport { BlurView } from '@react-native-community/blur';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef, useCallback, Platform } from '@wordpress/element';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst HIDE_TIMER = 3000;\n\nconst Notice = ( { onNoticeHidden, content, id, status } ) => {\n\tconst { width } = useWindowDimensions();\n\tconst animationValue = useRef( new Animated.Value( 0 ) ).current;\n\tconst timer = useRef( null );\n\n\tuseEffect( () => {\n\t\t// start animation\n\t\tAnimated.timing( animationValue, {\n\t\t\ttoValue: 1,\n\t\t\tduration: 300,\n\t\t\tuseNativeDriver: true,\n\t\t\teasing: Easing.out( Easing.quad ),\n\t\t} ).start( ( { finished } ) => {\n\t\t\tif ( finished && onNoticeHidden ) {\n\t\t\t\ttimer.current = setTimeout( () => {\n\t\t\t\t\tonHide();\n\t\t\t\t}, HIDE_TIMER );\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tclearTimeout( timer?.current );\n\t\t};\n\t}, [ animationValue, onHide, onNoticeHidden ] );\n\n\tconst onHide = useCallback( () => {\n\t\tAnimated.timing( animationValue, {\n\t\t\ttoValue: 0,\n\t\t\tduration: 150,\n\t\t\tuseNativeDriver: true,\n\t\t\teasing: Easing.out( Easing.quad ),\n\t\t} ).start( ( { finished } ) => {\n\t\t\tif ( finished && onNoticeHidden ) {\n\t\t\t\tonNoticeHidden( id );\n\t\t\t}\n\t\t} );\n\t}, [ animationValue, onNoticeHidden, id ] );\n\n\tconst noticeSolidStyles = usePreferredColorSchemeStyle(\n\t\tstyles.noticeSolid,\n\t\tstyles.noticeSolidDark\n\t);\n\n\tconst successTextStyles = usePreferredColorSchemeStyle(\n\t\tstyles.successText,\n\t\tstyles.successTextDark\n\t);\n\n\tconst errorTextStyles = usePreferredColorSchemeStyle(\n\t\tstyles.errorText,\n\t\tstyles.errorTextDark\n\t);\n\n\tconst textStyles = [\n\t\tstatus === 'success' && successTextStyles,\n\t\tstatus === 'error' && errorTextStyles,\n\t];\n\n\tconst containerStyles = [\n\t\tstyles.notice,\n\t\t! Platform.isIOS && noticeSolidStyles,\n\t\t{\n\t\t\twidth,\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateY: animationValue.interpolate( {\n\t\t\t\t\t\tinputRange: [ 0, 1 ],\n\t\t\t\t\t\toutputRange: [ -24, 0 ],\n\t\t\t\t\t} ),\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t];\n\n\treturn (\n\t\t<>\n\t\t\t<Animated.View style={ containerStyles }>\n\t\t\t\t<TouchableWithoutFeedback onPress={ onHide }>\n\t\t\t\t\t<View style={ styles.noticeContent }>\n\t\t\t\t\t\t<Text numberOfLines={ 3 } style={ textStyles }>\n\t\t\t\t\t\t\t{ content }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t\t{ Platform.isIOS && (\n\t\t\t\t\t<BlurView\n\t\t\t\t\t\tstyle={ styles.blurBackground }\n\t\t\t\t\t\tblurType=\"prominent\"\n\t\t\t\t\t\tblurAmount={ 10 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</Animated.View>\n\t\t</>\n\t);\n};\n\nexport default Notice;\n"]}
|
package/build/notice/list.js
CHANGED
|
@@ -51,14 +51,12 @@ const noop = () => {};
|
|
|
51
51
|
*/
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
function NoticeList(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
} = _ref;
|
|
61
|
-
|
|
54
|
+
function NoticeList({
|
|
55
|
+
notices,
|
|
56
|
+
onRemove = noop,
|
|
57
|
+
className,
|
|
58
|
+
children
|
|
59
|
+
}) {
|
|
62
60
|
const removeNotice = id => () => onRemove(id);
|
|
63
61
|
|
|
64
62
|
className = (0, _classnames.default)('components-notice-list', className);
|
package/build/notice/list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/notice/list.tsx"],"names":["noop","NoticeList","notices","onRemove","className","children","removeNotice","id","reverse","map","notice","content","restNotice"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAKA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,UAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/notice/list.tsx"],"names":["noop","NoticeList","notices","onRemove","className","children","removeNotice","id","reverse","map","notice","content","restNotice"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAKA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,UAAT,CAAqB;AACpBC,EAAAA,OADoB;AAEpBC,EAAAA,QAAQ,GAAGH,IAFS;AAGpBI,EAAAA,SAHoB;AAIpBC,EAAAA;AAJoB,CAArB,EAK8D;AAC7D,QAAMC,YAAY,GACfC,EAAF,IAA0D,MACzDJ,QAAQ,CAAEI,EAAF,CAFV;;AAIAH,EAAAA,SAAS,GAAG,yBAAY,wBAAZ,EAAsCA,SAAtC,CAAZ;AAEA,SACC;AAAK,IAAA,SAAS,EAAGA;AAAjB,KACGC,QADH,EAEG,CAAE,GAAGH,OAAL,EAAeM,OAAf,GAAyBC,GAAzB,CAAgCC,MAAF,IAAc;AAC7C,UAAM;AAAEC,MAAAA,OAAF;AAAW,SAAGC;AAAd,QAA6BF,MAAnC;AACA,WACC,4BAAC,SAAD,6BACME,UADN;AAEC,MAAA,GAAG,EAAGF,MAAM,CAACH,EAFd;AAGC,MAAA,QAAQ,EAAGD,YAAY,CAAEI,MAAM,CAACH,EAAT;AAHxB,QAKGG,MAAM,CAACC,OALV,CADD;AASA,GAXC,CAFH,CADD;AAiBA;;eAEcV,U","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport Notice from '.';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { NoticeListProps } from './types';\n\nconst noop = () => {};\n\n/**\n * `NoticeList` is a component used to render a collection of notices.\n *\n *```jsx\n * import { Notice, NoticeList } from `@wordpress/components`;\n *\n * const MyNoticeList = () => {\n *\tconst [ notices, setNotices ] = useState( [\n *\t\t{\n *\t\t\tid: 'second-notice',\n *\t\t\tcontent: 'second notice content',\n *\t\t},\n *\t\t{\n *\t\t\tid: 'fist-notice',\n *\t\t\tcontent: 'first notice content',\n *\t\t},\n *\t] );\n *\n *\tconst removeNotice = ( id ) => {\n *\t\tsetNotices( notices.filter( ( notice ) => notice.id !== id ) );\n *\t};\n *\n *\treturn <NoticeList notices={ notices } onRemove={ removeNotice } />;\n *};\n *```\n */\nfunction NoticeList( {\n\tnotices,\n\tonRemove = noop,\n\tclassName,\n\tchildren,\n}: WordPressComponentProps< NoticeListProps, 'div', false > ) {\n\tconst removeNotice =\n\t\t( id: NoticeListProps[ 'notices' ][ number ][ 'id' ] ) => () =>\n\t\t\tonRemove( id );\n\n\tclassName = classnames( 'components-notice-list', className );\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t{ children }\n\t\t\t{ [ ...notices ].reverse().map( ( notice ) => {\n\t\t\t\tconst { content, ...restNotice } = notice;\n\t\t\t\treturn (\n\t\t\t\t\t<Notice\n\t\t\t\t\t\t{ ...restNotice }\n\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\tonRemove={ removeNotice( notice.id ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ notice.content }\n\t\t\t\t\t</Notice>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n\nexport default NoticeList;\n"]}
|