@wordpress/components 21.3.0 → 22.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +107 -1
- package/build/angle-picker-control/index.js +4 -2
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +28 -2
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/index.js +7 -3
- package/build/autocomplete/index.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js +63 -15
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control/hook.js +19 -3
- 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 -3
- 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 +3 -3
- 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 +18 -11
- 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 +3 -7
- package/build/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
- package/build/border-box-control/styles.js +34 -34
- package/build/border-box-control/styles.js.map +1 -1
- package/build/border-control/border-control/component.js +6 -5
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js +22 -5
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +1 -1
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/hook.js +15 -7
- package/build/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build/border-control/styles.js +19 -34
- package/build/border-control/styles.js.map +1 -1
- package/build/box-control/index.js +6 -2
- package/build/box-control/index.js.map +1 -1
- package/build/circular-option-picker/index.js +14 -14
- package/build/circular-option-picker/index.js.map +1 -1
- package/build/color-palette/index.js +84 -31
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/styles.js +3 -3
- package/build/color-palette/styles.js.map +1 -1
- package/build/color-palette/types.js +6 -0
- package/build/color-palette/types.js.map +1 -0
- package/build/color-picker/input-with-slider.js +18 -4
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/index.js +1 -3
- package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build/custom-select-control/index.js +12 -5
- package/build/custom-select-control/index.js.map +1 -1
- package/build/dashicon/index.js +17 -2
- package/build/dashicon/index.js.map +1 -1
- package/build/date-time/date-time/index.js +2 -0
- package/build/date-time/date-time/index.js.map +1 -1
- package/build/date-time/time/index.js +4 -4
- package/build/date-time/time/index.js.map +1 -1
- package/build/disabled/index.js +8 -1
- package/build/disabled/index.js.map +1 -1
- package/build/draggable/index.js +58 -38
- package/build/draggable/index.js.map +1 -1
- package/build/draggable/types.js +6 -0
- package/build/draggable/types.js.map +1 -0
- package/build/external-link/index.js +13 -2
- package/build/external-link/index.js.map +1 -1
- package/build/flex/flex/hook.js +2 -3
- package/build/flex/flex/hook.js.map +1 -1
- package/build/focal-point-picker/focal-point.js +2 -12
- package/build/focal-point-picker/focal-point.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-style.js +11 -51
- package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build/focusable-iframe/index.js +0 -1
- package/build/focusable-iframe/index.js.map +1 -1
- package/build/font-size-picker/constants.js +41 -0
- package/build/font-size-picker/constants.js.map +1 -0
- package/build/font-size-picker/font-size-picker-select.js +97 -0
- package/build/font-size-picker/font-size-picker-select.js.map +1 -0
- package/build/font-size-picker/font-size-picker-toggle-group.js +50 -0
- package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -0
- package/build/font-size-picker/index.js +86 -110
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/utils.js +16 -109
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/form-file-upload/index.js.map +1 -1
- package/build/form-token-field/index.js +9 -6
- package/build/form-token-field/index.js.map +1 -1
- package/build/higher-order/navigate-regions/index.js +3 -0
- package/build/higher-order/navigate-regions/index.js.map +1 -1
- package/build/higher-order/with-filters/index.js +1 -7
- package/build/higher-order/with-filters/index.js.map +1 -1
- package/build/icon/index.js +3 -2
- package/build/icon/index.js.map +1 -1
- package/build/index.js +15 -1
- package/build/index.js.map +1 -1
- package/build/input-control/index.js +2 -0
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js +1 -1
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +21 -21
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/isolated-event-container/index.js +5 -9
- package/build/isolated-event-container/index.js.map +1 -1
- package/build/item-group/styles.js +10 -10
- package/build/item-group/styles.js.map +1 -1
- package/build/menu-group/index.js +17 -3
- package/build/menu-group/index.js.map +1 -1
- package/build/menu-group/types.js +6 -0
- package/build/menu-group/types.js.map +1 -0
- package/build/navigator/navigator-screen/component.js +27 -17
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/number-control/index.js +82 -22
- package/build/number-control/index.js.map +1 -1
- package/build/number-control/styles/number-control-styles.js +36 -6
- package/build/number-control/styles/number-control-styles.js.map +1 -1
- package/build/palette-edit/index.js +3 -1
- package/build/palette-edit/index.js.map +1 -1
- package/build/popover/index.js +23 -33
- package/build/popover/index.js.map +1 -1
- package/build/radio-group/index.js +7 -1
- package/build/radio-group/index.js.map +1 -1
- package/build/{radio → radio-group/radio}/index.js +7 -1
- package/build/radio-group/radio/index.js.map +1 -0
- package/build/{radio-context → radio-group/radio-context}/index.js +0 -0
- package/build/radio-group/radio-context/index.js.map +1 -0
- package/build/range-control/styles/range-control-styles.js +47 -57
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/fill.js +9 -5
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot.js +13 -8
- package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/use-slot.js +15 -9
- package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
- package/build/slot-fill/fill.js +12 -4
- package/build/slot-fill/fill.js.map +1 -1
- package/build/slot-fill/use-slot.js +3 -1
- package/build/slot-fill/use-slot.js.map +1 -1
- package/build/snackbar/index.js +1 -1
- package/build/snackbar/index.js.map +1 -1
- package/build/spinner/styles.js +4 -4
- package/build/spinner/styles.js.map +1 -1
- package/build/tab-panel/index.js +4 -9
- package/build/tab-panel/index.js.map +1 -1
- package/build/text-control/index.js +0 -2
- package/build/text-control/index.js.map +1 -1
- package/build/toggle-control/index.js +15 -3
- package/build/toggle-control/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-button-group.js +90 -0
- package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -0
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js +90 -0
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -0
- package/build/toggle-group-control/toggle-group-control/component.js +22 -50
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +13 -8
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js +39 -17
- package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js +23 -23
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build/toolbar-dropdown-menu/index.js +1 -1
- package/build/toolbar-dropdown-menu/index.js.map +1 -1
- package/build/tools-panel/styles.js +14 -14
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +9 -5
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/ui/context/context-system-provider.js +9 -22
- package/build/ui/context/context-system-provider.js.map +1 -1
- package/build/unit-control/index.js +7 -9
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +15 -25
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/utils/colors-values.js +3 -2
- package/build/utils/colors-values.js.map +1 -1
- package/build/utils/config-values.js +0 -1
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/hooks/use-update-effect.js +5 -1
- package/build/utils/hooks/use-update-effect.js.map +1 -1
- package/build/utils/input/base.js +2 -2
- package/build/utils/input/base.js.map +1 -1
- package/build/view/index.js.map +1 -1
- package/build-module/angle-picker-control/index.js +3 -2
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +29 -3
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/index.js +7 -3
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +61 -13
- 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 +19 -3
- 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 -3
- 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 +3 -3
- 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 +19 -10
- 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 +4 -6
- package/build-module/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
- package/build-module/border-box-control/styles.js +26 -28
- package/build-module/border-box-control/styles.js.map +1 -1
- package/build-module/border-control/border-control/component.js +6 -5
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js +22 -5
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +1 -1
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/hook.js +15 -7
- package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build-module/border-control/styles.js +20 -36
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/box-control/index.js +6 -2
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/circular-option-picker/index.js +14 -14
- package/build-module/circular-option-picker/index.js.map +1 -1
- package/build-module/color-palette/index.js +82 -29
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/styles.js +3 -3
- package/build-module/color-palette/styles.js.map +1 -1
- package/build-module/color-palette/types.js +2 -0
- package/build-module/color-palette/types.js.map +1 -0
- package/build-module/color-picker/input-with-slider.js +18 -4
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -2
- package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build-module/custom-select-control/index.js +12 -5
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/dashicon/index.js +17 -2
- package/build-module/dashicon/index.js.map +1 -1
- package/build-module/date-time/date-time/index.js +2 -0
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/date-time/time/index.js +4 -4
- package/build-module/date-time/time/index.js.map +1 -1
- package/build-module/disabled/index.js +8 -1
- package/build-module/disabled/index.js.map +1 -1
- package/build-module/draggable/index.js +59 -38
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/draggable/types.js +2 -0
- package/build-module/draggable/types.js.map +1 -0
- package/build-module/external-link/index.js +13 -2
- package/build-module/external-link/index.js.map +1 -1
- package/build-module/flex/flex/hook.js +2 -3
- package/build-module/flex/flex/hook.js.map +1 -1
- package/build-module/focal-point-picker/focal-point.js +3 -13
- package/build-module/focal-point-picker/focal-point.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-style.js +6 -52
- package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build-module/focusable-iframe/index.js +0 -1
- package/build-module/focusable-iframe/index.js.map +1 -1
- package/build-module/font-size-picker/constants.js +31 -0
- package/build-module/font-size-picker/constants.js.map +1 -0
- package/build-module/font-size-picker/font-size-picker-select.js +83 -0
- package/build-module/font-size-picker/font-size-picker-select.js.map +1 -0
- package/build-module/font-size-picker/font-size-picker-toggle-group.js +40 -0
- package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -0
- package/build-module/font-size-picker/index.js +88 -111
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/utils.js +15 -105
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/form-file-upload/index.js.map +1 -1
- package/build-module/form-token-field/index.js +9 -6
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/higher-order/navigate-regions/index.js +3 -0
- package/build-module/higher-order/navigate-regions/index.js.map +1 -1
- package/build-module/higher-order/with-filters/index.js +1 -6
- package/build-module/higher-order/with-filters/index.js.map +1 -1
- package/build-module/icon/index.js +3 -2
- package/build-module/icon/index.js.map +1 -1
- package/build-module/index.js +3 -2
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/index.js +2 -0
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +1 -1
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +21 -21
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/isolated-event-container/index.js +7 -9
- package/build-module/isolated-event-container/index.js.map +1 -1
- package/build-module/item-group/styles.js +10 -10
- package/build-module/item-group/styles.js.map +1 -1
- package/build-module/menu-group/index.js +20 -2
- package/build-module/menu-group/index.js.map +1 -1
- package/build-module/menu-group/types.js +2 -0
- package/build-module/menu-group/types.js.map +1 -0
- package/build-module/navigator/navigator-screen/component.js +27 -7
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/number-control/index.js +81 -26
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/number-control/styles/number-control-styles.js +30 -4
- package/build-module/number-control/styles/number-control-styles.js.map +1 -1
- package/build-module/palette-edit/index.js +3 -1
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/popover/index.js +23 -33
- package/build-module/popover/index.js.map +1 -1
- package/build-module/radio-group/index.js +6 -1
- package/build-module/radio-group/index.js.map +1 -1
- package/build-module/{radio → radio-group/radio}/index.js +6 -1
- package/build-module/radio-group/radio/index.js.map +1 -0
- package/build-module/{radio-context → radio-group/radio-context}/index.js +0 -0
- package/build-module/radio-group/radio-context/index.js.map +1 -0
- package/build-module/range-control/styles/range-control-styles.js +47 -57
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js +9 -5
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot.js +13 -8
- package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot.js +15 -9
- package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
- package/build-module/slot-fill/fill.js +12 -4
- package/build-module/slot-fill/fill.js.map +1 -1
- package/build-module/slot-fill/use-slot.js +3 -1
- package/build-module/slot-fill/use-slot.js.map +1 -1
- package/build-module/snackbar/index.js +1 -1
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/spinner/styles.js +4 -4
- package/build-module/spinner/styles.js.map +1 -1
- package/build-module/tab-panel/index.js +5 -10
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/text-control/index.js +0 -2
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/toggle-control/index.js +15 -3
- package/build-module/toggle-control/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-button-group.js +76 -0
- package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -0
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +75 -0
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -0
- package/build-module/toggle-group-control/toggle-group-control/component.js +20 -49
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +13 -6
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +39 -17
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +21 -18
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build-module/toolbar-dropdown-menu/index.js +1 -1
- package/build-module/toolbar-dropdown-menu/index.js.map +1 -1
- package/build-module/tools-panel/styles.js +14 -14
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +9 -5
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/ui/context/context-system-provider.js +6 -20
- package/build-module/ui/context/context-system-provider.js.map +1 -1
- package/build-module/unit-control/index.js +8 -10
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +8 -24
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/utils/colors-values.js +3 -2
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-module/utils/config-values.js +0 -1
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/hooks/use-update-effect.js +5 -1
- package/build-module/utils/hooks/use-update-effect.js.map +1 -1
- package/build-module/utils/input/base.js +2 -2
- package/build-module/utils/input/base.js.map +1 -1
- package/build-module/view/index.js.map +1 -1
- package/build-style/style-rtl.css +93 -85
- package/build-style/style.css +91 -83
- package/build-types/base-field/hook.d.ts +11 -11
- package/build-types/border-box-control/border-box-control/component.d.ts +55 -6
- 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 +18 -17
- 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/component.d.ts +4 -2
- package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +12 -12
- 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 +3 -3
- 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 +17 -17
- 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/component.d.ts +3 -2
- package/build-types/border-box-control/border-box-control-visualizer/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +12 -12
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
- package/build-types/border-box-control/stories/index.d.ts +17 -0
- package/build-types/border-box-control/stories/index.d.ts.map +1 -0
- package/build-types/border-box-control/styles.d.ts +7 -6
- package/build-types/border-box-control/styles.d.ts.map +1 -1
- package/build-types/border-box-control/types.d.ts +5 -42
- package/build-types/border-box-control/types.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +4 -2
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +18 -18
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts +3 -3
- 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 +16 -16
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-style-picker/hook.d.ts +11 -11
- package/build-types/border-control/stories/index.d.ts +24 -12
- package/build-types/border-control/stories/index.d.ts.map +1 -1
- package/build-types/border-control/styles.d.ts +3 -3
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +10 -53
- package/build-types/border-control/types.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +12 -12
- package/build-types/card/card-body/hook.d.ts +12 -12
- package/build-types/card/card-divider/hook.d.ts +13 -13
- package/build-types/card/card-footer/hook.d.ts +12 -12
- package/build-types/card/card-header/hook.d.ts +12 -12
- package/build-types/card/card-media/hook.d.ts +12 -12
- package/build-types/card/stories/index.d.ts.map +1 -1
- package/build-types/circular-option-picker/index.d.ts +4 -24
- package/build-types/circular-option-picker/index.d.ts.map +1 -1
- package/build-types/color-palette/index.d.ts +43 -14
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.d.ts +50 -0
- package/build-types/color-palette/stories/index.d.ts.map +1 -0
- package/build-types/color-palette/styles.d.ts +3 -2
- package/build-types/color-palette/styles.d.ts.map +1 -1
- package/build-types/color-palette/test/index.d.ts +2 -0
- package/build-types/color-palette/test/index.d.ts.map +1 -0
- package/build-types/color-palette/types.d.ts +90 -0
- package/build-types/color-palette/types.d.ts.map +1 -0
- package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +5 -4
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/confirm-dialog/component.d.ts +4 -4
- package/build-types/custom-select-control/index.d.ts +1 -12
- package/build-types/custom-select-control/index.d.ts.map +1 -1
- package/build-types/custom-select-control/styles.d.ts +3 -1
- package/build-types/custom-select-control/styles.d.ts.map +1 -1
- package/build-types/dashicon/index.d.ts +6 -1
- package/build-types/dashicon/index.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +3 -3
- package/build-types/date-time/date-time/index.d.ts +2 -0
- package/build-types/date-time/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/date-time/styles.d.ts +3 -3
- package/build-types/date-time/stories/date-time.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts +8 -4
- package/build-types/date-time/time/styles.d.ts.map +1 -1
- package/build-types/date-time/types.d.ts +0 -16
- package/build-types/date-time/types.d.ts.map +1 -1
- package/build-types/disabled/index.d.ts +8 -1
- package/build-types/disabled/index.d.ts.map +1 -1
- package/build-types/draggable/index.d.ts +42 -66
- package/build-types/draggable/index.d.ts.map +1 -1
- package/build-types/draggable/stories/index.d.ts +12 -0
- package/build-types/draggable/stories/index.d.ts.map +1 -0
- package/build-types/draggable/types.d.ts +58 -0
- package/build-types/draggable/types.d.ts.map +1 -0
- package/build-types/elevation/hook.d.ts +12 -12
- package/build-types/external-link/index.d.ts.map +1 -1
- package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
- package/build-types/external-link/test/index.d.ts +2 -0
- package/build-types/external-link/test/index.d.ts.map +1 -0
- package/build-types/flex/flex/hook.d.ts +12 -12
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/flex/flex-block/hook.d.ts +12 -12
- package/build-types/flex/flex-item/hook.d.ts +12 -12
- package/build-types/focal-point-picker/focal-point.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -2
- package/build-types/focal-point-picker/styles/focal-point-style.d.ts +1 -12
- package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
- package/build-types/focusable-iframe/index.d.ts.map +1 -1
- package/build-types/font-size-picker/constants.d.ts +15 -0
- package/build-types/font-size-picker/constants.d.ts.map +1 -0
- package/build-types/font-size-picker/font-size-picker-select.d.ts +5 -0
- package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -0
- package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts +5 -0
- package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -0
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/types.d.ts +14 -14
- package/build-types/font-size-picker/types.d.ts.map +1 -1
- package/build-types/font-size-picker/utils.d.ts +6 -26
- package/build-types/font-size-picker/utils.d.ts.map +1 -1
- package/build-types/form-file-upload/index.d.ts.map +1 -1
- package/build-types/form-file-upload/types.d.ts +5 -4
- package/build-types/form-file-upload/types.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +12 -12
- package/build-types/h-stack/component.d.ts +1 -1
- package/build-types/h-stack/hook.d.ts +12 -12
- package/build-types/heading/hook.d.ts +12 -12
- package/build-types/icon/index.d.ts +1 -1
- package/build-types/icon/index.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts +1 -1
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-base.d.ts +5 -2
- package/build-types/input-control/input-base.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +3 -8
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/input-control/utils.d.ts +1 -1
- package/build-types/isolated-event-container/index.d.ts +3 -2
- package/build-types/isolated-event-container/index.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +13 -13
- package/build-types/item-group/item-group/hook.d.ts +13 -13
- package/build-types/menu-group/index.d.ts +21 -1
- package/build-types/menu-group/index.d.ts.map +1 -1
- package/build-types/menu-group/test/index.d.ts +2 -0
- package/build-types/menu-group/test/index.d.ts.map +1 -0
- package/build-types/menu-group/types.d.ts +23 -0
- package/build-types/menu-group/types.d.ts.map +1 -0
- package/build-types/navigator/navigator-back-button/hook.d.ts +13 -13
- package/build-types/navigator/navigator-button/hook.d.ts +13 -13
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts +2 -4
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +5 -0
- package/build-types/number-control/styles/number-control-styles.d.ts.map +1 -1
- package/build-types/number-control/types.d.ts +12 -0
- package/build-types/number-control/types.d.ts.map +1 -1
- package/build-types/popover/index.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/e2e/index.d.ts +1 -1
- package/build-types/popover/stories/index.d.ts +2 -0
- package/build-types/popover/stories/index.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +18 -14
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/radio-group/index.d.ts +10 -0
- package/build-types/radio-group/index.d.ts.map +1 -0
- package/build-types/radio-group/radio/index.d.ts +7 -0
- package/build-types/radio-group/radio/index.d.ts.map +1 -0
- package/build-types/{radio-context → radio-group/radio-context}/index.d.ts +0 -0
- package/build-types/radio-group/radio-context/index.d.ts.map +1 -0
- package/build-types/range-control/index.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +2 -1
- package/build-types/range-control/styles/range-control-styles.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/label.d.ts +1 -1
- package/build-types/scrollable/hook.d.ts +12 -12
- package/build-types/search-control/index.d.ts +2 -2
- package/build-types/search-control/stories/index.d.ts +4 -4
- package/build-types/select-control/stories/index.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
- package/build-types/slot-fill/fill.d.ts.map +1 -1
- package/build-types/slot-fill/use-slot.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +12 -12
- package/build-types/spinner/index.d.ts +1 -1
- package/build-types/surface/hook.d.ts +12 -12
- package/build-types/tab-panel/index.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +12 -12
- package/build-types/text-control/index.d.ts +2 -4
- package/build-types/text-control/index.d.ts.map +1 -1
- package/build-types/text-control/stories/index.d.ts.map +1 -1
- package/build-types/toggle-control/index.d.ts.map +1 -1
- package/build-types/toggle-control/types.d.ts +2 -1
- package/build-types/toggle-control/types.d.ts.map +1 -1
- package/build-types/toggle-group-control/stories/index.d.ts +2 -2
- package/build-types/toggle-group-control/stories/index.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +6 -0
- package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -0
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +6 -0
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -0
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +1 -2
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +4 -7
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
- package/build-types/toggle-group-control/types.d.ts +21 -15
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +12 -12
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +12 -12
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +12 -12
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +12 -12
- package/build-types/ui/context/context-system-provider.d.ts.map +1 -1
- package/build-types/ui/control-group/hook.d.ts +12 -12
- package/build-types/ui/control-label/component.d.ts +1 -1
- package/build-types/ui/control-label/hook.d.ts +12 -12
- package/build-types/ui/form-group/form-group.d.ts +4 -4
- package/build-types/ui/form-group/use-form-group.d.ts +28 -28
- 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 +2 -5
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +3 -3
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/utils/colors-values.d.ts +1 -0
- package/build-types/utils/colors-values.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +0 -1
- package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
- package/build-types/utils/types.d.ts +0 -14
- package/build-types/utils/types.d.ts.map +1 -1
- package/build-types/v-stack/component.d.ts +2 -2
- package/build-types/v-stack/hook.d.ts +12 -12
- package/build-types/v-stack/stories/index.d.ts +2 -2
- package/build-types/view/index.d.ts +1 -1
- package/build-types/view/index.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/angle-picker-control/index.js +3 -2
- package/src/angle-picker-control/stories/index.js +3 -0
- package/src/autocomplete/autocompleter-ui.js +29 -2
- package/src/autocomplete/index.js +12 -3
- package/src/autocomplete/style.scss +1 -1
- package/src/autocomplete/test/index.js +89 -0
- package/src/base-field/test/__snapshots__/index.js.snap +9 -7
- package/src/base-field/test/index.js +27 -15
- package/src/border-box-control/border-box-control/README.md +13 -17
- package/src/border-box-control/border-box-control/component.tsx +64 -13
- package/src/border-box-control/border-box-control/hook.ts +25 -6
- package/src/border-box-control/border-box-control-linked-button/hook.ts +3 -6
- package/src/border-box-control/border-box-control-split-controls/component.tsx +3 -6
- package/src/border-box-control/border-box-control-split-controls/hook.ts +21 -14
- package/src/border-box-control/border-box-control-visualizer/hook.ts +4 -7
- package/src/border-box-control/stories/index.tsx +90 -0
- package/src/border-box-control/styles.ts +28 -22
- package/src/border-box-control/test/index.js +287 -122
- package/src/border-box-control/types.ts +32 -62
- package/src/border-control/border-control/README.md +12 -17
- package/src/border-control/border-control/component.tsx +5 -4
- package/src/border-control/border-control/hook.ts +20 -6
- package/src/border-control/border-control-dropdown/component.tsx +7 -6
- package/src/border-control/border-control-dropdown/hook.ts +14 -8
- package/src/border-control/stories/index.tsx +12 -14
- package/src/border-control/styles.ts +20 -23
- package/src/border-control/test/index.js +139 -96
- package/src/border-control/types.ts +43 -82
- package/src/box-control/README.md +14 -0
- package/src/box-control/index.js +4 -0
- package/src/box-control/stories/index.js +8 -27
- package/src/button/README.md +2 -15
- package/src/button/stories/index.js +109 -178
- package/src/button/style.scss +17 -54
- package/src/card/stories/index.tsx +27 -31
- package/src/card/test/__snapshots__/index.tsx.snap +98 -401
- package/src/card/test/index.tsx +4 -8
- package/src/checkbox-control/style.scss +3 -3
- package/src/circular-option-picker/index.js +14 -20
- package/src/color-palette/README.md +47 -49
- package/src/color-palette/{index.js → index.tsx} +132 -51
- package/src/color-palette/stories/{index.js → index.tsx} +38 -27
- package/src/color-palette/style.scss +3 -3
- package/src/color-palette/{styles.js → styles.ts} +0 -0
- package/src/color-palette/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/color-palette/test/{index.js → index.tsx} +1 -1
- package/src/color-palette/types.ts +97 -0
- package/src/color-picker/input-with-slider.tsx +14 -3
- package/src/custom-gradient-picker/gradient-bar/index.js +1 -3
- package/src/custom-select-control/README.md +14 -0
- package/src/custom-select-control/index.js +29 -15
- package/src/custom-select-control/stories/index.js +1 -0
- package/src/custom-select-control/style.scss +6 -1
- package/src/custom-select-control/test/index.js +39 -0
- package/src/dashicon/index.js +21 -2
- package/src/date-time/date/test/index.tsx +2 -2
- package/src/date-time/date-time/index.tsx +2 -0
- package/src/date-time/stories/date-time.tsx +4 -0
- package/src/date-time/time/index.tsx +4 -4
- package/src/date-time/types.ts +0 -19
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -0
- package/src/disabled/README.md +2 -0
- package/src/disabled/index.tsx +8 -1
- package/src/disabled/test/index.tsx +0 -5
- package/src/divider/test/index.tsx +4 -4
- package/src/draggable/README.md +13 -18
- package/src/draggable/{index.js → index.tsx} +71 -47
- package/src/draggable/stories/index.tsx +83 -0
- package/src/draggable/types.ts +58 -0
- package/src/drop-zone/style.scss +1 -1
- package/src/external-link/index.tsx +14 -6
- package/src/external-link/test/index.tsx +106 -0
- package/src/flex/flex/hook.ts +0 -3
- package/src/flex/test/index.tsx +29 -3
- package/src/focal-point-picker/focal-point.tsx +2 -24
- package/src/focal-point-picker/styles/focal-point-style.ts +8 -32
- package/src/focusable-iframe/index.js +0 -1
- package/src/font-size-picker/README.md +3 -3
- package/src/font-size-picker/constants.ts +37 -0
- package/src/font-size-picker/font-size-picker-select.tsx +98 -0
- package/src/font-size-picker/font-size-picker-toggle-group.tsx +41 -0
- package/src/font-size-picker/index.tsx +161 -214
- package/src/font-size-picker/test/index.tsx +653 -171
- package/src/font-size-picker/test/utils.ts +56 -140
- package/src/font-size-picker/types.ts +26 -17
- package/src/font-size-picker/utils.ts +16 -124
- package/src/form-file-upload/README.md +1 -3
- package/src/form-file-upload/index.tsx +1 -0
- package/src/form-file-upload/types.ts +5 -4
- package/src/form-toggle/style.scss +3 -3
- package/src/form-toggle/test/__snapshots__/index.tsx.snap +15 -13
- package/src/form-toggle/test/index.tsx +1 -1
- package/src/form-token-field/index.tsx +13 -5
- package/src/form-token-field/style.scss +2 -2
- package/src/form-token-field/test/index.tsx +6 -6
- package/src/h-stack/test/__snapshots__/index.tsx.snap +36 -30
- package/src/h-stack/test/index.tsx +3 -3
- package/src/higher-order/navigate-regions/index.js +4 -0
- package/src/higher-order/navigate-regions/style.scss +72 -20
- package/src/higher-order/with-filters/index.js +4 -9
- package/src/higher-order/with-notices/test/index.js +1 -1
- package/src/icon/index.tsx +3 -2
- package/src/icon/test/index.js +10 -0
- package/src/index.js +3 -1
- package/src/input-control/index.tsx +2 -0
- package/src/input-control/input-base.tsx +3 -3
- package/src/input-control/styles/input-control-styles.tsx +1 -0
- package/src/input-control/types.ts +4 -11
- package/src/isolated-event-container/index.tsx +32 -0
- package/src/item-group/stories/index.js +1 -1
- package/src/item-group/styles.ts +1 -1
- package/src/item-group/test/__snapshots__/index.js.snap +90 -85
- package/src/item-group/test/index.js +7 -17
- package/src/menu-group/{index.js → index.tsx} +22 -3
- package/src/menu-group/test/{index.js → index.tsx} +0 -0
- package/src/menu-group/types.ts +23 -0
- package/src/menu-item/style.scss +1 -1
- package/src/mobile/bottom-sheet/test/range-cell.native.js +4 -4
- package/src/mobile/html-text-input/test/index.native.js +2 -2
- package/src/mobile/link-settings/test/edit.native.js +29 -29
- package/src/mobile/link-settings/test/link-settings-navigation.native.js +5 -5
- package/src/navigator/navigator-screen/component.tsx +28 -6
- package/src/notice/README.md +2 -1
- package/src/notice/style.scss +1 -1
- package/src/number-control/README.md +9 -4
- package/src/number-control/index.tsx +100 -33
- package/src/number-control/styles/number-control-styles.js +26 -1
- package/src/number-control/test/index.js +50 -0
- package/src/number-control/types.ts +12 -0
- package/src/palette-edit/index.js +3 -0
- package/src/panel/style.scss +1 -1
- package/src/popover/README.md +12 -7
- package/src/popover/index.tsx +38 -37
- package/src/popover/stories/index.tsx +29 -1
- package/src/popover/style.scss +9 -0
- package/src/popover/types.ts +18 -15
- package/src/radio-group/README.md +4 -0
- package/src/radio-group/index.js +6 -1
- package/src/{radio → radio-group/radio}/index.js +6 -1
- package/src/{radio-context → radio-group/radio-context}/index.js +0 -0
- package/src/radio-group/stories/index.js +11 -2
- package/src/range-control/styles/range-control-styles.ts +2 -2
- package/src/resizable-box/style.scss +2 -2
- package/src/sandbox/test/index.js +2 -2
- package/src/scrollable/test/index.tsx +7 -3
- package/src/search-control/style.scss +1 -1
- package/src/select-control/stories/index.tsx +9 -4
- package/src/slot-fill/bubbles-virtually/fill.js +5 -5
- package/src/slot-fill/bubbles-virtually/slot.js +10 -8
- package/src/slot-fill/bubbles-virtually/use-slot.js +15 -9
- package/src/slot-fill/fill.js +12 -2
- package/src/slot-fill/use-slot.js +3 -0
- package/src/snackbar/index.js +1 -1
- package/src/snackbar/style.scss +2 -2
- package/src/spacer/test/index.tsx +33 -3
- package/src/spinner/styles.ts +1 -1
- package/src/surface/test/__snapshots__/index.tsx.snap +58 -46
- package/src/surface/test/index.tsx +12 -22
- package/src/tab-panel/index.tsx +10 -8
- package/src/tab-panel/style.scss +4 -5
- package/src/tab-panel/test/index.tsx +78 -1
- package/src/text/test/__snapshots__/index.tsx.snap +19 -15
- package/src/text/test/index.tsx +6 -6
- package/src/text-control/index.tsx +0 -2
- package/src/text-control/stories/index.tsx +5 -6
- package/src/toggle-control/README.md +6 -4
- package/src/toggle-control/index.tsx +13 -2
- package/src/toggle-control/types.ts +2 -4
- package/src/toggle-group-control/stories/index.tsx +6 -4
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +221 -164
- package/src/toggle-group-control/test/index.tsx +156 -17
- package/src/toggle-group-control/toggle-group-control/README.md +8 -1
- package/src/toggle-group-control/toggle-group-control/as-button-group.tsx +103 -0
- package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +99 -0
- package/src/toggle-group-control/toggle-group-control/component.tsx +29 -74
- package/src/toggle-group-control/toggle-group-control/styles.ts +23 -15
- package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +49 -25
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +39 -19
- package/src/toggle-group-control/types.ts +76 -63
- package/src/toolbar-dropdown-menu/index.js +1 -1
- package/src/tools-panel/stories/index.js +0 -1
- package/src/tools-panel/stories/tools-panel-with-item-group-slot.js +0 -1
- package/src/tools-panel/styles.ts +1 -1
- package/src/tools-panel/tools-panel-item/hook.ts +6 -1
- package/src/tree-grid/test/__snapshots__/cell.js.snap +20 -18
- package/src/tree-grid/test/__snapshots__/roving-tab-index.js.snap +3 -1
- package/src/tree-grid/test/__snapshots__/row.js.snap +33 -29
- package/src/tree-grid/test/cell.js +1 -1
- package/src/tree-grid/test/index.js +12 -12
- package/src/tree-grid/test/roving-tab-index.js +1 -1
- package/src/tree-grid/test/row.js +2 -2
- package/src/truncate/test/index.tsx +9 -9
- package/src/ui/context/context-system-provider.js +5 -18
- package/src/ui/context/test/__snapshots__/context-system-provider.js.snap +23 -17
- package/src/ui/context/test/context-system-provider.js +3 -3
- package/src/ui/control-group/test/__snapshots__/index.js.snap +18 -16
- package/src/ui/control-group/test/index.js +1 -1
- package/src/ui/control-label/test/__snapshots__/index.js.snap +27 -21
- package/src/ui/control-label/test/index.js +3 -3
- package/src/ui/form-group/test/__snapshots__/index.js.snap +34 -30
- package/src/ui/form-group/test/index.js +18 -19
- package/src/ui/shortcut/test/__snapshots__/index.js.snap +1 -1
- package/src/ui/shortcut/test/index.js +1 -1
- package/src/ui/spinner/test/__snapshots__/index.js.snap +75 -73
- package/src/ui/spinner/test/index.js +3 -7
- package/src/unit-control/index.tsx +29 -30
- package/src/unit-control/styles/unit-control-styles.ts +6 -12
- package/src/unit-control/test/utils.ts +43 -0
- package/src/unit-control/types.ts +5 -6
- package/src/utils/colors-values.js +4 -2
- package/src/utils/config-values.js +0 -1
- package/src/utils/hooks/stories/use-cx.js +1 -1
- package/src/utils/hooks/use-update-effect.js +5 -1
- package/src/utils/input/base.js +2 -2
- package/src/utils/types.ts +0 -15
- package/src/v-stack/test/__snapshots__/index.tsx.snap +36 -30
- package/src/v-stack/test/index.tsx +3 -3
- package/src/view/{index.js → index.ts} +0 -0
- package/src/view/test/__snapshots__/index.js.snap +34 -24
- package/src/view/test/index.js +5 -5
- package/tsconfig.json +0 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/build/radio/index.js.map +0 -1
- package/build/radio-context/index.js.map +0 -1
- package/build-module/radio/index.js.map +0 -1
- package/build-module/radio-context/index.js.map +0 -1
- package/build-types/radio-context/index.d.ts.map +0 -1
- package/src/border-box-control/stories/index.js +0 -106
- package/src/draggable/stories/index.js +0 -72
- package/src/form-file-upload/stories/index.js +0 -51
- package/src/isolated-event-container/index.js +0 -28
- package/src/radio/stories/index.js +0 -20
package/build/draggable/index.js
CHANGED
|
@@ -3,12 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Draggable = Draggable;
|
|
7
|
+
exports.default = void 0;
|
|
7
8
|
|
|
8
9
|
var _element = require("@wordpress/element");
|
|
9
10
|
|
|
10
11
|
var _compose = require("@wordpress/compose");
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* External dependencies
|
|
15
|
+
*/
|
|
16
|
+
|
|
12
17
|
/**
|
|
13
18
|
* WordPress dependencies
|
|
14
19
|
*/
|
|
@@ -17,27 +22,43 @@ const cloneWrapperClass = 'components-draggable__clone';
|
|
|
17
22
|
const clonePadding = 0;
|
|
18
23
|
const bodyClass = 'is-dragging-components-draggable';
|
|
19
24
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*
|
|
40
|
-
*
|
|
25
|
+
* `Draggable` is a Component that provides a way to set up a cross-browser
|
|
26
|
+
* (including IE) customizable drag image and the transfer data for the drag
|
|
27
|
+
* event. It decouples the drag handle and the element to drag: use it by
|
|
28
|
+
* wrapping the component that will become the drag handle and providing the DOM
|
|
29
|
+
* ID of the element to drag.
|
|
30
|
+
*
|
|
31
|
+
* Note that the drag handle needs to declare the `draggable="true"` property
|
|
32
|
+
* and bind the `Draggable`s `onDraggableStart` and `onDraggableEnd` event
|
|
33
|
+
* handlers to its own `onDragStart` and `onDragEnd` respectively. `Draggable`
|
|
34
|
+
* takes care of the logic to setup the drag image and the transfer data, but is
|
|
35
|
+
* not concerned with creating an actual DOM element that is draggable.
|
|
36
|
+
*
|
|
37
|
+
* ```jsx
|
|
38
|
+
* import { Draggable, Panel, PanelBody } from '@wordpress/components';
|
|
39
|
+
* import { Icon, more } from '@wordpress/icons';
|
|
40
|
+
*
|
|
41
|
+
* const MyDraggable = () => (
|
|
42
|
+
* <div id="draggable-panel">
|
|
43
|
+
* <Panel header="Draggable panel">
|
|
44
|
+
* <PanelBody>
|
|
45
|
+
* <Draggable elementId="draggable-panel" transferData={ {} }>
|
|
46
|
+
* { ( { onDraggableStart, onDraggableEnd } ) => (
|
|
47
|
+
* <div
|
|
48
|
+
* className="example-drag-handle"
|
|
49
|
+
* draggable
|
|
50
|
+
* onDragStart={ onDraggableStart }
|
|
51
|
+
* onDragEnd={ onDraggableEnd }
|
|
52
|
+
* >
|
|
53
|
+
* <Icon icon={ more } />
|
|
54
|
+
* </div>
|
|
55
|
+
* ) }
|
|
56
|
+
* </Draggable>
|
|
57
|
+
* </PanelBody>
|
|
58
|
+
* </Panel>
|
|
59
|
+
* </div>
|
|
60
|
+
* );
|
|
61
|
+
* ```
|
|
41
62
|
*/
|
|
42
63
|
|
|
43
64
|
function Draggable(_ref) {
|
|
@@ -52,14 +73,12 @@ function Draggable(_ref) {
|
|
|
52
73
|
__experimentalTransferDataType: transferDataType = 'text',
|
|
53
74
|
__experimentalDragComponent: dragComponent
|
|
54
75
|
} = _ref;
|
|
55
|
-
|
|
56
|
-
/** @type {import('react').MutableRefObject<HTMLDivElement | null>} */
|
|
57
76
|
const dragComponentRef = (0, _element.useRef)(null);
|
|
58
77
|
const cleanup = (0, _element.useRef)(() => {});
|
|
59
78
|
/**
|
|
60
79
|
* Removes the element clone, resets cursor, and removes drag listener.
|
|
61
80
|
*
|
|
62
|
-
* @param
|
|
81
|
+
* @param event The non-custom DragEvent.
|
|
63
82
|
*/
|
|
64
83
|
|
|
65
84
|
function end(event) {
|
|
@@ -78,20 +97,19 @@ function Draggable(_ref) {
|
|
|
78
97
|
* - Sets transfer data.
|
|
79
98
|
* - Adds dragover listener.
|
|
80
99
|
*
|
|
81
|
-
* @param
|
|
100
|
+
* @param event The non-custom DragEvent.
|
|
82
101
|
*/
|
|
83
102
|
|
|
84
103
|
|
|
85
104
|
function start(event) {
|
|
86
|
-
// @ts-ignore We know that ownerDocument does exist on an Element
|
|
87
105
|
const {
|
|
88
106
|
ownerDocument
|
|
89
107
|
} = event.target;
|
|
90
108
|
event.dataTransfer.setData(transferDataType, JSON.stringify(transferData));
|
|
91
109
|
const cloneWrapper = ownerDocument.createElement('div'); // Reset position to 0,0. Natural stacking order will position this lower, even with a transform otherwise.
|
|
92
110
|
|
|
93
|
-
cloneWrapper.style.top = 0;
|
|
94
|
-
cloneWrapper.style.left = 0;
|
|
111
|
+
cloneWrapper.style.top = '0';
|
|
112
|
+
cloneWrapper.style.left = '0';
|
|
95
113
|
const dragImage = ownerDocument.createElement('div'); // Set a fake drag image to avoid browser defaults. Remove from DOM
|
|
96
114
|
// right after. event.dataTransfer.setDragImage is not supported yet in
|
|
97
115
|
// IE, we need to check for its existence first.
|
|
@@ -127,8 +145,8 @@ function Draggable(_ref) {
|
|
|
127
145
|
|
|
128
146
|
const elementRect = element.getBoundingClientRect();
|
|
129
147
|
const elementWrapper = element.parentNode;
|
|
130
|
-
const elementTopOffset =
|
|
131
|
-
const elementLeftOffset =
|
|
148
|
+
const elementTopOffset = elementRect.top;
|
|
149
|
+
const elementLeftOffset = elementRect.left;
|
|
132
150
|
cloneWrapper.style.width = `${elementRect.width + clonePadding * 2}px`;
|
|
133
151
|
const clone = element.cloneNode(true);
|
|
134
152
|
clone.id = `clone-${elementId}`; // Position clone right over the original element (20px padding).
|
|
@@ -137,18 +155,19 @@ function Draggable(_ref) {
|
|
|
137
155
|
y = elementTopOffset - clonePadding;
|
|
138
156
|
cloneWrapper.style.transform = `translate( ${x}px, ${y}px )`; // Hack: Remove iFrames as it's causing the embeds drag clone to freeze.
|
|
139
157
|
|
|
140
|
-
Array.from(clone.querySelectorAll('iframe')).forEach(child =>
|
|
158
|
+
Array.from(clone.querySelectorAll('iframe')).forEach(child => {
|
|
159
|
+
var _child$parentNode;
|
|
160
|
+
|
|
161
|
+
return (_child$parentNode = child.parentNode) === null || _child$parentNode === void 0 ? void 0 : _child$parentNode.removeChild(child);
|
|
162
|
+
});
|
|
141
163
|
cloneWrapper.appendChild(clone); // Inject the cloneWrapper into the DOM.
|
|
142
164
|
|
|
143
|
-
elementWrapper.appendChild(cloneWrapper);
|
|
165
|
+
elementWrapper === null || elementWrapper === void 0 ? void 0 : elementWrapper.appendChild(cloneWrapper);
|
|
144
166
|
} // Mark the current cursor coordinates.
|
|
145
167
|
|
|
146
168
|
|
|
147
169
|
let cursorLeft = event.clientX;
|
|
148
170
|
let cursorTop = event.clientY;
|
|
149
|
-
/**
|
|
150
|
-
* @param {import('react').DragEvent<Element>} e
|
|
151
|
-
*/
|
|
152
171
|
|
|
153
172
|
function over(e) {
|
|
154
173
|
// Skip doing any work if mouse has not moved.
|
|
@@ -179,8 +198,6 @@ function Draggable(_ref) {
|
|
|
179
198
|
// https://reactjs.org/docs/events.html#event-pooling
|
|
180
199
|
|
|
181
200
|
event.persist();
|
|
182
|
-
/** @type {number | undefined} */
|
|
183
|
-
|
|
184
201
|
let timerId;
|
|
185
202
|
|
|
186
203
|
if (onDragStart) {
|
|
@@ -218,4 +235,7 @@ function Draggable(_ref) {
|
|
|
218
235
|
ref: dragComponentRef
|
|
219
236
|
}, dragComponent));
|
|
220
237
|
}
|
|
238
|
+
|
|
239
|
+
var _default = Draggable;
|
|
240
|
+
exports.default = _default;
|
|
221
241
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/draggable/index.js"],"names":["dragImageClass","cloneWrapperClass","clonePadding","bodyClass","Draggable","children","onDragStart","onDragOver","onDragEnd","cloneClassname","elementId","transferData","__experimentalTransferDataType","transferDataType","__experimentalDragComponent","dragComponent","dragComponentRef","cleanup","end","event","preventDefault","current","start","ownerDocument","target","dataTransfer","setData","JSON","stringify","cloneWrapper","createElement","style","top","left","dragImage","setDragImage","classList","add","body","appendChild","x","y","clientX","clientY","transform","clonedDragComponent","innerHTML","element","getElementById","elementRect","getBoundingClientRect","elementWrapper","parentNode","elementTopOffset","parseInt","elementLeftOffset","width","clone","cloneNode","id","Array","from","querySelectorAll","forEach","child","removeChild","cursorLeft","cursorTop","over","e","nextX","nextY","throttledDragOver","addEventListener","persist","timerId","setTimeout","remove","removeEventListener","clearTimeout","onDraggableStart","onDraggableEnd","display"],"mappings":";;;;;;;AAIA;;AADA;;AAHA;AACA;AACA;AAIA,MAA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Y,CAACuB,UAAb,CAAwBa,WAAxB,CAAqCpC,YAArC;AACA;;AAED,UAAKK,SAAS,IAAIA,SAAS,CAACkB,UAA5B,EAAyC;AACxClB,QAAAA,SAAS,CAACkB,UAAV,CAAqBa,WAArB,CAAkC/B,SAAlC;AACA,OARsB,CAUvB;;;AACAX,MAAAA,aAAa,CAACe,IAAd,CAAmBF,SAAnB,CAA6ByC,MAA7B,CAAqC1E,SAArC;AAEAoB,MAAAA,aAAa,CAACuD,mBAAd,CAAmC,UAAnC,EAA+CN,iBAA/C;AAEAO,MAAAA,YAAY,CAAEJ,OAAF,CAAZ;AACA,KAhBD;AAiBA;;AAED,0BACC,MAAM,MAAM;AACX1D,IAAAA,OAAO,CAACI,OAAR;AACA,GAHF,EAIC,EAJD;AAOA,SACC,qDACGhB,QAAQ,CAAE;AACX2E,IAAAA,gBAAgB,EAAE1D,KADP;AAEX2D,IAAAA,cAAc,EAAE/D;AAFL,GAAF,CADX,EAKGH,aAAa,IACd;AACC,IAAA,SAAS,EAAC,0CADX;AAEC,IAAA,KAAK,EAAG;AAAEmE,MAAAA,OAAO,EAAE;AAAX,KAFT;AAGC,IAAA,GAAG,EAAGlE;AAHP,KAKGD,aALH,CANF,CADD;AAiBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { throttle } from '@wordpress/compose';\nimport { useEffect, useRef } from '@wordpress/element';\n\nconst dragImageClass = 'components-draggable__invisible-drag-image';\nconst cloneWrapperClass = 'components-draggable__clone';\nconst clonePadding = 0;\nconst bodyClass = 'is-dragging-components-draggable';\n\n/**\n * @typedef RenderProp\n * @property {(event: import('react').DragEvent) => void} onDraggableStart `onDragStart` handler.\n * @property {(event: import('react').DragEvent) => void} onDraggableEnd `onDragEnd` handler.\n */\n\n/**\n * @typedef Props\n * @property {(props: RenderProp) => JSX.Element | null} children Children.\n * @property {(event: import('react').DragEvent) => void} [onDragStart] Callback when dragging starts.\n * @property {(event: import('react').DragEvent) => void} [onDragOver] Callback when dragging happens over the document.\n * @property {(event: import('react').DragEvent) => void} [onDragEnd] Callback when dragging ends.\n * @property {string} [cloneClassname] Classname for the cloned element.\n * @property {string} [elementId] ID for the element.\n * @property {any} [transferData] Transfer data for the drag event.\n * @property {string} [__experimentalTransferDataType] The transfer data type to set.\n * @property {import('react').ReactNode} __experimentalDragComponent Component to show when dragging.\n */\n\n/**\n * @param {Props} props\n * @return {JSX.Element} A draggable component.\n */\nexport default function Draggable( {\n\tchildren,\n\tonDragStart,\n\tonDragOver,\n\tonDragEnd,\n\tcloneClassname,\n\telementId,\n\ttransferData,\n\t__experimentalTransferDataType: transferDataType = 'text',\n\t__experimentalDragComponent: dragComponent,\n} ) {\n\t/** @type {import('react').MutableRefObject<HTMLDivElement | null>} */\n\tconst dragComponentRef = useRef( null );\n\tconst cleanup = useRef( () => {} );\n\n\t/**\n\t * Removes the element clone, resets cursor, and removes drag listener.\n\t *\n\t * @param {import('react').DragEvent} event The non-custom DragEvent.\n\t */\n\tfunction end( event ) {\n\t\tevent.preventDefault();\n\t\tcleanup.current();\n\n\t\tif ( onDragEnd ) {\n\t\t\tonDragEnd( event );\n\t\t}\n\t}\n\n\t/**\n\t * This method does a couple of things:\n\t *\n\t * - Clones the current element and spawns clone over original element.\n\t * - Adds a fake temporary drag image to avoid browser defaults.\n\t * - Sets transfer data.\n\t * - Adds dragover listener.\n\t *\n\t * @param {import('react').DragEvent} event The non-custom DragEvent.\n\t */\n\tfunction start( event ) {\n\t\t// @ts-ignore We know that ownerDocument does exist on an Element\n\t\tconst { ownerDocument } = event.target;\n\n\t\tevent.dataTransfer.setData(\n\t\t\ttransferDataType,\n\t\t\tJSON.stringify( transferData )\n\t\t);\n\n\t\tconst cloneWrapper = ownerDocument.createElement( 'div' );\n\t\t// Reset position to 0,0. Natural stacking order will position this lower, even with a transform otherwise.\n\t\tcloneWrapper.style.top = 0;\n\t\tcloneWrapper.style.left = 0;\n\n\t\tconst dragImage = ownerDocument.createElement( 'div' );\n\n\t\t// Set a fake drag image to avoid browser defaults. Remove from DOM\n\t\t// right after. event.dataTransfer.setDragImage is not supported yet in\n\t\t// IE, we need to check for its existence first.\n\t\tif ( 'function' === typeof event.dataTransfer.setDragImage ) {\n\t\t\tdragImage.classList.add( dragImageClass );\n\t\t\townerDocument.body.appendChild( dragImage );\n\t\t\tevent.dataTransfer.setDragImage( dragImage, 0, 0 );\n\t\t}\n\n\t\tcloneWrapper.classList.add( cloneWrapperClass );\n\n\t\tif ( cloneClassname ) {\n\t\t\tcloneWrapper.classList.add( cloneClassname );\n\t\t}\n\n\t\tlet x = 0;\n\t\tlet y = 0;\n\t\t// If a dragComponent is defined, the following logic will clone the\n\t\t// HTML node and inject it into the cloneWrapper.\n\t\tif ( dragComponentRef.current ) {\n\t\t\t// Position dragComponent at the same position as the cursor.\n\t\t\tx = event.clientX;\n\t\t\ty = event.clientY;\n\t\t\tcloneWrapper.style.transform = `translate( ${ x }px, ${ y }px )`;\n\n\t\t\tconst clonedDragComponent = ownerDocument.createElement( 'div' );\n\t\t\tclonedDragComponent.innerHTML = dragComponentRef.current.innerHTML;\n\t\t\tcloneWrapper.appendChild( clonedDragComponent );\n\n\t\t\t// Inject the cloneWrapper into the DOM.\n\t\t\townerDocument.body.appendChild( cloneWrapper );\n\t\t} else {\n\t\t\tconst element = ownerDocument.getElementById( elementId );\n\n\t\t\t// Prepare element clone and append to element wrapper.\n\t\t\tconst elementRect = element.getBoundingClientRect();\n\t\t\tconst elementWrapper = element.parentNode;\n\t\t\tconst elementTopOffset = parseInt( elementRect.top, 10 );\n\t\t\tconst elementLeftOffset = parseInt( elementRect.left, 10 );\n\n\t\t\tcloneWrapper.style.width = `${\n\t\t\t\telementRect.width + clonePadding * 2\n\t\t\t}px`;\n\n\t\t\tconst clone = element.cloneNode( true );\n\t\t\tclone.id = `clone-${ elementId }`;\n\n\t\t\t// Position clone right over the original element (20px padding).\n\t\t\tx = elementLeftOffset - clonePadding;\n\t\t\ty = elementTopOffset - clonePadding;\n\t\t\tcloneWrapper.style.transform = `translate( ${ x }px, ${ y }px )`;\n\n\t\t\t// Hack: Remove iFrames as it's causing the embeds drag clone to freeze.\n\t\t\tArray.from( clone.querySelectorAll( 'iframe' ) ).forEach(\n\t\t\t\t( child ) => child.parentNode.removeChild( child )\n\t\t\t);\n\n\t\t\tcloneWrapper.appendChild( clone );\n\n\t\t\t// Inject the cloneWrapper into the DOM.\n\t\t\telementWrapper.appendChild( cloneWrapper );\n\t\t}\n\n\t\t// Mark the current cursor coordinates.\n\t\tlet cursorLeft = event.clientX;\n\t\tlet cursorTop = event.clientY;\n\n\t\t/**\n\t\t * @param {import('react').DragEvent<Element>} e\n\t\t */\n\t\tfunction over( e ) {\n\t\t\t// Skip doing any work if mouse has not moved.\n\t\t\tif ( cursorLeft === e.clientX && cursorTop === e.clientY ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst nextX = x + e.clientX - cursorLeft;\n\t\t\tconst nextY = y + e.clientY - cursorTop;\n\t\t\tcloneWrapper.style.transform = `translate( ${ nextX }px, ${ nextY }px )`;\n\t\t\tcursorLeft = e.clientX;\n\t\t\tcursorTop = e.clientY;\n\t\t\tx = nextX;\n\t\t\ty = nextY;\n\t\t\tif ( onDragOver ) {\n\t\t\t\tonDragOver( e );\n\t\t\t}\n\t\t}\n\n\t\t// Aim for 60fps (16 ms per frame) for now. We can potentially use requestAnimationFrame (raf) instead,\n\t\t// note that browsers may throttle raf below 60fps in certain conditions.\n\t\t// @ts-ignore\n\t\tconst throttledDragOver = throttle( over, 16 );\n\n\t\townerDocument.addEventListener( 'dragover', throttledDragOver );\n\n\t\t// Update cursor to 'grabbing', document wide.\n\t\townerDocument.body.classList.add( bodyClass );\n\n\t\t// Allow the Synthetic Event to be accessed from asynchronous code.\n\t\t// https://reactjs.org/docs/events.html#event-pooling\n\t\tevent.persist();\n\n\t\t/** @type {number | undefined} */\n\t\tlet timerId;\n\n\t\tif ( onDragStart ) {\n\t\t\ttimerId = setTimeout( () => onDragStart( event ) );\n\t\t}\n\n\t\tcleanup.current = () => {\n\t\t\t// Remove drag clone.\n\t\t\tif ( cloneWrapper && cloneWrapper.parentNode ) {\n\t\t\t\tcloneWrapper.parentNode.removeChild( cloneWrapper );\n\t\t\t}\n\n\t\t\tif ( dragImage && dragImage.parentNode ) {\n\t\t\t\tdragImage.parentNode.removeChild( dragImage );\n\t\t\t}\n\n\t\t\t// Reset cursor.\n\t\t\townerDocument.body.classList.remove( bodyClass );\n\n\t\t\townerDocument.removeEventListener( 'dragover', throttledDragOver );\n\n\t\t\tclearTimeout( timerId );\n\t\t};\n\t}\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tcleanup.current();\n\t\t},\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ children( {\n\t\t\t\tonDraggableStart: start,\n\t\t\t\tonDraggableEnd: end,\n\t\t\t} ) }\n\t\t\t{ dragComponent && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"components-draggable-drag-component-root\"\n\t\t\t\t\tstyle={ { display: 'none' } }\n\t\t\t\t\tref={ dragComponentRef }\n\t\t\t\t>\n\t\t\t\t\t{ dragComponent }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/draggable/index.tsx"],"names":["dragImageClass","cloneWrapperClass","clonePadding","bodyClass","Draggable","children","onDragStart","onDragOver","onDragEnd","cloneClassname","elementId","transferData","__experimentalTransferDataType","transferDataType","__experimentalDragComponent","dragComponent","dragComponentRef","cleanup","end","event","preventDefault","current","start","ownerDocument","target","dataTransfer","setData","JSON","stringify","cloneWrapper","createElement","style","top","left","dragImage","setDragImage","classList","add","body","appendChild","x","y","clientX","clientY","transform","clonedDragComponent","innerHTML","element","getElementById","elementRect","getBoundingClientRect","elementWrapper","parentNode","elementTopOffset","elementLeftOffset","width","clone","cloneNode","id","Array","from","querySelectorAll","forEach","child","removeChild","cursorLeft","cursorTop","over","e","nextX","nextY","throttledDragOver","addEventListener","persist","timerId","setTimeout","remove","removeEventListener","clearTimeout","onDraggableStart","onDraggableEnd","display"],"mappings":";;;;;;;;AASA;;AADA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AASA,MAAMA,cAAc,GAAG,4CAAvB;AACA,MAAMC,iBAAiB,GAAG,6BAA1B;AACA,MAAMC,YAAY,GAAG,CAArB;AACA,MAAMC,SAAS,GAAG,kCAAlB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,SAAT,OAUa;AAAA,MAVO;AAC1BC,IAAAA,QAD0B;AAE1BC,IAAAA,WAF0B;AAG1BC,IAAAA,UAH0B;AAI1BC,IAAAA,SAJ0B;AAK1BC,IAAAA,cAL0B;AAM1BC,IAAAA,SAN0B;AAO1BC,IAAAA,YAP0B;AAQ1BC,IAAAA,8BAA8B,EAAEC,gBAAgB,GAAG,MARzB;AAS1BC,IAAAA,2BAA2B,EAAEC;AATH,GAUP;AACnB,QAAMC,gBAAgB,GAAG,qBAA0B,IAA1B,CAAzB;AACA,QAAMC,OAAO,GAAG,qBAAQ,MAAM,CAAE,CAAhB,CAAhB;AAEA;AACD;AACA;AACA;AACA;;AACC,WAASC,GAAT,CAAcC,KAAd,EAAiC;AAChCA,IAAAA,KAAK,CAACC,cAAN;AACAH,IAAAA,OAAO,CAACI,OAAR;;AAEA,QAAKb,SAAL,EAAiB;AAChBA,MAAAA,SAAS,CAAEW,KAAF,CAAT;AACA;AACD;AAED;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACC,WAASG,KAAT,CAAgBH,KAAhB,EAAmC;AAClC,UAAM;AAAEI,MAAAA;AAAF,QAAoBJ,KAAK,CAACK,MAAhC;AAEAL,IAAAA,KAAK,CAACM,YAAN,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AAU,CAAE,MAAMrE,WAAW,CAAEa,KAAF,CAAnB,CAApB;AACA;;AAEDF,IAAAA,OAAO,CAACI,OAAR,GAAkB,MAAM;AACvB;AACA,UAAKQ,YAAY,IAAIA,YAAY,CAACuB,UAAlC,EAA+C;AAC9CvB,QAAAA,YAAY,CAACuB,UAAb,CAAwBY,WAAxB,CAAqCnC,YAArC;AACA;;AAED,UAAKK,SAAS,IAAIA,SAAS,CAACkB,UAA5B,EAAyC;AACxClB,QAAAA,SAAS,CAACkB,UAAV,CAAqBY,WAArB,CAAkC9B,SAAlC;AACA,OARsB,CAUvB;;;AACAX,MAAAA,aAAa,CAACe,IAAd,CAAmBF,SAAnB,CAA6BwC,MAA7B,CAAqCzE,SAArC;AAEAoB,MAAAA,aAAa,CAACsD,mBAAd,CAAmC,UAAnC,EAA+CN,iBAA/C;AAEAO,MAAAA,YAAY,CAAEJ,OAAF,CAAZ;AACA,KAhBD;AAiBA;;AAED,0BACC,MAAM,MAAM;AACXzD,IAAAA,OAAO,CAACI,OAAR;AACA,GAHF,EAIC,EAJD;AAOA,SACC,qDACGhB,QAAQ,CAAE;AACX0E,IAAAA,gBAAgB,EAAEzD,KADP;AAEX0D,IAAAA,cAAc,EAAE9D;AAFL,GAAF,CADX,EAKGH,aAAa,IACd;AACC,IAAA,SAAS,EAAC,0CADX;AAEC,IAAA,KAAK,EAAG;AAAEkE,MAAAA,OAAO,EAAE;AAAX,KAFT;AAGC,IAAA,GAAG,EAAGjE;AAHP,KAKGD,aALH,CANF,CADD;AAiBA;;eAEcX,S","sourcesContent":["/**\n * External dependencies\n */\nimport type { DragEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { throttle } from '@wordpress/compose';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { DraggableProps } from './types';\n\nconst dragImageClass = 'components-draggable__invisible-drag-image';\nconst cloneWrapperClass = 'components-draggable__clone';\nconst clonePadding = 0;\nconst bodyClass = 'is-dragging-components-draggable';\n\n/**\n * `Draggable` is a Component that provides a way to set up a cross-browser\n * (including IE) customizable drag image and the transfer data for the drag\n * event. It decouples the drag handle and the element to drag: use it by\n * wrapping the component that will become the drag handle and providing the DOM\n * ID of the element to drag.\n *\n * Note that the drag handle needs to declare the `draggable=\"true\"` property\n * and bind the `Draggable`s `onDraggableStart` and `onDraggableEnd` event\n * handlers to its own `onDragStart` and `onDragEnd` respectively. `Draggable`\n * takes care of the logic to setup the drag image and the transfer data, but is\n * not concerned with creating an actual DOM element that is draggable.\n *\n * ```jsx\n * import { Draggable, Panel, PanelBody } from '@wordpress/components';\n * import { Icon, more } from '@wordpress/icons';\n *\n * const MyDraggable = () => (\n * <div id=\"draggable-panel\">\n * <Panel header=\"Draggable panel\">\n * <PanelBody>\n * <Draggable elementId=\"draggable-panel\" transferData={ {} }>\n * { ( { onDraggableStart, onDraggableEnd } ) => (\n * <div\n * className=\"example-drag-handle\"\n * draggable\n * onDragStart={ onDraggableStart }\n * onDragEnd={ onDraggableEnd }\n * >\n * <Icon icon={ more } />\n * </div>\n * ) }\n * </Draggable>\n * </PanelBody>\n * </Panel>\n * </div>\n * );\n * ```\n */\nexport function Draggable( {\n\tchildren,\n\tonDragStart,\n\tonDragOver,\n\tonDragEnd,\n\tcloneClassname,\n\telementId,\n\ttransferData,\n\t__experimentalTransferDataType: transferDataType = 'text',\n\t__experimentalDragComponent: dragComponent,\n}: DraggableProps ) {\n\tconst dragComponentRef = useRef< HTMLDivElement >( null );\n\tconst cleanup = useRef( () => {} );\n\n\t/**\n\t * Removes the element clone, resets cursor, and removes drag listener.\n\t *\n\t * @param event The non-custom DragEvent.\n\t */\n\tfunction end( event: DragEvent ) {\n\t\tevent.preventDefault();\n\t\tcleanup.current();\n\n\t\tif ( onDragEnd ) {\n\t\t\tonDragEnd( event );\n\t\t}\n\t}\n\n\t/**\n\t * This method does a couple of things:\n\t *\n\t * - Clones the current element and spawns clone over original element.\n\t * - Adds a fake temporary drag image to avoid browser defaults.\n\t * - Sets transfer data.\n\t * - Adds dragover listener.\n\t *\n\t * @param event The non-custom DragEvent.\n\t */\n\tfunction start( event: DragEvent ) {\n\t\tconst { ownerDocument } = event.target as HTMLElement;\n\n\t\tevent.dataTransfer.setData(\n\t\t\ttransferDataType,\n\t\t\tJSON.stringify( transferData )\n\t\t);\n\n\t\tconst cloneWrapper = ownerDocument.createElement( 'div' );\n\t\t// Reset position to 0,0. Natural stacking order will position this lower, even with a transform otherwise.\n\t\tcloneWrapper.style.top = '0';\n\t\tcloneWrapper.style.left = '0';\n\n\t\tconst dragImage = ownerDocument.createElement( 'div' );\n\n\t\t// Set a fake drag image to avoid browser defaults. Remove from DOM\n\t\t// right after. event.dataTransfer.setDragImage is not supported yet in\n\t\t// IE, we need to check for its existence first.\n\t\tif ( 'function' === typeof event.dataTransfer.setDragImage ) {\n\t\t\tdragImage.classList.add( dragImageClass );\n\t\t\townerDocument.body.appendChild( dragImage );\n\t\t\tevent.dataTransfer.setDragImage( dragImage, 0, 0 );\n\t\t}\n\n\t\tcloneWrapper.classList.add( cloneWrapperClass );\n\n\t\tif ( cloneClassname ) {\n\t\t\tcloneWrapper.classList.add( cloneClassname );\n\t\t}\n\n\t\tlet x = 0;\n\t\tlet y = 0;\n\t\t// If a dragComponent is defined, the following logic will clone the\n\t\t// HTML node and inject it into the cloneWrapper.\n\t\tif ( dragComponentRef.current ) {\n\t\t\t// Position dragComponent at the same position as the cursor.\n\t\t\tx = event.clientX;\n\t\t\ty = event.clientY;\n\t\t\tcloneWrapper.style.transform = `translate( ${ x }px, ${ y }px )`;\n\n\t\t\tconst clonedDragComponent = ownerDocument.createElement( 'div' );\n\t\t\tclonedDragComponent.innerHTML = dragComponentRef.current.innerHTML;\n\t\t\tcloneWrapper.appendChild( clonedDragComponent );\n\n\t\t\t// Inject the cloneWrapper into the DOM.\n\t\t\townerDocument.body.appendChild( cloneWrapper );\n\t\t} else {\n\t\t\tconst element = ownerDocument.getElementById(\n\t\t\t\telementId\n\t\t\t) as HTMLElement;\n\n\t\t\t// Prepare element clone and append to element wrapper.\n\t\t\tconst elementRect = element.getBoundingClientRect();\n\t\t\tconst elementWrapper = element.parentNode;\n\t\t\tconst elementTopOffset = elementRect.top;\n\t\t\tconst elementLeftOffset = elementRect.left;\n\n\t\t\tcloneWrapper.style.width = `${\n\t\t\t\telementRect.width + clonePadding * 2\n\t\t\t}px`;\n\n\t\t\tconst clone = element.cloneNode( true ) as HTMLElement;\n\t\t\tclone.id = `clone-${ elementId }`;\n\n\t\t\t// Position clone right over the original element (20px padding).\n\t\t\tx = elementLeftOffset - clonePadding;\n\t\t\ty = elementTopOffset - clonePadding;\n\t\t\tcloneWrapper.style.transform = `translate( ${ x }px, ${ y }px )`;\n\n\t\t\t// Hack: Remove iFrames as it's causing the embeds drag clone to freeze.\n\t\t\tArray.from< HTMLIFrameElement >(\n\t\t\t\tclone.querySelectorAll( 'iframe' )\n\t\t\t).forEach( ( child ) => child.parentNode?.removeChild( child ) );\n\n\t\t\tcloneWrapper.appendChild( clone );\n\n\t\t\t// Inject the cloneWrapper into the DOM.\n\t\t\telementWrapper?.appendChild( cloneWrapper );\n\t\t}\n\n\t\t// Mark the current cursor coordinates.\n\t\tlet cursorLeft = event.clientX;\n\t\tlet cursorTop = event.clientY;\n\n\t\tfunction over( e: DragEvent ) {\n\t\t\t// Skip doing any work if mouse has not moved.\n\t\t\tif ( cursorLeft === e.clientX && cursorTop === e.clientY ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst nextX = x + e.clientX - cursorLeft;\n\t\t\tconst nextY = y + e.clientY - cursorTop;\n\t\t\tcloneWrapper.style.transform = `translate( ${ nextX }px, ${ nextY }px )`;\n\t\t\tcursorLeft = e.clientX;\n\t\t\tcursorTop = e.clientY;\n\t\t\tx = nextX;\n\t\t\ty = nextY;\n\t\t\tif ( onDragOver ) {\n\t\t\t\tonDragOver( e );\n\t\t\t}\n\t\t}\n\n\t\t// Aim for 60fps (16 ms per frame) for now. We can potentially use requestAnimationFrame (raf) instead,\n\t\t// note that browsers may throttle raf below 60fps in certain conditions.\n\t\t// @ts-ignore\n\t\tconst throttledDragOver = throttle( over, 16 );\n\n\t\townerDocument.addEventListener( 'dragover', throttledDragOver );\n\n\t\t// Update cursor to 'grabbing', document wide.\n\t\townerDocument.body.classList.add( bodyClass );\n\n\t\t// Allow the Synthetic Event to be accessed from asynchronous code.\n\t\t// https://reactjs.org/docs/events.html#event-pooling\n\t\tevent.persist();\n\n\t\tlet timerId: number | undefined;\n\n\t\tif ( onDragStart ) {\n\t\t\ttimerId = setTimeout( () => onDragStart( event ) );\n\t\t}\n\n\t\tcleanup.current = () => {\n\t\t\t// Remove drag clone.\n\t\t\tif ( cloneWrapper && cloneWrapper.parentNode ) {\n\t\t\t\tcloneWrapper.parentNode.removeChild( cloneWrapper );\n\t\t\t}\n\n\t\t\tif ( dragImage && dragImage.parentNode ) {\n\t\t\t\tdragImage.parentNode.removeChild( dragImage );\n\t\t\t}\n\n\t\t\t// Reset cursor.\n\t\t\townerDocument.body.classList.remove( bodyClass );\n\n\t\t\townerDocument.removeEventListener( 'dragover', throttledDragOver );\n\n\t\t\tclearTimeout( timerId );\n\t\t};\n\t}\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tcleanup.current();\n\t\t},\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ children( {\n\t\t\t\tonDraggableStart: start,\n\t\t\t\tonDraggableEnd: end,\n\t\t\t} ) }\n\t\t\t{ dragComponent && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"components-draggable-drag-component-root\"\n\t\t\t\t\tstyle={ { display: 'none' } }\n\t\t\t\t\tref={ dragComponentRef }\n\t\t\t\t>\n\t\t\t\t\t{ dragComponent }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Draggable;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -42,17 +42,28 @@ function UnforwardedExternalLink(props, ref) {
|
|
|
42
42
|
} = props;
|
|
43
43
|
const optimizedRel = [...new Set([...rel.split(' '), 'external', 'noreferrer', 'noopener'].filter(Boolean))].join(' ');
|
|
44
44
|
const classes = (0, _classnames.default)('components-external-link', className);
|
|
45
|
-
/* Anchor links are
|
|
45
|
+
/* Anchor links are perceived as external links.
|
|
46
46
|
This constant helps check for on page anchor links,
|
|
47
47
|
to prevent them from being opened in the editor. */
|
|
48
48
|
|
|
49
49
|
const isInternalAnchor = !!(href !== null && href !== void 0 && href.startsWith('#'));
|
|
50
|
+
|
|
51
|
+
const onClickHandler = event => {
|
|
52
|
+
if (isInternalAnchor) {
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (props.onClick) {
|
|
57
|
+
props.onClick(event);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
50
61
|
return (
|
|
51
62
|
/* eslint-disable react/jsx-no-target-blank */
|
|
52
63
|
(0, _element.createElement)("a", (0, _extends2.default)({}, additionalProps, {
|
|
53
64
|
className: classes,
|
|
54
65
|
href: href,
|
|
55
|
-
onClick:
|
|
66
|
+
onClick: onClickHandler,
|
|
56
67
|
target: "_blank",
|
|
57
68
|
rel: optimizedRel,
|
|
58
69
|
ref: ref
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/external-link/index.tsx"],"names":["UnforwardedExternalLink","props","ref","href","children","className","rel","additionalProps","optimizedRel","Set","split","filter","Boolean","join","classes","isInternalAnchor","startsWith","event","preventDefault","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/external-link/index.tsx"],"names":["UnforwardedExternalLink","props","ref","href","children","className","rel","additionalProps","optimizedRel","Set","split","filter","Boolean","join","classes","isInternalAnchor","startsWith","onClickHandler","event","preventDefault","onClick","external","ExternalLink"],"mappings":";;;;;;;;;AAUA;;;;AAPA;;AAMA;;AAEA;;AAKA;;AAC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,SAAS,EAAC;AAFX,MAhBD;AAqBA;;AAvBD;AAyBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMC,YAAY,GAAG,yBAAYtB,uBAAZ,CAArB;;eAEQsB,Y","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef } from '@wordpress/element';\nimport { external } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport { StyledIcon } from './styles/external-link-styles';\nimport type { ExternalLinkProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\nfunction UnforwardedExternalLink(\n\tprops: Omit<\n\t\tWordPressComponentProps< ExternalLinkProps, 'a', false >,\n\t\t'target'\n\t>,\n\tref: ForwardedRef< HTMLAnchorElement >\n) {\n\tconst { href, children, className, rel = '', ...additionalProps } = props;\n\tconst optimizedRel = [\n\t\t...new Set(\n\t\t\t[\n\t\t\t\t...rel.split( ' ' ),\n\t\t\t\t'external',\n\t\t\t\t'noreferrer',\n\t\t\t\t'noopener',\n\t\t\t].filter( Boolean )\n\t\t),\n\t].join( ' ' );\n\tconst classes = classnames( 'components-external-link', className );\n\t/* Anchor links are perceived as external links.\n\tThis constant helps check for on page anchor links,\n\tto prevent them from being opened in the editor. */\n\tconst isInternalAnchor = !! href?.startsWith( '#' );\n\n\tconst onClickHandler = (\n\t\tevent: React.MouseEvent< HTMLAnchorElement, MouseEvent >\n\t) => {\n\t\tif ( isInternalAnchor ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\tif ( props.onClick ) {\n\t\t\tprops.onClick( event );\n\t\t}\n\t};\n\n\treturn (\n\t\t/* eslint-disable react/jsx-no-target-blank */\n\t\t<a\n\t\t\t{ ...additionalProps }\n\t\t\tclassName={ classes }\n\t\t\thref={ href }\n\t\t\tonClick={ onClickHandler }\n\t\t\ttarget=\"_blank\"\n\t\t\trel={ optimizedRel }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ children }\n\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t{\n\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t}\n\t\t\t</VisuallyHidden>\n\t\t\t<StyledIcon\n\t\t\t\ticon={ external }\n\t\t\t\tclassName=\"components-external-link__icon\"\n\t\t\t/>\n\t\t</a>\n\t\t/* eslint-enable react/jsx-no-target-blank */\n\t);\n}\n\n/**\n * Link to an external resource.\n *\n * ```jsx\n * import { ExternalLink } from '@wordpress/components';\n *\n * const MyExternalLink = () => (\n * <ExternalLink href=\"https://wordpress.org\">WordPress.org</ExternalLink>\n * );\n * ```\n */\nexport const ExternalLink = forwardRef( UnforwardedExternalLink );\n\nexport default ExternalLink;\n"]}
|
package/build/flex/flex/hook.js
CHANGED
|
@@ -71,7 +71,6 @@ function useFlex(props) {
|
|
|
71
71
|
const directionAsArray = Array.isArray(directionProp) ? directionProp : [directionProp];
|
|
72
72
|
const direction = (0, _useResponsiveValue.useResponsiveValue)(directionAsArray);
|
|
73
73
|
const isColumn = typeof direction === 'string' && !!direction.includes('column');
|
|
74
|
-
const isReverse = typeof direction === 'string' && direction.includes('reverse');
|
|
75
74
|
const cx = (0, _utils.useCx)();
|
|
76
75
|
const classes = (0, _element.useMemo)(() => {
|
|
77
76
|
const base = /*#__PURE__*/(0, _react.css)({
|
|
@@ -82,9 +81,9 @@ function useFlex(props) {
|
|
|
82
81
|
justifyContent: justify,
|
|
83
82
|
height: isColumn && expanded ? '100%' : undefined,
|
|
84
83
|
width: !isColumn && expanded ? '100%' : undefined
|
|
85
|
-
}, process.env.NODE_ENV === "production" ? "" : ";label:base;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
84
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:base;", process.env.NODE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XHRjbGFzc05hbWVcblx0XHQpO1xuXHR9LCBbXG5cdFx0YWxpZ24sXG5cdFx0Y2xhc3NOYW1lLFxuXHRcdGN4LFxuXHRcdGRpcmVjdGlvbixcblx0XHRleHBhbmRlZCxcblx0XHRnYXAsXG5cdFx0aXNDb2x1bW4sXG5cdFx0anVzdGlmeSxcblx0XHR3cmFwLFxuXHRdICk7XG5cblx0cmV0dXJuIHsgLi4ub3RoZXJQcm9wcywgY2xhc3NOYW1lOiBjbGFzc2VzLCBpc0NvbHVtbiB9O1xufVxuIl19 */");
|
|
86
85
|
return cx(styles.Flex, base, isColumn ? styles.ItemsColumn : styles.ItemsRow, className);
|
|
87
|
-
}, [align, className, cx, direction, expanded, gap, isColumn,
|
|
86
|
+
}, [align, className, cx, direction, expanded, gap, isColumn, justify, wrap]);
|
|
88
87
|
return { ...otherProps,
|
|
89
88
|
className: classes,
|
|
90
89
|
isColumn
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/flex/flex/hook.ts"],"names":["useDeprecatedProps","props","isReversed","otherProps","alternative","since","direction","useFlex","align","className","directionProp","expanded","gap","justify","wrap","directionAsArray","Array","isArray","isColumn","includes","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/flex/flex/hook.ts"],"names":["useDeprecatedProps","props","isReversed","otherProps","alternative","since","direction","useFlex","align","className","directionProp","expanded","gap","justify","wrap","directionAsArray","Array","isArray","isColumn","includes","cx","classes","base","alignItems","flexDirection","flexWrap","undefined","justifyContent","height","width","styles","Flex","ItemsColumn","ItemsRow"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;;;;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAQA,SAASA,kBAAT,CACCC,KADD,EAE+C;AAC9C,QAAM;AAAEC,IAAAA,UAAF;AAAc,OAAGC;AAAjB,MAAgCF,KAAtC;;AAEA,MAAK,OAAOC,UAAP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AAA,MAAM,EAAEV,QAAQ,IAAIP,QAAZ,GAAuB,MAAvB,GAAgCe,SANvB;AAOjBG,MAAAA,KAAK,EAAE,CAAEX,QAAF,IAAcP,QAAd,GAAyB,MAAzB,GAAkCe;AAPxB,KAAL,0iHAAb;AAUA,WAAON,EAAE,CACRU,MAAM,CAACC,IADC,EAERT,IAFQ,EAGRJ,QAAQ,GAAGY,MAAM,CAACE,WAAV,GAAwBF,MAAM,CAACG,QAH/B,EAIRxB,SAJQ,CAAT;AAMA,GAjBe,EAiBb,CACFD,KADE,EAEFC,SAFE,EAGFW,EAHE,EAIFd,SAJE,EAKFK,QALE,EAMFC,GANE,EAOFM,QAPE,EAQFL,OARE,EASFC,IATE,CAjBa,CAAhB;AA6BA,SAAO,EAAE,GAAGX,UAAL;AAAiBM,IAAAA,SAAS,EAAEY,OAA5B;AAAqCH,IAAAA;AAArC,GAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport { useResponsiveValue } from '../../ui/utils/use-responsive-value';\nimport { space } from '../../ui/utils/space';\nimport * as styles from '../styles';\nimport { useCx } from '../../utils';\nimport type { FlexProps } from '../types';\n\nfunction useDeprecatedProps(\n\tprops: WordPressComponentProps< FlexProps, 'div' >\n): WordPressComponentProps< FlexProps, 'div' > {\n\tconst { isReversed, ...otherProps } = props;\n\n\tif ( typeof isReversed !== 'undefined' ) {\n\t\tdeprecated( 'Flex isReversed', {\n\t\t\talternative: 'Flex direction=\"row-reverse\" or \"column-reverse\"',\n\t\t\tsince: '5.9',\n\t\t} );\n\t\treturn {\n\t\t\t...otherProps,\n\t\t\tdirection: isReversed ? 'row-reverse' : 'row',\n\t\t};\n\t}\n\n\treturn otherProps;\n}\n\nexport function useFlex( props: WordPressComponentProps< FlexProps, 'div' > ) {\n\tconst {\n\t\talign = 'center',\n\t\tclassName,\n\t\tdirection: directionProp = 'row',\n\t\texpanded = true,\n\t\tgap = 2,\n\t\tjustify = 'space-between',\n\t\twrap = false,\n\t\t...otherProps\n\t} = useContextSystem( useDeprecatedProps( props ), 'Flex' );\n\n\tconst directionAsArray = Array.isArray( directionProp )\n\t\t? directionProp\n\t\t: [ directionProp ];\n\tconst direction = useResponsiveValue( directionAsArray );\n\n\tconst isColumn =\n\t\ttypeof direction === 'string' && !! direction.includes( 'column' );\n\n\tconst cx = useCx();\n\n\tconst classes = useMemo( () => {\n\t\tconst base = css( {\n\t\t\talignItems: isColumn ? 'normal' : align,\n\t\t\tflexDirection: direction,\n\t\t\tflexWrap: wrap ? 'wrap' : undefined,\n\t\t\tgap: space( gap ),\n\t\t\tjustifyContent: justify,\n\t\t\theight: isColumn && expanded ? '100%' : undefined,\n\t\t\twidth: ! isColumn && expanded ? '100%' : undefined,\n\t\t} );\n\n\t\treturn cx(\n\t\t\tstyles.Flex,\n\t\t\tbase,\n\t\t\tisColumn ? styles.ItemsColumn : styles.ItemsRow,\n\t\t\tclassName\n\t\t);\n\t}, [\n\t\talign,\n\t\tclassName,\n\t\tcx,\n\t\tdirection,\n\t\texpanded,\n\t\tgap,\n\t\tisColumn,\n\t\tjustify,\n\t\twrap,\n\t] );\n\n\treturn { ...otherProps, className: classes, isColumn };\n}\n"]}
|
|
@@ -33,19 +33,9 @@ function FocalPoint(_ref) {
|
|
|
33
33
|
left,
|
|
34
34
|
top
|
|
35
35
|
};
|
|
36
|
-
return (0, _element.createElement)(_focalPointStyle.
|
|
36
|
+
return (0, _element.createElement)(_focalPointStyle.PointerCircle, (0, _extends2.default)({}, props, {
|
|
37
37
|
className: classes,
|
|
38
38
|
style: style
|
|
39
|
-
})
|
|
40
|
-
className: "components-focal-point-picker__icon",
|
|
41
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
42
|
-
viewBox: "0 0 30 30"
|
|
43
|
-
}, (0, _element.createElement)(_focalPointStyle.PointerIconPathOutline, {
|
|
44
|
-
className: "components-focal-point-picker__icon-outline",
|
|
45
|
-
d: "M15 1C7.3 1 1 7.3 1 15s6.3 14 14 14 14-6.3 14-14S22.7 1 15 1zm0 22c-4.4 0-8-3.6-8-8s3.6-8 8-8 8 3.6 8 8-3.6 8-8 8z"
|
|
46
|
-
}), (0, _element.createElement)(_focalPointStyle.PointerIconPathFill, {
|
|
47
|
-
className: "components-focal-point-picker__icon-fill",
|
|
48
|
-
d: "M15 3C8.4 3 3 8.4 3 15s5.4 12 12 12 12-5.4 12-12S21.6 3 15 3zm0 22C9.5 25 5 20.5 5 15S9.5 5 15 5s10 4.5 10 10-4.5 10-10 10z"
|
|
49
|
-
})));
|
|
39
|
+
}));
|
|
50
40
|
}
|
|
51
41
|
//# sourceMappingURL=focal-point.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/focal-point-picker/focal-point.tsx"],"names":["FocalPoint","left","top","props","classes","style"],"mappings":";;;;;;;;;;;;;AAGA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/focal-point-picker/focal-point.tsx"],"names":["FocalPoint","left","top","props","classes","style"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAKe,SAASA,UAAT,OAIwC;AAAA,MAJnB;AACnCC,IAAAA,IAAI,GAAG,KAD4B;AAEnCC,IAAAA,GAAG,GAAG,KAF6B;AAGnC,OAAGC;AAHgC,GAImB;AACtD,QAAMC,OAAO,GAAG,yBACf,+CADe,CAAhB;AAIA,QAAMC,KAAK,GAAG;AAAEJ,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAd;AAEA,SAAO,4BAAC,8BAAD,6BAAoBC,KAApB;AAA4B,IAAA,SAAS,EAAGC,OAAxC;AAAkD,IAAA,KAAK,EAAGC;AAA1D,KAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { PointerCircle } from './styles/focal-point-style';\n\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { FocalPointProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\nexport default function FocalPoint( {\n\tleft = '50%',\n\ttop = '50%',\n\t...props\n}: WordPressComponentProps< FocalPointProps, 'div' > ) {\n\tconst classes = classnames(\n\t\t'components-focal-point-picker__icon_container'\n\t);\n\n\tconst style = { left, top };\n\n\treturn <PointerCircle { ...props } className={ classes } style={ style } />;\n}\n"]}
|
|
@@ -5,63 +5,23 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.PointerCircle = void 0;
|
|
9
9
|
|
|
10
10
|
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const FocalPointWrapper = (0, _base.default)("div", process.env.NODE_ENV === "production" ? {
|
|
19
|
-
target: "e19snlhg3"
|
|
12
|
+
/**
|
|
13
|
+
* External dependencies
|
|
14
|
+
*/
|
|
15
|
+
const PointerCircle = (0, _base.default)("div", process.env.NODE_ENV === "production" ? {
|
|
16
|
+
target: "e19snlhg0"
|
|
20
17
|
} : {
|
|
21
|
-
target: "
|
|
22
|
-
label: "
|
|
23
|
-
})("background-color:transparent;cursor:grab;height:
|
|
18
|
+
target: "e19snlhg0",
|
|
19
|
+
label: "PointerCircle"
|
|
20
|
+
})("background-color:transparent;cursor:grab;height:48px;margin:-24px 0 0 -24px;position:absolute;user-select:none;width:48px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.6 );border-radius:50%;backdrop-filter:blur( 4px );box-shadow:rgb( 0 0 0 / 20% ) 0px 0px 10px;", _ref => {
|
|
24
21
|
let {
|
|
25
22
|
isDragging
|
|
26
23
|
} = _ref;
|
|
27
24
|
return isDragging && 'cursor: grabbing;';
|
|
28
|
-
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
29
|
-
exports.
|
|
30
|
-
const PointerIconSVG = ( /*#__PURE__*/0, _base.default)(_primitives.SVG, process.env.NODE_ENV === "production" ? {
|
|
31
|
-
target: "e19snlhg2"
|
|
32
|
-
} : {
|
|
33
|
-
target: "e19snlhg2",
|
|
34
|
-
label: "PointerIconSVG"
|
|
35
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
36
|
-
name: "qkx60y",
|
|
37
|
-
styles: "display:block;height:100%;left:0;position:absolute;top:0;width:100%"
|
|
38
|
-
} : {
|
|
39
|
-
name: "qkx60y",
|
|
40
|
-
styles: "display:block;height:100%;left:0;position:absolute;top:0;width:100%",
|
|
41
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZm9jYWwtcG9pbnQtcGlja2VyL3N0eWxlcy9mb2NhbC1wb2ludC1zdHlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUErQjJDIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZm9jYWwtcG9pbnQtcGlja2VyL3N0eWxlcy9mb2NhbC1wb2ludC1zdHlsZS50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuLyoqXG4gKiBXb3JkUHJlc3MgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFBhdGgsIFNWRyB9IGZyb20gJ0B3b3JkcHJlc3MvcHJpbWl0aXZlcyc7XG5cbi8qKlxuICogSW50ZXJuYWwgZG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IconSVG;
|
|
45
|
-
const PointerIconPathOutline = ( /*#__PURE__*/0, _base.default)(_primitives.Path, process.env.NODE_ENV === "production" ? {
|
|
46
|
-
target: "e19snlhg1"
|
|
47
|
-
} : {
|
|
48
|
-
target: "e19snlhg1",
|
|
49
|
-
label: "PointerIconPathOutline"
|
|
50
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
51
|
-
name: "1b3qpiw",
|
|
52
|
-
styles: "fill:white"
|
|
53
|
-
} : {
|
|
54
|
-
name: "1b3qpiw",
|
|
55
|
-
styles: "fill:white",
|
|
56
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZm9jYWwtcG9pbnQtcGlja2VyL3N0eWxlcy9mb2NhbC1wb2ludC1zdHlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF3Q29EIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZm9jYWwtcG9pbnQtcGlja2VyL3N0eWxlcy9mb2NhbC1wb2ludC1zdHlsZS50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuLyoqXG4gKiBXb3JkUHJlc3MgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFBhdGgsIFNWRyB9IGZyb20gJ0B3b3JkcHJlc3MvcHJpbWl0aXZlcyc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IENPTE9SUyB9IGZyb20gJy4uLy4uL3V0aWxzJztcblxuZXhwb3J0IGNvbnN0IEZvY2FsUG9pbnRXcmFwcGVyID0gc3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZC1jb2xvcjogdHJhbnNwYXJlbnQ7XG5cdGN1cnNvcjogZ3JhYjtcblx0aGVpZ2h0OiAzMHB4O1xuXHRtYXJnaW46IC0xNXB4IDAgMCAtMTVweDtcblx0b3BhY2l0eTogMC44O1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHVzZXItc2VsZWN0OiBub25lO1xuXHR3aWR0aDogMzBweDtcblx0d2lsbC1jaGFuZ2U6IHRyYW5zZm9ybTtcblx0ei1pbmRleDogMTAwMDA7XG5cblx0JHsgKCB7IGlzRHJhZ2dpbmcgfTogeyBpc0RyYWdnaW5nOiBib29sZWFuIH0gKSA9PlxuXHRcdGlzRHJhZ2dpbmcgJiYgJ2N1cnNvcjogZ3JhYmJpbmc7JyB9XG5gO1xuXG5leHBvcnQgY29uc3QgUG9pbnRlckljb25TVkcgPSBzdHlsZWQoIFNWRyApYFxuXHRkaXNwbGF5OiBibG9jaztcblx0aGVpZ2h0OiAxMDAlO1xuXHRsZWZ0OiAwO1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHRvcDogMDtcblx0d2lkdGg6IDEwMCU7XG5gO1xuXG5leHBvcnQgY29uc3QgUG9pbnRlckljb25QYXRoT3V0bGluZSA9IHN0eWxlZCggUGF0aCApYFxuXHRmaWxsOiB3aGl0ZTtcbmA7XG5cbmV4cG9ydCBjb25zdCBQb2ludGVySWNvblBhdGhGaWxsID0gc3R5bGVkKCBQYXRoIClgXG5cdGZpbGw6ICR7IENPTE9SUy51aS50aGVtZSB9O1xuYDtcbiJdfQ== */",
|
|
57
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
58
|
-
});
|
|
59
|
-
exports.PointerIconPathOutline = PointerIconPathOutline;
|
|
60
|
-
const PointerIconPathFill = ( /*#__PURE__*/0, _base.default)(_primitives.Path, process.env.NODE_ENV === "production" ? {
|
|
61
|
-
target: "e19snlhg0"
|
|
62
|
-
} : {
|
|
63
|
-
target: "e19snlhg0",
|
|
64
|
-
label: "PointerIconPathFill"
|
|
65
|
-
})("fill:", _utils.COLORS.ui.theme, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZm9jYWwtcG9pbnQtcGlja2VyL3N0eWxlcy9mb2NhbC1wb2ludC1zdHlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE0Q2lEIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZm9jYWwtcG9pbnQtcGlja2VyL3N0eWxlcy9mb2NhbC1wb2ludC1zdHlsZS50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuLyoqXG4gKiBXb3JkUHJlc3MgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFBhdGgsIFNWRyB9IGZyb20gJ0B3b3JkcHJlc3MvcHJpbWl0aXZlcyc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IENPTE9SUyB9IGZyb20gJy4uLy4uL3V0aWxzJztcblxuZXhwb3J0IGNvbnN0IEZvY2FsUG9pbnRXcmFwcGVyID0gc3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZC1jb2xvcjogdHJhbnNwYXJlbnQ7XG5cdGN1cnNvcjogZ3JhYjtcblx0aGVpZ2h0OiAzMHB4O1xuXHRtYXJnaW46IC0xNXB4IDAgMCAtMTVweDtcblx0b3BhY2l0eTogMC44O1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHVzZXItc2VsZWN0OiBub25lO1xuXHR3aWR0aDogMzBweDtcblx0d2lsbC1jaGFuZ2U6IHRyYW5zZm9ybTtcblx0ei1pbmRleDogMTAwMDA7XG5cblx0JHsgKCB7IGlzRHJhZ2dpbmcgfTogeyBpc0RyYWdnaW5nOiBib29sZWFuIH0gKSA9PlxuXHRcdGlzRHJhZ2dpbmcgJiYgJ2N1cnNvcjogZ3JhYmJpbmc7JyB9XG5gO1xuXG5leHBvcnQgY29uc3QgUG9pbnRlckljb25TVkcgPSBzdHlsZWQoIFNWRyApYFxuXHRkaXNwbGF5OiBibG9jaztcblx0aGVpZ2h0OiAxMDAlO1xuXHRsZWZ0OiAwO1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHRvcDogMDtcblx0d2lkdGg6IDEwMCU7XG5gO1xuXG5leHBvcnQgY29uc3QgUG9pbnRlckljb25QYXRoT3V0bGluZSA9IHN0eWxlZCggUGF0aCApYFxuXHRmaWxsOiB3aGl0ZTtcbmA7XG5cbmV4cG9ydCBjb25zdCBQb2ludGVySWNvblBhdGhGaWxsID0gc3R5bGVkKCBQYXRoIClgXG5cdGZpbGw6ICR7IENPTE9SUy51aS50aGVtZSB9O1xuYDtcbiJdfQ== */"));
|
|
66
|
-
exports.PointerIconPathFill = PointerIconPathFill;
|
|
25
|
+
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZm9jYWwtcG9pbnQtcGlja2VyL3N0eWxlcy9mb2NhbC1wb2ludC1zdHlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLdUMiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9mb2NhbC1wb2ludC1waWNrZXIvc3R5bGVzL2ZvY2FsLXBvaW50LXN0eWxlLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5leHBvcnQgY29uc3QgUG9pbnRlckNpcmNsZSA9IHN0eWxlZC5kaXZgXG5cdGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50O1xuXHRjdXJzb3I6IGdyYWI7XG5cdGhlaWdodDogNDhweDtcblx0bWFyZ2luOiAtMjRweCAwIDAgLTI0cHg7XG5cdHBvc2l0aW9uOiBhYnNvbHV0ZTtcblx0dXNlci1zZWxlY3Q6IG5vbmU7XG5cdHdpZHRoOiA0OHB4O1xuXHR3aWxsLWNoYW5nZTogdHJhbnNmb3JtO1xuXHR6LWluZGV4OiAxMDAwMDtcblx0YmFja2dyb3VuZDogcmdiYSggMjU1LCAyNTUsIDI1NSwgMC42ICk7XG5cdGJvcmRlci1yYWRpdXM6IDUwJTtcblx0YmFja2Ryb3AtZmlsdGVyOiBibHVyKCA0cHggKTtcblx0Ym94LXNoYWRvdzogcmdiKCAwIDAgMCAvIDIwJSApIDBweCAwcHggMTBweDtcblxuXHQkeyAoIHsgaXNEcmFnZ2luZyB9OiB7IGlzRHJhZ2dpbmc6IGJvb2xlYW4gfSApID0+XG5cdFx0aXNEcmFnZ2luZyAmJiAnY3Vyc29yOiBncmFiYmluZzsnIH1cbmA7XG4iXX0= */"));
|
|
26
|
+
exports.PointerCircle = PointerCircle;
|
|
67
27
|
//# sourceMappingURL=focal-point-style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/focal-point-picker/styles/focal-point-style.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/focal-point-picker/styles/focal-point-style.ts"],"names":["PointerCircle","isDragging"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AAGO,MAAMA,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,oSAetB;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACFA,UAAU,IAAI,mBADZ;AAAA,CAfsB,6qCAAnB","sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n\nexport const PointerCircle = styled.div`\n\tbackground-color: transparent;\n\tcursor: grab;\n\theight: 48px;\n\tmargin: -24px 0 0 -24px;\n\tposition: absolute;\n\tuser-select: none;\n\twidth: 48px;\n\twill-change: transform;\n\tz-index: 10000;\n\tbackground: rgba( 255, 255, 255, 0.6 );\n\tborder-radius: 50%;\n\tbackdrop-filter: blur( 4px );\n\tbox-shadow: rgb( 0 0 0 / 20% ) 0px 0px 10px;\n\n\t${ ( { isDragging }: { isDragging: boolean } ) =>\n\t\tisDragging && 'cursor: grabbing;' }\n`;\n"]}
|
|
@@ -28,7 +28,6 @@ function FocusableIframe(_ref) {
|
|
|
28
28
|
iframeRef,
|
|
29
29
|
...props
|
|
30
30
|
} = _ref;
|
|
31
|
-
// @ts-expect-error: Return type for useFocusableIframe() is incorrect.
|
|
32
31
|
const ref = (0, _compose.useMergeRefs)([iframeRef, (0, _compose.useFocusableIframe)()]);
|
|
33
32
|
(0, _deprecated.default)('wp.components.FocusableIframe', {
|
|
34
33
|
since: '5.9',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/focusable-iframe/index.js"],"names":["FocusableIframe","iframeRef","props","ref","since","alternative"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACe,SAASA,eAAT,OAAoD;AAAA,MAA1B;AAAEC,IAAAA,SAAF;AAAa,OAAGC;AAAhB,GAA0B;AAClE
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/focusable-iframe/index.js"],"names":["FocusableIframe","iframeRef","props","ref","since","alternative"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACe,SAASA,eAAT,OAAoD;AAAA,MAA1B;AAAEC,IAAAA,SAAF;AAAa,OAAGC;AAAhB,GAA0B;AAClE,QAAMC,GAAG,GAAG,2BAAc,CAAEF,SAAF,EAAa,kCAAb,CAAd,CAAZ;AACA,2BAAY,+BAAZ,EAA6C;AAC5CG,IAAAA,KAAK,EAAE,KADqC;AAE5CC,IAAAA,WAAW,EAAE;AAF+B,GAA7C,EAFkE,CAMlE;AACA;AACA;AACA;;AACA,SAAO;AAAQ,IAAA,GAAG,EAAGF;AAAd,KAAyBD,KAAzB,EAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMergeRefs, useFocusableIframe } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * @param {Object} props\n * @param {import('react').Ref<HTMLIFrameElement>} props.iframeRef\n */\nexport default function FocusableIframe( { iframeRef, ...props } ) {\n\tconst ref = useMergeRefs( [ iframeRef, useFocusableIframe() ] );\n\tdeprecated( 'wp.components.FocusableIframe', {\n\t\tsince: '5.9',\n\t\talternative: 'wp.compose.useFocusableIframe',\n\t} );\n\t// Disable reason: The rendered iframe is a pass-through component,\n\t// assigning props inherited from the rendering parent. It's the\n\t// responsibility of the parent to assign a title.\n\t// eslint-disable-next-line jsx-a11y/iframe-has-title\n\treturn <iframe ref={ ref } { ...props } />;\n}\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.T_SHIRT_NAMES = exports.T_SHIRT_ABBREVIATIONS = void 0;
|
|
7
|
+
|
|
8
|
+
var _i18n = require("@wordpress/i18n");
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* WordPress dependencies
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* List of T-shirt abbreviations.
|
|
16
|
+
*
|
|
17
|
+
* When there are 5 font sizes or fewer, we assume that the font sizes are
|
|
18
|
+
* ordered by size and show T-shirt labels.
|
|
19
|
+
*/
|
|
20
|
+
const T_SHIRT_ABBREVIATIONS = [
|
|
21
|
+
/* translators: S stands for 'small' and is a size label. */
|
|
22
|
+
(0, _i18n.__)('S'),
|
|
23
|
+
/* translators: M stands for 'medium' and is a size label. */
|
|
24
|
+
(0, _i18n.__)('M'),
|
|
25
|
+
/* translators: L stands for 'large' and is a size label. */
|
|
26
|
+
(0, _i18n.__)('L'),
|
|
27
|
+
/* translators: XL stands for 'extra large' and is a size label. */
|
|
28
|
+
(0, _i18n.__)('XL'),
|
|
29
|
+
/* translators: XXL stands for 'extra extra large' and is a size label. */
|
|
30
|
+
(0, _i18n.__)('XXL')];
|
|
31
|
+
/**
|
|
32
|
+
* List of T-shirt names.
|
|
33
|
+
*
|
|
34
|
+
* When there are 5 font sizes or fewer, we assume that the font sizes are
|
|
35
|
+
* ordered by size and show T-shirt labels.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
exports.T_SHIRT_ABBREVIATIONS = T_SHIRT_ABBREVIATIONS;
|
|
39
|
+
const T_SHIRT_NAMES = [(0, _i18n.__)('Small'), (0, _i18n.__)('Medium'), (0, _i18n.__)('Large'), (0, _i18n.__)('Extra Large'), (0, _i18n.__)('Extra Extra Large')];
|
|
40
|
+
exports.T_SHIRT_NAMES = T_SHIRT_NAMES;
|
|
41
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/font-size-picker/constants.ts"],"names":["T_SHIRT_ABBREVIATIONS","T_SHIRT_NAMES"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,qBAAqB,GAAG;AACpC;AACA,cAAI,GAAJ,CAFoC;AAGpC;AACA,cAAI,GAAJ,CAJoC;AAKpC;AACA,cAAI,GAAJ,CANoC;AAOpC;AACA,cAAI,IAAJ,CARoC;AASpC;AACA,cAAI,KAAJ,CAVoC,CAA9B;AAaP;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMC,aAAa,GAAG,CAC5B,cAAI,OAAJ,CAD4B,EAE5B,cAAI,QAAJ,CAF4B,EAG5B,cAAI,OAAJ,CAH4B,EAI5B,cAAI,aAAJ,CAJ4B,EAK5B,cAAI,mBAAJ,CAL4B,CAAtB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * List of T-shirt abbreviations.\n *\n * When there are 5 font sizes or fewer, we assume that the font sizes are\n * ordered by size and show T-shirt labels.\n */\nexport const T_SHIRT_ABBREVIATIONS = [\n\t/* translators: S stands for 'small' and is a size label. */\n\t__( 'S' ),\n\t/* translators: M stands for 'medium' and is a size label. */\n\t__( 'M' ),\n\t/* translators: L stands for 'large' and is a size label. */\n\t__( 'L' ),\n\t/* translators: XL stands for 'extra large' and is a size label. */\n\t__( 'XL' ),\n\t/* translators: XXL stands for 'extra extra large' and is a size label. */\n\t__( 'XXL' ),\n];\n\n/**\n * List of T-shirt names.\n *\n * When there are 5 font sizes or fewer, we assume that the font sizes are\n * ordered by size and show T-shirt labels.\n */\nexport const T_SHIRT_NAMES = [\n\t__( 'Small' ),\n\t__( 'Medium' ),\n\t__( 'Large' ),\n\t__( 'Extra Large' ),\n\t__( 'Extra Extra Large' ),\n];\n"]}
|