@wordpress/components 19.2.1-next.33ec3857e2.0 → 19.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -1
- package/CONTRIBUTING.md +1 -1
- package/LICENSE.md +1 -1
- package/README.md +8 -4
- package/build/base-control/index.js +2 -3
- package/build/base-control/index.js.map +1 -1
- package/build/base-control/styles/base-control-styles.js +23 -13
- package/build/base-control/styles/base-control-styles.js.map +1 -1
- package/build/base-field/hook.js +1 -1
- package/build/base-field/hook.js.map +1 -1
- package/build/box-control/styles/box-control-styles.js +9 -9
- package/build/box-control/styles/box-control-styles.js.map +1 -1
- package/build/button/deprecated.js +2 -1
- package/build/button/deprecated.js.map +1 -1
- package/build/button/index.js +2 -1
- package/build/button/index.js.map +1 -1
- package/build/card/card/component.js +1 -1
- package/build/card/card/component.js.map +1 -1
- package/build/card/card/hook.js +1 -1
- package/build/card/card/hook.js.map +1 -1
- package/build/card/card-body/hook.js +1 -1
- package/build/card/card-body/hook.js.map +1 -1
- package/build/card/card-divider/hook.js +1 -1
- package/build/card/card-divider/hook.js.map +1 -1
- package/build/card/card-footer/hook.js +1 -1
- package/build/card/card-footer/hook.js.map +1 -1
- package/build/card/card-header/hook.js +1 -1
- package/build/card/card-header/hook.js.map +1 -1
- package/build/card/card-media/hook.js +1 -1
- package/build/card/card-media/hook.js.map +1 -1
- package/build/circular-option-picker/index.js +2 -0
- package/build/circular-option-picker/index.js.map +1 -1
- package/build/color-indicator/index.js +2 -0
- package/build/color-indicator/index.js.map +1 -1
- package/build/color-palette/index.js +4 -7
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/index.native.js +4 -2
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-picker/color-display.js.map +1 -1
- package/build/color-picker/color-input.js.map +1 -1
- package/build/color-picker/component.js +2 -5
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/use-deprecated-props.js +2 -0
- package/build/color-picker/use-deprecated-props.js.map +1 -1
- package/build/confirm-dialog/component.js +10 -6
- package/build/confirm-dialog/component.js.map +1 -1
- package/build/confirm-dialog/styles.js +30 -0
- package/build/confirm-dialog/styles.js.map +1 -0
- package/build/custom-gradient-bar/control-points.js +1 -2
- package/build/custom-gradient-bar/control-points.js.map +1 -1
- package/build/custom-select-control/index.js +10 -2
- package/build/custom-select-control/index.js.map +1 -1
- package/build/date-time/time.js +1 -1
- package/build/date-time/time.js.map +1 -1
- package/build/divider/component.js.map +1 -1
- package/build/dropdown/index.js +3 -3
- package/build/dropdown/index.js.map +1 -1
- package/build/elevation/hook.js +5 -5
- package/build/elevation/hook.js.map +1 -1
- package/build/external-link/styles/external-link-styles.js +5 -5
- package/build/external-link/styles/external-link-styles.js.map +1 -1
- package/build/flex/flex/hook.js +4 -4
- package/build/flex/flex/hook.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +75 -81
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/grid/hook.js +2 -2
- package/build/grid/hook.js.map +1 -1
- package/build/heading/component.js +0 -1
- package/build/heading/component.js.map +1 -1
- package/build/icon/index.js +0 -1
- package/build/icon/index.js.map +1 -1
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js +0 -1
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/reducer/actions.js +0 -1
- package/build/input-control/reducer/actions.js.map +1 -1
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/reducer/state.js +0 -1
- package/build/input-control/reducer/state.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +32 -30
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/item-group/item/component.js +0 -1
- package/build/item-group/item/component.js.map +1 -1
- package/build/item-group/item/hook.js +1 -2
- package/build/item-group/item/hook.js.map +1 -1
- package/build/item-group/item-group/component.js +0 -1
- package/build/item-group/item-group/component.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-context.native.js +3 -1
- package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +4 -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 +23 -5
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +3 -5
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.native.js +16 -16
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-text-input.native.js +2 -3
- package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js +2 -0
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +5 -0
- package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build/mobile/color-settings/utils.native.js +9 -3
- package/build/mobile/color-settings/utils.native.js.map +1 -1
- package/build/mobile/keyboard-avoiding-view/index.ios.js +6 -8
- package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build/mobile/link-picker/index.native.js +3 -1
- package/build/mobile/link-picker/index.native.js.map +1 -1
- package/build/mobile/link-picker/link-picker-screen.native.js +18 -5
- package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
- package/build/mobile/link-settings/index.native.js +3 -1
- package/build/mobile/link-settings/index.native.js.map +1 -1
- package/build/mobile/readable-content-view/index.native.js +2 -2
- package/build/mobile/readable-content-view/index.native.js.map +1 -1
- package/build/mobile/utils/use-is-floating-keyboard.native.js +2 -2
- package/build/mobile/utils/use-is-floating-keyboard.native.js.map +1 -1
- package/build/mobile/utils/use-unit-converter-to-mobile.native.js +7 -3
- package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build/modal/index.js +1 -12
- package/build/modal/index.js.map +1 -1
- package/build/navigator/context.js +5 -1
- package/build/navigator/context.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +42 -22
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +57 -29
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/use-navigator.js +8 -8
- package/build/navigator/use-navigator.js.map +1 -1
- package/build/notice/index.native.js +2 -2
- package/build/notice/index.native.js.map +1 -1
- package/build/palette-edit/index.js +39 -30
- package/build/palette-edit/index.js.map +1 -1
- package/build/palette-edit/styles.js +11 -13
- package/build/palette-edit/styles.js.map +1 -1
- package/build/placeholder/index.js +4 -4
- package/build/placeholder/index.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +29 -29
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/resizable-box/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/label.js +0 -1
- package/build/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build/sandbox/index.native.js +5 -5
- package/build/sandbox/index.native.js.map +1 -1
- package/build/scrollable/hook.js +1 -1
- package/build/scrollable/hook.js.map +1 -1
- package/build/select-control/index.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/fill.js +11 -2
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/spacer/component.js +0 -1
- package/build/spacer/component.js.map +1 -1
- package/build/spinner/index.js +44 -5
- package/build/spinner/index.js.map +1 -1
- package/build/spinner/index.native.js +4 -2
- package/build/spinner/index.native.js.map +1 -1
- package/build/spinner/styles.js +56 -0
- package/build/spinner/styles.js.map +1 -0
- package/build/surface/hook.js +1 -1
- package/build/surface/hook.js.map +1 -1
- package/build/text/get-line-height.js +0 -1
- package/build/text/get-line-height.js.map +1 -1
- package/build/text/hook.js +5 -5
- package/build/text/hook.js.map +1 -1
- package/build/tip/index.js +4 -8
- package/build/tip/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +2 -12
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +3 -14
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option/component.js +0 -1
- package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option/styles.js +8 -8
- package/build/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
- package/build/tools-panel/styles.js +10 -10
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +0 -1
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +51 -44
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +0 -1
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/hook.js +3 -3
- package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-item/component.js +0 -1
- package/build/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +17 -9
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/tree-grid/index.js +19 -10
- package/build/tree-grid/index.js.map +1 -1
- package/build/truncate/hook.js +2 -2
- package/build/truncate/hook.js.map +1 -1
- package/build/ui/shortcut/component.js +0 -1
- package/build/ui/shortcut/component.js.map +1 -1
- package/build/ui/utils/font-size.js +0 -1
- package/build/ui/utils/font-size.js.map +1 -1
- package/build/ui/utils/get-valid-children.js +0 -1
- package/build/ui/utils/get-valid-children.js.map +1 -1
- package/build/unit-control/index.js +0 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/unit-select-control.js.map +1 -1
- package/build/utils/colors-values.js +6 -3
- package/build/utils/colors-values.js.map +1 -1
- package/build/utils/config-values.js +1 -4
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/hooks/use-combined-ref.js.map +1 -1
- package/build/utils/hooks/use-latest-ref.js +0 -1
- package/build/utils/hooks/use-latest-ref.js.map +1 -1
- package/build/z-stack/component.js +0 -1
- package/build/z-stack/component.js.map +1 -1
- package/build-module/base-control/index.js +3 -4
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/base-control/styles/base-control-styles.js +20 -12
- package/build-module/base-control/styles/base-control-styles.js.map +1 -1
- package/build-module/base-field/hook.js +1 -1
- package/build-module/base-field/hook.js.map +1 -1
- package/build-module/box-control/styles/box-control-styles.js +9 -9
- package/build-module/box-control/styles/box-control-styles.js.map +1 -1
- package/build-module/button/deprecated.js +2 -1
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/index.js +2 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/card/card/component.js +1 -1
- package/build-module/card/card/component.js.map +1 -1
- package/build-module/card/card/hook.js +1 -1
- package/build-module/card/card/hook.js.map +1 -1
- package/build-module/card/card-body/hook.js +1 -1
- package/build-module/card/card-body/hook.js.map +1 -1
- package/build-module/card/card-divider/hook.js +1 -1
- package/build-module/card/card-divider/hook.js.map +1 -1
- package/build-module/card/card-footer/hook.js +1 -1
- package/build-module/card/card-footer/hook.js.map +1 -1
- package/build-module/card/card-header/hook.js +1 -1
- package/build-module/card/card-header/hook.js.map +1 -1
- package/build-module/card/card-media/hook.js +1 -1
- package/build-module/card/card-media/hook.js.map +1 -1
- package/build-module/circular-option-picker/index.js +1 -0
- package/build-module/circular-option-picker/index.js.map +1 -1
- package/build-module/color-indicator/index.js +1 -0
- package/build-module/color-indicator/index.js.map +1 -1
- package/build-module/color-palette/index.js +4 -8
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +4 -2
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/color-display.js.map +1 -1
- package/build-module/color-picker/color-input.js.map +1 -1
- package/build-module/color-picker/component.js +2 -4
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/use-deprecated-props.js +3 -2
- package/build-module/color-picker/use-deprecated-props.js.map +1 -1
- package/build-module/confirm-dialog/component.js +6 -3
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/confirm-dialog/styles.js +25 -0
- package/build-module/confirm-dialog/styles.js.map +1 -0
- package/build-module/custom-gradient-bar/control-points.js +2 -3
- package/build-module/custom-gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-select-control/index.js +11 -2
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/date-time/time.js +1 -1
- package/build-module/date-time/time.js.map +1 -1
- package/build-module/divider/component.js +1 -1
- package/build-module/divider/component.js.map +1 -1
- package/build-module/dropdown/index.js +3 -3
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/elevation/hook.js +5 -5
- package/build-module/elevation/hook.js.map +1 -1
- package/build-module/external-link/styles/external-link-styles.js +5 -5
- package/build-module/external-link/styles/external-link-styles.js.map +1 -1
- package/build-module/flex/flex/hook.js +4 -4
- package/build-module/flex/flex/hook.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +73 -79
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/grid/hook.js +2 -2
- package/build-module/grid/hook.js.map +1 -1
- package/build-module/heading/component.js +0 -1
- package/build-module/heading/component.js.map +1 -1
- package/build-module/icon/index.js +0 -1
- package/build-module/icon/index.js.map +1 -1
- package/build-module/input-control/index.js +1 -1
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +0 -1
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/input-field.js +1 -1
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/reducer/actions.js +0 -1
- package/build-module/input-control/reducer/actions.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js +1 -1
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/reducer/state.js +0 -1
- package/build-module/input-control/reducer/state.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +32 -30
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/item-group/item/component.js +0 -1
- package/build-module/item-group/item/component.js.map +1 -1
- package/build-module/item-group/item/hook.js +1 -2
- package/build-module/item-group/item/hook.js.map +1 -1
- package/build-module/item-group/item-group/component.js +0 -1
- package/build-module/item-group/item-group/component.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js +3 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +5 -13
- 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 +23 -5
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +3 -3
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js +16 -13
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-text-input.native.js +2 -2
- package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +2 -0
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +5 -0
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/mobile/color-settings/utils.native.js +7 -3
- package/build-module/mobile/color-settings/utils.native.js.map +1 -1
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js +6 -6
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +2 -1
- package/build-module/mobile/link-picker/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-screen.native.js +13 -5
- package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
- package/build-module/mobile/link-settings/index.native.js +2 -1
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/mobile/readable-content-view/index.native.js +2 -2
- package/build-module/mobile/readable-content-view/index.native.js.map +1 -1
- package/build-module/mobile/utils/use-is-floating-keyboard.native.js +2 -2
- package/build-module/mobile/utils/use-is-floating-keyboard.native.js.map +1 -1
- package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js +7 -3
- package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build-module/modal/index.js +1 -11
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigator/context.js +5 -1
- package/build-module/navigator/context.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +43 -24
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +57 -32
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/use-navigator.js +8 -8
- package/build-module/navigator/use-navigator.js.map +1 -1
- package/build-module/notice/index.native.js +2 -2
- package/build-module/notice/index.native.js.map +1 -1
- package/build-module/palette-edit/index.js +38 -30
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/palette-edit/styles.js +11 -12
- package/build-module/palette-edit/styles.js.map +1 -1
- package/build-module/placeholder/index.js +4 -4
- package/build-module/placeholder/index.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +29 -29
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js +3 -3
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/label.js +0 -1
- package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build-module/sandbox/index.native.js +5 -5
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/scrollable/hook.js +1 -1
- package/build-module/scrollable/hook.js.map +1 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js +11 -2
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/spacer/component.js +0 -1
- package/build-module/spacer/component.js.map +1 -1
- package/build-module/spinner/index.js +40 -5
- package/build-module/spinner/index.js.map +1 -1
- package/build-module/spinner/index.native.js +4 -2
- package/build-module/spinner/index.native.js.map +1 -1
- package/build-module/spinner/styles.js +49 -0
- package/build-module/spinner/styles.js.map +1 -0
- package/build-module/surface/hook.js +1 -1
- package/build-module/surface/hook.js.map +1 -1
- package/build-module/text/get-line-height.js +0 -1
- package/build-module/text/get-line-height.js.map +1 -1
- package/build-module/text/hook.js +5 -5
- package/build-module/text/hook.js.map +1 -1
- package/build-module/tip/index.js +4 -8
- package/build-module/tip/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +2 -10
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +3 -11
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option/component.js +0 -1
- package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option/styles.js +8 -8
- package/build-module/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
- package/build-module/tools-panel/styles.js +10 -10
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +0 -1
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +52 -45
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +0 -1
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/hook.js +3 -3
- package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/component.js +0 -1
- package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +17 -9
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/tree-grid/index.js +18 -10
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/truncate/hook.js +2 -2
- package/build-module/truncate/hook.js.map +1 -1
- package/build-module/ui/shortcut/component.js +0 -1
- package/build-module/ui/shortcut/component.js.map +1 -1
- package/build-module/ui/utils/font-size.js +0 -1
- package/build-module/ui/utils/font-size.js.map +1 -1
- package/build-module/ui/utils/get-valid-children.js +0 -1
- package/build-module/ui/utils/get-valid-children.js.map +1 -1
- package/build-module/unit-control/index.js +0 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/unit-select-control.js +1 -2
- package/build-module/unit-control/unit-select-control.js.map +1 -1
- package/build-module/utils/colors-values.js +6 -3
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-module/utils/config-values.js +1 -4
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/hooks/use-combined-ref.js +0 -1
- package/build-module/utils/hooks/use-combined-ref.js.map +1 -1
- package/build-module/utils/hooks/use-latest-ref.js +0 -1
- package/build-module/utils/hooks/use-latest-ref.js.map +1 -1
- package/build-module/z-stack/component.js +0 -1
- package/build-module/z-stack/component.js.map +1 -1
- package/build-style/style-rtl.css +22 -6
- package/build-style/style.css +22 -6
- package/build-types/base-control/index.d.ts.map +1 -1
- package/build-types/base-control/styles/base-control-styles.d.ts +4 -0
- package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/card/types.d.ts.map +1 -1
- package/build-types/circular-option-picker/index.d.ts +31 -0
- package/build-types/circular-option-picker/index.d.ts.map +1 -0
- package/build-types/color-palette/index.d.ts +16 -0
- package/build-types/color-palette/index.d.ts.map +1 -0
- package/build-types/color-palette/styles.d.ts +8 -0
- package/build-types/color-palette/styles.d.ts.map +1 -0
- package/build-types/color-picker/color-display.d.ts +14 -0
- package/build-types/color-picker/color-display.d.ts.map +1 -0
- package/build-types/color-picker/color-input.d.ts +14 -0
- package/build-types/color-picker/color-input.d.ts.map +1 -0
- package/build-types/color-picker/component.d.ts +11 -0
- package/build-types/color-picker/component.d.ts.map +1 -0
- package/build-types/color-picker/hex-input.d.ts +13 -0
- package/build-types/color-picker/hex-input.d.ts.map +1 -0
- package/build-types/color-picker/hsl-input.d.ts +13 -0
- package/build-types/color-picker/hsl-input.d.ts.map +1 -0
- package/build-types/color-picker/index.d.ts +5 -0
- package/build-types/color-picker/index.d.ts.map +1 -0
- package/build-types/color-picker/input-with-slider.d.ts +12 -0
- package/build-types/color-picker/input-with-slider.d.ts.map +1 -0
- package/build-types/color-picker/legacy-adapter.d.ts +6 -0
- package/build-types/color-picker/legacy-adapter.d.ts.map +1 -0
- package/build-types/color-picker/picker.d.ts +10 -0
- package/build-types/color-picker/picker.d.ts.map +1 -0
- package/build-types/color-picker/rgb-input.d.ts +13 -0
- package/build-types/color-picker/rgb-input.d.ts.map +1 -0
- package/build-types/color-picker/styles.d.ts +76 -0
- package/build-types/color-picker/styles.d.ts.map +1 -0
- package/build-types/color-picker/types.d.ts +2 -0
- package/build-types/color-picker/types.d.ts.map +1 -0
- package/build-types/color-picker/use-deprecated-props.d.ts +49 -0
- package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -0
- package/build-types/confirm-dialog/component.d.ts +11 -14
- package/build-types/confirm-dialog/component.d.ts.map +1 -1
- package/build-types/confirm-dialog/styles.d.ts +10 -0
- package/build-types/confirm-dialog/styles.d.ts.map +1 -0
- package/build-types/confirm-dialog/types.d.ts.map +1 -1
- package/build-types/divider/component.d.ts.map +1 -1
- package/build-types/dropdown/index.d.ts +1 -13
- package/build-types/dropdown/index.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts.map +1 -1
- package/build-types/elevation/types.d.ts.map +1 -1
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/flex/types.d.ts.map +1 -1
- package/build-types/flyout/types.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts.map +1 -1
- package/build-types/grid/types.d.ts.map +1 -1
- package/build-types/h-stack/hook.d.ts +1 -1
- package/build-types/h-stack/hook.d.ts.map +1 -1
- package/build-types/h-stack/types.d.ts.map +1 -1
- package/build-types/heading/component.d.ts.map +1 -1
- package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
- package/build-types/icon/index.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-base.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/reducer/actions.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
- package/build-types/input-control/reducer/state.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/item-group/item/component.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts.map +1 -1
- package/build-types/item-group/item-group/component.d.ts.map +1 -1
- package/build-types/navigator/context.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts +16 -17
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +16 -16
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/types.d.ts +10 -9
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/resizable-box/index.d.ts +1 -1
- package/build-types/resizable-box/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +3 -2
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
- package/build-types/spacer/component.d.ts.map +1 -1
- package/build-types/spacer/types.d.ts.map +1 -1
- package/build-types/spinner/index.d.ts +18 -1
- package/build-types/spinner/index.d.ts.map +1 -1
- package/build-types/spinner/styles.d.ts +13 -0
- package/build-types/spinner/styles.d.ts.map +1 -0
- package/build-types/surface/hook.d.ts.map +1 -1
- package/build-types/text/get-line-height.d.ts.map +1 -1
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/text/types.d.ts.map +1 -1
- package/build-types/tip/index.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +0 -5
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/types.d.ts +1 -7
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/tools-panel/styles.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +8 -4
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +14 -0
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
- package/build-types/ui/control-group/types.d.ts.map +1 -1
- package/build-types/ui/form-group/types.d.ts.map +1 -1
- package/build-types/ui/shortcut/component.d.ts.map +1 -1
- package/build-types/ui/tooltip/types.d.ts.map +1 -1
- package/build-types/ui/utils/font-size.d.ts.map +1 -1
- package/build-types/ui/utils/get-valid-children.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +3 -2
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +2 -1
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/unit-control/unit-select-control.d.ts.map +1 -1
- package/build-types/utils/colors-values.d.ts +1 -0
- package/build-types/utils/colors-values.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +1 -5
- package/build-types/utils/config-values.d.ts.map +1 -1
- package/build-types/utils/hooks/use-combined-ref.d.ts.map +1 -1
- package/build-types/utils/hooks/use-latest-ref.d.ts.map +1 -1
- package/build-types/v-stack/types.d.ts.map +1 -1
- package/build-types/z-stack/component.d.ts.map +1 -1
- package/package.json +20 -17
- package/src/base-control/index.js +11 -2
- package/src/base-control/styles/base-control-styles.js +10 -1
- package/src/base-field/hook.js +1 -1
- package/src/box-control/styles/box-control-styles.js +1 -1
- package/src/button/deprecated.js +1 -0
- package/src/button/index.js +1 -0
- package/src/card/card/component.js +1 -1
- package/src/card/card/hook.js +1 -1
- package/src/card/card-body/hook.js +1 -1
- package/src/card/card-divider/hook.js +1 -1
- package/src/card/card-footer/hook.js +1 -1
- package/src/card/card-header/hook.js +1 -1
- package/src/card/card-media/hook.js +1 -1
- package/src/card/types.ts +0 -1
- package/src/circular-option-picker/index.js +1 -0
- package/src/color-indicator/README.md +28 -0
- package/src/color-indicator/index.js +2 -0
- package/src/color-indicator/style.scss +1 -1
- package/src/color-palette/index.js +7 -8
- package/src/color-palette/index.native.js +2 -0
- package/src/color-palette/style.scss +11 -3
- package/src/color-palette/test/__snapshots__/index.js.snap +0 -1
- package/src/color-picker/README.md +1 -1
- package/src/color-picker/color-display.tsx +1 -1
- package/src/color-picker/color-input.tsx +1 -1
- package/src/color-picker/component.tsx +3 -4
- package/src/color-picker/use-deprecated-props.ts +2 -1
- package/src/combobox-control/stories/index.js +6 -2
- package/src/combobox-control/style.scss +2 -2
- package/src/confirm-dialog/component.tsx +7 -4
- package/src/confirm-dialog/stories/index.js +5 -2
- package/src/confirm-dialog/styles.ts +18 -0
- package/src/confirm-dialog/types.ts +0 -1
- package/src/custom-gradient-bar/control-points.js +2 -3
- package/src/custom-gradient-picker/style.scss +0 -1
- package/src/custom-select-control/index.js +13 -1
- package/src/custom-select-control/stories/index.js +27 -0
- package/src/custom-select-control/test/index.js +46 -0
- package/src/date-time/README.md +4 -4
- package/src/date-time/test/time.js +2 -2
- package/src/date-time/time.js +2 -2
- package/src/dimension-control/README.md +2 -0
- package/src/divider/component.tsx +0 -1
- package/src/dropdown/index.js +14 -13
- package/src/elevation/hook.js +1 -0
- package/src/elevation/types.ts +0 -1
- package/src/external-link/styles/external-link-styles.js +3 -3
- package/src/flex/flex/hook.js +1 -0
- package/src/flex/types.ts +0 -1
- package/src/flyout/types.ts +0 -1
- package/src/form-token-field/style.scss +1 -1
- package/src/form-token-field/suggestions-list.js +109 -120
- package/src/form-token-field/test/index.js +4 -2
- package/src/gradient-picker/README.md +94 -0
- package/src/grid/hook.js +1 -0
- package/src/grid/types.ts +0 -1
- package/src/h-stack/types.ts +0 -1
- package/src/heading/component.tsx +0 -1
- package/src/icon/index.tsx +0 -1
- package/src/input-control/index.tsx +0 -1
- package/src/input-control/input-base.tsx +0 -1
- package/src/input-control/input-field.tsx +0 -1
- package/src/input-control/reducer/actions.ts +0 -1
- package/src/input-control/reducer/reducer.ts +0 -1
- package/src/input-control/reducer/state.ts +0 -1
- package/src/input-control/styles/input-control-styles.tsx +7 -7
- package/src/input-control/types.ts +0 -1
- package/src/item-group/item/component.tsx +0 -1
- package/src/item-group/item/hook.ts +1 -2
- package/src/item-group/item-group/component.tsx +0 -1
- package/src/item-group/stories/index.js +2 -2
- package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +2 -0
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +8 -14
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +33 -3
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +162 -0
- package/src/mobile/bottom-sheet/cell.native.js +8 -6
- package/src/mobile/bottom-sheet/index.native.js +24 -14
- package/src/mobile/bottom-sheet/link-suggestion-styles.native.scss +3 -0
- package/src/mobile/bottom-sheet/range-text-input.native.js +5 -2
- package/src/mobile/bottom-sheet/styles.native.scss +4 -0
- package/src/mobile/bottom-sheet/test/index.native.js +24 -0
- package/src/mobile/color-settings/index.native.js +2 -0
- package/src/mobile/color-settings/palette.screen.native.js +5 -0
- package/src/mobile/color-settings/utils.native.js +8 -3
- package/src/mobile/html-text-input/test/index.native.js +34 -35
- package/src/mobile/keyboard-avoiding-view/index.ios.js +12 -9
- package/src/mobile/link-picker/index.native.js +2 -1
- package/src/mobile/link-picker/link-picker-screen.native.js +13 -5
- package/src/mobile/link-settings/index.native.js +2 -1
- package/src/mobile/link-settings/test/edit.native.js +172 -236
- package/src/mobile/link-settings/test/link-settings-navigation.native.js +97 -0
- package/src/mobile/readable-content-view/index.native.js +5 -2
- package/src/mobile/utils/use-is-floating-keyboard.native.js +2 -5
- package/src/mobile/utils/use-unit-converter-to-mobile.native.js +11 -3
- package/src/modal/index.js +1 -10
- package/src/navigator/context.ts +5 -1
- package/src/navigator/navigator-provider/README.md +30 -20
- package/src/navigator/navigator-provider/component.tsx +69 -25
- package/src/navigator/navigator-screen/component.tsx +71 -34
- package/src/navigator/stories/index.js +26 -13
- package/src/navigator/test/index.js +167 -32
- package/src/navigator/types.ts +11 -11
- package/src/navigator/use-navigator.ts +4 -4
- package/src/notice/index.native.js +5 -2
- package/src/palette-edit/index.js +115 -75
- package/src/palette-edit/styles.js +22 -3
- package/src/placeholder/index.js +8 -6
- package/src/placeholder/style.scss +12 -0
- package/src/placeholder/test/index.js +18 -1
- package/src/range-control/styles/range-control-styles.js +1 -1
- package/src/resizable-box/index.tsx +0 -1
- package/src/resizable-box/resize-tooltip/index.tsx +1 -2
- package/src/resizable-box/resize-tooltip/label.tsx +0 -1
- package/src/sandbox/index.native.js +8 -5
- package/src/scrollable/hook.js +1 -1
- package/src/scrollable/stories/index.js +6 -3
- package/src/select-control/README.md +2 -2
- package/src/select-control/index.tsx +3 -2
- package/src/select-control/stories/index.js +1 -1
- package/src/slot-fill/bubbles-virtually/fill.js +12 -1
- package/src/spacer/component.tsx +0 -1
- package/src/spacer/types.ts +0 -1
- package/src/spinner/README.md +10 -10
- package/src/spinner/index.js +42 -3
- package/src/spinner/index.native.js +7 -2
- package/src/spinner/stories/index.js +36 -3
- package/src/spinner/styles.js +47 -0
- package/src/surface/hook.js +1 -0
- package/src/text/get-line-height.ts +0 -1
- package/src/text/hook.js +1 -0
- package/src/text/types.ts +0 -1
- package/src/tip/index.js +2 -4
- package/src/toggle-group-control/test/__snapshots__/index.js.snap +25 -27
- package/src/toggle-group-control/toggle-group-control/component.tsx +1 -12
- package/src/toggle-group-control/toggle-group-control/styles.ts +0 -14
- package/src/toggle-group-control/toggle-group-control-option/component.tsx +0 -1
- package/src/toggle-group-control/toggle-group-control-option/styles.ts +1 -3
- package/src/toggle-group-control/types.ts +1 -9
- package/src/tools-panel/stories/index.js +21 -1
- package/src/tools-panel/stories/tools-panel-with-item-group-slot.js +244 -0
- package/src/tools-panel/styles.ts +1 -3
- package/src/tools-panel/test/__snapshots__/index.js.snap +219 -0
- package/src/tools-panel/test/index.js +218 -20
- package/src/tools-panel/tools-panel/README.md +3 -2
- package/src/tools-panel/tools-panel/component.tsx +0 -1
- package/src/tools-panel/tools-panel/hook.ts +164 -97
- package/src/tools-panel/tools-panel-header/component.tsx +0 -1
- package/src/tools-panel/tools-panel-header/hook.ts +3 -3
- package/src/tools-panel/tools-panel-item/component.tsx +0 -1
- package/src/tools-panel/tools-panel-item/hook.ts +39 -8
- package/src/tools-panel/types.ts +14 -1
- package/src/tooltip/test/index.native.js +3 -1
- package/src/tree-grid/index.js +157 -126
- package/src/truncate/hook.js +1 -1
- package/src/ui/README.md +1 -1
- package/src/ui/context/wordpress-component.ts +0 -1
- package/src/ui/control-group/types.ts +0 -1
- package/src/ui/form-group/types.ts +0 -1
- package/src/ui/shortcut/component.tsx +0 -1
- package/src/ui/tooltip/types.ts +0 -1
- package/src/ui/utils/font-size.ts +0 -1
- package/src/ui/utils/get-valid-children.ts +0 -1
- package/src/unit-control/index.tsx +0 -1
- package/src/unit-control/types.ts +2 -2
- package/src/unit-control/unit-select-control.tsx +0 -1
- package/src/utils/colors-values.js +4 -3
- package/src/utils/config-values.js +1 -5
- package/src/utils/hooks/stories/use-cx.js +121 -44
- package/src/utils/hooks/use-combined-ref.ts +0 -1
- package/src/utils/hooks/use-latest-ref.ts +0 -1
- package/src/v-stack/types.ts +0 -1
- package/src/z-stack/component.tsx +0 -1
- package/tsconfig.json +3 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/spinner/styles/spinner-styles.js +0 -40
- package/build/spinner/styles/spinner-styles.js.map +0 -1
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +0 -90
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +0 -1
- package/build-module/spinner/styles/spinner-styles.js +0 -28
- package/build-module/spinner/styles/spinner-styles.js.map +0 -1
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +0 -86
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +0 -1
- package/build-types/spinner/styles/spinner-styles.d.ts +0 -5
- package/build-types/spinner/styles/spinner-styles.d.ts.map +0 -1
- package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts +0 -9
- package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +0 -1
- package/src/spinner/styles/spinner-styles.js +0 -47
- package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +0 -86
- package/src/ui/visually-hidden/README.md +0 -21
|
@@ -27,6 +27,7 @@ const BottomSheetNavigationScreen = ( {
|
|
|
27
27
|
fullScreen,
|
|
28
28
|
isScrollable,
|
|
29
29
|
isNested,
|
|
30
|
+
name,
|
|
30
31
|
} ) => {
|
|
31
32
|
const navigation = useNavigation();
|
|
32
33
|
const heightRef = useRef( { maxHeight: 0 } );
|
|
@@ -56,6 +57,25 @@ const BottomSheetNavigationScreen = ( {
|
|
|
56
57
|
onHandleHardwareButtonPress( null );
|
|
57
58
|
return false;
|
|
58
59
|
} );
|
|
60
|
+
/**
|
|
61
|
+
* TODO: onHandleHardwareButtonPress stores a single value, which means
|
|
62
|
+
* future invocations from sibling screens can replace the callback for
|
|
63
|
+
* the currently active screen. Currently, the empty dependency array
|
|
64
|
+
* passed to useCallback here is what prevents erroneous callback
|
|
65
|
+
* replacements, but leveraging memoization to achieve this is brittle and
|
|
66
|
+
* explicitly discouraged in the React documentation.
|
|
67
|
+
* https://reactjs.org/docs/hooks-reference.html#usememo
|
|
68
|
+
*
|
|
69
|
+
* Ideally, we refactor onHandleHardwareButtonPress to manage multiple
|
|
70
|
+
* callbacks triggered based upon which screen is currently active.
|
|
71
|
+
*
|
|
72
|
+
* Related: https://git.io/JD2no
|
|
73
|
+
*/
|
|
74
|
+
}, [] )
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
useFocusEffect(
|
|
78
|
+
useCallback( () => {
|
|
59
79
|
if ( fullScreen ) {
|
|
60
80
|
setHeight( '100%' );
|
|
61
81
|
setIsFullScreen( true );
|
|
@@ -64,8 +84,9 @@ const BottomSheetNavigationScreen = ( {
|
|
|
64
84
|
setHeight( heightRef.current.maxHeight );
|
|
65
85
|
}
|
|
66
86
|
return () => {};
|
|
67
|
-
}, [] )
|
|
87
|
+
}, [ setHeight ] )
|
|
68
88
|
);
|
|
89
|
+
|
|
69
90
|
const onLayout = ( { nativeEvent } ) => {
|
|
70
91
|
if ( fullScreen ) {
|
|
71
92
|
return;
|
|
@@ -77,13 +98,22 @@ const BottomSheetNavigationScreen = ( {
|
|
|
77
98
|
setHeightDebounce( height );
|
|
78
99
|
}
|
|
79
100
|
};
|
|
101
|
+
|
|
80
102
|
return useMemo( () => {
|
|
81
103
|
return isScrollable || isNested ? (
|
|
82
|
-
<View
|
|
104
|
+
<View
|
|
105
|
+
onLayout={ onLayout }
|
|
106
|
+
testID={ `navigation-screen-${ name }` }
|
|
107
|
+
>
|
|
108
|
+
{ children }
|
|
109
|
+
</View>
|
|
83
110
|
) : (
|
|
84
111
|
<ScrollView { ...listProps }>
|
|
85
112
|
<TouchableHighlight accessible={ false }>
|
|
86
|
-
<View
|
|
113
|
+
<View
|
|
114
|
+
onLayout={ onLayout }
|
|
115
|
+
testID={ `navigation-screen-${ name }` }
|
|
116
|
+
>
|
|
87
117
|
{ children }
|
|
88
118
|
{ ! isNested && (
|
|
89
119
|
<View
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { Text } from 'react-native';
|
|
5
|
+
import { render, fireEvent, waitFor, act } from 'test/helpers';
|
|
6
|
+
import { useNavigation } from '@react-navigation/native';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import NavigationContainer from '../navigation-container';
|
|
12
|
+
import NavigationScreen from '../navigation-screen';
|
|
13
|
+
import { performLayoutAnimation } from '../../../layout-animation';
|
|
14
|
+
|
|
15
|
+
jest.mock( '../../../layout-animation', () => ( {
|
|
16
|
+
performLayoutAnimation: jest.fn(),
|
|
17
|
+
} ) );
|
|
18
|
+
|
|
19
|
+
const TestScreen = ( { fullScreen, name, navigateTo } ) => {
|
|
20
|
+
const navigation = useNavigation();
|
|
21
|
+
return (
|
|
22
|
+
<NavigationScreen fullScreen={ fullScreen } name={ name }>
|
|
23
|
+
<Text onPress={ () => navigation.navigate( navigateTo ) }>
|
|
24
|
+
{ name }
|
|
25
|
+
</Text>
|
|
26
|
+
</NavigationScreen>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
jest.useFakeTimers( 'legacy' );
|
|
31
|
+
|
|
32
|
+
it( 'animates height transitioning from non-full-screen to full-screen', async () => {
|
|
33
|
+
const screen = render(
|
|
34
|
+
<NavigationContainer main animate>
|
|
35
|
+
<TestScreen name="test-screen-1" navigateTo="test-screen-2" />
|
|
36
|
+
<TestScreen
|
|
37
|
+
name="test-screen-2"
|
|
38
|
+
navigateTo="test-screen-1"
|
|
39
|
+
fullScreen
|
|
40
|
+
/>
|
|
41
|
+
</NavigationContainer>
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
// Await navigation screen to allow async state updates to complete
|
|
45
|
+
const navigationScreen = await waitFor( () =>
|
|
46
|
+
screen.getByTestId( 'navigation-screen-test-screen-1' )
|
|
47
|
+
);
|
|
48
|
+
// Trigger non-full-screen layout event
|
|
49
|
+
act( () => {
|
|
50
|
+
fireEvent( navigationScreen, 'layout', {
|
|
51
|
+
nativeEvent: {
|
|
52
|
+
layout: {
|
|
53
|
+
height: 123,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
} );
|
|
57
|
+
// Trigger debounced setting of height after layout event
|
|
58
|
+
jest.advanceTimersByTime( 10 );
|
|
59
|
+
} );
|
|
60
|
+
// Navigate to screen 2
|
|
61
|
+
fireEvent.press(
|
|
62
|
+
await waitFor( () => screen.getByText( /test-screen-1/ ) )
|
|
63
|
+
);
|
|
64
|
+
// Await navigation screen to allow async state updates to complete
|
|
65
|
+
await waitFor( () => screen.getByText( /test-screen-2/ ) );
|
|
66
|
+
|
|
67
|
+
expect( performLayoutAnimation ).toHaveBeenCalledTimes( 1 );
|
|
68
|
+
} );
|
|
69
|
+
|
|
70
|
+
it( 'animates height transitioning from full-screen to non-full-screen', async () => {
|
|
71
|
+
const screen = render(
|
|
72
|
+
<NavigationContainer main animate>
|
|
73
|
+
<TestScreen name="test-screen-1" navigateTo="test-screen-2" />
|
|
74
|
+
<TestScreen
|
|
75
|
+
name="test-screen-2"
|
|
76
|
+
navigateTo="test-screen-1"
|
|
77
|
+
fullScreen
|
|
78
|
+
/>
|
|
79
|
+
</NavigationContainer>
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
// Await navigation screen to allow async state updates to complete
|
|
83
|
+
const navigationScreen = await waitFor( () =>
|
|
84
|
+
screen.getByTestId( 'navigation-screen-test-screen-1' )
|
|
85
|
+
);
|
|
86
|
+
// Trigger non-full-screen layout event
|
|
87
|
+
act( () => {
|
|
88
|
+
fireEvent( navigationScreen, 'layout', {
|
|
89
|
+
nativeEvent: {
|
|
90
|
+
layout: {
|
|
91
|
+
height: 123,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
} );
|
|
95
|
+
// Trigger debounced setting of height after layout event
|
|
96
|
+
jest.advanceTimersByTime( 10 );
|
|
97
|
+
} );
|
|
98
|
+
// Navigate to screen 2
|
|
99
|
+
fireEvent.press(
|
|
100
|
+
await waitFor( () => screen.getByText( /test-screen-1/ ) )
|
|
101
|
+
);
|
|
102
|
+
// Navigate to screen 1
|
|
103
|
+
fireEvent.press(
|
|
104
|
+
// Use custom waitFor due to https://git.io/JYYGE
|
|
105
|
+
await waitFor( () => screen.getByText( /test-screen-2/ ) )
|
|
106
|
+
);
|
|
107
|
+
// Await navigation screen to allow async state updates to complete
|
|
108
|
+
await waitFor( () => screen.getByText( /test-screen-1/ ) );
|
|
109
|
+
|
|
110
|
+
expect( performLayoutAnimation ).toHaveBeenCalledTimes( 2 );
|
|
111
|
+
} );
|
|
112
|
+
|
|
113
|
+
it( 'does not animate height transitioning from full-screen to full-screen', async () => {
|
|
114
|
+
const screen = render(
|
|
115
|
+
<NavigationContainer main animate>
|
|
116
|
+
<TestScreen name="test-screen-1" navigateTo="test-screen-2" />
|
|
117
|
+
<TestScreen
|
|
118
|
+
name="test-screen-2"
|
|
119
|
+
navigateTo="test-screen-3"
|
|
120
|
+
fullScreen
|
|
121
|
+
/>
|
|
122
|
+
<TestScreen
|
|
123
|
+
name="test-screen-3"
|
|
124
|
+
navigateTo="test-screen-2"
|
|
125
|
+
fullScreen
|
|
126
|
+
/>
|
|
127
|
+
</NavigationContainer>
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
// Await navigation screen to allow async state updates to complete
|
|
131
|
+
const navigationScreen = await waitFor( () =>
|
|
132
|
+
screen.getByTestId( 'navigation-screen-test-screen-1' )
|
|
133
|
+
);
|
|
134
|
+
// Trigger non-full-screen layout event
|
|
135
|
+
act( () => {
|
|
136
|
+
fireEvent( navigationScreen, 'layout', {
|
|
137
|
+
nativeEvent: {
|
|
138
|
+
layout: {
|
|
139
|
+
height: 123,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
} );
|
|
143
|
+
// Trigger debounced setting of height after layout event
|
|
144
|
+
jest.advanceTimersByTime( 10 );
|
|
145
|
+
} );
|
|
146
|
+
// Navigate to screen 2
|
|
147
|
+
fireEvent.press(
|
|
148
|
+
await waitFor( () => screen.getByText( /test-screen-1/ ) )
|
|
149
|
+
);
|
|
150
|
+
// Navigate to screen 3
|
|
151
|
+
fireEvent.press(
|
|
152
|
+
await waitFor( () => screen.getByText( /test-screen-2/ ) )
|
|
153
|
+
);
|
|
154
|
+
// Navigate to screen 2
|
|
155
|
+
fireEvent.press(
|
|
156
|
+
await waitFor( () => screen.getByText( /test-screen-3/ ) )
|
|
157
|
+
);
|
|
158
|
+
// Await navigation screen to allow async state updates to complete
|
|
159
|
+
await waitFor( () => screen.getByText( /test-screen-2/ ) );
|
|
160
|
+
|
|
161
|
+
expect( performLayoutAnimation ).toHaveBeenCalledTimes( 1 );
|
|
162
|
+
} );
|
|
@@ -52,7 +52,7 @@ class BottomSheetCell extends Component {
|
|
|
52
52
|
|
|
53
53
|
componentDidMount() {
|
|
54
54
|
this.isCurrent = true;
|
|
55
|
-
AccessibilityInfo.addEventListener(
|
|
55
|
+
this.a11yInfoChangeSubscription = AccessibilityInfo.addEventListener(
|
|
56
56
|
'screenReaderChanged',
|
|
57
57
|
this.handleScreenReaderToggled
|
|
58
58
|
);
|
|
@@ -68,10 +68,7 @@ class BottomSheetCell extends Component {
|
|
|
68
68
|
|
|
69
69
|
componentWillUnmount() {
|
|
70
70
|
this.isCurrent = false;
|
|
71
|
-
|
|
72
|
-
'screenReaderChanged',
|
|
73
|
-
this.handleScreenReaderToggled
|
|
74
|
-
);
|
|
71
|
+
this.a11yInfoChangeSubscription.remove();
|
|
75
72
|
}
|
|
76
73
|
|
|
77
74
|
handleScreenReaderToggled( isScreenReaderEnabled ) {
|
|
@@ -359,7 +356,12 @@ class BottomSheetCell extends Component {
|
|
|
359
356
|
<View style={ rowContainerStyles }>
|
|
360
357
|
<View style={ styles.cellRowContainer }>
|
|
361
358
|
{ icon && (
|
|
362
|
-
<View
|
|
359
|
+
<View
|
|
360
|
+
style={ [
|
|
361
|
+
styles.cellRowContainer,
|
|
362
|
+
styles.cellRowIcon,
|
|
363
|
+
] }
|
|
364
|
+
>
|
|
363
365
|
<Icon
|
|
364
366
|
icon={ icon }
|
|
365
367
|
size={ 24 }
|
|
@@ -145,9 +145,13 @@ class BottomSheet extends Component {
|
|
|
145
145
|
} );
|
|
146
146
|
this.lastLayoutAnimation = layoutAnimation;
|
|
147
147
|
} else {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
// TODO: Reinstate animations, possibly replacing `LayoutAnimation` with
|
|
149
|
+
// more nuanced `Animated` usage or replacing our custom `BottomSheet`
|
|
150
|
+
// with `@gorhom/bottom-sheet`. This animation was disabled to avoid a
|
|
151
|
+
// preexisting bug: https://git.io/JMPCV
|
|
152
|
+
// this.performRegularLayoutAnimation( {
|
|
153
|
+
// useLastLayoutAnimation: false,
|
|
154
|
+
// } );
|
|
151
155
|
}
|
|
152
156
|
}
|
|
153
157
|
|
|
@@ -185,7 +189,10 @@ class BottomSheet extends Component {
|
|
|
185
189
|
);
|
|
186
190
|
}
|
|
187
191
|
|
|
188
|
-
Dimensions.addEventListener(
|
|
192
|
+
this.dimensionsChangeSubscription = Dimensions.addEventListener(
|
|
193
|
+
'change',
|
|
194
|
+
this.onDimensionsChange
|
|
195
|
+
);
|
|
189
196
|
|
|
190
197
|
// 'Will' keyboard events are not available on Android.
|
|
191
198
|
// Reference: https://reactnative.dev/docs/0.61/keyboard#addlistener
|
|
@@ -206,7 +213,7 @@ class BottomSheet extends Component {
|
|
|
206
213
|
}
|
|
207
214
|
|
|
208
215
|
componentWillUnmount() {
|
|
209
|
-
|
|
216
|
+
this.dimensionsChangeSubscription.remove();
|
|
210
217
|
this.keyboardShowListener.remove();
|
|
211
218
|
this.keyboardHideListener.remove();
|
|
212
219
|
if ( this.androidModalClosedSubscription ) {
|
|
@@ -217,10 +224,6 @@ class BottomSheet extends Component {
|
|
|
217
224
|
}
|
|
218
225
|
this.safeAreaEventSubscription.remove();
|
|
219
226
|
this.safeAreaEventSubscription = null;
|
|
220
|
-
SafeArea.removeEventListener(
|
|
221
|
-
'safeAreaInsetsForRootViewDidChange',
|
|
222
|
-
this.onSafeAreaInsetsUpdate
|
|
223
|
-
);
|
|
224
227
|
}
|
|
225
228
|
|
|
226
229
|
onSafeAreaInsetsUpdate( result ) {
|
|
@@ -254,16 +257,19 @@ class BottomSheet extends Component {
|
|
|
254
257
|
statusBarHeight -
|
|
255
258
|
this.headerHeight );
|
|
256
259
|
|
|
257
|
-
//
|
|
260
|
+
// In landscape orientation, set `maxHeight` to ~96% of the height
|
|
258
261
|
if ( width > height ) {
|
|
259
262
|
this.setState( {
|
|
260
|
-
maxHeight: Math.min(
|
|
263
|
+
maxHeight: Math.min(
|
|
264
|
+
0.96 * height - this.headerHeight,
|
|
265
|
+
maxHeightWithOpenKeyboard
|
|
266
|
+
),
|
|
261
267
|
} );
|
|
262
|
-
//
|
|
268
|
+
// In portrait orientation, set `maxHeight` to ~59% of the height
|
|
263
269
|
} else {
|
|
264
270
|
this.setState( {
|
|
265
271
|
maxHeight: Math.min(
|
|
266
|
-
height
|
|
272
|
+
height * 0.59 - safeAreaBottomInset - this.headerHeight,
|
|
267
273
|
maxHeightWithOpenKeyboard
|
|
268
274
|
),
|
|
269
275
|
} );
|
|
@@ -279,7 +285,10 @@ class BottomSheet extends Component {
|
|
|
279
285
|
const { height } = nativeEvent.layout;
|
|
280
286
|
// The layout animation should only be triggered if the header
|
|
281
287
|
// height has changed after being mounted.
|
|
282
|
-
if (
|
|
288
|
+
if (
|
|
289
|
+
this.headerHeight !== 0 &&
|
|
290
|
+
Math.round( height ) !== Math.round( this.headerHeight )
|
|
291
|
+
) {
|
|
283
292
|
this.performRegularLayoutAnimation( {
|
|
284
293
|
useLastLayoutAnimation: true,
|
|
285
294
|
} );
|
|
@@ -545,6 +554,7 @@ class BottomSheet extends Component {
|
|
|
545
554
|
<View
|
|
546
555
|
style={ styles.header }
|
|
547
556
|
onLayout={ this.onHeaderLayout }
|
|
557
|
+
testID={ `${ rest.testID || 'bottom-sheet' }-header` }
|
|
548
558
|
>
|
|
549
559
|
{ showDragIndicator() && (
|
|
550
560
|
<View style={ styles.dragIndicator } />
|
|
@@ -56,11 +56,14 @@ class RangeTextInput extends Component {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
componentDidMount() {
|
|
59
|
-
AppState.addEventListener(
|
|
59
|
+
this.appStateChangeSubscription = AppState.addEventListener(
|
|
60
|
+
'change',
|
|
61
|
+
this.handleChangePixelRatio
|
|
62
|
+
);
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
componentWillUnmount() {
|
|
63
|
-
|
|
66
|
+
this.appStateChangeSubscription.remove();
|
|
64
67
|
clearTimeout( this.timeoutAnnounceValue );
|
|
65
68
|
}
|
|
66
69
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { fireEvent, render } from 'test/helpers';
|
|
5
|
+
import { LayoutAnimation } from 'react-native';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import BottomSheet from '../';
|
|
11
|
+
|
|
12
|
+
it( 'does not animate transitions between header heights differing less than 1 pixel', () => {
|
|
13
|
+
const screen = render( <BottomSheet isVisible /> );
|
|
14
|
+
|
|
15
|
+
const bottomSheetHeader = screen.getByTestId( 'bottom-sheet-header' );
|
|
16
|
+
fireEvent( bottomSheetHeader, 'layout', {
|
|
17
|
+
nativeEvent: { layout: { height: 123 } },
|
|
18
|
+
} );
|
|
19
|
+
fireEvent( bottomSheetHeader, 'layout', {
|
|
20
|
+
nativeEvent: { layout: { height: 123.001 } },
|
|
21
|
+
} );
|
|
22
|
+
|
|
23
|
+
expect( LayoutAnimation.configureNext ).not.toHaveBeenCalled();
|
|
24
|
+
} );
|
|
@@ -27,6 +27,7 @@ const ColorSettingsMemo = memo(
|
|
|
27
27
|
colorValue,
|
|
28
28
|
gradientValue,
|
|
29
29
|
onGradientChange,
|
|
30
|
+
onColorCleared,
|
|
30
31
|
label,
|
|
31
32
|
hideNavigation,
|
|
32
33
|
} ) => {
|
|
@@ -44,6 +45,7 @@ const ColorSettingsMemo = memo(
|
|
|
44
45
|
colorValue,
|
|
45
46
|
gradientValue,
|
|
46
47
|
onGradientChange,
|
|
48
|
+
onColorCleared,
|
|
47
49
|
label,
|
|
48
50
|
hideNavigation,
|
|
49
51
|
} }
|
|
@@ -36,6 +36,7 @@ const PaletteScreen = () => {
|
|
|
36
36
|
label,
|
|
37
37
|
onColorChange,
|
|
38
38
|
onGradientChange,
|
|
39
|
+
onColorCleared,
|
|
39
40
|
colorValue,
|
|
40
41
|
defaultSettings,
|
|
41
42
|
hideNavigation = false,
|
|
@@ -85,6 +86,10 @@ const PaletteScreen = () => {
|
|
|
85
86
|
} else {
|
|
86
87
|
onGradientChange( '' );
|
|
87
88
|
}
|
|
89
|
+
|
|
90
|
+
if ( onColorCleared ) {
|
|
91
|
+
onColorCleared();
|
|
92
|
+
}
|
|
88
93
|
}
|
|
89
94
|
|
|
90
95
|
function onCustomPress() {
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
1
6
|
const gradients = {
|
|
2
7
|
linear: 'linear-gradient',
|
|
3
8
|
radial: 'radial-gradient',
|
|
4
9
|
};
|
|
5
10
|
|
|
6
11
|
const gradientOptions = [
|
|
7
|
-
{ label: 'Linear', value: gradients.linear },
|
|
8
|
-
{ label: 'Radial', value: gradients.radial },
|
|
12
|
+
{ label: __( 'Linear' ), value: gradients.linear },
|
|
13
|
+
{ label: __( 'Radial' ), value: gradients.radial },
|
|
9
14
|
];
|
|
10
15
|
|
|
11
16
|
const getGradientType = ( color ) => {
|
|
@@ -23,7 +28,7 @@ export const colorsUtils = {
|
|
|
23
28
|
picker: 'Picker',
|
|
24
29
|
palette: 'Palette',
|
|
25
30
|
},
|
|
26
|
-
segments: [ 'Solid', 'Gradient' ],
|
|
31
|
+
segments: [ __( 'Solid' ), __( 'Gradient' ) ],
|
|
27
32
|
gradients,
|
|
28
33
|
gradientOptions,
|
|
29
34
|
getGradientType,
|
|
@@ -1,31 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { render, fireEvent } from 'test/helpers';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { HTMLTextInput } from '..';
|
|
10
10
|
|
|
11
|
-
// Utility to find a TextInput in a ShallowWrapper
|
|
12
|
-
const findTextInputInWrapper = ( wrapper, accessibilityLabel ) => {
|
|
13
|
-
return wrapper
|
|
14
|
-
.dive()
|
|
15
|
-
.findWhere( ( node ) => {
|
|
16
|
-
return node.prop( 'accessibilityLabel' ) === accessibilityLabel;
|
|
17
|
-
} )
|
|
18
|
-
.first();
|
|
19
|
-
};
|
|
20
|
-
|
|
21
11
|
// Finds the Content TextInput in our HTMLInputView
|
|
22
|
-
const findContentTextInput = (
|
|
23
|
-
return
|
|
12
|
+
const findContentTextInput = ( screen ) => {
|
|
13
|
+
return screen.getByA11yLabel( 'html-view-content' );
|
|
24
14
|
};
|
|
25
15
|
|
|
26
16
|
// Finds the Title TextInput in our HTMLInputView
|
|
27
|
-
const findTitleTextInput = (
|
|
28
|
-
return
|
|
17
|
+
const findTitleTextInput = ( screen ) => {
|
|
18
|
+
return screen.getByA11yLabel( 'html-view-title' );
|
|
29
19
|
};
|
|
30
20
|
|
|
31
21
|
const getStylesFromColorScheme = () => {
|
|
@@ -34,42 +24,40 @@ const getStylesFromColorScheme = () => {
|
|
|
34
24
|
|
|
35
25
|
describe( 'HTMLTextInput', () => {
|
|
36
26
|
it( 'HTMLTextInput renders', () => {
|
|
37
|
-
const
|
|
27
|
+
const screen = render(
|
|
38
28
|
<HTMLTextInput
|
|
39
29
|
getStylesFromColorScheme={ getStylesFromColorScheme }
|
|
40
30
|
/>
|
|
41
31
|
);
|
|
42
|
-
expect(
|
|
32
|
+
expect( screen.container ).toBeTruthy();
|
|
43
33
|
} );
|
|
44
34
|
|
|
45
|
-
it( 'HTMLTextInput updates
|
|
35
|
+
it( 'HTMLTextInput updates state on HTML text change', () => {
|
|
46
36
|
const onChange = jest.fn();
|
|
47
37
|
|
|
48
|
-
const
|
|
38
|
+
const screen = render(
|
|
49
39
|
<HTMLTextInput
|
|
50
40
|
onChange={ onChange }
|
|
41
|
+
onPersist={ jest.fn() }
|
|
51
42
|
getStylesFromColorScheme={ getStylesFromColorScheme }
|
|
52
43
|
/>
|
|
53
44
|
);
|
|
54
45
|
|
|
55
|
-
expect( wrapper.instance().state.isDirty ).toBeFalsy();
|
|
56
|
-
|
|
57
46
|
// Simulate user typing text
|
|
58
|
-
const htmlTextInput = findContentTextInput(
|
|
59
|
-
|
|
47
|
+
const htmlTextInput = findContentTextInput( screen );
|
|
48
|
+
fireEvent( htmlTextInput, 'changeText', 'text' );
|
|
60
49
|
|
|
61
50
|
//Check if the onChange is called and the state is updated
|
|
62
51
|
expect( onChange ).toHaveBeenCalledTimes( 1 );
|
|
63
52
|
expect( onChange ).toHaveBeenCalledWith( 'text' );
|
|
64
53
|
|
|
65
|
-
expect(
|
|
66
|
-
expect( wrapper.instance().state.value ).toEqual( 'text' );
|
|
54
|
+
expect( screen.getByDisplayValue( 'text' ) ).toBeDefined();
|
|
67
55
|
} );
|
|
68
56
|
|
|
69
57
|
it( 'HTMLTextInput persists changes in HTML text input on blur', () => {
|
|
70
58
|
const onPersist = jest.fn();
|
|
71
59
|
|
|
72
|
-
const
|
|
60
|
+
const screen = render(
|
|
73
61
|
<HTMLTextInput
|
|
74
62
|
onPersist={ onPersist }
|
|
75
63
|
onChange={ jest.fn() }
|
|
@@ -78,30 +66,41 @@ describe( 'HTMLTextInput', () => {
|
|
|
78
66
|
);
|
|
79
67
|
|
|
80
68
|
// Simulate user typing text
|
|
81
|
-
const htmlTextInput = findContentTextInput(
|
|
82
|
-
|
|
69
|
+
const htmlTextInput = findContentTextInput( screen );
|
|
70
|
+
fireEvent( htmlTextInput, 'changeText', 'text' );
|
|
83
71
|
|
|
84
72
|
//Simulate blur event
|
|
85
|
-
|
|
73
|
+
fireEvent( htmlTextInput, 'blur' );
|
|
86
74
|
|
|
87
75
|
//Normally prop.value is updated with the help of withSelect
|
|
88
76
|
//But we don't have it in tests so we just simulate it
|
|
89
|
-
|
|
77
|
+
screen.update(
|
|
78
|
+
<HTMLTextInput
|
|
79
|
+
onPersist={ onPersist }
|
|
80
|
+
onChange={ jest.fn() }
|
|
81
|
+
getStylesFromColorScheme={ getStylesFromColorScheme }
|
|
82
|
+
value="text"
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
90
85
|
|
|
91
86
|
//Check if the onPersist is called and the state is updated
|
|
92
87
|
expect( onPersist ).toHaveBeenCalledTimes( 1 );
|
|
93
88
|
expect( onPersist ).toHaveBeenCalledWith( 'text' );
|
|
94
89
|
|
|
95
|
-
|
|
90
|
+
//Simulate blur event
|
|
91
|
+
fireEvent( htmlTextInput, 'blur' );
|
|
92
|
+
|
|
93
|
+
// Check that onPersist is not called for non-dirty state
|
|
94
|
+
expect( onPersist ).toHaveBeenCalledTimes( 1 );
|
|
96
95
|
|
|
97
96
|
//We expect state.value is getting propagated from prop.value
|
|
98
|
-
expect(
|
|
97
|
+
expect( screen.getByDisplayValue( 'text' ) ).toBeDefined();
|
|
99
98
|
} );
|
|
100
99
|
|
|
101
100
|
it( 'HTMLTextInput propagates title changes to store', () => {
|
|
102
101
|
const editTitle = jest.fn();
|
|
103
102
|
|
|
104
|
-
const
|
|
103
|
+
const screen = render(
|
|
105
104
|
<HTMLTextInput
|
|
106
105
|
editTitle={ editTitle }
|
|
107
106
|
getStylesFromColorScheme={ getStylesFromColorScheme }
|
|
@@ -109,8 +108,8 @@ describe( 'HTMLTextInput', () => {
|
|
|
109
108
|
);
|
|
110
109
|
|
|
111
110
|
// Simulate user typing text
|
|
112
|
-
const textInput = findTitleTextInput(
|
|
113
|
-
|
|
111
|
+
const textInput = findTitleTextInput( screen );
|
|
112
|
+
fireEvent( textInput, 'changeText', 'text' );
|
|
114
113
|
|
|
115
114
|
//Check if the setTitleAction is called
|
|
116
115
|
expect( editTitle ).toHaveBeenCalledTimes( 1 );
|
|
@@ -51,20 +51,23 @@ export const KeyboardAvoidingView = ( {
|
|
|
51
51
|
setSafeAreaBottomInset( safeAreaInsets.bottom );
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
|
-
SafeArea.addEventListener(
|
|
54
|
+
const safeAreaSubscription = SafeArea.addEventListener(
|
|
55
55
|
'safeAreaInsetsForRootViewDidChange',
|
|
56
56
|
onSafeAreaInsetsUpdate
|
|
57
57
|
);
|
|
58
|
-
Keyboard.addListener(
|
|
59
|
-
|
|
58
|
+
const keyboardShowSubscription = Keyboard.addListener(
|
|
59
|
+
'keyboardWillShow',
|
|
60
|
+
onKeyboardWillShow
|
|
61
|
+
);
|
|
62
|
+
const keyboardHideSubscription = Keyboard.addListener(
|
|
63
|
+
'keyboardWillHide',
|
|
64
|
+
onKeyboardWillHide
|
|
65
|
+
);
|
|
60
66
|
|
|
61
67
|
return () => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
);
|
|
66
|
-
Keyboard.removeListener( 'keyboardWillShow', onKeyboardWillShow );
|
|
67
|
-
Keyboard.removeListener( 'keyboardWillHide', onKeyboardWillHide );
|
|
68
|
+
safeAreaSubscription.remove();
|
|
69
|
+
keyboardShowSubscription.remove();
|
|
70
|
+
keyboardHideSubscription.remove();
|
|
68
71
|
};
|
|
69
72
|
}, [] );
|
|
70
73
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { SafeAreaView, TouchableOpacity, View } from 'react-native';
|
|
5
|
+
import Clipboard from '@react-native-clipboard/clipboard';
|
|
5
6
|
import { lowerCase, startsWith } from 'lodash';
|
|
6
7
|
|
|
7
8
|
/**
|