@wordpress/components 19.9.0 → 19.12.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 +84 -0
- package/CONTRIBUTING.md +80 -7
- package/README.md +1 -1
- package/build/alignment-matrix-control/index.js +5 -2
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js +5 -7
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +1 -1
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.native.js +2 -2
- package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build/autocomplete/index.js +12 -10
- package/build/autocomplete/index.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js +22 -7
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control/hook.js +2 -2
- package/build/border-box-control/border-box-control/hook.js.map +1 -1
- package/build/border-box-control/border-box-control-linked-button/hook.js +3 -2
- package/build/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js +23 -8
- package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/hook.js +13 -4
- package/build/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
- package/build/border-box-control/border-box-control-visualizer/hook.js +7 -2
- package/build/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
- package/build/border-box-control/styles.js +25 -19
- package/build/border-box-control/styles.js.map +1 -1
- package/build/border-control/border-control/component.js +5 -3
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js +8 -5
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +6 -2
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/hook.js +5 -5
- package/build/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build/border-control/styles.js +58 -29
- package/build/border-control/styles.js.map +1 -1
- package/build/box-control/index.js +0 -21
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/utils.js +1 -8
- package/build/box-control/utils.js.map +1 -1
- package/build/button/index.js +3 -5
- package/build/button/index.js.map +1 -1
- package/build/button/index.native.js +16 -2
- package/build/button/index.native.js.map +1 -1
- package/build/button-group/index.js +24 -7
- package/build/button-group/index.js.map +1 -1
- package/build/{flyout → button-group}/types.js +0 -0
- package/build/button-group/types.js.map +1 -0
- package/build/checkbox-control/index.js +34 -7
- package/build/checkbox-control/index.js.map +1 -1
- package/build/checkbox-control/types.js +6 -0
- package/build/checkbox-control/types.js.map +1 -0
- package/build/circular-option-picker/index.js +1 -2
- package/build/circular-option-picker/index.js.map +1 -1
- package/build/color-palette/index.js +14 -14
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/index.native.js +4 -1
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-picker/color-copy-button.js +87 -0
- package/build/color-picker/color-copy-button.js.map +1 -0
- package/build/color-picker/component.js +5 -15
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/hex-input.js +18 -1
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/styles.js +11 -11
- package/build/color-picker/styles.js.map +1 -1
- package/build/custom-gradient-picker/utils.js +1 -1
- package/build/custom-gradient-picker/utils.js.map +1 -1
- package/build/date-time/{date.js → date/index.js} +83 -20
- package/build/date-time/date/index.js.map +1 -0
- package/build/date-time/date/styles.js +70 -0
- package/build/date-time/date/styles.js.map +1 -0
- package/build/date-time/{utils.js → date/utils.js} +6 -4
- package/build/date-time/date/utils.js.map +1 -0
- package/build/date-time/date-time/index.js +175 -0
- package/build/date-time/date-time/index.js.map +1 -0
- package/build/date-time/date-time/styles.js +32 -0
- package/build/date-time/date-time/styles.js.map +1 -0
- package/build/date-time/index.js +2 -84
- package/build/date-time/index.js.map +1 -1
- package/build/date-time/time/index.js +322 -0
- package/build/date-time/time/index.js.map +1 -0
- package/build/date-time/time/styles.js +139 -0
- package/build/date-time/time/styles.js.map +1 -0
- package/build/date-time/{timezone.js → time/timezone.js} +8 -5
- package/build/date-time/time/timezone.js.map +1 -0
- package/build/date-time/types.js +6 -0
- package/build/date-time/types.js.map +1 -0
- package/build/disabled/index.js +4 -76
- package/build/disabled/index.js.map +1 -1
- package/build/draggable/index.native.js +228 -0
- package/build/draggable/index.native.js.map +1 -0
- package/build/dropdown/index.js +9 -4
- package/build/dropdown/index.js.map +1 -1
- package/build/focal-point-picker/index.native.js +3 -3
- package/build/focal-point-picker/index.native.js.map +1 -1
- package/build/index.js +0 -8
- package/build/index.js.map +1 -1
- package/build/index.native.js +16 -0
- package/build/index.native.js.map +1 -1
- package/build/input-control/index.js +12 -6
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-field.js +1 -26
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/reducer/reducer.js +36 -24
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/reducer/state.js +0 -1
- package/build/input-control/reducer/state.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +42 -30
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/input-control/utils.js +45 -0
- package/build/input-control/utils.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.native.js +1 -1
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet-select-control/index.native.js +4 -2
- package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build/mobile/html-text-input/index.native.js +19 -8
- package/build/mobile/html-text-input/index.native.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.android.js +28 -5
- package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.ios.js +47 -24
- package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build/palette-edit/index.js +38 -7
- package/build/palette-edit/index.js.map +1 -1
- package/build/popover/index.js +228 -321
- package/build/popover/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js +5 -8
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/sandbox/index.native.js +1 -1
- package/build/sandbox/index.native.js.map +1 -1
- package/build/search-control/index.js +4 -6
- package/build/search-control/index.js.map +1 -1
- package/build/select-control/index.js +34 -5
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +17 -14
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/spacer/hook.js +11 -3
- package/build/spacer/hook.js.map +1 -1
- package/build/surface/component.js +7 -7
- package/build/surface/component.js.map +1 -1
- package/build/surface/hook.js +8 -11
- package/build/surface/hook.js.map +1 -1
- package/build/surface/index.js.map +1 -1
- package/build/surface/styles.js +8 -48
- package/build/surface/styles.js.map +1 -1
- package/build/text-control/index.js +35 -28
- package/build/text-control/index.js.map +1 -1
- package/build/text-control/types.js +6 -0
- package/build/text-control/types.js.map +1 -0
- package/build/textarea-control/index.js +40 -6
- package/build/textarea-control/index.js.map +1 -1
- package/build/textarea-control/styles/textarea-control-styles.js +3 -3
- package/build/textarea-control/styles/textarea-control-styles.js.map +1 -1
- package/build/textarea-control/types.js +6 -0
- package/build/textarea-control/types.js.map +1 -0
- package/build/toggle-group-control/toggle-group-control/component.js +1 -3
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-icon/component.js +6 -4
- package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +52 -36
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tooltip/index.js +2 -2
- package/build/tooltip/index.js.map +1 -1
- package/build/unit-control/index.js +3 -3
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +11 -20
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/unit-control/utils.js.map +1 -1
- package/build/utils/hooks/index.js +0 -8
- package/build/utils/hooks/index.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +5 -2
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js +5 -7
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +1 -1
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.native.js +2 -2
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/autocomplete/index.js +13 -11
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +22 -7
- 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 +2 -2
- package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
- package/build-module/border-box-control/border-box-control-linked-button/hook.js +3 -2
- package/build-module/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js +23 -8
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/hook.js +11 -4
- package/build-module/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
- package/build-module/border-box-control/border-box-control-visualizer/hook.js +5 -2
- package/build-module/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
- package/build-module/border-box-control/styles.js +15 -16
- package/build-module/border-box-control/styles.js.map +1 -1
- package/build-module/border-control/border-control/component.js +5 -3
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js +8 -5
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +6 -2
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/hook.js +5 -5
- package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build-module/border-control/styles.js +56 -29
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/box-control/index.js +1 -20
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/utils.js +0 -6
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/button/index.js +3 -4
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/index.native.js +16 -3
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/button-group/index.js +27 -7
- package/build-module/button-group/index.js.map +1 -1
- package/build-module/{flyout → button-group}/types.js +0 -0
- package/build-module/{flyout → button-group}/types.js.map +0 -0
- package/build-module/checkbox-control/index.js +31 -7
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/checkbox-control/types.js +2 -0
- package/{build/flyout → build-module/checkbox-control}/types.js.map +0 -0
- package/build-module/circular-option-picker/index.js +1 -2
- package/build-module/circular-option-picker/index.js.map +1 -1
- package/build-module/color-palette/index.js +12 -16
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +4 -1
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/color-copy-button.js +73 -0
- package/build-module/color-picker/color-copy-button.js.map +1 -0
- package/build-module/color-picker/component.js +6 -15
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/hex-input.js +18 -1
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/styles.js +9 -9
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/custom-gradient-picker/utils.js +1 -1
- package/build-module/custom-gradient-picker/utils.js.map +1 -1
- package/build-module/date-time/{date.js → date/index.js} +79 -22
- package/build-module/date-time/date/index.js.map +1 -0
- package/build-module/date-time/date/styles.js +61 -0
- package/build-module/date-time/date/styles.js.map +1 -0
- package/build-module/date-time/date/utils.js +22 -0
- package/build-module/date-time/date/utils.js.map +1 -0
- package/build-module/date-time/date-time/index.js +144 -0
- package/build-module/date-time/date-time/index.js.map +1 -0
- package/build-module/date-time/date-time/styles.js +22 -0
- package/build-module/date-time/date-time/styles.js.map +1 -0
- package/build-module/date-time/index.js +2 -82
- package/build-module/date-time/index.js.map +1 -1
- package/build-module/date-time/time/index.js +302 -0
- package/build-module/date-time/time/index.js.map +1 -0
- package/build-module/date-time/time/styles.js +118 -0
- package/build-module/date-time/time/styles.js.map +1 -0
- package/build-module/date-time/{timezone.js → time/timezone.js} +7 -5
- package/build-module/date-time/time/timezone.js.map +1 -0
- package/build-module/date-time/types.js +2 -0
- package/build-module/date-time/types.js.map +1 -0
- package/build-module/disabled/index.js +5 -76
- package/build-module/disabled/index.js.map +1 -1
- package/build-module/draggable/index.native.js +211 -0
- package/build-module/draggable/index.native.js.map +1 -0
- package/build-module/dropdown/index.js +9 -4
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/focal-point-picker/index.native.js +3 -3
- package/build-module/focal-point-picker/index.native.js.map +1 -1
- package/build-module/index.js +0 -1
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +2 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/input-control/index.js +11 -6
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-field.js +1 -25
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js +38 -26
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/reducer/state.js +0 -1
- package/build-module/input-control/reducer/state.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +42 -30
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/input-control/utils.js +48 -2
- package/build-module/input-control/utils.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-select-control/index.native.js +4 -2
- package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build-module/mobile/html-text-input/index.native.js +20 -9
- package/build-module/mobile/html-text-input/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js +21 -5
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +42 -25
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build-module/palette-edit/index.js +37 -7
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/popover/index.js +230 -323
- package/build-module/popover/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.js +4 -5
- package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build-module/sandbox/index.native.js +1 -1
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/search-control/index.js +6 -7
- package/build-module/search-control/index.js.map +1 -1
- package/build-module/select-control/index.js +32 -4
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +17 -14
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/spacer/hook.js +10 -2
- package/build-module/spacer/hook.js.map +1 -1
- package/build-module/surface/component.js +7 -7
- package/build-module/surface/component.js.map +1 -1
- package/build-module/surface/hook.js +8 -11
- package/build-module/surface/hook.js.map +1 -1
- package/build-module/surface/index.js.map +1 -1
- package/build-module/surface/styles.js +8 -48
- package/build-module/surface/styles.js.map +1 -1
- package/build-module/text-control/index.js +35 -27
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/text-control/types.js +2 -0
- package/build-module/text-control/types.js.map +1 -0
- package/build-module/textarea-control/index.js +36 -5
- package/build-module/textarea-control/index.js.map +1 -1
- package/build-module/textarea-control/styles/textarea-control-styles.js +3 -3
- package/build-module/textarea-control/styles/textarea-control-styles.js.map +1 -1
- package/build-module/textarea-control/types.js +2 -0
- package/build-module/textarea-control/types.js.map +1 -0
- package/build-module/toggle-group-control/toggle-group-control/component.js +2 -3
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +1 -5
- package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +51 -36
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tooltip/index.js +2 -2
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/unit-control/index.js +3 -3
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +11 -20
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/unit-control/utils.js.map +1 -1
- package/build-module/utils/hooks/index.js +0 -1
- package/build-module/utils/hooks/index.js.map +1 -1
- package/build-style/style-rtl.css +51 -358
- package/build-style/style.css +47 -361
- package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +3 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +4 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
- package/build-types/border-box-control/styles.d.ts +4 -3
- package/build-types/border-box-control/styles.d.ts.map +1 -1
- package/build-types/border-box-control/types.d.ts +40 -13
- package/build-types/border-box-control/types.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +2 -1
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +1 -0
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/border-control/styles.d.ts +2 -1
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +18 -6
- package/build-types/border-control/types.d.ts.map +1 -1
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/button-group/index.d.ts +25 -0
- package/build-types/button-group/index.d.ts.map +1 -0
- package/build-types/button-group/stories/index.d.ts +12 -0
- package/build-types/button-group/stories/index.d.ts.map +1 -0
- package/build-types/button-group/types.d.ts +11 -0
- package/build-types/button-group/types.d.ts.map +1 -0
- package/build-types/card/types.d.ts +1 -1
- package/build-types/card/types.d.ts.map +1 -1
- package/build-types/checkbox-control/index.d.ts +26 -0
- package/build-types/checkbox-control/index.d.ts.map +1 -0
- package/build-types/checkbox-control/stories/index.d.ts +13 -0
- package/build-types/checkbox-control/stories/index.d.ts.map +1 -0
- package/build-types/checkbox-control/test/index.d.ts +2 -0
- package/build-types/checkbox-control/test/index.d.ts.map +1 -0
- package/build-types/checkbox-control/types.d.ts +35 -0
- package/build-types/checkbox-control/types.d.ts.map +1 -0
- package/build-types/circular-option-picker/index.d.ts.map +1 -1
- package/build-types/color-palette/index.d.ts +1 -0
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/test/utils.d.ts +2 -0
- package/build-types/color-palette/test/utils.d.ts.map +1 -0
- package/build-types/color-picker/color-copy-button.d.ts +4 -0
- package/build-types/color-picker/color-copy-button.d.ts.map +1 -0
- package/build-types/color-picker/component.d.ts.map +1 -1
- package/build-types/color-picker/hex-input.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +4 -4
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/color-picker/types.d.ts +8 -0
- package/build-types/color-picker/types.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts +25 -0
- package/build-types/date-time/date/index.d.ts.map +1 -0
- package/build-types/date-time/date/styles.d.ts +23 -0
- package/build-types/date-time/date/styles.d.ts.map +1 -0
- package/build-types/date-time/date/test/index.d.ts +2 -0
- package/build-types/date-time/date/test/index.d.ts.map +1 -0
- package/build-types/date-time/date/test/utils.d.ts +2 -0
- package/build-types/date-time/date/test/utils.d.ts.map +1 -0
- package/build-types/date-time/date/utils.d.ts +15 -0
- package/build-types/date-time/date/utils.d.ts.map +1 -0
- package/build-types/date-time/date-time/index.d.ts +33 -0
- package/build-types/date-time/date-time/index.d.ts.map +1 -0
- package/build-types/date-time/date-time/styles.d.ts +6 -0
- package/build-types/date-time/date-time/styles.d.ts.map +1 -0
- package/build-types/date-time/index.d.ts +9 -0
- package/build-types/date-time/index.d.ts.map +1 -0
- package/build-types/date-time/stories/date-time.d.ts +14 -0
- package/build-types/date-time/stories/date-time.d.ts.map +1 -0
- package/build-types/date-time/stories/date.d.ts +14 -0
- package/build-types/date-time/stories/date.d.ts.map +1 -0
- package/build-types/date-time/stories/time.d.ts +12 -0
- package/build-types/date-time/stories/time.d.ts.map +1 -0
- package/build-types/date-time/stories/utils.d.ts +3 -0
- package/build-types/date-time/stories/utils.d.ts.map +1 -0
- package/build-types/date-time/time/index.d.ts +25 -0
- package/build-types/date-time/time/index.d.ts.map +1 -0
- package/build-types/date-time/time/styles.d.ts +111 -0
- package/build-types/date-time/time/styles.d.ts.map +1 -0
- package/build-types/date-time/time/test/index.d.ts +2 -0
- package/build-types/date-time/time/test/index.d.ts.map +1 -0
- package/build-types/date-time/time/timezone.d.ts +8 -0
- package/build-types/date-time/time/timezone.d.ts.map +1 -0
- package/build-types/date-time/types.d.ts +90 -0
- package/build-types/date-time/types.d.ts.map +1 -0
- package/build-types/disabled/index.d.ts.map +1 -1
- package/build-types/dropdown/index.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts +4 -3
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts +5 -3
- package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
- package/build-types/input-control/reducer/state.d.ts +2 -2
- package/build-types/input-control/reducer/state.d.ts.map +1 -1
- package/build-types/input-control/stories/index.d.ts +5 -5
- package/build-types/input-control/stories/index.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +1 -0
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +6 -0
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/input-control/utils.d.ts +17 -0
- package/build-types/input-control/utils.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/popover/index.d.ts +6 -8
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/resizable-box/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +30 -26
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.d.ts +23 -0
- package/build-types/select-control/stories/index.d.ts.map +1 -0
- package/build-types/select-control/styles/select-control-styles.d.ts +3 -4
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/select-control/test/select-control.d.ts +2 -0
- package/build-types/select-control/test/select-control.d.ts.map +1 -0
- package/build-types/select-control/types.d.ts +52 -1
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/surface/component.d.ts +3 -2
- package/build-types/surface/component.d.ts.map +1 -1
- package/build-types/surface/hook.d.ts +4 -4
- package/build-types/surface/hook.d.ts.map +1 -1
- package/build-types/surface/index.d.ts +2 -2
- package/build-types/surface/index.d.ts.map +1 -1
- package/build-types/surface/stories/index.d.ts +12 -0
- package/build-types/surface/stories/index.d.ts.map +1 -0
- package/build-types/surface/styles.d.ts +10 -21
- package/build-types/surface/styles.d.ts.map +1 -1
- package/build-types/surface/test/index.d.ts +2 -0
- package/build-types/{flyout/flyout → surface/test}/index.d.ts.map +1 -1
- package/build-types/surface/types.d.ts +1 -1
- package/build-types/surface/types.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts +32 -0
- package/build-types/text-control/index.d.ts.map +1 -0
- package/build-types/text-control/stories/index.d.ts +13 -0
- package/build-types/text-control/stories/index.d.ts.map +1 -0
- package/build-types/text-control/types.d.ts +25 -0
- package/build-types/text-control/types.d.ts.map +1 -0
- package/build-types/textarea-control/index.d.ts +29 -0
- package/build-types/textarea-control/index.d.ts.map +1 -0
- package/build-types/textarea-control/stories/index.d.ts +12 -0
- package/build-types/textarea-control/stories/index.d.ts.map +1 -0
- package/build-types/textarea-control/styles/textarea-control-styles.d.ts +6 -0
- package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +1 -0
- package/build-types/textarea-control/types.d.ts +26 -0
- package/build-types/textarea-control/types.d.ts.map +1 -0
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +0 -1
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +2 -2
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/test/index.d.ts +2 -0
- package/build-types/unit-control/test/index.d.ts.map +1 -0
- package/build-types/unit-control/test/utils.d.ts +2 -0
- package/build-types/unit-control/test/utils.d.ts.map +1 -0
- package/build-types/unit-control/types.d.ts +1 -1
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/unit-control/utils.d.ts +3 -3
- package/build-types/unit-control/utils.d.ts.map +1 -1
- package/build-types/utils/hooks/index.d.ts +0 -1
- package/package.json +20 -20
- package/src/alignment-matrix-control/index.js +4 -2
- package/src/angle-picker-control/angle-circle.js +3 -3
- package/src/autocomplete/autocompleter-ui.js +1 -1
- package/src/autocomplete/autocompleter-ui.native.js +2 -2
- package/src/autocomplete/index.js +21 -9
- package/src/autocomplete/style.scss +1 -1
- package/src/border-box-control/border-box-control/README.md +10 -14
- package/src/border-box-control/border-box-control/component.tsx +21 -4
- package/src/border-box-control/border-box-control/hook.ts +2 -2
- package/src/border-box-control/border-box-control-linked-button/hook.ts +10 -6
- package/src/border-box-control/border-box-control-split-controls/component.tsx +26 -7
- package/src/border-box-control/border-box-control-split-controls/hook.ts +18 -4
- package/src/border-box-control/border-box-control-visualizer/hook.ts +14 -6
- package/src/border-box-control/stories/index.js +1 -0
- package/src/border-box-control/styles.ts +20 -9
- package/src/border-box-control/types.ts +40 -14
- package/src/border-control/border-control/README.md +0 -7
- package/src/border-control/border-control/component.tsx +4 -2
- package/src/border-control/border-control/hook.ts +13 -4
- package/src/border-control/border-control-dropdown/component.tsx +18 -11
- package/src/border-control/border-control-dropdown/hook.ts +7 -5
- package/src/border-control/stories/index.js +1 -0
- package/src/border-control/styles.ts +82 -22
- package/src/border-control/types.ts +18 -6
- package/src/box-control/README.md +0 -74
- package/src/box-control/index.js +0 -15
- package/src/box-control/stories/index.js +0 -29
- package/src/box-control/test/index.js +120 -109
- package/src/box-control/utils.js +0 -7
- package/src/button/index.js +2 -4
- package/src/button/index.native.js +33 -18
- package/src/button/test/index.js +16 -1
- package/src/button-group/index.tsx +47 -0
- package/src/button-group/stories/index.tsx +41 -0
- package/src/button-group/types.ts +11 -0
- package/src/card/types.ts +1 -1
- package/src/checkbox-control/README.md +10 -8
- package/src/checkbox-control/{index.js → index.tsx} +49 -14
- package/src/checkbox-control/stories/{index.js → index.tsx} +49 -27
- package/src/checkbox-control/test/__snapshots__/index.tsx.snap +42 -0
- package/src/checkbox-control/test/index.tsx +109 -0
- package/src/checkbox-control/types.ts +36 -0
- package/src/circular-option-picker/index.js +1 -2
- package/src/circular-option-picker/style.scss +1 -0
- package/src/color-palette/README.md +0 -1
- package/src/color-palette/index.js +17 -17
- package/src/color-palette/index.native.js +3 -0
- package/src/color-palette/stories/index.js +25 -1
- package/src/color-palette/style.scss +3 -18
- package/src/color-palette/test/__snapshots__/index.js.snap +2 -3
- package/src/color-palette/test/utils.ts +24 -0
- package/src/color-picker/color-copy-button.tsx +76 -0
- package/src/color-picker/component.tsx +18 -38
- package/src/color-picker/hex-input.tsx +16 -0
- package/src/color-picker/styles.ts +5 -1
- package/src/color-picker/types.ts +9 -0
- package/src/confirm-dialog/stories/index.js +87 -99
- package/src/custom-gradient-picker/utils.js +1 -1
- package/src/date-time/README.md +29 -10
- package/src/date-time/{datepicker.scss → date/datepicker.scss} +0 -0
- package/src/date-time/{date.js → date/index.tsx} +76 -24
- package/src/date-time/date/style.scss +75 -0
- package/src/date-time/date/styles.ts +55 -0
- package/src/date-time/date/test/index.tsx +127 -0
- package/src/date-time/{test/utils.js → date/test/utils.ts} +1 -1
- package/src/date-time/date/utils.ts +20 -0
- package/src/date-time/date-time/index.tsx +217 -0
- package/src/date-time/date-time/styles.ts +8 -0
- package/src/date-time/index.ts +9 -0
- package/src/date-time/stories/date-time.tsx +75 -0
- package/src/date-time/stories/date.tsx +73 -0
- package/src/date-time/stories/time.tsx +51 -0
- package/src/date-time/stories/utils.ts +9 -0
- package/src/date-time/style.scss +1 -262
- package/src/date-time/time/index.tsx +356 -0
- package/src/date-time/time/styles.ts +119 -0
- package/src/date-time/{test/time.js → time/test/index.tsx} +119 -57
- package/src/date-time/{timezone.js → time/timezone.tsx} +9 -5
- package/src/date-time/types.ts +104 -0
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
- package/src/disabled/index.js +5 -90
- package/src/draggable/index.native.js +226 -0
- package/src/draggable/style.native.scss +3 -0
- package/src/draggable/test/index.native.js +130 -0
- package/src/dropdown/index.js +12 -3
- package/src/dropdown/style.scss +1 -1
- package/src/focal-point-picker/index.native.js +3 -3
- package/src/form-file-upload/test/index.js +20 -13
- package/src/index.js +0 -1
- package/src/index.native.js +1 -0
- package/src/input-control/README.md +1 -1
- package/src/input-control/index.tsx +11 -4
- package/src/input-control/input-field.tsx +10 -30
- package/src/input-control/reducer/reducer.ts +40 -26
- package/src/input-control/reducer/state.ts +2 -3
- package/src/input-control/stories/index.tsx +1 -1
- package/src/input-control/styles/input-control-styles.tsx +19 -5
- package/src/input-control/types.ts +6 -0
- package/src/input-control/utils.ts +55 -1
- package/src/item-group/stories/index.js +22 -18
- package/src/menu-item/style.scss +10 -0
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +9 -2
- package/src/mobile/bottom-sheet/index.native.js +1 -1
- package/src/mobile/bottom-sheet-select-control/index.native.js +8 -2
- package/src/mobile/html-text-input/index.native.js +45 -29
- package/src/mobile/html-text-input/style.android.scss +2 -15
- package/src/mobile/html-text-input/style.ios.scss +2 -15
- package/src/mobile/html-text-input/{style-common.native.scss → style.scss} +16 -0
- package/src/mobile/keyboard-aware-flat-list/index.android.js +15 -5
- package/src/mobile/keyboard-aware-flat-list/index.ios.js +75 -46
- package/src/mobile/link-settings/test/link-settings-navigation.native.js +9 -1
- package/src/navigator/stories/index.js +16 -10
- package/src/palette-edit/index.js +37 -9
- package/src/palette-edit/style.scss +0 -7
- package/src/palette-edit/test/index.js +63 -0
- package/src/panel/README.md +1 -1
- package/src/placeholder/test/index.js +7 -0
- package/src/popover/README.md +7 -9
- package/src/popover/index.js +256 -416
- package/src/popover/style.scss +20 -190
- package/src/popover/test/__snapshots__/index.js.snap +6 -18
- package/src/query-controls/README.md +1 -1
- package/src/resizable-box/resize-tooltip/utils.ts +4 -5
- package/src/sandbox/index.native.js +1 -1
- package/src/search-control/index.js +6 -7
- package/src/select-control/README.md +13 -2
- package/src/select-control/index.tsx +36 -30
- package/src/select-control/stories/index.tsx +90 -0
- package/src/select-control/styles/select-control-styles.ts +15 -11
- package/src/select-control/test/{select-control.js → select-control.tsx} +2 -2
- package/src/select-control/types.ts +66 -1
- package/src/slot-fill/README.md +1 -1
- package/src/spacer/hook.ts +13 -13
- package/src/surface/README.md +15 -15
- package/src/surface/{component.js → component.tsx} +13 -7
- package/src/surface/{hook.js → hook.ts} +13 -12
- package/src/surface/{index.js → index.ts} +0 -0
- package/src/surface/stories/index.tsx +40 -0
- package/src/surface/{styles.js → styles.ts} +15 -44
- package/src/surface/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/surface/test/{index.js → index.tsx} +2 -1
- package/src/surface/types.ts +1 -1
- package/src/tab-panel/style.scss +1 -1
- package/src/text-control/index.tsx +84 -0
- package/src/text-control/stories/index.tsx +66 -0
- package/src/text-control/types.ts +29 -0
- package/src/textarea-control/README.md +14 -20
- package/src/textarea-control/index.tsx +86 -0
- package/src/textarea-control/stories/index.tsx +58 -0
- package/src/textarea-control/styles/{textarea-control-styles.js → textarea-control-styles.ts} +0 -0
- package/src/textarea-control/types.ts +30 -0
- package/src/toggle-group-control/test/__snapshots__/index.js.snap +4 -10
- package/src/toggle-group-control/toggle-group-control/component.tsx +7 -3
- package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +1 -5
- package/src/tools-panel/test/__snapshots__/index.js.snap +1 -1
- package/src/tools-panel/test/index.js +71 -18
- package/src/tools-panel/tools-panel-header/component.tsx +75 -33
- package/src/tools-panel/types.ts +0 -1
- package/src/tooltip/index.js +8 -2
- package/src/tooltip/style.scss +2 -4
- package/src/tooltip/test/index.js +6 -0
- package/src/tooltip/test/index.native.js +1 -1
- package/src/unit-control/index.tsx +2 -5
- package/src/unit-control/styles/unit-control-styles.ts +3 -13
- package/src/unit-control/test/__snapshots__/index.tsx.snap +33 -0
- package/src/unit-control/test/{index.js → index.tsx} +295 -166
- package/src/unit-control/test/{utils.js → utils.ts} +38 -19
- package/src/unit-control/types.ts +4 -1
- package/src/unit-control/utils.ts +5 -3
- package/src/utils/hooks/index.js +0 -1
- package/tsconfig.json +7 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/box-control/visualizer.js +0 -165
- package/build/box-control/visualizer.js.map +0 -1
- package/build/color-picker/color-display.js +0 -184
- package/build/color-picker/color-display.js.map +0 -1
- package/build/date-time/date.js.map +0 -1
- package/build/date-time/time.js +0 -287
- package/build/date-time/time.js.map +0 -1
- package/build/date-time/timezone.js.map +0 -1
- package/build/date-time/utils.js.map +0 -1
- package/build/flyout/context.js +0 -23
- package/build/flyout/context.js.map +0 -1
- package/build/flyout/flyout/component.js +0 -106
- package/build/flyout/flyout/component.js.map +0 -1
- package/build/flyout/flyout/hook.js +0 -53
- package/build/flyout/flyout/hook.js.map +0 -1
- package/build/flyout/flyout/index.js +0 -24
- package/build/flyout/flyout/index.js.map +0 -1
- package/build/flyout/flyout-content/component.js +0 -65
- package/build/flyout/flyout-content/component.js.map +0 -1
- package/build/flyout/flyout-content/index.js +0 -16
- package/build/flyout/flyout-content/index.js.map +0 -1
- package/build/flyout/index.js +0 -16
- package/build/flyout/index.js.map +0 -1
- package/build/flyout/styles.js +0 -46
- package/build/flyout/styles.js.map +0 -1
- package/build/flyout/utils.js +0 -36
- package/build/flyout/utils.js.map +0 -1
- package/build/mobile/html-text-input/container.android.js +0 -41
- package/build/mobile/html-text-input/container.android.js.map +0 -1
- package/build/mobile/html-text-input/container.ios.js +0 -60
- package/build/mobile/html-text-input/container.ios.js.map +0 -1
- package/build/popover/utils.js +0 -322
- package/build/popover/utils.js.map +0 -1
- package/build/utils/hooks/use-combined-ref.js +0 -32
- package/build/utils/hooks/use-combined-ref.js.map +0 -1
- package/build-module/box-control/visualizer.js +0 -154
- package/build-module/box-control/visualizer.js.map +0 -1
- package/build-module/color-picker/color-display.js +0 -170
- package/build-module/color-picker/color-display.js.map +0 -1
- package/build-module/date-time/date.js.map +0 -1
- package/build-module/date-time/time.js +0 -269
- package/build-module/date-time/time.js.map +0 -1
- package/build-module/date-time/timezone.js.map +0 -1
- package/build-module/date-time/utils.js +0 -20
- package/build-module/date-time/utils.js.map +0 -1
- package/build-module/flyout/context.js +0 -11
- package/build-module/flyout/context.js.map +0 -1
- package/build-module/flyout/flyout/component.js +0 -89
- package/build-module/flyout/flyout/component.js.map +0 -1
- package/build-module/flyout/flyout/hook.js +0 -44
- package/build-module/flyout/flyout/hook.js.map +0 -1
- package/build-module/flyout/flyout/index.js +0 -3
- package/build-module/flyout/flyout/index.js.map +0 -1
- package/build-module/flyout/flyout-content/component.js +0 -51
- package/build-module/flyout/flyout-content/component.js.map +0 -1
- package/build-module/flyout/flyout-content/index.js +0 -2
- package/build-module/flyout/flyout-content/index.js.map +0 -1
- package/build-module/flyout/index.js +0 -2
- package/build-module/flyout/index.js.map +0 -1
- package/build-module/flyout/styles.js +0 -27
- package/build-module/flyout/styles.js.map +0 -1
- package/build-module/flyout/utils.js +0 -25
- package/build-module/flyout/utils.js.map +0 -1
- package/build-module/mobile/html-text-input/container.android.js +0 -29
- package/build-module/mobile/html-text-input/container.android.js.map +0 -1
- package/build-module/mobile/html-text-input/container.ios.js +0 -48
- package/build-module/mobile/html-text-input/container.ios.js.map +0 -1
- package/build-module/popover/utils.js +0 -308
- package/build-module/popover/utils.js.map +0 -1
- package/build-module/utils/hooks/use-combined-ref.js +0 -28
- package/build-module/utils/hooks/use-combined-ref.js.map +0 -1
- package/build-types/color-picker/color-display.d.ts +0 -14
- package/build-types/color-picker/color-display.d.ts.map +0 -1
- package/build-types/flyout/context.d.ts +0 -6
- package/build-types/flyout/context.d.ts.map +0 -1
- package/build-types/flyout/flyout/component.d.ts +0 -21
- package/build-types/flyout/flyout/component.d.ts.map +0 -1
- package/build-types/flyout/flyout/hook.d.ts +0 -270
- package/build-types/flyout/flyout/hook.d.ts.map +0 -1
- package/build-types/flyout/flyout/index.d.ts +0 -3
- package/build-types/flyout/flyout-content/component.d.ts +0 -3
- package/build-types/flyout/flyout-content/component.d.ts.map +0 -1
- package/build-types/flyout/flyout-content/index.d.ts +0 -2
- package/build-types/flyout/flyout-content/index.d.ts.map +0 -1
- package/build-types/flyout/index.d.ts +0 -2
- package/build-types/flyout/index.d.ts.map +0 -1
- package/build-types/flyout/styles.d.ts +0 -22
- package/build-types/flyout/styles.d.ts.map +0 -1
- package/build-types/flyout/types.d.ts +0 -80
- package/build-types/flyout/types.d.ts.map +0 -1
- package/build-types/flyout/utils.d.ts +0 -8
- package/build-types/flyout/utils.d.ts.map +0 -1
- package/build-types/popover/utils.d.ts +0 -70
- package/build-types/popover/utils.d.ts.map +0 -1
- package/build-types/utils/hooks/use-combined-ref.d.ts +0 -8
- package/build-types/utils/hooks/use-combined-ref.d.ts.map +0 -1
- package/src/box-control/visualizer.js +0 -116
- package/src/button-group/index.js +0 -17
- package/src/button-group/stories/index.js +0 -21
- package/src/color-picker/color-display.tsx +0 -169
- package/src/date-time/index.js +0 -170
- package/src/date-time/stories/date.js +0 -17
- package/src/date-time/stories/index.js +0 -72
- package/src/date-time/stories/time.js +0 -32
- package/src/date-time/test/date.js +0 -97
- package/src/date-time/time.js +0 -310
- package/src/date-time/utils.js +0 -18
- package/src/flyout/context.js +0 -10
- package/src/flyout/flyout/README.md +0 -98
- package/src/flyout/flyout/component.js +0 -111
- package/src/flyout/flyout/hook.js +0 -45
- package/src/flyout/flyout/index.js +0 -2
- package/src/flyout/flyout-content/component.js +0 -53
- package/src/flyout/flyout-content/index.js +0 -1
- package/src/flyout/index.js +0 -1
- package/src/flyout/stories/index.js +0 -24
- package/src/flyout/styles.ts +0 -41
- package/src/flyout/test/__snapshots__/index.js.snap +0 -186
- package/src/flyout/test/index.js +0 -103
- package/src/flyout/types.ts +0 -84
- package/src/flyout/utils.js +0 -23
- package/src/mobile/html-text-input/container.android.js +0 -23
- package/src/mobile/html-text-input/container.ios.js +0 -50
- package/src/popover/test/utils.js +0 -304
- package/src/popover/utils.js +0 -396
- package/src/select-control/stories/index.js +0 -104
- package/src/surface/stories/index.js +0 -46
- package/src/text-control/index.js +0 -72
- package/src/text-control/stories/index.js +0 -46
- package/src/textarea-control/index.js +0 -45
- package/src/textarea-control/stories/index.js +0 -48
- package/src/utils/hooks/use-combined-ref.ts +0 -28
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
Object.defineProperty(exports, "default", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () {
|
|
11
|
-
return _component.default;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
var _component = _interopRequireDefault(require("./component"));
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/flyout/flyout-content/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA","sourcesContent":["export { default } from './component';\n"]}
|
package/build/flyout/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
Object.defineProperty(exports, "Flyout", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () {
|
|
11
|
-
return _flyout.default;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
var _flyout = _interopRequireDefault(require("./flyout"));
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/flyout/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as Flyout } from './flyout';\n"]}
|
package/build/flyout/styles.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.FlyoutContentView = exports.CardView = void 0;
|
|
9
|
-
|
|
10
|
-
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
11
|
-
|
|
12
|
-
var _reakit = require("reakit");
|
|
13
|
-
|
|
14
|
-
var _card = require("../card");
|
|
15
|
-
|
|
16
|
-
var ZIndex = _interopRequireWildcard(require("../utils/z-index"));
|
|
17
|
-
|
|
18
|
-
var _configValues = _interopRequireDefault(require("../utils/config-values"));
|
|
19
|
-
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* External dependencies
|
|
26
|
-
*/
|
|
27
|
-
// eslint-disable-next-line no-restricted-imports
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Internal dependencies
|
|
31
|
-
*/
|
|
32
|
-
const FlyoutContentView = ( /*#__PURE__*/0, _base.default)(_reakit.Popover, process.env.NODE_ENV === "production" ? {
|
|
33
|
-
target: "e1vtu5161"
|
|
34
|
-
} : {
|
|
35
|
-
target: "e1vtu5161",
|
|
36
|
-
label: "FlyoutContentView"
|
|
37
|
-
})("z-index:", ZIndex.Flyout, ";box-sizing:border-box;opacity:0;outline:none;position:relative;transform-origin:center center;transition:opacity ", _configValues.default.transitionDurationFastest, " linear;width:100%;&[data-enter]{opacity:1;}&::before,&::after{display:none;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZmx5b3V0L3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnQjJCIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZmx5b3V0L3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQsIHsgU3R5bGVkQ29tcG9uZW50IH0gZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1yZXN0cmljdGVkLWltcG9ydHNcbmltcG9ydCB7IFBvcG92ZXIgYXMgUmVha2l0UG9wb3ZlciB9IGZyb20gJ3JlYWtpdCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IENhcmQsIENhcmRCb2R5IH0gZnJvbSAnLi4vY2FyZCc7XG5pbXBvcnQgKiBhcyBaSW5kZXggZnJvbSAnLi4vdXRpbHMvei1pbmRleCc7XG5pbXBvcnQgQ09ORklHIGZyb20gJy4uL3V0aWxzL2NvbmZpZy12YWx1ZXMnO1xuXG5leHBvcnQgY29uc3QgRmx5b3V0Q29udGVudFZpZXc6IFN0eWxlZENvbXBvbmVudDxcblx0UmVhY3QuQ29tcG9uZW50UHJvcHNXaXRob3V0UmVmPCB0eXBlb2YgUmVha2l0UG9wb3ZlciA+XG4+ID0gc3R5bGVkKCBSZWFraXRQb3BvdmVyIClgXG5cdHotaW5kZXg6ICR7IFpJbmRleC5GbHlvdXQgfTtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0b3BhY2l0eTogMDtcblx0b3V0bGluZTogbm9uZTtcblx0cG9zaXRpb246IHJlbGF0aXZlO1xuXHR0cmFuc2Zvcm0tb3JpZ2luOiBjZW50ZXIgY2VudGVyO1xuXHR0cmFuc2l0aW9uOiBvcGFjaXR5ICR7IENPTkZJRy50cmFuc2l0aW9uRHVyYXRpb25GYXN0ZXN0IH0gbGluZWFyO1xuXHR3aWR0aDogMTAwJTtcblxuXHQmW2RhdGEtZW50ZXJdIHtcblx0XHRvcGFjaXR5OiAxO1xuXHR9XG5cblx0Jjo6YmVmb3JlLFxuXHQmOjphZnRlciB7XG5cdFx0ZGlzcGxheTogbm9uZTtcblx0fVxuYDtcblxuZXhwb3J0IGNvbnN0IENhcmRWaWV3ID0gc3R5bGVkKCBDYXJkIClgXG5cdCR7IENhcmRCb2R5LnNlbGVjdG9yIH0ge1xuXHRcdG1heC1oZWlnaHQ6IDgwdmg7XG5cdH1cbmA7XG4iXX0= */"));
|
|
38
|
-
exports.FlyoutContentView = FlyoutContentView;
|
|
39
|
-
const CardView = ( /*#__PURE__*/0, _base.default)(_card.Card, process.env.NODE_ENV === "production" ? {
|
|
40
|
-
target: "e1vtu5160"
|
|
41
|
-
} : {
|
|
42
|
-
target: "e1vtu5160",
|
|
43
|
-
label: "CardView"
|
|
44
|
-
})(_card.CardBody.selector, "{max-height:80vh;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3Mv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vcGFjaXR5ICR7IENPTkZJRy50cmFuc2l0aW9uRHVyYXRpb25GYXN0ZXN0IH0gbGluZWFyO1xuXHR3aWR0aDogMTAwJTtcblxuXHQmW2RhdGEtZW50ZXJdIHtcblx0XHRvcGFjaXR5OiAxO1xuXHR9XG5cblx0Jjo6YmVmb3JlLFxuXHQmOjphZnRlciB7XG5cdFx0ZGlzcGxheTogbm9uZTtcblx0fVxuYDtcblxuZXhwb3J0IGNvbnN0IENhcmRWaWV3ID0gc3R5bGVkKCBDYXJkIClgXG5cdCR7IENhcmRCb2R5LnNlbGVjdG9yIH0ge1xuXHRcdG1heC1oZWlnaHQ6IDgwdmg7XG5cdH1cbmA7XG4iXX0= */"));
|
|
45
|
-
exports.CardView = CardView;
|
|
46
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/flyout/styles.ts"],"names":["FlyoutContentView","ReakitPopover","ZIndex","Flyout","CONFIG","transitionDurationFastest","CardView","Card","CardBody","selector"],"mappings":";;;;;;;;;;;AAKA;;AAKA;;AACA;;AACA;;;;;;AAZA;AACA;AACA;AAEA;;AAGA;AACA;AACA;AAKO,MAAMA,iBAEZ,GAAG,iCAAQC,eAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,aACYC,MAAM,CAACC,MADnB,wHAOuBC,sBAAOC,yBAP9B,yqDAFM;;AAsBA,MAAMC,QAAQ,GAAG,iCAAQC,UAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,CACjBC,eAASC,QADQ,8mDAAd","sourcesContent":["/**\n * External dependencies\n */\nimport styled, { StyledComponent } from '@emotion/styled';\n// eslint-disable-next-line no-restricted-imports\nimport { Popover as ReakitPopover } from 'reakit';\n\n/**\n * Internal dependencies\n */\nimport { Card, CardBody } from '../card';\nimport * as ZIndex from '../utils/z-index';\nimport CONFIG from '../utils/config-values';\n\nexport const FlyoutContentView: StyledComponent<\n\tReact.ComponentPropsWithoutRef< typeof ReakitPopover >\n> = styled( ReakitPopover )`\n\tz-index: ${ ZIndex.Flyout };\n\tbox-sizing: border-box;\n\topacity: 0;\n\toutline: none;\n\tposition: relative;\n\ttransform-origin: center center;\n\ttransition: opacity ${ CONFIG.transitionDurationFastest } linear;\n\twidth: 100%;\n\n\t&[data-enter] {\n\t\topacity: 1;\n\t}\n\n\t&::before,\n\t&::after {\n\t\tdisplay: none;\n\t}\n`;\n\nexport const CardView = styled( Card )`\n\t${ CardBody.selector } {\n\t\tmax-height: 80vh;\n\t}\n`;\n"]}
|
package/build/flyout/utils.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.useFlyoutResizeUpdater = useFlyoutResizeUpdater;
|
|
9
|
-
|
|
10
|
-
var _reactResizeAware = _interopRequireDefault(require("react-resize-aware"));
|
|
11
|
-
|
|
12
|
-
var _compose = require("@wordpress/compose");
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* External dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* WordPress dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @param { { onResize?: () => any } } onResize
|
|
25
|
-
*/
|
|
26
|
-
function useFlyoutResizeUpdater(_ref) {
|
|
27
|
-
let {
|
|
28
|
-
onResize
|
|
29
|
-
} = _ref;
|
|
30
|
-
const [resizeListener, sizes] = (0, _reactResizeAware.default)();
|
|
31
|
-
(0, _compose.useIsomorphicLayoutEffect)(() => {
|
|
32
|
-
onResize === null || onResize === void 0 ? void 0 : onResize();
|
|
33
|
-
}, [sizes.width, sizes.height]);
|
|
34
|
-
return resizeListener;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/flyout/utils.js"],"names":["useFlyoutResizeUpdater","onResize","resizeListener","sizes","width","height"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACO,SAASA,sBAAT,OAAgD;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AACtD,QAAM,CAAEC,cAAF,EAAkBC,KAAlB,IAA4B,gCAAlC;AAEA,0CAA2B,MAAM;AAChCF,IAAAA,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ;AACR,GAFD,EAEG,CAAEE,KAAK,CAACC,KAAR,EAAeD,KAAK,CAACE,MAArB,CAFH;AAIA,SAAOH,cAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport useResizeAware from 'react-resize-aware';\n\n/**\n * WordPress dependencies\n */\nimport { useIsomorphicLayoutEffect } from '@wordpress/compose';\n\n/**\n *\n * @param { { onResize?: () => any } } onResize\n */\nexport function useFlyoutResizeUpdater( { onResize } ) {\n\tconst [ resizeListener, sizes ] = useResizeAware();\n\n\tuseIsomorphicLayoutEffect( () => {\n\t\tonResize?.();\n\t}, [ sizes.width, sizes.height ] );\n\n\treturn resizeListener;\n}\n"]}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
|
-
var _reactNative = require("react-native");
|
|
13
|
-
|
|
14
|
-
var _keyboardAvoidingView = _interopRequireDefault(require("../keyboard-avoiding-view"));
|
|
15
|
-
|
|
16
|
-
var _styleAndroid = _interopRequireDefault(require("./style.android.scss"));
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* External dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Internal dependencies
|
|
24
|
-
*/
|
|
25
|
-
const HTMLInputContainer = _ref => {
|
|
26
|
-
let {
|
|
27
|
-
children,
|
|
28
|
-
parentHeight
|
|
29
|
-
} = _ref;
|
|
30
|
-
return (0, _element.createElement)(_keyboardAvoidingView.default, {
|
|
31
|
-
style: _styleAndroid.default.keyboardAvoidingView,
|
|
32
|
-
parentHeight: parentHeight
|
|
33
|
-
}, (0, _element.createElement)(_reactNative.ScrollView, {
|
|
34
|
-
style: _styleAndroid.default.scrollView
|
|
35
|
-
}, children));
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
HTMLInputContainer.scrollEnabled = false;
|
|
39
|
-
var _default = HTMLInputContainer;
|
|
40
|
-
exports.default = _default;
|
|
41
|
-
//# sourceMappingURL=container.android.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/mobile/html-text-input/container.android.js"],"names":["HTMLInputContainer","children","parentHeight","styles","keyboardAvoidingView","scrollView","scrollEnabled"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,kBAAkB,GAAG;AAAA,MAAE;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAF;AAAA,SAC1B,4BAAC,6BAAD;AACC,IAAA,KAAK,EAAGC,sBAAOC,oBADhB;AAEC,IAAA,YAAY,EAAGF;AAFhB,KAIC,4BAAC,uBAAD;AAAY,IAAA,KAAK,EAAGC,sBAAOE;AAA3B,KAA0CJ,QAA1C,CAJD,CAD0B;AAAA,CAA3B;;AASAD,kBAAkB,CAACM,aAAnB,GAAmC,KAAnC;eAEeN,kB","sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView } from 'react-native';\n\n/**\n * Internal dependencies\n */\nimport KeyboardAvoidingView from '../keyboard-avoiding-view';\nimport styles from './style.android.scss';\n\nconst HTMLInputContainer = ( { children, parentHeight } ) => (\n\t<KeyboardAvoidingView\n\t\tstyle={ styles.keyboardAvoidingView }\n\t\tparentHeight={ parentHeight }\n\t>\n\t\t<ScrollView style={ styles.scrollView }>{ children }</ScrollView>\n\t</KeyboardAvoidingView>\n);\n\nHTMLInputContainer.scrollEnabled = false;\n\nexport default HTMLInputContainer;\n"]}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
|
-
var _reactNative = require("react-native");
|
|
15
|
-
|
|
16
|
-
var _keyboardAvoidingView = _interopRequireDefault(require("../keyboard-avoiding-view"));
|
|
17
|
-
|
|
18
|
-
var _styleIos = _interopRequireDefault(require("./style.ios.scss"));
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* External dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* WordPress dependencies
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Internal dependencies
|
|
30
|
-
*/
|
|
31
|
-
class HTMLInputContainer extends _element.Component {
|
|
32
|
-
constructor() {
|
|
33
|
-
super(...arguments);
|
|
34
|
-
this.panResponder = _reactNative.PanResponder.create({
|
|
35
|
-
onStartShouldSetPanResponderCapture: () => true,
|
|
36
|
-
onPanResponderMove: (e, gestureState) => {
|
|
37
|
-
if (gestureState.dy > 100 && gestureState.dy < 110) {
|
|
38
|
-
// Keyboard.dismiss() and this.textInput.blur() are not working here
|
|
39
|
-
// They require to know the currentlyFocusedID under the hood but
|
|
40
|
-
// during this gesture there's no currentlyFocusedID.
|
|
41
|
-
_reactNative.UIManager.blur(e.target);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
render() {
|
|
48
|
-
return (0, _element.createElement)(_keyboardAvoidingView.default, (0, _extends2.default)({
|
|
49
|
-
style: _styleIos.default.keyboardAvoidingView
|
|
50
|
-
}, this.panResponder.panHandlers, {
|
|
51
|
-
parentHeight: this.props.parentHeight
|
|
52
|
-
}), this.props.children);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
HTMLInputContainer.scrollEnabled = true;
|
|
58
|
-
var _default = HTMLInputContainer;
|
|
59
|
-
exports.default = _default;
|
|
60
|
-
//# sourceMappingURL=container.ios.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/mobile/html-text-input/container.ios.js"],"names":["HTMLInputContainer","Component","constructor","arguments","panResponder","PanResponder","create","onStartShouldSetPanResponderCapture","onPanResponderMove","e","gestureState","dy","UIManager","blur","target","render","styles","keyboardAvoidingView","panHandlers","props","parentHeight","children","scrollEnabled"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAUA;;AACA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,kBAAN,SAAiCC,kBAAjC,CAA2C;AAC1CC,EAAAA,WAAW,GAAG;AACb,UAAO,GAAGC,SAAV;AAEA,SAAKC,YAAL,GAAoBC,0BAAaC,MAAb,CAAqB;AACxCC,MAAAA,mCAAmC,EAAE,MAAM,IADH;AAGxCC,MAAAA,kBAAkB,EAAE,CAAEC,CAAF,EAAKC,YAAL,KAAuB;AAC1C,YAAKA,YAAY,CAACC,EAAb,GAAkB,GAAlB,IAAyBD,YAAY,CAACC,EAAb,GAAkB,GAAhD,EAAsD;AACrD;AACA;AACA;AACAC,iCAAUC,IAAV,CAAgBJ,CAAC,CAACK,MAAlB;AACA;AACD;AAVuC,KAArB,CAApB;AAYA;;AAEDC,EAAAA,MAAM,GAAG;AACR,WACC,4BAAC,6BAAD;AACC,MAAA,KAAK,EAAGC,kBAAOC;AADhB,OAEM,KAAKb,YAAL,CAAkBc,WAFxB;AAGC,MAAA,YAAY,EAAG,KAAKC,KAAL,CAAWC;AAH3B,QAKG,KAAKD,KAAL,CAAWE,QALd,CADD;AASA;;AA5ByC;;AA+B3CrB,kBAAkB,CAACsB,aAAnB,GAAmC,IAAnC;eAEetB,kB","sourcesContent":["/**\n * External dependencies\n */\nimport { UIManager, PanResponder } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport KeyboardAvoidingView from '../keyboard-avoiding-view';\nimport styles from './style.ios.scss';\n\nclass HTMLInputContainer extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.panResponder = PanResponder.create( {\n\t\t\tonStartShouldSetPanResponderCapture: () => true,\n\n\t\t\tonPanResponderMove: ( e, gestureState ) => {\n\t\t\t\tif ( gestureState.dy > 100 && gestureState.dy < 110 ) {\n\t\t\t\t\t// Keyboard.dismiss() and this.textInput.blur() are not working here\n\t\t\t\t\t// They require to know the currentlyFocusedID under the hood but\n\t\t\t\t\t// during this gesture there's no currentlyFocusedID.\n\t\t\t\t\tUIManager.blur( e.target );\n\t\t\t\t}\n\t\t\t},\n\t\t} );\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<KeyboardAvoidingView\n\t\t\t\tstyle={ styles.keyboardAvoidingView }\n\t\t\t\t{ ...this.panResponder.panHandlers }\n\t\t\t\tparentHeight={ this.props.parentHeight }\n\t\t\t>\n\t\t\t\t{ this.props.children }\n\t\t\t</KeyboardAvoidingView>\n\t\t);\n\t}\n}\n\nHTMLInputContainer.scrollEnabled = true;\n\nexport default HTMLInputContainer;\n"]}
|
package/build/popover/utils.js
DELETED
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.computePopoverPosition = computePopoverPosition;
|
|
7
|
-
exports.computePopoverXAxisPosition = computePopoverXAxisPosition;
|
|
8
|
-
exports.computePopoverYAxisPosition = computePopoverYAxisPosition;
|
|
9
|
-
exports.offsetIframe = offsetIframe;
|
|
10
|
-
|
|
11
|
-
var _i18n = require("@wordpress/i18n");
|
|
12
|
-
|
|
13
|
-
// @ts-nocheck
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* WordPress dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Module constants
|
|
21
|
-
*/
|
|
22
|
-
const HEIGHT_OFFSET = 10; // Used by the arrow and a bit of empty space.
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Utility used to compute the popover position over the xAxis
|
|
26
|
-
*
|
|
27
|
-
* @param {Object} anchorRect Anchor Rect.
|
|
28
|
-
* @param {Object} contentSize Content Size.
|
|
29
|
-
* @param {string} xAxis Desired xAxis.
|
|
30
|
-
* @param {string} corner Desired corner.
|
|
31
|
-
* @param {boolean} stickyBoundaryElement The boundary element to use when
|
|
32
|
-
* switching between sticky and normal
|
|
33
|
-
* position.
|
|
34
|
-
* @param {string} chosenYAxis yAxis to be used.
|
|
35
|
-
* @param {Element} boundaryElement Boundary element.
|
|
36
|
-
* @param {boolean} forcePosition Don't adjust position based on anchor.
|
|
37
|
-
* @param {boolean} forceXAlignment Don't adjust alignment based on YAxis
|
|
38
|
-
*
|
|
39
|
-
* @return {Object} Popover xAxis position and constraints.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, chosenYAxis, boundaryElement, forcePosition, forceXAlignment) {
|
|
43
|
-
const {
|
|
44
|
-
width
|
|
45
|
-
} = contentSize; // Correct xAxis for RTL support.
|
|
46
|
-
|
|
47
|
-
if (xAxis === 'left' && (0, _i18n.isRTL)()) {
|
|
48
|
-
xAxis = 'right';
|
|
49
|
-
} else if (xAxis === 'right' && (0, _i18n.isRTL)()) {
|
|
50
|
-
xAxis = 'left';
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (corner === 'left' && (0, _i18n.isRTL)()) {
|
|
54
|
-
corner = 'right';
|
|
55
|
-
} else if (corner === 'right' && (0, _i18n.isRTL)()) {
|
|
56
|
-
corner = 'left';
|
|
57
|
-
} // X axis alignment choices.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2);
|
|
61
|
-
const centerAlignment = {
|
|
62
|
-
popoverLeft: anchorMidPoint,
|
|
63
|
-
contentWidth: (anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint) + (anchorMidPoint + width / 2 > window.innerWidth ? window.innerWidth - anchorMidPoint : width / 2)
|
|
64
|
-
};
|
|
65
|
-
let leftAlignmentX = anchorRect.left;
|
|
66
|
-
|
|
67
|
-
if (corner === 'right') {
|
|
68
|
-
leftAlignmentX = anchorRect.right;
|
|
69
|
-
} else if (chosenYAxis !== 'middle' && !forceXAlignment) {
|
|
70
|
-
leftAlignmentX = anchorMidPoint;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
let rightAlignmentX = anchorRect.right;
|
|
74
|
-
|
|
75
|
-
if (corner === 'left') {
|
|
76
|
-
rightAlignmentX = anchorRect.left;
|
|
77
|
-
} else if (chosenYAxis !== 'middle' && !forceXAlignment) {
|
|
78
|
-
rightAlignmentX = anchorMidPoint;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const leftAlignment = {
|
|
82
|
-
popoverLeft: leftAlignmentX,
|
|
83
|
-
contentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX
|
|
84
|
-
};
|
|
85
|
-
const rightAlignment = {
|
|
86
|
-
popoverLeft: rightAlignmentX,
|
|
87
|
-
contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width
|
|
88
|
-
}; // Choosing the x axis.
|
|
89
|
-
|
|
90
|
-
let chosenXAxis = xAxis;
|
|
91
|
-
let contentWidth = null;
|
|
92
|
-
|
|
93
|
-
if (!stickyBoundaryElement && !forcePosition) {
|
|
94
|
-
if (xAxis === 'center' && centerAlignment.contentWidth === width) {
|
|
95
|
-
chosenXAxis = 'center';
|
|
96
|
-
} else if (xAxis === 'left' && leftAlignment.contentWidth === width) {
|
|
97
|
-
chosenXAxis = 'left';
|
|
98
|
-
} else if (xAxis === 'right' && rightAlignment.contentWidth === width) {
|
|
99
|
-
chosenXAxis = 'right';
|
|
100
|
-
} else {
|
|
101
|
-
chosenXAxis = leftAlignment.contentWidth > rightAlignment.contentWidth ? 'left' : 'right';
|
|
102
|
-
const chosenWidth = chosenXAxis === 'left' ? leftAlignment.contentWidth : rightAlignment.contentWidth; // Limit width of the content to the viewport width
|
|
103
|
-
|
|
104
|
-
if (width > window.innerWidth) {
|
|
105
|
-
contentWidth = window.innerWidth;
|
|
106
|
-
} // If we can't find any alignment options that could fit
|
|
107
|
-
// our content, then let's fallback to the center of the viewport.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (chosenWidth !== width) {
|
|
111
|
-
chosenXAxis = 'center';
|
|
112
|
-
centerAlignment.popoverLeft = window.innerWidth / 2;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
let popoverLeft;
|
|
118
|
-
|
|
119
|
-
if (chosenXAxis === 'center') {
|
|
120
|
-
popoverLeft = centerAlignment.popoverLeft;
|
|
121
|
-
} else if (chosenXAxis === 'left') {
|
|
122
|
-
popoverLeft = leftAlignment.popoverLeft;
|
|
123
|
-
} else {
|
|
124
|
-
popoverLeft = rightAlignment.popoverLeft;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if (boundaryElement) {
|
|
128
|
-
popoverLeft = Math.min(popoverLeft, boundaryElement.offsetLeft + boundaryElement.offsetWidth - width); // Avoid the popover being position beyond the left boundary if the
|
|
129
|
-
// direction is left to right.
|
|
130
|
-
|
|
131
|
-
if (!(0, _i18n.isRTL)()) {
|
|
132
|
-
popoverLeft = Math.max(popoverLeft, 0);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return {
|
|
137
|
-
xAxis: chosenXAxis,
|
|
138
|
-
popoverLeft,
|
|
139
|
-
contentWidth
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Utility used to compute the popover position over the yAxis
|
|
144
|
-
*
|
|
145
|
-
* @param {Object} anchorRect Anchor Rect.
|
|
146
|
-
* @param {Object} contentSize Content Size.
|
|
147
|
-
* @param {string} yAxis Desired yAxis.
|
|
148
|
-
* @param {string} corner Desired corner.
|
|
149
|
-
* @param {boolean} stickyBoundaryElement The boundary element to use when switching between sticky
|
|
150
|
-
* and normal position.
|
|
151
|
-
* @param {Element} anchorRef The anchor element.
|
|
152
|
-
* @param {Element} relativeOffsetTop If applicable, top offset of the relative positioned
|
|
153
|
-
* parent container.
|
|
154
|
-
* @param {boolean} forcePosition Don't adjust position based on anchor.
|
|
155
|
-
* @param {Element|null} editorWrapper Element that wraps the editor content. Used to access
|
|
156
|
-
* scroll position to determine sticky behavior.
|
|
157
|
-
* @return {Object} Popover xAxis position and constraints.
|
|
158
|
-
*/
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition, editorWrapper) {
|
|
162
|
-
const {
|
|
163
|
-
height
|
|
164
|
-
} = contentSize;
|
|
165
|
-
|
|
166
|
-
if (stickyBoundaryElement) {
|
|
167
|
-
const stickyRect = stickyBoundaryElement.getBoundingClientRect();
|
|
168
|
-
const stickyPositionTop = stickyRect.top + height - relativeOffsetTop;
|
|
169
|
-
const stickyPositionBottom = stickyRect.bottom - height - relativeOffsetTop;
|
|
170
|
-
|
|
171
|
-
if (anchorRect.top <= stickyPositionTop) {
|
|
172
|
-
if (editorWrapper) {
|
|
173
|
-
// If a popover cannot be positioned above the anchor, even after scrolling, we must
|
|
174
|
-
// ensure we use the bottom position instead of the popover slot. This prevents the
|
|
175
|
-
// popover from always restricting block content and interaction while selected if the
|
|
176
|
-
// block is near the top of the site editor.
|
|
177
|
-
const isRoomAboveInCanvas = height + HEIGHT_OFFSET < editorWrapper.scrollTop + anchorRect.top;
|
|
178
|
-
|
|
179
|
-
if (!isRoomAboveInCanvas) {
|
|
180
|
-
return {
|
|
181
|
-
yAxis: 'bottom',
|
|
182
|
-
// If the bottom of the block is also below the bottom sticky position (ex -
|
|
183
|
-
// block is also taller than the editor window), return the bottom sticky
|
|
184
|
-
// position instead. We do this instead of the top sticky position both to
|
|
185
|
-
// allow a smooth transition and more importantly to ensure every section of
|
|
186
|
-
// the block can be free from popover obscuration at some point in the
|
|
187
|
-
// scroll position.
|
|
188
|
-
popoverTop: Math.min(anchorRect.bottom, stickyPositionBottom)
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
} // Default sticky behavior.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return {
|
|
195
|
-
yAxis,
|
|
196
|
-
popoverTop: Math.min(anchorRect.bottom, stickyPositionTop)
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
} // Y axis alignment choices.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
let anchorMidPoint = anchorRect.top + anchorRect.height / 2;
|
|
203
|
-
|
|
204
|
-
if (corner === 'bottom') {
|
|
205
|
-
anchorMidPoint = anchorRect.bottom;
|
|
206
|
-
} else if (corner === 'top') {
|
|
207
|
-
anchorMidPoint = anchorRect.top;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const middleAlignment = {
|
|
211
|
-
popoverTop: anchorMidPoint,
|
|
212
|
-
contentHeight: (anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint) + (anchorMidPoint + height / 2 > window.innerHeight ? window.innerHeight - anchorMidPoint : height / 2)
|
|
213
|
-
};
|
|
214
|
-
const topAlignment = {
|
|
215
|
-
popoverTop: anchorRect.top,
|
|
216
|
-
contentHeight: anchorRect.top - HEIGHT_OFFSET - height > 0 ? height : anchorRect.top - HEIGHT_OFFSET
|
|
217
|
-
};
|
|
218
|
-
const bottomAlignment = {
|
|
219
|
-
popoverTop: anchorRect.bottom,
|
|
220
|
-
contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height
|
|
221
|
-
}; // Choosing the y axis.
|
|
222
|
-
|
|
223
|
-
let chosenYAxis = yAxis;
|
|
224
|
-
let contentHeight = null;
|
|
225
|
-
|
|
226
|
-
if (!stickyBoundaryElement && !forcePosition) {
|
|
227
|
-
if (yAxis === 'middle' && middleAlignment.contentHeight === height) {
|
|
228
|
-
chosenYAxis = 'middle';
|
|
229
|
-
} else if (yAxis === 'top' && topAlignment.contentHeight === height) {
|
|
230
|
-
chosenYAxis = 'top';
|
|
231
|
-
} else if (yAxis === 'bottom' && bottomAlignment.contentHeight === height) {
|
|
232
|
-
chosenYAxis = 'bottom';
|
|
233
|
-
} else {
|
|
234
|
-
chosenYAxis = topAlignment.contentHeight > bottomAlignment.contentHeight ? 'top' : 'bottom';
|
|
235
|
-
const chosenHeight = chosenYAxis === 'top' ? topAlignment.contentHeight : bottomAlignment.contentHeight;
|
|
236
|
-
contentHeight = chosenHeight !== height ? chosenHeight : null;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
let popoverTop;
|
|
241
|
-
|
|
242
|
-
if (chosenYAxis === 'middle') {
|
|
243
|
-
popoverTop = middleAlignment.popoverTop;
|
|
244
|
-
} else if (chosenYAxis === 'top') {
|
|
245
|
-
popoverTop = topAlignment.popoverTop;
|
|
246
|
-
} else {
|
|
247
|
-
popoverTop = bottomAlignment.popoverTop;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
return {
|
|
251
|
-
yAxis: chosenYAxis,
|
|
252
|
-
popoverTop,
|
|
253
|
-
contentHeight
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Utility used to compute the popover position and the content max width/height for a popover given
|
|
258
|
-
* its anchor rect and its content size.
|
|
259
|
-
*
|
|
260
|
-
* @param {Object} anchorRect Anchor Rect.
|
|
261
|
-
* @param {Object} contentSize Content Size.
|
|
262
|
-
* @param {string} position Position.
|
|
263
|
-
* @param {boolean} stickyBoundaryElement The boundary element to use when switching between
|
|
264
|
-
* sticky and normal position.
|
|
265
|
-
* @param {Element} anchorRef The anchor element.
|
|
266
|
-
* @param {number} relativeOffsetTop If applicable, top offset of the relative positioned
|
|
267
|
-
* parent container.
|
|
268
|
-
* @param {Element} boundaryElement Boundary element.
|
|
269
|
-
* @param {boolean} forcePosition Don't adjust position based on anchor.
|
|
270
|
-
* @param {boolean} forceXAlignment Don't adjust alignment based on YAxis
|
|
271
|
-
* @param {Element|null} editorWrapper Element that wraps the editor content. Used to access
|
|
272
|
-
* scroll position to determine sticky behavior.
|
|
273
|
-
* @return {Object} Popover position and constraints.
|
|
274
|
-
*/
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
function computePopoverPosition(anchorRect, contentSize) {
|
|
278
|
-
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'top';
|
|
279
|
-
let stickyBoundaryElement = arguments.length > 3 ? arguments[3] : undefined;
|
|
280
|
-
let anchorRef = arguments.length > 4 ? arguments[4] : undefined;
|
|
281
|
-
let relativeOffsetTop = arguments.length > 5 ? arguments[5] : undefined;
|
|
282
|
-
let boundaryElement = arguments.length > 6 ? arguments[6] : undefined;
|
|
283
|
-
let forcePosition = arguments.length > 7 ? arguments[7] : undefined;
|
|
284
|
-
let forceXAlignment = arguments.length > 8 ? arguments[8] : undefined;
|
|
285
|
-
let editorWrapper = arguments.length > 9 ? arguments[9] : undefined;
|
|
286
|
-
const [yAxis, xAxis = 'center', corner] = position.split(' ');
|
|
287
|
-
const yAxisPosition = computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition, editorWrapper);
|
|
288
|
-
const xAxisPosition = computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, yAxisPosition.yAxis, boundaryElement, forcePosition, forceXAlignment);
|
|
289
|
-
return { ...xAxisPosition,
|
|
290
|
-
...yAxisPosition
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Offsets the given rect by the position of the iframe that contains the
|
|
295
|
-
* element. If the owner document is not in an iframe then it returns with the
|
|
296
|
-
* original rect. If the popover container document and the anchor document are
|
|
297
|
-
* the same, the original rect will also be returned.
|
|
298
|
-
*
|
|
299
|
-
* @param {DOMRect} rect bounds of the element
|
|
300
|
-
* @param {Document} ownerDocument document of the element
|
|
301
|
-
* @param {Element} container The popover container to position.
|
|
302
|
-
*
|
|
303
|
-
* @return {DOMRect} offsetted bounds
|
|
304
|
-
*/
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
function offsetIframe(rect, ownerDocument, container) {
|
|
308
|
-
const {
|
|
309
|
-
defaultView
|
|
310
|
-
} = ownerDocument;
|
|
311
|
-
const {
|
|
312
|
-
frameElement
|
|
313
|
-
} = defaultView;
|
|
314
|
-
|
|
315
|
-
if (!frameElement || ownerDocument === container.ownerDocument) {
|
|
316
|
-
return rect;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
const iframeRect = frameElement.getBoundingClientRect();
|
|
320
|
-
return new defaultView.DOMRect(rect.left + iframeRect.left, rect.top + iframeRect.top, rect.width, rect.height);
|
|
321
|
-
}
|
|
322
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/popover/utils.js"],"names":["HEIGHT_OFFSET","computePopoverXAxisPosition","anchorRect","contentSize","xAxis","corner","stickyBoundaryElement","chosenYAxis","boundaryElement","forcePosition","forceXAlignment","width","anchorMidPoint","Math","round","left","centerAlignment","popoverLeft","contentWidth","window","innerWidth","leftAlignmentX","right","rightAlignmentX","leftAlignment","rightAlignment","chosenXAxis","chosenWidth","min","offsetLeft","offsetWidth","max","computePopoverYAxisPosition","yAxis","anchorRef","relativeOffsetTop","editorWrapper","height","stickyRect","getBoundingClientRect","stickyPositionTop","top","stickyPositionBottom","bottom","isRoomAboveInCanvas","scrollTop","popoverTop","middleAlignment","contentHeight","innerHeight","topAlignment","bottomAlignment","chosenHeight","computePopoverPosition","position","split","yAxisPosition","xAxisPosition","offsetIframe","rect","ownerDocument","container","defaultView","frameElement","iframeRect","DOMRect"],"mappings":";;;;;;;;;;AAIA;;AAJA;;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,aAAa,GAAG,EAAtB,C,CAA0B;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,2BAAT,CACNC,UADM,EAENC,WAFM,EAGNC,KAHM,EAINC,MAJM,EAKNC,qBALM,EAMNC,WANM,EAONC,eAPM,EAQNC,aARM,EASNC,eATM,EAUL;AACD,QAAM;AAAEC,IAAAA;AAAF,MAAYR,WAAlB,CADC,CAGD;;AACA,MAAKC,KAAK,KAAK,MAAV,IAAoB,kBAAzB,EAAmC;AAClCA,IAAAA,KAAK,GAAG,OAAR;AACA,GAFD,MAEO,IAAKA,KAAK,KAAK,OAAV,IAAqB,kBAA1B,EAAoC;AAC1CA,IAAAA,KAAK,GAAG,MAAR;AACA;;AAED,MAAKC,MAA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,eATgD,CAAjD;AAYA,SAAO,EACN,GAAG+C,aADG;AAEN,OAAGD;AAFG,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASE,YAAT,CAAuBC,IAAvB,EAA6BC,aAA7B,EAA4CC,SAA5C,EAAwD;AAC9D,QAAM;AAAEC,IAAAA;AAAF,MAAkBF,aAAxB;AACA,QAAM;AAAEG,IAAAA;AAAF,MAAmBD,WAAzB;;AAEA,MAAK,CAAEC,YAAF,IAAkBH,aAAa,KAAKC,SAAS,CAACD,aAAnD,EAAmE;AAClE,WAAOD,IAAP;AACA;;AAED,QAAMK,UAAU,GAAGD,YAAY,CAACxB,qBAAb,EAAnB;AACA,SAAO,IAAIuB,WAAW,CAACG,OAAhB,CACNN,IAAI,CAAC5C,IAAL,GAAYiD,UAAU,CAACjD,IADjB,EAEN4C,IAAI,CAAClB,GAAL,GAAWuB,UAAU,CAACvB,GAFhB,EAGNkB,IAAI,CAAChD,KAHC,EAINgD,IAAI,CAACtB,MAJC,CAAP;AAMA","sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Module constants\n */\nconst HEIGHT_OFFSET = 10; // Used by the arrow and a bit of empty space.\n\n/**\n * Utility used to compute the popover position over the xAxis\n *\n * @param {Object} anchorRect Anchor Rect.\n * @param {Object} contentSize Content Size.\n * @param {string} xAxis Desired xAxis.\n * @param {string} corner Desired corner.\n * @param {boolean} stickyBoundaryElement The boundary element to use when\n * switching between sticky and normal\n * position.\n * @param {string} chosenYAxis yAxis to be used.\n * @param {Element} boundaryElement Boundary element.\n * @param {boolean} forcePosition Don't adjust position based on anchor.\n * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis\n *\n * @return {Object} Popover xAxis position and constraints.\n */\nexport function computePopoverXAxisPosition(\n\tanchorRect,\n\tcontentSize,\n\txAxis,\n\tcorner,\n\tstickyBoundaryElement,\n\tchosenYAxis,\n\tboundaryElement,\n\tforcePosition,\n\tforceXAlignment\n) {\n\tconst { width } = contentSize;\n\n\t// Correct xAxis for RTL support.\n\tif ( xAxis === 'left' && isRTL() ) {\n\t\txAxis = 'right';\n\t} else if ( xAxis === 'right' && isRTL() ) {\n\t\txAxis = 'left';\n\t}\n\n\tif ( corner === 'left' && isRTL() ) {\n\t\tcorner = 'right';\n\t} else if ( corner === 'right' && isRTL() ) {\n\t\tcorner = 'left';\n\t}\n\n\t// X axis alignment choices.\n\tconst anchorMidPoint = Math.round( anchorRect.left + anchorRect.width / 2 );\n\tconst centerAlignment = {\n\t\tpopoverLeft: anchorMidPoint,\n\t\tcontentWidth:\n\t\t\t( anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint ) +\n\t\t\t( anchorMidPoint + width / 2 > window.innerWidth\n\t\t\t\t? window.innerWidth - anchorMidPoint\n\t\t\t\t: width / 2 ),\n\t};\n\n\tlet leftAlignmentX = anchorRect.left;\n\n\tif ( corner === 'right' ) {\n\t\tleftAlignmentX = anchorRect.right;\n\t} else if ( chosenYAxis !== 'middle' && ! forceXAlignment ) {\n\t\tleftAlignmentX = anchorMidPoint;\n\t}\n\n\tlet rightAlignmentX = anchorRect.right;\n\n\tif ( corner === 'left' ) {\n\t\trightAlignmentX = anchorRect.left;\n\t} else if ( chosenYAxis !== 'middle' && ! forceXAlignment ) {\n\t\trightAlignmentX = anchorMidPoint;\n\t}\n\n\tconst leftAlignment = {\n\t\tpopoverLeft: leftAlignmentX,\n\t\tcontentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX,\n\t};\n\tconst rightAlignment = {\n\t\tpopoverLeft: rightAlignmentX,\n\t\tcontentWidth:\n\t\t\trightAlignmentX + width > window.innerWidth\n\t\t\t\t? window.innerWidth - rightAlignmentX\n\t\t\t\t: width,\n\t};\n\n\t// Choosing the x axis.\n\tlet chosenXAxis = xAxis;\n\tlet contentWidth = null;\n\n\tif ( ! stickyBoundaryElement && ! forcePosition ) {\n\t\tif ( xAxis === 'center' && centerAlignment.contentWidth === width ) {\n\t\t\tchosenXAxis = 'center';\n\t\t} else if ( xAxis === 'left' && leftAlignment.contentWidth === width ) {\n\t\t\tchosenXAxis = 'left';\n\t\t} else if (\n\t\t\txAxis === 'right' &&\n\t\t\trightAlignment.contentWidth === width\n\t\t) {\n\t\t\tchosenXAxis = 'right';\n\t\t} else {\n\t\t\tchosenXAxis =\n\t\t\t\tleftAlignment.contentWidth > rightAlignment.contentWidth\n\t\t\t\t\t? 'left'\n\t\t\t\t\t: 'right';\n\t\t\tconst chosenWidth =\n\t\t\t\tchosenXAxis === 'left'\n\t\t\t\t\t? leftAlignment.contentWidth\n\t\t\t\t\t: rightAlignment.contentWidth;\n\n\t\t\t// Limit width of the content to the viewport width\n\t\t\tif ( width > window.innerWidth ) {\n\t\t\t\tcontentWidth = window.innerWidth;\n\t\t\t}\n\n\t\t\t// If we can't find any alignment options that could fit\n\t\t\t// our content, then let's fallback to the center of the viewport.\n\t\t\tif ( chosenWidth !== width ) {\n\t\t\t\tchosenXAxis = 'center';\n\t\t\t\tcenterAlignment.popoverLeft = window.innerWidth / 2;\n\t\t\t}\n\t\t}\n\t}\n\n\tlet popoverLeft;\n\tif ( chosenXAxis === 'center' ) {\n\t\tpopoverLeft = centerAlignment.popoverLeft;\n\t} else if ( chosenXAxis === 'left' ) {\n\t\tpopoverLeft = leftAlignment.popoverLeft;\n\t} else {\n\t\tpopoverLeft = rightAlignment.popoverLeft;\n\t}\n\n\tif ( boundaryElement ) {\n\t\tpopoverLeft = Math.min(\n\t\t\tpopoverLeft,\n\t\t\tboundaryElement.offsetLeft + boundaryElement.offsetWidth - width\n\t\t);\n\n\t\t// Avoid the popover being position beyond the left boundary if the\n\t\t// direction is left to right.\n\t\tif ( ! isRTL() ) {\n\t\t\tpopoverLeft = Math.max( popoverLeft, 0 );\n\t\t}\n\t}\n\n\treturn {\n\t\txAxis: chosenXAxis,\n\t\tpopoverLeft,\n\t\tcontentWidth,\n\t};\n}\n\n/**\n * Utility used to compute the popover position over the yAxis\n *\n * @param {Object} anchorRect Anchor Rect.\n * @param {Object} contentSize Content Size.\n * @param {string} yAxis Desired yAxis.\n * @param {string} corner Desired corner.\n * @param {boolean} stickyBoundaryElement The boundary element to use when switching between sticky\n * and normal position.\n * @param {Element} anchorRef The anchor element.\n * @param {Element} relativeOffsetTop If applicable, top offset of the relative positioned\n * parent container.\n * @param {boolean} forcePosition Don't adjust position based on anchor.\n * @param {Element|null} editorWrapper Element that wraps the editor content. Used to access\n * scroll position to determine sticky behavior.\n * @return {Object} Popover xAxis position and constraints.\n */\nexport function computePopoverYAxisPosition(\n\tanchorRect,\n\tcontentSize,\n\tyAxis,\n\tcorner,\n\tstickyBoundaryElement,\n\tanchorRef,\n\trelativeOffsetTop,\n\tforcePosition,\n\teditorWrapper\n) {\n\tconst { height } = contentSize;\n\n\tif ( stickyBoundaryElement ) {\n\t\tconst stickyRect = stickyBoundaryElement.getBoundingClientRect();\n\t\tconst stickyPositionTop = stickyRect.top + height - relativeOffsetTop;\n\t\tconst stickyPositionBottom =\n\t\t\tstickyRect.bottom - height - relativeOffsetTop;\n\n\t\tif ( anchorRect.top <= stickyPositionTop ) {\n\t\t\tif ( editorWrapper ) {\n\t\t\t\t// If a popover cannot be positioned above the anchor, even after scrolling, we must\n\t\t\t\t// ensure we use the bottom position instead of the popover slot. This prevents the\n\t\t\t\t// popover from always restricting block content and interaction while selected if the\n\t\t\t\t// block is near the top of the site editor.\n\n\t\t\t\tconst isRoomAboveInCanvas =\n\t\t\t\t\theight + HEIGHT_OFFSET <\n\t\t\t\t\teditorWrapper.scrollTop + anchorRect.top;\n\t\t\t\tif ( ! isRoomAboveInCanvas ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tyAxis: 'bottom',\n\t\t\t\t\t\t// If the bottom of the block is also below the bottom sticky position (ex -\n\t\t\t\t\t\t// block is also taller than the editor window), return the bottom sticky\n\t\t\t\t\t\t// position instead. We do this instead of the top sticky position both to\n\t\t\t\t\t\t// allow a smooth transition and more importantly to ensure every section of\n\t\t\t\t\t\t// the block can be free from popover obscuration at some point in the\n\t\t\t\t\t\t// scroll position.\n\t\t\t\t\t\tpopoverTop: Math.min(\n\t\t\t\t\t\t\tanchorRect.bottom,\n\t\t\t\t\t\t\tstickyPositionBottom\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\t// Default sticky behavior.\n\t\t\treturn {\n\t\t\t\tyAxis,\n\t\t\t\tpopoverTop: Math.min( anchorRect.bottom, stickyPositionTop ),\n\t\t\t};\n\t\t}\n\t}\n\n\t// Y axis alignment choices.\n\tlet anchorMidPoint = anchorRect.top + anchorRect.height / 2;\n\n\tif ( corner === 'bottom' ) {\n\t\tanchorMidPoint = anchorRect.bottom;\n\t} else if ( corner === 'top' ) {\n\t\tanchorMidPoint = anchorRect.top;\n\t}\n\n\tconst middleAlignment = {\n\t\tpopoverTop: anchorMidPoint,\n\t\tcontentHeight:\n\t\t\t( anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint ) +\n\t\t\t( anchorMidPoint + height / 2 > window.innerHeight\n\t\t\t\t? window.innerHeight - anchorMidPoint\n\t\t\t\t: height / 2 ),\n\t};\n\n\tconst topAlignment = {\n\t\tpopoverTop: anchorRect.top,\n\t\tcontentHeight:\n\t\t\tanchorRect.top - HEIGHT_OFFSET - height > 0\n\t\t\t\t? height\n\t\t\t\t: anchorRect.top - HEIGHT_OFFSET,\n\t};\n\tconst bottomAlignment = {\n\t\tpopoverTop: anchorRect.bottom,\n\t\tcontentHeight:\n\t\t\tanchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight\n\t\t\t\t? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom\n\t\t\t\t: height,\n\t};\n\n\t// Choosing the y axis.\n\tlet chosenYAxis = yAxis;\n\tlet contentHeight = null;\n\n\tif ( ! stickyBoundaryElement && ! forcePosition ) {\n\t\tif ( yAxis === 'middle' && middleAlignment.contentHeight === height ) {\n\t\t\tchosenYAxis = 'middle';\n\t\t} else if ( yAxis === 'top' && topAlignment.contentHeight === height ) {\n\t\t\tchosenYAxis = 'top';\n\t\t} else if (\n\t\t\tyAxis === 'bottom' &&\n\t\t\tbottomAlignment.contentHeight === height\n\t\t) {\n\t\t\tchosenYAxis = 'bottom';\n\t\t} else {\n\t\t\tchosenYAxis =\n\t\t\t\ttopAlignment.contentHeight > bottomAlignment.contentHeight\n\t\t\t\t\t? 'top'\n\t\t\t\t\t: 'bottom';\n\t\t\tconst chosenHeight =\n\t\t\t\tchosenYAxis === 'top'\n\t\t\t\t\t? topAlignment.contentHeight\n\t\t\t\t\t: bottomAlignment.contentHeight;\n\t\t\tcontentHeight = chosenHeight !== height ? chosenHeight : null;\n\t\t}\n\t}\n\n\tlet popoverTop;\n\tif ( chosenYAxis === 'middle' ) {\n\t\tpopoverTop = middleAlignment.popoverTop;\n\t} else if ( chosenYAxis === 'top' ) {\n\t\tpopoverTop = topAlignment.popoverTop;\n\t} else {\n\t\tpopoverTop = bottomAlignment.popoverTop;\n\t}\n\n\treturn {\n\t\tyAxis: chosenYAxis,\n\t\tpopoverTop,\n\t\tcontentHeight,\n\t};\n}\n\n/**\n * Utility used to compute the popover position and the content max width/height for a popover given\n * its anchor rect and its content size.\n *\n * @param {Object} anchorRect Anchor Rect.\n * @param {Object} contentSize Content Size.\n * @param {string} position Position.\n * @param {boolean} stickyBoundaryElement The boundary element to use when switching between\n * sticky and normal position.\n * @param {Element} anchorRef The anchor element.\n * @param {number} relativeOffsetTop If applicable, top offset of the relative positioned\n * parent container.\n * @param {Element} boundaryElement Boundary element.\n * @param {boolean} forcePosition Don't adjust position based on anchor.\n * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis\n * @param {Element|null} editorWrapper Element that wraps the editor content. Used to access\n * scroll position to determine sticky behavior.\n * @return {Object} Popover position and constraints.\n */\nexport function computePopoverPosition(\n\tanchorRect,\n\tcontentSize,\n\tposition = 'top',\n\tstickyBoundaryElement,\n\tanchorRef,\n\trelativeOffsetTop,\n\tboundaryElement,\n\tforcePosition,\n\tforceXAlignment,\n\teditorWrapper\n) {\n\tconst [ yAxis, xAxis = 'center', corner ] = position.split( ' ' );\n\n\tconst yAxisPosition = computePopoverYAxisPosition(\n\t\tanchorRect,\n\t\tcontentSize,\n\t\tyAxis,\n\t\tcorner,\n\t\tstickyBoundaryElement,\n\t\tanchorRef,\n\t\trelativeOffsetTop,\n\t\tforcePosition,\n\t\teditorWrapper\n\t);\n\tconst xAxisPosition = computePopoverXAxisPosition(\n\t\tanchorRect,\n\t\tcontentSize,\n\t\txAxis,\n\t\tcorner,\n\t\tstickyBoundaryElement,\n\t\tyAxisPosition.yAxis,\n\t\tboundaryElement,\n\t\tforcePosition,\n\t\tforceXAlignment\n\t);\n\n\treturn {\n\t\t...xAxisPosition,\n\t\t...yAxisPosition,\n\t};\n}\n\n/**\n * Offsets the given rect by the position of the iframe that contains the\n * element. If the owner document is not in an iframe then it returns with the\n * original rect. If the popover container document and the anchor document are\n * the same, the original rect will also be returned.\n *\n * @param {DOMRect} rect bounds of the element\n * @param {Document} ownerDocument document of the element\n * @param {Element} container The popover container to position.\n *\n * @return {DOMRect} offsetted bounds\n */\nexport function offsetIframe( rect, ownerDocument, container ) {\n\tconst { defaultView } = ownerDocument;\n\tconst { frameElement } = defaultView;\n\n\tif ( ! frameElement || ownerDocument === container.ownerDocument ) {\n\t\treturn rect;\n\t}\n\n\tconst iframeRect = frameElement.getBoundingClientRect();\n\treturn new defaultView.DOMRect(\n\t\trect.left + iframeRect.left,\n\t\trect.top + iframeRect.top,\n\t\trect.width,\n\t\trect.height\n\t);\n}\n"]}
|