@wordpress/components 26.0.4 → 27.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/.stylelintrc.js +2 -2
- package/CHANGELOG.md +45 -0
- package/CONTRIBUTING.md +72 -0
- package/build/autocomplete/index.js +3 -8
- package/build/autocomplete/index.js.map +1 -1
- package/build/base-control/index.native.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/button/index.js +2 -2
- package/build/button/index.js.map +1 -1
- package/build/button/index.native.js.map +1 -1
- package/build/color-picker/component.js +10 -1
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/styles.js +8 -9
- package/build/color-picker/styles.js.map +1 -1
- package/build/combobox-control/index.js +4 -9
- package/build/combobox-control/index.js.map +1 -1
- package/build/confirm-dialog/component.js.map +1 -1
- package/build/custom-select-control/index.js +2 -15
- package/build/custom-select-control/index.js.map +1 -1
- package/build/custom-select-control-v2/custom-select-item.js +32 -0
- package/build/custom-select-control-v2/custom-select-item.js.map +1 -0
- package/build/custom-select-control-v2/custom-select.js +91 -0
- package/build/custom-select-control-v2/custom-select.js.map +1 -0
- package/build/custom-select-control-v2/default-component/index.js +41 -0
- package/build/custom-select-control-v2/default-component/index.js.map +1 -0
- package/build/custom-select-control-v2/index.js +13 -82
- package/build/custom-select-control-v2/index.js.map +1 -1
- package/build/custom-select-control-v2/legacy-component/index.js +123 -0
- package/build/custom-select-control-v2/legacy-component/index.js.map +1 -0
- package/build/custom-select-control-v2/styles.js +73 -50
- package/build/custom-select-control-v2/styles.js.map +1 -1
- package/build/custom-select-control-v2/types.js.map +1 -1
- package/build/draggable/index.native.js +2 -2
- package/build/draggable/index.native.js.map +1 -1
- package/build/dropdown-menu/index.native.js.map +1 -1
- package/build/flex/flex/hook.js +1 -1
- package/build/flex/flex/hook.js.map +1 -1
- package/build/font-size-picker/font-size-picker-select.js +0 -1
- package/build/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build/font-size-picker/index.native.js.map +1 -1
- package/build/form-token-field/index.js +3 -8
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +5 -12
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/h-stack/hook.js +6 -1
- package/build/h-stack/hook.js.map +1 -1
- package/build/mobile/bottom-sheet/button.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build/mobile/gradient/index.native.js.map +1 -1
- package/build/mobile/image/index.native.js +4 -13
- package/build/mobile/image/index.native.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js +1 -1
- package/build/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js.map +1 -1
- package/build/mobile/media-edit/index.native.js.map +1 -1
- package/build/modal/index.js +2 -10
- package/build/modal/index.js.map +1 -1
- package/build/palette-edit/index.js.map +1 -1
- package/build/progress-bar/styles.js +5 -5
- package/build/progress-bar/styles.js.map +1 -1
- package/build/query-controls/index.native.js.map +1 -1
- package/build/range-control/index.js.map +1 -1
- package/build/search-control/index.native.js.map +1 -1
- package/build/snackbar/index.js +3 -2
- package/build/snackbar/index.js.map +1 -1
- package/build/snackbar/list.js +2 -1
- package/build/snackbar/list.js.map +1 -1
- package/build/snackbar/types.js.map +1 -1
- package/build/tabs/index.js +7 -7
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/types.js.map +1 -1
- package/build/utils/hooks/index.js +0 -7
- package/build/utils/hooks/index.js.map +1 -1
- package/build/utils/with-ignore-ime-events.js +34 -0
- package/build/utils/with-ignore-ime-events.js.map +1 -0
- package/build-module/autocomplete/index.js +3 -8
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/base-control/index.native.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/button/index.js +2 -2
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/color-picker/component.js +11 -2
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/styles.js +8 -9
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/combobox-control/index.js +4 -9
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/custom-select-control/index.js +2 -15
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/custom-select-control-v2/custom-select-item.js +26 -0
- package/build-module/custom-select-control-v2/custom-select-item.js.map +1 -0
- package/build-module/custom-select-control-v2/custom-select.js +82 -0
- package/build-module/custom-select-control-v2/custom-select.js.map +1 -0
- package/build-module/custom-select-control-v2/default-component/index.js +30 -0
- package/build-module/custom-select-control-v2/default-component/index.js.map +1 -0
- package/build-module/custom-select-control-v2/index.js +2 -74
- package/build-module/custom-select-control-v2/index.js.map +1 -1
- package/build-module/custom-select-control-v2/legacy-component/index.js +111 -0
- package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -0
- package/build-module/custom-select-control-v2/styles.js +73 -42
- package/build-module/custom-select-control-v2/styles.js.map +1 -1
- package/build-module/custom-select-control-v2/types.js.map +1 -1
- package/build-module/draggable/index.native.js +2 -2
- package/build-module/draggable/index.native.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/flex/flex/hook.js +1 -1
- package/build-module/flex/flex/hook.js.map +1 -1
- package/build-module/font-size-picker/font-size-picker-select.js +0 -1
- package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build-module/font-size-picker/index.native.js.map +1 -1
- package/build-module/form-token-field/index.js +3 -8
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +5 -12
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/h-stack/hook.js +6 -1
- package/build-module/h-stack/hook.js.map +1 -1
- package/build-module/mobile/bottom-sheet/button.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- 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.map +1 -1
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/image/index.native.js +6 -15
- package/build-module/mobile/image/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js.map +1 -1
- package/build-module/mobile/media-edit/index.native.js.map +1 -1
- package/build-module/modal/index.js +3 -10
- package/build-module/modal/index.js.map +1 -1
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/progress-bar/styles.js +5 -5
- package/build-module/progress-bar/styles.js.map +1 -1
- package/build-module/query-controls/index.native.js.map +1 -1
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/search-control/index.native.js.map +1 -1
- package/build-module/snackbar/index.js +3 -2
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +2 -1
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/snackbar/types.js.map +1 -1
- package/build-module/tabs/index.js +7 -7
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/types.js.map +1 -1
- package/build-module/utils/hooks/index.js +0 -1
- package/build-module/utils/hooks/index.js.map +1 -1
- package/build-module/utils/with-ignore-ime-events.js +28 -0
- package/build-module/utils/with-ignore-ime-events.js.map +1 -0
- package/build-style/style-rtl.css +10 -2
- package/build-style/style.css +10 -2
- package/build-types/alignment-matrix-control/stories/index.story.d.ts +1 -1
- package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
- package/build-types/animate/stories/index.story.d.ts +7 -7
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/base-control/stories/index.story.d.ts +1 -1
- package/build-types/border-box-control/stories/index.story.d.ts +1 -1
- package/build-types/border-control/stories/index.story.d.ts +6 -6
- package/build-types/box-control/stories/index.story.d.ts +6 -6
- package/build-types/button/stories/e2e/index.story.d.ts +1 -1
- package/build-types/button/stories/index.story.d.ts +7 -7
- package/build-types/card/stories/index.story.d.ts +2 -2
- package/build-types/circular-option-picker/stories/index.story.d.ts +5 -5
- package/build-types/color-palette/stories/index.story.d.ts +3 -3
- package/build-types/color-picker/component.d.ts.map +1 -1
- package/build-types/color-picker/stories/index.story.d.ts +1 -1
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/combobox-control/index.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts +2 -2
- package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
- package/build-types/custom-gradient-picker/stories/index.story.d.ts +1 -1
- package/build-types/custom-select-control/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/custom-select-item.d.ts +9 -0
- package/build-types/custom-select-control-v2/custom-select-item.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/custom-select.d.ts +6 -0
- package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/default-component/index.d.ts +6 -0
- package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/index.d.ts +5 -6
- package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/legacy-component/index.d.ts +5 -0
- package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/legacy-component/test/index.d.ts +2 -0
- package/build-types/custom-select-control-v2/legacy-component/test/index.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/stories/default.story.d.ts +30 -0
- package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/stories/legacy.story.d.ts +12 -0
- package/build-types/custom-select-control-v2/stories/legacy.story.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/styles.d.ts +31 -6
- package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/types.d.ts +136 -14
- package/build-types/custom-select-control-v2/types.d.ts.map +1 -1
- package/build-types/dimension-control/stories/index.story.d.ts +2 -2
- package/build-types/drop-zone/stories/index.story.d.ts +1 -1
- package/build-types/dropdown/stories/index.story.d.ts +3 -3
- package/build-types/dropdown-menu/stories/index.story.d.ts +2 -2
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +1 -1
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +3 -3
- package/build-types/flex/flex/hook.d.ts +2 -3
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/focal-point-picker/stories/index.story.d.ts +4 -4
- package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
- package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
- package/build-types/gradient-picker/stories/index.story.d.ts +3 -3
- package/build-types/guide/stories/index.story.d.ts +1 -1
- package/build-types/h-stack/hook.d.ts +2 -4
- package/build-types/h-stack/hook.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts +4 -4
- package/build-types/input-control/stories/index.story.d.ts +6 -6
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts +1 -1
- package/build-types/menu-group/stories/index.story.d.ts +1 -1
- package/build-types/menu-item/stories/index.story.d.ts +4 -4
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/navigation/stories/index.story.d.ts +6 -6
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.d.ts +4 -4
- package/build-types/number-control/stories/index.story.d.ts +1 -1
- package/build-types/palette-edit/stories/index.story.d.ts +2 -2
- package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
- package/build-types/query-controls/stories/index.story.d.ts +1 -1
- package/build-types/radio-group/stories/index.story.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts +2 -2
- package/build-types/responsive-wrapper/stories/index.story.d.ts +1 -1
- package/build-types/sandbox/stories/index.story.d.ts +1 -1
- package/build-types/search-control/stories/index.story.d.ts +2 -2
- package/build-types/select-control/stories/index.story.d.ts +2 -2
- package/build-types/shortcut/stories/index.story.d.ts +1 -1
- package/build-types/snackbar/index.d.ts +5 -2
- package/build-types/snackbar/index.d.ts.map +1 -1
- package/build-types/snackbar/list.d.ts.map +1 -1
- package/build-types/snackbar/test/index.d.ts +2 -0
- package/build-types/snackbar/test/index.d.ts.map +1 -0
- package/build-types/snackbar/test/list.d.ts +2 -0
- package/build-types/snackbar/test/list.d.ts.map +1 -0
- package/build-types/snackbar/types.d.ts +18 -2
- package/build-types/snackbar/types.d.ts.map +1 -1
- package/build-types/tab-panel/stories/index.story.d.ts +4 -4
- package/build-types/tabs/index.d.ts +1 -1
- package/build-types/tabs/stories/index.story.d.ts +9 -9
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/types.d.ts +1 -1
- package/build-types/text/stories/index.story.d.ts +3 -3
- package/build-types/theme/stories/index.story.d.ts +1 -1
- package/build-types/theme/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-control/stories/index.story.d.ts +2 -2
- package/build-types/toolbar/stories/index.story.d.ts +3 -3
- package/build-types/tooltip/stories/index.story.d.ts +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts +1 -1
- package/build-types/tree-select/stories/index.story.d.ts +1 -1
- package/build-types/utils/hooks/index.d.ts +0 -1
- package/build-types/utils/with-ignore-ime-events.d.ts +15 -0
- package/build-types/utils/with-ignore-ime-events.d.ts.map +1 -0
- package/build-types/v-stack/hook.d.ts +2 -4
- package/build-types/v-stack/hook.d.ts.map +1 -1
- package/build-types/v-stack/stories/index.story.d.ts +1 -1
- package/package.json +19 -20
- package/src/alignment-matrix-control/test/index.tsx +3 -1
- package/src/autocomplete/index.tsx +3 -10
- package/src/base-control/index.native.js +1 -1
- package/src/base-control/test/index.tsx +1 -1
- package/src/border-box-control/border-box-control/component.tsx +1 -1
- package/src/border-box-control/border-box-control-split-controls/component.tsx +4 -4
- package/src/border-control/border-control-dropdown/component.tsx +1 -1
- package/src/button/index.native.js +1 -1
- package/src/button/index.tsx +1 -1
- package/src/button/style.scss +1 -3
- package/src/circular-option-picker/test/index.tsx +6 -5
- package/src/color-picker/component.tsx +22 -11
- package/src/color-picker/styles.ts +1 -15
- package/src/combobox-control/index.tsx +33 -41
- package/src/combobox-control/test/index.tsx +1 -1
- package/src/composite/legacy/test/index.tsx +18 -2
- package/src/confirm-dialog/component.tsx +1 -1
- package/src/confirm-dialog/test/index.tsx +5 -21
- package/src/custom-select-control/README.md +0 -10
- package/src/custom-select-control/index.js +3 -22
- package/src/custom-select-control/stories/index.story.js +0 -1
- package/src/custom-select-control/test/index.js +17 -17
- package/src/custom-select-control-v2/README.md +97 -7
- package/src/custom-select-control-v2/custom-select-item.tsx +29 -0
- package/src/custom-select-control-v2/custom-select.tsx +122 -0
- package/src/custom-select-control-v2/default-component/index.tsx +27 -0
- package/src/custom-select-control-v2/index.tsx +2 -102
- package/src/custom-select-control-v2/legacy-component/index.tsx +133 -0
- package/src/custom-select-control-v2/legacy-component/test/index.tsx +457 -0
- package/src/custom-select-control-v2/stories/{index.story.tsx → default.story.tsx} +27 -33
- package/src/custom-select-control-v2/stories/legacy.story.tsx +87 -0
- package/src/custom-select-control-v2/styles.ts +82 -38
- package/src/custom-select-control-v2/test/index.tsx +207 -17
- package/src/custom-select-control-v2/types.ts +147 -20
- package/src/disabled/test/index.tsx +1 -1
- package/src/draggable/index.native.js +2 -2
- package/src/draggable/test/index.native.js +6 -2
- package/src/dropdown-menu/index.native.js +2 -2
- package/src/dropdown-menu-v2/stories/index.story.tsx +1 -0
- package/src/dropdown-menu-v2/test/index.tsx +4 -1
- package/src/flex/flex/hook.ts +1 -1
- package/src/font-size-picker/font-size-picker-select.tsx +0 -1
- package/src/font-size-picker/index.native.js +2 -2
- package/src/form-token-field/index.tsx +4 -11
- package/src/form-token-field/suggestions-list.tsx +5 -17
- package/src/h-stack/hook.tsx +2 -1
- package/src/h-stack/test/index.tsx +10 -0
- package/src/item-group/test/index.js +2 -2
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +10 -15
- package/src/mobile/bottom-sheet/button.native.js +1 -5
- package/src/mobile/bottom-sheet/index.native.js +2 -2
- package/src/mobile/bottom-sheet/range-cell.native.js +1 -1
- package/src/mobile/bottom-sheet/stepper-cell/index.native.js +2 -2
- 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/mobile/gradient/index.native.js +1 -1
- package/src/mobile/image/index.native.js +8 -23
- package/src/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js +1 -1
- package/src/mobile/media-edit/index.native.js +1 -1
- package/src/modal/index.tsx +2 -12
- package/src/modal/style.scss +1 -0
- package/src/modal/test/index.tsx +1 -1
- package/src/navigation/stories/utils/hide-if-empty.tsx +2 -6
- package/src/palette-edit/index.tsx +2 -2
- package/src/popover/test/index.tsx +1 -4
- package/src/progress-bar/stories/index.story.tsx +1 -0
- package/src/progress-bar/styles.ts +2 -2
- package/src/query-controls/index.native.js +2 -2
- package/src/radio-group/stories/index.story.tsx +1 -0
- package/src/range-control/index.tsx +3 -3
- package/src/range-control/test/index.tsx +2 -2
- package/src/search-control/index.native.js +1 -1
- package/src/snackbar/index.tsx +5 -2
- package/src/snackbar/list.tsx +6 -1
- package/src/snackbar/stories/list.story.tsx +0 -3
- package/src/snackbar/test/index.tsx +267 -0
- package/src/snackbar/test/list.tsx +46 -0
- package/src/snackbar/types.ts +31 -3
- package/src/tab-panel/test/index.tsx +8 -1
- package/src/tabs/README.md +18 -18
- package/src/tabs/index.tsx +7 -7
- package/src/tabs/stories/index.story.tsx +2 -1
- package/src/tabs/test/index.tsx +66 -36
- package/src/tabs/types.ts +1 -1
- package/src/theme/stories/index.story.tsx +1 -0
- package/src/toggle-group-control/test/index.tsx +5 -1
- package/src/toolbar/toolbar-group/style.scss +1 -0
- package/src/tools-panel/stories/index.story.tsx +8 -8
- package/src/tools-panel/test/index.tsx +10 -28
- package/src/tooltip/style.scss +2 -1
- package/src/tooltip/test/index.native.js +3 -3
- package/src/tooltip/test/index.tsx +5 -0
- package/src/tree-grid/test/index.tsx +1 -1
- package/src/utils/hooks/index.js +0 -1
- package/src/utils/with-ignore-ime-events.ts +32 -0
- package/src/v-stack/test/index.tsx +10 -0
- package/tsconfig.json +0 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/custom-select-control/styles.js +0 -27
- package/build/custom-select-control/styles.js.map +0 -1
- package/build/utils/hooks/use-latest-ref.js +0 -33
- package/build/utils/hooks/use-latest-ref.js.map +0 -1
- package/build-module/custom-select-control/styles.js +0 -18
- package/build-module/custom-select-control/styles.js.map +0 -1
- package/build-module/utils/hooks/use-latest-ref.js +0 -27
- package/build-module/utils/hooks/use-latest-ref.js.map +0 -1
- package/build-types/custom-select-control/styles.d.ts +0 -11
- package/build-types/custom-select-control/styles.d.ts.map +0 -1
- package/build-types/custom-select-control-v2/stories/index.story.d.ts +0 -20
- package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +0 -1
- package/build-types/utils/hooks/use-latest-ref.d.ts +0 -15
- package/build-types/utils/hooks/use-latest-ref.d.ts.map +0 -1
- package/src/custom-select-control/styles.ts +0 -28
- package/src/utils/hooks/test/use-latest-ref.js +0 -119
- package/src/utils/hooks/use-latest-ref.ts +0 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Dimensions","Keyboard","LayoutAnimation","PanResponder","Platform","ScrollView","StatusBar","Text","TouchableHighlight","View","Modal","SafeArea","subscribeAndroidModalClosed","showAndroidSoftKeyboard","Component","withPreferredColorScheme","styles","Button","Cell","CyclePickerCell","PickerCell","SwitchCell","RangeCell","ColorCell","LinkCell","LinkSuggestionItemCell","RadioCell","NavigationScreen","NavigationContainer","KeyboardAvoidingView","BottomSheetSubSheet","NavBar","BottomSheetProvider","DEFAULT_LAYOUT_ANIMATION","Presets","easeInEaseOut","BottomSheet","constructor","arguments","onSafeAreaInsetsUpdate","bind","onScroll","isScrolling","onShouldEnableScroll","onDismiss","onShouldSetBottomSheetMaxHeight","setIsFullScreen","onDimensionsChange","onHeaderLayout","onCloseBottomSheet","onHandleClosingBottomSheet","onHardwareButtonPress","onHandleHardwareButtonPress","keyboardShow","keyboardHide","headerHeight","keyboardHeight","lastLayoutAnimation","lastLayoutAnimationFinished","state","safeAreaBottomInset","safeAreaTopInset","bounces","maxHeight","scrollEnabled","handleClosingBottomSheet","handleHardwareButtonPress","isMaxHeightSet","isFullScreen","props","e","isVisible","height","endCoordinates","performKeyboardLayoutAnimation","onSetMaxHeight","onKeyboardShow","onKeyboardHide","event","duration","easing","animationConfig","type","Types","layoutAnimation","update","create","property","Properties","opacity","delete","configureNext","performRegularLayoutAnimation","useLastLayoutAnimation","OS","componentDidMount","getSafeAreaInsetsForRootView","then","androidModalClosedSubscription","onClose","dimensionsChangeSubscription","addEventListener","keyboardShowListener","addListener","keyboardHideListener","safeAreaEventSubscription","componentWillUnmount","remove","result","safeAreaInsets","bottom","top","setState","width","get","statusBarHeight","currentHeight","maxHeightWithOpenKeyboard","Math","min","nativeEvent","layout","round","isCloseToBottom","layoutMeasurement","contentOffset","contentSize","y","isCloseToTop","value","action","getContentStyle","paddingBottom","scrollableContent","render","title","leftButton","rightButton","header","hideHeader","style","contentStyle","getStylesFromColorScheme","children","withHeaderSeparator","hasNavigation","rest","panResponder","onMoveShouldSetPanResponder","evt","gestureState","dy","backgroundStyle","background","backgroundDark","bottomSheetHeaderTitleStyle","bottomSheetHeaderTitle","bottomSheetHeaderTitleDark","listStyle","flexGrow","flexShrink","setMinHeightToMaxHeight","minHeight","listProps","disableScrollViewPanResponder","onScrollBeginDrag","onScrollEndDrag","scrollEventThrottle","contentContainerStyle","content","emptyHeader","automaticallyAdjustContentInsets","WrapperView","getHeader","createElement","Fragment","bottomSheetHeader","flex","maxFontSizeMultiplier","separator","showDragIndicator","allowDragIndicator","bottomModal","animationInTiming","animationOutTiming","backdropTransitionInTiming","backdropTransitionOutTiming","backdropOpacity","onBackdropPress","onBackButtonPress","onSwipeComplete","undefined","onModalHide","swipeDirection","onMoveShouldSetResponder","panHandlers","onMoveShouldSetResponderCapture","onAccessibilityEscape","testID","hardwareAccelerated","useNativeDriverForBackdrop","behavior","borderColor","marginTop","backgroundFullScreen","keyboardVerticalOffset","onLayout","dragIndicator","shouldEnableBottomSheetScroll","shouldEnableBottomSheetMaxHeight","isBottomSheetContentScrolling","accessible","getWidth","maxWidth","ThemedBottomSheet","SubSheet"],"sources":["@wordpress/components/src/mobile/bottom-sheet/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tDimensions,\n\tKeyboard,\n\tLayoutAnimation,\n\tPanResponder,\n\tPlatform,\n\tScrollView,\n\tStatusBar,\n\tText,\n\tTouchableHighlight,\n\tView,\n} from 'react-native';\nimport Modal from 'react-native-modal';\nimport SafeArea from 'react-native-safe-area';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tsubscribeAndroidModalClosed,\n\tshowAndroidSoftKeyboard,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport Button from './button';\nimport Cell from './cell';\nimport CyclePickerCell from './cycle-picker-cell';\nimport PickerCell from './picker-cell';\nimport SwitchCell from './switch-cell';\nimport RangeCell from './range-cell';\nimport ColorCell from './color-cell';\nimport LinkCell from './link-cell';\nimport LinkSuggestionItemCell from './link-suggestion-item-cell';\nimport RadioCell from './radio-cell';\nimport NavigationScreen from './bottom-sheet-navigation/navigation-screen';\nimport NavigationContainer from './bottom-sheet-navigation/navigation-container';\nimport KeyboardAvoidingView from './keyboard-avoiding-view';\nimport BottomSheetSubSheet from './sub-sheet';\nimport NavBar from './nav-bar';\nimport { BottomSheetProvider } from './bottom-sheet-context';\n\nconst DEFAULT_LAYOUT_ANIMATION = LayoutAnimation.Presets.easeInEaseOut;\n\nclass BottomSheet extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.onSafeAreaInsetsUpdate = this.onSafeAreaInsetsUpdate.bind( this );\n\t\tthis.onScroll = this.onScroll.bind( this );\n\t\tthis.isScrolling = this.isScrolling.bind( this );\n\t\tthis.onShouldEnableScroll = this.onShouldEnableScroll.bind( this );\n\t\tthis.onDismiss = this.onDismiss.bind( this );\n\t\tthis.onShouldSetBottomSheetMaxHeight =\n\t\t\tthis.onShouldSetBottomSheetMaxHeight.bind( this );\n\n\t\tthis.setIsFullScreen = this.setIsFullScreen.bind( this );\n\n\t\tthis.onDimensionsChange = this.onDimensionsChange.bind( this );\n\t\tthis.onHeaderLayout = this.onHeaderLayout.bind( this );\n\t\tthis.onCloseBottomSheet = this.onCloseBottomSheet.bind( this );\n\t\tthis.onHandleClosingBottomSheet =\n\t\t\tthis.onHandleClosingBottomSheet.bind( this );\n\t\tthis.onHardwareButtonPress = this.onHardwareButtonPress.bind( this );\n\t\tthis.onHandleHardwareButtonPress =\n\t\t\tthis.onHandleHardwareButtonPress.bind( this );\n\t\tthis.keyboardShow = this.keyboardShow.bind( this );\n\t\tthis.keyboardHide = this.keyboardHide.bind( this );\n\n\t\tthis.headerHeight = 0;\n\t\tthis.keyboardHeight = 0;\n\t\tthis.lastLayoutAnimation = null;\n\t\tthis.lastLayoutAnimationFinished = false;\n\n\t\tthis.state = {\n\t\t\tsafeAreaBottomInset: 0,\n\t\t\tsafeAreaTopInset: 0,\n\t\t\tbounces: false,\n\t\t\tmaxHeight: 0,\n\t\t\tscrollEnabled: true,\n\t\t\tisScrolling: false,\n\t\t\thandleClosingBottomSheet: null,\n\t\t\thandleHardwareButtonPress: null,\n\t\t\tisMaxHeightSet: true,\n\t\t\tisFullScreen: this.props.isFullScreen || false,\n\t\t};\n\t}\n\n\tkeyboardShow( e ) {\n\t\tif ( ! this.props.isVisible ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { height } = e.endCoordinates;\n\t\tthis.keyboardHeight = height;\n\t\tthis.performKeyboardLayoutAnimation( e );\n\t\tthis.onSetMaxHeight();\n\t\tthis.props.onKeyboardShow?.();\n\t}\n\n\tkeyboardHide( e ) {\n\t\tif ( ! this.props.isVisible ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.keyboardHeight = 0;\n\t\tthis.performKeyboardLayoutAnimation( e );\n\t\tthis.onSetMaxHeight();\n\t\tthis.props.onKeyboardHide?.();\n\t}\n\n\tperformKeyboardLayoutAnimation( event ) {\n\t\tconst { duration, easing } = event;\n\n\t\tif ( duration && easing ) {\n\t\t\t// This layout animation is the same as the React Native's KeyboardAvoidingView component.\n\t\t\t// Reference: https://github.com/facebook/react-native/blob/266b21baf35e052ff28120f79c06c4f6dddc51a9/Libraries/Components/Keyboard/KeyboardAvoidingView.js#L119-L128.\n\t\t\tconst animationConfig = {\n\t\t\t\t// We have to pass the duration equal to minimal accepted duration defined here: RCTLayoutAnimation.m.\n\t\t\t\tduration: duration > 10 ? duration : 10,\n\t\t\t\ttype: LayoutAnimation.Types[ easing ] || 'keyboard',\n\t\t\t};\n\t\t\tconst layoutAnimation = {\n\t\t\t\tduration: animationConfig.duration,\n\t\t\t\tupdate: animationConfig,\n\t\t\t\tcreate: {\n\t\t\t\t\t...animationConfig,\n\t\t\t\t\tproperty: LayoutAnimation.Properties.opacity,\n\t\t\t\t},\n\t\t\t\tdelete: {\n\t\t\t\t\t...animationConfig,\n\t\t\t\t\tproperty: LayoutAnimation.Properties.opacity,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.lastLayoutAnimationFinished = false;\n\t\t\tLayoutAnimation.configureNext( layoutAnimation, () => {\n\t\t\t\tthis.lastLayoutAnimationFinished = true;\n\t\t\t} );\n\t\t\tthis.lastLayoutAnimation = layoutAnimation;\n\t\t} else {\n\t\t\t// TODO: Reinstate animations, possibly replacing `LayoutAnimation` with\n\t\t\t// more nuanced `Animated` usage or replacing our custom `BottomSheet`\n\t\t\t// with `@gorhom/bottom-sheet`. This animation was disabled to avoid a\n\t\t\t// preexisting bug: https://github.com/WordPress/gutenberg/issues/30562\n\t\t\t// this.performRegularLayoutAnimation( {\n\t\t\t// \tuseLastLayoutAnimation: false,\n\t\t\t// } );.\n\t\t}\n\t}\n\n\tperformRegularLayoutAnimation( { useLastLayoutAnimation } ) {\n\t\t// On Android, we should prevent triggering multiple layout animations at the same time because it can produce visual glitches.\n\t\tif (\n\t\t\tPlatform.OS === 'android' &&\n\t\t\tthis.lastLayoutAnimation &&\n\t\t\t! this.lastLayoutAnimationFinished\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst layoutAnimation = useLastLayoutAnimation\n\t\t\t? this.lastLayoutAnimation || DEFAULT_LAYOUT_ANIMATION\n\t\t\t: DEFAULT_LAYOUT_ANIMATION;\n\n\t\tthis.lastLayoutAnimationFinished = false;\n\t\tLayoutAnimation.configureNext( layoutAnimation, () => {\n\t\t\tthis.lastLayoutAnimationFinished = true;\n\t\t} );\n\t\tthis.lastLayoutAnimation = layoutAnimation;\n\t}\n\n\tcomponentDidMount() {\n\t\tSafeArea.getSafeAreaInsetsForRootView().then(\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\n\t\tif ( Platform.OS === 'android' ) {\n\t\t\tthis.androidModalClosedSubscription = subscribeAndroidModalClosed(\n\t\t\t\t() => {\n\t\t\t\t\tthis.props.onClose();\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tthis.dimensionsChangeSubscription = Dimensions.addEventListener(\n\t\t\t'change',\n\t\t\tthis.onDimensionsChange\n\t\t);\n\n\t\t// 'Will' keyboard events are not available on Android.\n\t\t// Reference: https://reactnative.dev/docs/0.61/keyboard#addlistener.\n\t\tthis.keyboardShowListener = Keyboard.addListener(\n\t\t\tPlatform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow',\n\t\t\tthis.keyboardShow\n\t\t);\n\t\tthis.keyboardHideListener = Keyboard.addListener(\n\t\t\tPlatform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide',\n\t\t\tthis.keyboardHide\n\t\t);\n\n\t\tthis.safeAreaEventSubscription = SafeArea.addEventListener(\n\t\t\t'safeAreaInsetsForRootViewDidChange',\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t\tthis.onSetMaxHeight();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.dimensionsChangeSubscription.remove();\n\t\tthis.keyboardShowListener.remove();\n\t\tthis.keyboardHideListener.remove();\n\t\tif ( this.androidModalClosedSubscription ) {\n\t\t\tthis.androidModalClosedSubscription.remove();\n\t\t}\n\n\t\tif ( this.props.isVisible ) {\n\t\t\tshowAndroidSoftKeyboard();\n\t\t}\n\n\t\tif ( this.safeAreaEventSubscription === null ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.safeAreaEventSubscription.remove();\n\t\tthis.safeAreaEventSubscription = null;\n\t}\n\n\tonSafeAreaInsetsUpdate( result ) {\n\t\tconst { safeAreaBottomInset, safeAreaTopInset } = this.state;\n\t\tif ( this.safeAreaEventSubscription === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { safeAreaInsets } = result;\n\t\tif (\n\t\t\tsafeAreaBottomInset !== safeAreaInsets.bottom ||\n\t\t\tsafeAreaTopInset !== safeAreaInsets.top\n\t\t) {\n\t\t\tthis.setState( {\n\t\t\t\tsafeAreaBottomInset: safeAreaInsets.bottom,\n\t\t\t\tsafeAreaTopInset: safeAreaInsets.top,\n\t\t\t} );\n\t\t}\n\t}\n\n\tonSetMaxHeight() {\n\t\tconst { height, width } = Dimensions.get( 'window' );\n\t\tconst { safeAreaBottomInset } = this.state;\n\t\tconst statusBarHeight =\n\t\t\tPlatform.OS === 'android' ? StatusBar.currentHeight : 0;\n\n\t\t// `maxHeight` when modal is opened along with a keyboard.\n\t\tconst maxHeightWithOpenKeyboard =\n\t\t\t0.95 *\n\t\t\t( Dimensions.get( 'window' ).height -\n\t\t\t\tthis.keyboardHeight -\n\t\t\t\tstatusBarHeight -\n\t\t\t\tthis.headerHeight );\n\n\t\t// In landscape orientation, set `maxHeight` to ~96% of the height.\n\t\tif ( width > height ) {\n\t\t\tthis.setState( {\n\t\t\t\tmaxHeight: Math.min(\n\t\t\t\t\t0.96 * height - this.headerHeight,\n\t\t\t\t\tmaxHeightWithOpenKeyboard\n\t\t\t\t),\n\t\t\t} );\n\t\t\t// In portrait orientation, set `maxHeight` to ~59% of the height.\n\t\t} else {\n\t\t\tthis.setState( {\n\t\t\t\tmaxHeight: Math.min(\n\t\t\t\t\theight * 0.59 - safeAreaBottomInset - this.headerHeight,\n\t\t\t\t\tmaxHeightWithOpenKeyboard\n\t\t\t\t),\n\t\t\t} );\n\t\t}\n\t}\n\n\tonDimensionsChange() {\n\t\tthis.onSetMaxHeight();\n\t\tthis.setState( { bounces: false } );\n\t}\n\n\tonHeaderLayout( { nativeEvent } ) {\n\t\tconst { height } = nativeEvent.layout;\n\t\t// The layout animation should only be triggered if the header\n\t\t// height has changed after being mounted.\n\t\tif (\n\t\t\tthis.headerHeight !== 0 &&\n\t\t\tMath.round( height ) !== Math.round( this.headerHeight )\n\t\t) {\n\t\t\tthis.performRegularLayoutAnimation( {\n\t\t\t\tuseLastLayoutAnimation: true,\n\t\t\t} );\n\t\t}\n\t\tthis.headerHeight = height;\n\t\tthis.onSetMaxHeight();\n\t}\n\n\tisCloseToBottom( { layoutMeasurement, contentOffset, contentSize } ) {\n\t\treturn (\n\t\t\tlayoutMeasurement.height + contentOffset.y >=\n\t\t\tcontentSize.height - contentOffset.y\n\t\t);\n\t}\n\n\tisCloseToTop( { contentOffset } ) {\n\t\treturn contentOffset.y < 10;\n\t}\n\n\tonScroll( { nativeEvent } ) {\n\t\tif ( this.isCloseToTop( nativeEvent ) ) {\n\t\t\tthis.setState( { bounces: false } );\n\t\t} else {\n\t\t\tthis.setState( { bounces: true } );\n\t\t}\n\t}\n\n\tonDismiss() {\n\t\tconst { onDismiss } = this.props;\n\n\t\t// Restore Keyboard Visibility\n\t\tshowAndroidSoftKeyboard();\n\n\t\tif ( onDismiss ) {\n\t\t\tonDismiss();\n\t\t}\n\n\t\tthis.onCloseBottomSheet();\n\t}\n\n\tonShouldEnableScroll( value ) {\n\t\tthis.setState( { scrollEnabled: value } );\n\t}\n\n\tonShouldSetBottomSheetMaxHeight( value ) {\n\t\tthis.setState( { isMaxHeightSet: value } );\n\t}\n\n\tisScrolling( value ) {\n\t\tthis.setState( { isScrolling: value } );\n\t}\n\n\tonHandleClosingBottomSheet( action ) {\n\t\tthis.setState( { handleClosingBottomSheet: action } );\n\t}\n\n\tonHandleHardwareButtonPress( action ) {\n\t\tthis.setState( { handleHardwareButtonPress: action } );\n\t}\n\n\tonCloseBottomSheet() {\n\t\tconst { onClose } = this.props;\n\t\tconst { handleClosingBottomSheet } = this.state;\n\t\tif ( handleClosingBottomSheet ) {\n\t\t\thandleClosingBottomSheet();\n\t\t\tthis.onHandleClosingBottomSheet( null );\n\t\t}\n\t\tif ( onClose ) {\n\t\t\tonClose();\n\t\t}\n\t\tthis.onShouldSetBottomSheetMaxHeight( true );\n\t}\n\n\tsetIsFullScreen( isFullScreen ) {\n\t\tif ( isFullScreen !== this.state.isFullScreen ) {\n\t\t\tif ( isFullScreen ) {\n\t\t\t\tthis.setState( { isFullScreen, isMaxHeightSet: false } );\n\t\t\t} else {\n\t\t\t\tthis.setState( { isFullScreen, isMaxHeightSet: true } );\n\t\t\t}\n\t\t}\n\t}\n\n\tonHardwareButtonPress() {\n\t\tconst { onClose } = this.props;\n\t\tconst { handleHardwareButtonPress } = this.state;\n\n\t\tif ( handleHardwareButtonPress && handleHardwareButtonPress() ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( onClose ) {\n\t\t\treturn onClose();\n\t\t}\n\t}\n\n\tgetContentStyle() {\n\t\tconst { safeAreaBottomInset } = this.state;\n\t\treturn {\n\t\t\tpaddingBottom:\n\t\t\t\t( safeAreaBottomInset || 0 ) +\n\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t};\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\ttitle = '',\n\t\t\tisVisible,\n\t\t\tleftButton,\n\t\t\trightButton,\n\t\t\theader,\n\t\t\thideHeader,\n\t\t\tstyle = {},\n\t\t\tcontentStyle = {},\n\t\t\tgetStylesFromColorScheme,\n\t\t\tchildren,\n\t\t\twithHeaderSeparator = false,\n\t\t\thasNavigation,\n\t\t\tonDismiss,\n\t\t\t...rest\n\t\t} = this.props;\n\t\tconst {\n\t\t\tmaxHeight,\n\t\t\tbounces,\n\t\t\tsafeAreaBottomInset,\n\t\t\tsafeAreaTopInset,\n\t\t\tisScrolling,\n\t\t\tscrollEnabled,\n\t\t\tisMaxHeightSet,\n\t\t\tisFullScreen,\n\t\t} = this.state;\n\n\t\tconst panResponder = PanResponder.create( {\n\t\t\tonMoveShouldSetPanResponder: ( evt, gestureState ) => {\n\t\t\t\t// 'swiping-to-close' option is temporarily and partially disabled\n\t\t\t\t// on Android ( swipe / drag is still available in the top most area - near drag indicator).\n\t\t\t\tif ( Platform.OS === 'ios' ) {\n\t\t\t\t\t// Activates swipe down over child Touchables if the swipe is long enough.\n\t\t\t\t\t// With this we can adjust sensibility on the swipe vs tap gestures.\n\t\t\t\t\tif ( gestureState.dy > 3 && ! bounces ) {\n\t\t\t\t\t\tgestureState.dy = 0;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t} );\n\n\t\tconst backgroundStyle = getStylesFromColorScheme(\n\t\t\tstyles.background,\n\t\t\tstyles.backgroundDark\n\t\t);\n\n\t\tconst bottomSheetHeaderTitleStyle = getStylesFromColorScheme(\n\t\t\tstyles.bottomSheetHeaderTitle,\n\t\t\tstyles.bottomSheetHeaderTitleDark\n\t\t);\n\n\t\tlet listStyle = {};\n\t\tif ( isFullScreen ) {\n\t\t\tlistStyle = { flexGrow: 1, flexShrink: 1 };\n\t\t} else if ( isMaxHeightSet ) {\n\t\t\tlistStyle = { maxHeight };\n\n\t\t\t// Allow setting a \"static\" height of the bottom sheet\n\t\t\t// by setting the min height to the max height.\n\t\t\tif ( this.props.setMinHeightToMaxHeight ) {\n\t\t\t\tlistStyle.minHeight = maxHeight;\n\t\t\t}\n\t\t}\n\n\t\tconst listProps = {\n\t\t\tdisableScrollViewPanResponder: true,\n\t\t\tbounces,\n\t\t\tonScroll: this.onScroll,\n\t\t\tonScrollBeginDrag: this.onScrollBeginDrag,\n\t\t\tonScrollEndDrag: this.onScrollEndDrag,\n\t\t\tscrollEventThrottle: 16,\n\t\t\tcontentContainerStyle: [\n\t\t\t\tstyles.content,\n\t\t\t\thideHeader && styles.emptyHeader,\n\t\t\t\tcontentStyle,\n\t\t\t\tisFullScreen && { flexGrow: 1 },\n\t\t\t],\n\t\t\tstyle: listStyle,\n\t\t\tsafeAreaBottomInset,\n\t\t\tscrollEnabled,\n\t\t\tautomaticallyAdjustContentInsets: false,\n\t\t};\n\n\t\tconst WrapperView = hasNavigation ? View : ScrollView;\n\n\t\tconst getHeader = () => (\n\t\t\t<>\n\t\t\t\t{ header || (\n\t\t\t\t\t<View style={ styles.bottomSheetHeader }>\n\t\t\t\t\t\t<View style={ styles.flex }>{ leftButton }</View>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tstyle={ bottomSheetHeaderTitleStyle }\n\t\t\t\t\t\t\tmaxFontSizeMultiplier={ 3 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<View style={ styles.flex }>{ rightButton }</View>\n\t\t\t\t\t</View>\n\t\t\t\t) }\n\t\t\t\t{ withHeaderSeparator && <View style={ styles.separator } /> }\n\t\t\t</>\n\t\t);\n\n\t\tconst showDragIndicator = () => {\n\t\t\t// If iOS or not fullscreen show the drag indicator.\n\t\t\tif ( Platform.OS === 'ios' || ! this.state.isFullScreen ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Otherwise check the allowDragIndicator.\n\t\t\treturn this.props.allowDragIndicator;\n\t\t};\n\n\t\treturn (\n\t\t\t<Modal\n\t\t\t\tisVisible={ isVisible }\n\t\t\t\tstyle={ styles.bottomModal }\n\t\t\t\tanimationInTiming={ 400 }\n\t\t\t\tanimationOutTiming={ 300 }\n\t\t\t\tbackdropTransitionInTiming={ 50 }\n\t\t\t\tbackdropTransitionOutTiming={ 50 }\n\t\t\t\tbackdropOpacity={ 0.2 }\n\t\t\t\tonBackdropPress={ this.onCloseBottomSheet }\n\t\t\t\tonBackButtonPress={ this.onHardwareButtonPress }\n\t\t\t\tonSwipeComplete={ this.onCloseBottomSheet }\n\t\t\t\tonDismiss={ Platform.OS === 'ios' ? this.onDismiss : undefined }\n\t\t\t\tonModalHide={\n\t\t\t\t\tPlatform.OS === 'android' ? this.onDismiss : undefined\n\t\t\t\t}\n\t\t\t\tswipeDirection=\"down\"\n\t\t\t\tonMoveShouldSetResponder={\n\t\t\t\t\tscrollEnabled &&\n\t\t\t\t\tpanResponder.panHandlers.onMoveShouldSetResponder\n\t\t\t\t}\n\t\t\t\tonMoveShouldSetResponderCapture={\n\t\t\t\t\tscrollEnabled &&\n\t\t\t\t\tpanResponder.panHandlers.onMoveShouldSetResponderCapture\n\t\t\t\t}\n\t\t\t\tonAccessibilityEscape={ this.onCloseBottomSheet }\n\t\t\t\ttestID=\"bottom-sheet\"\n\t\t\t\thardwareAccelerated={ true }\n\t\t\t\tuseNativeDriverForBackdrop={ true }\n\t\t\t\t{ ...rest }\n\t\t\t>\n\t\t\t\t<KeyboardAvoidingView\n\t\t\t\t\tbehavior={ Platform.OS === 'ios' && 'padding' }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...backgroundStyle,\n\t\t\t\t\t\tborderColor: 'rgba(0, 0, 0, 0.1)',\n\t\t\t\t\t\tmarginTop:\n\t\t\t\t\t\t\tPlatform.OS === 'ios' && isFullScreen\n\t\t\t\t\t\t\t\t? safeAreaTopInset\n\t\t\t\t\t\t\t\t: 0,\n\t\t\t\t\t\tflex: isFullScreen ? 1 : undefined,\n\t\t\t\t\t\t...( Platform.OS === 'android' && isFullScreen\n\t\t\t\t\t\t\t? styles.backgroundFullScreen\n\t\t\t\t\t\t\t: {} ),\n\t\t\t\t\t\t...style,\n\t\t\t\t\t} }\n\t\t\t\t\tkeyboardVerticalOffset={ -safeAreaBottomInset }\n\t\t\t\t>\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={ styles.header }\n\t\t\t\t\t\tonLayout={ this.onHeaderLayout }\n\t\t\t\t\t\ttestID={ `${ rest.testID || 'bottom-sheet' }-header` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showDragIndicator() && (\n\t\t\t\t\t\t\t<View style={ styles.dragIndicator } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! hideHeader && getHeader() }\n\t\t\t\t\t</View>\n\t\t\t\t\t<WrapperView\n\t\t\t\t\t\t{ ...( hasNavigation\n\t\t\t\t\t\t\t? { style: listProps.style }\n\t\t\t\t\t\t\t: listProps ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BottomSheetProvider\n\t\t\t\t\t\t\tvalue={ {\n\t\t\t\t\t\t\t\tshouldEnableBottomSheetScroll:\n\t\t\t\t\t\t\t\t\tthis.onShouldEnableScroll,\n\t\t\t\t\t\t\t\tshouldEnableBottomSheetMaxHeight:\n\t\t\t\t\t\t\t\t\tthis.onShouldSetBottomSheetMaxHeight,\n\t\t\t\t\t\t\t\tisBottomSheetContentScrolling: isScrolling,\n\t\t\t\t\t\t\t\tonHandleClosingBottomSheet:\n\t\t\t\t\t\t\t\t\tthis.onHandleClosingBottomSheet,\n\t\t\t\t\t\t\t\tonHandleHardwareButtonPress:\n\t\t\t\t\t\t\t\t\tthis.onHandleHardwareButtonPress,\n\t\t\t\t\t\t\t\tlistProps,\n\t\t\t\t\t\t\t\tsetIsFullScreen: this.setIsFullScreen,\n\t\t\t\t\t\t\t\tsafeAreaBottomInset,\n\t\t\t\t\t\t\t\tmaxHeight,\n\t\t\t\t\t\t\t\tisMaxHeightSet,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ hasNavigation ? (\n\t\t\t\t\t\t\t\t<>{ children }</>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<TouchableHighlight accessible={ false }>\n\t\t\t\t\t\t\t\t\t<>{ children }</>\n\t\t\t\t\t\t\t\t</TouchableHighlight>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BottomSheetProvider>\n\t\t\t\t\t\t{ ! hasNavigation && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\tsafeAreaBottomInset ||\n\t\t\t\t\t\t\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</WrapperView>\n\t\t\t\t</KeyboardAvoidingView>\n\t\t\t</Modal>\n\t\t);\n\t}\n}\n\nfunction getWidth() {\n\treturn Math.min(\n\t\tDimensions.get( 'window' ).width,\n\t\tstyles.background.maxWidth\n\t);\n}\n\nconst ThemedBottomSheet = withPreferredColorScheme( BottomSheet );\n\nThemedBottomSheet.getWidth = getWidth;\nThemedBottomSheet.Button = Button;\nThemedBottomSheet.Cell = Cell;\nThemedBottomSheet.SubSheet = BottomSheetSubSheet;\nThemedBottomSheet.NavBar = NavBar;\nThemedBottomSheet.CyclePickerCell = CyclePickerCell;\nThemedBottomSheet.PickerCell = PickerCell;\nThemedBottomSheet.SwitchCell = SwitchCell;\nThemedBottomSheet.RangeCell = RangeCell;\nThemedBottomSheet.ColorCell = ColorCell;\nThemedBottomSheet.LinkCell = LinkCell;\nThemedBottomSheet.LinkSuggestionItemCell = LinkSuggestionItemCell;\nThemedBottomSheet.RadioCell = RadioCell;\nThemedBottomSheet.NavigationScreen = NavigationScreen;\nThemedBottomSheet.NavigationContainer = NavigationContainer;\n\nexport default ThemedBottomSheet;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,UAAU,EACVC,QAAQ,EACRC,eAAe,EACfC,YAAY,EACZC,QAAQ,EACRC,UAAU,EACVC,SAAS,EACTC,IAAI,EACJC,kBAAkB,EAClBC,IAAI,QACE,cAAc;AACrB,OAAOC,KAAK,MAAM,oBAAoB;AACtC,OAAOC,QAAQ,MAAM,wBAAwB;;AAE7C;AACA;AACA;AACA,SACCC,2BAA2B,EAC3BC,uBAAuB,QACjB,gCAAgC;AACvC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,OAAOC,MAAM,MAAM,eAAe;AAClC,OAAOC,MAAM,MAAM,UAAU;AAC7B,OAAOC,IAAI,MAAM,QAAQ;AACzB,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,OAAOC,SAAS,MAAM,cAAc;AACpC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AAmB,GAAGA,mBAAmB;AAE3D,eAAe0L,iBAAiB"}
|
|
1
|
+
{"version":3,"names":["Dimensions","Keyboard","LayoutAnimation","PanResponder","Platform","ScrollView","StatusBar","Text","TouchableHighlight","View","Modal","SafeArea","subscribeAndroidModalClosed","showAndroidSoftKeyboard","Component","withPreferredColorScheme","styles","Button","Cell","CyclePickerCell","PickerCell","SwitchCell","RangeCell","ColorCell","LinkCell","LinkSuggestionItemCell","RadioCell","NavigationScreen","NavigationContainer","KeyboardAvoidingView","BottomSheetSubSheet","NavBar","BottomSheetProvider","DEFAULT_LAYOUT_ANIMATION","Presets","easeInEaseOut","BottomSheet","constructor","arguments","onSafeAreaInsetsUpdate","bind","onScroll","isScrolling","onShouldEnableScroll","onDismiss","onShouldSetBottomSheetMaxHeight","setIsFullScreen","onDimensionsChange","onHeaderLayout","onCloseBottomSheet","onHandleClosingBottomSheet","onHardwareButtonPress","onHandleHardwareButtonPress","keyboardShow","keyboardHide","headerHeight","keyboardHeight","lastLayoutAnimation","lastLayoutAnimationFinished","state","safeAreaBottomInset","safeAreaTopInset","bounces","maxHeight","scrollEnabled","handleClosingBottomSheet","handleHardwareButtonPress","isMaxHeightSet","isFullScreen","props","e","isVisible","height","endCoordinates","performKeyboardLayoutAnimation","onSetMaxHeight","onKeyboardShow","onKeyboardHide","event","duration","easing","animationConfig","type","Types","layoutAnimation","update","create","property","Properties","opacity","delete","configureNext","performRegularLayoutAnimation","useLastLayoutAnimation","OS","componentDidMount","getSafeAreaInsetsForRootView","then","androidModalClosedSubscription","onClose","dimensionsChangeSubscription","addEventListener","keyboardShowListener","addListener","keyboardHideListener","safeAreaEventSubscription","componentWillUnmount","remove","result","safeAreaInsets","bottom","top","setState","width","get","statusBarHeight","currentHeight","maxHeightWithOpenKeyboard","Math","min","nativeEvent","layout","round","isCloseToBottom","layoutMeasurement","contentOffset","contentSize","y","isCloseToTop","value","action","getContentStyle","paddingBottom","scrollableContent","render","title","leftButton","rightButton","header","hideHeader","style","contentStyle","getStylesFromColorScheme","children","withHeaderSeparator","hasNavigation","rest","panResponder","onMoveShouldSetPanResponder","evt","gestureState","dy","backgroundStyle","background","backgroundDark","bottomSheetHeaderTitleStyle","bottomSheetHeaderTitle","bottomSheetHeaderTitleDark","listStyle","flexGrow","flexShrink","setMinHeightToMaxHeight","minHeight","listProps","disableScrollViewPanResponder","onScrollBeginDrag","onScrollEndDrag","scrollEventThrottle","contentContainerStyle","content","emptyHeader","automaticallyAdjustContentInsets","WrapperView","getHeader","createElement","Fragment","bottomSheetHeader","flex","maxFontSizeMultiplier","separator","showDragIndicator","allowDragIndicator","bottomModal","animationInTiming","animationOutTiming","backdropTransitionInTiming","backdropTransitionOutTiming","backdropOpacity","onBackdropPress","onBackButtonPress","onSwipeComplete","undefined","onModalHide","swipeDirection","onMoveShouldSetResponder","panHandlers","onMoveShouldSetResponderCapture","onAccessibilityEscape","testID","hardwareAccelerated","useNativeDriverForBackdrop","behavior","borderColor","marginTop","backgroundFullScreen","keyboardVerticalOffset","onLayout","dragIndicator","shouldEnableBottomSheetScroll","shouldEnableBottomSheetMaxHeight","isBottomSheetContentScrolling","accessible","getWidth","maxWidth","ThemedBottomSheet","SubSheet"],"sources":["@wordpress/components/src/mobile/bottom-sheet/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tDimensions,\n\tKeyboard,\n\tLayoutAnimation,\n\tPanResponder,\n\tPlatform,\n\tScrollView,\n\tStatusBar,\n\tText,\n\tTouchableHighlight,\n\tView,\n} from 'react-native';\nimport Modal from 'react-native-modal';\nimport SafeArea from 'react-native-safe-area';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tsubscribeAndroidModalClosed,\n\tshowAndroidSoftKeyboard,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport Button from './button';\nimport Cell from './cell';\nimport CyclePickerCell from './cycle-picker-cell';\nimport PickerCell from './picker-cell';\nimport SwitchCell from './switch-cell';\nimport RangeCell from './range-cell';\nimport ColorCell from './color-cell';\nimport LinkCell from './link-cell';\nimport LinkSuggestionItemCell from './link-suggestion-item-cell';\nimport RadioCell from './radio-cell';\nimport NavigationScreen from './bottom-sheet-navigation/navigation-screen';\nimport NavigationContainer from './bottom-sheet-navigation/navigation-container';\nimport KeyboardAvoidingView from './keyboard-avoiding-view';\nimport BottomSheetSubSheet from './sub-sheet';\nimport NavBar from './nav-bar';\nimport { BottomSheetProvider } from './bottom-sheet-context';\n\nconst DEFAULT_LAYOUT_ANIMATION = LayoutAnimation.Presets.easeInEaseOut;\n\nclass BottomSheet extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.onSafeAreaInsetsUpdate = this.onSafeAreaInsetsUpdate.bind( this );\n\t\tthis.onScroll = this.onScroll.bind( this );\n\t\tthis.isScrolling = this.isScrolling.bind( this );\n\t\tthis.onShouldEnableScroll = this.onShouldEnableScroll.bind( this );\n\t\tthis.onDismiss = this.onDismiss.bind( this );\n\t\tthis.onShouldSetBottomSheetMaxHeight =\n\t\t\tthis.onShouldSetBottomSheetMaxHeight.bind( this );\n\n\t\tthis.setIsFullScreen = this.setIsFullScreen.bind( this );\n\n\t\tthis.onDimensionsChange = this.onDimensionsChange.bind( this );\n\t\tthis.onHeaderLayout = this.onHeaderLayout.bind( this );\n\t\tthis.onCloseBottomSheet = this.onCloseBottomSheet.bind( this );\n\t\tthis.onHandleClosingBottomSheet =\n\t\t\tthis.onHandleClosingBottomSheet.bind( this );\n\t\tthis.onHardwareButtonPress = this.onHardwareButtonPress.bind( this );\n\t\tthis.onHandleHardwareButtonPress =\n\t\t\tthis.onHandleHardwareButtonPress.bind( this );\n\t\tthis.keyboardShow = this.keyboardShow.bind( this );\n\t\tthis.keyboardHide = this.keyboardHide.bind( this );\n\n\t\tthis.headerHeight = 0;\n\t\tthis.keyboardHeight = 0;\n\t\tthis.lastLayoutAnimation = null;\n\t\tthis.lastLayoutAnimationFinished = false;\n\n\t\tthis.state = {\n\t\t\tsafeAreaBottomInset: 0,\n\t\t\tsafeAreaTopInset: 0,\n\t\t\tbounces: false,\n\t\t\tmaxHeight: 0,\n\t\t\tscrollEnabled: true,\n\t\t\tisScrolling: false,\n\t\t\thandleClosingBottomSheet: null,\n\t\t\thandleHardwareButtonPress: null,\n\t\t\tisMaxHeightSet: true,\n\t\t\tisFullScreen: this.props.isFullScreen || false,\n\t\t};\n\t}\n\n\tkeyboardShow( e ) {\n\t\tif ( ! this.props.isVisible ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { height } = e.endCoordinates;\n\t\tthis.keyboardHeight = height;\n\t\tthis.performKeyboardLayoutAnimation( e );\n\t\tthis.onSetMaxHeight();\n\t\tthis.props.onKeyboardShow?.();\n\t}\n\n\tkeyboardHide( e ) {\n\t\tif ( ! this.props.isVisible ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.keyboardHeight = 0;\n\t\tthis.performKeyboardLayoutAnimation( e );\n\t\tthis.onSetMaxHeight();\n\t\tthis.props.onKeyboardHide?.();\n\t}\n\n\tperformKeyboardLayoutAnimation( event ) {\n\t\tconst { duration, easing } = event;\n\n\t\tif ( duration && easing ) {\n\t\t\t// This layout animation is the same as the React Native's KeyboardAvoidingView component.\n\t\t\t// Reference: https://github.com/facebook/react-native/blob/266b21baf35e052ff28120f79c06c4f6dddc51a9/Libraries/Components/Keyboard/KeyboardAvoidingView.js#L119-L128.\n\t\t\tconst animationConfig = {\n\t\t\t\t// We have to pass the duration equal to minimal accepted duration defined here: RCTLayoutAnimation.m.\n\t\t\t\tduration: duration > 10 ? duration : 10,\n\t\t\t\ttype: LayoutAnimation.Types[ easing ] || 'keyboard',\n\t\t\t};\n\t\t\tconst layoutAnimation = {\n\t\t\t\tduration: animationConfig.duration,\n\t\t\t\tupdate: animationConfig,\n\t\t\t\tcreate: {\n\t\t\t\t\t...animationConfig,\n\t\t\t\t\tproperty: LayoutAnimation.Properties.opacity,\n\t\t\t\t},\n\t\t\t\tdelete: {\n\t\t\t\t\t...animationConfig,\n\t\t\t\t\tproperty: LayoutAnimation.Properties.opacity,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.lastLayoutAnimationFinished = false;\n\t\t\tLayoutAnimation.configureNext( layoutAnimation, () => {\n\t\t\t\tthis.lastLayoutAnimationFinished = true;\n\t\t\t} );\n\t\t\tthis.lastLayoutAnimation = layoutAnimation;\n\t\t} else {\n\t\t\t// TODO: Reinstate animations, possibly replacing `LayoutAnimation` with\n\t\t\t// more nuanced `Animated` usage or replacing our custom `BottomSheet`\n\t\t\t// with `@gorhom/bottom-sheet`. This animation was disabled to avoid a\n\t\t\t// preexisting bug: https://github.com/WordPress/gutenberg/issues/30562\n\t\t\t// this.performRegularLayoutAnimation( {\n\t\t\t// \tuseLastLayoutAnimation: false,\n\t\t\t// } );.\n\t\t}\n\t}\n\n\tperformRegularLayoutAnimation( { useLastLayoutAnimation } ) {\n\t\t// On Android, we should prevent triggering multiple layout animations at the same time because it can produce visual glitches.\n\t\tif (\n\t\t\tPlatform.OS === 'android' &&\n\t\t\tthis.lastLayoutAnimation &&\n\t\t\t! this.lastLayoutAnimationFinished\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst layoutAnimation = useLastLayoutAnimation\n\t\t\t? this.lastLayoutAnimation || DEFAULT_LAYOUT_ANIMATION\n\t\t\t: DEFAULT_LAYOUT_ANIMATION;\n\n\t\tthis.lastLayoutAnimationFinished = false;\n\t\tLayoutAnimation.configureNext( layoutAnimation, () => {\n\t\t\tthis.lastLayoutAnimationFinished = true;\n\t\t} );\n\t\tthis.lastLayoutAnimation = layoutAnimation;\n\t}\n\n\tcomponentDidMount() {\n\t\tSafeArea.getSafeAreaInsetsForRootView().then(\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\n\t\tif ( Platform.OS === 'android' ) {\n\t\t\tthis.androidModalClosedSubscription = subscribeAndroidModalClosed(\n\t\t\t\t() => {\n\t\t\t\t\tthis.props.onClose();\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tthis.dimensionsChangeSubscription = Dimensions.addEventListener(\n\t\t\t'change',\n\t\t\tthis.onDimensionsChange\n\t\t);\n\n\t\t// 'Will' keyboard events are not available on Android.\n\t\t// Reference: https://reactnative.dev/docs/0.61/keyboard#addlistener.\n\t\tthis.keyboardShowListener = Keyboard.addListener(\n\t\t\tPlatform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow',\n\t\t\tthis.keyboardShow\n\t\t);\n\t\tthis.keyboardHideListener = Keyboard.addListener(\n\t\t\tPlatform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide',\n\t\t\tthis.keyboardHide\n\t\t);\n\n\t\tthis.safeAreaEventSubscription = SafeArea.addEventListener(\n\t\t\t'safeAreaInsetsForRootViewDidChange',\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t\tthis.onSetMaxHeight();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.dimensionsChangeSubscription.remove();\n\t\tthis.keyboardShowListener.remove();\n\t\tthis.keyboardHideListener.remove();\n\t\tif ( this.androidModalClosedSubscription ) {\n\t\t\tthis.androidModalClosedSubscription.remove();\n\t\t}\n\n\t\tif ( this.props.isVisible ) {\n\t\t\tshowAndroidSoftKeyboard();\n\t\t}\n\n\t\tif ( this.safeAreaEventSubscription === null ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.safeAreaEventSubscription.remove();\n\t\tthis.safeAreaEventSubscription = null;\n\t}\n\n\tonSafeAreaInsetsUpdate( result ) {\n\t\tconst { safeAreaBottomInset, safeAreaTopInset } = this.state;\n\t\tif ( this.safeAreaEventSubscription === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { safeAreaInsets } = result;\n\t\tif (\n\t\t\tsafeAreaBottomInset !== safeAreaInsets.bottom ||\n\t\t\tsafeAreaTopInset !== safeAreaInsets.top\n\t\t) {\n\t\t\tthis.setState( {\n\t\t\t\tsafeAreaBottomInset: safeAreaInsets.bottom,\n\t\t\t\tsafeAreaTopInset: safeAreaInsets.top,\n\t\t\t} );\n\t\t}\n\t}\n\n\tonSetMaxHeight() {\n\t\tconst { height, width } = Dimensions.get( 'window' );\n\t\tconst { safeAreaBottomInset } = this.state;\n\t\tconst statusBarHeight =\n\t\t\tPlatform.OS === 'android' ? StatusBar.currentHeight : 0;\n\n\t\t// `maxHeight` when modal is opened along with a keyboard.\n\t\tconst maxHeightWithOpenKeyboard =\n\t\t\t0.95 *\n\t\t\t( Dimensions.get( 'window' ).height -\n\t\t\t\tthis.keyboardHeight -\n\t\t\t\tstatusBarHeight -\n\t\t\t\tthis.headerHeight );\n\n\t\t// In landscape orientation, set `maxHeight` to ~96% of the height.\n\t\tif ( width > height ) {\n\t\t\tthis.setState( {\n\t\t\t\tmaxHeight: Math.min(\n\t\t\t\t\t0.96 * height - this.headerHeight,\n\t\t\t\t\tmaxHeightWithOpenKeyboard\n\t\t\t\t),\n\t\t\t} );\n\t\t\t// In portrait orientation, set `maxHeight` to ~59% of the height.\n\t\t} else {\n\t\t\tthis.setState( {\n\t\t\t\tmaxHeight: Math.min(\n\t\t\t\t\theight * 0.59 - safeAreaBottomInset - this.headerHeight,\n\t\t\t\t\tmaxHeightWithOpenKeyboard\n\t\t\t\t),\n\t\t\t} );\n\t\t}\n\t}\n\n\tonDimensionsChange() {\n\t\tthis.onSetMaxHeight();\n\t\tthis.setState( { bounces: false } );\n\t}\n\n\tonHeaderLayout( { nativeEvent } ) {\n\t\tconst { height } = nativeEvent.layout;\n\t\t// The layout animation should only be triggered if the header\n\t\t// height has changed after being mounted.\n\t\tif (\n\t\t\tthis.headerHeight !== 0 &&\n\t\t\tMath.round( height ) !== Math.round( this.headerHeight )\n\t\t) {\n\t\t\tthis.performRegularLayoutAnimation( {\n\t\t\t\tuseLastLayoutAnimation: true,\n\t\t\t} );\n\t\t}\n\t\tthis.headerHeight = height;\n\t\tthis.onSetMaxHeight();\n\t}\n\n\tisCloseToBottom( { layoutMeasurement, contentOffset, contentSize } ) {\n\t\treturn (\n\t\t\tlayoutMeasurement.height + contentOffset.y >=\n\t\t\tcontentSize.height - contentOffset.y\n\t\t);\n\t}\n\n\tisCloseToTop( { contentOffset } ) {\n\t\treturn contentOffset.y < 10;\n\t}\n\n\tonScroll( { nativeEvent } ) {\n\t\tif ( this.isCloseToTop( nativeEvent ) ) {\n\t\t\tthis.setState( { bounces: false } );\n\t\t} else {\n\t\t\tthis.setState( { bounces: true } );\n\t\t}\n\t}\n\n\tonDismiss() {\n\t\tconst { onDismiss } = this.props;\n\n\t\t// Restore Keyboard Visibility\n\t\tshowAndroidSoftKeyboard();\n\n\t\tif ( onDismiss ) {\n\t\t\tonDismiss();\n\t\t}\n\n\t\tthis.onCloseBottomSheet();\n\t}\n\n\tonShouldEnableScroll( value ) {\n\t\tthis.setState( { scrollEnabled: value } );\n\t}\n\n\tonShouldSetBottomSheetMaxHeight( value ) {\n\t\tthis.setState( { isMaxHeightSet: value } );\n\t}\n\n\tisScrolling( value ) {\n\t\tthis.setState( { isScrolling: value } );\n\t}\n\n\tonHandleClosingBottomSheet( action ) {\n\t\tthis.setState( { handleClosingBottomSheet: action } );\n\t}\n\n\tonHandleHardwareButtonPress( action ) {\n\t\tthis.setState( { handleHardwareButtonPress: action } );\n\t}\n\n\tonCloseBottomSheet() {\n\t\tconst { onClose } = this.props;\n\t\tconst { handleClosingBottomSheet } = this.state;\n\t\tif ( handleClosingBottomSheet ) {\n\t\t\thandleClosingBottomSheet();\n\t\t\tthis.onHandleClosingBottomSheet( null );\n\t\t}\n\t\tif ( onClose ) {\n\t\t\tonClose();\n\t\t}\n\t\tthis.onShouldSetBottomSheetMaxHeight( true );\n\t}\n\n\tsetIsFullScreen( isFullScreen ) {\n\t\tif ( isFullScreen !== this.state.isFullScreen ) {\n\t\t\tif ( isFullScreen ) {\n\t\t\t\tthis.setState( { isFullScreen, isMaxHeightSet: false } );\n\t\t\t} else {\n\t\t\t\tthis.setState( { isFullScreen, isMaxHeightSet: true } );\n\t\t\t}\n\t\t}\n\t}\n\n\tonHardwareButtonPress() {\n\t\tconst { onClose } = this.props;\n\t\tconst { handleHardwareButtonPress } = this.state;\n\n\t\tif ( handleHardwareButtonPress && handleHardwareButtonPress() ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( onClose ) {\n\t\t\treturn onClose();\n\t\t}\n\t}\n\n\tgetContentStyle() {\n\t\tconst { safeAreaBottomInset } = this.state;\n\t\treturn {\n\t\t\tpaddingBottom:\n\t\t\t\t( safeAreaBottomInset || 0 ) +\n\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t};\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\ttitle = '',\n\t\t\tisVisible,\n\t\t\tleftButton,\n\t\t\trightButton,\n\t\t\theader,\n\t\t\thideHeader,\n\t\t\tstyle = {},\n\t\t\tcontentStyle = {},\n\t\t\tgetStylesFromColorScheme,\n\t\t\tchildren,\n\t\t\twithHeaderSeparator = false,\n\t\t\thasNavigation,\n\t\t\tonDismiss,\n\t\t\t...rest\n\t\t} = this.props;\n\t\tconst {\n\t\t\tmaxHeight,\n\t\t\tbounces,\n\t\t\tsafeAreaBottomInset,\n\t\t\tsafeAreaTopInset,\n\t\t\tisScrolling,\n\t\t\tscrollEnabled,\n\t\t\tisMaxHeightSet,\n\t\t\tisFullScreen,\n\t\t} = this.state;\n\n\t\tconst panResponder = PanResponder.create( {\n\t\t\tonMoveShouldSetPanResponder: ( evt, gestureState ) => {\n\t\t\t\t// 'swiping-to-close' option is temporarily and partially disabled\n\t\t\t\t// on Android ( swipe / drag is still available in the top most area - near drag indicator).\n\t\t\t\tif ( Platform.OS === 'ios' ) {\n\t\t\t\t\t// Activates swipe down over child Touchables if the swipe is long enough.\n\t\t\t\t\t// With this we can adjust sensibility on the swipe vs tap gestures.\n\t\t\t\t\tif ( gestureState.dy > 3 && ! bounces ) {\n\t\t\t\t\t\tgestureState.dy = 0;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t} );\n\n\t\tconst backgroundStyle = getStylesFromColorScheme(\n\t\t\tstyles.background,\n\t\t\tstyles.backgroundDark\n\t\t);\n\n\t\tconst bottomSheetHeaderTitleStyle = getStylesFromColorScheme(\n\t\t\tstyles.bottomSheetHeaderTitle,\n\t\t\tstyles.bottomSheetHeaderTitleDark\n\t\t);\n\n\t\tlet listStyle = {};\n\t\tif ( isFullScreen ) {\n\t\t\tlistStyle = { flexGrow: 1, flexShrink: 1 };\n\t\t} else if ( isMaxHeightSet ) {\n\t\t\tlistStyle = { maxHeight };\n\n\t\t\t// Allow setting a \"static\" height of the bottom sheet\n\t\t\t// by setting the min height to the max height.\n\t\t\tif ( this.props.setMinHeightToMaxHeight ) {\n\t\t\t\tlistStyle.minHeight = maxHeight;\n\t\t\t}\n\t\t}\n\n\t\tconst listProps = {\n\t\t\tdisableScrollViewPanResponder: true,\n\t\t\tbounces,\n\t\t\tonScroll: this.onScroll,\n\t\t\tonScrollBeginDrag: this.onScrollBeginDrag,\n\t\t\tonScrollEndDrag: this.onScrollEndDrag,\n\t\t\tscrollEventThrottle: 16,\n\t\t\tcontentContainerStyle: [\n\t\t\t\tstyles.content,\n\t\t\t\thideHeader && styles.emptyHeader,\n\t\t\t\tcontentStyle,\n\t\t\t\tisFullScreen && { flexGrow: 1 },\n\t\t\t],\n\t\t\tstyle: listStyle,\n\t\t\tsafeAreaBottomInset,\n\t\t\tscrollEnabled,\n\t\t\tautomaticallyAdjustContentInsets: false,\n\t\t};\n\n\t\tconst WrapperView = hasNavigation ? View : ScrollView;\n\n\t\tconst getHeader = () => (\n\t\t\t<>\n\t\t\t\t{ header || (\n\t\t\t\t\t<View style={ styles.bottomSheetHeader }>\n\t\t\t\t\t\t<View style={ styles.flex }>{ leftButton }</View>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tstyle={ bottomSheetHeaderTitleStyle }\n\t\t\t\t\t\t\tmaxFontSizeMultiplier={ 3 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<View style={ styles.flex }>{ rightButton }</View>\n\t\t\t\t\t</View>\n\t\t\t\t) }\n\t\t\t\t{ withHeaderSeparator && <View style={ styles.separator } /> }\n\t\t\t</>\n\t\t);\n\n\t\tconst showDragIndicator = () => {\n\t\t\t// If iOS or not fullscreen show the drag indicator.\n\t\t\tif ( Platform.OS === 'ios' || ! this.state.isFullScreen ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Otherwise check the allowDragIndicator.\n\t\t\treturn this.props.allowDragIndicator;\n\t\t};\n\n\t\treturn (\n\t\t\t<Modal\n\t\t\t\tisVisible={ isVisible }\n\t\t\t\tstyle={ styles.bottomModal }\n\t\t\t\tanimationInTiming={ 400 }\n\t\t\t\tanimationOutTiming={ 300 }\n\t\t\t\tbackdropTransitionInTiming={ 50 }\n\t\t\t\tbackdropTransitionOutTiming={ 50 }\n\t\t\t\tbackdropOpacity={ 0.2 }\n\t\t\t\tonBackdropPress={ this.onCloseBottomSheet }\n\t\t\t\tonBackButtonPress={ this.onHardwareButtonPress }\n\t\t\t\tonSwipeComplete={ this.onCloseBottomSheet }\n\t\t\t\tonDismiss={ Platform.OS === 'ios' ? this.onDismiss : undefined }\n\t\t\t\tonModalHide={\n\t\t\t\t\tPlatform.OS === 'android' ? this.onDismiss : undefined\n\t\t\t\t}\n\t\t\t\tswipeDirection=\"down\"\n\t\t\t\tonMoveShouldSetResponder={\n\t\t\t\t\tscrollEnabled &&\n\t\t\t\t\tpanResponder.panHandlers.onMoveShouldSetResponder\n\t\t\t\t}\n\t\t\t\tonMoveShouldSetResponderCapture={\n\t\t\t\t\tscrollEnabled &&\n\t\t\t\t\tpanResponder.panHandlers.onMoveShouldSetResponderCapture\n\t\t\t\t}\n\t\t\t\tonAccessibilityEscape={ this.onCloseBottomSheet }\n\t\t\t\ttestID=\"bottom-sheet\"\n\t\t\t\thardwareAccelerated\n\t\t\t\tuseNativeDriverForBackdrop\n\t\t\t\t{ ...rest }\n\t\t\t>\n\t\t\t\t<KeyboardAvoidingView\n\t\t\t\t\tbehavior={ Platform.OS === 'ios' && 'padding' }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...backgroundStyle,\n\t\t\t\t\t\tborderColor: 'rgba(0, 0, 0, 0.1)',\n\t\t\t\t\t\tmarginTop:\n\t\t\t\t\t\t\tPlatform.OS === 'ios' && isFullScreen\n\t\t\t\t\t\t\t\t? safeAreaTopInset\n\t\t\t\t\t\t\t\t: 0,\n\t\t\t\t\t\tflex: isFullScreen ? 1 : undefined,\n\t\t\t\t\t\t...( Platform.OS === 'android' && isFullScreen\n\t\t\t\t\t\t\t? styles.backgroundFullScreen\n\t\t\t\t\t\t\t: {} ),\n\t\t\t\t\t\t...style,\n\t\t\t\t\t} }\n\t\t\t\t\tkeyboardVerticalOffset={ -safeAreaBottomInset }\n\t\t\t\t>\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={ styles.header }\n\t\t\t\t\t\tonLayout={ this.onHeaderLayout }\n\t\t\t\t\t\ttestID={ `${ rest.testID || 'bottom-sheet' }-header` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showDragIndicator() && (\n\t\t\t\t\t\t\t<View style={ styles.dragIndicator } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! hideHeader && getHeader() }\n\t\t\t\t\t</View>\n\t\t\t\t\t<WrapperView\n\t\t\t\t\t\t{ ...( hasNavigation\n\t\t\t\t\t\t\t? { style: listProps.style }\n\t\t\t\t\t\t\t: listProps ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BottomSheetProvider\n\t\t\t\t\t\t\tvalue={ {\n\t\t\t\t\t\t\t\tshouldEnableBottomSheetScroll:\n\t\t\t\t\t\t\t\t\tthis.onShouldEnableScroll,\n\t\t\t\t\t\t\t\tshouldEnableBottomSheetMaxHeight:\n\t\t\t\t\t\t\t\t\tthis.onShouldSetBottomSheetMaxHeight,\n\t\t\t\t\t\t\t\tisBottomSheetContentScrolling: isScrolling,\n\t\t\t\t\t\t\t\tonHandleClosingBottomSheet:\n\t\t\t\t\t\t\t\t\tthis.onHandleClosingBottomSheet,\n\t\t\t\t\t\t\t\tonHandleHardwareButtonPress:\n\t\t\t\t\t\t\t\t\tthis.onHandleHardwareButtonPress,\n\t\t\t\t\t\t\t\tlistProps,\n\t\t\t\t\t\t\t\tsetIsFullScreen: this.setIsFullScreen,\n\t\t\t\t\t\t\t\tsafeAreaBottomInset,\n\t\t\t\t\t\t\t\tmaxHeight,\n\t\t\t\t\t\t\t\tisMaxHeightSet,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ hasNavigation ? (\n\t\t\t\t\t\t\t\t<>{ children }</>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<TouchableHighlight accessible={ false }>\n\t\t\t\t\t\t\t\t\t<>{ children }</>\n\t\t\t\t\t\t\t\t</TouchableHighlight>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BottomSheetProvider>\n\t\t\t\t\t\t{ ! hasNavigation && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\tsafeAreaBottomInset ||\n\t\t\t\t\t\t\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</WrapperView>\n\t\t\t\t</KeyboardAvoidingView>\n\t\t\t</Modal>\n\t\t);\n\t}\n}\n\nfunction getWidth() {\n\treturn Math.min(\n\t\tDimensions.get( 'window' ).width,\n\t\tstyles.background.maxWidth\n\t);\n}\n\nconst ThemedBottomSheet = withPreferredColorScheme( BottomSheet );\n\nThemedBottomSheet.getWidth = getWidth;\nThemedBottomSheet.Button = Button;\nThemedBottomSheet.Cell = Cell;\nThemedBottomSheet.SubSheet = BottomSheetSubSheet;\nThemedBottomSheet.NavBar = NavBar;\nThemedBottomSheet.CyclePickerCell = CyclePickerCell;\nThemedBottomSheet.PickerCell = PickerCell;\nThemedBottomSheet.SwitchCell = SwitchCell;\nThemedBottomSheet.RangeCell = RangeCell;\nThemedBottomSheet.ColorCell = ColorCell;\nThemedBottomSheet.LinkCell = LinkCell;\nThemedBottomSheet.LinkSuggestionItemCell = LinkSuggestionItemCell;\nThemedBottomSheet.RadioCell = RadioCell;\nThemedBottomSheet.NavigationScreen = NavigationScreen;\nThemedBottomSheet.NavigationContainer = NavigationContainer;\n\nexport default ThemedBottomSheet;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,UAAU,EACVC,QAAQ,EACRC,eAAe,EACfC,YAAY,EACZC,QAAQ,EACRC,UAAU,EACVC,SAAS,EACTC,IAAI,EACJC,kBAAkB,EAClBC,IAAI,QACE,cAAc;AACrB,OAAOC,KAAK,MAAM,oBAAoB;AACtC,OAAOC,QAAQ,MAAM,wBAAwB;;AAE7C;AACA;AACA;AACA,SACCC,2BAA2B,EAC3BC,uBAAuB,QACjB,gCAAgC;AACvC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,OAAOC,MAAM,MAAM,eAAe;AAClC,OAAOC,MAAM,MAAM,UAAU;AAC7B,OAAOC,IAAI,MAAM,QAAQ;AACzB,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,gBAAgB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iB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","AccessibilityInfo","View","Slider","__","sprintf","Component","withPreferredColorScheme","Cell","LockIcon","styles","RangeTextInput","toFixed","isIOS","OS","BottomSheetRangeCell","constructor","props","onSliderChange","bind","onCompleteSliderChange","onTextInputChange","a11yIncrementValue","a11yDecrementValue","a11yUpdateValue","value","defaultValue","minimumValue","initialValue","Number","state","inputValue","sliderValue","componentWillUnmount","clearTimeout","timeoutAnnounceValue","decimalNum","onChange","setState","nextValue","onComplete","step","maximumValue","newValue","undefined","announceValue","label","unitLabel","setTimeout","announceForAccessibility","render","disabled","preferredColorScheme","minimumTrackTintColor","maximumTrackTintColor","thumbTintColor","preview","cellContainerStyle","shouldDisplayTextInput","settingLabel","openUnitPicker","children","cellProps","getAccessibilityHint","getAccessibilityLabel","containerStyle","container","containerIOS","containerAndroid","createElement","accessible","accessibilityRole","accessibilityActions","name","onAccessibilityAction","event","nativeEvent","actionName","accessibilityLabel","accessibilityHint","importantForAccessibility","cellContainerStyles","cellRowContainerStyle","leftAlign","editable","activeOpacity","valueStyle","showLockIcon","style","testID","onValueChange","onSlidingComplete","ref","slider","sliderRef","sliderIOS","sliderAndroid","min","max"],"sources":["@wordpress/components/src/mobile/bottom-sheet/range-cell.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, AccessibilityInfo, View } from 'react-native';\nimport Slider from '@react-native-community/slider';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\nimport LockIcon from './lock-icon';\nimport styles from './range-cell.scss';\nimport RangeTextInput from './range-text-input';\nimport { toFixed } from '../utils';\n\nconst isIOS = Platform.OS === 'ios';\n\nclass BottomSheetRangeCell extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.onSliderChange = this.onSliderChange.bind( this );\n\t\tthis.onCompleteSliderChange = this.onCompleteSliderChange.bind( this );\n\t\tthis.onTextInputChange = this.onTextInputChange.bind( this );\n\t\tthis.a11yIncrementValue = this.a11yIncrementValue.bind( this );\n\t\tthis.a11yDecrementValue = this.a11yDecrementValue.bind( this );\n\t\tthis.a11yUpdateValue = this.a11yUpdateValue.bind( this );\n\n\t\tconst { value, defaultValue, minimumValue } = props;\n\t\tconst initialValue = Number( value || defaultValue || minimumValue );\n\n\t\tthis.state = {\n\t\t\tinputValue: initialValue,\n\t\t\tsliderValue: initialValue,\n\t\t};\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeoutAnnounceValue );\n\t}\n\n\tonSliderChange( initialValue ) {\n\t\tconst { decimalNum, onChange } = this.props;\n\t\tinitialValue = toFixed( initialValue, decimalNum );\n\t\tthis.setState( { inputValue: initialValue } );\n\t\tonChange( initialValue );\n\t}\n\n\tonTextInputChange( nextValue ) {\n\t\tconst { onChange, onComplete } = this.props;\n\t\tthis.setState( {\n\t\t\tsliderValue: nextValue,\n\t\t} );\n\t\tonChange( nextValue );\n\t\tif ( onComplete ) {\n\t\t\tonComplete( nextValue );\n\t\t}\n\t}\n\n\tonCompleteSliderChange( nextValue ) {\n\t\tconst { decimalNum, onComplete } = this.props;\n\t\tnextValue = toFixed( nextValue, decimalNum );\n\t\tif ( onComplete ) {\n\t\t\tonComplete( nextValue );\n\t\t}\n\t}\n\n\t/*\n\t * Only used with screenreaders like VoiceOver and TalkBack. Increments the\n\t * value of this setting programmatically.\n\t */\n\ta11yIncrementValue() {\n\t\tconst { step = 5, maximumValue, decimalNum } = this.props;\n\t\tconst { inputValue } = this.state;\n\n\t\tconst newValue = toFixed( inputValue + step, decimalNum );\n\n\t\tif ( newValue <= maximumValue || maximumValue === undefined ) {\n\t\t\tthis.a11yUpdateValue( newValue );\n\t\t}\n\t}\n\n\t/*\n\t * Only used with screenreaders like VoiceOver and TalkBack. Decrements the\n\t * value of this setting programmatically.\n\t */\n\ta11yDecrementValue() {\n\t\tconst { step = 5, minimumValue, decimalNum } = this.props;\n\t\tconst { sliderValue } = this.state;\n\n\t\tconst newValue = toFixed( sliderValue - step, decimalNum );\n\n\t\tif ( newValue >= minimumValue ) {\n\t\t\tthis.a11yUpdateValue( newValue );\n\t\t}\n\t}\n\n\ta11yUpdateValue( newValue ) {\n\t\tconst { onChange, onComplete } = this.props;\n\t\tthis.setState( {\n\t\t\tsliderValue: newValue,\n\t\t\tinputValue: newValue,\n\t\t} );\n\t\tonChange( newValue );\n\t\tif ( onComplete ) {\n\t\t\tonComplete( newValue );\n\t\t}\n\t\tthis.announceValue( newValue );\n\t}\n\n\t/*\n\t * Only used with screenreaders like VoiceOver and TalkBack.\n\t */\n\tannounceValue( value ) {\n\t\tconst { label, unitLabel = '' } = this.props;\n\n\t\tif ( isIOS ) {\n\t\t\t// On Android it triggers the accessibilityLabel with the value change, but\n\t\t\t// on iOS we need to do this manually.\n\t\t\tclearTimeout( this.timeoutAnnounceValue );\n\t\t\tthis.timeoutAnnounceValue = setTimeout( () => {\n\t\t\t\tAccessibilityInfo.announceForAccessibility(\n\t\t\t\t\t`${ value } ${ unitLabel }, ${ label }`\n\t\t\t\t);\n\t\t\t}, 300 );\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tminimumValue = 0,\n\t\t\tmaximumValue = 10,\n\t\t\tdisabled,\n\t\t\tstep = 1,\n\t\t\tpreferredColorScheme,\n\t\t\tminimumTrackTintColor = preferredColorScheme === 'light'\n\t\t\t\t? '#00669b'\n\t\t\t\t: '#5198d9',\n\t\t\tmaximumTrackTintColor = isIOS ? '#e9eff3' : '#909090',\n\t\t\tthumbTintColor = ! isIOS && '#00669b',\n\t\t\tpreview,\n\t\t\tcellContainerStyle,\n\t\t\tshouldDisplayTextInput = true,\n\t\t\tunitLabel = '',\n\t\t\tsettingLabel = 'Value',\n\t\t\topenUnitPicker,\n\t\t\tchildren,\n\t\t\tdecimalNum,\n\t\t\t...cellProps\n\t\t} = this.props;\n\n\t\tconst { inputValue, sliderValue } = this.state;\n\n\t\tconst getAccessibilityHint = () => {\n\t\t\treturn openUnitPicker ? __( 'double-tap to change unit' ) : '';\n\t\t};\n\n\t\tconst getAccessibilityLabel = () => {\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: accessibility text. Inform about current value. %1$s: Control label %2$s: setting label (example: width), %3$s: Current value. %4$s: value measurement unit (example: pixels) */\n\t\t\t\t__( '%1$s. %2$s is %3$s %4$s.' ),\n\t\t\t\tcellProps.label,\n\t\t\t\tsettingLabel,\n\t\t\t\ttoFixed( value, decimalNum ),\n\t\t\t\tunitLabel\n\t\t\t);\n\t\t};\n\n\t\tconst containerStyle = [\n\t\t\tstyles.container,\n\t\t\tisIOS ? styles.containerIOS : styles.containerAndroid,\n\t\t];\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\taccessible={ true }\n\t\t\t\taccessibilityRole=\"adjustable\"\n\t\t\t\taccessibilityActions={ [\n\t\t\t\t\t{ name: 'increment' },\n\t\t\t\t\t{ name: 'decrement' },\n\t\t\t\t\t{ name: 'activate' },\n\t\t\t\t] }\n\t\t\t\tonAccessibilityAction={ ( event ) => {\n\t\t\t\t\tswitch ( event.nativeEvent.actionName ) {\n\t\t\t\t\t\tcase 'increment':\n\t\t\t\t\t\t\tthis.a11yIncrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'decrement':\n\t\t\t\t\t\t\tthis.a11yDecrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'activate':\n\t\t\t\t\t\t\tif ( openUnitPicker ) {\n\t\t\t\t\t\t\t\topenUnitPicker();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t\taccessibilityLabel={ getAccessibilityLabel() }\n\t\t\t\taccessibilityHint={ getAccessibilityHint() }\n\t\t\t>\n\t\t\t\t<View importantForAccessibility=\"no-hide-descendants\">\n\t\t\t\t\t<Cell\n\t\t\t\t\t\t{ ...cellProps }\n\t\t\t\t\t\tcellContainerStyle={ [\n\t\t\t\t\t\t\tstyles.cellContainerStyles,\n\t\t\t\t\t\t\tcellContainerStyle,\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tcellRowContainerStyle={ containerStyle }\n\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\teditable={ false }\n\t\t\t\t\t\tactiveOpacity={ 1 }\n\t\t\t\t\t\taccessible={ false }\n\t\t\t\t\t\tvalueStyle={ styles.valueStyle }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tshowLockIcon={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ containerStyle }>\n\t\t\t\t\t\t\t{ preview }\n\t\t\t\t\t\t\t<Slider\n\t\t\t\t\t\t\t\ttestID={ `Slider ${ cellProps.label }` }\n\t\t\t\t\t\t\t\tvalue={ sliderValue }\n\t\t\t\t\t\t\t\tdefaultValue={ defaultValue }\n\t\t\t\t\t\t\t\tdisabled={ disabled && ! isIOS }\n\t\t\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t\t\tminimumValue={ minimumValue }\n\t\t\t\t\t\t\t\tmaximumValue={ maximumValue }\n\t\t\t\t\t\t\t\tminimumTrackTintColor={ minimumTrackTintColor }\n\t\t\t\t\t\t\t\tmaximumTrackTintColor={ maximumTrackTintColor }\n\t\t\t\t\t\t\t\tthumbTintColor={ thumbTintColor }\n\t\t\t\t\t\t\t\tonValueChange={ this.onSliderChange }\n\t\t\t\t\t\t\t\tonSlidingComplete={\n\t\t\t\t\t\t\t\t\tthis.onCompleteSliderChange\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tref={ ( slider ) => {\n\t\t\t\t\t\t\t\t\tthis.sliderRef = slider;\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tisIOS\n\t\t\t\t\t\t\t\t\t\t? styles.sliderIOS\n\t\t\t\t\t\t\t\t\t\t: styles.sliderAndroid\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ shouldDisplayTextInput && (\n\t\t\t\t\t\t\t\t<RangeTextInput\n\t\t\t\t\t\t\t\t\tlabel={ cellProps.label }\n\t\t\t\t\t\t\t\t\tonChange={ this.onTextInputChange }\n\t\t\t\t\t\t\t\t\tdefaultValue={ `${ inputValue }` }\n\t\t\t\t\t\t\t\t\tvalue={ inputValue }\n\t\t\t\t\t\t\t\t\tmin={ minimumValue }\n\t\t\t\t\t\t\t\t\tmax={ maximumValue }\n\t\t\t\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t\t\t\tdecimalNum={ decimalNum }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t\t</RangeTextInput>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ disabled && <LockIcon /> }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</Cell>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default withPreferredColorScheme( BottomSheetRangeCell );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,iBAAiB,EAAEC,IAAI,QAAQ,cAAc;AAChE,OAAOC,MAAM,MAAM,gCAAgC;;AAEnD;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,OAAOC,IAAI,MAAM,QAAQ;AACzB,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,MAAM,MAAM,mBAAmB;AACtC,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,SAASC,OAAO,QAAQ,UAAU;AAElC,MAAMC,KAAK,GAAGb,QAAQ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,IAAI,CAAChB,iBAAmB;MACnCK,YAAY,EAAI,GAAGK,UAAY,EAAG;MAClCN,KAAK,EAAGM,UAAY;MACpBkE,GAAG,EAAGtE,YAAc;MACpBuE,GAAG,EAAGxD,YAAc;MACpBD,IAAI,EAAGA,IAAM;MACbL,UAAU,EAAGA;IAAY,GAEvByB,QACa,CAChB,EACCV,QAAQ,IAAIkB,aAAA,CAAC5D,QAAQ,MAAE,CACpB,CACD,CACD,CACD,CAAC;EAET;AACD;AAEA,eAAeF,wBAAwB,CAAEQ,oBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"names":["Platform","AccessibilityInfo","View","Slider","__","sprintf","Component","withPreferredColorScheme","Cell","LockIcon","styles","RangeTextInput","toFixed","isIOS","OS","BottomSheetRangeCell","constructor","props","onSliderChange","bind","onCompleteSliderChange","onTextInputChange","a11yIncrementValue","a11yDecrementValue","a11yUpdateValue","value","defaultValue","minimumValue","initialValue","Number","state","inputValue","sliderValue","componentWillUnmount","clearTimeout","timeoutAnnounceValue","decimalNum","onChange","setState","nextValue","onComplete","step","maximumValue","newValue","undefined","announceValue","label","unitLabel","setTimeout","announceForAccessibility","render","disabled","preferredColorScheme","minimumTrackTintColor","maximumTrackTintColor","thumbTintColor","preview","cellContainerStyle","shouldDisplayTextInput","settingLabel","openUnitPicker","children","cellProps","getAccessibilityHint","getAccessibilityLabel","containerStyle","container","containerIOS","containerAndroid","createElement","accessible","accessibilityRole","accessibilityActions","name","onAccessibilityAction","event","nativeEvent","actionName","accessibilityLabel","accessibilityHint","importantForAccessibility","cellContainerStyles","cellRowContainerStyle","leftAlign","editable","activeOpacity","valueStyle","showLockIcon","style","testID","onValueChange","onSlidingComplete","ref","slider","sliderRef","sliderIOS","sliderAndroid","min","max"],"sources":["@wordpress/components/src/mobile/bottom-sheet/range-cell.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, AccessibilityInfo, View } from 'react-native';\nimport Slider from '@react-native-community/slider';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\nimport LockIcon from './lock-icon';\nimport styles from './range-cell.scss';\nimport RangeTextInput from './range-text-input';\nimport { toFixed } from '../utils';\n\nconst isIOS = Platform.OS === 'ios';\n\nclass BottomSheetRangeCell extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.onSliderChange = this.onSliderChange.bind( this );\n\t\tthis.onCompleteSliderChange = this.onCompleteSliderChange.bind( this );\n\t\tthis.onTextInputChange = this.onTextInputChange.bind( this );\n\t\tthis.a11yIncrementValue = this.a11yIncrementValue.bind( this );\n\t\tthis.a11yDecrementValue = this.a11yDecrementValue.bind( this );\n\t\tthis.a11yUpdateValue = this.a11yUpdateValue.bind( this );\n\n\t\tconst { value, defaultValue, minimumValue } = props;\n\t\tconst initialValue = Number( value || defaultValue || minimumValue );\n\n\t\tthis.state = {\n\t\t\tinputValue: initialValue,\n\t\t\tsliderValue: initialValue,\n\t\t};\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeoutAnnounceValue );\n\t}\n\n\tonSliderChange( initialValue ) {\n\t\tconst { decimalNum, onChange } = this.props;\n\t\tinitialValue = toFixed( initialValue, decimalNum );\n\t\tthis.setState( { inputValue: initialValue } );\n\t\tonChange( initialValue );\n\t}\n\n\tonTextInputChange( nextValue ) {\n\t\tconst { onChange, onComplete } = this.props;\n\t\tthis.setState( {\n\t\t\tsliderValue: nextValue,\n\t\t} );\n\t\tonChange( nextValue );\n\t\tif ( onComplete ) {\n\t\t\tonComplete( nextValue );\n\t\t}\n\t}\n\n\tonCompleteSliderChange( nextValue ) {\n\t\tconst { decimalNum, onComplete } = this.props;\n\t\tnextValue = toFixed( nextValue, decimalNum );\n\t\tif ( onComplete ) {\n\t\t\tonComplete( nextValue );\n\t\t}\n\t}\n\n\t/*\n\t * Only used with screenreaders like VoiceOver and TalkBack. Increments the\n\t * value of this setting programmatically.\n\t */\n\ta11yIncrementValue() {\n\t\tconst { step = 5, maximumValue, decimalNum } = this.props;\n\t\tconst { inputValue } = this.state;\n\n\t\tconst newValue = toFixed( inputValue + step, decimalNum );\n\n\t\tif ( newValue <= maximumValue || maximumValue === undefined ) {\n\t\t\tthis.a11yUpdateValue( newValue );\n\t\t}\n\t}\n\n\t/*\n\t * Only used with screenreaders like VoiceOver and TalkBack. Decrements the\n\t * value of this setting programmatically.\n\t */\n\ta11yDecrementValue() {\n\t\tconst { step = 5, minimumValue, decimalNum } = this.props;\n\t\tconst { sliderValue } = this.state;\n\n\t\tconst newValue = toFixed( sliderValue - step, decimalNum );\n\n\t\tif ( newValue >= minimumValue ) {\n\t\t\tthis.a11yUpdateValue( newValue );\n\t\t}\n\t}\n\n\ta11yUpdateValue( newValue ) {\n\t\tconst { onChange, onComplete } = this.props;\n\t\tthis.setState( {\n\t\t\tsliderValue: newValue,\n\t\t\tinputValue: newValue,\n\t\t} );\n\t\tonChange( newValue );\n\t\tif ( onComplete ) {\n\t\t\tonComplete( newValue );\n\t\t}\n\t\tthis.announceValue( newValue );\n\t}\n\n\t/*\n\t * Only used with screenreaders like VoiceOver and TalkBack.\n\t */\n\tannounceValue( value ) {\n\t\tconst { label, unitLabel = '' } = this.props;\n\n\t\tif ( isIOS ) {\n\t\t\t// On Android it triggers the accessibilityLabel with the value change, but\n\t\t\t// on iOS we need to do this manually.\n\t\t\tclearTimeout( this.timeoutAnnounceValue );\n\t\t\tthis.timeoutAnnounceValue = setTimeout( () => {\n\t\t\t\tAccessibilityInfo.announceForAccessibility(\n\t\t\t\t\t`${ value } ${ unitLabel }, ${ label }`\n\t\t\t\t);\n\t\t\t}, 300 );\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tminimumValue = 0,\n\t\t\tmaximumValue = 10,\n\t\t\tdisabled,\n\t\t\tstep = 1,\n\t\t\tpreferredColorScheme,\n\t\t\tminimumTrackTintColor = preferredColorScheme === 'light'\n\t\t\t\t? '#00669b'\n\t\t\t\t: '#5198d9',\n\t\t\tmaximumTrackTintColor = isIOS ? '#e9eff3' : '#909090',\n\t\t\tthumbTintColor = ! isIOS && '#00669b',\n\t\t\tpreview,\n\t\t\tcellContainerStyle,\n\t\t\tshouldDisplayTextInput = true,\n\t\t\tunitLabel = '',\n\t\t\tsettingLabel = 'Value',\n\t\t\topenUnitPicker,\n\t\t\tchildren,\n\t\t\tdecimalNum,\n\t\t\t...cellProps\n\t\t} = this.props;\n\n\t\tconst { inputValue, sliderValue } = this.state;\n\n\t\tconst getAccessibilityHint = () => {\n\t\t\treturn openUnitPicker ? __( 'double-tap to change unit' ) : '';\n\t\t};\n\n\t\tconst getAccessibilityLabel = () => {\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: accessibility text. Inform about current value. %1$s: Control label %2$s: setting label (example: width), %3$s: Current value. %4$s: value measurement unit (example: pixels) */\n\t\t\t\t__( '%1$s. %2$s is %3$s %4$s.' ),\n\t\t\t\tcellProps.label,\n\t\t\t\tsettingLabel,\n\t\t\t\ttoFixed( value, decimalNum ),\n\t\t\t\tunitLabel\n\t\t\t);\n\t\t};\n\n\t\tconst containerStyle = [\n\t\t\tstyles.container,\n\t\t\tisIOS ? styles.containerIOS : styles.containerAndroid,\n\t\t];\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\taccessible\n\t\t\t\taccessibilityRole=\"adjustable\"\n\t\t\t\taccessibilityActions={ [\n\t\t\t\t\t{ name: 'increment' },\n\t\t\t\t\t{ name: 'decrement' },\n\t\t\t\t\t{ name: 'activate' },\n\t\t\t\t] }\n\t\t\t\tonAccessibilityAction={ ( event ) => {\n\t\t\t\t\tswitch ( event.nativeEvent.actionName ) {\n\t\t\t\t\t\tcase 'increment':\n\t\t\t\t\t\t\tthis.a11yIncrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'decrement':\n\t\t\t\t\t\t\tthis.a11yDecrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'activate':\n\t\t\t\t\t\t\tif ( openUnitPicker ) {\n\t\t\t\t\t\t\t\topenUnitPicker();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t\taccessibilityLabel={ getAccessibilityLabel() }\n\t\t\t\taccessibilityHint={ getAccessibilityHint() }\n\t\t\t>\n\t\t\t\t<View importantForAccessibility=\"no-hide-descendants\">\n\t\t\t\t\t<Cell\n\t\t\t\t\t\t{ ...cellProps }\n\t\t\t\t\t\tcellContainerStyle={ [\n\t\t\t\t\t\t\tstyles.cellContainerStyles,\n\t\t\t\t\t\t\tcellContainerStyle,\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tcellRowContainerStyle={ containerStyle }\n\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\teditable={ false }\n\t\t\t\t\t\tactiveOpacity={ 1 }\n\t\t\t\t\t\taccessible={ false }\n\t\t\t\t\t\tvalueStyle={ styles.valueStyle }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tshowLockIcon={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ containerStyle }>\n\t\t\t\t\t\t\t{ preview }\n\t\t\t\t\t\t\t<Slider\n\t\t\t\t\t\t\t\ttestID={ `Slider ${ cellProps.label }` }\n\t\t\t\t\t\t\t\tvalue={ sliderValue }\n\t\t\t\t\t\t\t\tdefaultValue={ defaultValue }\n\t\t\t\t\t\t\t\tdisabled={ disabled && ! isIOS }\n\t\t\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t\t\tminimumValue={ minimumValue }\n\t\t\t\t\t\t\t\tmaximumValue={ maximumValue }\n\t\t\t\t\t\t\t\tminimumTrackTintColor={ minimumTrackTintColor }\n\t\t\t\t\t\t\t\tmaximumTrackTintColor={ maximumTrackTintColor }\n\t\t\t\t\t\t\t\tthumbTintColor={ thumbTintColor }\n\t\t\t\t\t\t\t\tonValueChange={ this.onSliderChange }\n\t\t\t\t\t\t\t\tonSlidingComplete={\n\t\t\t\t\t\t\t\t\tthis.onCompleteSliderChange\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tref={ ( slider ) => {\n\t\t\t\t\t\t\t\t\tthis.sliderRef = slider;\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tisIOS\n\t\t\t\t\t\t\t\t\t\t? styles.sliderIOS\n\t\t\t\t\t\t\t\t\t\t: styles.sliderAndroid\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ shouldDisplayTextInput && (\n\t\t\t\t\t\t\t\t<RangeTextInput\n\t\t\t\t\t\t\t\t\tlabel={ cellProps.label }\n\t\t\t\t\t\t\t\t\tonChange={ this.onTextInputChange }\n\t\t\t\t\t\t\t\t\tdefaultValue={ `${ inputValue }` }\n\t\t\t\t\t\t\t\t\tvalue={ inputValue }\n\t\t\t\t\t\t\t\t\tmin={ minimumValue }\n\t\t\t\t\t\t\t\t\tmax={ maximumValue }\n\t\t\t\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t\t\t\tdecimalNum={ decimalNum }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t\t</RangeTextInput>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ disabled && <LockIcon /> }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</Cell>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default withPreferredColorScheme( BottomSheetRangeCell );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,iBAAiB,EAAEC,IAAI,QAAQ,cAAc;AAChE,OAAOC,MAAM,MAAM,gCAAgC;;AAEnD;AACA;AACA;AACA,SAASC,EAA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iB,EAChB,IAAI,CAACvE,sBACL;MACDwE,GAAG,EAAKC,MAAM,IAAM;QACnB,IAAI,CAACC,SAAS,GAAGD,MAAM;MACxB,CAAG;MACHL,KAAK,EACJ3E,KAAK,GACFH,MAAM,CAACqF,SAAS,GAChBrF,MAAM,CAACsF;IACV,CACD,CAAC,EACAtC,sBAAsB,IACvBW,aAAA,CAAC1D,cAAc;MACdmC,KAAK,EAAGgB,SAAS,CAAChB,KAAO;MACzBT,QAAQ,EAAG,IAAI,CAAChB,iBAAmB;MACnCK,YAAY,EAAI,GAAGK,UAAY,EAAG;MAClCN,KAAK,EAAGM,UAAY;MACpBkE,GAAG,EAAGtE,YAAc;MACpBuE,GAAG,EAAGxD,YAAc;MACpBD,IAAI,EAAGA,IAAM;MACbL,UAAU,EAAGA;IAAY,GAEvByB,QACa,CAChB,EACCV,QAAQ,IAAIkB,aAAA,CAAC5D,QAAQ,MAAE,CACpB,CACD,CACD,CACD,CAAC;EAET;AACD;AAEA,eAAeF,wBAAwB,CAAEQ,oBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AccessibilityInfo","View","Platform","__","sprintf","Component","withPreferredColorScheme","Cell","Stepper","styles","RangeTextInput","toFixed","STEP_DELAY","DEFAULT_STEP","isIOS","OS","BottomSheetStepperCell","constructor","props","announceValue","bind","onDecrementValue","onDecrementValuePressIn","onIncrementValue","onIncrementValuePressIn","onPressOut","value","defaultValue","min","initialValue","state","inputValue","stepperValue","componentWillUnmount","clearTimeout","timeout","clearInterval","interval","timeoutAnnounceValue","step","max","onChange","decimalNum","newValue","parseInt","undefined","setState","setTimeout","startPressInterval","callback","speed","counter","setInterval","label","unitLabel","announceForAccessibility","render","settingLabel","icon","separatorType","children","shouldDisplayTextInput","preview","openUnitPicker","cellContainerStyle","disabled","isMinValue","isMaxValue","labelStyle","cellLabel","cellLabelNoIcon","getAccessibilityHint","accessibilityLabel","containerStyle","rowContainer","containerIOS","containerAndroid","createElement","accessible","accessibilityRole","accessibilityHint","accessibilityActions","name","onAccessibilityAction","event","nativeEvent","actionName","importantForAccessibility","columnContainer","cellRowContainerStyle","cellRowStyles","editable","leftAlign","style","onPressInDecrement","onPressInIncrement","defaultProps"],"sources":["@wordpress/components/src/mobile/bottom-sheet/stepper-cell/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { AccessibilityInfo, View, Platform } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Cell from '../cell';\nimport Stepper from './stepper';\nimport styles from './style.scss';\nimport RangeTextInput from '../range-text-input';\nimport { toFixed } from '../../utils';\n\nconst STEP_DELAY = 200;\nconst DEFAULT_STEP = 1;\n\nconst isIOS = Platform.OS === 'ios';\n\nclass BottomSheetStepperCell extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.announceValue = this.announceValue.bind( this );\n\t\tthis.onDecrementValue = this.onDecrementValue.bind( this );\n\t\tthis.onDecrementValuePressIn =\n\t\t\tthis.onDecrementValuePressIn.bind( this );\n\t\tthis.onIncrementValue = this.onIncrementValue.bind( this );\n\t\tthis.onIncrementValuePressIn =\n\t\t\tthis.onIncrementValuePressIn.bind( this );\n\t\tthis.onPressOut = this.onPressOut.bind( this );\n\n\t\tconst { value, defaultValue, min } = props;\n\n\t\tconst initialValue = value || defaultValue || min;\n\n\t\tthis.state = {\n\t\t\tinputValue: initialValue,\n\t\t\tstepperValue: initialValue,\n\t\t};\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeout );\n\t\tclearInterval( this.interval );\n\t\tclearTimeout( this.timeoutAnnounceValue );\n\t}\n\n\tonIncrementValue() {\n\t\tconst { step, max, onChange, value, decimalNum } = this.props;\n\t\tlet newValue = toFixed( value + step, decimalNum );\n\t\tnewValue =\n\t\t\tparseInt( newValue ) === newValue ? parseInt( newValue ) : newValue;\n\t\tif ( newValue <= max || max === undefined ) {\n\t\t\tonChange( newValue );\n\t\t\tthis.setState( {\n\t\t\t\tinputValue: newValue,\n\t\t\t} );\n\t\t\tthis.announceValue( newValue );\n\t\t}\n\t}\n\n\tonDecrementValue() {\n\t\tconst { step, min, onChange, value, decimalNum } = this.props;\n\t\tlet newValue = toFixed( value - step, decimalNum );\n\t\tnewValue =\n\t\t\tparseInt( newValue ) === newValue ? parseInt( newValue ) : newValue;\n\t\tif ( newValue >= min ) {\n\t\t\tonChange( newValue );\n\t\t\tthis.setState( {\n\t\t\t\tinputValue: newValue,\n\t\t\t} );\n\t\t\tthis.announceValue( newValue );\n\t\t}\n\t}\n\n\tonIncrementValuePressIn() {\n\t\tthis.onIncrementValue();\n\t\tthis.timeout = setTimeout( () => {\n\t\t\tthis.startPressInterval( this.onIncrementValue );\n\t\t}, 500 );\n\t}\n\n\tonDecrementValuePressIn() {\n\t\tthis.onDecrementValue();\n\t\tthis.timeout = setTimeout( () => {\n\t\t\tthis.startPressInterval( this.onDecrementValue );\n\t\t}, 500 );\n\t}\n\n\tonPressOut() {\n\t\tclearTimeout( this.timeout );\n\t\tclearInterval( this.interval );\n\t}\n\n\tstartPressInterval( callback, speed = STEP_DELAY ) {\n\t\tlet counter = 0;\n\t\tthis.interval = setInterval( () => {\n\t\t\tcallback();\n\t\t\tcounter += 1;\n\n\t\t\tif ( counter === 10 ) {\n\t\t\t\tclearInterval( this.interval );\n\t\t\t\tthis.startPressInterval( callback, speed / 2 );\n\t\t\t}\n\t\t}, speed );\n\t}\n\n\tannounceValue( value ) {\n\t\tconst { label, unitLabel = '' } = this.props;\n\n\t\tif ( isIOS ) {\n\t\t\t// On Android it triggers the accessibilityLabel with the value change\n\t\t\tclearTimeout( this.timeoutAnnounceValue );\n\t\t\tthis.timeoutAnnounceValue = setTimeout( () => {\n\t\t\t\tAccessibilityInfo.announceForAccessibility(\n\t\t\t\t\t`${ value } ${ unitLabel } ${ label }`\n\t\t\t\t);\n\t\t\t}, 300 );\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tlabel,\n\t\t\tsettingLabel = 'Value',\n\t\t\tunitLabel = '',\n\t\t\ticon,\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tvalue,\n\t\t\tseparatorType,\n\t\t\tchildren,\n\t\t\tshouldDisplayTextInput = false,\n\t\t\tpreview,\n\t\t\tonChange,\n\t\t\topenUnitPicker,\n\t\t\tdecimalNum,\n\t\t\tcellContainerStyle,\n\t\t\tdisabled,\n\t\t} = this.props;\n\t\tconst { inputValue } = this.state;\n\t\tconst isMinValue = value === min;\n\t\tconst isMaxValue = value === max;\n\t\tconst labelStyle = [\n\t\t\tstyles.cellLabel,\n\t\t\t! icon ? styles.cellLabelNoIcon : {},\n\t\t];\n\n\t\tconst getAccessibilityHint = () => {\n\t\t\treturn openUnitPicker ? __( 'double-tap to change unit' ) : '';\n\t\t};\n\n\t\tconst accessibilityLabel = sprintf(\n\t\t\t/* translators: accessibility text. Inform about current value. %1$s: Control label %2$s: setting label (example: width), %3$s: Current value. %4$s: value measurement unit (example: pixels) */\n\t\t\t__( '%1$s. %2$s is %3$s %4$s.' ),\n\t\t\tlabel,\n\t\t\tsettingLabel,\n\t\t\tvalue,\n\t\t\tunitLabel\n\t\t);\n\n\t\tconst containerStyle = [\n\t\t\tstyles.rowContainer,\n\t\t\tisIOS ? styles.containerIOS : styles.containerAndroid,\n\t\t];\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\taccessible={ true }\n\t\t\t\taccessibilityRole=\"adjustable\"\n\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\taccessibilityHint={ getAccessibilityHint() }\n\t\t\t\taccessibilityActions={ [\n\t\t\t\t\t{ name: 'increment' },\n\t\t\t\t\t{ name: 'decrement' },\n\t\t\t\t\t{ name: 'activate' },\n\t\t\t\t] }\n\t\t\t\tonAccessibilityAction={ ( event ) => {\n\t\t\t\t\tswitch ( event.nativeEvent.actionName ) {\n\t\t\t\t\t\tcase 'increment':\n\t\t\t\t\t\t\tthis.onIncrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'decrement':\n\t\t\t\t\t\t\tthis.onDecrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'activate':\n\t\t\t\t\t\t\tif ( openUnitPicker ) {\n\t\t\t\t\t\t\t\topenUnitPicker();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<View importantForAccessibility=\"no-hide-descendants\">\n\t\t\t\t\t<Cell\n\t\t\t\t\t\taccessible={ false }\n\t\t\t\t\t\tcellContainerStyle={ [\n\t\t\t\t\t\t\tstyles.cellContainerStyle,\n\t\t\t\t\t\t\tpreview && styles.columnContainer,\n\t\t\t\t\t\t\tcellContainerStyle,\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tcellRowContainerStyle={\n\t\t\t\t\t\t\tpreview ? containerStyle : styles.cellRowStyles\n\t\t\t\t\t\t}\n\t\t\t\t\t\teditable={ false }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tlabelStyle={ labelStyle }\n\t\t\t\t\t\tleftAlign={ true }\n\t\t\t\t\t\tseparatorType={ separatorType }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ preview && containerStyle }>\n\t\t\t\t\t\t\t{ preview }\n\t\t\t\t\t\t\t<Stepper\n\t\t\t\t\t\t\t\tisMaxValue={ isMaxValue }\n\t\t\t\t\t\t\t\tisMinValue={ isMinValue }\n\t\t\t\t\t\t\t\tonPressInDecrement={\n\t\t\t\t\t\t\t\t\tthis.onDecrementValuePressIn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonPressInIncrement={\n\t\t\t\t\t\t\t\t\tthis.onIncrementValuePressIn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonPressOut={ this.onPressOut }\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tshouldDisplayTextInput={\n\t\t\t\t\t\t\t\t\tshouldDisplayTextInput\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ shouldDisplayTextInput && (\n\t\t\t\t\t\t\t\t\t<RangeTextInput\n\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\t\t\tdefaultValue={ `${ inputValue }` }\n\t\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\t\t\t\tdecimalNum={ decimalNum }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t\t\t</RangeTextInput>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Stepper>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</Cell>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nBottomSheetStepperCell.defaultProps = {\n\tstep: DEFAULT_STEP,\n};\n\nexport default withPreferredColorScheme( BottomSheetStepperCell );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,iBAAiB,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;;AAEhE;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,cAAc,MAAM,qBAAqB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EAAG,CAAG;MACVG,UAAU,EAAGA;IAAY,GAEvBkB,QACa,CAET,CACJ,CACD,CACD,CACD,CAAC;EAET;AACD;AAEA5C,sBAAsB,CAACgF,YAAY,GAAG;EACrCzD,IAAI,EAAE1B;AACP,CAAC;AAED,eAAeP,wBAAwB,CAAEU,sBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"names":["AccessibilityInfo","View","Platform","__","sprintf","Component","withPreferredColorScheme","Cell","Stepper","styles","RangeTextInput","toFixed","STEP_DELAY","DEFAULT_STEP","isIOS","OS","BottomSheetStepperCell","constructor","props","announceValue","bind","onDecrementValue","onDecrementValuePressIn","onIncrementValue","onIncrementValuePressIn","onPressOut","value","defaultValue","min","initialValue","state","inputValue","stepperValue","componentWillUnmount","clearTimeout","timeout","clearInterval","interval","timeoutAnnounceValue","step","max","onChange","decimalNum","newValue","parseInt","undefined","setState","setTimeout","startPressInterval","callback","speed","counter","setInterval","label","unitLabel","announceForAccessibility","render","settingLabel","icon","separatorType","children","shouldDisplayTextInput","preview","openUnitPicker","cellContainerStyle","disabled","isMinValue","isMaxValue","labelStyle","cellLabel","cellLabelNoIcon","getAccessibilityHint","accessibilityLabel","containerStyle","rowContainer","containerIOS","containerAndroid","createElement","accessible","accessibilityRole","accessibilityHint","accessibilityActions","name","onAccessibilityAction","event","nativeEvent","actionName","importantForAccessibility","columnContainer","cellRowContainerStyle","cellRowStyles","editable","leftAlign","style","onPressInDecrement","onPressInIncrement","defaultProps"],"sources":["@wordpress/components/src/mobile/bottom-sheet/stepper-cell/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { AccessibilityInfo, View, Platform } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Cell from '../cell';\nimport Stepper from './stepper';\nimport styles from './style.scss';\nimport RangeTextInput from '../range-text-input';\nimport { toFixed } from '../../utils';\n\nconst STEP_DELAY = 200;\nconst DEFAULT_STEP = 1;\n\nconst isIOS = Platform.OS === 'ios';\n\nclass BottomSheetStepperCell extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.announceValue = this.announceValue.bind( this );\n\t\tthis.onDecrementValue = this.onDecrementValue.bind( this );\n\t\tthis.onDecrementValuePressIn =\n\t\t\tthis.onDecrementValuePressIn.bind( this );\n\t\tthis.onIncrementValue = this.onIncrementValue.bind( this );\n\t\tthis.onIncrementValuePressIn =\n\t\t\tthis.onIncrementValuePressIn.bind( this );\n\t\tthis.onPressOut = this.onPressOut.bind( this );\n\n\t\tconst { value, defaultValue, min } = props;\n\n\t\tconst initialValue = value || defaultValue || min;\n\n\t\tthis.state = {\n\t\t\tinputValue: initialValue,\n\t\t\tstepperValue: initialValue,\n\t\t};\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeout );\n\t\tclearInterval( this.interval );\n\t\tclearTimeout( this.timeoutAnnounceValue );\n\t}\n\n\tonIncrementValue() {\n\t\tconst { step, max, onChange, value, decimalNum } = this.props;\n\t\tlet newValue = toFixed( value + step, decimalNum );\n\t\tnewValue =\n\t\t\tparseInt( newValue ) === newValue ? parseInt( newValue ) : newValue;\n\t\tif ( newValue <= max || max === undefined ) {\n\t\t\tonChange( newValue );\n\t\t\tthis.setState( {\n\t\t\t\tinputValue: newValue,\n\t\t\t} );\n\t\t\tthis.announceValue( newValue );\n\t\t}\n\t}\n\n\tonDecrementValue() {\n\t\tconst { step, min, onChange, value, decimalNum } = this.props;\n\t\tlet newValue = toFixed( value - step, decimalNum );\n\t\tnewValue =\n\t\t\tparseInt( newValue ) === newValue ? parseInt( newValue ) : newValue;\n\t\tif ( newValue >= min ) {\n\t\t\tonChange( newValue );\n\t\t\tthis.setState( {\n\t\t\t\tinputValue: newValue,\n\t\t\t} );\n\t\t\tthis.announceValue( newValue );\n\t\t}\n\t}\n\n\tonIncrementValuePressIn() {\n\t\tthis.onIncrementValue();\n\t\tthis.timeout = setTimeout( () => {\n\t\t\tthis.startPressInterval( this.onIncrementValue );\n\t\t}, 500 );\n\t}\n\n\tonDecrementValuePressIn() {\n\t\tthis.onDecrementValue();\n\t\tthis.timeout = setTimeout( () => {\n\t\t\tthis.startPressInterval( this.onDecrementValue );\n\t\t}, 500 );\n\t}\n\n\tonPressOut() {\n\t\tclearTimeout( this.timeout );\n\t\tclearInterval( this.interval );\n\t}\n\n\tstartPressInterval( callback, speed = STEP_DELAY ) {\n\t\tlet counter = 0;\n\t\tthis.interval = setInterval( () => {\n\t\t\tcallback();\n\t\t\tcounter += 1;\n\n\t\t\tif ( counter === 10 ) {\n\t\t\t\tclearInterval( this.interval );\n\t\t\t\tthis.startPressInterval( callback, speed / 2 );\n\t\t\t}\n\t\t}, speed );\n\t}\n\n\tannounceValue( value ) {\n\t\tconst { label, unitLabel = '' } = this.props;\n\n\t\tif ( isIOS ) {\n\t\t\t// On Android it triggers the accessibilityLabel with the value change\n\t\t\tclearTimeout( this.timeoutAnnounceValue );\n\t\t\tthis.timeoutAnnounceValue = setTimeout( () => {\n\t\t\t\tAccessibilityInfo.announceForAccessibility(\n\t\t\t\t\t`${ value } ${ unitLabel } ${ label }`\n\t\t\t\t);\n\t\t\t}, 300 );\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tlabel,\n\t\t\tsettingLabel = 'Value',\n\t\t\tunitLabel = '',\n\t\t\ticon,\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tvalue,\n\t\t\tseparatorType,\n\t\t\tchildren,\n\t\t\tshouldDisplayTextInput = false,\n\t\t\tpreview,\n\t\t\tonChange,\n\t\t\topenUnitPicker,\n\t\t\tdecimalNum,\n\t\t\tcellContainerStyle,\n\t\t\tdisabled,\n\t\t} = this.props;\n\t\tconst { inputValue } = this.state;\n\t\tconst isMinValue = value === min;\n\t\tconst isMaxValue = value === max;\n\t\tconst labelStyle = [\n\t\t\tstyles.cellLabel,\n\t\t\t! icon ? styles.cellLabelNoIcon : {},\n\t\t];\n\n\t\tconst getAccessibilityHint = () => {\n\t\t\treturn openUnitPicker ? __( 'double-tap to change unit' ) : '';\n\t\t};\n\n\t\tconst accessibilityLabel = sprintf(\n\t\t\t/* translators: accessibility text. Inform about current value. %1$s: Control label %2$s: setting label (example: width), %3$s: Current value. %4$s: value measurement unit (example: pixels) */\n\t\t\t__( '%1$s. %2$s is %3$s %4$s.' ),\n\t\t\tlabel,\n\t\t\tsettingLabel,\n\t\t\tvalue,\n\t\t\tunitLabel\n\t\t);\n\n\t\tconst containerStyle = [\n\t\t\tstyles.rowContainer,\n\t\t\tisIOS ? styles.containerIOS : styles.containerAndroid,\n\t\t];\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\taccessible\n\t\t\t\taccessibilityRole=\"adjustable\"\n\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\taccessibilityHint={ getAccessibilityHint() }\n\t\t\t\taccessibilityActions={ [\n\t\t\t\t\t{ name: 'increment' },\n\t\t\t\t\t{ name: 'decrement' },\n\t\t\t\t\t{ name: 'activate' },\n\t\t\t\t] }\n\t\t\t\tonAccessibilityAction={ ( event ) => {\n\t\t\t\t\tswitch ( event.nativeEvent.actionName ) {\n\t\t\t\t\t\tcase 'increment':\n\t\t\t\t\t\t\tthis.onIncrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'decrement':\n\t\t\t\t\t\t\tthis.onDecrementValue();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'activate':\n\t\t\t\t\t\t\tif ( openUnitPicker ) {\n\t\t\t\t\t\t\t\topenUnitPicker();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<View importantForAccessibility=\"no-hide-descendants\">\n\t\t\t\t\t<Cell\n\t\t\t\t\t\taccessible={ false }\n\t\t\t\t\t\tcellContainerStyle={ [\n\t\t\t\t\t\t\tstyles.cellContainerStyle,\n\t\t\t\t\t\t\tpreview && styles.columnContainer,\n\t\t\t\t\t\t\tcellContainerStyle,\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tcellRowContainerStyle={\n\t\t\t\t\t\t\tpreview ? containerStyle : styles.cellRowStyles\n\t\t\t\t\t\t}\n\t\t\t\t\t\teditable={ false }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tlabelStyle={ labelStyle }\n\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\tseparatorType={ separatorType }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ preview && containerStyle }>\n\t\t\t\t\t\t\t{ preview }\n\t\t\t\t\t\t\t<Stepper\n\t\t\t\t\t\t\t\tisMaxValue={ isMaxValue }\n\t\t\t\t\t\t\t\tisMinValue={ isMinValue }\n\t\t\t\t\t\t\t\tonPressInDecrement={\n\t\t\t\t\t\t\t\t\tthis.onDecrementValuePressIn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonPressInIncrement={\n\t\t\t\t\t\t\t\t\tthis.onIncrementValuePressIn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonPressOut={ this.onPressOut }\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tshouldDisplayTextInput={\n\t\t\t\t\t\t\t\t\tshouldDisplayTextInput\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ shouldDisplayTextInput && (\n\t\t\t\t\t\t\t\t\t<RangeTextInput\n\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\t\t\tdefaultValue={ `${ inputValue }` }\n\t\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\t\t\t\tdecimalNum={ decimalNum }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t\t\t</RangeTextInput>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Stepper>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</Cell>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nBottomSheetStepperCell.defaultProps = {\n\tstep: DEFAULT_STEP,\n};\n\nexport default withPreferredColorScheme( BottomSheetStepperCell );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,iBAAiB,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;;AAEhE;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,cAAc,MAAM,qBAAqB;AAChD,SAASC,OAAO,QAAQ,aAAa;AAErC,MAAMC,UAAU,GAAG,GAAG;AACtB,MAAMC,YAAY,GAAG,CAAC;AAEtB,MAAMC,KAAK,GAAGZ,QAAQ,CAACa,EAAE,KAAK,KAAK;AAEnC,MAAMC,sBAAsB,SAASX,SAAS,CAAC;EAC9CY,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAEA,KAAM,CAAC;IAEd,IAAI,CAACC,aAAa,GAAG,IAAI,CAACA,aAAa,CAACC,IAAI,CAAE,IAAK,CAAC;IACpD,IAAI,CAACC,gBAAgB,GAAG,IAAI,CAACA,gBAAgB,CAACD,IAAI,CAAE,IAAK,CAAC;IAC1D,IAAI,CAACE,uBAAuB,GAC3B,IAAI,CAACA,uBAAu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,MAAM,CAACiF,aAClC;MACDC,QAAQ,EAAG,KAAO;MAClBjC,IAAI,EAAGA,IAAM;MACbL,KAAK,EAAGA,KAAO;MACfe,UAAU,EAAGA,UAAY;MACzBwB,SAAS;MACTjC,aAAa,EAAGA,aAAe;MAC/BM,QAAQ,EAAGA;IAAU,GAErBY,aAAA,CAAC5E,IAAI;MAAC4F,KAAK,EAAG/B,OAAO,IAAIW;IAAgB,GACtCX,OAAO,EACTe,aAAA,CAACrE,OAAO;MACP2D,UAAU,EAAGA,UAAY;MACzBD,UAAU,EAAGA,UAAY;MACzB4B,kBAAkB,EACjB,IAAI,CAACxE,uBACL;MACDyE,kBAAkB,EACjB,IAAI,CAACvE,uBACL;MACDC,UAAU,EAAG,IAAI,CAACA,UAAY;MAC9BC,KAAK,EAAGA,KAAO;MACfmC,sBAAsB,EACrBA;IACA,GAECA,sBAAsB,IACvBgB,aAAA,CAACnE,cAAc;MACd2C,KAAK,EAAGA,KAAO;MACfZ,QAAQ,EAAGA,QAAU;MACrBd,YAAY,EAAI,GAAGI,UAAY,EAAG;MAClCL,KAAK,EAAGA,KAAO;MACfE,GAAG,EAAGA,GAAK;MACXW,IAAI,EAAG,CAAG;MACVG,UAAU,EAAGA;IAAY,GAEvBkB,QACa,CAET,CACJ,CACD,CACD,CACD,CAAC;EAET;AACD;AAEA5C,sBAAsB,CAACgF,YAAY,GAAG;EACrCzD,IAAI,EAAE1B;AACP,CAAC;AAED,eAAeP,wBAAwB,CAAEU,sBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","useNavigation","useState","Icon","chevronRight","check","__","sprintf","BottomSheet","styles","BottomSheetSelectControl","label","icon","options","items","onChange","value","selectedValue","disabled","showSubSheet","setShowSubSheet","navigation","onChangeValue","goBack","selectedOption","find","option","openSubSheet","navigate","SubSheet","screenName","createElement","navigationButton","Cell","separatorType","onPress","accessibilityRole","accessibilityLabel","accessibilityHint","showSheet","Fragment","NavBar","BackButton","Heading","style","selectControl","map","item","index","customActionButton","leftAlign","key"],"sources":["@wordpress/components/src/mobile/bottom-sheet-select-control/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useNavigation } from '@react-navigation/native';\nimport { useState } from '@wordpress/element';\nimport { Icon, chevronRight, check } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { BottomSheet } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst BottomSheetSelectControl = ( {\n\tlabel,\n\ticon,\n\toptions: items,\n\tonChange,\n\tvalue: selectedValue,\n\tdisabled,\n} ) => {\n\tconst [ showSubSheet, setShowSubSheet ] = useState( false );\n\tconst navigation = useNavigation();\n\n\tconst onChangeValue = ( value ) => {\n\t\treturn () => {\n\t\t\tgoBack();\n\t\t\tonChange( value );\n\t\t};\n\t};\n\n\tconst selectedOption = items.find(\n\t\t( option ) => option.value === selectedValue\n\t);\n\n\tconst goBack = () => {\n\t\tsetShowSubSheet( false );\n\t\tnavigation.goBack();\n\t};\n\n\tconst openSubSheet = () => {\n\t\tnavigation.navigate( BottomSheet.SubSheet.screenName );\n\t\tsetShowSubSheet( true );\n\t};\n\n\treturn (\n\t\t<BottomSheet.SubSheet\n\t\t\tnavigationButton={\n\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tseparatorType=\"none\"\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tvalue={ selectedOption.label }\n\t\t\t\t\tonPress={ openSubSheet }\n\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\taccessibilityLabel={ sprintf(\n\t\t\t\t\t\t// translators: %1$s: Select control button label e.g. \"Button width\". %2$s: Select control option value e.g: \"Auto, 25%\".\n\t\t\t\t\t\t__( '%1$s. Currently selected: %2$s' ),\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tselectedOption.label\n\t\t\t\t\t) }\n\t\t\t\t\taccessibilityHint={ sprintf(\n\t\t\t\t\t\t// translators: %s: Select control button label e.g. \"Button width\"\n\t\t\t\t\t\t__( 'Navigates to select %s' ),\n\t\t\t\t\t\tlabel\n\t\t\t\t\t) }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t>\n\t\t\t\t\t{ disabled ? null : <Icon icon={ chevronRight } /> }\n\t\t\t\t</BottomSheet.Cell>\n\t\t\t}\n\t\t\tshowSheet={ showSubSheet }\n\t\t>\n\t\t\t<>\n\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t<BottomSheet.NavBar.BackButton onPress={ goBack } />\n\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t<View style={ styles.selectControl }>\n\t\t\t\t\t{ items.map( ( item, index ) => (\n\t\t\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\t\t\tcustomActionButton\n\t\t\t\t\t\t\tseparatorType=\"none\"\n\t\t\t\t\t\t\tlabel={ item.label }\n\t\t\t\t\t\t\ticon={ item.icon }\n\t\t\t\t\t\t\tonPress={ onChangeValue( item.value ) }\n\t\t\t\t\t\t\tleftAlign
|
|
1
|
+
{"version":3,"names":["View","useNavigation","useState","Icon","chevronRight","check","__","sprintf","BottomSheet","styles","BottomSheetSelectControl","label","icon","options","items","onChange","value","selectedValue","disabled","showSubSheet","setShowSubSheet","navigation","onChangeValue","goBack","selectedOption","find","option","openSubSheet","navigate","SubSheet","screenName","createElement","navigationButton","Cell","separatorType","onPress","accessibilityRole","accessibilityLabel","accessibilityHint","showSheet","Fragment","NavBar","BackButton","Heading","style","selectControl","map","item","index","customActionButton","leftAlign","key"],"sources":["@wordpress/components/src/mobile/bottom-sheet-select-control/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useNavigation } from '@react-navigation/native';\nimport { useState } from '@wordpress/element';\nimport { Icon, chevronRight, check } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { BottomSheet } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst BottomSheetSelectControl = ( {\n\tlabel,\n\ticon,\n\toptions: items,\n\tonChange,\n\tvalue: selectedValue,\n\tdisabled,\n} ) => {\n\tconst [ showSubSheet, setShowSubSheet ] = useState( false );\n\tconst navigation = useNavigation();\n\n\tconst onChangeValue = ( value ) => {\n\t\treturn () => {\n\t\t\tgoBack();\n\t\t\tonChange( value );\n\t\t};\n\t};\n\n\tconst selectedOption = items.find(\n\t\t( option ) => option.value === selectedValue\n\t);\n\n\tconst goBack = () => {\n\t\tsetShowSubSheet( false );\n\t\tnavigation.goBack();\n\t};\n\n\tconst openSubSheet = () => {\n\t\tnavigation.navigate( BottomSheet.SubSheet.screenName );\n\t\tsetShowSubSheet( true );\n\t};\n\n\treturn (\n\t\t<BottomSheet.SubSheet\n\t\t\tnavigationButton={\n\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tseparatorType=\"none\"\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tvalue={ selectedOption.label }\n\t\t\t\t\tonPress={ openSubSheet }\n\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\taccessibilityLabel={ sprintf(\n\t\t\t\t\t\t// translators: %1$s: Select control button label e.g. \"Button width\". %2$s: Select control option value e.g: \"Auto, 25%\".\n\t\t\t\t\t\t__( '%1$s. Currently selected: %2$s' ),\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tselectedOption.label\n\t\t\t\t\t) }\n\t\t\t\t\taccessibilityHint={ sprintf(\n\t\t\t\t\t\t// translators: %s: Select control button label e.g. \"Button width\"\n\t\t\t\t\t\t__( 'Navigates to select %s' ),\n\t\t\t\t\t\tlabel\n\t\t\t\t\t) }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t>\n\t\t\t\t\t{ disabled ? null : <Icon icon={ chevronRight } /> }\n\t\t\t\t</BottomSheet.Cell>\n\t\t\t}\n\t\t\tshowSheet={ showSubSheet }\n\t\t>\n\t\t\t<>\n\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t<BottomSheet.NavBar.BackButton onPress={ goBack } />\n\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t<View style={ styles.selectControl }>\n\t\t\t\t\t{ items.map( ( item, index ) => (\n\t\t\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\t\t\tcustomActionButton\n\t\t\t\t\t\t\tseparatorType=\"none\"\n\t\t\t\t\t\t\tlabel={ item.label }\n\t\t\t\t\t\t\ticon={ item.icon }\n\t\t\t\t\t\t\tonPress={ onChangeValue( item.value ) }\n\t\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\t\taccessibilityLabel={\n\t\t\t\t\t\t\t\titem.value === selectedValue\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// translators: %s: Select control option value e.g: \"Auto, 25%\".\n\t\t\t\t\t\t\t\t\t\t\t__( 'Selected: %s' ),\n\t\t\t\t\t\t\t\t\t\t\titem.label\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: item.label\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taccessibilityHint={ __( 'Double tap to select' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.value === selectedValue && (\n\t\t\t\t\t\t\t\t<Icon icon={ check }></Icon>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BottomSheet.Cell>\n\t\t\t\t\t) ) }\n\t\t\t\t</View>\n\t\t\t</>\n\t\t</BottomS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C,kBAAkB,EACjBU,IAAI,CAAC/B,KAAK,KAAKC,aAAa,GACzBV,OAAO;IACP;IACAD,EAAE,CAAE,cAAe,CAAC,EACpByC,IAAI,CAACpC,KACL,CAAC,GACDoC,IAAI,CAACpC,KACR;IACD2B,iBAAiB,EAAGhC,EAAE,CAAE,sBAAuB;EAAG,GAEhDyC,IAAI,CAAC/B,KAAK,KAAKC,aAAa,IAC7Bc,aAAA,CAAC5B,IAAI;IAACS,IAAI,EAAGP;EAAO,CAAO,CAEX,CACjB,CACG,CACL,CACmB,CAAC;AAEzB,CAAC;AAED,eAAeK,wBAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TextInput","useNavigation","useState","Icon","chevronRight","usePreferredColorSchemeStyle","BottomSheet","PanelBody","FooterMessageControl","styles","BottomSheetTextControl","initialValue","onChange","placeholder","label","icon","footerNote","cellPlaceholder","disabled","showSubSheet","setShowSubSheet","navigation","goBack","openSubSheet","navigate","SubSheet","screenName","horizontalBorderStyle","horizontalBorder","horizontalBorderDark","textEditorStyle","textEditor","textEditorDark","createElement","navigationButton","Cell","onPress","value","showSheet","Fragment","NavBar","BackButton","Heading","style","onChangeText","text","defaultValue","multiline","placeholderTextColor","textAlignVertical","textFooternote","textAlign"],"sources":["@wordpress/components/src/mobile/bottom-sheet-text-control/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { TextInput } from 'react-native';\nimport { useNavigation } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { Icon, chevronRight } from '@wordpress/icons';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport {\n\tBottomSheet,\n\tPanelBody,\n\tFooterMessageControl,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\n\nconst BottomSheetTextControl = ( {\n\tinitialValue,\n\tonChange,\n\tplaceholder,\n\tlabel,\n\ticon,\n\tfooterNote,\n\tcellPlaceholder,\n\tdisabled,\n} ) => {\n\tconst [ showSubSheet, setShowSubSheet ] = useState( false );\n\tconst navigation = useNavigation();\n\n\tconst goBack = () => {\n\t\tsetShowSubSheet( false );\n\t\tnavigation.goBack();\n\t};\n\n\tconst openSubSheet = () => {\n\t\tnavigation.navigate( BottomSheet.SubSheet.screenName );\n\t\tsetShowSubSheet( true );\n\t};\n\n\tconst horizontalBorderStyle = usePreferredColorSchemeStyle(\n\t\tstyles.horizontalBorder,\n\t\tstyles.horizontalBorderDark\n\t);\n\n\tconst textEditorStyle = usePreferredColorSchemeStyle(\n\t\tstyles.textEditor,\n\t\tstyles.textEditorDark\n\t);\n\n\treturn (\n\t\t<BottomSheet.SubSheet\n\t\t\tnavigationButton={\n\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonPress={ openSubSheet }\n\t\t\t\t\tvalue={ initialValue || '' }\n\t\t\t\t\tplaceholder={ cellPlaceholder || placeholder || '' }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t>\n\t\t\t\t\t{ disabled ? null : <Icon icon={ chevronRight } /> }\n\t\t\t\t</BottomSheet.Cell>\n\t\t\t}\n\t\t\tshowSheet={ showSubSheet }\n\t\t>\n\t\t\t<>\n\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t<BottomSheet.NavBar.BackButton onPress={ goBack } />\n\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t<PanelBody style={ horizontalBorderStyle }>\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tonChangeText={ ( text ) => onChange( text ) }\n\t\t\t\t\t\tdefaultValue={ initialValue }\n\t\t\t\t\t\tmultiline
|
|
1
|
+
{"version":3,"names":["TextInput","useNavigation","useState","Icon","chevronRight","usePreferredColorSchemeStyle","BottomSheet","PanelBody","FooterMessageControl","styles","BottomSheetTextControl","initialValue","onChange","placeholder","label","icon","footerNote","cellPlaceholder","disabled","showSubSheet","setShowSubSheet","navigation","goBack","openSubSheet","navigate","SubSheet","screenName","horizontalBorderStyle","horizontalBorder","horizontalBorderDark","textEditorStyle","textEditor","textEditorDark","createElement","navigationButton","Cell","onPress","value","showSheet","Fragment","NavBar","BackButton","Heading","style","onChangeText","text","defaultValue","multiline","placeholderTextColor","textAlignVertical","textFooternote","textAlign"],"sources":["@wordpress/components/src/mobile/bottom-sheet-text-control/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { TextInput } from 'react-native';\nimport { useNavigation } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { Icon, chevronRight } from '@wordpress/icons';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport {\n\tBottomSheet,\n\tPanelBody,\n\tFooterMessageControl,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\n\nconst BottomSheetTextControl = ( {\n\tinitialValue,\n\tonChange,\n\tplaceholder,\n\tlabel,\n\ticon,\n\tfooterNote,\n\tcellPlaceholder,\n\tdisabled,\n} ) => {\n\tconst [ showSubSheet, setShowSubSheet ] = useState( false );\n\tconst navigation = useNavigation();\n\n\tconst goBack = () => {\n\t\tsetShowSubSheet( false );\n\t\tnavigation.goBack();\n\t};\n\n\tconst openSubSheet = () => {\n\t\tnavigation.navigate( BottomSheet.SubSheet.screenName );\n\t\tsetShowSubSheet( true );\n\t};\n\n\tconst horizontalBorderStyle = usePreferredColorSchemeStyle(\n\t\tstyles.horizontalBorder,\n\t\tstyles.horizontalBorderDark\n\t);\n\n\tconst textEditorStyle = usePreferredColorSchemeStyle(\n\t\tstyles.textEditor,\n\t\tstyles.textEditorDark\n\t);\n\n\treturn (\n\t\t<BottomSheet.SubSheet\n\t\t\tnavigationButton={\n\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonPress={ openSubSheet }\n\t\t\t\t\tvalue={ initialValue || '' }\n\t\t\t\t\tplaceholder={ cellPlaceholder || placeholder || '' }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t>\n\t\t\t\t\t{ disabled ? null : <Icon icon={ chevronRight } /> }\n\t\t\t\t</BottomSheet.Cell>\n\t\t\t}\n\t\t\tshowSheet={ showSubSheet }\n\t\t>\n\t\t\t<>\n\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t<BottomSheet.NavBar.BackButton onPress={ goBack } />\n\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t<PanelBody style={ horizontalBorderStyle }>\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tonChangeText={ ( text ) => onChange( text ) }\n\t\t\t\t\t\tdefaultValue={ initialValue }\n\t\t\t\t\t\tmultiline\n\t\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\t\tplaceholderTextColor={ '#87a6bc' }\n\t\t\t\t\t\tstyle={ textEditorStyle }\n\t\t\t\t\t\ttextAlignVertical={ 'top' }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</>\n\n\t\t\t{ footerNote && (\n\t\t\t\t<PanelBody style={ styles.textFooternote }>\n\t\t\t\t\t<FooterMessageControl\n\t\t\t\t\t\tlabel={ footerNote }\n\t\t\t\t\t\ttextAlign=\"left\"\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t) }\n\t\t</BottomSheet.SubSheet>\n\t);\n};\n\nexport default BottomSheetTextControl;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,cAAc;AACxC,SAASC,aAAa,QAAQ,0BAA0B;;AAExD;AACA;AACA;A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AI;MACpDK,QAAQ,EAAGA;IAAU,GAEnBA,QAAQ,GAAG,IAAI,GAAGe,aAAA,CAAC9B,IAAI;MAACY,IAAI,EAAGX;IAAc,CAAE,CAChC,CAClB;IACDkC,SAAS,EAAGnB;EAAc,GAE1Bc,aAAA,CAAAM,QAAA,QACCN,aAAA,CAAC3B,WAAW,CAACkC,MAAM,QAClBP,aAAA,CAAC3B,WAAW,CAACkC,MAAM,CAACC,UAAU;IAACL,OAAO,EAAGd;EAAQ,CAAE,CAAC,EACpDW,aAAA,CAAC3B,WAAW,CAACkC,MAAM,CAACE,OAAO,QACxB5B,KACyB,CACT,CAAC,EACrBmB,aAAA,CAAC1B,SAAS;IAACoC,KAAK,EAAGhB;EAAuB,GACzCM,aAAA,CAACjC,SAAS;IACTc,KAAK,EAAGA,KAAO;IACf8B,YAAY,EAAKC,IAAI,IAAMjC,QAAQ,CAAEiC,IAAK,CAAG;IAC7CC,YAAY,EAAGnC,YAAc;IAC7BoC,SAAS;IACTlC,WAAW,EAAGA,WAAa;IAC3BmC,oBAAoB,EAAG,SAAW;IAClCL,KAAK,EAAGb,eAAiB;IACzBmB,iBAAiB,EAAG;EAAO,CAC3B,CACS,CACV,CAAC,EAEDjC,UAAU,IACXiB,aAAA,CAAC1B,SAAS;IAACoC,KAAK,EAAGlC,MAAM,CAACyC;EAAgB,GACzCjB,aAAA,CAACzB,oBAAoB;IACpBM,KAAK,EAAGE,UAAY;IACpBmC,SAAS,EAAC;EAAM,CAChB,CACS,CAES,CAAC;AAEzB,CAAC;AAED,eAAezC,sBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","Platform","RNLinearGradient","gradientParser","colorsUtils","RadialGradient","Stop","SVG","Defs","Rect","useResizeObserver","useMemo","styles","getGradientAngle","gradientValue","angleBase","matchAngle","angle","exec","angleType","includes","parseFloat","getGradientColorGroup","colorNeedParenthesis","excludeSideOrCorner","modifiedGradientValue","replace","concat","parse","map","gradient","colorStops","color","index","type","value","length","fallbackLength","colorLength","join","getGradientBaseColors","colorGroup","getColorLocations","location","Number","Gradient","style","angleCenter","x","y","children","otherProps","resizeObserver","sizes","width","height","isGradient","getGradientType","gradients","locations","colors","isLinearGradient","linear","createElement","useAngle","overflow","radialGradientContent","id","gradientUnits","rx","ry","cy","OS","group","offset","stopColor","stopOpacity","key","fill"],"sources":["@wordpress/components/src/mobile/gradient/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Platform } from 'react-native';\nimport RNLinearGradient from 'react-native-linear-gradient';\nimport gradientParser from 'gradient-parser';\n/**\n * WordPress dependencies\n */\nimport { colorsUtils } from '@wordpress/components';\nimport { RadialGradient, Stop, SVG, Defs, Rect } from '@wordpress/primitives';\nimport { useResizeObserver } from '@wordpress/compose';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nexport function getGradientAngle( gradientValue ) {\n\tconst angleBase = 45;\n\tconst matchAngle = /\\(((\\d+deg)|(to\\s[^,]+))/;\n\tconst angle = matchAngle.exec( gradientValue )\n\t\t? matchAngle.exec( gradientValue )[ 1 ]\n\t\t: '180deg';\n\n\tconst angleType = angle.includes( 'deg' ) ? 'angle' : 'sideOrCorner';\n\n\tif ( angleType === 'sideOrCorner' ) {\n\t\tswitch ( angle ) {\n\t\t\tcase 'to top':\n\t\t\t\treturn 0;\n\t\t\tcase 'to top right':\n\t\t\tcase 'to right top':\n\t\t\t\treturn angleBase;\n\t\t\tcase 'to right':\n\t\t\t\treturn 2 * angleBase;\n\t\t\tcase 'to bottom right':\n\t\t\tcase 'to right bottom':\n\t\t\t\treturn 3 * angleBase;\n\t\t\tcase 'to bottom':\n\t\t\t\treturn 4 * angleBase;\n\t\t\tcase 'to bottom left':\n\t\t\tcase 'to left bottom':\n\t\t\t\treturn 5 * angleBase;\n\t\t\tcase 'to left':\n\t\t\t\treturn 6 * angleBase;\n\t\t\tcase 'to top left':\n\t\t\tcase 'to left top':\n\t\t\t\treturn 7 * angleBase;\n\t\t}\n\t} else if ( angleType === 'angle' ) {\n\t\treturn parseFloat( angle );\n\t} else return 4 * angleBase;\n}\n\nexport function getGradientColorGroup( gradientValue ) {\n\tconst colorNeedParenthesis = [ 'rgb', 'rgba' ];\n\n\tconst excludeSideOrCorner = /linear-gradient\\(to\\s+([a-z\\s]+,)/;\n\n\t// Parser has some difficulties with angle defined as a side or corner (e.g. `to left`)\n\t// so it's going to be excluded in order to matching color groups.\n\tconst modifiedGradientValue = gradientValue.replace(\n\t\texcludeSideOrCorner,\n\t\t'linear-gradient('\n\t);\n\n\treturn [].concat(\n\t\t...gradientParser.parse( modifiedGradientValue )?.map( ( gradient ) =>\n\t\t\tgradient.colorStops?.map( ( color, index ) => {\n\t\t\t\tconst { type, value, length } = color;\n\t\t\t\tconst fallbackLength = `${\n\t\t\t\t\t100 * ( index / ( gradient.colorStops.length - 1 ) )\n\t\t\t\t}%`;\n\t\t\t\tconst colorLength = length\n\t\t\t\t\t? `${ length.value }${ length.type }`\n\t\t\t\t\t: fallbackLength;\n\n\t\t\t\tif ( colorNeedParenthesis.includes( type ) ) {\n\t\t\t\t\treturn [ `${ type }(${ value.join( ',' ) })`, colorLength ];\n\t\t\t\t} else if ( type === 'literal' ) {\n\t\t\t\t\treturn [ value, colorLength ];\n\t\t\t\t}\n\t\t\t\treturn [ `#${ value }`, colorLength ];\n\t\t\t} )\n\t\t)\n\t);\n}\n\nexport function getGradientBaseColors( colorGroup ) {\n\treturn colorGroup.map( ( color ) => color[ 0 ] );\n}\n\nexport function getColorLocations( colorGroup ) {\n\treturn colorGroup.map(\n\t\t( location ) => Number( location[ 1 ].replace( '%', '' ) ) / 100\n\t);\n}\n\nfunction Gradient( {\n\tgradientValue,\n\tstyle,\n\tangleCenter = { x: 0.5, y: 0.5 },\n\tchildren,\n\t...otherProps\n} ) {\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst { width = 0, height = 0 } = sizes || {};\n\tconst { isGradient, getGradientType, gradients } = colorsUtils;\n\n\tconst colorGroup = useMemo(\n\t\t() => getGradientColorGroup( gradientValue ),\n\t\t[ gradientValue ]\n\t);\n\n\tconst locations = useMemo(\n\t\t() => getColorLocations( colorGroup ),\n\t\t[ colorGroup ]\n\t);\n\n\tconst colors = useMemo(\n\t\t() => getGradientBaseColors( colorGroup ),\n\t\t[ colorGroup ]\n\t);\n\n\tif ( ! gradientValue || ! isGradient( gradientValue ) ) {\n\t\treturn null;\n\t}\n\n\tconst isLinearGradient =\n\t\tgetGradientType( gradientValue ) === gradients.linear;\n\n\tif ( isLinearGradient ) {\n\t\treturn (\n\t\t\t<RNLinearGradient\n\t\t\t\tcolors={ colors }\n\t\t\t\tuseAngle={ true }\n\t\t\t\tangle={ getGradientAngle( gradientValue ) }\n\t\t\t\tlocations={ locations }\n\t\t\t\tangleCenter={ angleCenter }\n\t\t\t\tstyle={ style }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</RNLinearGradient>\n\t\t);\n\t}\n\n\treturn (\n\t\t<View style={ [ style, styles.overflow ] }>\n\t\t\t<View style={ styles.radialGradientContent }>{ children }</View>\n\t\t\t{ resizeObserver }\n\t\t\t<SVG>\n\t\t\t\t<Defs>\n\t\t\t\t\t<RadialGradient\n\t\t\t\t\t\t// eslint-disable-next-line no-restricted-syntax\n\t\t\t\t\t\tid=\"radialGradient\"\n\t\t\t\t\t\tgradientUnits=\"userSpaceOnUse\"\n\t\t\t\t\t\trx=\"70%\"\n\t\t\t\t\t\try=\"70%\"\n\t\t\t\t\t\tcy={ Platform.OS === 'android' ? width / 2 : '50%' }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ colorGroup.map( ( group ) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Stop\n\t\t\t\t\t\t\t\t\toffset={ group[ 1 ] }\n\t\t\t\t\t\t\t\t\tstopColor={ group[ 0 ] }\n\t\t\t\t\t\t\t\t\tstopOpacity=\"1\"\n\t\t\t\t\t\t\t\t\tkey={ `${ group[ 1 ] }-${ group[ 0 ] }` }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t</RadialGradient>\n\t\t\t\t</Defs>\n\t\t\t\t<Rect\n\t\t\t\t\theight={ height }\n\t\t\t\t\twidth={ width }\n\t\t\t\t\tfill=\"url(#radialGradient)\"\n\t\t\t\t/>\n\t\t\t</SVG>\n\t\t</View>\n\t);\n}\n\nexport default Gradient;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AAC7C,OAAOC,gBAAgB,MAAM,8BAA8B;AAC3D,OAAOC,cAAc,MAAM,iBAAiB;AAC5C;AACA;AACA;AACA,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,cAAc,EAAEC,IAAI,EAAEC,GAAG,EAAEC,IAAI,EAAEC,IAAI,QAAQ,uBAAuB;AAC7E,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AAEjC,OAAO,SAASC,gBAAgBA,CAAEC,aAAa,EAAG;EACjD,MAAMC,SAAS,GAAG,EAAE;EACpB,MAAMC,UAAU,GAAG,0BAA0B;EAC7C,MAAMC,KAAK,GAAGD,UAAU,CAACE,IAAI,CAAEJ,aAAc,CAAC,GAC3CE,UAAU,CAACE,IAAI,CAAEJ,aAAc,CAAC,CAAE,CAAC,CAAE,GACrC,QAAQ;EAEX,MAAMK,SAAS,GAAGF,KAAK,CAACG,QAAQ,CAAE,KAAM,CAAC,GAAG,OAAO,GAAG,cAAc;EAEpE,IAAKD,SAAS,KAAK,cAAc,EAAG;IACnC,QAASF,KAAK;MACb,KAAK,QAAQ;QACZ,OAAO,CAAC;MACT,KAAK,cAAc;MACnB,KAAK,cAAc;QAClB,OAAOF,SAAS;MACjB,KAAK,UAAU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E,MAAM,EAAGD,KAAK,CAAE,CAAC,CAAI;MACrBE,SAAS,EAAGF,KAAK,CAAE,CAAC,CAAI;MACxBG,WAAW,EAAC,GAAG;MACfC,GAAG,EAAI,GAAGJ,KAAK,CAAE,CAAC,CAAI,IAAIA,KAAK,CAAE,CAAC,CAAI;IAAG,CACzC,CAAC;EAEJ,CAAE,CACa,CACX,CAAC,EACPV,aAAA,CAACtD,IAAI;IACJ8C,MAAM,EAAGA,MAAQ;IACjBD,KAAK,EAAGA,KAAO;IACfwB,IAAI,EAAC;EAAsB,CAC3B,CACG,CACA,CAAC;AAET;AAEA,eAAejC,QAAQ"}
|
|
1
|
+
{"version":3,"names":["View","Platform","RNLinearGradient","gradientParser","colorsUtils","RadialGradient","Stop","SVG","Defs","Rect","useResizeObserver","useMemo","styles","getGradientAngle","gradientValue","angleBase","matchAngle","angle","exec","angleType","includes","parseFloat","getGradientColorGroup","colorNeedParenthesis","excludeSideOrCorner","modifiedGradientValue","replace","concat","parse","map","gradient","colorStops","color","index","type","value","length","fallbackLength","colorLength","join","getGradientBaseColors","colorGroup","getColorLocations","location","Number","Gradient","style","angleCenter","x","y","children","otherProps","resizeObserver","sizes","width","height","isGradient","getGradientType","gradients","locations","colors","isLinearGradient","linear","createElement","useAngle","overflow","radialGradientContent","id","gradientUnits","rx","ry","cy","OS","group","offset","stopColor","stopOpacity","key","fill"],"sources":["@wordpress/components/src/mobile/gradient/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Platform } from 'react-native';\nimport RNLinearGradient from 'react-native-linear-gradient';\nimport gradientParser from 'gradient-parser';\n/**\n * WordPress dependencies\n */\nimport { colorsUtils } from '@wordpress/components';\nimport { RadialGradient, Stop, SVG, Defs, Rect } from '@wordpress/primitives';\nimport { useResizeObserver } from '@wordpress/compose';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nexport function getGradientAngle( gradientValue ) {\n\tconst angleBase = 45;\n\tconst matchAngle = /\\(((\\d+deg)|(to\\s[^,]+))/;\n\tconst angle = matchAngle.exec( gradientValue )\n\t\t? matchAngle.exec( gradientValue )[ 1 ]\n\t\t: '180deg';\n\n\tconst angleType = angle.includes( 'deg' ) ? 'angle' : 'sideOrCorner';\n\n\tif ( angleType === 'sideOrCorner' ) {\n\t\tswitch ( angle ) {\n\t\t\tcase 'to top':\n\t\t\t\treturn 0;\n\t\t\tcase 'to top right':\n\t\t\tcase 'to right top':\n\t\t\t\treturn angleBase;\n\t\t\tcase 'to right':\n\t\t\t\treturn 2 * angleBase;\n\t\t\tcase 'to bottom right':\n\t\t\tcase 'to right bottom':\n\t\t\t\treturn 3 * angleBase;\n\t\t\tcase 'to bottom':\n\t\t\t\treturn 4 * angleBase;\n\t\t\tcase 'to bottom left':\n\t\t\tcase 'to left bottom':\n\t\t\t\treturn 5 * angleBase;\n\t\t\tcase 'to left':\n\t\t\t\treturn 6 * angleBase;\n\t\t\tcase 'to top left':\n\t\t\tcase 'to left top':\n\t\t\t\treturn 7 * angleBase;\n\t\t}\n\t} else if ( angleType === 'angle' ) {\n\t\treturn parseFloat( angle );\n\t} else return 4 * angleBase;\n}\n\nexport function getGradientColorGroup( gradientValue ) {\n\tconst colorNeedParenthesis = [ 'rgb', 'rgba' ];\n\n\tconst excludeSideOrCorner = /linear-gradient\\(to\\s+([a-z\\s]+,)/;\n\n\t// Parser has some difficulties with angle defined as a side or corner (e.g. `to left`)\n\t// so it's going to be excluded in order to matching color groups.\n\tconst modifiedGradientValue = gradientValue.replace(\n\t\texcludeSideOrCorner,\n\t\t'linear-gradient('\n\t);\n\n\treturn [].concat(\n\t\t...gradientParser.parse( modifiedGradientValue )?.map( ( gradient ) =>\n\t\t\tgradient.colorStops?.map( ( color, index ) => {\n\t\t\t\tconst { type, value, length } = color;\n\t\t\t\tconst fallbackLength = `${\n\t\t\t\t\t100 * ( index / ( gradient.colorStops.length - 1 ) )\n\t\t\t\t}%`;\n\t\t\t\tconst colorLength = length\n\t\t\t\t\t? `${ length.value }${ length.type }`\n\t\t\t\t\t: fallbackLength;\n\n\t\t\t\tif ( colorNeedParenthesis.includes( type ) ) {\n\t\t\t\t\treturn [ `${ type }(${ value.join( ',' ) })`, colorLength ];\n\t\t\t\t} else if ( type === 'literal' ) {\n\t\t\t\t\treturn [ value, colorLength ];\n\t\t\t\t}\n\t\t\t\treturn [ `#${ value }`, colorLength ];\n\t\t\t} )\n\t\t)\n\t);\n}\n\nexport function getGradientBaseColors( colorGroup ) {\n\treturn colorGroup.map( ( color ) => color[ 0 ] );\n}\n\nexport function getColorLocations( colorGroup ) {\n\treturn colorGroup.map(\n\t\t( location ) => Number( location[ 1 ].replace( '%', '' ) ) / 100\n\t);\n}\n\nfunction Gradient( {\n\tgradientValue,\n\tstyle,\n\tangleCenter = { x: 0.5, y: 0.5 },\n\tchildren,\n\t...otherProps\n} ) {\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst { width = 0, height = 0 } = sizes || {};\n\tconst { isGradient, getGradientType, gradients } = colorsUtils;\n\n\tconst colorGroup = useMemo(\n\t\t() => getGradientColorGroup( gradientValue ),\n\t\t[ gradientValue ]\n\t);\n\n\tconst locations = useMemo(\n\t\t() => getColorLocations( colorGroup ),\n\t\t[ colorGroup ]\n\t);\n\n\tconst colors = useMemo(\n\t\t() => getGradientBaseColors( colorGroup ),\n\t\t[ colorGroup ]\n\t);\n\n\tif ( ! gradientValue || ! isGradient( gradientValue ) ) {\n\t\treturn null;\n\t}\n\n\tconst isLinearGradient =\n\t\tgetGradientType( gradientValue ) === gradients.linear;\n\n\tif ( isLinearGradient ) {\n\t\treturn (\n\t\t\t<RNLinearGradient\n\t\t\t\tcolors={ colors }\n\t\t\t\tuseAngle\n\t\t\t\tangle={ getGradientAngle( gradientValue ) }\n\t\t\t\tlocations={ locations }\n\t\t\t\tangleCenter={ angleCenter }\n\t\t\t\tstyle={ style }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</RNLinearGradient>\n\t\t);\n\t}\n\n\treturn (\n\t\t<View style={ [ style, styles.overflow ] }>\n\t\t\t<View style={ styles.radialGradientContent }>{ children }</View>\n\t\t\t{ resizeObserver }\n\t\t\t<SVG>\n\t\t\t\t<Defs>\n\t\t\t\t\t<RadialGradient\n\t\t\t\t\t\t// eslint-disable-next-line no-restricted-syntax\n\t\t\t\t\t\tid=\"radialGradient\"\n\t\t\t\t\t\tgradientUnits=\"userSpaceOnUse\"\n\t\t\t\t\t\trx=\"70%\"\n\t\t\t\t\t\try=\"70%\"\n\t\t\t\t\t\tcy={ Platform.OS === 'android' ? width / 2 : '50%' }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ colorGroup.map( ( group ) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Stop\n\t\t\t\t\t\t\t\t\toffset={ group[ 1 ] }\n\t\t\t\t\t\t\t\t\tstopColor={ group[ 0 ] }\n\t\t\t\t\t\t\t\t\tstopOpacity=\"1\"\n\t\t\t\t\t\t\t\t\tkey={ `${ group[ 1 ] }-${ group[ 0 ] }` }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t</RadialGradient>\n\t\t\t\t</Defs>\n\t\t\t\t<Rect\n\t\t\t\t\theight={ height }\n\t\t\t\t\twidth={ width }\n\t\t\t\t\tfill=\"url(#radialGradient)\"\n\t\t\t\t/>\n\t\t\t</SVG>\n\t\t</View>\n\t);\n}\n\nexport default Gradient;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AAC7C,OAAOC,gBAAgB,MAAM,8BAA8B;AAC3D,OAAOC,cAAc,MAAM,iBAAiB;AAC5C;AACA;AACA;AACA,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,cAAc,EAAEC,IAAI,EAAEC,GAAG,EAAEC,IAAI,EAAEC,IAAI,QAAQ,uBAAuB;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AAA,GACVK;IAAU,GAEbD,QACe,CAAC;EAErB;EAEA,OACCa,aAAA,CAAC/D,IAAI;IAAC8C,KAAK,EAAG,CAAEA,KAAK,EAAElC,MAAM,CAACqD,QAAQ;EAAI,GACzCF,aAAA,CAAC/D,IAAI;IAAC8C,KAAK,EAAGlC,MAAM,CAACsD;EAAuB,GAAGhB,QAAgB,CAAC,EAC9DE,cAAc,EAChBW,aAAA,CAACxD,GAAG,QACHwD,aAAA,CAACvD,IAAI,QACJuD,aAAA,CAAC1D;EACA;EAAA;IACA8D,EAAE,EAAC,gBAAgB;IACnBC,aAAa,EAAC,gBAAgB;IAC9BC,EAAE,EAAC,KAAK;IACRC,EAAE,EAAC,KAAK;IACRC,EAAE,EAAGtE,QAAQ,CAACuE,EAAE,KAAK,SAAS,GAAGlB,KAAK,GAAG,CAAC,GAAG;EAAO,GAElDb,UAAU,CAACZ,GAAG,CAAI4C,KAAK,IAAM;IAC9B,OACCV,aAAA,CAACzD,IAAI;MACJoE,MAAM,EAAGD,KAAK,CAAE,CAAC,CAAI;MACrBE,SAAS,EAAGF,KAAK,CAAE,CAAC,CAAI;MACxBG,WAAW,EAAC,GAAG;MACfC,GAAG,EAAI,GAAGJ,KAAK,CAAE,CAAC,CAAI,IAAIA,KAAK,CAAE,CAAC,CAAI;IAAG,CACzC,CAAC;EAEJ,CAAE,CACa,CACX,CAAC,EACPV,aAAA,CAACtD,IAAI;IACJ8C,MAAM,EAAGA,MAAQ;IACjBD,KAAK,EAAGA,KAAO;IACfwB,IAAI,EAAC;EAAsB,CAC3B,CACG,CACA,CAAC;AAET;AAEA,eAAejC,QAAQ"}
|
|
@@ -2,7 +2,7 @@ import { createElement, Fragment } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { Image as RNImage, Text, View } from 'react-native';
|
|
6
6
|
import FastImage from 'react-native-fast-image';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -12,7 +12,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
12
12
|
import { Icon } from '@wordpress/components';
|
|
13
13
|
import { image, offline } from '@wordpress/icons';
|
|
14
14
|
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
15
|
-
import { useEffect, useState,
|
|
15
|
+
import { useEffect, useState, Platform } from '@wordpress/element';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Internal dependencies
|
|
@@ -160,16 +160,7 @@ const ImageComponent = ({
|
|
|
160
160
|
}, resizeMode && {
|
|
161
161
|
width: styles.wide?.width
|
|
162
162
|
}, focalPoint && styles.focalPointContainer];
|
|
163
|
-
const opacityValue = useRef(new Animated.Value(1)).current;
|
|
164
|
-
useEffect(() => {
|
|
165
|
-
Animated.timing(opacityValue, {
|
|
166
|
-
toValue: isUploadInProgress ? 0.3 : 1,
|
|
167
|
-
duration: 100,
|
|
168
|
-
useNativeDriver: true
|
|
169
|
-
}).start();
|
|
170
|
-
}, [isUploadInProgress, opacityValue]);
|
|
171
163
|
const imageStyles = [{
|
|
172
|
-
opacity: opacityValue,
|
|
173
164
|
height: containerSize?.height
|
|
174
165
|
}, !resizeMode && {
|
|
175
166
|
aspectRatio: imageData?.aspectRatio
|
|
@@ -209,7 +200,7 @@ const ImageComponent = ({
|
|
|
209
200
|
accessibilityRole: 'imagebutton',
|
|
210
201
|
key: url,
|
|
211
202
|
style: imageContainerStyles
|
|
212
|
-
}, isSelected && highlightSelected &&
|
|
203
|
+
}, isSelected && highlightSelected && createElement(View, {
|
|
213
204
|
style: imageSelectedStyles
|
|
214
205
|
}), !imageData ? createElement(View, {
|
|
215
206
|
style: placeholderStyles
|
|
@@ -217,7 +208,7 @@ const ImageComponent = ({
|
|
|
217
208
|
style: styles.imageUploadingIconContainer
|
|
218
209
|
}, getIcon(ICON_TYPE.UPLOAD))) : createElement(View, {
|
|
219
210
|
style: focalPoint && styles.focalPointContent
|
|
220
|
-
}, Platform.isAndroid && createElement(Fragment, null, networkImageLoaded && networkURL && createElement(
|
|
211
|
+
}, Platform.isAndroid && createElement(Fragment, null, networkImageLoaded && networkURL && createElement(Image, {
|
|
221
212
|
style: imageStyles,
|
|
222
213
|
fadeDuration: 0,
|
|
223
214
|
source: {
|
|
@@ -228,7 +219,7 @@ const ImageComponent = ({
|
|
|
228
219
|
}),
|
|
229
220
|
resizeMode: imageResizeMode,
|
|
230
221
|
testID: `network-image-${url}`
|
|
231
|
-
}), !networkImageLoaded && !networkURL && createElement(
|
|
222
|
+
}), !networkImageLoaded && !networkURL && createElement(Image, {
|
|
232
223
|
style: imageStyles,
|
|
233
224
|
fadeDuration: 0,
|
|
234
225
|
source: {
|
|
@@ -238,7 +229,7 @@ const ImageComponent = ({
|
|
|
238
229
|
resizeMethod: 'scale'
|
|
239
230
|
}),
|
|
240
231
|
resizeMode: imageResizeMode
|
|
241
|
-
})), Platform.isIOS && createElement(Fragment, null, createElement(
|
|
232
|
+
})), Platform.isIOS && createElement(Fragment, null, createElement(Image, {
|
|
242
233
|
style: imageStyles,
|
|
243
234
|
source: {
|
|
244
235
|
uri: networkURL && networkImageLoaded ? networkURL : localURL || url
|