@wordpress/components 28.9.0 → 28.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/build/alignment-matrix-control/icon.js.map +1 -1
- package/build/alignment-matrix-control/types.js.map +1 -1
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +3 -3
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/get-default-use-items.js.map +1 -1
- package/build/autocomplete/index.js +1 -0
- package/build/autocomplete/index.js.map +1 -1
- package/build/base-control/hooks.js.map +1 -1
- package/build/base-control/index.js.map +1 -1
- package/build/border-box-control/border-box-control/hook.js.map +1 -1
- package/build/border-box-control/styles.js.map +1 -1
- package/build/border-box-control/utils.js.map +1 -1
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/border-control/styles.js.map +1 -1
- package/build/box-control/axial-input-controls.js.map +1 -1
- package/build/box-control/icon.js.map +1 -1
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-controls.js.map +1 -1
- package/build/button/index.native.js +1 -1
- package/build/button/index.native.js.map +1 -1
- package/build/card/card/component.js +1 -1
- package/build/card/card/component.js.map +1 -1
- package/build/card/styles.js.map +1 -1
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/index.native.js +2 -1
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-picker/styles.js.map +1 -1
- package/build/combobox-control/index.js +1 -1
- package/build/combobox-control/index.js.map +1 -1
- package/build/composite/legacy/index.js.map +1 -1
- package/build/context/context-connect.js +1 -0
- package/build/context/context-connect.js.map +1 -1
- package/build/context/context-system-provider.js +1 -1
- package/build/context/context-system-provider.js.map +1 -1
- package/build/context/get-styled-class-name-from-key.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/custom-gradient-picker/serializer.js.map +1 -1
- package/build/custom-gradient-picker/utils.js.map +1 -1
- package/build/custom-select-control-v2/styles.js.map +1 -1
- package/build/dashicon/index.js.map +1 -1
- package/build/date-time/date/styles.js.map +1 -1
- package/build/date-time/time/timezone.js.map +1 -1
- package/build/draggable/index.js.map +1 -1
- package/build/drop-zone/index.js +1 -2
- package/build/drop-zone/index.js.map +1 -1
- package/build/dropdown-menu-v2/styles.js.map +1 -1
- package/build/duotone-picker/color-list-picker/index.js.map +1 -1
- package/build/duotone-picker/utils.js.map +1 -1
- package/build/elevation/hook.js.map +1 -1
- package/build/external-link/index.js +20 -23
- package/build/external-link/index.js.map +1 -1
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/index.native.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build/font-size-picker/index.js.map +1 -1
- package/build/form-token-field/index.js +2 -1
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/form-token-field/token-input.js.map +1 -1
- package/build/form-token-field/token.js +1 -1
- package/build/form-token-field/token.js.map +1 -1
- package/build/gradient-picker/index.js.map +1 -1
- package/build/grid/hook.js.map +1 -1
- package/build/guide/page-control.js +1 -1
- package/build/guide/page-control.js.map +1 -1
- package/build/h-stack/hook.js.map +1 -1
- package/build/heading/hook.js.map +1 -1
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/item-group/styles.js.map +1 -1
- package/build/menu-group/index.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +4 -4
- package/build/mobile/bottom-sheet/cell.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 +1 -1
- package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/switch-cell.native.js +4 -4
- package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build/mobile/cycle-select-control/index.native.js.map +1 -1
- package/build/mobile/gradient/index.native.js.map +1 -1
- package/build/mobile/image/index.native.js.map +1 -1
- package/build/mobile/link-picker/index.native.js +1 -1
- package/build/mobile/link-picker/index.native.js.map +1 -1
- package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build/mobile/picker/index.android.js.map +1 -1
- package/build/mobile/segmented-control/index.native.js.map +1 -1
- package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
- package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build/modal/aria-helper.js +2 -1
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +2 -1
- package/build/modal/index.js.map +1 -1
- package/build/modal/use-modal-exit-animation.js.map +1 -1
- package/build/navigation/group/index.js.map +1 -1
- package/build/navigation/item/base.js.map +1 -1
- package/build/navigation/menu/index.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +2 -2
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/navigation/menu/menu-title.js.map +1 -1
- package/build/navigation/styles/navigation-styles.js.map +1 -1
- package/build/navigator/navigator/component.js.map +1 -1
- package/build/navigator/navigator-button/hook.js.map +1 -1
- package/build/number-control/styles/number-control-styles.js.map +1 -1
- package/build/palette-edit/index.js +25 -2
- package/build/palette-edit/index.js.map +1 -1
- package/build/popover/index.js +1 -1
- package/build/popover/index.js.map +1 -1
- package/build/popover/overlay-middlewares.js.map +1 -1
- package/build/popover/utils.js.map +1 -1
- package/build/progress-bar/index.js.map +1 -1
- package/build/progress-bar/styles.js.map +1 -1
- package/build/query-controls/index.js.map +1 -1
- package/build/query-controls/index.native.js.map +1 -1
- package/build/radio-control/index.js.map +1 -1
- package/build/radio-control/index.native.js.map +1 -1
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/index.native.js.map +1 -1
- package/build/range-control/rail.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +32 -32
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/range-control/tooltip.js +1 -1
- package/build/range-control/tooltip.js.map +1 -1
- package/build/range-control/utils.js.map +1 -1
- package/build/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/responsive-wrapper/index.js.map +1 -1
- package/build/sandbox/index.js.map +1 -1
- package/build/sandbox/index.native.js.map +1 -1
- package/build/search-control/index.js +6 -0
- package/build/search-control/index.js.map +1 -1
- package/build/search-control/index.native.js.map +1 -1
- package/build/search-control/types.js.map +1 -1
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/index.native.js.map +1 -1
- package/build/slot-fill/index.js.map +1 -1
- package/build/spinner/styles.js.map +1 -1
- package/build/style-provider/index.js +1 -0
- package/build/style-provider/index.js.map +1 -1
- package/build/surface/hook.js.map +1 -1
- package/build/surface/styles.js.map +1 -1
- package/build/tab-panel/index.js.map +1 -1
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/styles.js +30 -12
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tab.js +7 -2
- package/build/tabs/tab.js.map +1 -1
- package/build/tabs/tablist.js +47 -48
- package/build/tabs/tablist.js.map +1 -1
- package/build/tabs/tabpanel.js.map +1 -1
- package/build/text/get-line-height.js.map +1 -1
- package/build/text/styles/text-mixins.native.js.map +1 -1
- package/build/text/utils.js.map +1 -1
- package/build/text-control/index.native.js.map +1 -1
- package/build/text-highlight/index.js.map +1 -1
- package/build/textarea-control/index.js.map +1 -1
- package/build/theme/color-algorithms.js.map +1 -1
- package/build/theme/styles.js.map +1 -1
- package/build/toggle-control/index.js.map +1 -1
- package/build/toggle-control/index.native.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js +9 -1
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +2 -60
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js +10 -10
- package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build/toggle-group-control/types.js.map +1 -1
- package/build/toolbar/toolbar/index.js.map +1 -1
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tooltip/index.js +5 -1
- package/build/tooltip/index.js.map +1 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/utils.js.map +1 -1
- package/build/utils/breakpoint.js.map +1 -1
- package/build/utils/colors-values.js.map +1 -1
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/font-size.js.map +1 -1
- package/build/utils/hooks/use-animated-offset-rect.js +80 -0
- package/build/utils/hooks/use-animated-offset-rect.js.map +1 -0
- package/build/utils/hooks/use-cx.js.map +1 -1
- package/build/utils/math.js +2 -2
- package/build/utils/math.js.map +1 -1
- package/build/utils/space.js.map +1 -1
- package/build/utils/unit-values.js.map +1 -1
- package/build/utils/use-responsive-value.js.map +1 -1
- package/build-module/alignment-matrix-control/cell.js +1 -2
- package/build-module/alignment-matrix-control/cell.js.map +1 -1
- package/build-module/alignment-matrix-control/icon.js.map +1 -1
- package/build-module/alignment-matrix-control/types.js.map +1 -1
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/angle-picker-control/index.js +1 -2
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +4 -6
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.native.js +1 -2
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/autocomplete/get-default-use-items.js.map +1 -1
- package/build-module/autocomplete/index.js +2 -3
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/base-control/hooks.js.map +1 -1
- package/build-module/base-control/index.js +1 -2
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/base-control/index.native.js +1 -2
- package/build-module/base-control/index.native.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +1 -2
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js +1 -2
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build-module/border-box-control/styles.js.map +1 -1
- package/build-module/border-box-control/utils.js.map +1 -1
- package/build-module/border-control/border-control/component.js +1 -2
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +1 -3
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/box-control/all-input-control.js +1 -3
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/axial-input-controls.js +1 -3
- package/build-module/box-control/axial-input-controls.js.map +1 -1
- package/build-module/box-control/icon.js +1 -2
- package/build-module/box-control/icon.js.map +1 -1
- package/build-module/box-control/index.js +1 -2
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-controls.js +1 -3
- package/build-module/box-control/input-controls.js.map +1 -1
- package/build-module/button/index.js +1 -3
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/index.native.js +2 -3
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/card/card/component.js +2 -3
- package/build-module/card/card/component.js.map +1 -1
- package/build-module/card/styles.js.map +1 -1
- package/build-module/checkbox-control/index.js +1 -2
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-option.js +1 -2
- package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker.js +1 -2
- package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build-module/color-indicator/index.native.js +1 -2
- package/build-module/color-indicator/index.native.js.map +1 -1
- package/build-module/color-palette/index.js +1 -2
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +3 -4
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/component.js +1 -2
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/hsl-input.js +1 -3
- package/build-module/color-picker/hsl-input.js.map +1 -1
- package/build-module/color-picker/hsv-color-picker.native.js +1 -2
- package/build-module/color-picker/hsv-color-picker.native.js.map +1 -1
- package/build-module/color-picker/hue-picker.native.js +1 -2
- package/build-module/color-picker/hue-picker.native.js.map +1 -1
- package/build-module/color-picker/index.native.js +1 -3
- package/build-module/color-picker/index.native.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +1 -2
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/color-picker/rgb-input.js +1 -3
- package/build-module/color-picker/rgb-input.js.map +1 -1
- package/build-module/color-picker/saturation-picker.native.js +1 -2
- package/build-module/color-picker/saturation-picker.native.js.map +1 -1
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/combobox-control/index.js +2 -3
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/composite/legacy/index.js.map +1 -1
- package/build-module/confirm-dialog/component.js +1 -3
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/context/context-connect.js +1 -0
- package/build-module/context/context-connect.js.map +1 -1
- package/build-module/context/context-system-provider.js +1 -1
- package/build-module/context/context-system-provider.js.map +1 -1
- package/build-module/context/get-styled-class-name-from-key.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +1 -3
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -2
- package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +1 -2
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.native.js +1 -3
- package/build-module/custom-gradient-picker/index.native.js.map +1 -1
- package/build-module/custom-gradient-picker/serializer.js.map +1 -1
- package/build-module/custom-gradient-picker/utils.js.map +1 -1
- package/build-module/custom-select-control/index.js +1 -3
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/custom-select-control-v2/custom-select.js +1 -2
- package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
- package/build-module/custom-select-control-v2/item.js +1 -2
- package/build-module/custom-select-control-v2/item.js.map +1 -1
- package/build-module/custom-select-control-v2/styles.js.map +1 -1
- package/build-module/dashicon/index.js.map +1 -1
- package/build-module/date-time/date/index.js +1 -2
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date/styles.js.map +1 -1
- package/build-module/date-time/date-time/index.js +1 -3
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/date-time/time/index.js +1 -2
- package/build-module/date-time/time/index.js.map +1 -1
- package/build-module/date-time/time/time-input/index.js +1 -2
- package/build-module/date-time/time/time-input/index.js.map +1 -1
- package/build-module/date-time/time/timezone.js.map +1 -1
- package/build-module/dimension-control/index.js +1 -3
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/draggable/index.js +1 -3
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/drop-zone/index.js +2 -4
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/dropdown/index.js +1 -2
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/dropdown/index.native.js +1 -2
- package/build-module/dropdown/index.native.js.map +1 -1
- package/build-module/dropdown-menu/index.js +1 -2
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js +1 -2
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/dropdown-menu-v2/checkbox-item.js +1 -2
- package/build-module/dropdown-menu-v2/checkbox-item.js.map +1 -1
- package/build-module/dropdown-menu-v2/index.js +1 -3
- package/build-module/dropdown-menu-v2/index.js.map +1 -1
- package/build-module/dropdown-menu-v2/item.js +1 -2
- package/build-module/dropdown-menu-v2/item.js.map +1 -1
- package/build-module/dropdown-menu-v2/radio-item.js +1 -2
- package/build-module/dropdown-menu-v2/radio-item.js.map +1 -1
- package/build-module/dropdown-menu-v2/styles.js.map +1 -1
- package/build-module/duotone-picker/color-list-picker/index.js +1 -3
- package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
- package/build-module/duotone-picker/duotone-picker.js +1 -2
- package/build-module/duotone-picker/duotone-picker.js.map +1 -1
- package/build-module/duotone-picker/utils.js.map +1 -1
- package/build-module/elevation/hook.js.map +1 -1
- package/build-module/external-link/index.js +21 -25
- package/build-module/external-link/index.js.map +1 -1
- package/build-module/external-link/index.native.js +1 -2
- package/build-module/external-link/index.native.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +1 -2
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/focal-point.native.js +1 -2
- package/build-module/focal-point-picker/focal-point.native.js.map +1 -1
- package/build-module/focal-point-picker/grid.js +1 -2
- package/build-module/focal-point-picker/grid.js.map +1 -1
- package/build-module/focal-point-picker/index.js +1 -2
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/index.native.js +1 -2
- package/build-module/focal-point-picker/index.native.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build-module/focal-point-picker/tooltip/index.native.js +1 -2
- package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build-module/font-size-picker/index.js +1 -2
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/index.native.js +1 -3
- package/build-module/font-size-picker/index.native.js.map +1 -1
- package/build-module/form-file-upload/index.js +1 -2
- package/build-module/form-file-upload/index.js.map +1 -1
- package/build-module/form-toggle/index.js +1 -2
- package/build-module/form-toggle/index.js.map +1 -1
- package/build-module/form-token-field/index.js +3 -3
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +1 -2
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/form-token-field/token-input.js.map +1 -1
- package/build-module/form-token-field/token.js +2 -3
- package/build-module/form-token-field/token.js.map +1 -1
- package/build-module/gradient-picker/index.js +1 -2
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/grid/hook.js.map +1 -1
- package/build-module/guide/index.js +1 -2
- package/build-module/guide/index.js.map +1 -1
- package/build-module/guide/page-control.js +1 -1
- package/build-module/guide/page-control.js.map +1 -1
- package/build-module/h-stack/hook.js.map +1 -1
- package/build-module/heading/hook.js.map +1 -1
- package/build-module/higher-order/with-fallback-styles/index.js +3 -4
- package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +1 -2
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/item-group/styles.js.map +1 -1
- package/build-module/keyboard-shortcuts/index.js +1 -3
- package/build-module/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/menu-group/index.js +1 -2
- package/build-module/menu-group/index.js.map +1 -1
- package/build-module/menu-item/index.js +1 -2
- package/build-module/menu-item/index.js.map +1 -1
- package/build-module/menu-items-choice/index.js +1 -2
- package/build-module/menu-items-choice/index.js.map +1 -1
- package/build-module/mobile/badge/index.native.js +1 -3
- package/build-module/mobile/badge/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -2
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +5 -6
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/color-cell.native.js +1 -2
- package/build-module/mobile/bottom-sheet/color-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js +1 -3
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -2
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -2
- package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-cell.native.js +2 -3
- package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-text-input.native.js +1 -2
- package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +2 -3
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js +1 -2
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js +1 -2
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
- package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
- package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/switch-cell.native.js +4 -4
- package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-select-control/index.native.js +1 -3
- 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 +1 -3
- package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/gradient-picker-screen.native.js +1 -2
- package/build-module/mobile/color-settings/gradient-picker-screen.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +1 -2
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +1 -3
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/mobile/cycle-select-control/index.native.js.map +1 -1
- package/build-module/mobile/focal-point-settings-panel/index.native.js +1 -2
- package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
- package/build-module/mobile/gradient/index.native.js +1 -2
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/html-text-input/index.native.js +1 -2
- package/build-module/mobile/html-text-input/index.native.js.map +1 -1
- package/build-module/mobile/image/icon-retry.native.js +1 -2
- package/build-module/mobile/image/icon-retry.native.js.map +1 -1
- package/build-module/mobile/image/image-editing-button.native.js +1 -2
- package/build-module/mobile/image/image-editing-button.native.js.map +1 -1
- package/build-module/mobile/image/index.native.js +1 -3
- package/build-module/mobile/image/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js +1 -2
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +2 -3
- package/build-module/mobile/link-picker/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build-module/mobile/link-settings/index.native.js +1 -3
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/mobile/link-settings/link-settings-navigation.native.js +1 -2
- package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
- package/build-module/mobile/picker/index.android.js +1 -2
- package/build-module/mobile/picker/index.android.js.map +1 -1
- package/build-module/mobile/segmented-control/index.native.js +1 -2
- package/build-module/mobile/segmented-control/index.native.js.map +1 -1
- package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
- package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build-module/modal/aria-helper.js +2 -1
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +3 -4
- package/build-module/modal/index.js.map +1 -1
- package/build-module/modal/use-modal-exit-animation.js.map +1 -1
- package/build-module/navigation/back-button/index.js +1 -2
- package/build-module/navigation/back-button/index.js.map +1 -1
- package/build-module/navigation/group/index.js +1 -2
- package/build-module/navigation/group/index.js.map +1 -1
- package/build-module/navigation/item/base-content.js +1 -3
- package/build-module/navigation/item/base-content.js.map +1 -1
- package/build-module/navigation/item/base.js.map +1 -1
- package/build-module/navigation/item/index.js +1 -2
- package/build-module/navigation/item/index.js.map +1 -1
- package/build-module/navigation/menu/index.js +1 -2
- package/build-module/navigation/menu/index.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +2 -2
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/navigation/menu/menu-title.js +1 -2
- package/build-module/navigation/menu/menu-title.js.map +1 -1
- package/build-module/navigation/menu/search-no-results-found.js +1 -2
- package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
- package/build-module/navigation/styles/navigation-styles.js.map +1 -1
- package/build-module/navigator/navigator/component.js.map +1 -1
- package/build-module/navigator/navigator-button/hook.js.map +1 -1
- package/build-module/notice/index.js +1 -2
- package/build-module/notice/index.js.map +1 -1
- package/build-module/notice/index.native.js +1 -3
- package/build-module/notice/index.native.js.map +1 -1
- package/build-module/number-control/index.js +1 -3
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/number-control/styles/number-control-styles.js.map +1 -1
- package/build-module/palette-edit/index.js +25 -5
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/panel/actions.native.js +1 -2
- package/build-module/panel/actions.native.js.map +1 -1
- package/build-module/panel/body.js +1 -2
- package/build-module/panel/body.js.map +1 -1
- package/build-module/panel/body.native.js +1 -2
- package/build-module/panel/body.native.js.map +1 -1
- package/build-module/panel/header.js +1 -2
- package/build-module/panel/header.js.map +1 -1
- package/build-module/panel/index.js +1 -2
- package/build-module/panel/index.js.map +1 -1
- package/build-module/placeholder/index.js +1 -2
- package/build-module/placeholder/index.js.map +1 -1
- package/build-module/popover/index.js +2 -4
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/overlay-middlewares.js.map +1 -1
- package/build-module/popover/utils.js.map +1 -1
- package/build-module/progress-bar/index.js +1 -2
- package/build-module/progress-bar/index.js.map +1 -1
- package/build-module/progress-bar/styles.js.map +1 -1
- package/build-module/query-controls/index.js.map +1 -1
- package/build-module/query-controls/index.native.js +1 -3
- package/build-module/query-controls/index.native.js.map +1 -1
- package/build-module/radio-control/index.js +1 -2
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/radio-control/index.native.js +1 -2
- package/build-module/radio-control/index.native.js.map +1 -1
- package/build-module/range-control/index.js +1 -2
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/index.native.js.map +1 -1
- package/build-module/range-control/mark.js +1 -3
- package/build-module/range-control/mark.js.map +1 -1
- package/build-module/range-control/rail.js +1 -3
- package/build-module/range-control/rail.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +32 -32
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/range-control/tooltip.js +1 -1
- package/build-module/range-control/tooltip.js.map +1 -1
- package/build-module/range-control/utils.js.map +1 -1
- package/build-module/resizable-box/index.js +1 -2
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js +1 -2
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build-module/responsive-wrapper/index.js.map +1 -1
- package/build-module/sandbox/index.js +1 -2
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/sandbox/index.native.js +1 -2
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/search-control/index.js +6 -0
- package/build-module/search-control/index.js.map +1 -1
- package/build-module/search-control/index.native.js +1 -2
- package/build-module/search-control/index.native.js.map +1 -1
- package/build-module/search-control/types.js.map +1 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/index.native.js.map +1 -1
- package/build-module/slot-fill/index.js +1 -3
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/slot-fill/slot.js +1 -2
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/snackbar/index.js +1 -2
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +1 -2
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/spinner/index.js +1 -2
- package/build-module/spinner/index.js.map +1 -1
- package/build-module/spinner/styles.js.map +1 -1
- package/build-module/style-provider/index.js +1 -0
- package/build-module/style-provider/index.js.map +1 -1
- package/build-module/surface/hook.js.map +1 -1
- package/build-module/surface/styles.js.map +1 -1
- package/build-module/tab-panel/index.js +1 -2
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/styles.js +28 -6
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tab.js +9 -4
- package/build-module/tabs/tab.js.map +1 -1
- package/build-module/tabs/tablist.js +47 -48
- package/build-module/tabs/tablist.js.map +1 -1
- package/build-module/tabs/tabpanel.js.map +1 -1
- package/build-module/text/get-line-height.js.map +1 -1
- package/build-module/text/styles/text-mixins.native.js.map +1 -1
- package/build-module/text/utils.js.map +1 -1
- package/build-module/text-control/index.native.js.map +1 -1
- package/build-module/text-highlight/index.js +1 -2
- package/build-module/text-highlight/index.js.map +1 -1
- package/build-module/textarea-control/index.js.map +1 -1
- package/build-module/theme/color-algorithms.js.map +1 -1
- package/build-module/theme/styles.js.map +1 -1
- package/build-module/tip/index.js +1 -2
- package/build-module/tip/index.js.map +1 -1
- package/build-module/toggle-control/index.js +1 -2
- package/build-module/toggle-control/index.js.map +1 -1
- package/build-module/toggle-control/index.native.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +10 -2
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +4 -65
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +11 -12
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-module/toggle-group-control/types.js.map +1 -1
- package/build-module/toolbar/toolbar/index.js.map +1 -1
- package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js +2 -2
- package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js.map +1 -1
- package/build-module/toolbar/toolbar-group/index.js +1 -2
- package/build-module/toolbar/toolbar-group/index.js.map +1 -1
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +1 -2
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +1 -3
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tooltip/index.js +6 -3
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tooltip/index.native.js +1 -3
- package/build-module/tooltip/index.native.js.map +1 -1
- package/build-module/tree-grid/cell.js +1 -2
- package/build-module/tree-grid/cell.js.map +1 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/index.native.js +1 -3
- package/build-module/unit-control/index.native.js.map +1 -1
- package/build-module/unit-control/utils.js.map +1 -1
- package/build-module/utils/breakpoint.js.map +1 -1
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/font-size.js.map +1 -1
- package/build-module/utils/hooks/use-animated-offset-rect.js +74 -0
- package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -0
- package/build-module/utils/hooks/use-cx.js.map +1 -1
- package/build-module/utils/math.js +2 -2
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/space.js.map +1 -1
- package/build-module/utils/unit-values.js.map +1 -1
- package/build-module/utils/use-responsive-value.js.map +1 -1
- package/build-style/style-rtl.css +8 -5
- package/build-style/style.css +8 -5
- package/build-types/alignment-matrix-control/types.d.ts +2 -0
- package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
- package/build-types/drop-zone/index.d.ts.map +1 -1
- package/build-types/modal/aria-helper.d.ts.map +1 -1
- package/build-types/palette-edit/index.d.ts +3 -0
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/search-control/index.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts +0 -8
- package/build-types/search-control/stories/index.story.d.ts.map +1 -1
- package/build-types/search-control/types.d.ts +3 -0
- package/build-types/search-control/types.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts +7 -0
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/tabs/tab.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/types.d.ts +1 -0
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/utils/hooks/use-animated-offset-rect.d.ts +62 -0
- package/build-types/utils/hooks/use-animated-offset-rect.d.ts.map +1 -0
- package/package.json +20 -20
- package/schemas/docs-manifest.json +38 -0
- package/src/alignment-matrix-control/README.md +46 -36
- package/src/alignment-matrix-control/docs-manifest.json +12 -0
- package/src/alignment-matrix-control/types.ts +2 -0
- package/src/angle-picker-control/README.md +36 -23
- package/src/angle-picker-control/docs-manifest.json +5 -0
- package/src/button/style.scss +5 -1
- package/src/composite/test/index.tsx +629 -38
- package/src/drop-zone/index.tsx +1 -2
- package/src/drop-zone/style.scss +1 -1
- package/src/modal/aria-helper.ts +1 -0
- package/src/palette-edit/index.tsx +30 -5
- package/src/palette-edit/test/index.tsx +50 -1
- package/src/range-control/styles/range-control-styles.ts +19 -10
- package/src/range-control/tooltip.tsx +1 -1
- package/src/search-control/README.md +2 -0
- package/src/search-control/index.tsx +7 -0
- package/src/search-control/stories/index.story.tsx +0 -15
- package/src/search-control/test/index.tsx +4 -1
- package/src/search-control/types.ts +3 -0
- package/src/tabs/styles.ts +116 -47
- package/src/tabs/tab.tsx +8 -2
- package/src/tabs/tablist.tsx +48 -49
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +6 -6
- package/src/toggle-group-control/test/index.tsx +39 -0
- package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +11 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +3 -98
- package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +15 -15
- package/src/toggle-group-control/types.ts +1 -0
- package/src/tooltip/index.tsx +8 -1
- package/src/tooltip/test/index.tsx +78 -0
- package/src/utils/hooks/use-animated-offset-rect.ts +107 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TextInput","useNavigation","useState","Icon","chevronRight","usePreferredColorSchemeStyle","styles","BottomSheet","PanelBody","FooterMessageControl","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","BottomSheetTextControl","initialValue","onChange","placeholder","label","icon","footerNote","cellPlaceholder","disabled","showSubSheet","setShowSubSheet","navigation","goBack","openSubSheet","navigate","SubSheet","screenName","horizontalBorderStyle","horizontalBorder","horizontalBorderDark","textEditorStyle","textEditor","textEditorDark","navigationButton","Cell","onPress","value","children","showSheet","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';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport BottomSheet from '../bottom-sheet';\nimport PanelBody from '../../panel/body';\nimport FooterMessageControl from '../../footer-message-control';\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;AACA,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,IAAI,EAAEC,YAAY,QAAQ,kBAAkB;AACrD,SAASC,4BAA4B,QAAQ,oBAAoB;;AAEjE;AACA;AACA;AACA,OAAOC,MAAM,MAAM,eAAe;AAClC,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,SAAS,MAAM,kBAAkB;AACxC,OAAOC,oBAAoB,MAAM,8BAA8B;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["TextInput","useNavigation","useState","Icon","chevronRight","usePreferredColorSchemeStyle","styles","BottomSheet","PanelBody","FooterMessageControl","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","BottomSheetTextControl","initialValue","onChange","placeholder","label","icon","footerNote","cellPlaceholder","disabled","showSubSheet","setShowSubSheet","navigation","goBack","openSubSheet","navigate","SubSheet","screenName","horizontalBorderStyle","horizontalBorder","horizontalBorderDark","textEditorStyle","textEditor","textEditorDark","navigationButton","Cell","onPress","value","children","showSheet","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';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport BottomSheet from '../bottom-sheet';\nimport PanelBody from '../../panel/body';\nimport FooterMessageControl from '../../footer-message-control';\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;AACA,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,IAAI,EAAEC,YAAY,QAAQ,kBAAkB;AACrD,SAASC,4BAA4B,QAAQ,oBAAoB;;AAEjE;AACA;AACA;AACA,OAAOC,MAAM,MAAM,eA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A,QAAU;MAAAmB,QAAA,EAEnBnB,QAAQ,GAAG,IAAI,gBAAGb,IAAA,CAACR,IAAI;QAACkB,IAAI,EAAGjB;MAAc,CAAE;IAAC,CACjC,CAClB;IACDwC,SAAS,EAAGnB,YAAc;IAAAkB,QAAA,gBAE1B9B,KAAA,CAAAE,SAAA;MAAA4B,QAAA,gBACC9B,KAAA,CAACN,WAAW,CAACsC,MAAM;QAAAF,QAAA,gBAClBhC,IAAA,CAACJ,WAAW,CAACsC,MAAM,CAACC,UAAU;UAACL,OAAO,EAAGb;QAAQ,CAAE,CAAC,eACpDjB,IAAA,CAACJ,WAAW,CAACsC,MAAM,CAACE,OAAO;UAAAJ,QAAA,EACxBvB;QAAK,CACoB,CAAC;MAAA,CACV,CAAC,eACrBT,IAAA,CAACH,SAAS;QAACwC,KAAK,EAAGf,qBAAuB;QAAAU,QAAA,eACzChC,IAAA,CAACX,SAAS;UACToB,KAAK,EAAGA,KAAO;UACf6B,YAAY,EAAKC,IAAI,IAAMhC,QAAQ,CAAEgC,IAAK,CAAG;UAC7CC,YAAY,EAAGlC,YAAc;UAC7BmC,SAAS;UACTjC,WAAW,EAAGA,WAAa;UAC3BkC,oBAAoB,EAAC,SAAS;UAC9BL,KAAK,EAAGZ,eAAiB;UACzBkB,iBAAiB,EAAC;QAAK,CACvB;MAAC,CACQ,CAAC;IAAA,CACX,CAAC,EAEDhC,UAAU,iBACXX,IAAA,CAACH,SAAS;MAACwC,KAAK,EAAG1C,MAAM,CAACiD,cAAgB;MAAAZ,QAAA,eACzChC,IAAA,CAACF,oBAAoB;QACpBW,KAAK,EAAGE,UAAY;QACpBkC,SAAS,EAAC;MAAM,CAChB;IAAC,CACQ,CACX;EAAA,CACoB,CAAC;AAEzB,CAAC;AAED,eAAexC,sBAAsB","ignoreList":[]}
|
|
@@ -14,8 +14,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
14
14
|
*/
|
|
15
15
|
import CustomGradientPicker from '../../custom-gradient-picker';
|
|
16
16
|
import NavBar from '../bottom-sheet/nav-bar';
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
18
|
const GradientPickerScreen = () => {
|
|
20
19
|
const navigation = useNavigation();
|
|
21
20
|
const route = useRoute();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","useNavigation","useRoute","__","CustomGradientPicker","NavBar","jsx","_jsx","jsxs","_jsxs","GradientPickerScreen","navigation","route","setColor","currentValue","isGradientColor","params","children","BackButton","onPress","goBack","Heading"],"sources":["@wordpress/components/src/mobile/color-settings/gradient-picker-screen.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\nimport { useNavigation, useRoute } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport CustomGradientPicker from '../../custom-gradient-picker';\nimport NavBar from '../bottom-sheet/nav-bar';\n\nconst GradientPickerScreen = () => {\n\tconst navigation = useNavigation();\n\tconst route = useRoute();\n\tconst { setColor, currentValue, isGradientColor } = route.params;\n\treturn (\n\t\t<View>\n\t\t\t<NavBar>\n\t\t\t\t<NavBar.BackButton onPress={ navigation.goBack } />\n\t\t\t\t<NavBar.Heading>{ __( 'Customize Gradient' ) }</NavBar.Heading>\n\t\t\t</NavBar>\n\t\t\t<CustomGradientPicker\n\t\t\t\tsetColor={ setColor }\n\t\t\t\tcurrentValue={ currentValue }\n\t\t\t\tisGradientColor={ isGradientColor }\n\t\t\t/>\n\t\t</View>\n\t);\n};\n\nexport default GradientPickerScreen;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,QAAQ,QAAQ,0BAA0B;;AAElE;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,8BAA8B;AAC/D,OAAOC,MAAM,MAAM,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["View","useNavigation","useRoute","__","CustomGradientPicker","NavBar","jsx","_jsx","jsxs","_jsxs","GradientPickerScreen","navigation","route","setColor","currentValue","isGradientColor","params","children","BackButton","onPress","goBack","Heading"],"sources":["@wordpress/components/src/mobile/color-settings/gradient-picker-screen.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\nimport { useNavigation, useRoute } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport CustomGradientPicker from '../../custom-gradient-picker';\nimport NavBar from '../bottom-sheet/nav-bar';\n\nconst GradientPickerScreen = () => {\n\tconst navigation = useNavigation();\n\tconst route = useRoute();\n\tconst { setColor, currentValue, isGradientColor } = route.params;\n\treturn (\n\t\t<View>\n\t\t\t<NavBar>\n\t\t\t\t<NavBar.BackButton onPress={ navigation.goBack } />\n\t\t\t\t<NavBar.Heading>{ __( 'Customize Gradient' ) }</NavBar.Heading>\n\t\t\t</NavBar>\n\t\t\t<CustomGradientPicker\n\t\t\t\tsetColor={ setColor }\n\t\t\t\tcurrentValue={ currentValue }\n\t\t\t\tisGradientColor={ isGradientColor }\n\t\t\t/>\n\t\t</View>\n\t);\n};\n\nexport default GradientPickerScreen;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,QAAQ,QAAQ,0BAA0B;;AAElE;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,8BAA8B;AAC/D,OAAOC,MAAM,MAAM,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE7C,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;EAClC,MAAMC,UAAU,GAAGV,aAAa,CAAC,CAAC;EAClC,MAAMW,KAAK,GAAGV,QAAQ,CAAC,CAAC;EACxB,MAAM;IAAEW,QAAQ;IAAEC,YAAY;IAAEC;EAAgB,CAAC,GAAGH,KAAK,CAACI,MAAM;EAChE,oBACCP,KAAA,CAACT,IAAI;IAAAiB,QAAA,gBACJR,KAAA,CAACJ,MAAM;MAAAY,QAAA,gBACNV,IAAA,CAACF,MAAM,CAACa,UAAU;QAACC,OAAO,EAAGR,UAAU,CAACS;MAAQ,CAAE,CAAC,eACnDb,IAAA,CAACF,MAAM,CAACgB,OAAO;QAAAJ,QAAA,EAAGd,EAAE,CAAE,oBAAqB;MAAC,CAAkB,CAAC;IAAA,CACxD,CAAC,eACTI,IAAA,CAACH,oBAAoB;MACpBS,QAAQ,EAAGA,QAAU;MACrBC,YAAY,EAAGA,YAAc;MAC7BC,eAAe,EAAGA;IAAiB,CACnC,CAAC;EAAA,CACG,CAAC;AAET,CAAC;AAED,eAAeL,oBAAoB","ignoreList":[]}
|
|
@@ -17,8 +17,7 @@ import PaletteScreen from './palette.screen';
|
|
|
17
17
|
import BottomSheet from '../bottom-sheet';
|
|
18
18
|
import { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';
|
|
19
19
|
import { colorsUtils } from './utils';
|
|
20
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
21
|
const ColorSettingsMemo = memo(({
|
|
23
22
|
defaultSettings,
|
|
24
23
|
onHandleClosingBottomSheet,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRoute","memo","useEffect","useContext","PickerScreen","GradientPickerScreen","PaletteScreen","BottomSheet","BottomSheetContext","colorsUtils","jsx","_jsx","jsxs","_jsxs","ColorSettingsMemo","defaultSettings","onHandleClosingBottomSheet","shouldEnableBottomSheetMaxHeight","onColorChange","colorValue","gradientValue","onGradientChange","onColorCleared","label","hideNavigation","NavigationContainer","children","NavigationScreen","name","screens","palette","initialParams","picker","gradientPicker","ColorSettings","props","route","params"],"sources":["@wordpress/components/src/mobile/color-settings/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useRoute } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { memo, useEffect, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport PickerScreen from './picker-screen';\nimport GradientPickerScreen from './gradient-picker-screen';\nimport PaletteScreen from './palette.screen';\nimport BottomSheet from '../bottom-sheet';\nimport { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';\n\nimport { colorsUtils } from './utils';\n\nconst ColorSettingsMemo = memo(\n\t( {\n\t\tdefaultSettings,\n\t\tonHandleClosingBottomSheet,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tonColorChange,\n\t\tcolorValue,\n\t\tgradientValue,\n\t\tonGradientChange,\n\t\tonColorCleared,\n\t\tlabel,\n\t\thideNavigation,\n\t} ) => {\n\t\tuseEffect( () => {\n\t\t\tshouldEnableBottomSheetMaxHeight( true );\n\t\t\tonHandleClosingBottomSheet( null );\n\t\t\t// Disable reason: deferring this refactor to the native team.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [] );\n\t\treturn (\n\t\t\t<BottomSheet.NavigationContainer>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ colorsUtils.screens.palette }\n\t\t\t\t\tinitialParams={ {\n\t\t\t\t\t\tdefaultSettings,\n\t\t\t\t\t\tonColorChange,\n\t\t\t\t\t\tcolorValue,\n\t\t\t\t\t\tgradientValue,\n\t\t\t\t\t\tonGradientChange,\n\t\t\t\t\t\tonColorCleared,\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\thideNavigation,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<PaletteScreen />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ colorsUtils.screens.picker }\n\t\t\t\t>\n\t\t\t\t\t<PickerScreen />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ colorsUtils.screens.gradientPicker }\n\t\t\t\t>\n\t\t\t\t\t<GradientPickerScreen />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t</BottomSheet.NavigationContainer>\n\t\t);\n\t}\n);\nfunction ColorSettings( props ) {\n\tconst route = useRoute();\n\tconst { onHandleClosingBottomSheet, shouldEnableBottomSheetMaxHeight } =\n\t\tuseContext( BottomSheetContext );\n\n\treturn (\n\t\t<ColorSettingsMemo\n\t\t\tonHandleClosingBottomSheet={ onHandleClosingBottomSheet }\n\t\t\tshouldEnableBottomSheetMaxHeight={\n\t\t\t\tshouldEnableBottomSheetMaxHeight\n\t\t\t}\n\t\t\t{ ...props }\n\t\t\t{ ...route.params }\n\t\t/>\n\t);\n}\n\nexport default ColorSettings;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,0BAA0B;;AAEnD;AACA;AACA;AACA,SAASC,IAAI,EAAEC,SAAS,EAAEC,UAAU,QAAQ,oBAAoB;;AAEhE;AACA;AACA;AACA,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAASC,kBAAkB,QAAQ,sCAAsC;AAEzE,SAASC,WAAW,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["useRoute","memo","useEffect","useContext","PickerScreen","GradientPickerScreen","PaletteScreen","BottomSheet","BottomSheetContext","colorsUtils","jsx","_jsx","jsxs","_jsxs","ColorSettingsMemo","defaultSettings","onHandleClosingBottomSheet","shouldEnableBottomSheetMaxHeight","onColorChange","colorValue","gradientValue","onGradientChange","onColorCleared","label","hideNavigation","NavigationContainer","children","NavigationScreen","name","screens","palette","initialParams","picker","gradientPicker","ColorSettings","props","route","params"],"sources":["@wordpress/components/src/mobile/color-settings/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useRoute } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { memo, useEffect, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport PickerScreen from './picker-screen';\nimport GradientPickerScreen from './gradient-picker-screen';\nimport PaletteScreen from './palette.screen';\nimport BottomSheet from '../bottom-sheet';\nimport { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';\n\nimport { colorsUtils } from './utils';\n\nconst ColorSettingsMemo = memo(\n\t( {\n\t\tdefaultSettings,\n\t\tonHandleClosingBottomSheet,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tonColorChange,\n\t\tcolorValue,\n\t\tgradientValue,\n\t\tonGradientChange,\n\t\tonColorCleared,\n\t\tlabel,\n\t\thideNavigation,\n\t} ) => {\n\t\tuseEffect( () => {\n\t\t\tshouldEnableBottomSheetMaxHeight( true );\n\t\t\tonHandleClosingBottomSheet( null );\n\t\t\t// Disable reason: deferring this refactor to the native team.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [] );\n\t\treturn (\n\t\t\t<BottomSheet.NavigationContainer>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ colorsUtils.screens.palette }\n\t\t\t\t\tinitialParams={ {\n\t\t\t\t\t\tdefaultSettings,\n\t\t\t\t\t\tonColorChange,\n\t\t\t\t\t\tcolorValue,\n\t\t\t\t\t\tgradientValue,\n\t\t\t\t\t\tonGradientChange,\n\t\t\t\t\t\tonColorCleared,\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\thideNavigation,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<PaletteScreen />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ colorsUtils.screens.picker }\n\t\t\t\t>\n\t\t\t\t\t<PickerScreen />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tname={ colorsUtils.screens.gradientPicker }\n\t\t\t\t>\n\t\t\t\t\t<GradientPickerScreen />\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t</BottomSheet.NavigationContainer>\n\t\t);\n\t}\n);\nfunction ColorSettings( props ) {\n\tconst route = useRoute();\n\tconst { onHandleClosingBottomSheet, shouldEnableBottomSheetMaxHeight } =\n\t\tuseContext( BottomSheetContext );\n\n\treturn (\n\t\t<ColorSettingsMemo\n\t\t\tonHandleClosingBottomSheet={ onHandleClosingBottomSheet }\n\t\t\tshouldEnableBottomSheetMaxHeight={\n\t\t\t\tshouldEnableBottomSheetMaxHeight\n\t\t\t}\n\t\t\t{ ...props }\n\t\t\t{ ...route.params }\n\t\t/>\n\t);\n}\n\nexport default ColorSettings;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,0BAA0B;;AAEnD;AACA;AACA;AACA,SAASC,IAAI,EAAEC,SAAS,EAAEC,UAAU,QAAQ,oBAAoB;;AAEhE;AACA;AACA;AACA,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAASC,kBAAkB,QAAQ,sCAAsC;AAEzE,SAASC,WAAW,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtC,MAAMC,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BE,0BAA0B,EAAGA,0BAA4B;IACzDC,gCAAgC,EAC/BA,gCACA;IAAA,GACIkB,KAAK;IAAA,GACLC,KAAK,CAACC;EAAM,CACjB,CAAC;AAEJ;AAEA,eAAeH,aAAa","ignoreList":[]}
|
|
@@ -23,9 +23,7 @@ import PanelBody from '../../panel/body';
|
|
|
23
23
|
import { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';
|
|
24
24
|
import ColorControl from '../../color-control';
|
|
25
25
|
import styles from './style.scss';
|
|
26
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
26
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
29
27
|
const HIT_SLOP = {
|
|
30
28
|
top: 8,
|
|
31
29
|
bottom: 8,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","Text","TouchableWithoutFeedback","__","useState","useContext","usePreferredColorSchemeStyle","useRoute","useNavigation","ColorPalette","ColorIndicator","NavBar","SegmentedControls","colorsUtils","PanelBody","BottomSheetContext","ColorControl","styles","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","HIT_SLOP","top","bottom","left","right","PaletteScreen","route","navigation","shouldEnableBottomSheetScroll","label","onColorChange","onGradientChange","onColorCleared","colorValue","defaultSettings","hideNavigation","params","segments","isGradient","currentValue","setCurrentValue","isGradientColor","selectedSegmentIndex","currentSegment","setCurrentSegment","isGradientSegment","currentSegmentColors","colors","gradients","allAvailableColors","allAvailableGradients","flatMap","filter","Boolean","horizontalSeparatorStyle","horizontalSeparator","horizontalSeparatorDark","clearButtonStyle","clearButton","clearButtonDark","selectedColorTextStyle","colorText","colorTextDark","isSolidSegment","isCustomGadientShown","setColor","color","onClear","undefined","onCustomPress","navigate","screens","picker","gradientPicker","getClearButton","accessibilityLabel","onPress","hitSlop","children","style","clearButtonContainer","getFooter","segmentHandler","selectedIndex","indexOf","addonLeft","colorIndicator","addonRight","footer","flex","maxFontSizeMultiplier","selectable","toUpperCase","selectColorText","BackButton","goBack","Heading","colorPalettes","map","palette","paletteKey","paletteSettings","allColors","allGradients","enableCustomColor","name","activeColor","withColorIndicator"],"sources":["@wordpress/components/src/mobile/color-settings/palette.screen.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text, TouchableWithoutFeedback } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState, useContext } from '@wordpress/element';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { useRoute, useNavigation } from '@react-navigation/native';\n\n/**\n * Internal dependencies\n */\nimport ColorPalette from '../../color-palette';\nimport ColorIndicator from '../../color-indicator';\nimport NavBar from '../bottom-sheet/nav-bar';\nimport SegmentedControls from '../segmented-control';\nimport { colorsUtils } from './utils';\nimport PanelBody from '../../panel/body';\nimport { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';\nimport ColorControl from '../../color-control';\n\nimport styles from './style.scss';\n\nconst HIT_SLOP = { top: 8, bottom: 8, left: 8, right: 8 };\n\nconst PaletteScreen = () => {\n\tconst route = useRoute();\n\tconst navigation = useNavigation();\n\tconst { shouldEnableBottomSheetScroll } = useContext( BottomSheetContext );\n\tconst {\n\t\tlabel,\n\t\tonColorChange,\n\t\tonGradientChange,\n\t\tonColorCleared,\n\t\tcolorValue,\n\t\tdefaultSettings,\n\t\thideNavigation = false,\n\t} = route.params || {};\n\tconst { segments, isGradient } = colorsUtils;\n\tconst [ currentValue, setCurrentValue ] = useState( colorValue );\n\tconst isGradientColor = isGradient( currentValue );\n\tconst selectedSegmentIndex = isGradientColor ? 1 : 0;\n\n\tconst [ currentSegment, setCurrentSegment ] = useState(\n\t\tsegments[ selectedSegmentIndex ]\n\t);\n\tconst isGradientSegment = currentSegment === colorsUtils.segments[ 1 ];\n\tconst currentSegmentColors = ! isGradientSegment\n\t\t? defaultSettings.colors\n\t\t: defaultSettings.gradients;\n\tconst allAvailableColors = defaultSettings?.allAvailableColors || [];\n\tconst allAvailableGradients = currentSegmentColors\n\t\t.flatMap( ( { gradients } ) => gradients )\n\t\t.filter( Boolean );\n\n\tconst horizontalSeparatorStyle = usePreferredColorSchemeStyle(\n\t\tstyles.horizontalSeparator,\n\t\tstyles.horizontalSeparatorDark\n\t);\n\tconst clearButtonStyle = usePreferredColorSchemeStyle(\n\t\tstyles.clearButton,\n\t\tstyles.clearButtonDark\n\t);\n\tconst selectedColorTextStyle = usePreferredColorSchemeStyle(\n\t\tstyles.colorText,\n\t\tstyles.colorTextDark\n\t);\n\n\tconst isSolidSegment = currentSegment === segments[ 0 ];\n\tconst isCustomGadientShown = ! isSolidSegment && isGradientColor;\n\n\tconst setColor = ( color ) => {\n\t\tsetCurrentValue( color );\n\t\tif ( isSolidSegment && onColorChange && onGradientChange ) {\n\t\t\tonColorChange( color );\n\t\t} else if ( isSolidSegment && onColorChange ) {\n\t\t\tonColorChange( color );\n\t\t} else if ( ! isSolidSegment && onGradientChange ) {\n\t\t\tonGradientChange( color );\n\t\t}\n\t};\n\n\tfunction onClear() {\n\t\tsetCurrentValue( undefined );\n\n\t\tif ( onColorCleared ) {\n\t\t\tonColorCleared();\n\t\t}\n\t}\n\n\tfunction onCustomPress() {\n\t\tif ( isSolidSegment ) {\n\t\t\tnavigation.navigate( colorsUtils.screens.picker, {\n\t\t\t\tcurrentValue,\n\t\t\t\tsetColor,\n\t\t\t} );\n\t\t} else {\n\t\t\tnavigation.navigate( colorsUtils.screens.gradientPicker, {\n\t\t\t\tsetColor,\n\t\t\t\tisGradientColor,\n\t\t\t\tcurrentValue,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction getClearButton() {\n\t\treturn (\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\taccessibilityLabel={ __( 'Clear selected color' ) }\n\t\t\t\tonPress={ onClear }\n\t\t\t\thitSlop={ HIT_SLOP }\n\t\t\t>\n\t\t\t\t<View style={ styles.clearButtonContainer }>\n\t\t\t\t\t<Text style={ clearButtonStyle }>{ __( 'Reset' ) }</Text>\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t);\n\t}\n\n\tfunction getFooter() {\n\t\tif ( onGradientChange ) {\n\t\t\treturn (\n\t\t\t\t<SegmentedControls\n\t\t\t\t\tsegments={ segments }\n\t\t\t\t\tsegmentHandler={ setCurrentSegment }\n\t\t\t\t\tselectedIndex={ segments.indexOf( currentSegment ) }\n\t\t\t\t\taddonLeft={\n\t\t\t\t\t\tcurrentValue && (\n\t\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\t\tcolor={ currentValue }\n\t\t\t\t\t\t\t\tstyle={ styles.colorIndicator }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\taddonRight={ currentValue && getClearButton() }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t<View style={ styles.footer }>\n\t\t\t\t<View style={ styles.flex }>\n\t\t\t\t\t{ currentValue && (\n\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\tcolor={ currentValue }\n\t\t\t\t\t\t\tstyle={ styles.colorIndicator }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</View>\n\t\t\t\t{ currentValue ? (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={ selectedColorTextStyle }\n\t\t\t\t\t\tmaxFontSizeMultiplier={ 2 }\n\t\t\t\t\t\tselectable\n\t\t\t\t\t>\n\t\t\t\t\t\t{ currentValue.toUpperCase() }\n\t\t\t\t\t</Text>\n\t\t\t\t) : (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={ styles.selectColorText }\n\t\t\t\t\t\tmaxFontSizeMultiplier={ 2 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Select a color above' ) }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t\t<View style={ styles.flex }>\n\t\t\t\t\t{ currentValue && getClearButton() }\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t);\n\t}\n\treturn (\n\t\t<View>\n\t\t\t{ ! hideNavigation && (\n\t\t\t\t<NavBar>\n\t\t\t\t\t<NavBar.BackButton onPress={ navigation.goBack } />\n\t\t\t\t\t<NavBar.Heading>{ label } </NavBar.Heading>\n\t\t\t\t</NavBar>\n\t\t\t) }\n\n\t\t\t<View style={ styles.colorPalettes }>\n\t\t\t\t{ currentSegmentColors.map( ( palette, paletteKey ) => {\n\t\t\t\t\tconst paletteSettings = {\n\t\t\t\t\t\tcolors: palette.colors,\n\t\t\t\t\t\tgradients: palette.gradients,\n\t\t\t\t\t\tallColors: allAvailableColors,\n\t\t\t\t\t\tallGradients: allAvailableGradients,\n\t\t\t\t\t};\n\t\t\t\t\t// Limit to show the custom indicator to the first available palette\n\t\t\t\t\tconst enableCustomColor = paletteKey === 0;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\tenableCustomColor={ enableCustomColor }\n\t\t\t\t\t\t\tlabel={ palette.name }\n\t\t\t\t\t\t\tkey={ paletteKey }\n\t\t\t\t\t\t\tsetColor={ setColor }\n\t\t\t\t\t\t\tactiveColor={ currentValue }\n\t\t\t\t\t\t\tisGradientColor={ isGradientColor }\n\t\t\t\t\t\t\tcurrentSegment={ currentSegment }\n\t\t\t\t\t\t\tonCustomPress={ onCustomPress }\n\t\t\t\t\t\t\tshouldEnableBottomSheetScroll={\n\t\t\t\t\t\t\t\tshouldEnableBottomSheetScroll\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdefaultSettings={ paletteSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</View>\n\n\t\t\t{ isCustomGadientShown && (\n\t\t\t\t<>\n\t\t\t\t\t<View style={ horizontalSeparatorStyle } />\n\t\t\t\t\t<PanelBody>\n\t\t\t\t\t\t<ColorControl\n\t\t\t\t\t\t\tlabel={ __( 'Customize Gradient' ) }\n\t\t\t\t\t\t\tonPress={ onCustomPress }\n\t\t\t\t\t\t\twithColorIndicator={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<View style={ horizontalSeparatorStyle } />\n\t\t\t{ getFooter() }\n\t\t</View>\n\t);\n};\n\nexport default PaletteScreen;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,IAAI,EAAEC,wBAAwB,QAAQ,cAAc;;AAEnE;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,UAAU,QAAQ,oBAAoB;AACzD,SAASC,4BAA4B,QAAQ,oBAAoB;AACjE,SAASC,QAAQ,EAAEC,aAAa,QAAQ,0BAA0B;;AAElE;AACA;AACA;AACA,OAAOC,YAAY,MAAM,qBAAqB;AAC9C,OAAOC,cAAc,MAAM,uBAAuB;AAClD,OAAOC,MAAM,MAAM,yBAAyB;AAC5C,OAAOC,iBAAiB,MAAM,sBAAsB;AACpD,SAASC,WAAW,QAAQ,SAAS;AACrC,OAAOC,SAAS,MAAM,kBAAkB;AACxC,SAASC,kBAAkB,QAAQ,sCAAsC;AACzE,OAAOC,YAAY,MAAM,qBAAqB;AAE9C,OAAOC,MAAM,MAAM,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAElC,MAAMC,QAAQ,GAAG;EAAEC,GAAG,EAAE,CAAC;EAAEC,MAAM,EAAE,CAAC;EAAEC,IAAI,EAAE,CAAC;EAAEC,KAAK,EAAE;AAAE,CAAC;AAEzD,MAAMC,aAAa,GAAGA,CAAA,KAAM;EAC3B,MAAMC,KAAK,GAAGvB,QAAQ,CAAC,CAAC;EACxB,MAAMwB,UAAU,GAAGvB,a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,CAAE;IAAC,CACE,CAAC,EAELpC,oBAAoB,iBACrB/C,KAAA,CAAAE,SAAA;MAAA2D,QAAA,gBACC/D,IAAA,CAACnB,IAAI;QAACmF,KAAK,EAAGzB;MAA0B,CAAE,CAAC,eAC3CvC,IAAA,CAACL,SAAS;QAAAoE,QAAA,eACT/D,IAAA,CAACH,YAAY;UACZiB,KAAK,EAAG9B,EAAE,CAAE,oBAAqB,CAAG;UACpC6E,OAAO,EAAGP,aAAe;UACzBsC,kBAAkB,EAAG;QAAO,CAC5B;MAAC,CACQ,CAAC;IAAA,CACX,CACF,eACD5F,IAAA,CAACnB,IAAI;MAACmF,KAAK,EAAGzB;IAA0B,CAAE,CAAC,EACzC2B,SAAS,CAAC,CAAC;EAAA,CACR,CAAC;AAET,CAAC;AAED,eAAexD,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["View","Text","TouchableWithoutFeedback","__","useState","useContext","usePreferredColorSchemeStyle","useRoute","useNavigation","ColorPalette","ColorIndicator","NavBar","SegmentedControls","colorsUtils","PanelBody","BottomSheetContext","ColorControl","styles","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","HIT_SLOP","top","bottom","left","right","PaletteScreen","route","navigation","shouldEnableBottomSheetScroll","label","onColorChange","onGradientChange","onColorCleared","colorValue","defaultSettings","hideNavigation","params","segments","isGradient","currentValue","setCurrentValue","isGradientColor","selectedSegmentIndex","currentSegment","setCurrentSegment","isGradientSegment","currentSegmentColors","colors","gradients","allAvailableColors","allAvailableGradients","flatMap","filter","Boolean","horizontalSeparatorStyle","horizontalSeparator","horizontalSeparatorDark","clearButtonStyle","clearButton","clearButtonDark","selectedColorTextStyle","colorText","colorTextDark","isSolidSegment","isCustomGadientShown","setColor","color","onClear","undefined","onCustomPress","navigate","screens","picker","gradientPicker","getClearButton","accessibilityLabel","onPress","hitSlop","children","style","clearButtonContainer","getFooter","segmentHandler","selectedIndex","indexOf","addonLeft","colorIndicator","addonRight","footer","flex","maxFontSizeMultiplier","selectable","toUpperCase","selectColorText","BackButton","goBack","Heading","colorPalettes","map","palette","paletteKey","paletteSettings","allColors","allGradients","enableCustomColor","name","activeColor","withColorIndicator"],"sources":["@wordpress/components/src/mobile/color-settings/palette.screen.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text, TouchableWithoutFeedback } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState, useContext } from '@wordpress/element';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { useRoute, useNavigation } from '@react-navigation/native';\n\n/**\n * Internal dependencies\n */\nimport ColorPalette from '../../color-palette';\nimport ColorIndicator from '../../color-indicator';\nimport NavBar from '../bottom-sheet/nav-bar';\nimport SegmentedControls from '../segmented-control';\nimport { colorsUtils } from './utils';\nimport PanelBody from '../../panel/body';\nimport { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';\nimport ColorControl from '../../color-control';\n\nimport styles from './style.scss';\n\nconst HIT_SLOP = { top: 8, bottom: 8, left: 8, right: 8 };\n\nconst PaletteScreen = () => {\n\tconst route = useRoute();\n\tconst navigation = useNavigation();\n\tconst { shouldEnableBottomSheetScroll } = useContext( BottomSheetContext );\n\tconst {\n\t\tlabel,\n\t\tonColorChange,\n\t\tonGradientChange,\n\t\tonColorCleared,\n\t\tcolorValue,\n\t\tdefaultSettings,\n\t\thideNavigation = false,\n\t} = route.params || {};\n\tconst { segments, isGradient } = colorsUtils;\n\tconst [ currentValue, setCurrentValue ] = useState( colorValue );\n\tconst isGradientColor = isGradient( currentValue );\n\tconst selectedSegmentIndex = isGradientColor ? 1 : 0;\n\n\tconst [ currentSegment, setCurrentSegment ] = useState(\n\t\tsegments[ selectedSegmentIndex ]\n\t);\n\tconst isGradientSegment = currentSegment === colorsUtils.segments[ 1 ];\n\tconst currentSegmentColors = ! isGradientSegment\n\t\t? defaultSettings.colors\n\t\t: defaultSettings.gradients;\n\tconst allAvailableColors = defaultSettings?.allAvailableColors || [];\n\tconst allAvailableGradients = currentSegmentColors\n\t\t.flatMap( ( { gradients } ) => gradients )\n\t\t.filter( Boolean );\n\n\tconst horizontalSeparatorStyle = usePreferredColorSchemeStyle(\n\t\tstyles.horizontalSeparator,\n\t\tstyles.horizontalSeparatorDark\n\t);\n\tconst clearButtonStyle = usePreferredColorSchemeStyle(\n\t\tstyles.clearButton,\n\t\tstyles.clearButtonDark\n\t);\n\tconst selectedColorTextStyle = usePreferredColorSchemeStyle(\n\t\tstyles.colorText,\n\t\tstyles.colorTextDark\n\t);\n\n\tconst isSolidSegment = currentSegment === segments[ 0 ];\n\tconst isCustomGadientShown = ! isSolidSegment && isGradientColor;\n\n\tconst setColor = ( color ) => {\n\t\tsetCurrentValue( color );\n\t\tif ( isSolidSegment && onColorChange && onGradientChange ) {\n\t\t\tonColorChange( color );\n\t\t} else if ( isSolidSegment && onColorChange ) {\n\t\t\tonColorChange( color );\n\t\t} else if ( ! isSolidSegment && onGradientChange ) {\n\t\t\tonGradientChange( color );\n\t\t}\n\t};\n\n\tfunction onClear() {\n\t\tsetCurrentValue( undefined );\n\n\t\tif ( onColorCleared ) {\n\t\t\tonColorCleared();\n\t\t}\n\t}\n\n\tfunction onCustomPress() {\n\t\tif ( isSolidSegment ) {\n\t\t\tnavigation.navigate( colorsUtils.screens.picker, {\n\t\t\t\tcurrentValue,\n\t\t\t\tsetColor,\n\t\t\t} );\n\t\t} else {\n\t\t\tnavigation.navigate( colorsUtils.screens.gradientPicker, {\n\t\t\t\tsetColor,\n\t\t\t\tisGradientColor,\n\t\t\t\tcurrentValue,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction getClearButton() {\n\t\treturn (\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\taccessibilityLabel={ __( 'Clear selected color' ) }\n\t\t\t\tonPress={ onClear }\n\t\t\t\thitSlop={ HIT_SLOP }\n\t\t\t>\n\t\t\t\t<View style={ styles.clearButtonContainer }>\n\t\t\t\t\t<Text style={ clearButtonStyle }>{ __( 'Reset' ) }</Text>\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t);\n\t}\n\n\tfunction getFooter() {\n\t\tif ( onGradientChange ) {\n\t\t\treturn (\n\t\t\t\t<SegmentedControls\n\t\t\t\t\tsegments={ segments }\n\t\t\t\t\tsegmentHandler={ setCurrentSegment }\n\t\t\t\t\tselectedIndex={ segments.indexOf( currentSegment ) }\n\t\t\t\t\taddonLeft={\n\t\t\t\t\t\tcurrentValue && (\n\t\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\t\tcolor={ currentValue }\n\t\t\t\t\t\t\t\tstyle={ styles.colorIndicator }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\taddonRight={ currentValue && getClearButton() }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t<View style={ styles.footer }>\n\t\t\t\t<View style={ styles.flex }>\n\t\t\t\t\t{ currentValue && (\n\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\tcolor={ currentValue }\n\t\t\t\t\t\t\tstyle={ styles.colorIndicator }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</View>\n\t\t\t\t{ currentValue ? (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={ selectedColorTextStyle }\n\t\t\t\t\t\tmaxFontSizeMultiplier={ 2 }\n\t\t\t\t\t\tselectable\n\t\t\t\t\t>\n\t\t\t\t\t\t{ currentValue.toUpperCase() }\n\t\t\t\t\t</Text>\n\t\t\t\t) : (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={ styles.selectColorText }\n\t\t\t\t\t\tmaxFontSizeMultiplier={ 2 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Select a color above' ) }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t\t<View style={ styles.flex }>\n\t\t\t\t\t{ currentValue && getClearButton() }\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t);\n\t}\n\treturn (\n\t\t<View>\n\t\t\t{ ! hideNavigation && (\n\t\t\t\t<NavBar>\n\t\t\t\t\t<NavBar.BackButton onPress={ navigation.goBack } />\n\t\t\t\t\t<NavBar.Heading>{ label } </NavBar.Heading>\n\t\t\t\t</NavBar>\n\t\t\t) }\n\n\t\t\t<View style={ styles.colorPalettes }>\n\t\t\t\t{ currentSegmentColors.map( ( palette, paletteKey ) => {\n\t\t\t\t\tconst paletteSettings = {\n\t\t\t\t\t\tcolors: palette.colors,\n\t\t\t\t\t\tgradients: palette.gradients,\n\t\t\t\t\t\tallColors: allAvailableColors,\n\t\t\t\t\t\tallGradients: allAvailableGradients,\n\t\t\t\t\t};\n\t\t\t\t\t// Limit to show the custom indicator to the first available palette\n\t\t\t\t\tconst enableCustomColor = paletteKey === 0;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\tenableCustomColor={ enableCustomColor }\n\t\t\t\t\t\t\tlabel={ palette.name }\n\t\t\t\t\t\t\tkey={ paletteKey }\n\t\t\t\t\t\t\tsetColor={ setColor }\n\t\t\t\t\t\t\tactiveColor={ currentValue }\n\t\t\t\t\t\t\tisGradientColor={ isGradientColor }\n\t\t\t\t\t\t\tcurrentSegment={ currentSegment }\n\t\t\t\t\t\t\tonCustomPress={ onCustomPress }\n\t\t\t\t\t\t\tshouldEnableBottomSheetScroll={\n\t\t\t\t\t\t\t\tshouldEnableBottomSheetScroll\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdefaultSettings={ paletteSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</View>\n\n\t\t\t{ isCustomGadientShown && (\n\t\t\t\t<>\n\t\t\t\t\t<View style={ horizontalSeparatorStyle } />\n\t\t\t\t\t<PanelBody>\n\t\t\t\t\t\t<ColorControl\n\t\t\t\t\t\t\tlabel={ __( 'Customize Gradient' ) }\n\t\t\t\t\t\t\tonPress={ onCustomPress }\n\t\t\t\t\t\t\twithColorIndicator={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<View style={ horizontalSeparatorStyle } />\n\t\t\t{ getFooter() }\n\t\t</View>\n\t);\n};\n\nexport default PaletteScreen;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,IAAI,EAAEC,wBAAwB,QAAQ,cAAc;;AAEnE;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,UAAU,QAAQ,oBAAoB;AACzD,SAASC,4BAA4B,QAAQ,oBAAoB;AACjE,SAASC,QAAQ,EAAEC,aAAa,QAAQ,0BAA0B;;AAElE;AACA;AACA;AACA,OAAOC,YAAY,MAAM,qBAAqB;AAC9C,OAAOC,cAAc,MAAM,uBAAuB;AAClD,OAAOC,MAAM,MAAM,yBAAyB;AAC5C,OAAOC,iBAAiB,MAAM,sBAAsB;AACpD,SAASC,WAAW,QAAQ,SAAS;AACrC,OAAOC,SAAS,MAAM,kBAAkB;AACxC,SAASC,kBAAkB,QAAQ,sCAAsC;AACzE,OAAOC,YAAY,MAAM,qBAAqB;AAE9C,OAAOC,MAAM,MAAM,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAElC,MAAMC,QAAQ,GAAG;EAAEC,GAAG,EAAE,CAAC;EAAEC,MAAM,EAAE,CAAC;EAAEC,IAAI,EAAE,CAAC;EAAEC,KAAK,EAAE;AAAE,CAAC;AAEzD,MAAMC,aAAa,GAAGA,CAAA,KAAM;EAC3B,MAAMC,KAAK,GAAGvB,QAAQ,CAAC,CAAC;EACxB,MAAMwB,UAAU,GAAGvB,aAAa,CAAC,CAAC;EAClC,MAAM;IAAEwB;EAA8B,CAAC,GAAG3B,UAAU,CAAEU,kBAAmB,CAAC;EAC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,IAAA,CAACnB,IAAI;QAACmF,KAAK,EAAGzB;MAA0B,CAAE,CAAC,eAC3CvC,IAAA,CAACL,SAAS;QAAAoE,QAAA,eACT/D,IAAA,CAACH,YAAY;UACZiB,KAAK,EAAG9B,EAAE,CAAE,oBAAqB,CAAG;UACpC6E,OAAO,EAAGP,aAAe;UACzBsC,kBAAkB,EAAG;QAAO,CAC5B;MAAC,CACQ,CAAC;IAAA,CACX,CACF,eACD5F,IAAA,CAACnB,IAAI;MAACmF,KAAK,EAAGzB;IAA0B,CAAE,CAAC,EACzC2B,SAAS,CAAC,CAAC;EAAA,CACR,CAAC;AAET,CAAC;AAED,eAAexD,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memo","CyclePickerCell","jsx","_jsx","CycleSelectControl","help","instanceId","label","multiple","onChange","options","className","hideLabelFromVision","props","id","onChangeValue","undefined"],"sources":["@wordpress/components/src/mobile/cycle-select-control/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport CyclePickerCell from '../bottom-sheet/cycle-picker-cell';\n\nfunction CycleSelectControl( {\n\thelp,\n\tinstanceId,\n\tlabel,\n\tmultiple = false,\n\tonChange,\n\toptions = [],\n\tclassName,\n\thideLabelFromVision,\n\t...props\n} ) {\n\tconst id = `inspector-select-control-${ instanceId }`;\n\n\treturn (\n\t\t<CyclePickerCell\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t\tonChangeValue={ onChange }\n\t\t\taria-describedby={ !! help ? `${ id }__help` : undefined }\n\t\t\tmultiple={ multiple }\n\t\t\toptions={ options }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default memo( CycleSelectControl );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,oBAAoB;AACzC;AACA;AACA;AACA,OAAOC,eAAe,MAAM,mCAAmC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEhE,SAASC,kBAAkBA,CAAE;EAC5BC,IAAI;EACJC,UAAU;EACVC,KAAK;EACLC,QAAQ,GAAG,KAAK;EAChBC,QAAQ;EACRC,OAAO,GAAG,EAAE;EACZC,SAAS;EACTC,mBAAmB;EACnB,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,EAAE,
|
|
1
|
+
{"version":3,"names":["memo","CyclePickerCell","jsx","_jsx","CycleSelectControl","help","instanceId","label","multiple","onChange","options","className","hideLabelFromVision","props","id","onChangeValue","undefined"],"sources":["@wordpress/components/src/mobile/cycle-select-control/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport CyclePickerCell from '../bottom-sheet/cycle-picker-cell';\n\nfunction CycleSelectControl( {\n\thelp,\n\tinstanceId,\n\tlabel,\n\tmultiple = false,\n\tonChange,\n\toptions = [],\n\tclassName,\n\thideLabelFromVision,\n\t...props\n} ) {\n\tconst id = `inspector-select-control-${ instanceId }`;\n\n\treturn (\n\t\t<CyclePickerCell\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t\tonChangeValue={ onChange }\n\t\t\taria-describedby={ !! help ? `${ id }__help` : undefined }\n\t\t\tmultiple={ multiple }\n\t\t\toptions={ options }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default memo( CycleSelectControl );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,oBAAoB;AACzC;AACA;AACA;AACA,OAAOC,eAAe,MAAM,mCAAmC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEhE,SAASC,kBAAkBA,CAAE;EAC5BC,IAAI;EACJC,UAAU;EACVC,KAAK;EACLC,QAAQ,GAAG,KAAK;EAChBC,QAAQ;EACRC,OAAO,GAAG,EAAE;EACZC,SAAS;EACTC,mBAAmB;EACnB,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,EAAE,GAAG,4BAA6BR,UAAU,EAAG;EAErD,oBACCH,IAAA,CAACF,eAAe;IACfM,KAAK,EAAGA,KAAO;IACfK,mBAAmB,EAAGA,mBAAqB;IAC3CE,EAAE,EAAGA,EAAI;IACTT,IAAI,EAAGA,IAAM;IACbM,SAAS,EAAGA,SAAW;IACvBI,aAAa,EAAGN,QAAU;IAC1B,oBAAmB,CAAC,CAAEJ,IAAI,GAAG,GAAIS,EAAE,QAAS,GAAGE,SAAW;IAC1DR,QAAQ,EAAGA,QAAU;IACrBE,OAAO,EAAGA,OAAS;IAAA,GACdG;EAAK,CACV,CAAC;AAEJ;AAEA,eAAeb,IAAI,CAAEI,kBAAmB,CAAC","ignoreList":[]}
|
|
@@ -17,8 +17,7 @@ import NavBar from '../bottom-sheet/nav-bar';
|
|
|
17
17
|
import styles from './styles.scss';
|
|
18
18
|
import { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';
|
|
19
19
|
import FocalPointPicker from '../../focal-point-picker';
|
|
20
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
21
|
const FocalPointSettingsPanelMemo = memo(({
|
|
23
22
|
focalPoint,
|
|
24
23
|
onFocalPointChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SafeAreaView","useRoute","useNavigation","__","memo","useContext","useState","useCallback","NavBar","styles","BottomSheetContext","FocalPointPicker","jsx","_jsx","jsxs","_jsxs","FocalPointSettingsPanelMemo","focalPoint","onFocalPointChange","shouldEnableBottomSheetScroll","url","navigation","onButtonPress","action","goBack","draftFocalPoint","setDraftFocalPoint","setPosition","coordinates","prevState","style","safearea","children","DismissButton","onPress","Heading","ApplyButton","onChange","FocalPointSettingsPanel","props","route","params"],"sources":["@wordpress/components/src/mobile/focal-point-settings-panel/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { SafeAreaView } from 'react-native';\nimport { useRoute, useNavigation } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { memo, useContext, useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport NavBar from '../bottom-sheet/nav-bar';\nimport styles from './styles.scss';\nimport { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';\nimport FocalPointPicker from '../../focal-point-picker';\n\nconst FocalPointSettingsPanelMemo = memo(\n\t( {\n\t\tfocalPoint,\n\t\tonFocalPointChange,\n\t\tshouldEnableBottomSheetScroll,\n\t\turl,\n\t} ) => {\n\t\tconst navigation = useNavigation();\n\n\t\tfunction onButtonPress( action ) {\n\t\t\tnavigation.goBack();\n\t\t\tif ( action === 'apply' ) {\n\t\t\t\tonFocalPointChange( draftFocalPoint );\n\t\t\t}\n\t\t}\n\n\t\tconst [ draftFocalPoint, setDraftFocalPoint ] = useState( focalPoint );\n\t\tfunction setPosition( coordinates ) {\n\t\t\tsetDraftFocalPoint( ( prevState ) => ( {\n\t\t\t\t...prevState,\n\t\t\t\t...coordinates,\n\t\t\t} ) );\n\t\t}\n\n\t\treturn (\n\t\t\t<SafeAreaView style={ styles.safearea }>\n\t\t\t\t<NavBar>\n\t\t\t\t\t<NavBar.DismissButton\n\t\t\t\t\t\tonPress={ () => onButtonPress( 'cancel' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<NavBar.Heading>\n\t\t\t\t\t\t{ __( 'Edit focal point' ) }\n\t\t\t\t\t</NavBar.Heading>\n\t\t\t\t\t<NavBar.ApplyButton\n\t\t\t\t\t\tonPress={ () => onButtonPress( 'apply' ) }\n\t\t\t\t\t/>\n\t\t\t\t</NavBar>\n\t\t\t\t<FocalPointPicker\n\t\t\t\t\tfocalPoint={ draftFocalPoint }\n\t\t\t\t\tonChange={ useCallback( setPosition, [] ) }\n\t\t\t\t\tshouldEnableBottomSheetScroll={\n\t\t\t\t\t\tshouldEnableBottomSheetScroll\n\t\t\t\t\t}\n\t\t\t\t\turl={ url }\n\t\t\t\t/>\n\t\t\t</SafeAreaView>\n\t\t);\n\t}\n);\n\nfunction FocalPointSettingsPanel( props ) {\n\tconst route = useRoute();\n\tconst { shouldEnableBottomSheetScroll } = useContext( BottomSheetContext );\n\n\treturn (\n\t\t<FocalPointSettingsPanelMemo\n\t\t\tshouldEnableBottomSheetScroll={ shouldEnableBottomSheetScroll }\n\t\t\t{ ...props }\n\t\t\t{ ...route.params }\n\t\t/>\n\t);\n}\n\nexport default FocalPointSettingsPanel;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,cAAc;AAC3C,SAASC,QAAQ,EAAEC,aAAa,QAAQ,0BAA0B;;AAElE;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,oBAAoB;;AAE5E;AACA;AACA;AACA,OAAOC,MAAM,MAAM,yBAAyB;AAC5C,OAAOC,MAAM,MAAM,eAAe;AAClC,SAASC,kBAAkB,QAAQ,sCAAsC;AACzE,OAAOC,gBAAgB,MAAM,0BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["SafeAreaView","useRoute","useNavigation","__","memo","useContext","useState","useCallback","NavBar","styles","BottomSheetContext","FocalPointPicker","jsx","_jsx","jsxs","_jsxs","FocalPointSettingsPanelMemo","focalPoint","onFocalPointChange","shouldEnableBottomSheetScroll","url","navigation","onButtonPress","action","goBack","draftFocalPoint","setDraftFocalPoint","setPosition","coordinates","prevState","style","safearea","children","DismissButton","onPress","Heading","ApplyButton","onChange","FocalPointSettingsPanel","props","route","params"],"sources":["@wordpress/components/src/mobile/focal-point-settings-panel/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { SafeAreaView } from 'react-native';\nimport { useRoute, useNavigation } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { memo, useContext, useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport NavBar from '../bottom-sheet/nav-bar';\nimport styles from './styles.scss';\nimport { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';\nimport FocalPointPicker from '../../focal-point-picker';\n\nconst FocalPointSettingsPanelMemo = memo(\n\t( {\n\t\tfocalPoint,\n\t\tonFocalPointChange,\n\t\tshouldEnableBottomSheetScroll,\n\t\turl,\n\t} ) => {\n\t\tconst navigation = useNavigation();\n\n\t\tfunction onButtonPress( action ) {\n\t\t\tnavigation.goBack();\n\t\t\tif ( action === 'apply' ) {\n\t\t\t\tonFocalPointChange( draftFocalPoint );\n\t\t\t}\n\t\t}\n\n\t\tconst [ draftFocalPoint, setDraftFocalPoint ] = useState( focalPoint );\n\t\tfunction setPosition( coordinates ) {\n\t\t\tsetDraftFocalPoint( ( prevState ) => ( {\n\t\t\t\t...prevState,\n\t\t\t\t...coordinates,\n\t\t\t} ) );\n\t\t}\n\n\t\treturn (\n\t\t\t<SafeAreaView style={ styles.safearea }>\n\t\t\t\t<NavBar>\n\t\t\t\t\t<NavBar.DismissButton\n\t\t\t\t\t\tonPress={ () => onButtonPress( 'cancel' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<NavBar.Heading>\n\t\t\t\t\t\t{ __( 'Edit focal point' ) }\n\t\t\t\t\t</NavBar.Heading>\n\t\t\t\t\t<NavBar.ApplyButton\n\t\t\t\t\t\tonPress={ () => onButtonPress( 'apply' ) }\n\t\t\t\t\t/>\n\t\t\t\t</NavBar>\n\t\t\t\t<FocalPointPicker\n\t\t\t\t\tfocalPoint={ draftFocalPoint }\n\t\t\t\t\tonChange={ useCallback( setPosition, [] ) }\n\t\t\t\t\tshouldEnableBottomSheetScroll={\n\t\t\t\t\t\tshouldEnableBottomSheetScroll\n\t\t\t\t\t}\n\t\t\t\t\turl={ url }\n\t\t\t\t/>\n\t\t\t</SafeAreaView>\n\t\t);\n\t}\n);\n\nfunction FocalPointSettingsPanel( props ) {\n\tconst route = useRoute();\n\tconst { shouldEnableBottomSheetScroll } = useContext( BottomSheetContext );\n\n\treturn (\n\t\t<FocalPointSettingsPanelMemo\n\t\t\tshouldEnableBottomSheetScroll={ shouldEnableBottomSheetScroll }\n\t\t\t{ ...props }\n\t\t\t{ ...route.params }\n\t\t/>\n\t);\n}\n\nexport default FocalPointSettingsPanel;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,cAAc;AAC3C,SAASC,QAAQ,EAAEC,aAAa,QAAQ,0BAA0B;;AAElE;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,oBAAoB;;AAE5E;AACA;AACA;AACA,OAAOC,MAAM,MAAM,yBAAyB;AAC5C,OAAOC,MAAM,MAAM,eAAe;AAClC,SAASC,kBAAkB,QAAQ,sCAAsC;AACzE,OAAOC,gBAAgB,MAAM,0BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAExD,MAAMC,2BAA2B,GAAGZ,IAAI,CACvC,CAAE;EACDa,UAAU;EACVC,kBAAkB;EAClBC,6BAA6B;EAC7BC;AACD,CAAC,KAAM;EACN,MAAMC,UAAU,GAAGnB,aAAa,CAAC,CAAC;EAElC,SAASoB,aAAaA,CAAEC,MAAM,EAAG;IAChCF,UAAU,CAACG,MAAM,CAAC,CAAC;IACnB,IAAKD,MAAM,KAAK,OAAO,EAAG;MACzBL,kBAAkB,CAAEO,eAAgB,CAAC;IACtC;EACD;EAEA,MAAM,CAAEA,eAAe,EAAEC,kBAAkB,CAAE,GAAGpB,QAAQ,CAAEW,UAAW,CAAC;EACtE,SAAS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|
|
18
18
|
import { colorsUtils } from '../color-settings/utils';
|
|
19
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
20
|
export function getGradientAngle(gradientValue) {
|
|
22
21
|
const angleBase = 45;
|
|
23
22
|
const matchAngle = /\(((\d+deg)|(to\s[^,]+))/;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","Platform","RNLinearGradient","gradientParser","RadialGradient","Stop","SVG","Defs","Rect","useResizeObserver","useMemo","styles","colorsUtils","jsx","_jsx","jsxs","_jsxs","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","useAngle","overflow","radialGradientContent","id","gradientUnits","rx","ry","cy","OS","group","offset","stopColor","stopOpacity","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 { 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';\nimport { colorsUtils } from '../color-settings/utils';\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 {\n\t\treturn 4 * angleBase;\n\t}\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,cAAc,EAAEC,IAAI,EAAEC,GAAG,EAAEC,IAAI,EAAEC,IAAI,QAAQ,uBAAuB;AAC7E,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AAC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AAK,EAAGA,KAAO;MAAA,GACVK,UAAU;MAAAD,QAAA,EAEbA;IAAQ,CACO,CAAC;EAErB;EAEA,oBACCtC,KAAA,CAAChB,IAAI;IAACkD,KAAK,EAAG,CAAEA,KAAK,EAAEvC,MAAM,CAACyD,QAAQ,CAAI;IAAAd,QAAA,gBACzCxC,IAAA,CAACd,IAAI;MAACkD,KAAK,EAAGvC,MAAM,CAAC0D,qBAAuB;MAAAf,QAAA,EAAGA;IAAQ,CAAQ,CAAC,EAC9DE,cAAc,eAChBxC,KAAA,CAACV,GAAG;MAAAgD,QAAA,gBACHxC,IAAA,CAACP,IAAI;QAAA+C,QAAA,eACJxC,IAAA,CAACV;QACA;QAAA;UACAkE,EAAE,EAAC,gBAAgB;UACnBC,aAAa,EAAC,gBAAgB;UAC9BC,EAAE,EAAC,KAAK;UACRC,EAAE,EAAC,KAAK;UACRC,EAAE,EAAGzE,QAAQ,CAAC0E,EAAE,KAAK,SAAS,GAAGjB,KAAK,GAAG,CAAC,GAAG,KAAO;UAAAJ,QAAA,EAElDT,UAAU,CAACZ,GAAG,CAAI2C,KAAK,IAAM;YAC9B,oBACC9D,IAAA,CAACT,IAAI;cACJwE,MAAM,EAAGD,KAAK,CAAE,CAAC,CAAI;cACrBE,SAAS,EAAGF,KAAK,CAAE,CAAC,CAAI;cACxBG,WAAW,EAAC;YAAG,GACR,GAAGH,KAAK,CAAE,CAAC,CAAI,IAAIA,KAAK,CAAE,CAAC,CAAI,EACtC,CAAC;UAEJ,CAAE;QAAC,CACY;MAAC,CACZ,CAAC,eACP9D,IAAA,CAACN,IAAI;QACJmD,MAAM,EAAGA,MAAQ;QACjBD,KAAK,EAAGA,KAAO;QACfsB,IAAI,EAAC;MAAsB,CAC3B,CAAC;IAAA,CACE,CAAC;EAAA,CACD,CAAC;AAET;AAEA,eAAe/B,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["View","Platform","RNLinearGradient","gradientParser","RadialGradient","Stop","SVG","Defs","Rect","useResizeObserver","useMemo","styles","colorsUtils","jsx","_jsx","jsxs","_jsxs","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","useAngle","overflow","radialGradientContent","id","gradientUnits","rx","ry","cy","OS","group","offset","stopColor","stopOpacity","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 { 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';\nimport { colorsUtils } from '../color-settings/utils';\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 {\n\t\treturn 4 * angleBase;\n\t}\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,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;AACjC,SAASC,WAAW,QAAQ,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtD,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;EAE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I;QAAA+C,QAAA,eACJxC,IAAA,CAACV;QACA;QAAA;UACAkE,EAAE,EAAC,gBAAgB;UACnBC,aAAa,EAAC,gBAAgB;UAC9BC,EAAE,EAAC,KAAK;UACRC,EAAE,EAAC,KAAK;UACRC,EAAE,EAAGzE,QAAQ,CAAC0E,EAAE,KAAK,SAAS,GAAGjB,KAAK,GAAG,CAAC,GAAG,KAAO;UAAAJ,QAAA,EAElDT,UAAU,CAACZ,GAAG,CAAI2C,KAAK,IAAM;YAC9B,oBACC9D,IAAA,CAACT,IAAI;cACJwE,MAAM,EAAGD,KAAK,CAAE,CAAC,CAAI;cACrBE,SAAS,EAAGF,KAAK,CAAE,CAAC,CAAI;cACxBG,WAAW,EAAC;YAAG,GACT,GAAIH,KAAK,CAAE,CAAC,CAAE,IAAMA,KAAK,CAAE,CAAC,CAAE,EACpC,CAAC;UAEJ,CAAE;QAAC,CACY;MAAC,CACZ,CAAC,eACP9D,IAAA,CAACN,IAAI;QACJmD,MAAM,EAAGA,MAAQ;QACjBD,KAAK,EAAGA,KAAO;QACfsB,IAAI,EAAC;MAAsB,CAC3B,CAAC;IAAA,CACE,CAAC;EAAA,CACD,CAAC;AAET;AAEA,eAAe/B,QAAQ","ignoreList":[]}
|
|
@@ -18,8 +18,7 @@ import { withInstanceId, compose, withPreferredColorScheme } from '@wordpress/co
|
|
|
18
18
|
*/
|
|
19
19
|
import KeyboardAvoidingView from '../keyboard-avoiding-view';
|
|
20
20
|
import styles from './style.scss';
|
|
21
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
22
|
export class HTMLTextInput extends Component {
|
|
24
23
|
constructor() {
|
|
25
24
|
super(...arguments);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ScrollView","TextInput","Component","__","parse","withDispatch","withSelect","addFilter","removeFilter","withInstanceId","compose","withPreferredColorScheme","KeyboardAvoidingView","styles","jsx","_jsx","jsxs","_jsxs","HTMLTextInput","constructor","arguments","edit","bind","stopEditing","getHTMLForParent","state","getDerivedStateFromProps","props","isDirty","value","componentWillUnmount","html","onChange","setState","onPersist","render","editTitle","getStylesFromColorScheme","parentHeight","style","title","titleStyle","htmlViewTitle","htmlViewTitleDark","text","color","htmlStyle","htmlView","htmlViewDark","placeholderStyle","placeholder","placeholderDark","keyboardAvoidingView","children","scrollView","autoCorrect","accessibilityLabel","textAlignVertical","numberOfLines","placeholderTextColor","onChangeText","ref","contentTextInputRef","multiline","onBlur","scrollEnabled","rejectResponderTermination","select","getEditedPostAttribute","getEditedPostContent","dispatch","editPost","resetEditorBlocks","content","blocks"],"sources":["@wordpress/components/src/mobile/html-text-input/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, TextInput } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { parse } from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { addFilter, removeFilter } from '@wordpress/hooks';\nimport {\n\twithInstanceId,\n\tcompose,\n\twithPreferredColorScheme,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport KeyboardAvoidingView from '../keyboard-avoiding-view';\nimport styles from './style.scss';\n\nexport class HTMLTextInput extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.edit = this.edit.bind( this );\n\t\tthis.stopEditing = this.stopEditing.bind( this );\n\t\tthis.getHTMLForParent = this.getHTMLForParent.bind( this );\n\t\taddFilter(\n\t\t\t'native.persist-html',\n\t\t\t'html-text-input',\n\t\t\tthis.getHTMLForParent\n\t\t);\n\n\t\tthis.state = {};\n\t}\n\n\tstatic getDerivedStateFromProps( props, state ) {\n\t\tif ( state.isDirty ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn {\n\t\t\tvalue: props.value,\n\t\t\tisDirty: false,\n\t\t};\n\t}\n\n\tcomponentWillUnmount() {\n\t\tremoveFilter( 'native.persist-html', 'html-text-input' );\n\t\t// TODO: Blocking main thread.\n\t\tthis.stopEditing();\n\t}\n\n\tedit( html ) {\n\t\tthis.props.onChange( html );\n\t\tthis.setState( { value: html, isDirty: true } );\n\t}\n\n\tgetHTMLForParent() {\n\t\treturn this.state.value;\n\t}\n\n\tstopEditing() {\n\t\tif ( this.state.isDirty ) {\n\t\t\tthis.props.onPersist( this.state.value );\n\t\t\tthis.setState( { isDirty: false } );\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\teditTitle,\n\t\t\tgetStylesFromColorScheme,\n\t\t\tparentHeight,\n\t\t\tstyle,\n\t\t\ttitle,\n\t\t} = this.props;\n\t\tconst titleStyle = [\n\t\t\tgetStylesFromColorScheme(\n\t\t\t\tstyles.htmlViewTitle,\n\t\t\t\tstyles.htmlViewTitleDark\n\t\t\t),\n\t\t\tstyle?.text && { color: style.text },\n\t\t];\n\t\tconst htmlStyle = [\n\t\t\tgetStylesFromColorScheme( styles.htmlView, styles.htmlViewDark ),\n\t\t\tstyle?.text && { color: style.text },\n\t\t];\n\t\tconst placeholderStyle = {\n\t\t\t...getStylesFromColorScheme(\n\t\t\t\tstyles.placeholder,\n\t\t\t\tstyles.placeholderDark\n\t\t\t),\n\t\t\t...( style?.text && { color: style.text } ),\n\t\t};\n\t\treturn (\n\t\t\t<KeyboardAvoidingView\n\t\t\t\tstyle={ styles.keyboardAvoidingView }\n\t\t\t\tparentHeight={ parentHeight }\n\t\t\t>\n\t\t\t\t<ScrollView style={ styles.scrollView }>\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tautoCorrect={ false }\n\t\t\t\t\t\taccessibilityLabel=\"html-view-title\"\n\t\t\t\t\t\ttextAlignVertical=\"center\"\n\t\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\t\tstyle={ titleStyle }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tplaceholder={ __( 'Add title' ) }\n\t\t\t\t\t\tplaceholderTextColor={ placeholderStyle.color }\n\t\t\t\t\t\tonChangeText={ editTitle }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tref={ this.contentTextInputRef }\n\t\t\t\t\t\tautoCorrect={ false }\n\t\t\t\t\t\taccessibilityLabel=\"html-view-content\"\n\t\t\t\t\t\ttextAlignVertical=\"top\"\n\t\t\t\t\t\tmultiline\n\t\t\t\t\t\tstyle={ htmlStyle }\n\t\t\t\t\t\tvalue={ this.state.value }\n\t\t\t\t\t\tonChangeText={ this.edit }\n\t\t\t\t\t\tonBlur={ this.stopEditing }\n\t\t\t\t\t\tplaceholder={ __( 'Start writing…' ) }\n\t\t\t\t\t\tplaceholderTextColor={ placeholderStyle.color }\n\t\t\t\t\t\tscrollEnabled={ false }\n\t\t\t\t\t\t// [Only iOS] This prop prevents the text input from\n\t\t\t\t\t\t// automatically getting focused after scrolling\n\t\t\t\t\t\t// content.\n\t\t\t\t\t\trejectResponderTermination={ false }\n\t\t\t\t\t/>\n\t\t\t\t</ScrollView>\n\t\t\t</KeyboardAvoidingView>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getEditedPostContent } =\n\t\t\tselect( 'core/editor' );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tvalue: getEditedPostContent(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, resetEditorBlocks } = dispatch( 'core/editor' );\n\t\treturn {\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\tonChange( content ) {\n\t\t\t\teditPost( { content } );\n\t\t\t},\n\t\t\tonPersist( content ) {\n\t\t\t\tconst blocks = parse( content );\n\t\t\t\tresetEditorBlocks( blocks );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n\twithPreferredColorScheme,\n] )( HTMLTextInput );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,SAAS,QAAQ,cAAc;;AAEpD;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,QAAQ,mBAAmB;AACzC,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,SAAS,EAAEC,YAAY,QAAQ,kBAAkB;AAC1D,SACCC,cAAc,EACdC,OAAO,EACPC,wBAAwB,QAClB,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,2BAA2B;AAC5D,OAAOC,MAAM,MAAM,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["ScrollView","TextInput","Component","__","parse","withDispatch","withSelect","addFilter","removeFilter","withInstanceId","compose","withPreferredColorScheme","KeyboardAvoidingView","styles","jsx","_jsx","jsxs","_jsxs","HTMLTextInput","constructor","arguments","edit","bind","stopEditing","getHTMLForParent","state","getDerivedStateFromProps","props","isDirty","value","componentWillUnmount","html","onChange","setState","onPersist","render","editTitle","getStylesFromColorScheme","parentHeight","style","title","titleStyle","htmlViewTitle","htmlViewTitleDark","text","color","htmlStyle","htmlView","htmlViewDark","placeholderStyle","placeholder","placeholderDark","keyboardAvoidingView","children","scrollView","autoCorrect","accessibilityLabel","textAlignVertical","numberOfLines","placeholderTextColor","onChangeText","ref","contentTextInputRef","multiline","onBlur","scrollEnabled","rejectResponderTermination","select","getEditedPostAttribute","getEditedPostContent","dispatch","editPost","resetEditorBlocks","content","blocks"],"sources":["@wordpress/components/src/mobile/html-text-input/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, TextInput } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { parse } from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { addFilter, removeFilter } from '@wordpress/hooks';\nimport {\n\twithInstanceId,\n\tcompose,\n\twithPreferredColorScheme,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport KeyboardAvoidingView from '../keyboard-avoiding-view';\nimport styles from './style.scss';\n\nexport class HTMLTextInput extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.edit = this.edit.bind( this );\n\t\tthis.stopEditing = this.stopEditing.bind( this );\n\t\tthis.getHTMLForParent = this.getHTMLForParent.bind( this );\n\t\taddFilter(\n\t\t\t'native.persist-html',\n\t\t\t'html-text-input',\n\t\t\tthis.getHTMLForParent\n\t\t);\n\n\t\tthis.state = {};\n\t}\n\n\tstatic getDerivedStateFromProps( props, state ) {\n\t\tif ( state.isDirty ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn {\n\t\t\tvalue: props.value,\n\t\t\tisDirty: false,\n\t\t};\n\t}\n\n\tcomponentWillUnmount() {\n\t\tremoveFilter( 'native.persist-html', 'html-text-input' );\n\t\t// TODO: Blocking main thread.\n\t\tthis.stopEditing();\n\t}\n\n\tedit( html ) {\n\t\tthis.props.onChange( html );\n\t\tthis.setState( { value: html, isDirty: true } );\n\t}\n\n\tgetHTMLForParent() {\n\t\treturn this.state.value;\n\t}\n\n\tstopEditing() {\n\t\tif ( this.state.isDirty ) {\n\t\t\tthis.props.onPersist( this.state.value );\n\t\t\tthis.setState( { isDirty: false } );\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\teditTitle,\n\t\t\tgetStylesFromColorScheme,\n\t\t\tparentHeight,\n\t\t\tstyle,\n\t\t\ttitle,\n\t\t} = this.props;\n\t\tconst titleStyle = [\n\t\t\tgetStylesFromColorScheme(\n\t\t\t\tstyles.htmlViewTitle,\n\t\t\t\tstyles.htmlViewTitleDark\n\t\t\t),\n\t\t\tstyle?.text && { color: style.text },\n\t\t];\n\t\tconst htmlStyle = [\n\t\t\tgetStylesFromColorScheme( styles.htmlView, styles.htmlViewDark ),\n\t\t\tstyle?.text && { color: style.text },\n\t\t];\n\t\tconst placeholderStyle = {\n\t\t\t...getStylesFromColorScheme(\n\t\t\t\tstyles.placeholder,\n\t\t\t\tstyles.placeholderDark\n\t\t\t),\n\t\t\t...( style?.text && { color: style.text } ),\n\t\t};\n\t\treturn (\n\t\t\t<KeyboardAvoidingView\n\t\t\t\tstyle={ styles.keyboardAvoidingView }\n\t\t\t\tparentHeight={ parentHeight }\n\t\t\t>\n\t\t\t\t<ScrollView style={ styles.scrollView }>\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tautoCorrect={ false }\n\t\t\t\t\t\taccessibilityLabel=\"html-view-title\"\n\t\t\t\t\t\ttextAlignVertical=\"center\"\n\t\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\t\tstyle={ titleStyle }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tplaceholder={ __( 'Add title' ) }\n\t\t\t\t\t\tplaceholderTextColor={ placeholderStyle.color }\n\t\t\t\t\t\tonChangeText={ editTitle }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tref={ this.contentTextInputRef }\n\t\t\t\t\t\tautoCorrect={ false }\n\t\t\t\t\t\taccessibilityLabel=\"html-view-content\"\n\t\t\t\t\t\ttextAlignVertical=\"top\"\n\t\t\t\t\t\tmultiline\n\t\t\t\t\t\tstyle={ htmlStyle }\n\t\t\t\t\t\tvalue={ this.state.value }\n\t\t\t\t\t\tonChangeText={ this.edit }\n\t\t\t\t\t\tonBlur={ this.stopEditing }\n\t\t\t\t\t\tplaceholder={ __( 'Start writing…' ) }\n\t\t\t\t\t\tplaceholderTextColor={ placeholderStyle.color }\n\t\t\t\t\t\tscrollEnabled={ false }\n\t\t\t\t\t\t// [Only iOS] This prop prevents the text input from\n\t\t\t\t\t\t// automatically getting focused after scrolling\n\t\t\t\t\t\t// content.\n\t\t\t\t\t\trejectResponderTermination={ false }\n\t\t\t\t\t/>\n\t\t\t\t</ScrollView>\n\t\t\t</KeyboardAvoidingView>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getEditedPostContent } =\n\t\t\tselect( 'core/editor' );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tvalue: getEditedPostContent(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, resetEditorBlocks } = dispatch( 'core/editor' );\n\t\treturn {\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\tonChange( content ) {\n\t\t\t\teditPost( { content } );\n\t\t\t},\n\t\t\tonPersist( content ) {\n\t\t\t\tconst blocks = parse( content );\n\t\t\t\tresetEditorBlocks( blocks );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n\twithPreferredColorScheme,\n] )( HTMLTextInput );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,SAAS,QAAQ,cAAc;;AAEpD;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,QAAQ,mBAAmB;AACzC,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,SAAS,EAAEC,YAAY,QAAQ,kBAAkB;AAC1D,SACCC,cAAc,EACdC,OAAO,EACPC,wBAAwB,QAClB,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,2BAA2B;AAC5D,OAAOC,MAAM,MAAM,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAElC,OAAO,MAAMC,aAAa,SAAShB,SAAS,CAAC;EAC5CiB,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IAErB,IAAI,CAACC,IAAI,GAAG,IAAI,CAAC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B,CAAC,CAAEO,aAAc,CAAC","ignoreList":[]}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { SVG, Path } from '@wordpress/primitives';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
6
|
export default /*#__PURE__*/_jsxs(SVG, {
|
|
8
7
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9
8
|
viewBox: "0 0 24 24",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SVG","Path","jsx","_jsx","jsxs","_jsxs","xmlns","viewBox","children","d","fill"],"sources":["@wordpress/components/src/mobile/image/icon-retry.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nexport default (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z\" />\n\t\t<Path d=\"M0 0h24v24H0z\" fill=\"none\" />\n\t</SVG>\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAG,EAAEC,IAAI,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["SVG","Path","jsx","_jsx","jsxs","_jsxs","xmlns","viewBox","children","d","fill"],"sources":["@wordpress/components/src/mobile/image/icon-retry.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nexport default (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z\" />\n\t\t<Path d=\"M0 0h24v24H0z\" fill=\"none\" />\n\t</SVG>\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAG,EAAEC,IAAI,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAElD,4BACCA,KAAA,CAACL,GAAG;EAACM,KAAK,EAAC,4BAA4B;EAACC,OAAO,EAAC,WAAW;EAAAC,QAAA,gBAC1DL,IAAA,CAACF,IAAI;IAACQ,CAAC,EAAC;EAA4M,CAAE,CAAC,eACvNN,IAAA,CAACF,IAAI;IAACQ,CAAC,EAAC,eAAe;IAACC,IAAI,EAAC;EAAM,CAAE,CAAC;AAAA,CAClC,CAAC","ignoreList":[]}
|
|
@@ -15,8 +15,7 @@ import { MediaEdit } from '../media-edit';
|
|
|
15
15
|
import SvgIconCustomize from './icon-customize';
|
|
16
16
|
import styles from './style.scss';
|
|
17
17
|
import Icon from '../../icon';
|
|
18
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
19
|
const accessibilityHint = Platform.OS === 'ios' ? __('Double tap to open Action Sheet to edit, replace, or clear the image') : __('Double tap to open Bottom Sheet to edit, replace, or clear the image');
|
|
21
20
|
const ImageEditingButton = ({
|
|
22
21
|
onSelectMediaUploadOption,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TouchableWithoutFeedback","View","Platform","__","MediaEdit","SvgIconCustomize","styles","Icon","jsx","_jsx","jsxs","_jsxs","accessibilityHint","OS","ImageEditingButton","onSelectMediaUploadOption","openMediaOptions","pickerOptions","url","onSelect","source","uri","openReplaceMediaOptions","render","open","mediaOptions","accessibilityLabel","accessibilityRole","onPress","children","style","editContainer","edit","size","icon","iconCustomise"],"sources":["@wordpress/components/src/mobile/image/image-editing-button.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { TouchableWithoutFeedback, View, Platform } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { MediaEdit } from '../media-edit';\nimport SvgIconCustomize from './icon-customize';\nimport styles from './style.scss';\nimport Icon from '../../icon';\n\nconst accessibilityHint =\n\tPlatform.OS === 'ios'\n\t\t? __(\n\t\t\t\t'Double tap to open Action Sheet to edit, replace, or clear the image'\n\t\t )\n\t\t: __(\n\t\t\t\t'Double tap to open Bottom Sheet to edit, replace, or clear the image'\n\t\t );\n\nconst ImageEditingButton = ( {\n\tonSelectMediaUploadOption,\n\topenMediaOptions,\n\tpickerOptions,\n\turl,\n} ) => {\n\treturn (\n\t\t<MediaEdit\n\t\t\tonSelect={ onSelectMediaUploadOption }\n\t\t\tsource={ { uri: url } }\n\t\t\topenReplaceMediaOptions={ openMediaOptions }\n\t\t\trender={ ( { open, mediaOptions } ) => (\n\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\t\t\taccessibilityLabel={ __( 'Edit image' ) }\n\t\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\t\tonPress={ open }\n\t\t\t\t>\n\t\t\t\t\t<View style={ styles.editContainer }>\n\t\t\t\t\t\t<View style={ styles.edit }>\n\t\t\t\t\t\t\t{ mediaOptions() }\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\tsize={ 16 }\n\t\t\t\t\t\t\t\ticon={ SvgIconCustomize }\n\t\t\t\t\t\t\t\t{ ...styles.iconCustomise }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t) }\n\t\t\tpickerOptions={ pickerOptions }\n\t\t/>\n\t);\n};\n\nexport default ImageEditingButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,wBAAwB,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;;AAEvE;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,eAAe;AACzC,OAAOC,gBAAgB,MAAM,kBAAkB;AAC/C,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,IAAI,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["TouchableWithoutFeedback","View","Platform","__","MediaEdit","SvgIconCustomize","styles","Icon","jsx","_jsx","jsxs","_jsxs","accessibilityHint","OS","ImageEditingButton","onSelectMediaUploadOption","openMediaOptions","pickerOptions","url","onSelect","source","uri","openReplaceMediaOptions","render","open","mediaOptions","accessibilityLabel","accessibilityRole","onPress","children","style","editContainer","edit","size","icon","iconCustomise"],"sources":["@wordpress/components/src/mobile/image/image-editing-button.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { TouchableWithoutFeedback, View, Platform } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { MediaEdit } from '../media-edit';\nimport SvgIconCustomize from './icon-customize';\nimport styles from './style.scss';\nimport Icon from '../../icon';\n\nconst accessibilityHint =\n\tPlatform.OS === 'ios'\n\t\t? __(\n\t\t\t\t'Double tap to open Action Sheet to edit, replace, or clear the image'\n\t\t )\n\t\t: __(\n\t\t\t\t'Double tap to open Bottom Sheet to edit, replace, or clear the image'\n\t\t );\n\nconst ImageEditingButton = ( {\n\tonSelectMediaUploadOption,\n\topenMediaOptions,\n\tpickerOptions,\n\turl,\n} ) => {\n\treturn (\n\t\t<MediaEdit\n\t\t\tonSelect={ onSelectMediaUploadOption }\n\t\t\tsource={ { uri: url } }\n\t\t\topenReplaceMediaOptions={ openMediaOptions }\n\t\t\trender={ ( { open, mediaOptions } ) => (\n\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\t\t\taccessibilityLabel={ __( 'Edit image' ) }\n\t\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\t\tonPress={ open }\n\t\t\t\t>\n\t\t\t\t\t<View style={ styles.editContainer }>\n\t\t\t\t\t\t<View style={ styles.edit }>\n\t\t\t\t\t\t\t{ mediaOptions() }\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\tsize={ 16 }\n\t\t\t\t\t\t\t\ticon={ SvgIconCustomize }\n\t\t\t\t\t\t\t\t{ ...styles.iconCustomise }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t) }\n\t\t\tpickerOptions={ pickerOptions }\n\t\t/>\n\t);\n};\n\nexport default ImageEditingButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,wBAAwB,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;;AAEvE;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,eAAe;AACzC,OAAOC,gBAAgB,MAAM,kBAAkB;AAC/C,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,IAAI,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9B,MAAMC,iBAAiB,GACtBV,QAAQ,CAACW,EAAE,KAAK,KAAK,GAClBV,EAAE,CACF,sEACA,CAAC,GACDA,EAAE,CACF,sEACA,CAAC;AAEL,MAAMW,kBAAkB,GAAGA,CAAE;EAC5BC,yBAAyB;EACzBC,gBAAgB;EAChBC,aAAa;EACbC;AACD,CAAC,KAAM;EACN,oBACCT,IAAA,CAACL,SAAS;IACTe,QAAQ,EAAGJ,yBAA2B;IACtCK,MAAM,EAAG;MAAEC,GAAG,EAAEH;IAAI,CAAG;IACvBI,uBAAuB,EAAGN,gBAAkB;IAC5CO,MAAM,EAAGA,CAAE;MAAEC,IAAI;MAAEC;IAAa,CAAC,kBAChChB,IAAA,CAACT,wBAAwB;MACxBY,iBAAiB,EAAGA,iBAAmB;MACvCc,kBAAkB,EAAGvB,EAAE,CAAE,YAAa,CAAG;MACzCwB,iBAAiB,EAAC,QAAQ;MAC1BC,OAAO,EAAGJ,IAAM;MAAAK,QAAA,eAEhBpB,IAAA,CAACR,IAAI;QAAC6B,KAAK,EAAGxB,MAAM,CAACyB,aAAe;QAAAF,QAAA,eACnClB,KAAA,CAACV,IAAI;UAAC6B,KAAK,EAAGxB,MAAM,CAAC0B,IAAM;UAAAH,QAAA,GACxBJ,YAAY,CAAC,CAAC,eAChBhB,IAAA,CAACF,IAAI;YACJ0B,IAAI,EAAG,EAAI;YACXC,IAAI,EAAG7B,gBAAkB;YAAA,GACpBC,MAAM,CAAC6B;UAAa,CACzB,CAAC;QAAA,CACG;MAAC,CACF;IAAC,CACkB,CACxB;IACHlB,aAAa,EAAGA;EAAe,CAC/B,CAAC;AAEJ,CAAC;AAED,eAAeH,kBAAkB","ignoreList":[]}
|
|
@@ -20,9 +20,7 @@ import styles from './style.scss';
|
|
|
20
20
|
import SvgIconRetry from './icon-retry';
|
|
21
21
|
import ImageEditingButton from './image-editing-button';
|
|
22
22
|
import Icon from '../../icon';
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
25
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
24
|
const ICON_TYPE = {
|
|
27
25
|
OFFLINE: 'offline',
|
|
28
26
|
PLACEHOLDER: 'placeholder',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Image","RNImage","Text","View","FastImage","__","image","offline","usePreferredColorSchemeStyle","useEffect","useState","Platform","getImageWithFocalPointStyles","styles","SvgIconRetry","ImageEditingButton","Icon","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ICON_TYPE","OFFLINE","PLACEHOLDER","RETRY","UPLOAD","ImageComponent","align","alt","editButton","focalPoint","height","imageHeight","highlightSelected","isSelected","shouldUseFastImage","isUploadFailed","isUploadPaused","isUploadInProgress","mediaPickerOptions","onImageDataLoad","onSelectMediaUploadOption","openMediaOptions","resizeMode","retryMessage","retryIcon","url","shapeStyle","style","width","imageWidth","imageData","setImageData","containerSize","setContainerSize","localURL","setLocalURL","networkURL","setNetworkURL","networkImageLoaded","setNetworkImageLoaded","isAndroid","imageResizeMode","isCurrent","getSize","imgWidth","imgHeight","metaData","aspectRatio","startsWith","isIOS","prefetch","then","onContainerLayout","event","nativeEvent","layout","getIcon","iconType","icon","iconStyle","iconRetryStyles","iconOfflineStyles","iconPlaceholderStyles","iconUploadStyles","iconPlaceholder","iconPlaceholderDark","iconUpload","iconUploadDark","iconOffline","iconOfflineDark","retryIconStyles","retryIconDark","iconRetry","iconRetryDark","retryContainerStyles","retryContainer","retryContainerDark","uploadFailedTextStyles","uploadFailedText","uploadFailedTextDark","placeholderStyles","imageContainerUpload","imageContainerUploadDark","imageContainerUploadWithFocalpoint","customWidth","wide","imageContainerStyles","imageContent","focalPointContainer","imageStyles","undefined","calculatedSelectedHeight","isNaN","imageSelectedStyles","imageBorder","imageBorderDark","container","alignItems","onLayout","children","accessible","disabled","accessibilityLabel","accessibilityHint","accessibilityRole","imageUploadingIconContainer","focalPointContent","fadeDuration","source","uri","resizeMethod","testID","nonVisibleImage","onLoad","imageContainer","customRetryIcon","pickerOptions"],"sources":["@wordpress/components/src/mobile/image/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Image as RNImage, Text, View } from 'react-native';\nimport FastImage from 'react-native-fast-image';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { image, offline } from '@wordpress/icons';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { useEffect, useState, Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { getImageWithFocalPointStyles } from './utils';\nimport styles from './style.scss';\nimport SvgIconRetry from './icon-retry';\nimport ImageEditingButton from './image-editing-button';\nimport Icon from '../../icon';\n\nconst ICON_TYPE = {\n\tOFFLINE: 'offline',\n\tPLACEHOLDER: 'placeholder',\n\tRETRY: 'retry',\n\tUPLOAD: 'upload',\n};\n\nconst ImageComponent = ( {\n\talign,\n\talt,\n\teditButton = true,\n\tfocalPoint,\n\theight: imageHeight,\n\thighlightSelected = true,\n\tisSelected,\n\tshouldUseFastImage,\n\tisUploadFailed,\n\tisUploadPaused,\n\tisUploadInProgress,\n\tmediaPickerOptions,\n\tonImageDataLoad,\n\tonSelectMediaUploadOption,\n\topenMediaOptions,\n\tresizeMode,\n\tretryMessage,\n\tretryIcon,\n\turl,\n\tshapeStyle,\n\tstyle,\n\twidth: imageWidth,\n} ) => {\n\tconst [ imageData, setImageData ] = useState( null );\n\tconst [ containerSize, setContainerSize ] = useState( null );\n\tconst [ localURL, setLocalURL ] = useState( null );\n\tconst [ networkURL, setNetworkURL ] = useState( null );\n\tconst [ networkImageLoaded, setNetworkImageLoaded ] = useState( false );\n\n\t// Disabled for Android due to https://github.com/WordPress/gutenberg/issues/43149\n\tconst Image =\n\t\t! shouldUseFastImage || Platform.isAndroid ? RNImage : FastImage;\n\tconst imageResizeMode =\n\t\t! shouldUseFastImage || Platform.isAndroid\n\t\t\t? resizeMode\n\t\t\t: FastImage.resizeMode[ resizeMode ];\n\n\tuseEffect( () => {\n\t\tlet isCurrent = true;\n\t\tif ( url ) {\n\t\t\tRNImage.getSize( url, ( imgWidth, imgHeight ) => {\n\t\t\t\tif ( ! isCurrent ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst metaData = {\n\t\t\t\t\taspectRatio: imgWidth / imgHeight,\n\t\t\t\t\twidth: imgWidth,\n\t\t\t\t\theight: imgHeight,\n\t\t\t\t};\n\t\t\t\tsetImageData( metaData );\n\t\t\t\tif ( onImageDataLoad ) {\n\t\t\t\t\tonImageDataLoad( metaData );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tif ( url.startsWith( 'file:///' ) ) {\n\t\t\t\tsetLocalURL( url );\n\t\t\t\tsetNetworkURL( null );\n\t\t\t\tsetNetworkImageLoaded( false );\n\t\t\t} else if ( url.startsWith( 'https://' ) ) {\n\t\t\t\tif ( Platform.isIOS ) {\n\t\t\t\t\tsetNetworkURL( url );\n\t\t\t\t} else if ( Platform.isAndroid ) {\n\t\t\t\t\tRNImage.prefetch( url ).then(\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tif ( ! isCurrent ) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsetNetworkURL( url );\n\t\t\t\t\t\t\tsetNetworkImageLoaded( true );\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t// This callback is called when the image fails to load,\n\t\t\t\t\t\t\t// but these events are handled by `isUploadFailed`\n\t\t\t\t\t\t\t// and `isUploadPaused` events instead.\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Ignoring the error event will persist the local image URI.\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn () => ( isCurrent = false );\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ url ] );\n\n\tconst onContainerLayout = ( event ) => {\n\t\tconst { height, width } = event.nativeEvent.layout;\n\n\t\tif (\n\t\t\twidth !== 0 &&\n\t\t\theight !== 0 &&\n\t\t\t( containerSize?.width !== width ||\n\t\t\t\tcontainerSize?.height !== height )\n\t\t) {\n\t\t\tsetContainerSize( { width, height } );\n\t\t}\n\t};\n\n\tconst getIcon = ( iconType ) => {\n\t\tlet icon;\n\t\tlet iconStyle;\n\t\tswitch ( iconType ) {\n\t\t\tcase ICON_TYPE.RETRY:\n\t\t\t\ticon = retryIcon || SvgIconRetry;\n\t\t\t\ticonStyle = iconRetryStyles;\n\t\t\t\tbreak;\n\t\t\tcase ICON_TYPE.OFFLINE:\n\t\t\t\ticon = offline;\n\t\t\t\ticonStyle = iconOfflineStyles;\n\t\t\t\tbreak;\n\t\t\tcase ICON_TYPE.PLACEHOLDER:\n\t\t\t\ticon = image;\n\t\t\t\ticonStyle = iconPlaceholderStyles;\n\t\t\t\tbreak;\n\t\t\tcase ICON_TYPE.UPLOAD:\n\t\t\t\ticon = image;\n\t\t\t\ticonStyle = iconUploadStyles;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn <Icon icon={ icon } { ...iconStyle } />;\n\t};\n\n\tconst iconPlaceholderStyles = usePreferredColorSchemeStyle(\n\t\tstyles.iconPlaceholder,\n\t\tstyles.iconPlaceholderDark\n\t);\n\n\tconst iconUploadStyles = usePreferredColorSchemeStyle(\n\t\tstyles.iconUpload,\n\t\tstyles.iconUploadDark\n\t);\n\n\tconst iconOfflineStyles = usePreferredColorSchemeStyle(\n\t\tstyles.iconOffline,\n\t\tstyles.iconOfflineDark\n\t);\n\n\tconst retryIconStyles = usePreferredColorSchemeStyle(\n\t\tstyles.retryIcon,\n\t\tstyles.retryIconDark\n\t);\n\n\tconst iconRetryStyles = usePreferredColorSchemeStyle(\n\t\tstyles.iconRetry,\n\t\tstyles.iconRetryDark\n\t);\n\n\tconst retryContainerStyles = usePreferredColorSchemeStyle(\n\t\tstyles.retryContainer,\n\t\tstyles.retryContainerDark\n\t);\n\n\tconst uploadFailedTextStyles = usePreferredColorSchemeStyle(\n\t\tstyles.uploadFailedText,\n\t\tstyles.uploadFailedTextDark\n\t);\n\n\tconst placeholderStyles = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles.imageContainerUpload,\n\t\t\tstyles.imageContainerUploadDark\n\t\t),\n\t\tfocalPoint && styles.imageContainerUploadWithFocalpoint,\n\t\timageHeight && { height: imageHeight },\n\t];\n\n\tconst customWidth =\n\t\timageData?.width < containerSize?.width\n\t\t\t? imageData?.width\n\t\t\t: styles.wide?.width;\n\n\tconst imageContainerStyles = [\n\t\tstyles.imageContent,\n\t\t{\n\t\t\twidth:\n\t\t\t\timageWidth === styles.wide?.width ||\n\t\t\t\t( imageData &&\n\t\t\t\t\timageWidth > 0 &&\n\t\t\t\t\timageWidth < containerSize?.width )\n\t\t\t\t\t? imageWidth\n\t\t\t\t\t: customWidth,\n\t\t},\n\t\tresizeMode && { width: styles.wide?.width },\n\t\tfocalPoint && styles.focalPointContainer,\n\t];\n\n\tconst imageStyles = [\n\t\t{\n\t\t\theight: containerSize?.height,\n\t\t},\n\t\t! resizeMode && {\n\t\t\taspectRatio: imageData?.aspectRatio,\n\t\t},\n\t\tfocalPoint && styles.focalPoint,\n\t\tfocalPoint &&\n\t\t\tgetImageWithFocalPointStyles(\n\t\t\t\tfocalPoint,\n\t\t\t\tcontainerSize,\n\t\t\t\timageData\n\t\t\t),\n\t\t! focalPoint &&\n\t\t\timageData &&\n\t\t\tcontainerSize && {\n\t\t\t\theight:\n\t\t\t\t\timageData?.width > containerSize?.width && ! imageWidth\n\t\t\t\t\t\t? containerSize?.width / imageData?.aspectRatio\n\t\t\t\t\t\t: undefined,\n\t\t\t},\n\t\timageHeight && { height: imageHeight },\n\t\tshapeStyle,\n\t];\n\n\t// On iOS, add 1 to height to account for the 1px non-visible image\n\t// that is used to determine when the network image has loaded\n\t// We also must verify that it is not NaN, as it can be NaN when the image is loading.\n\t// This is not necessary on Android as the non-visible image is not used.\n\tlet calculatedSelectedHeight;\n\tif ( Platform.isIOS ) {\n\t\tcalculatedSelectedHeight =\n\t\t\tcontainerSize && ! isNaN( containerSize.height )\n\t\t\t\t? containerSize.height + 1\n\t\t\t\t: 0;\n\t} else {\n\t\tcalculatedSelectedHeight = containerSize?.height;\n\t}\n\n\tconst imageSelectedStyles = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles.imageBorder,\n\t\t\tstyles.imageBorderDark\n\t\t),\n\t\t{\n\t\t\theight: calculatedSelectedHeight,\n\t\t},\n\t];\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ [\n\t\t\t\tstyles.container,\n\t\t\t\t// Only set alignItems if an image exists because alignItems causes the placeholder\n\t\t\t\t// to disappear when an aligned image can't be downloaded\n\t\t\t\t// https://github.com/wordpress-mobile/gutenberg-mobile/issues/1592\n\t\t\t\timageData && align && { alignItems: align },\n\t\t\t\tstyle,\n\t\t\t] }\n\t\t\tonLayout={ onContainerLayout }\n\t\t>\n\t\t\t<View\n\t\t\t\taccessible\n\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\taccessibilityLabel={ alt }\n\t\t\t\taccessibilityHint={ __( 'Double tap and hold to edit' ) }\n\t\t\t\taccessibilityRole=\"imagebutton\"\n\t\t\t\tkey={ url }\n\t\t\t\tstyle={ imageContainerStyles }\n\t\t\t>\n\t\t\t\t{ isSelected && highlightSelected && (\n\t\t\t\t\t<View style={ imageSelectedStyles } />\n\t\t\t\t) }\n\n\t\t\t\t{ ! imageData ? (\n\t\t\t\t\t<View style={ placeholderStyles }>\n\t\t\t\t\t\t<View style={ styles.imageUploadingIconContainer }>\n\t\t\t\t\t\t\t{ getIcon( ICON_TYPE.UPLOAD ) }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t) : (\n\t\t\t\t\t<View style={ focalPoint && styles.focalPointContent }>\n\t\t\t\t\t\t{ Platform.isAndroid && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{ networkImageLoaded && networkURL && (\n\t\t\t\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\t\t\t\tstyle={ imageStyles }\n\t\t\t\t\t\t\t\t\t\tfadeDuration={ 0 }\n\t\t\t\t\t\t\t\t\t\tsource={ { uri: networkURL } }\n\t\t\t\t\t\t\t\t\t\t{ ...( ! focalPoint && {\n\t\t\t\t\t\t\t\t\t\t\tresizeMethod: 'scale',\n\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\tresizeMode={ imageResizeMode }\n\t\t\t\t\t\t\t\t\t\ttestID={ `network-image-${ url }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ ! networkImageLoaded && ! networkURL && (\n\t\t\t\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\t\t\t\tstyle={ imageStyles }\n\t\t\t\t\t\t\t\t\t\tfadeDuration={ 0 }\n\t\t\t\t\t\t\t\t\t\tsource={ { uri: localURL } }\n\t\t\t\t\t\t\t\t\t\t{ ...( ! focalPoint && {\n\t\t\t\t\t\t\t\t\t\t\tresizeMethod: 'scale',\n\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\tresizeMode={ imageResizeMode }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ Platform.isIOS && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\t\t\tstyle={ imageStyles }\n\t\t\t\t\t\t\t\t\tsource={ {\n\t\t\t\t\t\t\t\t\t\turi:\n\t\t\t\t\t\t\t\t\t\t\tnetworkURL && networkImageLoaded\n\t\t\t\t\t\t\t\t\t\t\t\t? networkURL\n\t\t\t\t\t\t\t\t\t\t\t\t: localURL || url,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t{ ...( ! focalPoint && {\n\t\t\t\t\t\t\t\t\t\tresizeMethod: 'scale',\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\tresizeMode={ imageResizeMode }\n\t\t\t\t\t\t\t\t\ttestID={ `network-image-${\n\t\t\t\t\t\t\t\t\t\tnetworkURL && networkImageLoaded\n\t\t\t\t\t\t\t\t\t\t\t? networkURL\n\t\t\t\t\t\t\t\t\t\t\t: localURL || url\n\t\t\t\t\t\t\t\t\t}` }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\t\t\tsource={ { uri: networkURL } }\n\t\t\t\t\t\t\t\t\tstyle={ styles.nonVisibleImage }\n\t\t\t\t\t\t\t\t\tonLoad={ () => {\n\t\t\t\t\t\t\t\t\t\tsetNetworkImageLoaded( true );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t) }\n\n\t\t\t\t{ ( isUploadFailed || isUploadPaused ) && retryMessage && (\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\tstyles.imageContainer,\n\t\t\t\t\t\t\tretryContainerStyles,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\tretryIconStyles,\n\t\t\t\t\t\t\t\tretryIcon && styles.customRetryIcon,\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ isUploadPaused\n\t\t\t\t\t\t\t\t? getIcon( ICON_TYPE.OFFLINE )\n\t\t\t\t\t\t\t\t: getIcon( ICON_TYPE.RETRY ) }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t\t<Text style={ uploadFailedTextStyles }>\n\t\t\t\t\t\t\t{ retryMessage }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</View>\n\t\t\t\t) }\n\t\t\t</View>\n\n\t\t\t{ editButton && isSelected && ! isUploadInProgress && (\n\t\t\t\t<ImageEditingButton\n\t\t\t\t\tonSelectMediaUploadOption={ onSelectMediaUploadOption }\n\t\t\t\t\topenMediaOptions={ openMediaOptions }\n\t\t\t\t\turl={\n\t\t\t\t\t\t! ( isUploadFailed || isUploadPaused ) &&\n\t\t\t\t\t\timageData &&\n\t\t\t\t\t\turl\n\t\t\t\t\t}\n\t\t\t\t\tpickerOptions={ mediaPickerOptions }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</View>\n\t);\n};\n\nexport default ImageComponent;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,OAAO,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC3D,OAAOC,SAAS,MAAM,yBAAyB;;AAE/C;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,EAAEC,OAAO,QAAQ,kBAAkB;AACjD,SAASC,4BAA4B,QAAQ,oBAAoB;AACjE,SAASC,SAAS,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,oBAAoB;;AAElE;AACA;AACA;AACA,SAASC,4BAA4B,QAAQ,SAAS;AACtD,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,YAAY,MAAM,cAAc;AACvC,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,OAAOC,IAAI,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE9B,MAAMC,SAAS,GAAG;EACjBC,OAAO,EAAE,SAAS;EAClBC,WAAW,EAAE,aAAa;EAC1BC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AAED,MAAMC,cAAc,GAAGA,CAAE;EACxBC,KAAK;EACLC,GAAG;EACHC,UAAU,GA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":3,"names":["Image","RNImage","Text","View","FastImage","__","image","offline","usePreferredColorSchemeStyle","useEffect","useState","Platform","getImageWithFocalPointStyles","styles","SvgIconRetry","ImageEditingButton","Icon","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ICON_TYPE","OFFLINE","PLACEHOLDER","RETRY","UPLOAD","ImageComponent","align","alt","editButton","focalPoint","height","imageHeight","highlightSelected","isSelected","shouldUseFastImage","isUploadFailed","isUploadPaused","isUploadInProgress","mediaPickerOptions","onImageDataLoad","onSelectMediaUploadOption","openMediaOptions","resizeMode","retryMessage","retryIcon","url","shapeStyle","style","width","imageWidth","imageData","setImageData","containerSize","setContainerSize","localURL","setLocalURL","networkURL","setNetworkURL","networkImageLoaded","setNetworkImageLoaded","isAndroid","imageResizeMode","isCurrent","getSize","imgWidth","imgHeight","metaData","aspectRatio","startsWith","isIOS","prefetch","then","onContainerLayout","event","nativeEvent","layout","getIcon","iconType","icon","iconStyle","iconRetryStyles","iconOfflineStyles","iconPlaceholderStyles","iconUploadStyles","iconPlaceholder","iconPlaceholderDark","iconUpload","iconUploadDark","iconOffline","iconOfflineDark","retryIconStyles","retryIconDark","iconRetry","iconRetryDark","retryContainerStyles","retryContainer","retryContainerDark","uploadFailedTextStyles","uploadFailedText","uploadFailedTextDark","placeholderStyles","imageContainerUpload","imageContainerUploadDark","imageContainerUploadWithFocalpoint","customWidth","wide","imageContainerStyles","imageContent","focalPointContainer","imageStyles","undefined","calculatedSelectedHeight","isNaN","imageSelectedStyles","imageBorder","imageBorderDark","container","alignItems","onLayout","children","accessible","disabled","accessibilityLabel","accessibilityHint","accessibilityRole","imageUploadingIconContainer","focalPointContent","fadeDuration","source","uri","resizeMethod","testID","nonVisibleImage","onLoad","imageContainer","customRetryIcon","pickerOptions"],"sources":["@wordpress/components/src/mobile/image/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Image as RNImage, Text, View } from 'react-native';\nimport FastImage from 'react-native-fast-image';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { image, offline } from '@wordpress/icons';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { useEffect, useState, Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { getImageWithFocalPointStyles } from './utils';\nimport styles from './style.scss';\nimport SvgIconRetry from './icon-retry';\nimport ImageEditingButton from './image-editing-button';\nimport Icon from '../../icon';\n\nconst ICON_TYPE = {\n\tOFFLINE: 'offline',\n\tPLACEHOLDER: 'placeholder',\n\tRETRY: 'retry',\n\tUPLOAD: 'upload',\n};\n\nconst ImageComponent = ( {\n\talign,\n\talt,\n\teditButton = true,\n\tfocalPoint,\n\theight: imageHeight,\n\thighlightSelected = true,\n\tisSelected,\n\tshouldUseFastImage,\n\tisUploadFailed,\n\tisUploadPaused,\n\tisUploadInProgress,\n\tmediaPickerOptions,\n\tonImageDataLoad,\n\tonSelectMediaUploadOption,\n\topenMediaOptions,\n\tresizeMode,\n\tretryMessage,\n\tretryIcon,\n\turl,\n\tshapeStyle,\n\tstyle,\n\twidth: imageWidth,\n} ) => {\n\tconst [ imageData, setImageData ] = useState( null );\n\tconst [ containerSize, setContainerSize ] = useState( null );\n\tconst [ localURL, setLocalURL ] = useState( null );\n\tconst [ networkURL, setNetworkURL ] = useState( null );\n\tconst [ networkImageLoaded, setNetworkImageLoaded ] = useState( false );\n\n\t// Disabled for Android due to https://github.com/WordPress/gutenberg/issues/43149\n\tconst Image =\n\t\t! shouldUseFastImage || Platform.isAndroid ? RNImage : FastImage;\n\tconst imageResizeMode =\n\t\t! shouldUseFastImage || Platform.isAndroid\n\t\t\t? resizeMode\n\t\t\t: FastImage.resizeMode[ resizeMode ];\n\n\tuseEffect( () => {\n\t\tlet isCurrent = true;\n\t\tif ( url ) {\n\t\t\tRNImage.getSize( url, ( imgWidth, imgHeight ) => {\n\t\t\t\tif ( ! isCurrent ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst metaData = {\n\t\t\t\t\taspectRatio: imgWidth / imgHeight,\n\t\t\t\t\twidth: imgWidth,\n\t\t\t\t\theight: imgHeight,\n\t\t\t\t};\n\t\t\t\tsetImageData( metaData );\n\t\t\t\tif ( onImageDataLoad ) {\n\t\t\t\t\tonImageDataLoad( metaData );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tif ( url.startsWith( 'file:///' ) ) {\n\t\t\t\tsetLocalURL( url );\n\t\t\t\tsetNetworkURL( null );\n\t\t\t\tsetNetworkImageLoaded( false );\n\t\t\t} else if ( url.startsWith( 'https://' ) ) {\n\t\t\t\tif ( Platform.isIOS ) {\n\t\t\t\t\tsetNetworkURL( url );\n\t\t\t\t} else if ( Platform.isAndroid ) {\n\t\t\t\t\tRNImage.prefetch( url ).then(\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tif ( ! isCurrent ) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsetNetworkURL( url );\n\t\t\t\t\t\t\tsetNetworkImageLoaded( true );\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t// This callback is called when the image fails to load,\n\t\t\t\t\t\t\t// but these events are handled by `isUploadFailed`\n\t\t\t\t\t\t\t// and `isUploadPaused` events instead.\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Ignoring the error event will persist the local image URI.\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn () => ( isCurrent = false );\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ url ] );\n\n\tconst onContainerLayout = ( event ) => {\n\t\tconst { height, width } = event.nativeEvent.layout;\n\n\t\tif (\n\t\t\twidth !== 0 &&\n\t\t\theight !== 0 &&\n\t\t\t( containerSize?.width !== width ||\n\t\t\t\tcontainerSize?.height !== height )\n\t\t) {\n\t\t\tsetContainerSize( { width, height } );\n\t\t}\n\t};\n\n\tconst getIcon = ( iconType ) => {\n\t\tlet icon;\n\t\tlet iconStyle;\n\t\tswitch ( iconType ) {\n\t\t\tcase ICON_TYPE.RETRY:\n\t\t\t\ticon = retryIcon || SvgIconRetry;\n\t\t\t\ticonStyle = iconRetryStyles;\n\t\t\t\tbreak;\n\t\t\tcase ICON_TYPE.OFFLINE:\n\t\t\t\ticon = offline;\n\t\t\t\ticonStyle = iconOfflineStyles;\n\t\t\t\tbreak;\n\t\t\tcase ICON_TYPE.PLACEHOLDER:\n\t\t\t\ticon = image;\n\t\t\t\ticonStyle = iconPlaceholderStyles;\n\t\t\t\tbreak;\n\t\t\tcase ICON_TYPE.UPLOAD:\n\t\t\t\ticon = image;\n\t\t\t\ticonStyle = iconUploadStyles;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn <Icon icon={ icon } { ...iconStyle } />;\n\t};\n\n\tconst iconPlaceholderStyles = usePreferredColorSchemeStyle(\n\t\tstyles.iconPlaceholder,\n\t\tstyles.iconPlaceholderDark\n\t);\n\n\tconst iconUploadStyles = usePreferredColorSchemeStyle(\n\t\tstyles.iconUpload,\n\t\tstyles.iconUploadDark\n\t);\n\n\tconst iconOfflineStyles = usePreferredColorSchemeStyle(\n\t\tstyles.iconOffline,\n\t\tstyles.iconOfflineDark\n\t);\n\n\tconst retryIconStyles = usePreferredColorSchemeStyle(\n\t\tstyles.retryIcon,\n\t\tstyles.retryIconDark\n\t);\n\n\tconst iconRetryStyles = usePreferredColorSchemeStyle(\n\t\tstyles.iconRetry,\n\t\tstyles.iconRetryDark\n\t);\n\n\tconst retryContainerStyles = usePreferredColorSchemeStyle(\n\t\tstyles.retryContainer,\n\t\tstyles.retryContainerDark\n\t);\n\n\tconst uploadFailedTextStyles = usePreferredColorSchemeStyle(\n\t\tstyles.uploadFailedText,\n\t\tstyles.uploadFailedTextDark\n\t);\n\n\tconst placeholderStyles = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles.imageContainerUpload,\n\t\t\tstyles.imageContainerUploadDark\n\t\t),\n\t\tfocalPoint && styles.imageContainerUploadWithFocalpoint,\n\t\timageHeight && { height: imageHeight },\n\t];\n\n\tconst customWidth =\n\t\timageData?.width < containerSize?.width\n\t\t\t? imageData?.width\n\t\t\t: styles.wide?.width;\n\n\tconst imageContainerStyles = [\n\t\tstyles.imageContent,\n\t\t{\n\t\t\twidth:\n\t\t\t\timageWidth === styles.wide?.width ||\n\t\t\t\t( imageData &&\n\t\t\t\t\timageWidth > 0 &&\n\t\t\t\t\timageWidth < containerSize?.width )\n\t\t\t\t\t? imageWidth\n\t\t\t\t\t: customWidth,\n\t\t},\n\t\tresizeMode && { width: styles.wide?.width },\n\t\tfocalPoint && styles.focalPointContainer,\n\t];\n\n\tconst imageStyles = [\n\t\t{\n\t\t\theight: containerSize?.height,\n\t\t},\n\t\t! resizeMode && {\n\t\t\taspectRatio: imageData?.aspectRatio,\n\t\t},\n\t\tfocalPoint && styles.focalPoint,\n\t\tfocalPoint &&\n\t\t\tgetImageWithFocalPointStyles(\n\t\t\t\tfocalPoint,\n\t\t\t\tcontainerSize,\n\t\t\t\timageData\n\t\t\t),\n\t\t! focalPoint &&\n\t\t\timageData &&\n\t\t\tcontainerSize && {\n\t\t\t\theight:\n\t\t\t\t\timageData?.width > containerSize?.width && ! imageWidth\n\t\t\t\t\t\t? containerSize?.width / imageData?.aspectRatio\n\t\t\t\t\t\t: undefined,\n\t\t\t},\n\t\timageHeight && { height: imageHeight },\n\t\tshapeStyle,\n\t];\n\n\t// On iOS, add 1 to height to account for the 1px non-visible image\n\t// that is used to determine when the network image has loaded\n\t// We also must verify that it is not NaN, as it can be NaN when the image is loading.\n\t// This is not necessary on Android as the non-visible image is not used.\n\tlet calculatedSelectedHeight;\n\tif ( Platform.isIOS ) {\n\t\tcalculatedSelectedHeight =\n\t\t\tcontainerSize && ! isNaN( containerSize.height )\n\t\t\t\t? containerSize.height + 1\n\t\t\t\t: 0;\n\t} else {\n\t\tcalculatedSelectedHeight = containerSize?.height;\n\t}\n\n\tconst imageSelectedStyles = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles.imageBorder,\n\t\t\tstyles.imageBorderDark\n\t\t),\n\t\t{\n\t\t\theight: calculatedSelectedHeight,\n\t\t},\n\t];\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ [\n\t\t\t\tstyles.container,\n\t\t\t\t// Only set alignItems if an image exists because alignItems causes the placeholder\n\t\t\t\t// to disappear when an aligned image can't be downloaded\n\t\t\t\t// https://github.com/wordpress-mobile/gutenberg-mobile/issues/1592\n\t\t\t\timageData && align && { alignItems: align },\n\t\t\t\tstyle,\n\t\t\t] }\n\t\t\tonLayout={ onContainerLayout }\n\t\t>\n\t\t\t<View\n\t\t\t\taccessible\n\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\taccessibilityLabel={ alt }\n\t\t\t\taccessibilityHint={ __( 'Double tap and hold to edit' ) }\n\t\t\t\taccessibilityRole=\"imagebutton\"\n\t\t\t\tkey={ url }\n\t\t\t\tstyle={ imageContainerStyles }\n\t\t\t>\n\t\t\t\t{ isSelected && highlightSelected && (\n\t\t\t\t\t<View style={ imageSelectedStyles } />\n\t\t\t\t) }\n\n\t\t\t\t{ ! imageData ? (\n\t\t\t\t\t<View style={ placeholderStyles }>\n\t\t\t\t\t\t<View style={ styles.imageUploadingIconContainer }>\n\t\t\t\t\t\t\t{ getIcon( ICON_TYPE.UPLOAD ) }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t) : (\n\t\t\t\t\t<View style={ focalPoint && styles.focalPointContent }>\n\t\t\t\t\t\t{ Platform.isAndroid && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{ networkImageLoaded && networkURL && (\n\t\t\t\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\t\t\t\tstyle={ imageStyles }\n\t\t\t\t\t\t\t\t\t\tfadeDuration={ 0 }\n\t\t\t\t\t\t\t\t\t\tsource={ { uri: networkURL } }\n\t\t\t\t\t\t\t\t\t\t{ ...( ! focalPoint && {\n\t\t\t\t\t\t\t\t\t\t\tresizeMethod: 'scale',\n\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\tresizeMode={ imageResizeMode }\n\t\t\t\t\t\t\t\t\t\ttestID={ `network-image-${ url }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ ! networkImageLoaded && ! networkURL && (\n\t\t\t\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\t\t\t\tstyle={ imageStyles }\n\t\t\t\t\t\t\t\t\t\tfadeDuration={ 0 }\n\t\t\t\t\t\t\t\t\t\tsource={ { uri: localURL } }\n\t\t\t\t\t\t\t\t\t\t{ ...( ! focalPoint && {\n\t\t\t\t\t\t\t\t\t\t\tresizeMethod: 'scale',\n\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\tresizeMode={ imageResizeMode }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ Platform.isIOS && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\t\t\tstyle={ imageStyles }\n\t\t\t\t\t\t\t\t\tsource={ {\n\t\t\t\t\t\t\t\t\t\turi:\n\t\t\t\t\t\t\t\t\t\t\tnetworkURL && networkImageLoaded\n\t\t\t\t\t\t\t\t\t\t\t\t? networkURL\n\t\t\t\t\t\t\t\t\t\t\t\t: localURL || url,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t{ ...( ! focalPoint && {\n\t\t\t\t\t\t\t\t\t\tresizeMethod: 'scale',\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\tresizeMode={ imageResizeMode }\n\t\t\t\t\t\t\t\t\ttestID={ `network-image-${\n\t\t\t\t\t\t\t\t\t\tnetworkURL && networkImageLoaded\n\t\t\t\t\t\t\t\t\t\t\t? networkURL\n\t\t\t\t\t\t\t\t\t\t\t: localURL || url\n\t\t\t\t\t\t\t\t\t}` }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\t\t\tsource={ { uri: networkURL } }\n\t\t\t\t\t\t\t\t\tstyle={ styles.nonVisibleImage }\n\t\t\t\t\t\t\t\t\tonLoad={ () => {\n\t\t\t\t\t\t\t\t\t\tsetNetworkImageLoaded( true );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t) }\n\n\t\t\t\t{ ( isUploadFailed || isUploadPaused ) && retryMessage && (\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\tstyles.imageContainer,\n\t\t\t\t\t\t\tretryContainerStyles,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\tretryIconStyles,\n\t\t\t\t\t\t\t\tretryIcon && styles.customRetryIcon,\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ isUploadPaused\n\t\t\t\t\t\t\t\t? getIcon( ICON_TYPE.OFFLINE )\n\t\t\t\t\t\t\t\t: getIcon( ICON_TYPE.RETRY ) }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t\t<Text style={ uploadFailedTextStyles }>\n\t\t\t\t\t\t\t{ retryMessage }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</View>\n\t\t\t\t) }\n\t\t\t</View>\n\n\t\t\t{ editButton && isSelected && ! isUploadInProgress && (\n\t\t\t\t<ImageEditingButton\n\t\t\t\t\tonSelectMediaUploadOption={ onSelectMediaUploadOption }\n\t\t\t\t\topenMediaOptions={ openMediaOptions }\n\t\t\t\t\turl={\n\t\t\t\t\t\t! ( isUploadFailed || isUploadPaused ) &&\n\t\t\t\t\t\timageData &&\n\t\t\t\t\t\turl\n\t\t\t\t\t}\n\t\t\t\t\tpickerOptions={ mediaPickerOptions }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</View>\n\t);\n};\n\nexport default ImageComponent;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,OAAO,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC3D,OAAOC,SAAS,MAAM,yBAAyB;;AAE/C;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,EAAEC,OAAO,QAAQ,kBAAkB;AACjD,SAASC,4BAA4B,QAAQ,oBAAoB;AACjE,SAASC,SAAS,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,oBAAoB;;AAElE;AACA;AACA;AACA,SAASC,4BAA4B,QAAQ,SAAS;AACtD,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,YAAY,MAAM,cAAc;AACvC,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,OAAOC,IAAI,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9B,MAAMC,SAAS,GAAG;EACjBC,OAAO,EAAE,SAAS;EAClBC,WAAW,EAAE,aAAa;EAC1BC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AAED,MAAMC,cAAc,GAAGA,CAAE;EACxBC,KAAK;EACLC,GAAG;EACHC,UAAU,GAAG,IAAI;EACjBC,UAAU;EACVC,MAAM,EAAEC,WAAW;EACnBC,iBAAiB,GAAG,IAAI;EACxBC,UAAU;EACVC,kBAAkB;EAClBC,cAAc;EACdC,cAAc;EACdC,kBAAkB;EAClBC,kBAAkB;EAClBC,eA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GAAG,EAAEzE;YAAW,CAAG;YAC9BT,KAAK,EAAGrC,MAAM,CAAC0H,eAAiB;YAChCC,MAAM,EAAGA,CAAA,KAAM;cACd1E,qBAAqB,CAAE,IAAK,CAAC;YAC9B;UAAG,CACH,CAAC;QAAA,CACD,CACF;MAAA,CACI,CACN,EAEC,CAAExB,cAAc,IAAIC,cAAc,KAAMO,YAAY,iBACrDxB,KAAA,CAACnB,IAAI;QACJ+C,KAAK,EAAG,CACPrC,MAAM,CAAC4H,cAAc,EACrBxC,oBAAoB,CAClB;QAAAyB,QAAA,gBAEHxG,IAAA,CAACf,IAAI;UACJ+C,KAAK,EAAG,CACP2C,eAAe,EACf9C,SAAS,IAAIlC,MAAM,CAAC6H,eAAe,CACjC;UAAAhB,QAAA,EAEDnF,cAAc,GACbwC,OAAO,CAAExD,SAAS,CAACC,OAAQ,CAAC,GAC5BuD,OAAO,CAAExD,SAAS,CAACG,KAAM;QAAC,CACxB,CAAC,eACPR,IAAA,CAAChB,IAAI;UAACgD,KAAK,EAAGkD,sBAAwB;UAAAsB,QAAA,EACnC5E;QAAY,CACT,CAAC;MAAA,CACF,CACN;IAAA,GA/FKE,GAgGD,CAAC,EAELjB,UAAU,IAAIK,UAAU,IAAI,CAAEI,kBAAkB,iBACjDtB,IAAA,CAACH,kBAAkB;MAClB4B,yBAAyB,EAAGA,yBAA2B;MACvDC,gBAAgB,EAAGA,gBAAkB;MACrCI,GAAG,EACF,EAAIV,cAAc,IAAIC,cAAc,CAAE,IACtCc,SAAS,IACTL,GACA;MACD2F,aAAa,EAAGlG;IAAoB,CACpC,CACD;EAAA,CACI,CAAC;AAET,CAAC;AAED,eAAeb,cAAc","ignoreList":[]}
|
|
@@ -15,8 +15,7 @@ import { useResizeObserver } from '@wordpress/compose';
|
|
|
15
15
|
*/
|
|
16
16
|
import useIsFloatingKeyboard from '../utils/use-is-floating-keyboard';
|
|
17
17
|
import styles from './styles.scss';
|
|
18
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
20
19
|
const AnimatedKeyboardAvoidingView = Animated.createAnimatedComponent(IOSKeyboardAvoidingView);
|
|
21
20
|
const MIN_HEIGHT = 44;
|
|
22
21
|
export const KeyboardAvoidingView = ({
|