@wordpress/components 19.2.3 → 19.4.1-next.f435e9e01b.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 +74 -5
- package/CONTRIBUTING.md +1 -1
- package/LICENSE.md +1 -1
- package/README.md +8 -4
- package/build/angle-picker-control/index.js +2 -0
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/base-control/index.js +2 -3
- package/build/base-control/index.js.map +1 -1
- package/build/base-control/styles/base-control-styles.js +23 -13
- package/build/base-control/styles/base-control-styles.js.map +1 -1
- package/build/base-field/hook.js +1 -1
- package/build/base-field/hook.js.map +1 -1
- package/build/box-control/styles/box-control-styles.js +9 -9
- package/build/box-control/styles/box-control-styles.js.map +1 -1
- package/build/button/deprecated.js +2 -1
- package/build/button/deprecated.js.map +1 -1
- package/build/button/index.js +2 -1
- package/build/button/index.js.map +1 -1
- package/build/button/index.native.js +13 -3
- package/build/button/index.native.js.map +1 -1
- package/build/card/card/component.js +1 -1
- package/build/card/card/component.js.map +1 -1
- package/build/card/card/hook.js +1 -1
- package/build/card/card/hook.js.map +1 -1
- package/build/card/card-body/hook.js +1 -1
- package/build/card/card-body/hook.js.map +1 -1
- package/build/card/card-divider/hook.js +1 -1
- package/build/card/card-divider/hook.js.map +1 -1
- package/build/card/card-footer/hook.js +1 -1
- package/build/card/card-footer/hook.js.map +1 -1
- package/build/card/card-header/hook.js +1 -1
- package/build/card/card-header/hook.js.map +1 -1
- package/build/card/card-media/hook.js +1 -1
- package/build/card/card-media/hook.js.map +1 -1
- package/build/checkbox-control/index.js +1 -1
- package/build/checkbox-control/index.js.map +1 -1
- package/build/circular-option-picker/index.js +2 -0
- package/build/circular-option-picker/index.js.map +1 -1
- package/build/clipboard-button/index.js +1 -2
- package/build/clipboard-button/index.js.map +1 -1
- package/build/color-indicator/index.js +2 -0
- package/build/color-indicator/index.js.map +1 -1
- package/build/color-palette/index.js +2 -0
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/index.native.js +4 -2
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-picker/color-display.js +4 -2
- package/build/color-picker/color-display.js.map +1 -1
- package/build/color-picker/color-input.js.map +1 -1
- package/build/color-picker/component.js +2 -5
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/hex-input.js +3 -1
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/input-with-slider.js +3 -1
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/color-picker/use-deprecated-props.js +2 -0
- package/build/color-picker/use-deprecated-props.js.map +1 -1
- package/build/confirm-dialog/component.js +107 -0
- package/build/confirm-dialog/component.js.map +1 -0
- package/build/confirm-dialog/index.js +16 -0
- package/build/confirm-dialog/index.js.map +1 -0
- package/build/confirm-dialog/styles.js +30 -0
- package/build/confirm-dialog/styles.js.map +1 -0
- package/build/confirm-dialog/types.js +6 -0
- package/build/confirm-dialog/types.js.map +1 -0
- package/build/custom-gradient-picker/index.js +1 -0
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/date-time/date.js +63 -86
- package/build/date-time/date.js.map +1 -1
- package/build/date-time/time.js +1 -1
- package/build/date-time/time.js.map +1 -1
- package/build/date-time/utils.js +32 -0
- package/build/date-time/utils.js.map +1 -0
- package/build/divider/component.js +8 -7
- package/build/divider/component.js.map +1 -1
- package/build/divider/styles.js +38 -13
- package/build/divider/styles.js.map +1 -1
- package/build/drop-zone/index.js +14 -6
- package/build/drop-zone/index.js.map +1 -1
- package/build/drop-zone/provider.js +1 -0
- package/build/drop-zone/provider.js.map +1 -1
- package/build/dropdown/index.js +3 -3
- package/build/dropdown/index.js.map +1 -1
- package/build/elevation/hook.js +5 -5
- package/build/elevation/hook.js.map +1 -1
- package/build/external-link/styles/external-link-styles.js +5 -5
- package/build/external-link/styles/external-link-styles.js.map +1 -1
- package/build/flex/flex/hook.js +4 -4
- package/build/flex/flex/hook.js.map +1 -1
- package/build/flyout/styles.js +2 -2
- package/build/flyout/styles.js.map +1 -1
- package/build/focusable-iframe/index.js +1 -0
- package/build/focusable-iframe/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +75 -81
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/grid/hook.js +2 -2
- package/build/grid/hook.js.map +1 -1
- package/build/heading/component.js +0 -1
- package/build/heading/component.js.map +1 -1
- package/build/higher-order/with-focus-outside/index.js +2 -0
- package/build/higher-order/with-focus-outside/index.js.map +1 -1
- package/build/icon/index.js +0 -1
- package/build/icon/index.js.map +1 -1
- package/build/index.js +8 -0
- package/build/index.js.map +1 -1
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js +0 -1
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/reducer/actions.js +0 -1
- package/build/input-control/reducer/actions.js.map +1 -1
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/reducer/state.js +0 -1
- package/build/input-control/reducer/state.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +51 -37
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/item-group/item/component.js +0 -1
- package/build/item-group/item/component.js.map +1 -1
- package/build/item-group/item/hook.js +1 -2
- package/build/item-group/item/hook.js.map +1 -1
- package/build/item-group/item-group/component.js +0 -1
- package/build/item-group/item-group/component.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-context.native.js +3 -1
- package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +4 -12
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +23 -5
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +3 -5
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.native.js +16 -16
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +10 -3
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-text-input.native.js +2 -3
- package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js +6 -2
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +12 -6
- package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build/mobile/color-settings/utils.native.js +9 -3
- package/build/mobile/color-settings/utils.native.js.map +1 -1
- package/build/mobile/global-styles-context/utils.native.js +1 -1
- package/build/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build/mobile/gridicons/index.native.js +3 -1
- package/build/mobile/gridicons/index.native.js.map +1 -1
- package/build/mobile/keyboard-avoiding-view/index.ios.js +6 -8
- package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build/mobile/link-picker/index.native.js +47 -4
- package/build/mobile/link-picker/index.native.js.map +1 -1
- package/build/mobile/link-picker/link-picker-screen.native.js +18 -5
- package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
- package/build/mobile/link-settings/index.native.js +13 -1
- package/build/mobile/link-settings/index.native.js.map +1 -1
- package/build/mobile/readable-content-view/index.native.js +2 -2
- package/build/mobile/readable-content-view/index.native.js.map +1 -1
- package/build/mobile/utils/use-is-floating-keyboard.native.js +2 -2
- package/build/mobile/utils/use-is-floating-keyboard.native.js.map +1 -1
- package/build/mobile/utils/use-unit-converter-to-mobile.native.js +2 -2
- package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build/modal/aria-helper.js +2 -0
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +18 -20
- package/build/modal/index.js.map +1 -1
- package/build/navigator/context.js +5 -1
- package/build/navigator/context.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +42 -22
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +57 -29
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/use-navigator.js +8 -8
- package/build/navigator/use-navigator.js.map +1 -1
- package/build/notice/index.native.js +2 -2
- package/build/notice/index.native.js.map +1 -1
- package/build/palette-edit/index.js +8 -3
- package/build/palette-edit/index.js.map +1 -1
- package/build/palette-edit/styles.js +11 -13
- package/build/palette-edit/styles.js.map +1 -1
- package/build/placeholder/index.js +4 -4
- package/build/placeholder/index.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +29 -29
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/resizable-box/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/label.js +0 -1
- package/build/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build/sandbox/index.native.js +5 -5
- package/build/sandbox/index.native.js.map +1 -1
- package/build/scrollable/hook.js +1 -1
- package/build/scrollable/hook.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +33 -9
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/fill.js +11 -2
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/spacer/component.js +0 -1
- package/build/spacer/component.js.map +1 -1
- package/build/spinner/index.js +44 -5
- package/build/spinner/index.js.map +1 -1
- package/build/spinner/index.native.js +4 -2
- package/build/spinner/index.native.js.map +1 -1
- package/build/spinner/styles.js +56 -0
- package/build/spinner/styles.js.map +1 -0
- package/build/style-provider/index.js +2 -0
- package/build/style-provider/index.js.map +1 -1
- package/build/surface/hook.js +1 -1
- package/build/surface/hook.js.map +1 -1
- package/build/text/get-line-height.js +0 -1
- package/build/text/get-line-height.js.map +1 -1
- package/build/text/hook.js +5 -5
- package/build/text/hook.js.map +1 -1
- package/build/tip/index.js +4 -8
- package/build/tip/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +9 -14
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +3 -14
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option/component.js +0 -1
- package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option/styles.js +8 -8
- package/build/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
- package/build/tools-panel/styles.js +12 -10
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +6 -9
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +51 -44
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +0 -1
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/hook.js +3 -3
- package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-item/component.js +0 -1
- package/build/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +9 -3
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/tree-grid/index.js +13 -6
- package/build/tree-grid/index.js.map +1 -1
- package/build/truncate/hook.js +2 -2
- package/build/truncate/hook.js.map +1 -1
- package/build/ui/shortcut/component.js +0 -1
- package/build/ui/shortcut/component.js.map +1 -1
- package/build/ui/utils/font-size.js +0 -1
- package/build/ui/utils/font-size.js.map +1 -1
- package/build/ui/utils/get-valid-children.js +0 -1
- package/build/ui/utils/get-valid-children.js.map +1 -1
- package/build/unit-control/index.js +0 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +23 -41
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/unit-control/unit-select-control.js.map +1 -1
- package/build/utils/colors-values.js +6 -3
- package/build/utils/colors-values.js.map +1 -1
- package/build/utils/config-values.js +1 -4
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/hooks/use-combined-ref.js.map +1 -1
- package/build/utils/hooks/use-latest-ref.js +0 -1
- package/build/utils/hooks/use-latest-ref.js.map +1 -1
- package/build/z-stack/component.js +0 -1
- package/build/z-stack/component.js.map +1 -1
- package/build/z-stack/styles.js +10 -8
- package/build/z-stack/styles.js.map +1 -1
- package/build-module/angle-picker-control/index.js +2 -0
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/base-control/index.js +3 -4
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/base-control/styles/base-control-styles.js +20 -12
- package/build-module/base-control/styles/base-control-styles.js.map +1 -1
- package/build-module/base-field/hook.js +1 -1
- package/build-module/base-field/hook.js.map +1 -1
- package/build-module/box-control/styles/box-control-styles.js +9 -9
- package/build-module/box-control/styles/box-control-styles.js.map +1 -1
- package/build-module/button/deprecated.js +2 -1
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/index.js +2 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/index.native.js +13 -3
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/card/card/component.js +1 -1
- package/build-module/card/card/component.js.map +1 -1
- package/build-module/card/card/hook.js +1 -1
- package/build-module/card/card/hook.js.map +1 -1
- package/build-module/card/card-body/hook.js +1 -1
- package/build-module/card/card-body/hook.js.map +1 -1
- package/build-module/card/card-divider/hook.js +1 -1
- package/build-module/card/card-divider/hook.js.map +1 -1
- package/build-module/card/card-footer/hook.js +1 -1
- package/build-module/card/card-footer/hook.js.map +1 -1
- package/build-module/card/card-header/hook.js +1 -1
- package/build-module/card/card-header/hook.js.map +1 -1
- package/build-module/card/card-media/hook.js +1 -1
- package/build-module/card/card-media/hook.js.map +1 -1
- package/build-module/checkbox-control/index.js +1 -1
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/circular-option-picker/index.js +1 -0
- package/build-module/circular-option-picker/index.js.map +1 -1
- package/build-module/clipboard-button/index.js +1 -2
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/color-indicator/index.js +1 -0
- package/build-module/color-indicator/index.js.map +1 -1
- package/build-module/color-palette/index.js +1 -0
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +4 -2
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/color-display.js +3 -2
- package/build-module/color-picker/color-display.js.map +1 -1
- package/build-module/color-picker/color-input.js.map +1 -1
- package/build-module/color-picker/component.js +2 -4
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/hex-input.js +2 -1
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +2 -1
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/color-picker/use-deprecated-props.js +3 -2
- package/build-module/color-picker/use-deprecated-props.js.map +1 -1
- package/build-module/confirm-dialog/component.js +87 -0
- package/build-module/confirm-dialog/component.js.map +1 -0
- package/build-module/confirm-dialog/index.js +6 -0
- package/build-module/confirm-dialog/index.js.map +1 -0
- package/build-module/confirm-dialog/styles.js +25 -0
- package/build-module/confirm-dialog/styles.js.map +1 -0
- package/build-module/confirm-dialog/types.js +2 -0
- package/build-module/confirm-dialog/types.js.map +1 -0
- package/build-module/custom-gradient-picker/index.js +1 -0
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/date-time/date.js +63 -87
- package/build-module/date-time/date.js.map +1 -1
- package/build-module/date-time/time.js +1 -1
- package/build-module/date-time/time.js.map +1 -1
- package/build-module/date-time/utils.js +20 -0
- package/build-module/date-time/utils.js.map +1 -0
- package/build-module/divider/component.js +9 -8
- package/build-module/divider/component.js.map +1 -1
- package/build-module/divider/styles.js +37 -13
- package/build-module/divider/styles.js.map +1 -1
- package/build-module/drop-zone/index.js +14 -6
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/drop-zone/provider.js +1 -0
- package/build-module/drop-zone/provider.js.map +1 -1
- package/build-module/dropdown/index.js +3 -3
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/elevation/hook.js +5 -5
- package/build-module/elevation/hook.js.map +1 -1
- package/build-module/external-link/styles/external-link-styles.js +5 -5
- package/build-module/external-link/styles/external-link-styles.js.map +1 -1
- package/build-module/flex/flex/hook.js +4 -4
- package/build-module/flex/flex/hook.js.map +1 -1
- package/build-module/flyout/styles.js +2 -2
- package/build-module/flyout/styles.js.map +1 -1
- package/build-module/focusable-iframe/index.js +1 -0
- package/build-module/focusable-iframe/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +73 -79
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/grid/hook.js +2 -2
- package/build-module/grid/hook.js.map +1 -1
- package/build-module/heading/component.js +0 -1
- package/build-module/heading/component.js.map +1 -1
- package/build-module/higher-order/with-focus-outside/index.js +1 -0
- package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
- package/build-module/icon/index.js +0 -1
- package/build-module/icon/index.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/index.js +1 -1
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +0 -1
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/input-field.js +1 -1
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/reducer/actions.js +0 -1
- package/build-module/input-control/reducer/actions.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js +1 -1
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/reducer/state.js +0 -1
- package/build-module/input-control/reducer/state.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +51 -37
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/item-group/item/component.js +0 -1
- package/build-module/item-group/item/component.js.map +1 -1
- package/build-module/item-group/item/hook.js +1 -2
- package/build-module/item-group/item/hook.js.map +1 -1
- package/build-module/item-group/item-group/component.js +0 -1
- package/build-module/item-group/item-group/component.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js +3 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +5 -13
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +23 -5
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +3 -3
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js +16 -13
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +10 -4
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-text-input.native.js +2 -2
- package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +6 -2
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +12 -6
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/mobile/color-settings/utils.native.js +7 -3
- package/build-module/mobile/color-settings/utils.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/mobile/gridicons/index.native.js +1 -0
- package/build-module/mobile/gridicons/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js +6 -6
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +50 -7
- package/build-module/mobile/link-picker/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-screen.native.js +13 -5
- package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
- package/build-module/mobile/link-settings/index.native.js +12 -1
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/mobile/readable-content-view/index.native.js +2 -2
- package/build-module/mobile/readable-content-view/index.native.js.map +1 -1
- package/build-module/mobile/utils/use-is-floating-keyboard.native.js +2 -2
- package/build-module/mobile/utils/use-is-floating-keyboard.native.js.map +1 -1
- package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js +2 -2
- package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build-module/modal/aria-helper.js +2 -0
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +16 -19
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigator/context.js +5 -1
- package/build-module/navigator/context.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +43 -24
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +57 -32
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/use-navigator.js +8 -8
- package/build-module/navigator/use-navigator.js.map +1 -1
- package/build-module/notice/index.native.js +2 -2
- package/build-module/notice/index.native.js.map +1 -1
- package/build-module/palette-edit/index.js +8 -3
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/palette-edit/styles.js +11 -12
- package/build-module/palette-edit/styles.js.map +1 -1
- package/build-module/placeholder/index.js +4 -4
- package/build-module/placeholder/index.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +29 -29
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js +3 -3
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/label.js +0 -1
- package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build-module/sandbox/index.native.js +5 -5
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/scrollable/hook.js +1 -1
- package/build-module/scrollable/hook.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +33 -9
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js +11 -2
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/spacer/component.js +0 -1
- package/build-module/spacer/component.js.map +1 -1
- package/build-module/spinner/index.js +40 -5
- package/build-module/spinner/index.js.map +1 -1
- package/build-module/spinner/index.native.js +4 -2
- package/build-module/spinner/index.native.js.map +1 -1
- package/build-module/spinner/styles.js +49 -0
- package/build-module/spinner/styles.js.map +1 -0
- package/build-module/style-provider/index.js +1 -0
- package/build-module/style-provider/index.js.map +1 -1
- package/build-module/surface/hook.js +1 -1
- package/build-module/surface/hook.js.map +1 -1
- package/build-module/text/get-line-height.js +0 -1
- package/build-module/text/get-line-height.js.map +1 -1
- package/build-module/text/hook.js +5 -5
- package/build-module/text/hook.js.map +1 -1
- package/build-module/tip/index.js +4 -8
- package/build-module/tip/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +10 -13
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +3 -11
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option/component.js +0 -1
- package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option/styles.js +8 -8
- package/build-module/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
- package/build-module/tools-panel/styles.js +12 -11
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +5 -9
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +52 -45
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +0 -1
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/hook.js +3 -3
- package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/component.js +0 -1
- package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +9 -3
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/tree-grid/index.js +12 -6
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/truncate/hook.js +2 -2
- package/build-module/truncate/hook.js.map +1 -1
- package/build-module/ui/shortcut/component.js +0 -1
- package/build-module/ui/shortcut/component.js.map +1 -1
- package/build-module/ui/utils/font-size.js +0 -1
- package/build-module/ui/utils/font-size.js.map +1 -1
- package/build-module/ui/utils/get-valid-children.js +0 -1
- package/build-module/ui/utils/get-valid-children.js.map +1 -1
- package/build-module/unit-control/index.js +0 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +23 -41
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/unit-control/unit-select-control.js +1 -2
- package/build-module/unit-control/unit-select-control.js.map +1 -1
- package/build-module/utils/colors-values.js +6 -3
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-module/utils/config-values.js +1 -4
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/hooks/use-combined-ref.js +0 -1
- package/build-module/utils/hooks/use-combined-ref.js.map +1 -1
- package/build-module/utils/hooks/use-latest-ref.js +0 -1
- package/build-module/utils/hooks/use-latest-ref.js.map +1 -1
- package/build-module/z-stack/component.js +0 -1
- package/build-module/z-stack/component.js.map +1 -1
- package/build-module/z-stack/styles.js +13 -8
- package/build-module/z-stack/styles.js.map +1 -1
- package/build-style/style-rtl.css +36 -15
- package/build-style/style.css +36 -15
- package/build-types/base-control/index.d.ts.map +1 -1
- package/build-types/base-control/styles/base-control-styles.d.ts +4 -0
- package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
- package/build-types/base-field/hook.d.ts +16 -16
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +16 -16
- package/build-types/card/card-body/hook.d.ts +16 -16
- package/build-types/card/card-divider/hook.d.ts +18 -18
- package/build-types/card/card-footer/hook.d.ts +17 -17
- package/build-types/card/card-header/hook.d.ts +16 -16
- package/build-types/card/card-media/hook.d.ts +16 -16
- package/build-types/card/types.d.ts.map +1 -1
- package/build-types/color-picker/color-display.d.ts +1 -0
- package/build-types/color-picker/color-display.d.ts.map +1 -1
- package/build-types/color-picker/color-input.d.ts +1 -0
- package/build-types/color-picker/color-input.d.ts.map +1 -1
- package/build-types/color-picker/hex-input.d.ts +1 -0
- package/build-types/color-picker/hex-input.d.ts.map +1 -1
- package/build-types/color-picker/hsl-input.d.ts +1 -0
- package/build-types/color-picker/hsl-input.d.ts.map +1 -1
- package/build-types/color-picker/input-with-slider.d.ts +1 -0
- package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
- package/build-types/color-picker/legacy-adapter.d.ts +1 -0
- package/build-types/color-picker/legacy-adapter.d.ts.map +1 -1
- package/build-types/color-picker/picker.d.ts +1 -0
- package/build-types/color-picker/picker.d.ts.map +1 -1
- package/build-types/color-picker/rgb-input.d.ts +1 -0
- package/build-types/color-picker/rgb-input.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +1 -1
- package/build-types/confirm-dialog/component.d.ts +4 -4
- package/build-types/divider/component.d.ts +8 -7
- package/build-types/divider/component.d.ts.map +1 -1
- package/build-types/divider/styles.d.ts +2 -2
- package/build-types/divider/styles.d.ts.map +1 -1
- package/build-types/divider/types.d.ts +5 -5
- package/build-types/divider/types.d.ts.map +1 -1
- package/build-types/dropdown/index.d.ts +1 -13
- package/build-types/dropdown/index.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +15 -15
- package/build-types/elevation/hook.d.ts.map +1 -1
- package/build-types/elevation/types.d.ts.map +1 -1
- package/build-types/flex/flex/hook.d.ts +16 -16
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/flex/flex-block/hook.d.ts +16 -16
- package/build-types/flex/flex-item/hook.d.ts +16 -16
- package/build-types/flex/types.d.ts.map +1 -1
- package/build-types/flyout/flyout/hook.d.ts +17 -17
- package/build-types/flyout/styles.d.ts +7 -9
- package/build-types/flyout/styles.d.ts.map +1 -1
- package/build-types/flyout/types.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +16 -16
- package/build-types/grid/hook.d.ts.map +1 -1
- package/build-types/grid/types.d.ts.map +1 -1
- package/build-types/h-stack/hook.d.ts +17 -17
- package/build-types/h-stack/hook.d.ts.map +1 -1
- package/build-types/h-stack/types.d.ts.map +1 -1
- package/build-types/heading/component.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts +16 -16
- package/build-types/icon/index.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts +1 -1
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-base.d.ts.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/actions.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
- package/build-types/input-control/reducer/state.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +1 -2
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +2 -1
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/item-group/item/component.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +16 -16
- package/build-types/item-group/item/hook.d.ts.map +1 -1
- package/build-types/item-group/item-group/component.d.ts.map +1 -1
- package/build-types/item-group/item-group/hook.d.ts +16 -16
- package/build-types/navigator/context.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts +16 -17
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +16 -16
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/types.d.ts +10 -9
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/resizable-box/index.d.ts +1 -1
- package/build-types/resizable-box/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts +16 -16
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/select-control/types.d.ts +1 -1
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
- package/build-types/spacer/component.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +16 -16
- package/build-types/spacer/types.d.ts.map +1 -1
- package/build-types/spinner/index.d.ts +18 -1
- package/build-types/spinner/index.d.ts.map +1 -1
- package/build-types/surface/hook.d.ts +16 -16
- package/build-types/surface/hook.d.ts.map +1 -1
- package/build-types/text/get-line-height.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +16 -16
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/text/types.d.ts.map +1 -1
- package/build-types/tip/index.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +0 -5
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/types.d.ts +1 -7
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/tools-panel/styles.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +24 -20
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +16 -16
- package/build-types/tools-panel/tools-panel-item/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +16 -16
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +14 -0
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +16 -16
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
- package/build-types/ui/control-group/hook.d.ts +18 -18
- package/build-types/ui/control-group/types.d.ts.map +1 -1
- package/build-types/ui/control-label/hook.d.ts +16 -16
- package/build-types/ui/form-group/form-group.d.ts +4 -4
- package/build-types/ui/form-group/types.d.ts.map +1 -1
- package/build-types/ui/form-group/use-form-group.d.ts +55 -55
- package/build-types/ui/shortcut/component.d.ts.map +1 -1
- package/build-types/ui/tooltip/types.d.ts.map +1 -1
- package/build-types/ui/utils/font-size.d.ts.map +1 -1
- package/build-types/ui/utils/get-valid-children.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +3 -2
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -0
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +4 -3
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/unit-control/unit-select-control.d.ts.map +1 -1
- package/build-types/utils/colors-values.d.ts +1 -0
- package/build-types/utils/colors-values.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +1 -5
- package/build-types/utils/config-values.d.ts.map +1 -1
- package/build-types/utils/hooks/use-combined-ref.d.ts.map +1 -1
- package/build-types/utils/hooks/use-latest-ref.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +16 -16
- package/build-types/v-stack/types.d.ts.map +1 -1
- package/build-types/z-stack/component.d.ts +1 -1
- package/build-types/z-stack/component.d.ts.map +1 -1
- package/build-types/z-stack/styles.d.ts.map +1 -1
- package/package.json +23 -22
- package/src/alignment-matrix-control/stories/index.js +1 -1
- package/src/angle-picker-control/index.js +2 -0
- package/src/base-control/index.js +11 -2
- package/src/base-control/stories/index.js +1 -1
- package/src/base-control/styles/base-control-styles.js +10 -1
- package/src/base-field/hook.js +1 -1
- package/src/box-control/styles/box-control-styles.js +1 -1
- package/src/button/deprecated.js +1 -0
- package/src/button/index.js +1 -0
- package/src/button/index.native.js +15 -1
- package/src/button/stories/index.js +1 -1
- package/src/button/style.scss +14 -0
- package/src/card/card/README.md +3 -3
- package/src/card/card/component.js +1 -1
- package/src/card/card/hook.js +1 -1
- package/src/card/card-body/hook.js +1 -1
- package/src/card/card-divider/hook.js +1 -1
- package/src/card/card-footer/hook.js +1 -1
- package/src/card/card-header/hook.js +1 -1
- package/src/card/card-media/hook.js +1 -1
- package/src/card/stories/index.js +1 -1
- package/src/card/test/__snapshots__/index.js.snap +6 -6
- package/src/card/types.ts +0 -1
- package/src/checkbox-control/index.js +1 -1
- package/src/checkbox-control/stories/index.js +1 -1
- package/src/circular-option-picker/index.js +1 -0
- package/src/clipboard-button/index.js +1 -2
- package/src/color-indicator/README.md +28 -0
- package/src/color-indicator/index.js +2 -0
- package/src/color-indicator/stories/index.js +1 -1
- package/src/color-indicator/style.scss +5 -8
- package/src/color-palette/index.js +1 -0
- package/src/color-palette/index.native.js +2 -0
- package/src/color-palette/stories/index.js +1 -1
- package/src/color-palette/test/__snapshots__/index.js.snap +1 -1
- package/src/color-picker/README.md +1 -1
- package/src/color-picker/color-display.tsx +4 -3
- package/src/color-picker/color-input.tsx +1 -1
- package/src/color-picker/component.tsx +3 -4
- package/src/color-picker/hex-input.tsx +2 -1
- package/src/color-picker/input-with-slider.tsx +2 -1
- package/src/color-picker/stories/index.js +1 -1
- package/src/color-picker/use-deprecated-props.ts +2 -1
- package/src/combobox-control/README.md +2 -2
- package/src/combobox-control/stories/index.js +6 -2
- package/src/combobox-control/style.scss +2 -2
- package/src/confirm-dialog/README.md +128 -0
- package/src/confirm-dialog/component.tsx +117 -0
- package/src/confirm-dialog/index.tsx +6 -0
- package/src/confirm-dialog/stories/index.js +123 -0
- package/src/confirm-dialog/styles.ts +18 -0
- package/src/confirm-dialog/test/index.js +302 -0
- package/src/confirm-dialog/types.ts +25 -0
- package/src/custom-gradient-picker/index.js +1 -0
- package/src/custom-gradient-picker/style.scss +0 -5
- package/src/custom-select-control/stories/index.js +27 -0
- package/src/date-time/README.md +9 -2
- package/src/date-time/date.js +67 -84
- package/src/date-time/stories/index.js +1 -1
- package/src/date-time/stories/time.js +1 -1
- package/src/date-time/test/date.js +3 -29
- package/src/date-time/test/time.js +2 -2
- package/src/date-time/test/utils.js +32 -0
- package/src/date-time/time.js +2 -2
- package/src/date-time/utils.js +18 -0
- package/src/dimension-control/README.md +3 -1
- package/src/divider/README.md +33 -5
- package/src/divider/component.tsx +8 -8
- package/src/divider/stories/index.js +43 -17
- package/src/divider/styles.ts +53 -16
- package/src/divider/test/__snapshots__/index.js.snap +11 -11
- package/src/divider/test/index.js +4 -4
- package/src/divider/types.ts +5 -5
- package/src/drop-zone/index.js +14 -6
- package/src/drop-zone/provider.js +1 -0
- package/src/dropdown/index.js +14 -13
- package/src/dropdown-menu/stories/index.js +1 -1
- package/src/duotone-picker/README.md +1 -1
- package/src/elevation/hook.js +1 -0
- package/src/elevation/stories/index.js +1 -1
- package/src/elevation/types.ts +0 -1
- package/src/external-link/stories/index.js +1 -1
- package/src/external-link/styles/external-link-styles.js +3 -3
- package/src/flex/flex/hook.js +1 -0
- package/src/flex/types.ts +0 -1
- package/src/flyout/styles.ts +4 -2
- package/src/flyout/types.ts +0 -1
- package/src/focusable-iframe/index.js +1 -0
- package/src/font-size-picker/stories/index.js +1 -1
- package/src/form-token-field/stories/index.js +1 -1
- package/src/form-token-field/style.scss +1 -1
- package/src/form-token-field/suggestions-list.js +109 -120
- package/src/form-token-field/test/index.js +4 -2
- package/src/gradient-picker/README.md +94 -0
- package/src/gradient-picker/stories/index.js +1 -1
- package/src/grid/hook.js +1 -0
- package/src/grid/stories/index.js +1 -1
- package/src/grid/types.ts +0 -1
- package/src/guide/stories/index.js +1 -1
- package/src/h-stack/types.ts +0 -1
- package/src/heading/component.tsx +0 -1
- package/src/higher-order/with-focus-outside/index.js +2 -0
- package/src/icon/index.tsx +0 -1
- package/src/icon/stories/index.js +1 -1
- package/src/index.js +1 -0
- package/src/input-control/index.tsx +0 -1
- package/src/input-control/input-base.tsx +0 -1
- package/src/input-control/input-field.tsx +0 -1
- package/src/input-control/reducer/actions.ts +0 -1
- package/src/input-control/reducer/reducer.ts +0 -1
- package/src/input-control/reducer/state.ts +0 -1
- package/src/input-control/stories/index.js +2 -1
- package/src/input-control/styles/input-control-styles.tsx +23 -13
- package/src/input-control/types.ts +3 -2
- package/src/item-group/item/component.tsx +0 -1
- package/src/item-group/item/hook.ts +1 -2
- package/src/item-group/item-group/component.tsx +0 -1
- package/src/item-group/stories/index.js +84 -2
- package/src/menu-item/README.md +2 -2
- package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +2 -0
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +8 -14
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +33 -3
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +162 -0
- package/src/mobile/bottom-sheet/cell.native.js +8 -6
- package/src/mobile/bottom-sheet/index.native.js +24 -14
- package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +6 -2
- package/src/mobile/bottom-sheet/link-suggestion-styles.native.scss +3 -0
- package/src/mobile/bottom-sheet/range-text-input.native.js +5 -2
- package/src/mobile/bottom-sheet/styles.native.scss +4 -0
- package/src/mobile/bottom-sheet/test/index.native.js +24 -0
- package/src/mobile/color-settings/index.native.js +4 -0
- package/src/mobile/color-settings/palette.screen.native.js +13 -5
- package/src/mobile/color-settings/style.native.scss +1 -1
- package/src/mobile/color-settings/utils.native.js +8 -3
- package/src/mobile/global-styles-context/utils.native.js +1 -1
- package/src/mobile/gridicons/index.native.js +3 -3
- package/src/mobile/html-text-input/test/index.native.js +34 -35
- package/src/mobile/inserter-button/style.native.scss +1 -0
- package/src/mobile/keyboard-avoiding-view/index.ios.js +12 -9
- package/src/mobile/link-picker/index.native.js +41 -6
- package/src/mobile/link-picker/link-picker-screen.native.js +13 -5
- package/src/mobile/link-settings/index.native.js +13 -1
- package/src/mobile/link-settings/test/edit.native.js +368 -0
- package/src/mobile/link-settings/test/link-settings-navigation.native.js +97 -0
- package/src/mobile/readable-content-view/index.native.js +5 -2
- package/src/mobile/utils/use-is-floating-keyboard.native.js +2 -5
- package/src/mobile/utils/use-unit-converter-to-mobile.native.js +5 -2
- package/src/modal/README.md +10 -0
- package/src/modal/aria-helper.js +2 -0
- package/src/modal/index.js +71 -63
- package/src/modal/stories/index.js +6 -1
- package/src/modal/style.scss +9 -0
- package/src/modal/test/index.js +11 -0
- package/src/navigation/README.md +0 -9
- package/src/navigator/context.ts +5 -1
- package/src/navigator/navigator-provider/README.md +30 -20
- package/src/navigator/navigator-provider/component.tsx +69 -25
- package/src/navigator/navigator-screen/component.tsx +71 -34
- package/src/navigator/stories/index.js +26 -13
- package/src/navigator/test/index.js +167 -32
- package/src/navigator/types.ts +11 -11
- package/src/navigator/use-navigator.ts +4 -4
- package/src/notice/index.native.js +5 -2
- package/src/notice/stories/index.js +1 -1
- package/src/number-control/stories/index.js +1 -1
- package/src/palette-edit/index.js +9 -2
- package/src/palette-edit/styles.js +22 -3
- package/src/panel/stories/index.js +1 -1
- package/src/placeholder/index.js +8 -6
- package/src/placeholder/stories/index.js +1 -1
- package/src/placeholder/style.scss +12 -0
- package/src/placeholder/test/index.js +18 -1
- package/src/popover/stories/index.js +1 -1
- package/src/query-controls/README.md +138 -6
- package/src/radio-group/README.md +4 -1
- package/src/range-control/stories/index.js +1 -1
- package/src/range-control/styles/range-control-styles.js +1 -1
- package/src/resizable-box/index.tsx +0 -1
- package/src/resizable-box/resize-tooltip/index.tsx +1 -2
- package/src/resizable-box/resize-tooltip/label.tsx +0 -1
- package/src/resizable-box/stories/index.js +1 -1
- package/src/sandbox/index.native.js +8 -5
- package/src/scrollable/hook.js +1 -1
- package/src/scrollable/stories/index.js +7 -4
- package/src/search-control/stories/index.js +1 -1
- package/src/select-control/stories/index.js +2 -1
- package/src/select-control/styles/select-control-styles.ts +25 -2
- package/src/select-control/types.ts +1 -1
- package/src/slot-fill/bubbles-virtually/fill.js +12 -1
- package/src/slot-fill/stories/index.js +1 -1
- package/src/snackbar/stories/index.js +1 -1
- package/src/spacer/component.tsx +0 -1
- package/src/spacer/stories/index.js +1 -1
- package/src/spacer/types.ts +0 -1
- package/src/spinner/README.md +10 -10
- package/src/spinner/index.js +42 -3
- package/src/spinner/index.native.js +7 -2
- package/src/spinner/stories/index.js +36 -3
- package/src/spinner/styles.js +47 -0
- package/src/style-provider/index.js +2 -0
- package/src/surface/hook.js +1 -0
- package/src/surface/stories/index.js +1 -1
- package/src/tab-panel/stories/index.js +1 -1
- package/src/text/get-line-height.ts +0 -1
- package/src/text/hook.js +1 -0
- package/src/text/types.ts +0 -1
- package/src/text-control/stories/index.js +1 -1
- package/src/text-highlight/stories/index.js +1 -1
- package/src/textarea-control/stories/index.js +1 -1
- package/src/tip/index.js +2 -4
- package/src/tip/stories/index.js +1 -1
- package/src/toggle-control/stories/index.js +1 -1
- package/src/toggle-group-control/stories/index.js +1 -1
- package/src/toggle-group-control/test/__snapshots__/index.js.snap +25 -27
- package/src/toggle-group-control/toggle-group-control/component.tsx +8 -14
- package/src/toggle-group-control/toggle-group-control/styles.ts +0 -14
- package/src/toggle-group-control/toggle-group-control-option/component.tsx +0 -1
- package/src/toggle-group-control/toggle-group-control-option/styles.ts +1 -3
- package/src/toggle-group-control/types.ts +1 -9
- package/src/toolbar-button/stories/index.js +1 -1
- package/src/tools-panel/stories/index.js +75 -1
- package/src/tools-panel/stories/tools-panel-with-item-group-slot.js +244 -0
- package/src/tools-panel/styles.ts +40 -2
- package/src/tools-panel/test/__snapshots__/index.js.snap +219 -0
- package/src/tools-panel/test/index.js +81 -1
- package/src/tools-panel/tools-panel/README.md +9 -0
- package/src/tools-panel/tools-panel/component.tsx +2 -6
- package/src/tools-panel/tools-panel/hook.ts +164 -97
- package/src/tools-panel/tools-panel-header/component.tsx +0 -1
- package/src/tools-panel/tools-panel-header/hook.ts +3 -3
- package/src/tools-panel/tools-panel-item/component.tsx +0 -1
- package/src/tools-panel/tools-panel-item/hook.ts +25 -2
- package/src/tools-panel/types.ts +14 -1
- package/src/tooltip/stories/index.js +1 -1
- package/src/tooltip/test/index.native.js +3 -1
- package/src/tree-grid/index.js +19 -5
- package/src/tree-select/stories/index.js +1 -1
- package/src/truncate/hook.js +1 -1
- package/src/truncate/stories/index.js +1 -1
- package/src/ui/README.md +1 -1
- package/src/ui/context/wordpress-component.ts +0 -1
- package/src/ui/control-group/types.ts +0 -1
- package/src/ui/form-group/types.ts +0 -1
- package/src/ui/shortcut/component.tsx +0 -1
- package/src/ui/tooltip/types.ts +0 -1
- package/src/ui/utils/font-size.ts +0 -1
- package/src/ui/utils/get-valid-children.ts +0 -1
- package/src/unit-control/index.tsx +0 -1
- package/src/unit-control/stories/index.js +19 -1
- package/src/unit-control/styles/unit-control-styles.ts +33 -46
- package/src/unit-control/types.ts +7 -4
- package/src/unit-control/unit-select-control.tsx +0 -1
- package/src/utils/colors-values.js +4 -3
- package/src/utils/config-values.js +1 -5
- package/src/utils/hooks/stories/use-cx.js +121 -44
- package/src/utils/hooks/use-combined-ref.ts +0 -1
- package/src/utils/hooks/use-latest-ref.ts +0 -1
- package/src/v-stack/types.ts +0 -1
- package/src/z-stack/README.md +1 -1
- package/src/z-stack/component.tsx +1 -2
- package/src/z-stack/stories/index.js +1 -1
- package/src/z-stack/styles.ts +7 -2
- package/tsconfig.json +9 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/build/spinner/styles/spinner-styles.js +0 -40
- package/build/spinner/styles/spinner-styles.js.map +0 -1
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +0 -90
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +0 -1
- package/build-module/spinner/styles/spinner-styles.js +0 -28
- package/build-module/spinner/styles/spinner-styles.js.map +0 -1
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +0 -86
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +0 -1
- package/build-types/spinner/styles/spinner-styles.d.ts +0 -5
- package/build-types/spinner/styles/spinner-styles.d.ts.map +0 -1
- package/build-types/toggle-group-control/component.d.ts +0 -4
- package/build-types/toggle-group-control/component.d.ts.map +0 -1
- package/build-types/toggle-group-control/styles.d.ts +0 -25
- package/build-types/toggle-group-control/styles.d.ts.map +0 -1
- package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts +0 -9
- package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +0 -1
- package/build-types/toggle-group-control/toggle-group-control-backdrop.d.ts +0 -9
- package/build-types/toggle-group-control/toggle-group-control-backdrop.d.ts.map +0 -1
- package/build-types/toggle-group-control/toggle-group-control-button.d.ts +0 -6
- package/build-types/toggle-group-control/toggle-group-control-button.d.ts.map +0 -1
- package/build-types/toggle-group-control/toggle-group-control-context.d.ts +0 -9
- package/build-types/toggle-group-control/toggle-group-control-context.d.ts.map +0 -1
- package/build-types/toggle-group-control/toggle-group-control-option.d.ts +0 -4
- package/build-types/toggle-group-control/toggle-group-control-option.d.ts.map +0 -1
- package/build-types/ui/color-picker/color-display.d.ts +0 -13
- package/build-types/ui/color-picker/color-display.d.ts.map +0 -1
- package/build-types/ui/color-picker/color-input.d.ts +0 -13
- package/build-types/ui/color-picker/color-input.d.ts.map +0 -1
- package/build-types/ui/color-picker/component.d.ts +0 -12
- package/build-types/ui/color-picker/component.d.ts.map +0 -1
- package/build-types/ui/color-picker/hex-input.d.ts +0 -12
- package/build-types/ui/color-picker/hex-input.d.ts.map +0 -1
- package/build-types/ui/color-picker/hsl-input.d.ts +0 -12
- package/build-types/ui/color-picker/hsl-input.d.ts.map +0 -1
- package/build-types/ui/color-picker/index.d.ts +0 -2
- package/build-types/ui/color-picker/index.d.ts.map +0 -1
- package/build-types/ui/color-picker/input-with-slider.d.ts +0 -11
- package/build-types/ui/color-picker/input-with-slider.d.ts.map +0 -1
- package/build-types/ui/color-picker/legacy-adapter.d.ts +0 -5
- package/build-types/ui/color-picker/legacy-adapter.d.ts.map +0 -1
- package/build-types/ui/color-picker/picker.d.ts +0 -12
- package/build-types/ui/color-picker/picker.d.ts.map +0 -1
- package/build-types/ui/color-picker/rgb-input.d.ts +0 -12
- package/build-types/ui/color-picker/rgb-input.d.ts.map +0 -1
- package/build-types/ui/color-picker/styles.d.ts +0 -76
- package/build-types/ui/color-picker/styles.d.ts.map +0 -1
- package/build-types/ui/color-picker/types.d.ts +0 -2
- package/build-types/ui/color-picker/types.d.ts.map +0 -1
- package/build-types/ui/color-picker/use-deprecated-props.d.ts +0 -50
- package/build-types/ui/color-picker/use-deprecated-props.d.ts.map +0 -1
- package/build-types/ui/utils/create-component.d.ts +0 -21
- package/build-types/ui/utils/create-component.d.ts.map +0 -1
- package/build-types/utils/hooks/use-jump-step.d.ts +0 -25
- package/build-types/utils/hooks/use-jump-step.d.ts.map +0 -1
- package/src/spinner/styles/spinner-styles.js +0 -47
- package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +0 -86
- package/src/ui/visually-hidden/README.md +0 -21
|
@@ -12,8 +12,13 @@ import DayPickerSingleDateController from 'react-dates/lib/components/DayPickerS
|
|
|
12
12
|
* WordPress dependencies
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { useEffect, useRef } from '@wordpress/element';
|
|
16
16
|
import { isRTL, _n, sprintf } from '@wordpress/i18n';
|
|
17
|
+
/**
|
|
18
|
+
* Internal dependencies
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { getMomentDate } from './utils';
|
|
17
22
|
/**
|
|
18
23
|
* Module Constants
|
|
19
24
|
*/
|
|
@@ -65,20 +70,20 @@ function DatePickerDay(_ref) {
|
|
|
65
70
|
}, day.format('D'));
|
|
66
71
|
}
|
|
67
72
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
73
|
+
function DatePicker(_ref2) {
|
|
74
|
+
let {
|
|
75
|
+
currentDate,
|
|
76
|
+
onChange,
|
|
77
|
+
events,
|
|
78
|
+
isInvalidDate,
|
|
79
|
+
onMonthPreviewed
|
|
80
|
+
} = _ref2;
|
|
81
|
+
const nodeRef = useRef();
|
|
82
|
+
|
|
83
|
+
const onMonthPreviewedHandler = newMonthDate => {
|
|
84
|
+
onMonthPreviewed === null || onMonthPreviewed === void 0 ? void 0 : onMonthPreviewed(newMonthDate.toISOString());
|
|
85
|
+
keepFocusInside();
|
|
86
|
+
};
|
|
82
87
|
/*
|
|
83
88
|
* Todo: We should remove this function ASAP.
|
|
84
89
|
* It is kept because focus is lost when we click on the previous and next month buttons.
|
|
@@ -87,21 +92,21 @@ class DatePicker extends Component {
|
|
|
87
92
|
*/
|
|
88
93
|
|
|
89
94
|
|
|
90
|
-
keepFocusInside() {
|
|
91
|
-
if (!
|
|
95
|
+
const keepFocusInside = () => {
|
|
96
|
+
if (!nodeRef.current) {
|
|
92
97
|
return;
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
const {
|
|
96
101
|
ownerDocument
|
|
97
|
-
} =
|
|
102
|
+
} = nodeRef.current;
|
|
98
103
|
const {
|
|
99
104
|
activeElement
|
|
100
105
|
} = ownerDocument; // If focus was lost.
|
|
101
106
|
|
|
102
|
-
if (!activeElement || !
|
|
107
|
+
if (!activeElement || !nodeRef.current.contains(ownerDocument.activeElement)) {
|
|
103
108
|
// Retrieve the focus region div.
|
|
104
|
-
const focusRegion =
|
|
109
|
+
const focusRegion = nodeRef.current.querySelector('.DayPicker_focusRegion');
|
|
105
110
|
|
|
106
111
|
if (!focusRegion) {
|
|
107
112
|
return;
|
|
@@ -110,14 +115,10 @@ class DatePicker extends Component {
|
|
|
110
115
|
|
|
111
116
|
focusRegion.focus();
|
|
112
117
|
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
onChangeMoment(newDate) {
|
|
116
|
-
const {
|
|
117
|
-
currentDate,
|
|
118
|
-
onChange
|
|
119
|
-
} = this.props; // If currentDate is null, use now as momentTime to designate hours, minutes, seconds.
|
|
118
|
+
};
|
|
120
119
|
|
|
120
|
+
const onChangeMoment = newDate => {
|
|
121
|
+
// If currentDate is null, use now as momentTime to designate hours, minutes, seconds.
|
|
121
122
|
const momentDate = currentDate ? moment(currentDate) : moment();
|
|
122
123
|
const momentTime = {
|
|
123
124
|
hours: momentDate.hours(),
|
|
@@ -126,71 +127,46 @@ class DatePicker extends Component {
|
|
|
126
127
|
};
|
|
127
128
|
onChange(newDate.set(momentTime).format(TIMEZONELESS_FORMAT)); // Keep focus on the date picker.
|
|
128
129
|
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Create a Moment object from a date string. With no currentDate supplied, default to a Moment
|
|
133
|
-
* object representing now. If a null value is passed, return a null value.
|
|
134
|
-
*
|
|
135
|
-
* @param {?string} currentDate Date representing the currently selected date or null to signify no selection.
|
|
136
|
-
* @return {?moment.Moment} Moment object for selected date or null.
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
getMomentDate(currentDate) {
|
|
141
|
-
if (null === currentDate) {
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return currentDate ? moment(currentDate) : moment();
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
getEventsPerDay(day) {
|
|
149
|
-
var _this$props$events;
|
|
130
|
+
keepFocusInside();
|
|
131
|
+
};
|
|
150
132
|
|
|
151
|
-
|
|
133
|
+
const getEventsPerDay = day => {
|
|
134
|
+
if (!(events !== null && events !== void 0 && events.length)) {
|
|
152
135
|
return [];
|
|
153
136
|
}
|
|
154
137
|
|
|
155
|
-
return
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
render() {
|
|
159
|
-
const {
|
|
160
|
-
currentDate,
|
|
161
|
-
isInvalidDate
|
|
162
|
-
} = this.props;
|
|
163
|
-
const momentDate = this.getMomentDate(currentDate);
|
|
164
|
-
return createElement("div", {
|
|
165
|
-
className: "components-datetime__date",
|
|
166
|
-
ref: this.nodeRef
|
|
167
|
-
}, createElement(DayPickerSingleDateController, {
|
|
168
|
-
date: momentDate,
|
|
169
|
-
daySize: 30,
|
|
170
|
-
focused: true,
|
|
171
|
-
hideKeyboardShortcutsPanel: true // This is a hack to force the calendar to update on month or year change
|
|
172
|
-
// https://github.com/airbnb/react-dates/issues/240#issuecomment-361776665
|
|
173
|
-
,
|
|
174
|
-
key: `datepicker-controller-${momentDate ? momentDate.format('MM-YYYY') : 'null'}`,
|
|
175
|
-
noBorder: true,
|
|
176
|
-
numberOfMonths: 1,
|
|
177
|
-
onDateChange: this.onChangeMoment,
|
|
178
|
-
transitionDuration: 0,
|
|
179
|
-
weekDayFormat: "ddd",
|
|
180
|
-
dayAriaLabelFormat: ARIAL_LABEL_TIME_FORMAT,
|
|
181
|
-
isRTL: isRTL(),
|
|
182
|
-
isOutsideRange: date => {
|
|
183
|
-
return isInvalidDate && isInvalidDate(date.toDate());
|
|
184
|
-
},
|
|
185
|
-
onPrevMonthClick: this.onMonthPreviewedHandler,
|
|
186
|
-
onNextMonthClick: this.onMonthPreviewedHandler,
|
|
187
|
-
renderDayContents: day => createElement(DatePickerDay, {
|
|
188
|
-
day: day,
|
|
189
|
-
events: this.getEventsPerDay(day)
|
|
190
|
-
})
|
|
191
|
-
}));
|
|
192
|
-
}
|
|
138
|
+
return events.filter(eventDay => day.isSame(eventDay.date, 'day'));
|
|
139
|
+
};
|
|
193
140
|
|
|
141
|
+
const momentDate = getMomentDate(currentDate);
|
|
142
|
+
return createElement("div", {
|
|
143
|
+
className: "components-datetime__date",
|
|
144
|
+
ref: nodeRef
|
|
145
|
+
}, createElement(DayPickerSingleDateController, {
|
|
146
|
+
date: momentDate,
|
|
147
|
+
daySize: 30,
|
|
148
|
+
focused: true,
|
|
149
|
+
hideKeyboardShortcutsPanel: true // This is a hack to force the calendar to update on month or year change
|
|
150
|
+
// https://github.com/airbnb/react-dates/issues/240#issuecomment-361776665
|
|
151
|
+
,
|
|
152
|
+
key: `datepicker-controller-${momentDate ? momentDate.format('MM-YYYY') : 'null'}`,
|
|
153
|
+
noBorder: true,
|
|
154
|
+
numberOfMonths: 1,
|
|
155
|
+
onDateChange: onChangeMoment,
|
|
156
|
+
transitionDuration: 0,
|
|
157
|
+
weekDayFormat: "ddd",
|
|
158
|
+
dayAriaLabelFormat: ARIAL_LABEL_TIME_FORMAT,
|
|
159
|
+
isRTL: isRTL(),
|
|
160
|
+
isOutsideRange: date => {
|
|
161
|
+
return isInvalidDate && isInvalidDate(date.toDate());
|
|
162
|
+
},
|
|
163
|
+
onPrevMonthClick: onMonthPreviewedHandler,
|
|
164
|
+
onNextMonthClick: onMonthPreviewedHandler,
|
|
165
|
+
renderDayContents: day => createElement(DatePickerDay, {
|
|
166
|
+
day: day,
|
|
167
|
+
events: getEventsPerDay(day)
|
|
168
|
+
})
|
|
169
|
+
}));
|
|
194
170
|
}
|
|
195
171
|
|
|
196
172
|
export default DatePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/date-time/date.js"],"names":["moment","classnames","DayPickerSingleDateController","Component","createRef","useEffect","useRef","isRTL","_n","sprintf","TIMEZONELESS_FORMAT","ARIAL_LABEL_TIME_FORMAT","DatePickerDay","day","events","ref","current","parentNode","dayAriaLabel","format","length","setAttribute","dayWithEventsDescription","DatePicker","constructor","arguments","onChangeMoment","bind","nodeRef","onMonthPreviewedHandler","newMonthDate","props","onMonthPreviewed","toISOString","keepFocusInside","ownerDocument","activeElement","contains","focusRegion","querySelector","focus","newDate","currentDate","onChange","momentDate","momentTime","hours","minutes","seconds","set","getMomentDate","getEventsPerDay","filter","eventDay","isSame","date","render","isInvalidDate","toDate"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,QAAnB;AACA,OAAOC,UAAP,MAAuB,YAAvB,C,CAEA;AACA;;AACA,OAAOC,6BAAP,MAA0C,0DAA1C;AAEA;AACA;AACA;;AACA,SAASC,SAAT,EAAoBC,SAApB,EAA+BC,SAA/B,EAA0CC,MAA1C,QAAwD,oBAAxD;AACA,SAASC,KAAT,EAAgBC,EAAhB,EAAoBC,OAApB,QAAmC,iBAAnC;AAEA;AACA;AACA;;AACA,MAAMC,mBAAmB,GAAG,qBAA5B;AACA,MAAMC,uBAAuB,GAAG,UAAhC;;AAEA,SAASC,aAAT,OAA+C;AAAA,MAAvB;AAAEC,IAAAA,GAAF;AAAOC,IAAAA,MAAM,GAAG;AAAhB,GAAuB;AAC9C,QAAMC,GAAG,GAAGT,MAAM,EAAlB;AAEA;AACD;AACA;AACA;AACA;AACA;;AACCD,EAAAA,SAAS,CAAE,MAAM;AAAA;;AAChB;AACA,QAAK,EAAEU,GAAF,aAAEA,GAAF,+BAAEA,GAAG,CAAEC,OAAP,yCAAE,aAAcC,UAAhB,CAAL,EAAkC;AACjC;AACA;;AAED,UAAM;AAAEA,MAAAA;AAAF,QAAiBF,GAAG,CAACC,OAA3B;AACA,UAAME,YAAY,GAAGlB,MAAM,CAAEa,GAAF,CAAN,CAAcM,MAAd,CAAsBR,uBAA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D;AACC,QAAA,GAAG,EAAGA,GADP;AAEC,QAAA,MAAM,EAAG,KAAKsC,eAAL,CAAsBtC,GAAtB;AAFV;AAvBF,MADD,CADD;AAiCA;;AA7HiC;;AAgInC,eAAeU,UAAf","sourcesContent":["/**\n * External dependencies\n */\nimport moment from 'moment';\nimport classnames from 'classnames';\n\n// react-dates doesn't tree-shake correctly, so we import from the individual\n// component here, to avoid including too much of the library\nimport DayPickerSingleDateController from 'react-dates/lib/components/DayPickerSingleDateController';\n\n/**\n * WordPress dependencies\n */\nimport { Component, createRef, useEffect, useRef } from '@wordpress/element';\nimport { isRTL, _n, sprintf } from '@wordpress/i18n';\n\n/**\n * Module Constants\n */\nconst TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';\nconst ARIAL_LABEL_TIME_FORMAT = 'dddd, LL';\n\nfunction DatePickerDay( { day, events = [] } ) {\n\tconst ref = useRef();\n\n\t/*\n\t * a11y hack to make the `There is/are n events` string\n\t * available speaking for readers,\n\t * re-defining the aria-label attribute.\n\t * This attribute is handled by the react-dates component.\n\t */\n\tuseEffect( () => {\n\t\t// Bail when no parent node.\n\t\tif ( ! ref?.current?.parentNode ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { parentNode } = ref.current;\n\t\tconst dayAriaLabel = moment( day ).format( ARIAL_LABEL_TIME_FORMAT );\n\n\t\tif ( ! events.length ) {\n\t\t\t// Set aria-label without event description.\n\t\t\tparentNode.setAttribute( 'aria-label', dayAriaLabel );\n\t\t\treturn;\n\t\t}\n\n\t\tconst dayWithEventsDescription = sprintf(\n\t\t\t// translators: 1: Calendar day format, 2: Calendar event number.\n\t\t\t_n(\n\t\t\t\t'%1$s. There is %2$d event.',\n\t\t\t\t'%1$s. There are %2$d events.',\n\t\t\t\tevents.length\n\t\t\t),\n\t\t\tdayAriaLabel,\n\t\t\tevents.length\n\t\t);\n\n\t\tparentNode.setAttribute( 'aria-label', dayWithEventsDescription );\n\t}, [ events.length ] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ classnames( 'components-datetime__date__day', {\n\t\t\t\t'has-events': events?.length,\n\t\t\t} ) }\n\t\t>\n\t\t\t{ day.format( 'D' ) }\n\t\t</div>\n\t);\n}\n\nclass DatePicker extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.onChangeMoment = this.onChangeMoment.bind( this );\n\t\tthis.nodeRef = createRef();\n\t\tthis.onMonthPreviewedHandler = this.onMonthPreviewedHandler.bind(\n\t\t\tthis\n\t\t);\n\t}\n\n\tonMonthPreviewedHandler( newMonthDate ) {\n\t\tthis.props.onMonthPreviewed?.( newMonthDate.toISOString() );\n\t\tthis.keepFocusInside();\n\t}\n\n\t/*\n\t * Todo: We should remove this function ASAP.\n\t * It is kept because focus is lost when we click on the previous and next month buttons.\n\t * This focus loss closes the date picker popover.\n\t * Ideally we should add an upstream commit on react-dates to fix this issue.\n\t */\n\tkeepFocusInside() {\n\t\tif ( ! this.nodeRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { ownerDocument } = this.nodeRef.current;\n\t\tconst { activeElement } = ownerDocument;\n\n\t\t// If focus was lost.\n\t\tif (\n\t\t\t! activeElement ||\n\t\t\t! this.nodeRef.current.contains( ownerDocument.activeElement )\n\t\t) {\n\t\t\t// Retrieve the focus region div.\n\t\t\tconst focusRegion = this.nodeRef.current.querySelector(\n\t\t\t\t'.DayPicker_focusRegion'\n\t\t\t);\n\t\t\tif ( ! focusRegion ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Keep the focus on focus region.\n\t\t\tfocusRegion.focus();\n\t\t}\n\t}\n\n\tonChangeMoment( newDate ) {\n\t\tconst { currentDate, onChange } = this.props;\n\n\t\t// If currentDate is null, use now as momentTime to designate hours, minutes, seconds.\n\t\tconst momentDate = currentDate ? moment( currentDate ) : moment();\n\t\tconst momentTime = {\n\t\t\thours: momentDate.hours(),\n\t\t\tminutes: momentDate.minutes(),\n\t\t\tseconds: 0,\n\t\t};\n\n\t\tonChange( newDate.set( momentTime ).format( TIMEZONELESS_FORMAT ) );\n\n\t\t// Keep focus on the date picker.\n\t\tthis.keepFocusInside();\n\t}\n\n\t/**\n\t * Create a Moment object from a date string. With no currentDate supplied, default to a Moment\n\t * object representing now. If a null value is passed, return a null value.\n\t *\n\t * @param {?string} currentDate Date representing the currently selected date or null to signify no selection.\n\t * @return {?moment.Moment} Moment object for selected date or null.\n\t */\n\tgetMomentDate( currentDate ) {\n\t\tif ( null === currentDate ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn currentDate ? moment( currentDate ) : moment();\n\t}\n\n\tgetEventsPerDay( day ) {\n\t\tif ( ! this.props.events?.length ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn this.props.events.filter( ( eventDay ) =>\n\t\t\tday.isSame( eventDay.date, 'day' )\n\t\t);\n\t}\n\n\trender() {\n\t\tconst { currentDate, isInvalidDate } = this.props;\n\t\tconst momentDate = this.getMomentDate( currentDate );\n\n\t\treturn (\n\t\t\t<div className=\"components-datetime__date\" ref={ this.nodeRef }>\n\t\t\t\t<DayPickerSingleDateController\n\t\t\t\t\tdate={ momentDate }\n\t\t\t\t\tdaySize={ 30 }\n\t\t\t\t\tfocused\n\t\t\t\t\thideKeyboardShortcutsPanel\n\t\t\t\t\t// This is a hack to force the calendar to update on month or year change\n\t\t\t\t\t// https://github.com/airbnb/react-dates/issues/240#issuecomment-361776665\n\t\t\t\t\tkey={ `datepicker-controller-${\n\t\t\t\t\t\tmomentDate ? momentDate.format( 'MM-YYYY' ) : 'null'\n\t\t\t\t\t}` }\n\t\t\t\t\tnoBorder\n\t\t\t\t\tnumberOfMonths={ 1 }\n\t\t\t\t\tonDateChange={ this.onChangeMoment }\n\t\t\t\t\ttransitionDuration={ 0 }\n\t\t\t\t\tweekDayFormat=\"ddd\"\n\t\t\t\t\tdayAriaLabelFormat={ ARIAL_LABEL_TIME_FORMAT }\n\t\t\t\t\tisRTL={ isRTL() }\n\t\t\t\t\tisOutsideRange={ ( date ) => {\n\t\t\t\t\t\treturn isInvalidDate && isInvalidDate( date.toDate() );\n\t\t\t\t\t} }\n\t\t\t\t\tonPrevMonthClick={ this.onMonthPreviewedHandler }\n\t\t\t\t\tonNextMonthClick={ this.onMonthPreviewedHandler }\n\t\t\t\t\trenderDayContents={ ( day ) => (\n\t\t\t\t\t\t<DatePickerDay\n\t\t\t\t\t\t\tday={ day }\n\t\t\t\t\t\t\tevents={ this.getEventsPerDay( day ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default DatePicker;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/date-time/date.js"],"names":["moment","classnames","DayPickerSingleDateController","useEffect","useRef","isRTL","_n","sprintf","getMomentDate","TIMEZONELESS_FORMAT","ARIAL_LABEL_TIME_FORMAT","DatePickerDay","day","events","ref","current","parentNode","dayAriaLabel","format","length","setAttribute","dayWithEventsDescription","DatePicker","currentDate","onChange","isInvalidDate","onMonthPreviewed","nodeRef","onMonthPreviewedHandler","newMonthDate","toISOString","keepFocusInside","ownerDocument","activeElement","contains","focusRegion","querySelector","focus","onChangeMoment","newDate","momentDate","momentTime","hours","minutes","seconds","set","getEventsPerDay","filter","eventDay","isSame","date","toDate"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,QAAnB;AACA,OAAOC,UAAP,MAAuB,YAAvB,C,CAEA;AACA;;AACA,OAAOC,6BAAP,MAA0C,0DAA1C;AAEA;AACA;AACA;;AACA,SAASC,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AACA,SAASC,KAAT,EAAgBC,EAAhB,EAAoBC,OAApB,QAAmC,iBAAnC;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,SAA9B;AAEA;AACA;AACA;;AACA,MAAMC,mBAAmB,GAAG,qBAA5B;AACA,MAAMC,uBAAuB,GAAG,UAAhC;;AAEA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ElC,GAAF;AAFzB;AAvBF,IADD,CADD;AAiCA;;AAED,eAAeU,UAAf","sourcesContent":["/**\n * External dependencies\n */\nimport moment from 'moment';\nimport classnames from 'classnames';\n\n// react-dates doesn't tree-shake correctly, so we import from the individual\n// component here, to avoid including too much of the library\nimport DayPickerSingleDateController from 'react-dates/lib/components/DayPickerSingleDateController';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { isRTL, _n, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getMomentDate } from './utils';\n\n/**\n * Module Constants\n */\nconst TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';\nconst ARIAL_LABEL_TIME_FORMAT = 'dddd, LL';\n\nfunction DatePickerDay( { day, events = [] } ) {\n\tconst ref = useRef();\n\n\t/*\n\t * a11y hack to make the `There is/are n events` string\n\t * available speaking for readers,\n\t * re-defining the aria-label attribute.\n\t * This attribute is handled by the react-dates component.\n\t */\n\tuseEffect( () => {\n\t\t// Bail when no parent node.\n\t\tif ( ! ref?.current?.parentNode ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { parentNode } = ref.current;\n\t\tconst dayAriaLabel = moment( day ).format( ARIAL_LABEL_TIME_FORMAT );\n\n\t\tif ( ! events.length ) {\n\t\t\t// Set aria-label without event description.\n\t\t\tparentNode.setAttribute( 'aria-label', dayAriaLabel );\n\t\t\treturn;\n\t\t}\n\n\t\tconst dayWithEventsDescription = sprintf(\n\t\t\t// translators: 1: Calendar day format, 2: Calendar event number.\n\t\t\t_n(\n\t\t\t\t'%1$s. There is %2$d event.',\n\t\t\t\t'%1$s. There are %2$d events.',\n\t\t\t\tevents.length\n\t\t\t),\n\t\t\tdayAriaLabel,\n\t\t\tevents.length\n\t\t);\n\n\t\tparentNode.setAttribute( 'aria-label', dayWithEventsDescription );\n\t}, [ events.length ] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ classnames( 'components-datetime__date__day', {\n\t\t\t\t'has-events': events?.length,\n\t\t\t} ) }\n\t\t>\n\t\t\t{ day.format( 'D' ) }\n\t\t</div>\n\t);\n}\n\nfunction DatePicker( {\n\tcurrentDate,\n\tonChange,\n\tevents,\n\tisInvalidDate,\n\tonMonthPreviewed,\n} ) {\n\tconst nodeRef = useRef();\n\tconst onMonthPreviewedHandler = ( newMonthDate ) => {\n\t\tonMonthPreviewed?.( newMonthDate.toISOString() );\n\t\tkeepFocusInside();\n\t};\n\n\t/*\n\t * Todo: We should remove this function ASAP.\n\t * It is kept because focus is lost when we click on the previous and next month buttons.\n\t * This focus loss closes the date picker popover.\n\t * Ideally we should add an upstream commit on react-dates to fix this issue.\n\t */\n\tconst keepFocusInside = () => {\n\t\tif ( ! nodeRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { ownerDocument } = nodeRef.current;\n\t\tconst { activeElement } = ownerDocument;\n\n\t\t// If focus was lost.\n\t\tif (\n\t\t\t! activeElement ||\n\t\t\t! nodeRef.current.contains( ownerDocument.activeElement )\n\t\t) {\n\t\t\t// Retrieve the focus region div.\n\t\t\tconst focusRegion = nodeRef.current.querySelector(\n\t\t\t\t'.DayPicker_focusRegion'\n\t\t\t);\n\t\t\tif ( ! focusRegion ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Keep the focus on focus region.\n\t\t\tfocusRegion.focus();\n\t\t}\n\t};\n\n\tconst onChangeMoment = ( newDate ) => {\n\t\t// If currentDate is null, use now as momentTime to designate hours, minutes, seconds.\n\t\tconst momentDate = currentDate ? moment( currentDate ) : moment();\n\t\tconst momentTime = {\n\t\t\thours: momentDate.hours(),\n\t\t\tminutes: momentDate.minutes(),\n\t\t\tseconds: 0,\n\t\t};\n\n\t\tonChange( newDate.set( momentTime ).format( TIMEZONELESS_FORMAT ) );\n\n\t\t// Keep focus on the date picker.\n\t\tkeepFocusInside();\n\t};\n\n\tconst getEventsPerDay = ( day ) => {\n\t\tif ( ! events?.length ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn events.filter( ( eventDay ) =>\n\t\t\tday.isSame( eventDay.date, 'day' )\n\t\t);\n\t};\n\n\tconst momentDate = getMomentDate( currentDate );\n\n\treturn (\n\t\t<div className=\"components-datetime__date\" ref={ nodeRef }>\n\t\t\t<DayPickerSingleDateController\n\t\t\t\tdate={ momentDate }\n\t\t\t\tdaySize={ 30 }\n\t\t\t\tfocused\n\t\t\t\thideKeyboardShortcutsPanel\n\t\t\t\t// This is a hack to force the calendar to update on month or year change\n\t\t\t\t// https://github.com/airbnb/react-dates/issues/240#issuecomment-361776665\n\t\t\t\tkey={ `datepicker-controller-${\n\t\t\t\t\tmomentDate ? momentDate.format( 'MM-YYYY' ) : 'null'\n\t\t\t\t}` }\n\t\t\t\tnoBorder\n\t\t\t\tnumberOfMonths={ 1 }\n\t\t\t\tonDateChange={ onChangeMoment }\n\t\t\t\ttransitionDuration={ 0 }\n\t\t\t\tweekDayFormat=\"ddd\"\n\t\t\t\tdayAriaLabelFormat={ ARIAL_LABEL_TIME_FORMAT }\n\t\t\t\tisRTL={ isRTL() }\n\t\t\t\tisOutsideRange={ ( date ) => {\n\t\t\t\t\treturn isInvalidDate && isInvalidDate( date.toDate() );\n\t\t\t\t} }\n\t\t\t\tonPrevMonthClick={ onMonthPreviewedHandler }\n\t\t\t\tonNextMonthClick={ onMonthPreviewedHandler }\n\t\t\t\trenderDayContents={ ( day ) => (\n\t\t\t\t\t<DatePickerDay\n\t\t\t\t\t\tday={ day }\n\t\t\t\t\t\tevents={ getEventsPerDay( day ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport default DatePicker;\n"]}
|
|
@@ -202,7 +202,7 @@ export function TimePicker(_ref2) {
|
|
|
202
202
|
}, __('November')), createElement("option", {
|
|
203
203
|
value: "12"
|
|
204
204
|
}, __('December'))));
|
|
205
|
-
const dayMonthFormat = is12Hour ? createElement(Fragment, null,
|
|
205
|
+
const dayMonthFormat = is12Hour ? createElement(Fragment, null, monthFormat, dayFormat) : createElement(Fragment, null, dayFormat, monthFormat);
|
|
206
206
|
return createElement("div", {
|
|
207
207
|
className: classnames('components-datetime__time')
|
|
208
208
|
}, createElement("fieldset", null, createElement("legend", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/date-time/time.js"],"names":["classnames","isInteger","moment","createElement","useState","useMemo","useEffect","__","Button","ButtonGroup","TimeZone","TIMEZONELESS_FORMAT","from12hTo24h","hours","isPm","UpdateOnBlurAsIntegerField","as","value","onUpdate","props","handleBlur","event","target","parsedValue","parseInt","max","min","name","key","defaultValue","onBlur","TimePicker","is12Hour","currentTime","onChange","date","setDate","startOf","day","month","year","minutes","am","format","changeDate","newDate","update","adjustedValue","clone","updateAmPm","parsedHours","dayFormat","monthFormat","dayMonthFormat"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,SAAT,QAA0B,QAA1B;AACA,OAAOC,MAAP,MAAmB,QAAnB;AAEA;AACA;AACA;;AACA,SACCC,aADD,EAECC,QAFD,EAGCC,OAHD,EAICC,SAJD,QAKO,oBALP;AAMA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,QAAP,MAAqB,YAArB;AAEA;AACA;AACA;;AACA,MAAMC,mBAAmB,GAAG,qBAA5B;;AAEA,SAASC,YAAT,CAAuBC,KAAvB,EAA8BC,IAA9B,EAAqC;AACpC,SAAOA,IAAI,GAAG,CAAID,KAAK,GAAG,EAAV,GAAiB,EAAnB,IAA0B,EAA7B,GAAkCA,KAAK,GAAG,EAArD;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASE,0BAAT,OAAyE;AAAA,MAApC;AAAEC,IAAAA,EAAF;AAAMC,IAAAA,KA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,GAAG,EAAG,CANP;AAOC,IAAA,GAAG,EAAG,EAPP;AAQC,IAAA,KAAK,EAAGkC,OART;AASC,IAAA,QAAQ,EAAGK;AATZ,IAlBD,CADD,EA+BGd,QAAQ,IACT,cAAC,WAAD;AAAa,IAAA,SAAS,EAAC;AAAvB,KACC,cAAC,MAAD;AACC,IAAA,OAAO,EACNU,EAAE,KAAK,IAAP,GAAc,SAAd,GAA0B,WAF5B;AAIC,IAAA,OAAO,EAAGO,UAAU,CAAE,IAAF,CAJrB;AAKC,IAAA,SAAS,EAAC;AALX,KAOG1C,EAAE,CAAE,IAAF,CAPL,CADD,EAUC,cAAC,MAAD;AACC,IAAA,OAAO,EACNmC,EAAE,KAAK,IAAP,GAAc,SAAd,GAA0B,WAF5B;AAIC,IAAA,OAAO,EAAGO,UAAU,CAAE,IAAF,CAJrB;AAKC,IAAA,SAAS,EAAC;AALX,KAOG1C,EAAE,CAAE,IAAF,CAPL,CAVD,CAhCF,EAsDC,cAAC,QAAD,OAtDD,CAJD,CAxBD,CADD;AAwFA;AAED,eAAewB,UAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { isInteger } from 'lodash';\nimport moment from 'moment';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateElement,\n\tuseState,\n\tuseMemo,\n\tuseEffect,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ButtonGroup from '../button-group';\nimport TimeZone from './timezone';\n\n/**\n * Module Constants\n */\nconst TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';\n\nfunction from12hTo24h( hours, isPm ) {\n\treturn isPm ? ( ( hours % 12 ) + 12 ) % 24 : hours % 12;\n}\n\n/**\n * <UpdateOnBlurAsIntegerField>\n * A shared component to parse, validate, and handle remounting of the underlying form field element like <input> and <select>.\n *\n * @param {Object} props Component props.\n * @param {string} props.as Render the component as specific element tag, defaults to \"input\".\n * @param {number|string} props.value The default value of the component which will be parsed to integer.\n * @param {Function} props.onUpdate Call back when blurred and validated.\n */\nfunction UpdateOnBlurAsIntegerField( { as, value, onUpdate, ...props } ) {\n\tfunction handleBlur( event ) {\n\t\tconst { target } = event;\n\n\t\tif ( value === target.value ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst parsedValue = parseInt( target.value, 10 );\n\n\t\t// Run basic number validation on the input.\n\t\tif (\n\t\t\t! isInteger( parsedValue ) ||\n\t\t\t( typeof props.max !== 'undefined' && parsedValue > props.max ) ||\n\t\t\t( typeof props.min !== 'undefined' && parsedValue < props.min )\n\t\t) {\n\t\t\t// If validation failed, reset the value to the previous valid value.\n\t\t\ttarget.value = value;\n\t\t} else {\n\t\t\t// Otherwise, it's valid, call onUpdate.\n\t\t\tonUpdate( target.name, parsedValue );\n\t\t}\n\t}\n\n\treturn createElement( as || 'input', {\n\t\t// Re-mount the input value to accept the latest value as the defaultValue.\n\t\tkey: value,\n\t\tdefaultValue: value,\n\t\tonBlur: handleBlur,\n\t\t...props,\n\t} );\n}\n\n/**\n * <TimePicker>\n *\n * @typedef {Date|string|number} WPValidDateTimeFormat\n *\n * @param {Object} props Component props.\n * @param {boolean} props.is12Hour Should the time picker showed in 12 hour format or 24 hour format.\n * @param {WPValidDateTimeFormat} props.currentTime The initial current time the time picker should render.\n * @param {Function} props.onChange Callback function when the date changed.\n */\nexport function TimePicker( { is12Hour, currentTime, onChange } ) {\n\tconst [ date, setDate ] = useState( () =>\n\t\t// Truncate the date at the minutes, see: #15495.\n\t\tmoment( currentTime ).startOf( 'minutes' )\n\t);\n\n\t// Reset the state when currentTime changed.\n\tuseEffect( () => {\n\t\tsetDate(\n\t\t\tcurrentTime ? moment( currentTime ).startOf( 'minutes' ) : moment()\n\t\t);\n\t}, [ currentTime ] );\n\n\tconst { day, month, year, minutes, hours, am } = useMemo(\n\t\t() => ( {\n\t\t\tday: date.format( 'DD' ),\n\t\t\tmonth: date.format( 'MM' ),\n\t\t\tyear: date.format( 'YYYY' ),\n\t\t\tminutes: date.format( 'mm' ),\n\t\t\thours: date.format( is12Hour ? 'hh' : 'HH' ),\n\t\t\tam: date.format( 'H' ) <= 11 ? 'AM' : 'PM',\n\t\t} ),\n\t\t[ date, is12Hour ]\n\t);\n\n\t/**\n\t * Function that sets the date state and calls the onChange with a new date.\n\t * The date is truncated at the minutes.\n\t *\n\t * @param {Object} newDate The date object.\n\t */\n\tfunction changeDate( newDate ) {\n\t\tsetDate( newDate );\n\t\tonChange( newDate.format( TIMEZONELESS_FORMAT ) );\n\t}\n\n\tfunction update( name, value ) {\n\t\t// If the 12-hour format is being used and the 'PM' period is selected, then\n\t\t// the incoming value (which ranges 1-12) should be increased by 12 to match\n\t\t// the expected 24-hour format.\n\t\tlet adjustedValue = value;\n\t\tif ( name === 'hours' && is12Hour ) {\n\t\t\tadjustedValue = from12hTo24h( value, am === 'PM' );\n\t\t}\n\n\t\t// Clone the date and call the specific setter function according to `name`.\n\t\tconst newDate = date.clone()[ name ]( adjustedValue );\n\t\tchangeDate( newDate );\n\t}\n\n\tfunction updateAmPm( value ) {\n\t\treturn () => {\n\t\t\tif ( am === value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst parsedHours = parseInt( hours, 10 );\n\n\t\t\tconst newDate = date\n\t\t\t\t.clone()\n\t\t\t\t.hours( from12hTo24h( parsedHours, value === 'PM' ) );\n\n\t\t\tchangeDate( newDate );\n\t\t};\n\t}\n\n\tconst dayFormat = (\n\t\t<div className=\"components-datetime__time-field components-datetime__time-field-day\">\n\t\t\t<UpdateOnBlurAsIntegerField\n\t\t\t\taria-label={ __( 'Day' ) }\n\t\t\t\tclassName=\"components-datetime__time-field-day-input\"\n\t\t\t\ttype=\"number\"\n\t\t\t\t// The correct function to call in moment.js is \"date\" not \"day\".\n\t\t\t\tname=\"date\"\n\t\t\t\tvalue={ day }\n\t\t\t\tstep={ 1 }\n\t\t\t\tmin={ 1 }\n\t\t\t\tmax={ 31 }\n\t\t\t\tonUpdate={ update }\n\t\t\t/>\n\t\t</div>\n\t);\n\n\tconst monthFormat = (\n\t\t<div className=\"components-datetime__time-field components-datetime__time-field-month\">\n\t\t\t<UpdateOnBlurAsIntegerField\n\t\t\t\tas=\"select\"\n\t\t\t\taria-label={ __( 'Month' ) }\n\t\t\t\tclassName=\"components-datetime__time-field-month-select\"\n\t\t\t\tname=\"month\"\n\t\t\t\tvalue={ month }\n\t\t\t\t// The value starts from 0, so we have to -1 when setting month.\n\t\t\t\tonUpdate={ ( key, value ) => update( key, value - 1 ) }\n\t\t\t>\n\t\t\t\t<option value=\"01\">{ __( 'January' ) }</option>\n\t\t\t\t<option value=\"02\">{ __( 'February' ) }</option>\n\t\t\t\t<option value=\"03\">{ __( 'March' ) }</option>\n\t\t\t\t<option value=\"04\">{ __( 'April' ) }</option>\n\t\t\t\t<option value=\"05\">{ __( 'May' ) }</option>\n\t\t\t\t<option value=\"06\">{ __( 'June' ) }</option>\n\t\t\t\t<option value=\"07\">{ __( 'July' ) }</option>\n\t\t\t\t<option value=\"08\">{ __( 'August' ) }</option>\n\t\t\t\t<option value=\"09\">{ __( 'September' ) }</option>\n\t\t\t\t<option value=\"10\">{ __( 'October' ) }</option>\n\t\t\t\t<option value=\"11\">{ __( 'November' ) }</option>\n\t\t\t\t<option value=\"12\">{ __( 'December' ) }</option>\n\t\t\t</UpdateOnBlurAsIntegerField>\n\t\t</div>\n\t);\n\n\tconst dayMonthFormat = is12Hour ? (\n\t\t<>\n\t\t\t{ dayFormat }\n\t\t\t{ monthFormat }\n\t\t</>\n\t) : (\n\t\t<>\n\t\t\t{ monthFormat }\n\t\t\t{ dayFormat }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div className={ classnames( 'components-datetime__time' ) }>\n\t\t\t<fieldset>\n\t\t\t\t<legend className=\"components-datetime__time-legend invisible\">\n\t\t\t\t\t{ __( 'Date' ) }\n\t\t\t\t</legend>\n\t\t\t\t<div className=\"components-datetime__time-wrapper\">\n\t\t\t\t\t{ dayMonthFormat }\n\n\t\t\t\t\t<div className=\"components-datetime__time-field components-datetime__time-field-year\">\n\t\t\t\t\t\t<UpdateOnBlurAsIntegerField\n\t\t\t\t\t\t\taria-label={ __( 'Year' ) }\n\t\t\t\t\t\t\tclassName=\"components-datetime__time-field-year-input\"\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tname=\"year\"\n\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={ 9999 }\n\t\t\t\t\t\t\tvalue={ year }\n\t\t\t\t\t\t\tonUpdate={ update }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\n\t\t\t<fieldset>\n\t\t\t\t<legend className=\"components-datetime__time-legend invisible\">\n\t\t\t\t\t{ __( 'Time' ) }\n\t\t\t\t</legend>\n\t\t\t\t<div className=\"components-datetime__time-wrapper\">\n\t\t\t\t\t<div className=\"components-datetime__time-field components-datetime__time-field-time\">\n\t\t\t\t\t\t<UpdateOnBlurAsIntegerField\n\t\t\t\t\t\t\taria-label={ __( 'Hours' ) }\n\t\t\t\t\t\t\tclassName=\"components-datetime__time-field-hours-input\"\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tname=\"hours\"\n\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\tmin={ is12Hour ? 1 : 0 }\n\t\t\t\t\t\t\tmax={ is12Hour ? 12 : 23 }\n\t\t\t\t\t\t\tvalue={ hours }\n\t\t\t\t\t\t\tonUpdate={ update }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"components-datetime__time-separator\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t:\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<UpdateOnBlurAsIntegerField\n\t\t\t\t\t\t\taria-label={ __( 'Minutes' ) }\n\t\t\t\t\t\t\tclassName=\"components-datetime__time-field-minutes-input\"\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tname=\"minutes\"\n\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={ 59 }\n\t\t\t\t\t\t\tvalue={ minutes }\n\t\t\t\t\t\t\tonUpdate={ update }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t{ is12Hour && (\n\t\t\t\t\t\t<ButtonGroup className=\"components-datetime__time-field components-datetime__time-field-am-pm\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tam === 'AM' ? 'primary' : 'secondary'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonClick={ updateAmPm( 'AM' ) }\n\t\t\t\t\t\t\t\tclassName=\"components-datetime__time-am-button\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'AM' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tam === 'PM' ? 'primary' : 'secondary'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonClick={ updateAmPm( 'PM' ) }\n\t\t\t\t\t\t\t\tclassName=\"components-datetime__time-pm-button\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'PM' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</ButtonGroup>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<TimeZone />\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\t\t</div>\n\t);\n}\n\nexport default TimePicker;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/date-time/time.js"],"names":["classnames","isInteger","moment","createElement","useState","useMemo","useEffect","__","Button","ButtonGroup","TimeZone","TIMEZONELESS_FORMAT","from12hTo24h","hours","isPm","UpdateOnBlurAsIntegerField","as","value","onUpdate","props","handleBlur","event","target","parsedValue","parseInt","max","min","name","key","defaultValue","onBlur","TimePicker","is12Hour","currentTime","onChange","date","setDate","startOf","day","month","year","minutes","am","format","changeDate","newDate","update","adjustedValue","clone","updateAmPm","parsedHours","dayFormat","monthFormat","dayMonthFormat"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,SAAT,QAA0B,QAA1B;AACA,OAAOC,MAAP,MAAmB,QAAnB;AAEA;AACA;AACA;;AACA,SACCC,aADD,EAECC,QAFD,EAGCC,OAHD,EAICC,SAJD,QAKO,oBALP;AAMA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,QAAP,MAAqB,YAArB;AAEA;AACA;AACA;;AACA,MAAMC,mBAAmB,GAAG,qBAA5B;;AAEA,SAASC,YAAT,CAAuBC,KAAvB,EAA8BC,IAA9B,EAAqC;AACpC,SAAOA,IAAI,GAAG,CAAID,KAAK,GAAG,EAAV,GAAiB,EAAnB,IAA0B,EAA7B,GAAkCA,KAAK,GAAG,EAArD;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASE,0BAAT,OAAyE;AAAA,MAApC;AAAEC,IAAAA,EAAF;AAAMC,IAAAA,KAAN;AAAaC,IAAAA,QAAb;AAAuB,OAAGC;AAA1B,GAAoC;;AACxE,WAASC,UAAT,CAAqBC,KAArB,EAA6B;AAC5B,UAAM;AAAEC,MAAAA;AAAF,QAAaD,KAAnB;;AAEA,QAAKJ,KAAK,KAAKK,MAAM,CAACL,KAAtB,EAA8B;AAC7B;AACA;;AAED,UAAMM,WAAW,GAAGC,QAAQ,CAAEF,MAAM,CAACL,KAAT,EAAgB,EAAhB,CAA5B,CAP4B,CAS5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AAE,IAAF,CAJrB;AAKC,IAAA,SAAS,EAAC;AALX,KAOG1C,EAAE,CAAE,IAAF,CAPL,CADD,EAUC,cAAC,MAAD;AACC,IAAA,OAAO,EACNmC,EAAE,KAAK,IAAP,GAAc,SAAd,GAA0B,WAF5B;AAIC,IAAA,OAAO,EAAGO,UAAU,CAAE,IAAF,CAJrB;AAKC,IAAA,SAAS,EAAC;AALX,KAOG1C,EAAE,CAAE,IAAF,CAPL,CAVD,CAhCF,EAsDC,cAAC,QAAD,OAtDD,CAJD,CAxBD,CADD;AAwFA;AAED,eAAewB,UAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { isInteger } from 'lodash';\nimport moment from 'moment';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateElement,\n\tuseState,\n\tuseMemo,\n\tuseEffect,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ButtonGroup from '../button-group';\nimport TimeZone from './timezone';\n\n/**\n * Module Constants\n */\nconst TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';\n\nfunction from12hTo24h( hours, isPm ) {\n\treturn isPm ? ( ( hours % 12 ) + 12 ) % 24 : hours % 12;\n}\n\n/**\n * <UpdateOnBlurAsIntegerField>\n * A shared component to parse, validate, and handle remounting of the underlying form field element like <input> and <select>.\n *\n * @param {Object} props Component props.\n * @param {string} props.as Render the component as specific element tag, defaults to \"input\".\n * @param {number|string} props.value The default value of the component which will be parsed to integer.\n * @param {Function} props.onUpdate Call back when blurred and validated.\n */\nfunction UpdateOnBlurAsIntegerField( { as, value, onUpdate, ...props } ) {\n\tfunction handleBlur( event ) {\n\t\tconst { target } = event;\n\n\t\tif ( value === target.value ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst parsedValue = parseInt( target.value, 10 );\n\n\t\t// Run basic number validation on the input.\n\t\tif (\n\t\t\t! isInteger( parsedValue ) ||\n\t\t\t( typeof props.max !== 'undefined' && parsedValue > props.max ) ||\n\t\t\t( typeof props.min !== 'undefined' && parsedValue < props.min )\n\t\t) {\n\t\t\t// If validation failed, reset the value to the previous valid value.\n\t\t\ttarget.value = value;\n\t\t} else {\n\t\t\t// Otherwise, it's valid, call onUpdate.\n\t\t\tonUpdate( target.name, parsedValue );\n\t\t}\n\t}\n\n\treturn createElement( as || 'input', {\n\t\t// Re-mount the input value to accept the latest value as the defaultValue.\n\t\tkey: value,\n\t\tdefaultValue: value,\n\t\tonBlur: handleBlur,\n\t\t...props,\n\t} );\n}\n\n/**\n * <TimePicker>\n *\n * @typedef {Date|string|number} WPValidDateTimeFormat\n *\n * @param {Object} props Component props.\n * @param {boolean} props.is12Hour Should the time picker showed in 12 hour format or 24 hour format.\n * @param {WPValidDateTimeFormat} props.currentTime The initial current time the time picker should render.\n * @param {Function} props.onChange Callback function when the date changed.\n */\nexport function TimePicker( { is12Hour, currentTime, onChange } ) {\n\tconst [ date, setDate ] = useState( () =>\n\t\t// Truncate the date at the minutes, see: #15495.\n\t\tmoment( currentTime ).startOf( 'minutes' )\n\t);\n\n\t// Reset the state when currentTime changed.\n\tuseEffect( () => {\n\t\tsetDate(\n\t\t\tcurrentTime ? moment( currentTime ).startOf( 'minutes' ) : moment()\n\t\t);\n\t}, [ currentTime ] );\n\n\tconst { day, month, year, minutes, hours, am } = useMemo(\n\t\t() => ( {\n\t\t\tday: date.format( 'DD' ),\n\t\t\tmonth: date.format( 'MM' ),\n\t\t\tyear: date.format( 'YYYY' ),\n\t\t\tminutes: date.format( 'mm' ),\n\t\t\thours: date.format( is12Hour ? 'hh' : 'HH' ),\n\t\t\tam: date.format( 'H' ) <= 11 ? 'AM' : 'PM',\n\t\t} ),\n\t\t[ date, is12Hour ]\n\t);\n\n\t/**\n\t * Function that sets the date state and calls the onChange with a new date.\n\t * The date is truncated at the minutes.\n\t *\n\t * @param {Object} newDate The date object.\n\t */\n\tfunction changeDate( newDate ) {\n\t\tsetDate( newDate );\n\t\tonChange( newDate.format( TIMEZONELESS_FORMAT ) );\n\t}\n\n\tfunction update( name, value ) {\n\t\t// If the 12-hour format is being used and the 'PM' period is selected, then\n\t\t// the incoming value (which ranges 1-12) should be increased by 12 to match\n\t\t// the expected 24-hour format.\n\t\tlet adjustedValue = value;\n\t\tif ( name === 'hours' && is12Hour ) {\n\t\t\tadjustedValue = from12hTo24h( value, am === 'PM' );\n\t\t}\n\n\t\t// Clone the date and call the specific setter function according to `name`.\n\t\tconst newDate = date.clone()[ name ]( adjustedValue );\n\t\tchangeDate( newDate );\n\t}\n\n\tfunction updateAmPm( value ) {\n\t\treturn () => {\n\t\t\tif ( am === value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst parsedHours = parseInt( hours, 10 );\n\n\t\t\tconst newDate = date\n\t\t\t\t.clone()\n\t\t\t\t.hours( from12hTo24h( parsedHours, value === 'PM' ) );\n\n\t\t\tchangeDate( newDate );\n\t\t};\n\t}\n\n\tconst dayFormat = (\n\t\t<div className=\"components-datetime__time-field components-datetime__time-field-day\">\n\t\t\t<UpdateOnBlurAsIntegerField\n\t\t\t\taria-label={ __( 'Day' ) }\n\t\t\t\tclassName=\"components-datetime__time-field-day-input\"\n\t\t\t\ttype=\"number\"\n\t\t\t\t// The correct function to call in moment.js is \"date\" not \"day\".\n\t\t\t\tname=\"date\"\n\t\t\t\tvalue={ day }\n\t\t\t\tstep={ 1 }\n\t\t\t\tmin={ 1 }\n\t\t\t\tmax={ 31 }\n\t\t\t\tonUpdate={ update }\n\t\t\t/>\n\t\t</div>\n\t);\n\n\tconst monthFormat = (\n\t\t<div className=\"components-datetime__time-field components-datetime__time-field-month\">\n\t\t\t<UpdateOnBlurAsIntegerField\n\t\t\t\tas=\"select\"\n\t\t\t\taria-label={ __( 'Month' ) }\n\t\t\t\tclassName=\"components-datetime__time-field-month-select\"\n\t\t\t\tname=\"month\"\n\t\t\t\tvalue={ month }\n\t\t\t\t// The value starts from 0, so we have to -1 when setting month.\n\t\t\t\tonUpdate={ ( key, value ) => update( key, value - 1 ) }\n\t\t\t>\n\t\t\t\t<option value=\"01\">{ __( 'January' ) }</option>\n\t\t\t\t<option value=\"02\">{ __( 'February' ) }</option>\n\t\t\t\t<option value=\"03\">{ __( 'March' ) }</option>\n\t\t\t\t<option value=\"04\">{ __( 'April' ) }</option>\n\t\t\t\t<option value=\"05\">{ __( 'May' ) }</option>\n\t\t\t\t<option value=\"06\">{ __( 'June' ) }</option>\n\t\t\t\t<option value=\"07\">{ __( 'July' ) }</option>\n\t\t\t\t<option value=\"08\">{ __( 'August' ) }</option>\n\t\t\t\t<option value=\"09\">{ __( 'September' ) }</option>\n\t\t\t\t<option value=\"10\">{ __( 'October' ) }</option>\n\t\t\t\t<option value=\"11\">{ __( 'November' ) }</option>\n\t\t\t\t<option value=\"12\">{ __( 'December' ) }</option>\n\t\t\t</UpdateOnBlurAsIntegerField>\n\t\t</div>\n\t);\n\n\tconst dayMonthFormat = is12Hour ? (\n\t\t<>\n\t\t\t{ monthFormat }\n\t\t\t{ dayFormat }\n\t\t</>\n\t) : (\n\t\t<>\n\t\t\t{ dayFormat }\n\t\t\t{ monthFormat }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div className={ classnames( 'components-datetime__time' ) }>\n\t\t\t<fieldset>\n\t\t\t\t<legend className=\"components-datetime__time-legend invisible\">\n\t\t\t\t\t{ __( 'Date' ) }\n\t\t\t\t</legend>\n\t\t\t\t<div className=\"components-datetime__time-wrapper\">\n\t\t\t\t\t{ dayMonthFormat }\n\n\t\t\t\t\t<div className=\"components-datetime__time-field components-datetime__time-field-year\">\n\t\t\t\t\t\t<UpdateOnBlurAsIntegerField\n\t\t\t\t\t\t\taria-label={ __( 'Year' ) }\n\t\t\t\t\t\t\tclassName=\"components-datetime__time-field-year-input\"\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tname=\"year\"\n\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={ 9999 }\n\t\t\t\t\t\t\tvalue={ year }\n\t\t\t\t\t\t\tonUpdate={ update }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\n\t\t\t<fieldset>\n\t\t\t\t<legend className=\"components-datetime__time-legend invisible\">\n\t\t\t\t\t{ __( 'Time' ) }\n\t\t\t\t</legend>\n\t\t\t\t<div className=\"components-datetime__time-wrapper\">\n\t\t\t\t\t<div className=\"components-datetime__time-field components-datetime__time-field-time\">\n\t\t\t\t\t\t<UpdateOnBlurAsIntegerField\n\t\t\t\t\t\t\taria-label={ __( 'Hours' ) }\n\t\t\t\t\t\t\tclassName=\"components-datetime__time-field-hours-input\"\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tname=\"hours\"\n\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\tmin={ is12Hour ? 1 : 0 }\n\t\t\t\t\t\t\tmax={ is12Hour ? 12 : 23 }\n\t\t\t\t\t\t\tvalue={ hours }\n\t\t\t\t\t\t\tonUpdate={ update }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"components-datetime__time-separator\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t:\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<UpdateOnBlurAsIntegerField\n\t\t\t\t\t\t\taria-label={ __( 'Minutes' ) }\n\t\t\t\t\t\t\tclassName=\"components-datetime__time-field-minutes-input\"\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tname=\"minutes\"\n\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={ 59 }\n\t\t\t\t\t\t\tvalue={ minutes }\n\t\t\t\t\t\t\tonUpdate={ update }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t{ is12Hour && (\n\t\t\t\t\t\t<ButtonGroup className=\"components-datetime__time-field components-datetime__time-field-am-pm\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tam === 'AM' ? 'primary' : 'secondary'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonClick={ updateAmPm( 'AM' ) }\n\t\t\t\t\t\t\t\tclassName=\"components-datetime__time-am-button\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'AM' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tam === 'PM' ? 'primary' : 'secondary'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonClick={ updateAmPm( 'PM' ) }\n\t\t\t\t\t\t\t\tclassName=\"components-datetime__time-pm-button\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'PM' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</ButtonGroup>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<TimeZone />\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\t\t</div>\n\t);\n}\n\nexport default TimePicker;\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import moment from 'moment';
|
|
5
|
+
/**
|
|
6
|
+
* Create a Moment object from a date string. With no date supplied, default to a Moment
|
|
7
|
+
* object representing now. If a null value is passed, return a null value.
|
|
8
|
+
*
|
|
9
|
+
* @param {?string} date Date representing the currently selected date or null to signify no selection.
|
|
10
|
+
* @return {?moment.Moment} Moment object for selected date or null.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const getMomentDate = date => {
|
|
14
|
+
if (null === date) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return date ? moment(date) : moment();
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/date-time/utils.js"],"names":["moment","getMomentDate","date"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,QAAnB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,aAAa,GAAKC,IAAF,IAAY;AACxC,MAAK,SAASA,IAAd,EAAqB;AACpB,WAAO,IAAP;AACA;;AACD,SAAOA,IAAI,GAAGF,MAAM,CAAEE,IAAF,CAAT,GAAoBF,MAAM,EAArC;AACA,CALM","sourcesContent":["/**\n * External dependencies\n */\nimport moment from 'moment';\n\n/**\n * Create a Moment object from a date string. With no date supplied, default to a Moment\n * object representing now. If a null value is passed, return a null value.\n *\n * @param {?string} date Date representing the currently selected date or null to signify no selection.\n * @return {?moment.Moment} Moment object for selected date or null.\n */\nexport const getMomentDate = ( date ) => {\n\tif ( null === date ) {\n\t\treturn null;\n\t}\n\treturn date ? moment( date ) : moment();\n};\n"]}
|
|
@@ -5,7 +5,7 @@ import { createElement } from "@wordpress/element";
|
|
|
5
5
|
* External dependencies
|
|
6
6
|
*/
|
|
7
7
|
// eslint-disable-next-line no-restricted-imports
|
|
8
|
-
import { Separator } from 'reakit';
|
|
8
|
+
import { Separator } from 'reakit';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
@@ -27,17 +27,18 @@ function Divider(props, forwardedRef) {
|
|
|
27
27
|
* @example
|
|
28
28
|
* ```js
|
|
29
29
|
* import {
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
30
|
+
* __experimentalDivider as Divider,
|
|
31
|
+
* __experimentalText as Text,
|
|
32
|
+
* __experimentalVStack as VStack,
|
|
33
|
+
* } from `@wordpress/components`;
|
|
33
34
|
*
|
|
34
35
|
* function Example() {
|
|
35
36
|
* return (
|
|
36
|
-
* <
|
|
37
|
-
* <
|
|
37
|
+
* <VStack spacing={4}>
|
|
38
|
+
* <Text>Some text here</Text>
|
|
38
39
|
* <Divider />
|
|
39
|
-
* <
|
|
40
|
-
* </
|
|
40
|
+
* <Text>Some more text here</Text>
|
|
41
|
+
* </VStack>
|
|
41
42
|
* );
|
|
42
43
|
* }
|
|
43
44
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/divider/component.tsx"],"names":["Separator","contextConnect","useContextSystem","DividerView","Divider","props","forwardedRef","contextProps","ConnectedDivider"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,QAA1B
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/divider/component.tsx"],"names":["Separator","contextConnect","useContextSystem","DividerView","Divider","props","forwardedRef","contextProps","ConnectedDivider"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,QAA1B;;AAGA;AACA;AACA;AACA,SACCC,cADD,EAECC,gBAFD,QAIO,eAJP;AAKA,SAASC,WAAT,QAA4B,UAA5B;;AAGA,SAASC,OAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,YAAY,GAAGL,gBAAgB,CAAEG,KAAF,EAAS,SAAT,CAArC;AAEA,SACC,cAAC,SAAD;AACC,IAAA,EAAE,EAAGF;AADN,KAEMI,YAFN;AAGC,IAAA,GAAG,EAAGD;AAHP,KADD;AAOA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,gBAAgB,GAAGP,cAAc,CAAEG,OAAF,EAAW,SAAX,CAAvC;AAEA,eAAeI,gBAAf","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport { Separator } from 'reakit';\nimport type { Ref } from 'react';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../ui/context';\nimport { DividerView } from './styles';\nimport type { Props } from './types';\n\nfunction Divider(\n\tprops: WordPressComponentProps< Props, 'hr', false >,\n\tforwardedRef: Ref< any >\n) {\n\tconst contextProps = useContextSystem( props, 'Divider' );\n\n\treturn (\n\t\t<Separator\n\t\t\tas={ DividerView }\n\t\t\t{ ...contextProps }\n\t\t\tref={ forwardedRef }\n\t\t/>\n\t);\n}\n\n/**\n * `Divider` is a layout component that separates groups of related content.\n *\n * @example\n * ```js\n * import {\n * \t\t__experimentalDivider as Divider,\n * \t\t__experimentalText as Text,\n * \t\t__experimentalVStack as VStack,\n * } from `@wordpress/components`;\n *\n * function Example() {\n * \treturn (\n * \t\t<VStack spacing={4}>\n * \t\t\t<Text>Some text here</Text>\n * \t\t\t<Divider />\n * \t\t\t<Text>Some more text here</Text>\n * \t\t</VStack>\n * \t);\n * }\n * ```\n */\nconst ConnectedDivider = contextConnect( Divider, 'Divider' );\n\nexport default ConnectedDivider;\n"]}
|
|
@@ -9,26 +9,50 @@ import { css } from '@emotion/react';
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { space } from '../ui/utils/space';
|
|
12
|
-
import
|
|
12
|
+
import { rtl } from '../utils';
|
|
13
|
+
const MARGIN_DIRECTIONS = {
|
|
14
|
+
vertical: {
|
|
15
|
+
start: 'marginLeft',
|
|
16
|
+
end: 'marginRight'
|
|
17
|
+
},
|
|
18
|
+
horizontal: {
|
|
19
|
+
start: 'marginTop',
|
|
20
|
+
end: 'marginBottom'
|
|
21
|
+
}
|
|
22
|
+
}; // Renders the correct margins given the Divider's `orientation` and the writing direction.
|
|
23
|
+
// When both the generic `margin` and the specific `marginStart|marginEnd` props are defined,
|
|
24
|
+
// the latter will take priority.
|
|
13
25
|
|
|
14
26
|
const renderMargin = _ref => {
|
|
15
27
|
let {
|
|
28
|
+
'aria-orientation': orientation = 'horizontal',
|
|
16
29
|
margin,
|
|
17
|
-
|
|
18
|
-
|
|
30
|
+
marginStart,
|
|
31
|
+
marginEnd
|
|
19
32
|
} = _ref;
|
|
33
|
+
return /*#__PURE__*/css(rtl({
|
|
34
|
+
[MARGIN_DIRECTIONS[orientation].start]: space(marginStart !== null && marginStart !== void 0 ? marginStart : margin),
|
|
35
|
+
[MARGIN_DIRECTIONS[orientation].end]: space(marginEnd !== null && marginEnd !== void 0 ? marginEnd : margin)
|
|
36
|
+
})(), process.env.NODE_ENV === "production" ? "" : ";label:renderMargin;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZGl2aWRlci9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBb0NDIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZGl2aWRlci9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IHNwYWNlIH0gZnJvbSAnLi4vdWkvdXRpbHMvc3BhY2UnO1xuaW1wb3J0IHsgcnRsIH0gZnJvbSAnLi4vdXRpbHMnO1xuaW1wb3J0IHR5cGUgeyBQcm9wcyB9IGZyb20gJy4vdHlwZXMnO1xuXG5jb25zdCBNQVJHSU5fRElSRUNUSU9OUzogUmVjb3JkPFxuXHROb25OdWxsYWJsZTwgUHJvcHNbICdvcmllbnRhdGlvbicgXSA+LFxuXHRSZWNvcmQ8ICdzdGFydCcgf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b3JpZW50YXRpb24nOiBvcmllbnRhdGlvbiA9ICdob3Jpem9udGFsJyxcbn06IFByb3BzICkgPT4ge1xuXHRyZXR1cm4gY3NzKCB7XG5cdFx0WyBvcmllbnRhdGlvbiA9PT0gJ3ZlcnRpY2FsJ1xuXHRcdFx0PyAnYm9yZGVyUmlnaHQnXG5cdFx0XHQ6ICdib3JkZXJCb3R0b20nIF06ICcxcHggc29saWQgY3VycmVudENvbG9yJyxcblx0fSApO1xufTtcblxuY29uc3QgcmVuZGVyU2l6ZSA9ICgge1xuXHQnYXJpYS1vcmllbnRhdGlvbic6IG9yaWVudGF0aW9uID0gJ2hvcml6b250YWwnLFxufTogUHJvcHMgKSA9PlxuXHRjc3MoIHtcblx0XHRoZWlnaHQ6IG9yaWVudGF0aW9uID09PSAndmVydGljYWwnID8gJ2F1dG8nIDogMCxcblx0XHR3aWR0aDogb3JpZW50YXRpb24gPT09ICd2ZXJ0aWNhbCcgPyAwIDogJ2F1dG8nLFxuXHR9ICk7XG5cbmV4cG9ydCBjb25zdCBEaXZpZGVyVmlldyA9IHN0eWxlZC5ocjwgUHJvcHMgPmBcblx0Ym9yZGVyOiAwO1xuXHRtYXJnaW46IDA7XG5cblx0JHsgcmVuZGVyQm9yZGVyIH1cblx0JHsgcmVuZGVyU2l6ZSB9XG5cdCR7IHJlbmRlck1hcmdpbiB9XG5gO1xuIl19 */");
|
|
37
|
+
};
|
|
20
38
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
39
|
+
const renderBorder = _ref2 => {
|
|
40
|
+
let {
|
|
41
|
+
'aria-orientation': orientation = 'horizontal'
|
|
42
|
+
} = _ref2;
|
|
43
|
+
return /*#__PURE__*/css({
|
|
44
|
+
[orientation === 'vertical' ? 'borderRight' : 'borderBottom']: '1px solid currentColor'
|
|
45
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:renderBorder;", process.env.NODE_ENV === "production" ? "" : "/*# s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WVudGF0aW9uID0gJ2hvcml6b250YWwnLFxufTogUHJvcHMgKSA9PlxuXHRjc3MoIHtcblx0XHRoZWlnaHQ6IG9yaWVudGF0aW9uID09PSAndmVydGljYWwnID8gJ2F1dG8nIDogMCxcblx0XHR3aWR0aDogb3JpZW50YXRpb24gPT09ICd2ZXJ0aWNhbCcgPyAwIDogJ2F1dG8nLFxuXHR9ICk7XG5cbmV4cG9ydCBjb25zdCBEaXZpZGVyVmlldyA9IHN0eWxlZC5ocjwgUHJvcHMgPmBcblx0Ym9yZGVyOiAwO1xuXHRtYXJnaW46IDA7XG5cblx0JHsgcmVuZGVyQm9yZGVyIH1cblx0JHsgcmVuZGVyU2l6ZSB9XG5cdCR7IHJlbmRlck1hcmdpbiB9XG5gO1xuIl19 */");
|
|
46
|
+
};
|
|
27
47
|
|
|
48
|
+
const renderSize = _ref3 => {
|
|
49
|
+
let {
|
|
50
|
+
'aria-orientation': orientation = 'horizontal'
|
|
51
|
+
} = _ref3;
|
|
28
52
|
return /*#__PURE__*/css({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, process.env.NODE_ENV === "production" ? "" : ";label:
|
|
53
|
+
height: orientation === 'vertical' ? 'auto' : 0,
|
|
54
|
+
width: orientation === 'vertical' ? 0 : 'auto'
|
|
55
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:renderSize;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZGl2aWRlci9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBNERDIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZGl2aWRlci9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5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DA7XG5cblx0JHsgcmVuZGVyQm9yZGVyIH1cblx0JHsgcmVuZGVyU2l6ZSB9XG5cdCR7IHJlbmRlck1hcmdpbiB9XG5gO1xuIl19 */");
|
|
32
56
|
};
|
|
33
57
|
|
|
34
58
|
export const DividerView = _styled("hr", process.env.NODE_ENV === "production" ? {
|
|
@@ -36,5 +60,5 @@ export const DividerView = _styled("hr", process.env.NODE_ENV === "production" ?
|
|
|
36
60
|
} : {
|
|
37
61
|
target: "e19on6iw0",
|
|
38
62
|
label: "DividerView"
|
|
39
|
-
})("border
|
|
63
|
+
})("border:0;margin:0;", renderBorder, " ", renderSize, " ", renderMargin, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZGl2aWRlci9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBaUU2QyIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL2RpdmlkZXIvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG4vKipcbiAqIEludGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBzcGFjZSB9IGZyb20gJy4uL3VpL3V0aWxzL3NwYWNlJztcbmltcG9ydCB7IHJ0bCB9IGZyb20gJy4uL3V0aWxzJztcbmltcG9ydCB0eXBlIHsgUHJvcHMgfSBmcm9tICcuL3R5cGVzJztcblxuY29uc3QgTUFSR0lOX0RJUkVDVElPTlM6IFJlY29yZDxcblx0Tm9uTnVsbGFibGU8IFByb3BzWyAnb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Clcblx0KTtcblxuY29uc3QgcmVuZGVyQm9yZGVyID0gKCB7XG5cdCdhcmlhLW9yaWVudGF0aW9uJzogb3JpZW50YXRpb24gPSAnaG9yaXpvbnRhbCcsXG59OiBQcm9wcyApID0+IHtcblx0cmV0dXJuIGNzcygge1xuXHRcdFsgb3JpZW50YXRpb24gPT09ICd2ZXJ0aWNhbCdcblx0XHRcdD8gJ2JvcmRlclJpZ2h0J1xuXHRcdFx0OiAnYm9yZGVyQm90dG9tJyBdOiAnMXB4IHNvbGlkIGN1cnJlbnRDb2xvcicsXG5cdH0gKTtcbn07XG5cbmNvbnN0IHJlbmRlclNpemUgPSAoIHtcblx0J2FyaWEtb3JpZW50YXRpb24nOiBvcmllbnRhdGlvbiA9ICdob3Jpem9udGFsJyxcbn06IFByb3BzICkgPT5cblx0Y3NzKCB7XG5cdFx0aGVpZ2h0OiBvcmllbnRhdGlvbiA9PT0gJ3ZlcnRpY2FsJyA/ICdhdXRvJyA6IDAsXG5cdFx0d2lkdGg6IG9yaWVudGF0aW9uID09PSAndmVydGljYWwnID8gMCA6ICdhdXRvJyxcblx0fSApO1xuXG5leHBvcnQgY29uc3QgRGl2aWRlclZpZXcgPSBzdHlsZWQuaHI8IFByb3BzID5gXG5cdGJvcmRlcjogMDtcblx0bWFyZ2luOiAwO1xuXG5cdCR7IHJlbmRlckJvcmRlciB9XG5cdCR7IHJlbmRlclNpemUgfVxuXHQkeyByZW5kZXJNYXJnaW4gfVxuYDtcbiJdfQ== */"));
|
|
40
64
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/divider/styles.ts"],"names":["css","space","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/divider/styles.ts"],"names":["css","space","rtl","MARGIN_DIRECTIONS","vertical","start","end","horizontal","renderMargin","orientation","margin","marginStart","marginEnd","renderBorder","renderSize","height","width","DividerView"],"mappings":";;AAAA;AACA;AACA;AAEA,SAASA,GA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K,EAAEP,WAAW,KAAK,UAAhB,GAA6B,CAA7B,GAAiC;AAFpC,GAAF,gqFAHe;AAAA,CAAnB;;AAQA,OAAO,MAAMQ,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA,yBAIpBJ,YAJoB,OAKpBC,UALoB,OAMpBN,YANoB,ymFAAjB","sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { space } from '../ui/utils/space';\nimport { rtl } from '../utils';\nimport type { Props } from './types';\n\nconst MARGIN_DIRECTIONS: Record<\n\tNonNullable< Props[ 'orientation' ] >,\n\tRecord< 'start' | 'end', string >\n> = {\n\tvertical: {\n\t\tstart: 'marginLeft',\n\t\tend: 'marginRight',\n\t},\n\thorizontal: {\n\t\tstart: 'marginTop',\n\t\tend: 'marginBottom',\n\t},\n};\n\n// Renders the correct margins given the Divider's `orientation` and the writing direction.\n// When both the generic `margin` and the specific `marginStart|marginEnd` props are defined,\n// the latter will take priority.\nconst renderMargin = ( {\n\t'aria-orientation': orientation = 'horizontal',\n\tmargin,\n\tmarginStart,\n\tmarginEnd,\n}: Props ) =>\n\tcss(\n\t\trtl( {\n\t\t\t[ MARGIN_DIRECTIONS[ orientation ].start ]: space(\n\t\t\t\tmarginStart ?? margin\n\t\t\t),\n\t\t\t[ MARGIN_DIRECTIONS[ orientation ].end ]: space(\n\t\t\t\tmarginEnd ?? margin\n\t\t\t),\n\t\t} )()\n\t);\n\nconst renderBorder = ( {\n\t'aria-orientation': orientation = 'horizontal',\n}: Props ) => {\n\treturn css( {\n\t\t[ orientation === 'vertical'\n\t\t\t? 'borderRight'\n\t\t\t: 'borderBottom' ]: '1px solid currentColor',\n\t} );\n};\n\nconst renderSize = ( {\n\t'aria-orientation': orientation = 'horizontal',\n}: Props ) =>\n\tcss( {\n\t\theight: orientation === 'vertical' ? 'auto' : 0,\n\t\twidth: orientation === 'vertical' ? 0 : 'auto',\n\t} );\n\nexport const DividerView = styled.hr< Props >`\n\tborder: 0;\n\tmargin: 0;\n\n\t${ renderBorder }\n\t${ renderSize }\n\t${ renderMargin }\n`;\n"]}
|
|
@@ -34,11 +34,15 @@ export default function DropZoneComponent(_ref) {
|
|
|
34
34
|
onDrop(event) {
|
|
35
35
|
const files = getFilesFromDataTransfer(event.dataTransfer);
|
|
36
36
|
const html = event.dataTransfer.getData('text/html');
|
|
37
|
+
/**
|
|
38
|
+
* From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.
|
|
39
|
+
* The order of the checks is important to recognise the HTML drop.
|
|
40
|
+
*/
|
|
37
41
|
|
|
38
|
-
if (
|
|
39
|
-
onFilesDrop(files);
|
|
40
|
-
} else if (html && onHTMLDrop) {
|
|
42
|
+
if (html && onHTMLDrop) {
|
|
41
43
|
onHTMLDrop(html);
|
|
44
|
+
} else if (files.length && onFilesDrop) {
|
|
45
|
+
onFilesDrop(files);
|
|
42
46
|
} else if (onDrop) {
|
|
43
47
|
onDrop(event);
|
|
44
48
|
}
|
|
@@ -47,13 +51,17 @@ export default function DropZoneComponent(_ref) {
|
|
|
47
51
|
onDragStart(event) {
|
|
48
52
|
setIsDraggingOverDocument(true);
|
|
49
53
|
let _type = 'default';
|
|
54
|
+
/**
|
|
55
|
+
* From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.
|
|
56
|
+
* The order of the checks is important to recognise the HTML drop.
|
|
57
|
+
*/
|
|
50
58
|
|
|
51
|
-
if (
|
|
59
|
+
if (includes(event.dataTransfer.types, 'text/html')) {
|
|
60
|
+
_type = 'html';
|
|
61
|
+
} else if ( // Check for the types because sometimes the files themselves
|
|
52
62
|
// are only available on drop.
|
|
53
63
|
includes(event.dataTransfer.types, 'Files') || getFilesFromDataTransfer(event.dataTransfer).length > 0) {
|
|
54
64
|
_type = 'file';
|
|
55
|
-
} else if (includes(event.dataTransfer.types, 'text/html')) {
|
|
56
|
-
_type = 'html';
|
|
57
65
|
}
|
|
58
66
|
|
|
59
67
|
setType(_type);
|