@wordpress/components 19.12.0 → 19.13.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 +37 -0
- package/CONTRIBUTING.md +94 -12
- package/build/alignment-matrix-control/index.js +3 -3
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/angle-picker-control/index.js +2 -2
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build/border-box-control/utils.js.map +1 -1
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/box-control/all-input-control.js +6 -10
- package/build/box-control/all-input-control.js.map +1 -1
- package/build/box-control/axial-input-controls.js.map +1 -1
- package/build/box-control/index.js +3 -7
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-controls.js +6 -10
- package/build/box-control/input-controls.js.map +1 -1
- package/build/box-control/unit-control.js +4 -4
- package/build/box-control/unit-control.js.map +1 -1
- package/build/button/index.native.js +1 -3
- package/build/button/index.native.js.map +1 -1
- package/build/checkbox-control/index.js.map +1 -1
- package/build/color-picker/index.native.js.map +1 -1
- package/build/combobox-control/index.js +4 -2
- package/build/combobox-control/index.js.map +1 -1
- package/build/confirm-dialog/component.js.map +1 -1
- package/build/custom-gradient-bar/constants.js +1 -3
- package/build/custom-gradient-bar/constants.js.map +1 -1
- package/build/custom-gradient-bar/control-points.js +15 -8
- package/build/custom-gradient-bar/control-points.js.map +1 -1
- package/build/custom-gradient-bar/index.js +5 -5
- package/build/custom-gradient-bar/index.js.map +1 -1
- package/build/custom-gradient-bar/utils.js +5 -7
- package/build/custom-gradient-bar/utils.js.map +1 -1
- package/build/custom-gradient-picker/utils.js.map +1 -1
- package/build/custom-select-control/index.js.map +1 -1
- package/build/date-time/date/index.js +4 -4
- package/build/date-time/date/index.js.map +1 -1
- package/build/date-time/date-time/index.js +3 -3
- package/build/date-time/date-time/index.js.map +1 -1
- package/build/dimension-control/index.js +1 -3
- package/build/dimension-control/index.js.map +1 -1
- package/build/divider/styles.js +5 -5
- package/build/divider/styles.js.map +1 -1
- package/build/draggable/index.js.map +1 -1
- package/build/draggable/index.native.js +6 -1
- package/build/draggable/index.native.js.map +1 -1
- package/build/drop-zone/provider.js.map +1 -1
- package/build/dropdown/index.js +2 -2
- package/build/dropdown/index.js.map +1 -1
- package/build/dropdown-menu/index.js +13 -2
- package/build/dropdown-menu/index.js.map +1 -1
- package/build/dropdown-menu/index.native.js +13 -2
- package/build/dropdown-menu/index.native.js.map +1 -1
- package/build/external-link/index.js +20 -8
- package/build/external-link/index.js.map +1 -1
- package/build/external-link/styles/external-link-styles.js +3 -3
- package/build/external-link/styles/external-link-styles.js.map +1 -1
- package/build/external-link/types.js +6 -0
- package/build/external-link/types.js.map +1 -0
- package/build/flex/flex/hook.js +9 -5
- package/build/flex/flex/hook.js.map +1 -1
- package/build/focal-point-picker/controls.js +3 -7
- package/build/focal-point-picker/controls.js.map +1 -1
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/media.js +4 -8
- package/build/focal-point-picker/media.js.map +1 -1
- package/build/font-size-picker/index.js +1 -1
- package/build/font-size-picker/index.js.map +1 -1
- package/build/form-toggle/index.js +6 -4
- package/build/form-toggle/index.js.map +1 -1
- package/build/form-token-field/index.js +328 -359
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +26 -20
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/form-token-field/token-input.js +39 -53
- package/build/form-token-field/token-input.js.map +1 -1
- package/build/form-token-field/token.js +3 -3
- package/build/form-token-field/token.js.map +1 -1
- package/build/form-token-field/types.js +6 -0
- package/build/form-token-field/types.js.map +1 -0
- package/build/gradient-picker/index.js.map +1 -1
- package/build/heading/hook.js.map +1 -1
- package/build/higher-order/navigate-regions/index.js.map +1 -1
- package/build/higher-order/with-focus-return/index.js.map +1 -1
- package/build/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build/icon/index.js.map +1 -1
- package/build/input-control/index.js +5 -5
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-field.js +10 -10
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/utils.js +1 -1
- package/build/input-control/utils.js.map +1 -1
- package/build/menu-items-choice/index.js +3 -7
- package/build/menu-items-choice/index.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -7
- package/build/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/global-styles-context/index.native.js.map +1 -1
- package/build/mobile/gradient/index.native.js.map +1 -1
- package/build/mobile/html-text-input/index.native.js.map +1 -1
- package/build/mobile/inserter-button/index.native.js.map +1 -1
- package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
- package/build/mobile/media-edit/index.native.js.map +1 -1
- package/build/mobile/segmented-control/index.native.js +1 -1
- package/build/mobile/segmented-control/index.native.js.map +1 -1
- package/build/modal/index.js +1 -1
- package/build/modal/index.js.map +1 -1
- package/build/navigable-container/container.js +4 -2
- package/build/navigable-container/container.js.map +1 -1
- package/build/navigation/context.js +12 -16
- package/build/navigation/context.js.map +1 -1
- package/build/navigation/index.js +3 -3
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/item/index.js +3 -3
- package/build/navigation/item/index.js.map +1 -1
- package/build/navigator/navigator-back-button/hook.js.map +1 -1
- package/build/navigator/navigator-button/hook.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +1 -1
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +1 -1
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/notice/index.js +5 -5
- package/build/notice/index.js.map +1 -1
- package/build/notice/list.js +4 -2
- package/build/notice/list.js.map +1 -1
- package/build/panel/body.js +3 -3
- package/build/panel/body.js.map +1 -1
- package/build/placeholder/index.js +26 -12
- package/build/placeholder/index.js.map +1 -1
- package/build/radio-control/index.js +43 -7
- package/build/radio-control/index.js.map +1 -1
- package/build/radio-control/types.js +6 -0
- package/build/radio-control/types.js.map +1 -0
- package/build/range-control/index.js +8 -6
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/input-range.js +6 -10
- package/build/range-control/input-range.js.map +1 -1
- package/build/range-control/utils.js +7 -5
- package/build/range-control/utils.js.map +1 -1
- package/build/resizable-box/resize-tooltip/index.js +3 -3
- package/build/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js +4 -7
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/responsive-wrapper/index.js.map +1 -1
- package/build/select-control/index.js +5 -3
- package/build/select-control/index.js.map +1 -1
- package/build/slot-fill/fill.js +1 -7
- package/build/slot-fill/fill.js.map +1 -1
- package/build/slot-fill/slot.js +14 -3
- package/build/slot-fill/slot.js.map +1 -1
- package/build/snackbar/index.js +7 -7
- package/build/snackbar/index.js.map +1 -1
- package/build/snackbar/list.js +3 -1
- package/build/snackbar/list.js.map +1 -1
- package/build/tab-panel/index.js +3 -1
- package/build/tab-panel/index.js.map +1 -1
- package/build/text/hook.js +4 -4
- package/build/text/hook.js.map +1 -1
- package/build/text/utils.js.map +1 -1
- package/build/toggle-control/index.js +1 -3
- package/build/toggle-control/index.js.map +1 -1
- package/build/toggle-control/index.native.js +1 -7
- package/build/toggle-control/index.native.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build/toolbar/index.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build/tooltip/index.js +2 -1
- package/build/tooltip/index.js.map +1 -1
- package/build/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build/tree-select/index.js +57 -4
- package/build/tree-select/index.js.map +1 -1
- package/build/tree-select/types.js +6 -0
- package/build/tree-select/types.js.map +1 -0
- package/build/ui/form-group/form-group-content.js.map +1 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/utils/unit-values.js.map +1 -1
- package/build/utils/values.js.map +1 -1
- package/build/z-stack/component.js +22 -3
- package/build/z-stack/component.js.map +1 -1
- package/build/z-stack/types.js +6 -0
- package/build/z-stack/types.js.map +1 -0
- package/build-module/alignment-matrix-control/index.js +2 -1
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/angle-picker-control/index.js +1 -1
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build-module/border-box-control/utils.js.map +1 -1
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/box-control/all-input-control.js +3 -5
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/axial-input-controls.js.map +1 -1
- package/build-module/box-control/index.js +2 -5
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-controls.js +3 -5
- package/build-module/box-control/input-controls.js.map +1 -1
- package/build-module/box-control/unit-control.js +3 -1
- package/build-module/box-control/unit-control.js.map +1 -1
- package/build-module/button/index.native.js +1 -2
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/color-picker/index.native.js.map +1 -1
- package/build-module/combobox-control/index.js +5 -2
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/custom-gradient-bar/constants.js +0 -1
- package/build-module/custom-gradient-bar/constants.js.map +1 -1
- package/build-module/custom-gradient-bar/control-points.js +16 -9
- package/build-module/custom-gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-gradient-bar/index.js +6 -6
- package/build-module/custom-gradient-bar/index.js.map +1 -1
- package/build-module/custom-gradient-bar/utils.js +6 -8
- package/build-module/custom-gradient-bar/utils.js.map +1 -1
- package/build-module/custom-gradient-picker/utils.js.map +1 -1
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/date-time/date/index.js +4 -3
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date-time/index.js +2 -1
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/dimension-control/index.js +1 -2
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/divider/styles.js +5 -5
- package/build-module/divider/styles.js.map +1 -1
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/draggable/index.native.js +6 -1
- package/build-module/draggable/index.native.js.map +1 -1
- package/build-module/drop-zone/provider.js.map +1 -1
- package/build-module/dropdown/index.js +2 -2
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/dropdown-menu/index.js +12 -1
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js +12 -1
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/external-link/index.js +22 -7
- package/build-module/external-link/index.js.map +1 -1
- package/build-module/external-link/styles/external-link-styles.js +3 -3
- package/build-module/external-link/styles/external-link-styles.js.map +1 -1
- package/build-module/external-link/types.js +2 -0
- package/build-module/external-link/types.js.map +1 -0
- package/build-module/flex/flex/hook.js +7 -5
- package/build-module/flex/flex/hook.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +3 -5
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/media.js +3 -5
- package/build-module/focal-point-picker/media.js.map +1 -1
- package/build-module/font-size-picker/index.js +1 -1
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/form-toggle/index.js +1 -1
- package/build-module/form-toggle/index.js.map +1 -1
- package/build-module/form-token-field/index.js +329 -361
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +32 -23
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/form-token-field/token-input.js +43 -58
- package/build-module/form-token-field/token-input.js.map +1 -1
- package/build-module/form-token-field/token.js +3 -1
- package/build-module/form-token-field/token.js.map +1 -1
- package/build-module/form-token-field/types.js +2 -0
- package/build-module/form-token-field/types.js.map +1 -0
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/heading/hook.js.map +1 -1
- package/build-module/higher-order/navigate-regions/index.js.map +1 -1
- package/build-module/higher-order/with-focus-return/index.js.map +1 -1
- package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build-module/icon/index.js.map +1 -1
- package/build-module/input-control/index.js +2 -1
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-field.js +2 -1
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/utils.js +1 -1
- package/build-module/input-control/utils.js.map +1 -1
- package/build-module/menu-items-choice/index.js +3 -5
- package/build-module/menu-items-choice/index.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -6
- package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/html-text-input/index.native.js.map +1 -1
- package/build-module/mobile/inserter-button/index.native.js.map +1 -1
- package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
- package/build-module/mobile/media-edit/index.native.js.map +1 -1
- package/build-module/mobile/segmented-control/index.native.js +2 -2
- package/build-module/mobile/segmented-control/index.native.js.map +1 -1
- package/build-module/modal/index.js +1 -1
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigable-container/container.js +5 -2
- package/build-module/navigable-container/container.js.map +1 -1
- package/build-module/navigation/context.js +3 -5
- package/build-module/navigation/context.js.map +1 -1
- package/build-module/navigation/index.js +3 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/item/index.js +3 -1
- package/build-module/navigation/item/index.js.map +1 -1
- package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +1 -1
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +1 -1
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/notice/index.js +2 -1
- package/build-module/notice/index.js.map +1 -1
- package/build-module/notice/list.js +4 -1
- package/build-module/notice/list.js.map +1 -1
- package/build-module/panel/body.js +3 -1
- package/build-module/panel/body.js.map +1 -1
- package/build-module/placeholder/index.js +24 -11
- package/build-module/placeholder/index.js.map +1 -1
- package/build-module/radio-control/index.js +40 -7
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/radio-control/types.js +2 -0
- package/build-module/radio-control/types.js.map +1 -0
- package/build-module/range-control/index.js +4 -2
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/input-range.js +2 -5
- package/build-module/range-control/input-range.js.map +1 -1
- package/build-module/range-control/utils.js +4 -1
- package/build-module/range-control/utils.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js +2 -1
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.js +3 -5
- package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build-module/responsive-wrapper/index.js.map +1 -1
- package/build-module/select-control/index.js +3 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/slot-fill/fill.js +1 -6
- package/build-module/slot-fill/fill.js.map +1 -1
- package/build-module/slot-fill/slot.js +12 -2
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/snackbar/index.js +3 -1
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +4 -1
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/tab-panel/index.js +3 -1
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/text/hook.js +4 -4
- package/build-module/text/hook.js.map +1 -1
- package/build-module/text/utils.js.map +1 -1
- package/build-module/toggle-control/index.js +1 -2
- package/build-module/toggle-control/index.js.map +1 -1
- package/build-module/toggle-control/index.native.js +1 -6
- package/build-module/toggle-control/index.native.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build-module/toolbar/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build-module/tooltip/index.js +2 -1
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build-module/tree-select/index.js +53 -3
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/tree-select/types.js +2 -0
- package/build-module/tree-select/types.js.map +1 -0
- package/build-module/ui/form-group/form-group-content.js.map +1 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/utils/unit-values.js.map +1 -1
- package/build-module/utils/values.js.map +1 -1
- package/build-module/z-stack/component.js +21 -2
- package/build-module/z-stack/component.js.map +1 -1
- package/build-module/z-stack/types.js +2 -0
- package/build-module/z-stack/types.js.map +1 -0
- package/build-style/style-rtl.css +32 -3
- package/build-style/style.css +32 -4
- package/build-types/base-control/stories/index.d.ts.map +1 -1
- package/build-types/base-field/hook.d.ts +0 -1
- package/build-types/base-field/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +0 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +0 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +0 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +0 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
- package/build-types/border-box-control/utils.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +0 -1
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +0 -1
- 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 +0 -1
- package/build-types/border-control/border-control-style-picker/hook.d.ts.map +1 -1
- package/build-types/button-group/index.d.ts +1 -1
- package/build-types/button-group/index.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +0 -1
- package/build-types/card/card/hook.d.ts.map +1 -1
- package/build-types/card/card-body/hook.d.ts +0 -1
- package/build-types/card/card-body/hook.d.ts.map +1 -1
- package/build-types/card/card-divider/hook.d.ts +0 -1
- package/build-types/card/card-divider/hook.d.ts.map +1 -1
- package/build-types/card/card-footer/hook.d.ts +0 -1
- package/build-types/card/card-footer/hook.d.ts.map +1 -1
- package/build-types/card/card-header/hook.d.ts +0 -1
- package/build-types/card/card-header/hook.d.ts.map +1 -1
- package/build-types/card/card-media/hook.d.ts +0 -1
- package/build-types/card/card-media/hook.d.ts.map +1 -1
- package/build-types/checkbox-control/index.d.ts.map +1 -1
- package/build-types/checkbox-control/stories/index.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +7 -7
- package/build-types/confirm-dialog/component.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/date-time/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/stories/date-time.d.ts.map +1 -1
- package/build-types/date-time/stories/date.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts +1 -1
- package/build-types/divider/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu/index.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +0 -1
- package/build-types/elevation/hook.d.ts.map +1 -1
- package/build-types/external-link/index.d.ts +17 -0
- package/build-types/external-link/index.d.ts.map +1 -0
- package/build-types/external-link/stories/index.d.ts +12 -0
- package/build-types/external-link/stories/index.d.ts.map +1 -0
- package/build-types/external-link/styles/external-link-styles.d.ts +10 -0
- package/build-types/external-link/styles/external-link-styles.d.ts.map +1 -0
- package/build-types/external-link/types.d.ts +15 -0
- package/build-types/external-link/types.d.ts.map +1 -0
- package/build-types/flex/flex/hook.d.ts +0 -1
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/flex/flex-block/hook.d.ts +0 -1
- package/build-types/flex/flex-block/hook.d.ts.map +1 -1
- package/build-types/flex/flex-item/hook.d.ts +0 -1
- package/build-types/flex/flex-item/hook.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts +15 -0
- package/build-types/form-token-field/index.d.ts.map +1 -0
- package/build-types/form-token-field/stories/index.d.ts +13 -0
- package/build-types/form-token-field/stories/index.d.ts.map +1 -0
- package/build-types/form-token-field/suggestions-list.d.ts +10 -0
- package/build-types/form-token-field/suggestions-list.d.ts.map +1 -0
- package/build-types/form-token-field/test/lib/fixtures.d.ts +26 -0
- package/build-types/form-token-field/test/lib/fixtures.d.ts.map +1 -0
- package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts +18 -0
- package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts.map +1 -0
- package/build-types/form-token-field/token-input.d.ts +12 -0
- package/build-types/form-token-field/token-input.d.ts.map +1 -0
- package/build-types/form-token-field/token.d.ts +4 -0
- package/build-types/form-token-field/token.d.ts.map +1 -0
- package/build-types/form-token-field/types.d.ts +176 -0
- package/build-types/form-token-field/types.d.ts.map +1 -0
- package/build-types/grid/hook.d.ts +0 -1
- package/build-types/grid/hook.d.ts.map +1 -1
- package/build-types/h-stack/hook.d.ts +0 -1
- package/build-types/h-stack/hook.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts +0 -1
- package/build-types/heading/hook.d.ts.map +1 -1
- package/build-types/higher-order/with-focus-outside/index.d.ts +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-field.d.ts +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
- package/build-types/input-control/stories/index.d.ts +5 -5
- package/build-types/input-control/stories/index.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +0 -1
- package/build-types/item-group/item/hook.d.ts.map +1 -1
- package/build-types/item-group/item-group/hook.d.ts +0 -1
- package/build-types/item-group/item-group/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +0 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +0 -1
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/radio-control/index.d.ts +31 -0
- package/build-types/radio-control/index.d.ts.map +1 -0
- package/build-types/radio-control/stories/index.d.ts +12 -0
- package/build-types/radio-control/stories/index.d.ts.map +1 -0
- package/build-types/radio-control/types.d.ts +29 -0
- package/build-types/radio-control/types.d.ts.map +1 -0
- package/build-types/range-control/index.d.ts +5 -5
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/input-range.d.ts +4 -4
- package/build-types/range-control/input-range.d.ts.map +1 -1
- package/build-types/range-control/utils.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts +0 -1
- package/build-types/scrollable/hook.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +1 -1
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.d.ts +3 -3
- package/build-types/select-control/stories/index.d.ts.map +1 -1
- package/build-types/slot-fill/fill.d.ts.map +1 -1
- package/build-types/slot-fill/slot.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +0 -1
- package/build-types/spacer/hook.d.ts.map +1 -1
- package/build-types/surface/hook.d.ts +0 -1
- package/build-types/surface/hook.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +0 -1
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/text/utils.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts +1 -1
- 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-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +0 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +0 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +0 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tree-select/index.d.ts +53 -0
- package/build-types/tree-select/index.d.ts.map +1 -0
- package/build-types/tree-select/stories/index.d.ts +12 -0
- package/build-types/tree-select/stories/index.d.ts.map +1 -0
- package/build-types/tree-select/types.d.ts +30 -0
- package/build-types/tree-select/types.d.ts.map +1 -0
- package/build-types/truncate/hook.d.ts +0 -1
- package/build-types/truncate/hook.d.ts.map +1 -1
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
- package/build-types/ui/control-group/hook.d.ts +0 -1
- package/build-types/ui/control-group/hook.d.ts.map +1 -1
- package/build-types/ui/control-label/hook.d.ts +0 -1
- package/build-types/ui/control-label/hook.d.ts.map +1 -1
- package/build-types/ui/form-group/use-form-group.d.ts +0 -2
- package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/stories/index.d.ts.map +1 -1
- package/build-types/utils/unit-values.d.ts.map +1 -1
- package/build-types/utils/values.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +0 -1
- package/build-types/v-stack/hook.d.ts.map +1 -1
- package/build-types/z-stack/component.d.ts +18 -28
- package/build-types/z-stack/component.d.ts.map +1 -1
- package/build-types/z-stack/stories/index.d.ts +6 -0
- package/build-types/z-stack/stories/index.d.ts.map +1 -0
- package/build-types/z-stack/types.d.ts +33 -0
- package/build-types/z-stack/types.d.ts.map +1 -0
- package/package.json +17 -17
- package/src/alignment-matrix-control/index.js +2 -1
- package/src/angle-picker-control/index.js +1 -1
- package/src/base-control/stories/index.tsx +2 -3
- package/src/border-box-control/border-box-control-linked-button/component.tsx +2 -5
- package/src/border-box-control/utils.ts +5 -2
- package/src/border-control/border-control/hook.ts +2 -3
- package/src/box-control/all-input-control.js +2 -4
- package/src/box-control/axial-input-controls.js +4 -6
- package/src/box-control/index.js +2 -5
- package/src/box-control/input-controls.js +33 -36
- package/src/box-control/unit-control.js +2 -1
- package/src/button/index.native.js +1 -2
- package/src/card/stories/index.js +10 -5
- package/src/checkbox-control/index.tsx +2 -3
- package/src/checkbox-control/stories/index.tsx +2 -3
- package/src/checkbox-control/test/index.tsx +2 -1
- package/src/color-picker/index.native.js +7 -4
- package/src/combobox-control/index.js +4 -2
- package/src/confirm-dialog/component.tsx +7 -8
- package/src/custom-gradient-bar/constants.js +2 -2
- package/src/custom-gradient-bar/control-points.js +20 -16
- package/src/custom-gradient-bar/index.js +11 -11
- package/src/custom-gradient-bar/test/utils.js +79 -0
- package/src/custom-gradient-bar/utils.js +6 -18
- package/src/custom-gradient-picker/style.scss +1 -3
- package/src/custom-gradient-picker/utils.js +4 -3
- package/src/custom-select-control/index.js +2 -1
- package/src/custom-select-control/stories/index.js +1 -2
- package/src/date-time/date/index.tsx +2 -2
- package/src/date-time/date/style.scss +10 -0
- package/src/date-time/date/test/index.tsx +1 -1
- package/src/date-time/date-time/index.tsx +6 -8
- package/src/date-time/stories/date-time.tsx +4 -6
- package/src/date-time/stories/date.tsx +2 -3
- package/src/date-time/time/test/index.tsx +12 -12
- package/src/dimension-control/index.js +1 -2
- package/src/divider/styles.ts +2 -3
- package/src/draggable/index.js +3 -3
- package/src/draggable/index.native.js +12 -4
- package/src/drop-zone/provider.js +1 -2
- package/src/dropdown/index.js +2 -2
- package/src/dropdown-menu/index.js +11 -1
- package/src/dropdown-menu/index.native.js +11 -1
- package/src/external-link/README.md +18 -0
- package/src/external-link/{index.js → index.tsx} +26 -6
- package/src/external-link/stories/index.tsx +36 -0
- package/src/external-link/styles/{external-link-styles.js → external-link-styles.ts} +0 -0
- package/src/external-link/types.ts +15 -0
- package/src/flex/flex/hook.js +4 -1
- package/src/focal-point-picker/controls.js +1 -5
- package/src/focal-point-picker/index.js +2 -8
- package/src/focal-point-picker/media.js +2 -5
- package/src/font-size-picker/index.js +3 -1
- package/src/form-toggle/index.js +2 -1
- package/src/form-toggle/test/index.js +1 -2
- package/src/form-token-field/index.tsx +694 -0
- package/src/form-token-field/stories/index.tsx +103 -0
- package/src/form-token-field/style.scss +2 -1
- package/src/form-token-field/{suggestions-list.js → suggestions-list.tsx} +45 -29
- package/src/form-token-field/test/index.js +64 -31
- package/src/form-token-field/test/lib/{token-field-wrapper.js → token-field-wrapper.tsx} +24 -9
- package/src/form-token-field/token-input.tsx +76 -0
- package/src/form-token-field/{token.js → token.tsx} +4 -2
- package/src/form-token-field/types.ts +178 -0
- package/src/gradient-picker/index.js +4 -3
- package/src/heading/hook.ts +5 -4
- package/src/higher-order/navigate-regions/index.js +7 -5
- package/src/higher-order/with-filters/test/index.js +43 -36
- package/src/higher-order/with-focus-return/index.js +14 -13
- package/src/higher-order/with-spoken-messages/index.js +8 -7
- package/src/higher-order/with-spoken-messages/test/index.js +1 -1
- package/src/icon/index.tsx +2 -2
- package/src/input-control/index.tsx +2 -1
- package/src/input-control/input-field.tsx +2 -1
- package/src/input-control/reducer/reducer.ts +23 -21
- package/src/input-control/utils.ts +1 -1
- package/src/item-group/stories/index.js +2 -1
- package/src/menu-item/test/index.js +2 -1
- package/src/menu-items-choice/index.js +2 -5
- package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +2 -4
- package/src/mobile/bottom-sheet/cell.native.js +2 -3
- package/src/mobile/bottom-sheet/cycle-picker-cell.native.js +3 -5
- package/src/mobile/bottom-sheet/index.native.js +14 -17
- package/src/mobile/bottom-sheet/picker-cell.native.js +2 -7
- package/src/mobile/bottom-sheet/stepper-cell/index.native.js +4 -6
- package/src/mobile/color-settings/index.native.js +2 -4
- package/src/mobile/global-styles-context/index.native.js +8 -7
- package/src/mobile/gradient/index.native.js +12 -9
- package/src/mobile/gradient/test/index.native.js +1 -3
- package/src/mobile/html-text-input/index.native.js +2 -3
- package/src/mobile/inserter-button/index.native.js +2 -6
- package/src/mobile/link-settings/image-link-destinations-screen.native.js +6 -2
- package/src/mobile/media-edit/index.native.js +2 -3
- package/src/mobile/segmented-control/index.native.js +4 -5
- package/src/mobile/utils/test/index.native.js +3 -12
- package/src/modal/index.js +1 -1
- package/src/navigable-container/container.js +3 -2
- package/src/navigable-container/test/menu.js +1 -2
- package/src/navigable-container/test/tabbable.js +1 -2
- package/src/navigation/context.js +2 -5
- package/src/navigation/index.js +2 -1
- package/src/navigation/item/index.js +2 -1
- package/src/navigation/stories/controlled-state.js +1 -1
- package/src/navigation/stories/more-examples.js +2 -3
- package/src/navigation/test/index.js +252 -52
- package/src/navigator/navigator-back-button/hook.ts +14 -12
- package/src/navigator/navigator-button/hook.ts +14 -13
- package/src/navigator/navigator-provider/component.tsx +2 -6
- package/src/navigator/navigator-screen/component.tsx +3 -3
- package/src/notice/index.js +2 -1
- package/src/notice/list.js +3 -1
- package/src/panel/body.js +2 -1
- package/src/placeholder/README.md +7 -6
- package/src/placeholder/index.js +27 -10
- package/src/placeholder/style.scss +23 -0
- package/src/radio-control/README.md +17 -23
- package/src/radio-control/index.tsx +107 -0
- package/src/radio-control/stories/index.tsx +72 -0
- package/src/radio-control/types.ts +32 -0
- package/src/range-control/index.js +4 -2
- package/src/range-control/input-range.js +2 -5
- package/src/range-control/utils.js +3 -1
- package/src/resizable-box/resize-tooltip/index.tsx +2 -1
- package/src/resizable-box/resize-tooltip/utils.ts +1 -5
- package/src/responsive-wrapper/index.js +2 -4
- package/src/sandbox/test/index.js +4 -6
- package/src/select-control/index.tsx +3 -1
- package/src/select-control/stories/index.tsx +3 -4
- package/src/slot-fill/fill.js +1 -5
- package/src/slot-fill/slot.js +12 -2
- package/src/snackbar/index.js +1 -1
- package/src/snackbar/list.js +2 -1
- package/src/tab-panel/index.js +3 -1
- package/src/text/hook.js +4 -1
- package/src/text/utils.js +2 -3
- package/src/text-control/stories/index.tsx +4 -6
- package/src/toggle-control/index.js +1 -2
- package/src/toggle-control/index.native.js +2 -6
- package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +2 -4
- package/src/toolbar/index.js +1 -2
- package/src/tools-panel/tools-panel/hook.ts +2 -4
- package/src/tools-panel/tools-panel-header/hook.ts +2 -5
- package/src/tooltip/index.js +1 -0
- package/src/tree-grid/roving-tab-index-item.js +2 -4
- package/src/tree-grid/test/index.js +2 -3
- package/src/tree-select/README.md +2 -2
- package/src/tree-select/index.tsx +99 -0
- package/src/tree-select/stories/index.tsx +80 -0
- package/src/tree-select/types.ts +35 -0
- package/src/ui/context/wordpress-component.ts +4 -5
- package/src/ui/form-group/form-group-content.js +4 -4
- package/src/unit-control/index.tsx +7 -9
- package/src/unit-control/stories/index.tsx +8 -12
- package/src/unit-control/test/index.tsx +4 -7
- package/src/utils/hooks/stories/use-cx.js +8 -7
- package/src/utils/hooks/test/use-controlled-state.js +2 -1
- package/src/utils/unit-values.ts +2 -1
- package/src/utils/values.js +2 -3
- package/src/z-stack/README.md +14 -3
- package/src/z-stack/component.tsx +24 -29
- package/src/z-stack/stories/index.tsx +76 -0
- package/src/z-stack/types.ts +33 -0
- package/tsconfig.json +5 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/src/external-link/stories/index.js +0 -23
- package/src/form-token-field/index.js +0 -725
- package/src/form-token-field/stories/index.js +0 -102
- package/src/form-token-field/token-input.js +0 -81
- package/src/radio-control/index.js +0 -69
- package/src/radio-control/stories/index.js +0 -41
- package/src/tree-select/index.js +0 -48
- package/src/tree-select/stories/index.js +0 -80
- package/src/z-stack/stories/index.js +0 -70
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 19.13.0 (2022-06-15)
|
|
6
|
+
|
|
7
|
+
### Bug Fix
|
|
8
|
+
|
|
9
|
+
- `Tooltip`: Opt in to `__unstableShift` to ensure that the Tooltip is always within the viewport. ([#41524](https://github.com/WordPress/gutenberg/pull/41524))
|
|
10
|
+
- `FormTokenField`: Do not suggest the selected one even if `{ value: string }` is passed ([#41216](https://github.com/WordPress/gutenberg/pull/41216)).
|
|
11
|
+
- `CustomGradientBar`: Fix insertion and control point positioning to more closely follow cursor. ([#41492](https://github.com/WordPress/gutenberg/pull/41492))
|
|
12
|
+
- `FormTokenField`: Added Padding to resolve close button overlap issue ([#41556](https://github.com/WordPress/gutenberg/pull/41556)).
|
|
13
|
+
- `ComboboxControl`: fix the autofocus behavior after resetting the value. ([#41737](https://github.com/WordPress/gutenberg/pull/41737)).
|
|
14
|
+
|
|
15
|
+
### Enhancements
|
|
16
|
+
|
|
17
|
+
- `AnglePickerControl`: Use NumberControl as input field ([#41472](https://github.com/WordPress/gutenberg/pull/41472)).
|
|
18
|
+
|
|
19
|
+
### Internal
|
|
20
|
+
|
|
21
|
+
- `FormTokenField`: Convert to TypeScript and refactor to functional component ([#41216](https://github.com/WordPress/gutenberg/pull/41216)).
|
|
22
|
+
- `Draggable`: updated to satisfy `react/exhuastive-deps` eslint rule ([#41499](https://github.com/WordPress/gutenberg/pull/41499))
|
|
23
|
+
- `RadioControl`: Convert to TypeScript ([#41568](https://github.com/WordPress/gutenberg/pull/41568)).
|
|
24
|
+
- `Flex` updated to satisfy `react/exhuastive-deps` eslint rule ([#41507](https://github.com/WordPress/gutenberg/pull/41507)).
|
|
25
|
+
- `CustomGradientBar` updated to satisfy `react/exhuastive-deps` eslint rule ([#41463](https://github.com/WordPress/gutenberg/pull/41463))
|
|
26
|
+
- `TreeSelect`: Convert to TypeScript ([#41536](https://github.com/WordPress/gutenberg/pull/41536)).
|
|
27
|
+
- `FontSizePicker`: updated to satisfy `react/exhuastive-deps` eslint rule ([#41600](https://github.com/WordPress/gutenberg/pull/41600)).
|
|
28
|
+
- `ZStack`: Convert component story to TypeScript and add inline docs ([#41694](https://github.com/WordPress/gutenberg/pull/41694)).
|
|
29
|
+
- `Dropdown`: Make sure cleanup (closing the dropdown) only runs when the menu has actually been opened.
|
|
30
|
+
- Enhance the TypeScript migration guidelines ([#41669](https://github.com/WordPress/gutenberg/pull/41669)).
|
|
31
|
+
- `ExternalLink`: Convert to TypeScript ([#41681](https://github.com/WordPress/gutenberg/pull/41681)).
|
|
32
|
+
- `InputControl` updated to satisfy `react/exhuastive-deps` eslint rule ([#41601](https://github.com/WordPress/gutenberg/pull/41601))
|
|
33
|
+
- `Modal`: updated to satisfy `react/exhuastive-deps` eslint rule ([#41610](https://github.com/WordPress/gutenberg/pull/41610))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Experimental
|
|
37
|
+
|
|
38
|
+
- `Navigation`: improve unit tests by using `@testing-library/user-event` and modern `@testing-library` assertions; add unit test for controlled component ([#41668](https://github.com/WordPress/gutenberg/pull/41668)).
|
|
39
|
+
|
|
5
40
|
## 19.12.0 (2022-06-01)
|
|
6
41
|
|
|
7
42
|
### Bug Fix
|
|
@@ -30,6 +65,8 @@
|
|
|
30
65
|
- `BoxControl`: Update unit tests to use `@testing-library/user-event` ([#41422](https://github.com/WordPress/gutenberg/pull/41422)).
|
|
31
66
|
- `Surface`: Convert to TypeScript ([#41212](https://github.com/WordPress/gutenberg/pull/41212)).
|
|
32
67
|
- `Autocomplete` updated to satisfy `react/exhuastive-deps` eslint rule ([#41382](https://github.com/WordPress/gutenberg/pull/41382))
|
|
68
|
+
- `Dropdown` updated to satisfy `react/exhuastive-deps` eslint rule ([#41505](https://github.com/WordPress/gutenberg/pull/41505))
|
|
69
|
+
- `DateDayPicker` updated to satisfy `react/exhuastive-deps` eslint rule ([#41470](https://github.com/WordPress/gutenberg/pull/41470)).
|
|
33
70
|
|
|
34
71
|
### Experimental
|
|
35
72
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -19,6 +19,7 @@ For an example of a component that follows these requirements, take a look at [`
|
|
|
19
19
|
- [Documentation](#documentation)
|
|
20
20
|
- [README example](#README-example)
|
|
21
21
|
- [Folder structure](#folder-structure)
|
|
22
|
+
- [TypeScript migration guide](#refactoring-a-component-to-typescript)
|
|
22
23
|
|
|
23
24
|
## Compatibility
|
|
24
25
|
|
|
@@ -489,13 +490,99 @@ Given a component folder (e.g. `packages/components/src/unit-control`):
|
|
|
489
490
|
2. Resume work on this component once all dependencies have been refactored.
|
|
490
491
|
2. Alternatively:
|
|
491
492
|
1. For each of those files, add `// @ts-nocheck` at the start of the file.
|
|
492
|
-
2.
|
|
493
|
-
|
|
494
|
-
|
|
493
|
+
2. If the components in the ignored files are destructuring props directly from the function's arguments, move the props destructuring to the function's body (this is to avoid TypeScript errors from trying to infer the props type):
|
|
494
|
+
|
|
495
|
+
```jsx
|
|
496
|
+
// Before:
|
|
497
|
+
function MyComponent( { myProp1, myProp2, ...restProps } ) { /* ... */ }
|
|
498
|
+
|
|
499
|
+
// After:
|
|
500
|
+
function MyComponent( props ) {
|
|
501
|
+
const { myProp1, myProp2, ...restProps } = props;
|
|
502
|
+
|
|
503
|
+
/* ... */
|
|
504
|
+
}
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
3. Add the folders to the `tsconfig.json` file.
|
|
508
|
+
4. If you’re still getting errors about a component’s props, the easiest way is to slightly refactor this component and perform the props destructuring inside the component’s body (as opposed as in the function signature) — this is to prevent TypeScript from inferring the types of these props.
|
|
509
|
+
5. Continue with the refactor of the current component (and take care of the refactor of the dependent components at a later stage).
|
|
495
510
|
6. Create a new `types.ts` file.
|
|
496
511
|
7. Slowly work your way through fixing the TypeScript errors in the folder:
|
|
497
512
|
1. Try to avoid introducing any runtime changes, if possible. The aim of this refactor is to simply rewrite the component to TypeScript.
|
|
498
|
-
2.
|
|
513
|
+
2. Extract props to `types.ts`, and use them to type components. The README can be of help when determining a prop’s type.
|
|
514
|
+
3. Use existing HTML types when possible? (e.g. `required` for an input field?)
|
|
515
|
+
4. Use the `CSSProperties` type where it makes sense.
|
|
516
|
+
5. Extend existing components’ props if possible, especially when a component internally forwards its props to another component in the package.
|
|
517
|
+
6. If the component forwards its `...restProps` to an underlying element/component, you should use the `WordPressComponentProps` type for the component's props:
|
|
518
|
+
|
|
519
|
+
```jsx
|
|
520
|
+
import type { WordPressComponentProps } from '../ui/context';
|
|
521
|
+
import type { ComponentOwnProps } from './types';
|
|
522
|
+
|
|
523
|
+
function UnconnectedMyComponent(
|
|
524
|
+
// The resulting type will include:
|
|
525
|
+
// - all props defined in `ComponentOwnProps`
|
|
526
|
+
// - all HTML props/attributes from the component specified as the second
|
|
527
|
+
// parameter (`div` in this example)
|
|
528
|
+
// - the special `as` prop (which marks the component as polymorphic),
|
|
529
|
+
// unless the third parameter is `false`
|
|
530
|
+
props: WordPressComponentProps< ComponentOwnProps, 'div', true >
|
|
531
|
+
) { /* ... */ }
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
7. If the component doesn't forwards its ref yet, wrap the component in a `forwardRed` call. Alternatively, if you want to take advantage of the [Context system](#context-system), you can use the `contextConnect` utility function (which also takes care of adding ref forwarding)
|
|
535
|
+
|
|
536
|
+
```jsx
|
|
537
|
+
// With `forwardRef`
|
|
538
|
+
import type { ForwardedRef } from 'react';
|
|
539
|
+
import { forwardRef } from '@wordpress/element';
|
|
540
|
+
import type { WordPressComponentProps } from '../ui/context';
|
|
541
|
+
import type { ComponentOwnProps } from './types';
|
|
542
|
+
|
|
543
|
+
function UnforwardedMyComponent(
|
|
544
|
+
props: WordPressComponentProps< ComponentOwnProps, 'div', true >,
|
|
545
|
+
forwardedRef: ForwardedRef< any >
|
|
546
|
+
) { /* ... */ }
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* MyComponent JSDoc
|
|
551
|
+
*/
|
|
552
|
+
export const MyComponent = forwardRef( UnforwardedMyComponent );
|
|
553
|
+
|
|
554
|
+
export default MyComponent;
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
```jsx
|
|
558
|
+
// With `contextConnect`
|
|
559
|
+
import type { ForwardedRef } from 'react';
|
|
560
|
+
import {
|
|
561
|
+
contextConnect,
|
|
562
|
+
useContextSystem,
|
|
563
|
+
WordPressComponentProps,
|
|
564
|
+
} from '../ui/context';
|
|
565
|
+
import type { ComponentOwnProps } from './types';
|
|
566
|
+
|
|
567
|
+
function UnconnectedMyComponent(
|
|
568
|
+
props: WordPressComponentProps< ComponentOwnProps, 'div', true >,
|
|
569
|
+
forwardedRef: ForwardedRef< any >
|
|
570
|
+
) {
|
|
571
|
+
const contextProps = useContextSystem( props, 'MyComponent' );
|
|
572
|
+
|
|
573
|
+
/* ... */
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* MyComponent JSDoc
|
|
579
|
+
*/
|
|
580
|
+
export const MyComponent = contextConnect( UnconnectedMyComponent, 'MyComponent' );
|
|
581
|
+
|
|
582
|
+
export default MyComponent;
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
8. As shown in the previous examples, make sure you have a **named** export for the component, not just the default export ([example](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/divider/component.tsx)). This ensures that the docgen can properly extract the types data. The naming should be so that the connected/forwarded component has the plain component name (`MyComponent`), and the raw component is prefixed (`UnconnectedMyComponent` or `UnforwardedMyComponent`). This makes the component's `displayName` look nicer in React devtools and in the autogenerated Storybook code snippets.
|
|
499
586
|
|
|
500
587
|
```jsx
|
|
501
588
|
function UnconnectedMyComponent() { /* ... */ }
|
|
@@ -505,14 +592,9 @@ Given a component folder (e.g. `packages/components/src/unit-control`):
|
|
|
505
592
|
export default MyComponent;
|
|
506
593
|
```
|
|
507
594
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
6. Extend existing components’ props if possible, especially when a component internally forwards its props to another component in the package.
|
|
512
|
-
7. Use `WordPressComponent` type if possible.
|
|
513
|
-
8. Use JSDocs syntax for each TypeScript property that is part of the public API of a component. The docs used here should be aligned with the component’s README. Add `@default` values where appropriate.
|
|
514
|
-
9. Prefer `unknown` to `any`, and in general avoid it when possible.
|
|
515
|
-
8. On the component's main export, add a JSDoc comment that includes the main description and `@example` code snippet from the README ([example](https://github.com/WordPress/gutenberg/blob/943cec92f21fedcd256502ea72d9903941f3b05a/packages/components/src/unit-control/index.tsx#L290-L306))
|
|
595
|
+
9. Use JSDocs syntax for each TypeScript property that is part of the public API of a component. The docs used here should be aligned with the component’s README. Add `@default` values where appropriate.
|
|
596
|
+
10. Prefer `unknown` to `any`, and in general avoid it when possible.
|
|
597
|
+
8. On the component's main named export, add a JSDoc comment that includes the main description and the example code snippet from the README ([example](https://github.com/WordPress/gutenberg/blob/43d9c82922619c1d1ff6b454f86f75c3157d3de6/packages/components/src/date-time/date-time/index.tsx#L193-L217)). _At the time of writing, the `@example` JSDoc keyword is not recognized by StoryBook's docgen, so please avoid using it_.
|
|
516
598
|
9. Make sure that:
|
|
517
599
|
1. tests still pass;
|
|
518
600
|
2. storybook examples work as expected.
|
|
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
|
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
14
|
-
var _lodash = require("lodash");
|
|
15
|
-
|
|
16
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
15
|
|
|
18
16
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -40,6 +38,8 @@ var _utils = require("./utils");
|
|
|
40
38
|
/**
|
|
41
39
|
* Internal dependencies
|
|
42
40
|
*/
|
|
41
|
+
const noop = () => {};
|
|
42
|
+
|
|
43
43
|
function useBaseId(id) {
|
|
44
44
|
const instanceId = (0, _compose.useInstanceId)(AlignmentMatrixControl, 'alignment-matrix-control');
|
|
45
45
|
return id || instanceId;
|
|
@@ -52,7 +52,7 @@ function AlignmentMatrixControl(_ref) {
|
|
|
52
52
|
label = (0, _i18n.__)('Alignment Matrix Control'),
|
|
53
53
|
defaultValue = 'center center',
|
|
54
54
|
value,
|
|
55
|
-
onChange =
|
|
55
|
+
onChange = noop,
|
|
56
56
|
width = 92,
|
|
57
57
|
...props
|
|
58
58
|
} = _ref;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/alignment-matrix-control/index.js"],"names":["useBaseId","id","instanceId","AlignmentMatrixControl","className","label","defaultValue","value","onChange","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/alignment-matrix-control/index.js"],"names":["noop","useBaseId","id","instanceId","AlignmentMatrixControl","className","label","defaultValue","value","onChange","width","props","immutableDefaultValue","baseId","initialCurrentId","composite","currentId","rtl","handleOnChange","nextValue","setCurrentId","classes","Root","GRID","map","cells","index","Row","cell","cellId","isActive","Icon","AlignmentMatrixControlIcon"],"mappings":";;;;;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AACD,GAJD,EAIG,CAAEA,KAAF,EAASY,YAAT,EAAuBP,MAAvB,CAJH;AAMA,QAAMQ,OAAO,GAAG,yBACf,oCADe,EAEfhB,SAFe,CAAhB;AAKA,SACC,4BAAC,oBAAD,6BACMM,KADN,EAEMI,SAFN;AAGC,kBAAaT,KAHd;AAIC,IAAA,EAAE,EAAGgB,kCAJN;AAKC,IAAA,SAAS,EAAGD,OALb;AAMC,IAAA,IAAI,EAAC,MANN;AAOC,IAAA,KAAK,EAAGX;AAPT,MASGa,YAAKC,GAAL,CAAU,CAAEC,KAAF,EAASC,KAAT,KACX,4BAAC,yBAAD,6BACMX,SADN;AAEC,IAAA,EAAE,EAAGY,iCAFN;AAGC,IAAA,IAAI,EAAC,KAHN;AAIC,IAAA,GAAG,EAAGD;AAJP,MAMGD,KAAK,CAACD,GAAN,CAAaI,IAAF,IAAY;AACxB,UAAMC,MAAM,GAAG,sBAAWhB,MAAX,EAAmBe,IAAnB,CAAf;AACA,UAAME,QAAQ,GAAGf,SAAS,CAACC,SAAV,KAAwBa,MAAzC;AAEA,WACC,4BAAC,aAAD,6BACMd,SADN;AAEC,MAAA,EAAE,EAAGc,MAFN;AAGC,MAAA,QAAQ,EAAGC,QAHZ;AAIC,MAAA,GAAG,EAAGF,IAJP;AAKC,MAAA,KAAK,EAAGA,IALT;AAMC,MAAA,OAAO,EAAG,MAAMV,cAAc,CAAEU,IAAF,CAN/B;AAOC,MAAA,QAAQ,EAAGE,QAAQ,GAAG,CAAH,GAAO,CAAC;AAP5B,OADD;AAWA,GAfC,CANH,CADC,CATH,CADD;AAqCA;;AAED1B,sBAAsB,CAAC2B,IAAvB,GAA8BC,aAA9B","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\nimport { Composite, CompositeGroup, useCompositeState } from '../composite';\nimport { Root, Row } from './styles/alignment-matrix-control-styles';\nimport AlignmentMatrixControlIcon from './icon';\nimport { GRID, getItemId } from './utils';\n\nconst noop = () => {};\n\nfunction useBaseId( id ) {\n\tconst instanceId = useInstanceId(\n\t\tAlignmentMatrixControl,\n\t\t'alignment-matrix-control'\n\t);\n\n\treturn id || instanceId;\n}\n\nexport default function AlignmentMatrixControl( {\n\tclassName,\n\tid,\n\tlabel = __( 'Alignment Matrix Control' ),\n\tdefaultValue = 'center center',\n\tvalue,\n\tonChange = noop,\n\twidth = 92,\n\t...props\n} ) {\n\tconst [ immutableDefaultValue ] = useState( value ?? defaultValue );\n\tconst baseId = useBaseId( id );\n\tconst initialCurrentId = getItemId( baseId, immutableDefaultValue );\n\n\tconst composite = useCompositeState( {\n\t\tbaseId,\n\t\tcurrentId: initialCurrentId,\n\t\trtl: isRTL(),\n\t} );\n\n\tconst handleOnChange = ( nextValue ) => {\n\t\tonChange( nextValue );\n\t};\n\n\tconst { setCurrentId } = composite;\n\n\tuseEffect( () => {\n\t\tif ( typeof value !== 'undefined' ) {\n\t\t\tsetCurrentId( getItemId( baseId, value ) );\n\t\t}\n\t}, [ value, setCurrentId, baseId ] );\n\n\tconst classes = classnames(\n\t\t'component-alignment-matrix-control',\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<Composite\n\t\t\t{ ...props }\n\t\t\t{ ...composite }\n\t\t\taria-label={ label }\n\t\t\tas={ Root }\n\t\t\tclassName={ classes }\n\t\t\trole=\"grid\"\n\t\t\twidth={ width }\n\t\t>\n\t\t\t{ GRID.map( ( cells, index ) => (\n\t\t\t\t<CompositeGroup\n\t\t\t\t\t{ ...composite }\n\t\t\t\t\tas={ Row }\n\t\t\t\t\trole=\"row\"\n\t\t\t\t\tkey={ index }\n\t\t\t\t>\n\t\t\t\t\t{ cells.map( ( cell ) => {\n\t\t\t\t\t\tconst cellId = getItemId( baseId, cell );\n\t\t\t\t\t\tconst isActive = composite.currentId === cellId;\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Cell\n\t\t\t\t\t\t\t\t{ ...composite }\n\t\t\t\t\t\t\t\tid={ cellId }\n\t\t\t\t\t\t\t\tisActive={ isActive }\n\t\t\t\t\t\t\t\tkey={ cell }\n\t\t\t\t\t\t\t\tvalue={ cell }\n\t\t\t\t\t\t\t\tonFocus={ () => handleOnChange( cell ) }\n\t\t\t\t\t\t\t\ttabIndex={ isActive ? 0 : -1 }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</CompositeGroup>\n\t\t\t) ) }\n\t\t</Composite>\n\t);\n}\n\nAlignmentMatrixControl.Icon = AlignmentMatrixControlIcon;\n"]}
|
|
@@ -15,7 +15,7 @@ var _i18n = require("@wordpress/i18n");
|
|
|
15
15
|
|
|
16
16
|
var _flex = require("../flex");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _numberControl = _interopRequireDefault(require("../number-control"));
|
|
19
19
|
|
|
20
20
|
var _angleCircle = _interopRequireDefault(require("./angle-circle"));
|
|
21
21
|
|
|
@@ -54,7 +54,7 @@ function AnglePickerControl(_ref) {
|
|
|
54
54
|
const classes = (0, _classnames.default)('components-angle-picker-control', className);
|
|
55
55
|
return (0, _element.createElement)(_anglePickerControlStyles.Root, {
|
|
56
56
|
className: classes
|
|
57
|
-
}, (0, _element.createElement)(_flex.FlexBlock, null, (0, _element.createElement)(
|
|
57
|
+
}, (0, _element.createElement)(_flex.FlexBlock, null, (0, _element.createElement)(_numberControl.default, {
|
|
58
58
|
label: label,
|
|
59
59
|
className: "components-angle-picker-control__input-field",
|
|
60
60
|
max: 360,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/angle-picker-control/index.js"],"names":["AnglePickerControl","className","label","onChange","value","handleOnNumberChange","unprocessedValue","inputValue","parseInt","classes","Text","color","marginLeft","marginBottom","marginTop"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AASe,SAASA,kBAAT,OAKX;AAAA,MALwC;AAC3CC,IAAAA,SAD2C;AAE3CC,IAAAA,KAAK,GAAG,cAAI,OAAJ,CAFmC;AAG3CC,IAAAA,QAH2C;AAI3CC,IAAAA;AAJ2C,GAKxC;;AACH,QAAMC,oBAAoB,GAAKC,gBAAF,IAAwB;AACpD,UAAMC,UAAU,GACfD,gBAAgB,KAAK,EAArB,GAA0BE,QAAQ,CAAEF,gBAAF,EAAoB,EAApB,CAAlC,GAA6D,CAD9D;AAEAH,IAAAA,QAAQ,CAAEI,UAAF,CAAR;AACA,GAJD;;AAMA,QAAME,OAAO,GAAG,yBAAY,iCAAZ,EAA+CR,SAA/C,CAAhB;AAEA,SACC,4BAAC,8BAAD;AAAM,IAAA,SAAS,EAAGQ;AAAlB,KACC,4BAAC,eAAD,QACC,4BAAC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/angle-picker-control/index.js"],"names":["AnglePickerControl","className","label","onChange","value","handleOnNumberChange","unprocessedValue","inputValue","parseInt","classes","Text","color","marginLeft","marginBottom","marginTop"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AASe,SAASA,kBAAT,OAKX;AAAA,MALwC;AAC3CC,IAAAA,SAD2C;AAE3CC,IAAAA,KAAK,GAAG,cAAI,OAAJ,CAFmC;AAG3CC,IAAAA,QAH2C;AAI3CC,IAAAA;AAJ2C,GAKxC;;AACH,QAAMC,oBAAoB,GAAKC,gBAAF,IAAwB;AACpD,UAAMC,UAAU,GACfD,gBAAgB,KAAK,EAArB,GAA0BE,QAAQ,CAAEF,gBAAF,EAAoB,EAApB,CAAlC,GAA6D,CAD9D;AAEAH,IAAAA,QAAQ,CAAEI,UAAF,CAAR;AACA,GAJD;;AAMA,QAAME,OAAO,GAAG,yBAAY,iCAAZ,EAA+CR,SAA/C,CAAhB;AAEA,SACC,4BAAC,8BAAD;AAAM,IAAA,SAAS,EAAGQ;AAAlB,KACC,4BAAC,eAAD,QACC,4BAAC,sBAAD;AACC,IAAA,KAAK,EAAGP,KADT;AAEC,IAAA,SAAS,EAAC,8CAFX;AAGC,IAAA,GAAG,EAAG,GAHP;AAIC,IAAA,GAAG,EAAG,CAJP;AAKC,IAAA,QAAQ,EAAGG,oBALZ;AAMC,IAAA,IAAI,EAAC,kBANN;AAOC,IAAA,IAAI,EAAC,GAPN;AAQC,IAAA,KAAK,EAAGD,KART;AASC,IAAA,cAAc,MATf;AAUC,IAAA,MAAM,EACL,4BAAC,cAAD;AACC,MAAA,EAAE,EAAGM,UADN;AAEC,MAAA,YAAY,EAAG,CAFhB;AAGC,MAAA,WAAW,EAAG,kBAAO,CAAP,CAHf;AAIC,MAAA,KAAK,EAAG;AACPC,QAAAA,KAAK,EAAE;AADA;AAJT;AAXF,IADD,CADD,EA0BC,4BAAC,cAAD;AACC,IAAA,KAAK,EAAG;AACPC,MAAAA,UAAU,EAAE,kBAAO,CAAP,CADL;AAEPC,MAAAA,YAAY,EAAE,kBAAO,CAAP,CAFP;AAGPC,MAAAA,SAAS,EAAE;AAHJ;AADT,KAOC,4BAAC,oBAAD;AACC,mBAAY,MADb;AAEC,IAAA,KAAK,EAAGV,KAFT;AAGC,IAAA,QAAQ,EAAGD;AAHZ,IAPD,CA1BD,CADD;AA0CA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { FlexBlock, FlexItem } from '../flex';\nimport NumberControl from '../number-control';\nimport AngleCircle from './angle-circle';\nimport { Root } from './styles/angle-picker-control-styles';\nimport { space } from '../ui/utils/space';\nimport { Text } from '../text';\nimport { Spacer } from '../spacer';\n\nexport default function AnglePickerControl( {\n\tclassName,\n\tlabel = __( 'Angle' ),\n\tonChange,\n\tvalue,\n} ) {\n\tconst handleOnNumberChange = ( unprocessedValue ) => {\n\t\tconst inputValue =\n\t\t\tunprocessedValue !== '' ? parseInt( unprocessedValue, 10 ) : 0;\n\t\tonChange( inputValue );\n\t};\n\n\tconst classes = classnames( 'components-angle-picker-control', className );\n\n\treturn (\n\t\t<Root className={ classes }>\n\t\t\t<FlexBlock>\n\t\t\t\t<NumberControl\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tclassName=\"components-angle-picker-control__input-field\"\n\t\t\t\t\tmax={ 360 }\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tonChange={ handleOnNumberChange }\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tstep=\"1\"\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\thideHTMLArrows\n\t\t\t\t\tsuffix={\n\t\t\t\t\t\t<Spacer\n\t\t\t\t\t\t\tas={ Text }\n\t\t\t\t\t\t\tmarginBottom={ 0 }\n\t\t\t\t\t\t\tmarginRight={ space( 3 ) }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tcolor: 'var( --wp-admin-theme-color )',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t°\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</FlexBlock>\n\t\t\t<FlexItem\n\t\t\t\tstyle={ {\n\t\t\t\t\tmarginLeft: space( 4 ),\n\t\t\t\t\tmarginBottom: space( 1 ),\n\t\t\t\t\tmarginTop: 'auto',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<AngleCircle\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t</FlexItem>\n\t\t</Root>\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/border-box-control/border-box-control-linked-button/component.tsx"],"names":["BorderBoxControlLinkedButton","props","forwardedRef","className","isLinked","buttonProps","label","link","linkOff","ConnectedBorderBoxControlLinkedButton"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;AASA,MAAMA,4BAA4B,GAAG,CACpCC,KADoC,EAEpCC,YAFoC,KAGhC;AACJ,QAAM;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/border-box-control/border-box-control-linked-button/component.tsx"],"names":["BorderBoxControlLinkedButton","props","forwardedRef","className","isLinked","buttonProps","label","link","linkOff","ConnectedBorderBoxControlLinkedButton"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;AASA,MAAMA,4BAA4B,GAAG,CACpCC,KADoC,EAEpCC,YAFoC,KAGhC;AACJ,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,QAAb;AAAuB,OAAGC;AAA1B,MACL,2CAAiCJ,KAAjC,CADD;AAEA,QAAMK,KAAK,GAAGF,QAAQ,GAAG,cAAI,cAAJ,CAAH,GAA0B,cAAI,YAAJ,CAAhD;AAEA,SACC,4BAAC,gBAAD;AAAS,IAAA,IAAI,EAAGE;AAAhB,KACC,4BAAC,UAAD;AAAM,IAAA,SAAS,EAAGH;AAAlB,KACC,4BAAC,eAAD,6BACME,WADN;AAEC,IAAA,OAAO,EAAGD,QAAQ,GAAG,SAAH,GAAe,WAFlC;AAGC,IAAA,OAAO,MAHR;AAIC,IAAA,IAAI,EAAGA,QAAQ,GAAGG,WAAH,GAAUC,cAJ1B;AAKC,IAAA,QAAQ,EAAG,EALZ;AAMC,kBAAaF,KANd;AAOC,IAAA,GAAG,EAAGJ;AAPP,KADD,CADD,CADD;AAeA,CAvBD;;AAyBA,MAAMO,qCAAqC,GAAG,6BAC7CT,4BAD6C,EAE7C,8BAF6C,CAA9C;eAIeS,qC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { link, linkOff } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport Tooltip from '../../tooltip';\nimport { View } from '../../view';\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { useBorderBoxControlLinkedButton } from './hook';\n\nimport type { LinkedButtonProps } from '../types';\n\nconst BorderBoxControlLinkedButton = (\n\tprops: WordPressComponentProps< LinkedButtonProps, 'div' >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst { className, isLinked, ...buttonProps } =\n\t\tuseBorderBoxControlLinkedButton( props );\n\tconst label = isLinked ? __( 'Unlink sides' ) : __( 'Link sides' );\n\n\treturn (\n\t\t<Tooltip text={ label }>\n\t\t\t<View className={ className }>\n\t\t\t\t<Button\n\t\t\t\t\t{ ...buttonProps }\n\t\t\t\t\tvariant={ isLinked ? 'primary' : 'secondary' }\n\t\t\t\t\tisSmall\n\t\t\t\t\ticon={ isLinked ? link : linkOff }\n\t\t\t\t\ticonSize={ 16 }\n\t\t\t\t\taria-label={ label }\n\t\t\t\t\tref={ forwardedRef }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</Tooltip>\n\t);\n};\n\nconst ConnectedBorderBoxControlLinkedButton = contextConnect(\n\tBorderBoxControlLinkedButton,\n\t'BorderBoxControlLinkedButton'\n);\nexport default ConnectedBorderBoxControlLinkedButton;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/border-box-control/utils.ts"],"names":["sides","borderProps","isEmptyBorder","border","some","prop","undefined","isDefinedBorder","hasSplitBorders","allSidesEmpty","every","side","isCompleteBorder","Object","keys","indexOf","hasMixedBorders","borders","shorthandBorders","map","getShorthandBorderStyle","getSplitBorders","top","right","bottom","left","getBorderDiff","original","updated","diff","color","style","width","getCommonBorder","colors","styles","widths","forEach","push","allColorsMatch","value","allStylesMatch","allWidthsMatch","fallbackBorder","fallbackColor","fallbackStyle","fallbackWidth","hasVisibleBorder","borderStyle","filter","Boolean","join"],"mappings":";;;;;;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,KAAmB,GAAG,CAAE,KAAF,EAAS,OAAT,EAAkB,QAAlB,EAA4B,MAA5B,CAA5B;AACA,MAAMC,WAAyB,GAAG,CAAE,OAAF,EAAW,OAAX,EAAoB,OAApB,CAAlC;;AAEO,MAAMC,aAAa,GAAKC,MAAF,IAAuB;AACnD,MAAK,CAAEA,MAAP,EAAgB;AACf,WAAO,IAAP;AACA;;AACD,SAAO,CAAEF,WAAW,CAACG,IAAZ,CAAoBC,IAAF,IAAYF,MAAM,CAAEE,IAAF,CAAN,KAAmBC,SAAjD,CAAT;AACA,CALM;;;;AAOA,MAAMC,eAAe,GAAKJ,MAAF,IAAyB;AACvD;AACA,MAAK,CAAEA,MAAP,EAAgB;AACf,WAAO,KAAP;AACA,GAJsD,CAMvD;AACA;;;AACA,MAAKK,eAAe,CAAEL,MAAF,CAApB,EAAiC;AAChC,UAAMM,aAAa,GAAGT,KAAK,CAACU,KAAN,CAAeC,IAAF,IAClCT,aAAa,CAAIC,MAAF,CAAuBQ,IAAvB,CAAF,CADQ,CAAtB;AAIA,WAAO,CAAEF,aAAT;AACA,GAdsD,CAgBvD;AACA;AACA;AACA;;;AACA,SAAO,CAAEP,aAAa,CAAEC,MAAF,CAAtB;AACA,CArBM;;;;AAuBA,MAAMS,gBAAgB,GAAKT,MAAF,IAAuB;AACtD,MAAK,CAAEA,MAAP,EAAgB;AACf,WAAO,KAAP;AACA;;AAED,SAAOF,WAAW,CAACS,KAAZ,CAAqBL,IAAF,IAAYF,MAAM,CAAEE,IAAF,CAAN,KAAmBC,SAAlD,CAAP;AACA,CANM;;;;AAQA,MAAME,eAAe,GAAG,YAA8B;AAAA,MAA5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AAAA,KAAK,EAAEU,cAAc,GAAGN,MAAM,CAAE,CAAF,CAAT,GAAiB9B;AAHhC,GAAP;AAKA,CAxBM;;;;AA0BA,MAAMc,uBAAuB,GAAG,CACtCjB,MADsC,EAEtCwC,cAFsC,KAGlC;AACJ,MAAKzC,aAAa,CAAEC,MAAF,CAAlB,EAA+B;AAC9B,WAAOwC,cAAP;AACA;;AAED,QAAM;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/border-box-control/utils.ts"],"names":["sides","borderProps","isEmptyBorder","border","some","prop","undefined","isDefinedBorder","hasSplitBorders","allSidesEmpty","every","side","isCompleteBorder","Object","keys","indexOf","hasMixedBorders","borders","shorthandBorders","map","getShorthandBorderStyle","getSplitBorders","top","right","bottom","left","getBorderDiff","original","updated","diff","color","style","width","getCommonBorder","colors","styles","widths","forEach","push","allColorsMatch","value","allStylesMatch","allWidthsMatch","fallbackBorder","fallbackColor","fallbackStyle","fallbackWidth","hasVisibleBorder","borderStyle","filter","Boolean","join"],"mappings":";;;;;;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,KAAmB,GAAG,CAAE,KAAF,EAAS,OAAT,EAAkB,QAAlB,EAA4B,MAA5B,CAA5B;AACA,MAAMC,WAAyB,GAAG,CAAE,OAAF,EAAW,OAAX,EAAoB,OAApB,CAAlC;;AAEO,MAAMC,aAAa,GAAKC,MAAF,IAAuB;AACnD,MAAK,CAAEA,MAAP,EAAgB;AACf,WAAO,IAAP;AACA;;AACD,SAAO,CAAEF,WAAW,CAACG,IAAZ,CAAoBC,IAAF,IAAYF,MAAM,CAAEE,IAAF,CAAN,KAAmBC,SAAjD,CAAT;AACA,CALM;;;;AAOA,MAAMC,eAAe,GAAKJ,MAAF,IAAyB;AACvD;AACA,MAAK,CAAEA,MAAP,EAAgB;AACf,WAAO,KAAP;AACA,GAJsD,CAMvD;AACA;;;AACA,MAAKK,eAAe,CAAEL,MAAF,CAApB,EAAiC;AAChC,UAAMM,aAAa,GAAG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OAAtC,EAAgDC,IAAhD,CAAsD,GAAtD,CAAP;AACA,CAxBM","sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { Border } from '../border-control/types';\nimport type { AnyBorder, Borders, BorderProp, BorderSide } from './types';\n\nconst sides: BorderSide[] = [ 'top', 'right', 'bottom', 'left' ];\nconst borderProps: BorderProp[] = [ 'color', 'style', 'width' ];\n\nexport const isEmptyBorder = ( border?: Border ) => {\n\tif ( ! border ) {\n\t\treturn true;\n\t}\n\treturn ! borderProps.some( ( prop ) => border[ prop ] !== undefined );\n};\n\nexport const isDefinedBorder = ( border: AnyBorder ) => {\n\t// No border, no worries :)\n\tif ( ! border ) {\n\t\treturn false;\n\t}\n\n\t// If we have individual borders per side within the border object we\n\t// need to check whether any of those side borders have been set.\n\tif ( hasSplitBorders( border ) ) {\n\t\tconst allSidesEmpty = sides.every( ( side ) =>\n\t\t\tisEmptyBorder( ( border as Borders )[ side ] )\n\t\t);\n\n\t\treturn ! allSidesEmpty;\n\t}\n\n\t// If we have a top-level border only, check if that is empty. e.g.\n\t// { color: undefined, style: undefined, width: undefined }\n\t// Border radius can still be set within the border object as it is\n\t// handled separately.\n\treturn ! isEmptyBorder( border as Border );\n};\n\nexport const isCompleteBorder = ( border?: Border ) => {\n\tif ( ! border ) {\n\t\treturn false;\n\t}\n\n\treturn borderProps.every( ( prop ) => border[ prop ] !== undefined );\n};\n\nexport const hasSplitBorders = ( border: AnyBorder = {} ) => {\n\treturn Object.keys( border ).some(\n\t\t( side ) => sides.indexOf( side as BorderSide ) !== -1\n\t);\n};\n\nexport const hasMixedBorders = ( borders: AnyBorder ) => {\n\tif ( ! hasSplitBorders( borders ) ) {\n\t\treturn false;\n\t}\n\n\tconst shorthandBorders = sides.map( ( side: BorderSide ) =>\n\t\tgetShorthandBorderStyle( ( borders as Borders )?.[ side ] )\n\t);\n\n\treturn ! shorthandBorders.every(\n\t\t( border ) => border === shorthandBorders[ 0 ]\n\t);\n};\n\nexport const getSplitBorders = ( border?: Border ) => {\n\tif ( ! border || isEmptyBorder( border ) ) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\ttop: border,\n\t\tright: border,\n\t\tbottom: border,\n\t\tleft: border,\n\t};\n};\n\nexport const getBorderDiff = ( original: Border, updated: Border ) => {\n\tconst diff: Border = {};\n\n\tif ( original.color !== updated.color ) {\n\t\tdiff.color = updated.color;\n\t}\n\n\tif ( original.style !== updated.style ) {\n\t\tdiff.style = updated.style;\n\t}\n\n\tif ( original.width !== updated.width ) {\n\t\tdiff.width = updated.width;\n\t}\n\n\treturn diff;\n};\n\nexport const getCommonBorder = ( borders?: Borders ) => {\n\tif ( ! borders ) {\n\t\treturn undefined;\n\t}\n\n\tconst colors: ( CSSProperties[ 'borderColor' ] | undefined )[] = [];\n\tconst styles: ( CSSProperties[ 'borderStyle' ] | undefined )[] = [];\n\tconst widths: ( CSSProperties[ 'borderWidth' ] | undefined )[] = [];\n\n\tsides.forEach( ( side ) => {\n\t\tcolors.push( borders[ side ]?.color );\n\t\tstyles.push( borders[ side ]?.style );\n\t\twidths.push( borders[ side ]?.width );\n\t} );\n\n\tconst allColorsMatch = colors.every( ( value ) => value === colors[ 0 ] );\n\tconst allStylesMatch = styles.every( ( value ) => value === styles[ 0 ] );\n\tconst allWidthsMatch = widths.every( ( value ) => value === widths[ 0 ] );\n\n\treturn {\n\t\tcolor: allColorsMatch ? colors[ 0 ] : undefined,\n\t\tstyle: allStylesMatch ? styles[ 0 ] : undefined,\n\t\twidth: allWidthsMatch ? widths[ 0 ] : undefined,\n\t};\n};\n\nexport const getShorthandBorderStyle = (\n\tborder?: Border,\n\tfallbackBorder?: Border\n) => {\n\tif ( isEmptyBorder( border ) ) {\n\t\treturn fallbackBorder;\n\t}\n\n\tconst {\n\t\tcolor: fallbackColor,\n\t\tstyle: fallbackStyle,\n\t\twidth: fallbackWidth,\n\t} = fallbackBorder || {};\n\n\tconst {\n\t\tcolor = fallbackColor,\n\t\tstyle = fallbackStyle,\n\t\twidth = fallbackWidth,\n\t} = border as Border;\n\n\tconst hasVisibleBorder = ( !! width && width !== '0' ) || !! color;\n\tconst borderStyle = hasVisibleBorder ? style || 'solid' : style;\n\n\treturn [ width, borderStyle, color ].filter( Boolean ).join( ' ' );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/border-control/border-control/hook.ts"],"names":["sanitizeBorder","border","hasNoWidth","width","undefined","hasNoColor","color","useBorderControl","props","className","isCompact","onChange","shouldSanitizeBorder","value","__next36pxDefaultSize","otherProps","widthValue","originalWidthUnit","widthUnit","hadPreviousZeroWidth","colorSelection","setColorSelection","styleSelection","setStyleSelection","onBorderChange","newBorder","onWidthChange","newWidth","newWidthValue","parsedValue","hasZeroWidth","updatedBorder","style","onSliderChange","cx","classes","styles","borderControl","innerWrapperClassName","wrapperWidth","widthStyle","heightStyle","wrapperHeight","innerWrapper","widthControlClassName","borderWidthControl","sliderClassName","borderSlider","previousStyleSelection"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;;;;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAQA,MAAMA,cAAc,GAAKC,MAAF,IAAuB;AAC7C,QAAMC,UAAU,GAAG,CAAAD,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEE,KAAR,MAAkBC,SAAlB,IAA+BH,MAAM,CAACE,KAAP,KAAiB,EAAnE;AACA,QAAME,UAAU,GAAG,CAAAJ,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEK,KAAR,MAAkBF,SAArC,CAF6C,CAI7C;;AACA,MAAKF,UAAU,IAAIG,UAAnB,EAAgC;AAC/B,WAAOD,SAAP;AACA;;AAED,SAAOH,MAAP;AACA,CAVD;;AAYO,SAASM,gBAAT,CACNC,KADM,EAEL;AACD,QAAM;AACLC,IAAAA,SADK;AAELC,IAAAA,SAFK;AAGLC,IAAAA,QAHK;AAILC,IAAAA,oBAAoB,GAAG,IAJlB;AAKLC,IAAAA,KAAK,EAAEZ,MALF;AAMLE,IAAAA,KANK;AAOLW,IAAAA,qBAAqB,GAAG,KAPnB;AAQL,OAAGC;AARE,MASF,+BAAkBP,KAAlB,EAAyB,eAAzB,CATJ;AAWA,QAAM,CAAEQ,UAAF,EAAcC,iBAAd,IAAoC,6CACzChB,MADyC,aACzCA,MADyC,uBACzCA,MAAM,CAAEE,KADiC,CAA1C;AAGA,QAAMe,SAAS,GAAGD,iBAAiB,IAAI,IAAvC;AACA,QAAME,oBAAoB,GAAGH,UAAU,KAAK,CAA5C;AAEA,QAAM,CAAEI,cAAF,EAAkBC,iBAAlB,IAAwC,wBAA9C;AACA,QAAM,CAAEC,cAAF,EAAkBC,iBAAlB,IAAwC,wBAA9C;AAEA,QAAMC,cAAc,GAAG,0BACpBC,SAAF,IAA0B;AACzB,QAAKb,oBAAL,EAA4B;AAC3B,aAAOD,QAAQ,CAAEX,cAAc,CAAEyB,SAAF,CAAhB,CAAf;AACA;;AAEDd,IAAAA,QAAQ,CAAEc,SAAF,CAAR;AACA,GAPqB,EAQtB,CAAEd,QAAF,EAAYC,oBAAZ,CARsB,CAAvB;AAWA,QAAMc,aAAa,GAAG,0BACnBC,QAAF,IAAyB;AACxB,UAAMC,aAAa,GAAGD,QAAQ,KAAK,EAAb,GAAkBvB,SAAlB,GAA8BuB,QAApD;AACA,UAAM,CAAEE,WAAF,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/border-control/border-control/hook.ts"],"names":["sanitizeBorder","border","hasNoWidth","width","undefined","hasNoColor","color","useBorderControl","props","className","isCompact","onChange","shouldSanitizeBorder","value","__next36pxDefaultSize","otherProps","widthValue","originalWidthUnit","widthUnit","hadPreviousZeroWidth","colorSelection","setColorSelection","styleSelection","setStyleSelection","onBorderChange","newBorder","onWidthChange","newWidth","newWidthValue","parsedValue","hasZeroWidth","updatedBorder","style","onSliderChange","cx","classes","styles","borderControl","innerWrapperClassName","wrapperWidth","widthStyle","heightStyle","wrapperHeight","innerWrapper","widthControlClassName","borderWidthControl","sliderClassName","borderSlider","previousStyleSelection"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;;;;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAQA,MAAMA,cAAc,GAAKC,MAAF,IAAuB;AAC7C,QAAMC,UAAU,GAAG,CAAAD,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEE,KAAR,MAAkBC,SAAlB,IAA+BH,MAAM,CAACE,KAAP,KAAiB,EAAnE;AACA,QAAME,UAAU,GAAG,CAAAJ,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEK,KAAR,MAAkBF,SAArC,CAF6C,CAI7C;;AACA,MAAKF,UAAU,IAAIG,UAAnB,EAAgC;AAC/B,WAAOD,SAAP;AACA;;AAED,SAAOH,MAAP;AACA,CAVD;;AAYO,SAASM,gBAAT,CACNC,KADM,EAEL;AACD,QAAM;AACLC,IAAAA,SADK;AAELC,IAAAA,SAFK;AAGLC,IAAAA,QAHK;AAILC,IAAAA,oBAAoB,GAAG,IAJlB;AAKLC,IAAAA,KAAK,EAAEZ,MALF;AAMLE,IAAAA,KANK;AAOLW,IAAAA,qBAAqB,GAAG,KAPnB;AAQL,OAAGC;AARE,MASF,+BAAkBP,KAAlB,EAAyB,eAAzB,CATJ;AAWA,QAAM,CAAEQ,UAAF,EAAcC,iBAAd,IAAoC,6CACzChB,MADyC,aACzCA,MADyC,uBACzCA,MAAM,CAAEE,KADiC,CAA1C;AAGA,QAAMe,SAAS,GAAGD,iBAAiB,IAAI,IAAvC;AACA,QAAME,oBAAoB,GAAGH,UAAU,KAAK,CAA5C;AAEA,QAAM,CAAEI,cAAF,EAAkBC,iBAAlB,IAAwC,wBAA9C;AACA,QAAM,CAAEC,cAAF,EAAkBC,iBAAlB,IAAwC,wBAA9C;AAEA,QAAMC,cAAc,GAAG,0BACpBC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AAGnB,UADG;AAENN,IAAAA,SAAS,EAAE0B,OAFL;AAGNG,IAAAA,qBAHM;AAINd,IAAAA,cAJM;AAKNS,IAAAA,cALM;AAMNP,IAAAA,aANM;AAONsB,IAAAA,sBAAsB,EAAE1B,cAPlB;AAQNwB,IAAAA,eARM;AASNjC,IAAAA,KAAK,EAAEZ,MATD;AAUN2C,IAAAA,qBAVM;AAWN1B,IAAAA,SAXM;AAYNF,IAAAA,UAZM;AAaNF,IAAAA;AAbM,GAAP;AAeA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport * as styles from '../styles';\nimport { parseQuantityAndUnitFromRawValue } from '../../unit-control/utils';\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\n\nimport type { Border, BorderControlProps } from '../types';\n\nconst sanitizeBorder = ( border?: Border ) => {\n\tconst hasNoWidth = border?.width === undefined || border.width === '';\n\tconst hasNoColor = border?.color === undefined;\n\n\t// If width and color are undefined, unset any style selection as well.\n\tif ( hasNoWidth && hasNoColor ) {\n\t\treturn undefined;\n\t}\n\n\treturn border;\n};\n\nexport function useBorderControl(\n\tprops: WordPressComponentProps< BorderControlProps, 'div' >\n) {\n\tconst {\n\t\tclassName,\n\t\tisCompact,\n\t\tonChange,\n\t\tshouldSanitizeBorder = true,\n\t\tvalue: border,\n\t\twidth,\n\t\t__next36pxDefaultSize = false,\n\t\t...otherProps\n\t} = useContextSystem( props, 'BorderControl' );\n\n\tconst [ widthValue, originalWidthUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tborder?.width\n\t);\n\tconst widthUnit = originalWidthUnit || 'px';\n\tconst hadPreviousZeroWidth = widthValue === 0;\n\n\tconst [ colorSelection, setColorSelection ] = useState< string >();\n\tconst [ styleSelection, setStyleSelection ] = useState< string >();\n\n\tconst onBorderChange = useCallback(\n\t\t( newBorder?: Border ) => {\n\t\t\tif ( shouldSanitizeBorder ) {\n\t\t\t\treturn onChange( sanitizeBorder( newBorder ) );\n\t\t\t}\n\n\t\t\tonChange( newBorder );\n\t\t},\n\t\t[ onChange, shouldSanitizeBorder ]\n\t);\n\n\tconst onWidthChange = useCallback(\n\t\t( newWidth?: string ) => {\n\t\t\tconst newWidthValue = newWidth === '' ? undefined : newWidth;\n\t\t\tconst [ parsedValue ] =\n\t\t\t\tparseQuantityAndUnitFromRawValue( newWidth );\n\t\t\tconst hasZeroWidth = parsedValue === 0;\n\n\t\t\tconst updatedBorder = { ...border, width: newWidthValue };\n\n\t\t\t// Setting the border width explicitly to zero will also set the\n\t\t\t// border style to `none` and clear the border color.\n\t\t\tif ( hasZeroWidth && ! hadPreviousZeroWidth ) {\n\t\t\t\t// Before clearing the color and style selections, keep track of\n\t\t\t\t// the current selections so they can be restored when the width\n\t\t\t\t// changes to a non-zero value.\n\t\t\t\tsetColorSelection( border?.color );\n\t\t\t\tsetStyleSelection( border?.style );\n\n\t\t\t\t// Clear the color and style border properties.\n\t\t\t\tupdatedBorder.color = undefined;\n\t\t\t\tupdatedBorder.style = 'none';\n\t\t\t}\n\n\t\t\t// Selection has changed from zero border width to non-zero width.\n\t\t\tif ( ! hasZeroWidth && hadPreviousZeroWidth ) {\n\t\t\t\t// Restore previous border color and style selections if width\n\t\t\t\t// is now not zero.\n\t\t\t\tif ( updatedBorder.color === undefined ) {\n\t\t\t\t\tupdatedBorder.color = colorSelection;\n\t\t\t\t}\n\t\t\t\tif ( updatedBorder.style === 'none' ) {\n\t\t\t\t\tupdatedBorder.style = styleSelection;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tonBorderChange( updatedBorder );\n\t\t},\n\t\t[\n\t\t\tborder,\n\t\t\thadPreviousZeroWidth,\n\t\t\tcolorSelection,\n\t\t\tstyleSelection,\n\t\t\tonBorderChange,\n\t\t]\n\t);\n\n\tconst onSliderChange = useCallback(\n\t\t( value: string ) => {\n\t\t\tonWidthChange( `${ value }${ widthUnit }` );\n\t\t},\n\t\t[ onWidthChange, widthUnit ]\n\t);\n\n\t// Generate class names.\n\tconst cx = useCx();\n\tconst classes = useMemo( () => {\n\t\treturn cx( styles.borderControl, className );\n\t}, [ className, cx ] );\n\n\tconst innerWrapperClassName = useMemo( () => {\n\t\tconst wrapperWidth = isCompact ? '90px' : width;\n\t\tconst widthStyle =\n\t\t\t!! wrapperWidth && styles.wrapperWidth( wrapperWidth );\n\t\tconst heightStyle = styles.wrapperHeight( __next36pxDefaultSize );\n\n\t\treturn cx( styles.innerWrapper(), widthStyle, heightStyle );\n\t}, [ isCompact, width, cx, __next36pxDefaultSize ] );\n\n\tconst widthControlClassName = useMemo( () => {\n\t\treturn cx( styles.borderWidthControl() );\n\t}, [ cx ] );\n\n\tconst sliderClassName = useMemo( () => {\n\t\treturn cx( styles.borderSlider() );\n\t}, [ cx ] );\n\n\treturn {\n\t\t...otherProps,\n\t\tclassName: classes,\n\t\tinnerWrapperClassName,\n\t\tonBorderChange,\n\t\tonSliderChange,\n\t\tonWidthChange,\n\t\tpreviousStyleSelection: styleSelection,\n\t\tsliderClassName,\n\t\tvalue: border,\n\t\twidthControlClassName,\n\t\twidthUnit,\n\t\twidthValue,\n\t\t__next36pxDefaultSize,\n\t};\n}\n"]}
|
|
@@ -11,25 +11,21 @@ var _element = require("@wordpress/element");
|
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
14
|
-
var _lodash = require("lodash");
|
|
15
|
-
|
|
16
14
|
var _unitControl = _interopRequireDefault(require("./unit-control"));
|
|
17
15
|
|
|
18
16
|
var _utils = require("./utils");
|
|
19
17
|
|
|
20
|
-
/**
|
|
21
|
-
* External dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
18
|
/**
|
|
25
19
|
* Internal dependencies
|
|
26
20
|
*/
|
|
21
|
+
const noop = () => {};
|
|
22
|
+
|
|
27
23
|
function AllInputControl(_ref) {
|
|
28
24
|
let {
|
|
29
|
-
onChange =
|
|
30
|
-
onFocus =
|
|
31
|
-
onHoverOn =
|
|
32
|
-
onHoverOff =
|
|
25
|
+
onChange = noop,
|
|
26
|
+
onFocus = noop,
|
|
27
|
+
onHoverOn = noop,
|
|
28
|
+
onHoverOff = noop,
|
|
33
29
|
values,
|
|
34
30
|
sides,
|
|
35
31
|
selectedUnits,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/box-control/all-input-control.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/box-control/all-input-control.js"],"names":["noop","AllInputControl","onChange","onFocus","onHoverOn","onHoverOff","values","sides","selectedUnits","setSelectedUnits","props","allValue","hasValues","isMixed","allPlaceholder","LABELS","mixed","handleOnFocus","event","side","applyValueToSides","currentValues","newValue","newValues","length","forEach","top","bottom","left","right","ALL_SIDES","handleOnChange","next","isNumeric","isNaN","parseFloat","nextValue","undefined","nextValues","handleOnUnitChange","unit","newUnits","handleOnHoverOn","handleOnHoverOff"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAUA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEe,SAASC,eAAT,OAUX;AAAA,MAVqC;AACxCC,IAAAA,QAAQ,GAAGF,IAD6B;AAExCG,IAAAA,OAAO,GAAGH,IAF8B;AAGxCI,IAAAA,SAAS,GAAGJ,IAH4B;AAIxCK,IAAAA,UAAU,GAAGL,IAJ2B;AAKxCM,IAAAA,MALwC;AAMxCC,IAAAA,KANwC;AAOxCC,IAAAA,aAPwC;AAQxCC,IAAAA,gBARwC;AASxC,OAAGC;AATqC,GAUrC;AACH,QAAMC,QAAQ,GAAG,wBAAaL,MAAb,EAAqBE,aAArB,EAAoCD,KAApC,CAAjB;AACA,QAAMK,SAAS,GAAG,4BAAiBN,MAAjB,CAAlB;AACA,QAAMO,OAAO,GAAGD,SAAS,IAAI,0BAAeN,MAAf,EAAuBE,aAAvB,EAAs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EAlC,IAAAA,QAAQ,CAAEoC,UAAF,CAAR;AACA,GAND,CAlCG,CA0CH;AACA;;;AACA,QAAMC,kBAAkB,GAAKC,IAAF,IAAY;AACtC,UAAMC,QAAQ,GAAGrB,iBAAiB,CAAEZ,aAAF,EAAiBgC,IAAjB,CAAlC;AACA/B,IAAAA,gBAAgB,CAAEgC,QAAF,CAAhB;AACA,GAHD;;AAKA,QAAMC,eAAe,GAAG,MAAM;AAC7BtC,IAAAA,SAAS,CAAE;AACVsB,MAAAA,GAAG,EAAE,IADK;AAEVC,MAAAA,MAAM,EAAE,IAFE;AAGVC,MAAAA,IAAI,EAAE,IAHI;AAIVC,MAAAA,KAAK,EAAE;AAJG,KAAF,CAAT;AAMA,GAPD;;AASA,QAAMc,gBAAgB,GAAG,MAAM;AAC9BtC,IAAAA,UAAU,CAAE;AACXqB,MAAAA,GAAG,EAAE,KADM;AAEXC,MAAAA,MAAM,EAAE,KAFG;AAGXC,MAAAA,IAAI,EAAE,KAHK;AAIXC,MAAAA,KAAK,EAAE;AAJI,KAAF,CAAV;AAMA,GAPD;;AASA,SACC,4BAAC,oBAAD,6BACMnB,KADN;AAEC,IAAA,YAAY,EAAGG,OAFhB;AAGC,IAAA,MAAM,MAHP;AAIC,IAAA,KAAK,EAAGF,QAJT;AAKC,IAAA,QAAQ,EAAGoB,cALZ;AAMC,IAAA,YAAY,EAAGQ,kBANhB;AAOC,IAAA,OAAO,EAAGtB,aAPX;AAQC,IAAA,SAAS,EAAGyB,eARb;AASC,IAAA,UAAU,EAAGC,gBATd;AAUC,IAAA,WAAW,EAAG7B;AAVf,KADD;AAcA","sourcesContent":["/**\n * Internal dependencies\n */\nimport UnitControl from './unit-control';\nimport {\n\tALL_SIDES,\n\tLABELS,\n\tgetAllValue,\n\tisValuesMixed,\n\tisValuesDefined,\n} from './utils';\n\nconst noop = () => {};\n\nexport default function AllInputControl( {\n\tonChange = noop,\n\tonFocus = noop,\n\tonHoverOn = noop,\n\tonHoverOff = noop,\n\tvalues,\n\tsides,\n\tselectedUnits,\n\tsetSelectedUnits,\n\t...props\n} ) {\n\tconst allValue = getAllValue( values, selectedUnits, sides );\n\tconst hasValues = isValuesDefined( values );\n\tconst isMixed = hasValues && isValuesMixed( values, selectedUnits, sides );\n\tconst allPlaceholder = isMixed ? LABELS.mixed : null;\n\n\tconst handleOnFocus = ( event ) => {\n\t\tonFocus( event, { side: 'all' } );\n\t};\n\n\t// Applies a value to an object representing top, right, bottom and left\n\t// sides while taking into account any custom side configuration.\n\tconst applyValueToSides = ( currentValues, newValue ) => {\n\t\tconst newValues = { ...currentValues };\n\n\t\tif ( sides?.length ) {\n\t\t\tsides.forEach( ( side ) => {\n\t\t\t\tif ( side === 'vertical' ) {\n\t\t\t\t\tnewValues.top = newValue;\n\t\t\t\t\tnewValues.bottom = newValue;\n\t\t\t\t} else if ( side === 'horizontal' ) {\n\t\t\t\t\tnewValues.left = newValue;\n\t\t\t\t\tnewValues.right = newValue;\n\t\t\t\t} else {\n\t\t\t\t\tnewValues[ side ] = newValue;\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tALL_SIDES.forEach( ( side ) => ( newValues[ side ] = newValue ) );\n\t\t}\n\n\t\treturn newValues;\n\t};\n\n\tconst handleOnChange = ( next ) => {\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\t\tconst nextValues = applyValueToSides( values, nextValue );\n\n\t\tonChange( nextValues );\n\t};\n\n\t// Set selected unit so it can be used as fallback by unlinked controls\n\t// when individual sides do not have a value containing a unit.\n\tconst handleOnUnitChange = ( unit ) => {\n\t\tconst newUnits = applyValueToSides( selectedUnits, unit );\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\tconst handleOnHoverOn = () => {\n\t\tonHoverOn( {\n\t\t\ttop: true,\n\t\t\tbottom: true,\n\t\t\tleft: true,\n\t\t\tright: true,\n\t\t} );\n\t};\n\n\tconst handleOnHoverOff = () => {\n\t\tonHoverOff( {\n\t\t\ttop: false,\n\t\t\tbottom: false,\n\t\t\tleft: false,\n\t\t\tright: false,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<UnitControl\n\t\t\t{ ...props }\n\t\t\tdisableUnits={ isMixed }\n\t\t\tisOnly\n\t\t\tvalue={ allValue }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonUnitChange={ handleOnUnitChange }\n\t\t\tonFocus={ handleOnFocus }\n\t\t\tonHoverOn={ handleOnHoverOn }\n\t\t\tonHoverOff={ handleOnHoverOff }\n\t\t\tplaceholder={ allPlaceholder }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/box-control/axial-input-controls.js"],"names":["groupedSides","AxialInputControls","onChange","onFocus","onHoverOn","onHoverOff","values","selectedUnits","setSelectedUnits","sides","props","createHandleOnFocus","side","event","createHandleOnHoverOn","top","bottom","left","right","createHandleOnHoverOff","createHandleOnChange","next","nextValues","isNumeric","isNaN","parseFloat","nextValue","undefined","createHandleOnUnitChange","newUnits","filteredSides","length","filter","includes","first","last","only","map","parsedQuantity","parsedUnit","selectedUnit","join","LABELS"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAMA,MAAMA,YAAY,GAAG,CAAE,UAAF,EAAc,YAAd,CAArB;;AAEe,SAASC,kBAAT,OAUX;AAAA,MAVwC;AAC3CC,IAAAA,QAD2C;AAE3CC,IAAAA,OAF2C;AAG3CC,IAAAA,SAH2C;AAI3CC,IAAAA,UAJ2C;AAK3CC,IAAAA,MAL2C;AAM3CC,IAAAA,aAN2C;AAO3CC,IAAAA,gBAP2C;AAQ3CC,IAAAA,KAR2C;AAS3C,OAAGC;AATwC,GAUxC;;AACH,QAAMC,mBAAmB,GAAKC,IAAF,IAAcC,KAAF,IAAa;AACpD,QAAK,CAAEV,OAAP,EAAiB;AAChB;AACA;;AACDA,IAAAA,OAAO,CAAEU,KAAF,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GAAd,CAAqBzB,IAAF,IAAY;AAChC,UAAM,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/box-control/axial-input-controls.js"],"names":["groupedSides","AxialInputControls","onChange","onFocus","onHoverOn","onHoverOff","values","selectedUnits","setSelectedUnits","sides","props","createHandleOnFocus","side","event","createHandleOnHoverOn","top","bottom","left","right","createHandleOnHoverOff","createHandleOnChange","next","nextValues","isNumeric","isNaN","parseFloat","nextValue","undefined","createHandleOnUnitChange","newUnits","filteredSides","length","filter","includes","first","last","only","map","parsedQuantity","parsedUnit","selectedUnit","join","LABELS"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAMA,MAAMA,YAAY,GAAG,CAAE,UAAF,EAAc,YAAd,CAArB;;AAEe,SAASC,kBAAT,OAUX;AAAA,MAVwC;AAC3CC,IAAAA,QAD2C;AAE3CC,IAAAA,OAF2C;AAG3CC,IAAAA,SAH2C;AAI3CC,IAAAA,UAJ2C;AAK3CC,IAAAA,MAL2C;AAM3CC,IAAAA,aAN2C;AAO3CC,IAAAA,gBAP2C;AAQ3CC,IAAAA,KAR2C;AAS3C,OAAGC;AATwC,GAUxC;;AACH,QAAMC,mBAAmB,GAAKC,IAAF,IAAcC,KAAF,IAAa;AACpD,QAAK,CAAEV,OAAP,EAAiB;AAChB;AACA;;AACDA,IAAAA,OAAO,CAAEU,KAAF,EAAS;AAAED,MAAAA;AAAF,KAAT,CAAP;AACA,GALD;;AAOA,QAAME,qBAAqB,GAAKF,IAAF,IAAY,MAAM;AAC/C,QAAK,CAAER,SAAP,EAAmB;AAClB;AACA;;AACD,QAAKQ,IAAI,KAAK,UAAd,EAA2B;AAC1BR,MAAAA,SAAS,CAAE;AACVW,QAAAA,GAAG,EAAE,IADK;AAEVC,QAAAA,MAAM,EAAE;AAFE,OAAF,CAAT;AAIA;;AACD,QAAKJ,IAAI,KAAK,YAAd,EAA6B;AAC5BR,MAAAA,SAAS,CAAE;AACVa,QAAAA,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AGuB,IAAI,KAAKvB,IAHnB;AAIC,MAAA,MAAM,EAAGwB,IAAI,KAAKxB,IAJnB;AAKC,MAAA,KAAK,EAAG,CACP0B,cADO,EAEPE,YAFO,aAEPA,YAFO,cAEPA,YAFO,GAESD,UAFT,EAGNE,IAHM,CAGA,EAHA,CALT;AASC,MAAA,QAAQ,EAAGrB,oBAAoB,CAAER,IAAF,CAThC;AAUC,MAAA,YAAY,EAAGgB,wBAAwB,CAAEhB,IAAF,CAVxC;AAWC,MAAA,OAAO,EAAGD,mBAAmB,CAAEC,IAAF,CAX9B;AAYC,MAAA,SAAS,EAAGE,qBAAqB,CAAEF,IAAF,CAZlC;AAaC,MAAA,UAAU,EAAGO,sBAAsB,CAAEP,IAAF,CAbpC;AAcC,MAAA,KAAK,EAAG8B,eAAQ9B,IAAR,CAdT;AAeC,MAAA,GAAG,EAAGA;AAfP,OADD;AAmBA,GA5BC,CALH,CADD;AAqCA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport UnitControl from './unit-control';\nimport { LABELS } from './utils';\nimport { Layout } from './styles/box-control-styles';\n\nconst groupedSides = [ 'vertical', 'horizontal' ];\n\nexport default function AxialInputControls( {\n\tonChange,\n\tonFocus,\n\tonHoverOn,\n\tonHoverOff,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n} ) {\n\tconst createHandleOnFocus = ( side ) => ( event ) => {\n\t\tif ( ! onFocus ) {\n\t\t\treturn;\n\t\t}\n\t\tonFocus( event, { side } );\n\t};\n\n\tconst createHandleOnHoverOn = ( side ) => () => {\n\t\tif ( ! onHoverOn ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( side === 'vertical' ) {\n\t\t\tonHoverOn( {\n\t\t\t\ttop: true,\n\t\t\t\tbottom: true,\n\t\t\t} );\n\t\t}\n\t\tif ( side === 'horizontal' ) {\n\t\t\tonHoverOn( {\n\t\t\t\tleft: true,\n\t\t\t\tright: true,\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst createHandleOnHoverOff = ( side ) => () => {\n\t\tif ( ! onHoverOff ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( side === 'vertical' ) {\n\t\t\tonHoverOff( {\n\t\t\t\ttop: false,\n\t\t\t\tbottom: false,\n\t\t\t} );\n\t\t}\n\t\tif ( side === 'horizontal' ) {\n\t\t\tonHoverOff( {\n\t\t\t\tleft: false,\n\t\t\t\tright: false,\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst createHandleOnChange = ( side ) => ( next ) => {\n\t\tif ( ! onChange ) {\n\t\t\treturn;\n\t\t}\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnextValues.top = nextValue;\n\t\t\tnextValues.bottom = nextValue;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnextValues.left = nextValue;\n\t\t\tnextValues.right = nextValue;\n\t\t}\n\n\t\tonChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange = ( side ) => ( next ) => {\n\t\tconst newUnits = { ...selectedUnits };\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnewUnits.top = next;\n\t\t\tnewUnits.bottom = next;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnewUnits.left = next;\n\t\t\tnewUnits.right = next;\n\t\t}\n\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? groupedSides.filter( ( side ) => sides.includes( side ) )\n\t\t: groupedSides;\n\n\tconst first = filteredSides[ 0 ];\n\tconst last = filteredSides[ filteredSides.length - 1 ];\n\tconst only = first === last;\n\n\treturn (\n\t\t<Layout\n\t\t\tgap={ 0 }\n\t\t\talign=\"top\"\n\t\t\tclassName=\"component-box-control__vertical-horizontal-input-controls\"\n\t\t>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue(\n\t\t\t\t\t\tside === 'vertical' ? values.top : values.left\n\t\t\t\t\t);\n\t\t\t\tconst selectedUnit =\n\t\t\t\t\tside === 'vertical'\n\t\t\t\t\t\t? selectedUnits.top\n\t\t\t\t\t\t: selectedUnits.left;\n\t\t\t\treturn (\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\tisFirst={ first === side }\n\t\t\t\t\t\tisLast={ last === side }\n\t\t\t\t\t\tisOnly={ only === side }\n\t\t\t\t\t\tvalue={ [\n\t\t\t\t\t\t\tparsedQuantity,\n\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t].join( '' ) }\n\t\t\t\t\t\tonChange={ createHandleOnChange( side ) }\n\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange( side ) }\n\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\tonHoverOn={ createHandleOnHoverOn( side ) }\n\t\t\t\t\t\tonHoverOff={ createHandleOnHoverOff( side ) }\n\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\tkey={ side }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Layout>\n\t);\n}\n"]}
|
|
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
|
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
14
|
-
var _lodash = require("lodash");
|
|
15
|
-
|
|
16
14
|
var _compose = require("@wordpress/compose");
|
|
17
15
|
|
|
18
16
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -41,10 +39,6 @@ var _utils2 = require("./utils");
|
|
|
41
39
|
|
|
42
40
|
var _hooks = require("../utils/hooks");
|
|
43
41
|
|
|
44
|
-
/**
|
|
45
|
-
* External dependencies
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
42
|
/**
|
|
49
43
|
* WordPress dependencies
|
|
50
44
|
*/
|
|
@@ -56,6 +50,8 @@ const defaultInputProps = {
|
|
|
56
50
|
min: 0
|
|
57
51
|
};
|
|
58
52
|
|
|
53
|
+
const noop = () => {};
|
|
54
|
+
|
|
59
55
|
function useUniqueId(idProp) {
|
|
60
56
|
const instanceId = (0, _compose.useInstanceId)(BoxControl, 'inspector-box-control');
|
|
61
57
|
return idProp || instanceId;
|
|
@@ -65,7 +61,7 @@ function BoxControl(_ref) {
|
|
|
65
61
|
let {
|
|
66
62
|
id: idProp,
|
|
67
63
|
inputProps = defaultInputProps,
|
|
68
|
-
onChange =
|
|
64
|
+
onChange = noop,
|
|
69
65
|
label = (0, _i18n.__)('Box Control'),
|
|
70
66
|
values: valuesProp,
|
|
71
67
|
units,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/box-control/index.js"],"names":["defaultInputProps","min","useUniqueId","idProp","instanceId","BoxControl","id","inputProps","onChange","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/box-control/index.js"],"names":["defaultInputProps","min","noop","useUniqueId","idProp","instanceId","BoxControl","id","inputProps","onChange","label","values","valuesProp","units","sides","splitOnAxis","allowReset","resetValues","DEFAULT_VALUES","setValues","fallback","inputValues","hasInitialValue","hasOneSide","length","isDirty","setIsDirty","isLinked","setIsLinked","side","setSide","selectedUnits","setSelectedUnits","top","right","bottom","left","headingId","toggleLinked","handleOnFocus","event","nextSide","handleOnChange","nextValues","handleOnReset","inputControlProps","onFocus"],"mappings":";;;;;;;;;AAIA;;;;AADA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAMA;;AA9BA;AACA;AACA;;AAKA;AACA;AACA;AAuBA,MAAMA,iBAAiB,GAAG;AACzBC,EAAAA,GAAG,E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B,iBAAzB,CADD,CAbF,EAiBG,CAAEtB,UAAF,IACD,4BAAC,cAAD,QACC,4BAAC,qBAAD;AACC,IAAA,OAAO,EAAGe,YADX;AAEC,IAAA,QAAQ,EAAGX;AAFZ,IADD,CAlBF,CAxBD,EAkDG,CAAEA,QAAF,IAAc,CAAEZ,WAAhB,IACD,4BAAC,sBAAD,EAAoB8B,iBAApB,CAnDF,CADD;AAwDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { FlexItem, FlexBlock } from '../flex';\nimport AllInputControl from './all-input-control';\nimport InputControls from './input-controls';\nimport AxialInputControls from './axial-input-controls';\nimport BoxControlIcon from './icon';\nimport { Text } from '../text';\nimport LinkedButton from './linked-button';\nimport {\n\tRoot,\n\tHeader,\n\tHeaderControlWrapper,\n} from './styles/box-control-styles';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport {\n\tDEFAULT_VALUES,\n\tgetInitialSide,\n\tisValuesMixed,\n\tisValuesDefined,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\n\nconst defaultInputProps = {\n\tmin: 0,\n};\n\nconst noop = () => {};\n\nfunction useUniqueId( idProp ) {\n\tconst instanceId = useInstanceId( BoxControl, 'inspector-box-control' );\n\n\treturn idProp || instanceId;\n}\nexport default function BoxControl( {\n\tid: idProp,\n\tinputProps = defaultInputProps,\n\tonChange = noop,\n\tlabel = __( 'Box Control' ),\n\tvalues: valuesProp,\n\tunits,\n\tsides,\n\tsplitOnAxis = false,\n\tallowReset = true,\n\tresetValues = DEFAULT_VALUES,\n} ) {\n\tconst [ values, setValues ] = useControlledState( valuesProp, {\n\t\tfallback: DEFAULT_VALUES,\n\t} );\n\tconst inputValues = values || DEFAULT_VALUES;\n\tconst hasInitialValue = isValuesDefined( valuesProp );\n\tconst hasOneSide = sides?.length === 1;\n\n\tconst [ isDirty, setIsDirty ] = useState( hasInitialValue );\n\tconst [ isLinked, setIsLinked ] = useState(\n\t\t! hasInitialValue || ! isValuesMixed( inputValues ) || hasOneSide\n\t);\n\n\tconst [ side, setSide ] = useState(\n\t\tgetInitialSide( isLinked, splitOnAxis )\n\t);\n\n\t// Tracking selected units via internal state allows filtering of CSS unit\n\t// only values from being saved while maintaining preexisting unit selection\n\t// behaviour. Filtering CSS only values prevents invalid style values.\n\tconst [ selectedUnits, setSelectedUnits ] = useState( {\n\t\ttop: parseQuantityAndUnitFromRawValue( valuesProp?.top )[ 1 ],\n\t\tright: parseQuantityAndUnitFromRawValue( valuesProp?.right )[ 1 ],\n\t\tbottom: parseQuantityAndUnitFromRawValue( valuesProp?.bottom )[ 1 ],\n\t\tleft: parseQuantityAndUnitFromRawValue( valuesProp?.left )[ 1 ],\n\t} );\n\n\tconst id = useUniqueId( idProp );\n\tconst headingId = `${ id }-heading`;\n\n\tconst toggleLinked = () => {\n\t\tsetIsLinked( ! isLinked );\n\t\tsetSide( getInitialSide( ! isLinked, splitOnAxis ) );\n\t};\n\n\tconst handleOnFocus = ( event, { side: nextSide } ) => {\n\t\tsetSide( nextSide );\n\t};\n\n\tconst handleOnChange = ( nextValues ) => {\n\t\tonChange( nextValues );\n\t\tsetValues( nextValues );\n\t\tsetIsDirty( true );\n\t};\n\n\tconst handleOnReset = () => {\n\t\tonChange( resetValues );\n\t\tsetValues( resetValues );\n\t\tsetSelectedUnits( resetValues );\n\t\tsetIsDirty( false );\n\t};\n\n\tconst inputControlProps = {\n\t\t...inputProps,\n\t\tonChange: handleOnChange,\n\t\tonFocus: handleOnFocus,\n\t\tisLinked,\n\t\tunits,\n\t\tselectedUnits,\n\t\tsetSelectedUnits,\n\t\tsides,\n\t\tvalues: inputValues,\n\t};\n\n\treturn (\n\t\t<Root id={ id } role=\"region\" aria-labelledby={ headingId }>\n\t\t\t<Header className=\"component-box-control__header\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tid={ headingId }\n\t\t\t\t\t\tclassName=\"component-box-control__label\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Text>\n\t\t\t\t</FlexItem>\n\t\t\t\t{ allowReset && (\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"component-box-control__reset-button\"\n\t\t\t\t\t\t\tisSecondary\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</Header>\n\t\t\t<HeaderControlWrapper className=\"component-box-control__header-control-wrapper\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<BoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t</FlexItem>\n\t\t\t\t{ isLinked && (\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<AllInputControl\n\t\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\t\t{ ...inputControlProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t) }\n\t\t\t\t{ ! isLinked && splitOnAxis && (\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<AxialInputControls { ...inputControlProps } />\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t) }\n\t\t\t\t{ ! hasOneSide && (\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<LinkedButton\n\t\t\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</HeaderControlWrapper>\n\t\t\t{ ! isLinked && ! splitOnAxis && (\n\t\t\t\t<InputControls { ...inputControlProps } />\n\t\t\t) }\n\t\t</Root>\n\t);\n}\n"]}
|