@wordpress/components 19.2.1-next.33ec3857e2.0 → 19.2.1
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 +6 -29
- package/build/angle-picker-control/index.js +0 -2
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/button/index.native.js +3 -13
- package/build/button/index.native.js.map +1 -1
- package/build/checkbox-control/index.js +1 -1
- package/build/checkbox-control/index.js.map +1 -1
- package/build/clipboard-button/index.js +2 -1
- package/build/clipboard-button/index.js.map +1 -1
- package/build/color-palette/index.js +1 -13
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/color-display.js +2 -4
- package/build/color-picker/color-display.js.map +1 -1
- package/build/color-picker/hex-input.js +1 -3
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/input-with-slider.js +1 -3
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/custom-gradient-picker/index.js +0 -1
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/date-time/date.js +86 -63
- package/build/date-time/date.js.map +1 -1
- package/build/divider/component.js +7 -8
- package/build/divider/component.js.map +1 -1
- package/build/divider/styles.js +13 -38
- package/build/divider/styles.js.map +1 -1
- package/build/drop-zone/index.js +6 -14
- package/build/drop-zone/index.js.map +1 -1
- package/build/drop-zone/provider.js +0 -1
- package/build/drop-zone/provider.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 +0 -1
- package/build/focusable-iframe/index.js.map +1 -1
- package/build/higher-order/with-focus-outside/index.js +0 -2
- package/build/higher-order/with-focus-outside/index.js.map +1 -1
- package/build/index.js +0 -8
- package/build/index.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +32 -44
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +3 -10
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js +2 -4
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +6 -7
- package/build/mobile/color-settings/palette.screen.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 +1 -3
- package/build/mobile/gridicons/index.native.js.map +1 -1
- package/build/mobile/link-picker/index.native.js +4 -45
- package/build/mobile/link-picker/index.native.js.map +1 -1
- package/build/mobile/link-settings/index.native.js +0 -10
- package/build/mobile/link-settings/index.native.js.map +1 -1
- package/build/modal/aria-helper.js +0 -2
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +8 -17
- package/build/modal/index.js.map +1 -1
- package/build/palette-edit/index.js +31 -27
- package/build/palette-edit/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +9 -33
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/style-provider/index.js +0 -2
- package/build/style-provider/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +2 -7
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +14 -25
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build/tools-panel/styles.js +10 -12
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +8 -6
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +8 -6
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +41 -23
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/z-stack/component.js.map +1 -1
- package/build/z-stack/styles.js +8 -10
- package/build/z-stack/styles.js.map +1 -1
- package/build-module/angle-picker-control/index.js +0 -2
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/button/index.native.js +3 -13
- package/build-module/button/index.native.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/clipboard-button/index.js +2 -1
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/color-palette/index.js +2 -14
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/color-display.js +2 -3
- package/build-module/color-picker/color-display.js.map +1 -1
- package/build-module/color-picker/hex-input.js +1 -2
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +1 -2
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +0 -1
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/date-time/date.js +87 -63
- package/build-module/date-time/date.js.map +1 -1
- package/build-module/divider/component.js +7 -8
- package/build-module/divider/component.js.map +1 -1
- package/build-module/divider/styles.js +13 -37
- package/build-module/divider/styles.js.map +1 -1
- package/build-module/drop-zone/index.js +6 -14
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/drop-zone/provider.js +0 -1
- package/build-module/drop-zone/provider.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 +0 -1
- package/build-module/focusable-iframe/index.js.map +1 -1
- package/build-module/higher-order/with-focus-outside/index.js +0 -1
- package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
- package/build-module/index.js +0 -1
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +32 -44
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +4 -10
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +2 -4
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +6 -7
- package/build-module/mobile/color-settings/palette.screen.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 +0 -1
- package/build-module/mobile/gridicons/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +8 -50
- package/build-module/mobile/link-picker/index.native.js.map +1 -1
- package/build-module/mobile/link-settings/index.native.js +0 -10
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/modal/aria-helper.js +0 -2
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +8 -15
- package/build-module/modal/index.js.map +1 -1
- package/build-module/palette-edit/index.js +30 -27
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +9 -33
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/style-provider/index.js +0 -1
- package/build-module/style-provider/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +3 -8
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +14 -25
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build-module/tools-panel/styles.js +11 -12
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +8 -5
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +8 -6
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +41 -23
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/z-stack/component.js.map +1 -1
- package/build-module/z-stack/styles.js +8 -13
- package/build-module/z-stack/styles.js.map +1 -1
- package/build-style/style-rtl.css +11 -23
- package/build-style/style.css +11 -23
- package/build-types/base-field/hook.d.ts +16 -16
- 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/divider/component.d.ts +7 -8
- 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/elevation/hook.d.ts +15 -15
- package/build-types/flex/flex/hook.d.ts +16 -16
- 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/flyout/flyout/hook.d.ts +17 -17
- package/build-types/flyout/styles.d.ts +9 -7
- package/build-types/flyout/styles.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +16 -16
- package/build-types/h-stack/hook.d.ts +16 -16
- package/build-types/heading/hook.d.ts +16 -16
- package/build-types/input-control/index.d.ts +1 -1
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +2 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +1 -2
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +16 -16
- package/build-types/item-group/item-group/hook.d.ts +16 -16
- package/build-types/number-control/styles/number-control-styles.d.ts +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/spacer/hook.d.ts +16 -16
- package/build-types/surface/hook.d.ts +16 -16
- package/build-types/text/hook.d.ts +16 -16
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
- package/build-types/tools-panel/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 +16 -16
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +16 -16
- 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/truncate/hook.d.ts +16 -16
- package/build-types/ui/control-group/hook.d.ts +18 -18
- 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/use-form-group.d.ts +55 -55
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +0 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +2 -2
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +16 -16
- package/build-types/z-stack/component.d.ts +1 -1
- package/build-types/z-stack/styles.d.ts.map +1 -1
- package/package.json +23 -21
- package/src/alignment-matrix-control/stories/index.js +1 -1
- package/src/angle-picker-control/index.js +0 -2
- package/src/base-control/stories/index.js +1 -1
- package/src/button/index.native.js +1 -15
- package/src/button/stories/index.js +1 -1
- package/src/button/style.scss +0 -14
- package/src/card/card/README.md +3 -3
- package/src/card/stories/index.js +1 -1
- package/src/card/test/__snapshots__/index.js.snap +6 -6
- package/src/checkbox-control/index.js +1 -1
- package/src/checkbox-control/stories/index.js +1 -1
- package/src/clipboard-button/index.js +2 -1
- package/src/color-indicator/stories/index.js +1 -1
- package/src/color-indicator/style.scss +8 -5
- package/src/color-palette/index.js +5 -13
- package/src/color-palette/stories/index.js +1 -1
- package/src/color-palette/test/__snapshots__/index.js.snap +0 -1
- package/src/color-picker/color-display.tsx +2 -3
- package/src/color-picker/hex-input.tsx +1 -2
- package/src/color-picker/input-with-slider.tsx +1 -2
- package/src/color-picker/stories/index.js +1 -1
- package/src/combobox-control/README.md +2 -2
- package/src/custom-gradient-picker/index.js +0 -1
- package/src/custom-gradient-picker/style.scss +4 -0
- package/src/date-time/README.md +0 -7
- package/src/date-time/date.js +84 -67
- 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 +29 -3
- package/src/dimension-control/README.md +1 -1
- package/src/divider/README.md +5 -33
- package/src/divider/component.tsx +7 -8
- package/src/divider/stories/index.js +17 -43
- package/src/divider/styles.ts +16 -53
- 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 +6 -14
- package/src/drop-zone/provider.js +0 -1
- package/src/dropdown-menu/stories/index.js +1 -1
- package/src/duotone-picker/README.md +1 -1
- package/src/elevation/stories/index.js +1 -1
- package/src/external-link/stories/index.js +1 -1
- package/src/flyout/styles.ts +2 -4
- package/src/focusable-iframe/index.js +0 -1
- package/src/font-size-picker/stories/index.js +1 -1
- package/src/form-token-field/stories/index.js +1 -1
- package/src/gradient-picker/stories/index.js +1 -1
- package/src/grid/stories/index.js +1 -1
- package/src/guide/stories/index.js +1 -1
- package/src/higher-order/with-focus-outside/index.js +0 -2
- package/src/icon/stories/index.js +1 -1
- package/src/index.js +0 -1
- package/src/input-control/stories/index.js +1 -2
- package/src/input-control/styles/input-control-styles.tsx +6 -16
- package/src/input-control/types.ts +1 -3
- package/src/item-group/stories/index.js +2 -84
- package/src/menu-item/README.md +2 -2
- package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +2 -6
- package/src/mobile/color-settings/index.native.js +0 -2
- package/src/mobile/color-settings/palette.screen.native.js +5 -8
- package/src/mobile/color-settings/style.native.scss +1 -1
- package/src/mobile/global-styles-context/utils.native.js +1 -1
- package/src/mobile/gridicons/index.native.js +3 -3
- package/src/mobile/inserter-button/style.native.scss +0 -1
- package/src/mobile/link-picker/index.native.js +7 -41
- package/src/mobile/link-settings/index.native.js +0 -11
- package/src/modal/README.md +0 -10
- package/src/modal/aria-helper.js +0 -2
- package/src/modal/index.js +55 -72
- package/src/modal/stories/index.js +1 -6
- package/src/modal/style.scss +0 -9
- package/src/modal/test/index.js +0 -11
- package/src/navigation/README.md +9 -0
- package/src/notice/stories/index.js +1 -1
- package/src/number-control/stories/index.js +1 -1
- package/src/palette-edit/index.js +106 -73
- package/src/panel/stories/index.js +1 -1
- package/src/placeholder/stories/index.js +1 -1
- package/src/popover/stories/index.js +1 -1
- package/src/query-controls/README.md +6 -138
- package/src/radio-group/README.md +1 -4
- package/src/range-control/stories/index.js +1 -1
- package/src/resizable-box/stories/index.js +1 -1
- package/src/scrollable/stories/index.js +1 -1
- package/src/search-control/stories/index.js +1 -1
- package/src/select-control/stories/index.js +1 -2
- package/src/select-control/styles/select-control-styles.ts +2 -25
- package/src/select-control/types.ts +1 -1
- package/src/slot-fill/stories/index.js +1 -1
- package/src/snackbar/stories/index.js +1 -1
- package/src/spacer/stories/index.js +1 -1
- package/src/style-provider/index.js +0 -2
- package/src/surface/stories/index.js +1 -1
- package/src/tab-panel/stories/index.js +1 -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/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/toggle-group-control/component.tsx +2 -7
- package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +9 -24
- package/src/toolbar-button/stories/index.js +1 -1
- package/src/tools-panel/stories/index.js +0 -54
- package/src/tools-panel/styles.ts +1 -41
- package/src/tools-panel/test/index.js +137 -19
- package/src/tools-panel/tools-panel/README.md +3 -11
- package/src/tools-panel/tools-panel/component.tsx +5 -2
- package/src/tools-panel/tools-panel-item/hook.ts +14 -6
- package/src/tooltip/stories/index.js +1 -1
- package/src/tree-select/stories/index.js +1 -1
- package/src/truncate/stories/index.js +1 -1
- package/src/unit-control/stories/index.js +1 -19
- package/src/unit-control/styles/unit-control-styles.ts +46 -33
- package/src/unit-control/types.ts +2 -5
- package/src/z-stack/README.md +1 -1
- package/src/z-stack/component.tsx +1 -1
- package/src/z-stack/stories/index.js +1 -1
- package/src/z-stack/styles.ts +2 -7
- package/tsconfig.json +2 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/build/confirm-dialog/component.js +0 -103
- package/build/confirm-dialog/component.js.map +0 -1
- package/build/confirm-dialog/index.js +0 -16
- package/build/confirm-dialog/index.js.map +0 -1
- package/build/confirm-dialog/types.js +0 -6
- package/build/confirm-dialog/types.js.map +0 -1
- package/build/date-time/utils.js +0 -32
- package/build/date-time/utils.js.map +0 -1
- package/build-module/confirm-dialog/component.js +0 -84
- package/build-module/confirm-dialog/component.js.map +0 -1
- package/build-module/confirm-dialog/index.js +0 -6
- package/build-module/confirm-dialog/index.js.map +0 -1
- package/build-module/confirm-dialog/types.js +0 -2
- package/build-module/confirm-dialog/types.js.map +0 -1
- package/build-module/date-time/utils.js +0 -20
- package/build-module/date-time/utils.js.map +0 -1
- package/src/confirm-dialog/README.md +0 -128
- package/src/confirm-dialog/component.tsx +0 -114
- package/src/confirm-dialog/index.tsx +0 -6
- package/src/confirm-dialog/stories/index.js +0 -120
- package/src/confirm-dialog/test/index.js +0 -302
- package/src/confirm-dialog/types.ts +0 -26
- package/src/date-time/test/utils.js +0 -32
- package/src/date-time/utils.js +0 -18
- package/src/mobile/link-settings/test/edit.native.js +0 -432
package/build/date-time/date.js
CHANGED
|
@@ -17,8 +17,6 @@ var _DayPickerSingleDateController = _interopRequireDefault(require("react-dates
|
|
|
17
17
|
|
|
18
18
|
var _i18n = require("@wordpress/i18n");
|
|
19
19
|
|
|
20
|
-
var _utils = require("./utils");
|
|
21
|
-
|
|
22
20
|
/**
|
|
23
21
|
* External dependencies
|
|
24
22
|
*/
|
|
@@ -29,10 +27,6 @@ var _utils = require("./utils");
|
|
|
29
27
|
* WordPress dependencies
|
|
30
28
|
*/
|
|
31
29
|
|
|
32
|
-
/**
|
|
33
|
-
* Internal dependencies
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
30
|
/**
|
|
37
31
|
* Module Constants
|
|
38
32
|
*/
|
|
@@ -83,20 +77,20 @@ function DatePickerDay(_ref) {
|
|
|
83
77
|
}, day.format('D'));
|
|
84
78
|
}
|
|
85
79
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
onMonthPreviewed === null ||
|
|
98
|
-
keepFocusInside();
|
|
99
|
-
}
|
|
80
|
+
class DatePicker extends _element.Component {
|
|
81
|
+
constructor() {
|
|
82
|
+
super(...arguments);
|
|
83
|
+
this.onChangeMoment = this.onChangeMoment.bind(this);
|
|
84
|
+
this.nodeRef = (0, _element.createRef)();
|
|
85
|
+
this.onMonthPreviewedHandler = this.onMonthPreviewedHandler.bind(this);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
onMonthPreviewedHandler(newMonthDate) {
|
|
89
|
+
var _this$props$onMonthPr, _this$props;
|
|
90
|
+
|
|
91
|
+
(_this$props$onMonthPr = (_this$props = this.props).onMonthPreviewed) === null || _this$props$onMonthPr === void 0 ? void 0 : _this$props$onMonthPr.call(_this$props, newMonthDate.toISOString());
|
|
92
|
+
this.keepFocusInside();
|
|
93
|
+
}
|
|
100
94
|
/*
|
|
101
95
|
* Todo: We should remove this function ASAP.
|
|
102
96
|
* It is kept because focus is lost when we click on the previous and next month buttons.
|
|
@@ -105,21 +99,21 @@ function DatePicker(_ref2) {
|
|
|
105
99
|
*/
|
|
106
100
|
|
|
107
101
|
|
|
108
|
-
|
|
109
|
-
if (!nodeRef.current) {
|
|
102
|
+
keepFocusInside() {
|
|
103
|
+
if (!this.nodeRef.current) {
|
|
110
104
|
return;
|
|
111
105
|
}
|
|
112
106
|
|
|
113
107
|
const {
|
|
114
108
|
ownerDocument
|
|
115
|
-
} = nodeRef.current;
|
|
109
|
+
} = this.nodeRef.current;
|
|
116
110
|
const {
|
|
117
111
|
activeElement
|
|
118
112
|
} = ownerDocument; // If focus was lost.
|
|
119
113
|
|
|
120
|
-
if (!activeElement || !nodeRef.current.contains(ownerDocument.activeElement)) {
|
|
114
|
+
if (!activeElement || !this.nodeRef.current.contains(ownerDocument.activeElement)) {
|
|
121
115
|
// Retrieve the focus region div.
|
|
122
|
-
const focusRegion = nodeRef.current.querySelector('.DayPicker_focusRegion');
|
|
116
|
+
const focusRegion = this.nodeRef.current.querySelector('.DayPicker_focusRegion');
|
|
123
117
|
|
|
124
118
|
if (!focusRegion) {
|
|
125
119
|
return;
|
|
@@ -128,10 +122,14 @@ function DatePicker(_ref2) {
|
|
|
128
122
|
|
|
129
123
|
focusRegion.focus();
|
|
130
124
|
}
|
|
131
|
-
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
onChangeMoment(newDate) {
|
|
128
|
+
const {
|
|
129
|
+
currentDate,
|
|
130
|
+
onChange
|
|
131
|
+
} = this.props; // If currentDate is null, use now as momentTime to designate hours, minutes, seconds.
|
|
132
132
|
|
|
133
|
-
const onChangeMoment = newDate => {
|
|
134
|
-
// If currentDate is null, use now as momentTime to designate hours, minutes, seconds.
|
|
135
133
|
const momentDate = currentDate ? (0, _moment.default)(currentDate) : (0, _moment.default)();
|
|
136
134
|
const momentTime = {
|
|
137
135
|
hours: momentDate.hours(),
|
|
@@ -140,46 +138,71 @@ function DatePicker(_ref2) {
|
|
|
140
138
|
};
|
|
141
139
|
onChange(newDate.set(momentTime).format(TIMEZONELESS_FORMAT)); // Keep focus on the date picker.
|
|
142
140
|
|
|
143
|
-
keepFocusInside();
|
|
144
|
-
}
|
|
141
|
+
this.keepFocusInside();
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Create a Moment object from a date string. With no currentDate supplied, default to a Moment
|
|
145
|
+
* object representing now. If a null value is passed, return a null value.
|
|
146
|
+
*
|
|
147
|
+
* @param {?string} currentDate Date representing the currently selected date or null to signify no selection.
|
|
148
|
+
* @return {?moment.Moment} Moment object for selected date or null.
|
|
149
|
+
*/
|
|
145
150
|
|
|
146
|
-
|
|
147
|
-
|
|
151
|
+
|
|
152
|
+
getMomentDate(currentDate) {
|
|
153
|
+
if (null === currentDate) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return currentDate ? (0, _moment.default)(currentDate) : (0, _moment.default)();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
getEventsPerDay(day) {
|
|
161
|
+
var _this$props$events;
|
|
162
|
+
|
|
163
|
+
if (!((_this$props$events = this.props.events) !== null && _this$props$events !== void 0 && _this$props$events.length)) {
|
|
148
164
|
return [];
|
|
149
165
|
}
|
|
150
166
|
|
|
151
|
-
return events.filter(eventDay => day.isSame(eventDay.date, 'day'));
|
|
152
|
-
}
|
|
167
|
+
return this.props.events.filter(eventDay => day.isSame(eventDay.date, 'day'));
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
render() {
|
|
171
|
+
const {
|
|
172
|
+
currentDate,
|
|
173
|
+
isInvalidDate
|
|
174
|
+
} = this.props;
|
|
175
|
+
const momentDate = this.getMomentDate(currentDate);
|
|
176
|
+
return (0, _element.createElement)("div", {
|
|
177
|
+
className: "components-datetime__date",
|
|
178
|
+
ref: this.nodeRef
|
|
179
|
+
}, (0, _element.createElement)(_DayPickerSingleDateController.default, {
|
|
180
|
+
date: momentDate,
|
|
181
|
+
daySize: 30,
|
|
182
|
+
focused: true,
|
|
183
|
+
hideKeyboardShortcutsPanel: true // This is a hack to force the calendar to update on month or year change
|
|
184
|
+
// https://github.com/airbnb/react-dates/issues/240#issuecomment-361776665
|
|
185
|
+
,
|
|
186
|
+
key: `datepicker-controller-${momentDate ? momentDate.format('MM-YYYY') : 'null'}`,
|
|
187
|
+
noBorder: true,
|
|
188
|
+
numberOfMonths: 1,
|
|
189
|
+
onDateChange: this.onChangeMoment,
|
|
190
|
+
transitionDuration: 0,
|
|
191
|
+
weekDayFormat: "ddd",
|
|
192
|
+
dayAriaLabelFormat: ARIAL_LABEL_TIME_FORMAT,
|
|
193
|
+
isRTL: (0, _i18n.isRTL)(),
|
|
194
|
+
isOutsideRange: date => {
|
|
195
|
+
return isInvalidDate && isInvalidDate(date.toDate());
|
|
196
|
+
},
|
|
197
|
+
onPrevMonthClick: this.onMonthPreviewedHandler,
|
|
198
|
+
onNextMonthClick: this.onMonthPreviewedHandler,
|
|
199
|
+
renderDayContents: day => (0, _element.createElement)(DatePickerDay, {
|
|
200
|
+
day: day,
|
|
201
|
+
events: this.getEventsPerDay(day)
|
|
202
|
+
})
|
|
203
|
+
}));
|
|
204
|
+
}
|
|
153
205
|
|
|
154
|
-
const momentDate = (0, _utils.getMomentDate)(currentDate);
|
|
155
|
-
return (0, _element.createElement)("div", {
|
|
156
|
-
className: "components-datetime__date",
|
|
157
|
-
ref: nodeRef
|
|
158
|
-
}, (0, _element.createElement)(_DayPickerSingleDateController.default, {
|
|
159
|
-
date: momentDate,
|
|
160
|
-
daySize: 30,
|
|
161
|
-
focused: true,
|
|
162
|
-
hideKeyboardShortcutsPanel: true // This is a hack to force the calendar to update on month or year change
|
|
163
|
-
// https://github.com/airbnb/react-dates/issues/240#issuecomment-361776665
|
|
164
|
-
,
|
|
165
|
-
key: `datepicker-controller-${momentDate ? momentDate.format('MM-YYYY') : 'null'}`,
|
|
166
|
-
noBorder: true,
|
|
167
|
-
numberOfMonths: 1,
|
|
168
|
-
onDateChange: onChangeMoment,
|
|
169
|
-
transitionDuration: 0,
|
|
170
|
-
weekDayFormat: "ddd",
|
|
171
|
-
dayAriaLabelFormat: ARIAL_LABEL_TIME_FORMAT,
|
|
172
|
-
isRTL: (0, _i18n.isRTL)(),
|
|
173
|
-
isOutsideRange: date => {
|
|
174
|
-
return isInvalidDate && isInvalidDate(date.toDate());
|
|
175
|
-
},
|
|
176
|
-
onPrevMonthClick: onMonthPreviewedHandler,
|
|
177
|
-
onNextMonthClick: onMonthPreviewedHandler,
|
|
178
|
-
renderDayContents: day => (0, _element.createElement)(DatePickerDay, {
|
|
179
|
-
day: day,
|
|
180
|
-
events: getEventsPerDay(day)
|
|
181
|
-
})
|
|
182
|
-
}));
|
|
183
206
|
}
|
|
184
207
|
|
|
185
208
|
var _default = DatePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/date-time/date.js"],"names":["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;;AAVA;;AACA;;AAIA;;AAMA;;AAKA;;AAnBA;AACA;AACA;AAIA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,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,GAAG,sBAAZ;AAEA;AACD;AACA;AACA;AACA;AACA;;AACC,0BAAW,MAAM;AAAA;;AAChB;AACA,QAAK,EAAEA,GAAF,aAAEA,GAAF,+BAAEA,GAAG,CAAEC,OAAP,yCAAE,aAAcC,U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;AAAK,IAAA,SAAS,EAAC,2BAAf;AAA2C,IAAA,GAAG,EAAGI;AAAjD,KACC,4BAAC,sCAAD;AACC,IAAA,IAAI,EAAGa,UADR;AAEC,IAAA,OAAO,EAAG,EAFX;AAGC,IAAA,OAAO,MAHR;AAIC,IAAA,0BAA0B,MAJ3B,CAKC;AACA;AAND;AAOC,IAAA,GAAG,EAAI,yBACNA,UAAU,GAAGA,UAAU,CAACtB,MAAX,CAAmB,SAAnB,CAAH,GAAoC,MAC9C,EATF;AAUC,IAAA,QAAQ,MAVT;AAWC,IAAA,cAAc,EAAG,CAXlB;AAYC,IAAA,YAAY,EAAGoB,cAZhB;AAaC,IAAA,kBAAkB,EAAG,CAbtB;AAcC,IAAA,aAAa,EAAC,KAdf;AAeC,IAAA,kBAAkB,EAAG5B,uBAftB;AAgBC,IAAA,KAAK,EAAG,kBAhBT;AAiBC,IAAA,cAAc,EAAKwC,IAAF,IAAY;AAC5B,aAAOzB,aAAa,IAAIA,aAAa,CAAEyB,IAAI,CAACC,MAAL,EAAF,CAArC;AACA,KAnBF;AAoBC,IAAA,gBAAgB,EAAGvB,uBApBpB;AAqBC,IAAA,gBAAgB,EAAGA,uBArBpB;AAsBC,IAAA,iBAAiB,EAAKhB,GAAF,IACnB,4BAAC,aAAD;AACC,MAAA,GAAG,EAAGA,GADP;AAEC,MAAA,MAAM,EAAGkC,eAAe,CAAElC,GAAF;AAFzB;AAvBF,IADD,CADD;AAiCA;;eAEcU,U","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"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/date-time/date.js"],"names":["TIMEZONELESS_FORMAT","ARIAL_LABEL_TIME_FORMAT","DatePickerDay","day","events","ref","current","parentNode","dayAriaLabel","format","length","setAttribute","dayWithEventsDescription","DatePicker","Component","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;;AAVA;;AACA;;AAIA;;AAMA;;AAdA;AACA;AACA;AAIA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA,MAAMA,mBAAmB,GAAG,qBAA5B;AACA,MAAMC,uBAAuB,G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AAcC,MAAA,aAAa,EAAC,KAdf;AAeC,MAAA,kBAAkB,EAAGhB,uBAftB;AAgBC,MAAA,KAAK,EAAG,kBAhBT;AAiBC,MAAA,cAAc,EAAK6C,IAAF,IAAY;AAC5B,eAAOE,aAAa,IAAIA,aAAa,CAAEF,IAAI,CAACG,MAAL,EAAF,CAArC;AACA,OAnBF;AAoBC,MAAA,gBAAgB,EAAG,KAAK7B,uBApBzB;AAqBC,MAAA,gBAAgB,EAAG,KAAKA,uBArBzB;AAsBC,MAAA,iBAAiB,EAAKjB,GAAF,IACnB,4BAAC,aAAD;AACC,QAAA,GAAG,EAAGA,GADP;AAEC,QAAA,MAAM,EAAG,KAAKuC,eAAL,CAAsBvC,GAAtB;AAFV;AAvBF,MADD,CADD;AAiCA;;AA7HiC;;eAgIpBU,U","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"]}
|
|
@@ -39,18 +39,17 @@ function Divider(props, forwardedRef) {
|
|
|
39
39
|
* @example
|
|
40
40
|
* ```js
|
|
41
41
|
* import {
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* } from `@wordpress/components`;
|
|
42
|
+
* __experimentalDivider as Divider,
|
|
43
|
+
* __experimentalText as Text }
|
|
44
|
+
* from `@wordpress/components`;
|
|
46
45
|
*
|
|
47
46
|
* function Example() {
|
|
48
47
|
* return (
|
|
49
|
-
* <
|
|
50
|
-
* <
|
|
48
|
+
* <ListGroup>
|
|
49
|
+
* <FormGroup>...</FormGroup>
|
|
51
50
|
* <Divider />
|
|
52
|
-
* <
|
|
53
|
-
* </
|
|
51
|
+
* <FormGroup>...</FormGroup>
|
|
52
|
+
* </ListGroup>
|
|
54
53
|
* );
|
|
55
54
|
* }
|
|
56
55
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/divider/component.tsx"],"names":["Divider","props","forwardedRef","contextProps","DividerView","ConnectedDivider"],"mappings":";;;;;;;;;;;;;AAIA;;AAOA;;AAKA;;AAhBA;AACA;AACA;AACA;;AAKA;AACA;AACA;AASA,SAASA,OAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,YAAY,GAAG,+BAAkBF,KAAlB,EAAyB,SAAzB,CAArB;AAEA,SACC,4BAAC,iBAAD;AACC,IAAA,EAAE,EAAGG;AADN,KAEMD,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
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/divider/component.tsx"],"names":["Divider","props","forwardedRef","contextProps","DividerView","ConnectedDivider"],"mappings":";;;;;;;;;;;;;AAIA;;AAOA;;AAKA;;AAhBA;AACA;AACA;AACA;;AAKA;AACA;AACA;AASA,SAASA,OAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,YAAY,GAAG,+BAAkBF,KAAlB,EAAyB,SAAzB,CAArB;AAEA,SACC,4BAAC,iBAAD;AACC,IAAA,EAAE,EAAGG;AADN,KAEMD,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,MAAMG,gBAAgB,GAAG,6BAAgBL,OAAhB,EAAyB,SAAzB,CAAzB;eAEeK,gB","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport { Separator } from 'reakit';\n// eslint-disable-next-line no-restricted-imports\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 * __experimentalDivider as Divider,\n * __experimentalText as Text }\n * from `@wordpress/components`;\n *\n * function Example() {\n * \treturn (\n * \t\t<ListGroup>\n * \t\t\t<FormGroup>...</FormGroup>\n * \t\t\t<Divider />\n * \t\t\t<FormGroup>...</FormGroup>\n * \t\t</ListGroup>\n * \t);\n * }\n * ```\n */\nconst ConnectedDivider = contextConnect( Divider, 'Divider' );\n\nexport default ConnectedDivider;\n"]}
|
package/build/divider/styles.js
CHANGED
|
@@ -13,7 +13,7 @@ var _react = require("@emotion/react");
|
|
|
13
13
|
|
|
14
14
|
var _space = require("../ui/utils/space");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _configValues = _interopRequireDefault(require("../utils/config-values"));
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* External dependencies
|
|
@@ -22,49 +22,24 @@ var _utils = require("../utils");
|
|
|
22
22
|
/**
|
|
23
23
|
* Internal dependencies
|
|
24
24
|
*/
|
|
25
|
-
const MARGIN_DIRECTIONS = {
|
|
26
|
-
vertical: {
|
|
27
|
-
start: 'marginLeft',
|
|
28
|
-
end: 'marginRight'
|
|
29
|
-
},
|
|
30
|
-
horizontal: {
|
|
31
|
-
start: 'marginTop',
|
|
32
|
-
end: 'marginBottom'
|
|
33
|
-
}
|
|
34
|
-
}; // Renders the correct margins given the Divider's `orientation` and the writing direction.
|
|
35
|
-
// When both the generic `margin` and the specific `marginStart|marginEnd` props are defined,
|
|
36
|
-
// the latter will take priority.
|
|
37
|
-
|
|
38
25
|
const renderMargin = _ref => {
|
|
39
26
|
let {
|
|
40
|
-
'aria-orientation': orientation = 'horizontal',
|
|
41
27
|
margin,
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
marginTop,
|
|
29
|
+
marginBottom
|
|
44
30
|
} = _ref;
|
|
45
|
-
return /*#__PURE__*/(0, _react.css)((0, _utils.rtl)({
|
|
46
|
-
[MARGIN_DIRECTIONS[orientation].start]: (0, _space.space)(marginStart !== null && marginStart !== void 0 ? marginStart : margin),
|
|
47
|
-
[MARGIN_DIRECTIONS[orientation].end]: (0, _space.space)(marginEnd !== null && marginEnd !== void 0 ? marginEnd : margin)
|
|
48
|
-
})(), process.env.NODE_ENV === "production" ? "" : ";label:renderMargin;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZGl2aWRlci9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBb0NDIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZGl2aWRlci9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IHNwYWNlIH0gZnJvbSAnLi4vdWkvdXRpbHMvc3BhY2UnO1xuaW1wb3J0IHsgcnR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? "" : ";label:renderBorder;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZGl2aWRlci9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBa0RRIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZGl2aWRlci9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IHNwYWNlIH0gZnJvbSAnLi4vdWkvdXRpbHMvc3BhY2UnO1xuaW1wb3J0IHsgcnRsIH0gZnJvbSAnLi4vdXRpbHMnO1xuaW1wb3J0IHR5cGUgeyBQcm9wcyB9IGZyb20gJy4vdHlwZXMnO1xuXG5jb25zdCBNQVJHSU5fRElSRUNUSU9OUzogUmVjb3JkPFxuXHROb25OdWxsYWJsZTwgUHJvcHNbICdvcmllbnRhdGlvbicgXSA+LFxuXHRSZWNvcmQ8ICdzdGFydCcgfCAnZW5kJywgc3RyaW5nID5cbj4gPSB7XG5cdHZlcnRpY2FsOiB7XG5cdFx0c3RhcnQ6ICdtYXJnaW5MZWZ0Jyxcblx0XHRlbmQ6ICdtYXJnaW5SaWdodCcsXG5cdH0sXG5cdGhvcml6b250YWw6IHtcblx0XHRzdGFydDogJ21hcmdpblRvcCcsXG5cdFx0ZW5kOiAnbWFyZ2luQm90dG9tJyxcblx0fSxcbn07XG5cbi8vIFJlbmRlcnMgdGhlIGNvcnJlY3QgbWFyZ2lucyBnaX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A9ICgge1xuXHQnYXJpYS1vcmllbnRhdGlvbic6IG9yaWVudGF0aW9uID0gJ2hvcml6b250YWwnLFxufTogUHJvcHMgKSA9PlxuXHRjc3MoIHtcblx0XHRoZWlnaHQ6IG9yaWVudGF0aW9uID09PSAndmVydGljYWwnID8gJ2F1dG8nIDogMCxcblx0XHR3aWR0aDogb3JpZW50YXRpb24gPT09ICd2ZXJ0aWNhbCcgPyAwIDogJ2F1dG8nLFxuXHR9ICk7XG5cbmV4cG9ydCBjb25zdCBEaXZpZGVyVmlldyA9IHN0eWxlZC5ocjwgUHJvcHMgPmBcblx0Ym9yZGVyOiAwO1xuXHRtYXJnaW46IDA7XG5cblx0JHsgcmVuZGVyQm9yZGVyIH1cblx0JHsgcmVuZGVyU2l6ZSB9XG5cdCR7IHJlbmRlck1hcmdpbiB9XG5gO1xuIl19 */");
|
|
58
|
-
};
|
|
32
|
+
if (typeof margin !== 'undefined') {
|
|
33
|
+
return /*#__PURE__*/(0, _react.css)({
|
|
34
|
+
marginBottom: (0, _space.space)(margin),
|
|
35
|
+
marginTop: (0, _space.space)(margin)
|
|
36
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:renderMargin;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZGl2aWRlci9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZVMiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9kaXZpZGVyL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLyoqXG4gKiBJbnRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgc3BhY2UgfSBmcm9tICcuLi91aS91dGlscy9zcGFjZSc7XG5pbXBvcnQgQ09ORklHIGZyb20gJy4uL3V0aWxzL2NvbmZpZy12YWx1ZXMnO1xuaW1wb3J0IHR5cGUgeyBPd25Qcm9wcyB9IGZyb20gJy4vdHlwZXMnO1xuXG5jb25zdCByZW5kZXJNYXJnaW4gPSAoIHsgbWFyZ2luLCBtYXJnaW5Ub3AsIG1hcmdpbkJvdHRvbSB9OiBPd25Qcm9wcyApID0+IHtcblx0aWYgKCB0eXBlb2YgbWFyZ2luICE9PSAndW5kZWZpbmVkJyApIHtcblx0XHRyZXR1cm4gY3NzKCB7XG5cdFx0XHRtYXJnaW5Cb3R0b206IHNwYWNlKCBtYXJnaW4gKSxcblx0XHRcdG1hcmdpblRvcDogc3BhY2UoIG1hcmdpbiApLFxuXHRcdH0gKTtcblx0fVxuXG5cdHJldHVybiBjc3MoIHtcblx0XHRtYXJnaW5Ub3A6IHNwYWNlKCBtYXJnaW5Ub3AgKSxcblx0XHRtYXJnaW5Cb3R0b206IHNwYWNlKCBtYXJnaW5Cb3R0b20gKSxcblx0fSApO1xufTtcblxuZXhwb3J0IGNvbnN0IERpdmlkZXJWaWV3ID0gc3R5bGVkLmhyPCBPd25Qcm9wcyA+YFxuXHRib3JkZXItY29sb3I6ICR7IENPTkZJRy5jb2xvckRpdmlkZXIgfTtcblx0Ym9yZGVyLXdpZHRoOiAwIDAgMXB4IDA7XG5cdGhlaWdodDogMDtcblx0bWFyZ2luOiAwO1xuXHR3aWR0aDogYXV0bztcblxuXHQkeyByZW5kZXJNYXJnaW4gfVxuYDtcbiJdfQ== */");
|
|
37
|
+
}
|
|
59
38
|
|
|
60
|
-
const renderSize = _ref3 => {
|
|
61
|
-
let {
|
|
62
|
-
'aria-orientation': orientation = 'horizontal'
|
|
63
|
-
} = _ref3;
|
|
64
39
|
return /*#__PURE__*/(0, _react.css)({
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}, process.env.NODE_ENV === "production" ? "" : ";label:
|
|
40
|
+
marginTop: (0, _space.space)(marginTop),
|
|
41
|
+
marginBottom: (0, _space.space)(marginBottom)
|
|
42
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:renderMargin;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZGl2aWRlci9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBcUJRIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZGl2aWRlci9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IHNwYWNlIH0gZnJvbSAnLi4vdWkvdXRpbHMvc3BhY2UnO1xuaW1wb3J0IENPTkZJRyBmcm9tICcuLi91dGlscy9jb25maWctdmFsdWVzJztcbmltcG9ydCB0eXBlIHsgT3duUHJvcHMgfSBmcm9tICcuL3R5cGVzJztcblxuY29uc3QgcmVuZGVyTWFyZ2luID0gKCB7IG1hcmdpbiwgbWFyZ2luVG9wLCBtYXJnaW5Cb3R0b20gfTogT3duUHJvcHMgKSA9PiB7XG5cdGlmICggdHlwZW9mIG1hcmdpbiAhPT0gJ3VuZGVmaW5lZCcgKSB7XG5cdFx0cmV0dXJuIGNzcygge1xuXHRcdFx0bWFyZ2luQm90dG9tOiBzcGFjZSggbWFyZ2luICksXG5cdFx0XHRtYXJnaW5Ub3A6IHNwYWNlKCBtYXJnaW4gKSxcblx0XHR9ICk7XG5cdH1cblxuXHRyZXR1cm4gY3NzKCB7XG5cdFx0bWFyZ2luVG9wOiBzcGFjZSggbWFyZ2luVG9wICksXG5cdFx0bWFyZ2luQm90dG9tOiBzcGFjZSggbWFyZ2luQm90dG9tICksXG5cdH0gKTtcbn07XG5cbmV4cG9ydCBjb25zdCBEaXZpZGVyVmlldyA9IHN0eWxlZC5ocjwgT3duUHJvcHMgPmBcblx0Ym9yZGVyLWNvbG9yOiAkeyBDT05GSUcuY29sb3JEaXZpZGVyIH07XG5cdGJvcmRlci13aWR0aDogMCAwIDFweCAwO1xuXHRoZWlnaHQ6IDA7XG5cdG1hcmdpbjogMDtcblx0d2lkdGg6IGF1dG87XG5cblx0JHsgcmVuZGVyTWFyZ2luIH1cbmA7XG4iXX0= */");
|
|
68
43
|
};
|
|
69
44
|
|
|
70
45
|
const DividerView = (0, _base.default)("hr", process.env.NODE_ENV === "production" ? {
|
|
@@ -72,6 +47,6 @@ const DividerView = (0, _base.default)("hr", process.env.NODE_ENV === "productio
|
|
|
72
47
|
} : {
|
|
73
48
|
target: "e19on6iw0",
|
|
74
49
|
label: "DividerView"
|
|
75
|
-
})("border:
|
|
50
|
+
})("border-color:", _configValues.default.colorDivider, ";border-width:0 0 1px 0;height:0;margin:0;width:auto;", renderMargin, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZGl2aWRlci9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBMkJnRCIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL2RpdmlkZXIvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbC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erView = DividerView;
|
|
77
52
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/divider/styles.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/divider/styles.ts"],"names":["renderMargin","margin","marginTop","marginBottom","DividerView","CONFIG","colorDivider"],"mappings":";;;;;;;;;;;AAIA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAKA,MAAMA,YAAY,GAAG,QAAqD;AAAA,MAAnD;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,SAAV;AAAqBC,IAAAA;AAArB,GAAmD;;AACzE,MAAK,OAAOF,MAAP,KAAkB,WAAvB,EAAqC;AACpC,wBAAO,gBAAK;AACXE,MAAAA,YAAY,EAAE,kBAAOF,MAAP,CADH;AAEXC,MAAAA,SAAS,EAAE,kBAAOD,MAAP;AAFA,KAAL,s+CAAP;AAIA;;AAED,sBAAO,gBAAK;AACXC,IAAAA,SAAS,EAAE,kBAAOA,SAAP,CADA;AAEXC,IAAAA,YAAY,EAAE,kBAAOA,YAAP;AAFH,GAAL,s+CAAP;AAIA,CAZD;;AAcO,MAAMC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA,oBACNC,sBAAOC,YADD,2DAOpBN,YAPoB,y6CAAjB","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 CONFIG from '../utils/config-values';\nimport type { OwnProps } from './types';\n\nconst renderMargin = ( { margin, marginTop, marginBottom }: OwnProps ) => {\n\tif ( typeof margin !== 'undefined' ) {\n\t\treturn css( {\n\t\t\tmarginBottom: space( margin ),\n\t\t\tmarginTop: space( margin ),\n\t\t} );\n\t}\n\n\treturn css( {\n\t\tmarginTop: space( marginTop ),\n\t\tmarginBottom: space( marginBottom ),\n\t} );\n};\n\nexport const DividerView = styled.hr< OwnProps >`\n\tborder-color: ${ CONFIG.colorDivider };\n\tborder-width: 0 0 1px 0;\n\theight: 0;\n\tmargin: 0;\n\twidth: auto;\n\n\t${ renderMargin }\n`;\n"]}
|
package/build/drop-zone/index.js
CHANGED
|
@@ -49,15 +49,11 @@ function DropZoneComponent(_ref) {
|
|
|
49
49
|
onDrop(event) {
|
|
50
50
|
const files = (0, _dom.getFilesFromDataTransfer)(event.dataTransfer);
|
|
51
51
|
const html = event.dataTransfer.getData('text/html');
|
|
52
|
-
/**
|
|
53
|
-
* From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.
|
|
54
|
-
* The order of the checks is important to recognise the HTML drop.
|
|
55
|
-
*/
|
|
56
52
|
|
|
57
|
-
if (
|
|
58
|
-
onHTMLDrop(html);
|
|
59
|
-
} else if (files.length && onFilesDrop) {
|
|
53
|
+
if (files.length && onFilesDrop) {
|
|
60
54
|
onFilesDrop(files);
|
|
55
|
+
} else if (html && onHTMLDrop) {
|
|
56
|
+
onHTMLDrop(html);
|
|
61
57
|
} else if (onDrop) {
|
|
62
58
|
onDrop(event);
|
|
63
59
|
}
|
|
@@ -66,17 +62,13 @@ function DropZoneComponent(_ref) {
|
|
|
66
62
|
onDragStart(event) {
|
|
67
63
|
setIsDraggingOverDocument(true);
|
|
68
64
|
let _type = 'default';
|
|
69
|
-
/**
|
|
70
|
-
* From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.
|
|
71
|
-
* The order of the checks is important to recognise the HTML drop.
|
|
72
|
-
*/
|
|
73
65
|
|
|
74
|
-
if (
|
|
75
|
-
_type = 'html';
|
|
76
|
-
} else if ( // Check for the types because sometimes the files themselves
|
|
66
|
+
if ( // Check for the types because sometimes the files themselves
|
|
77
67
|
// are only available on drop.
|
|
78
68
|
(0, _lodash.includes)(event.dataTransfer.types, 'Files') || (0, _dom.getFilesFromDataTransfer)(event.dataTransfer).length > 0) {
|
|
79
69
|
_type = 'file';
|
|
70
|
+
} else if ((0, _lodash.includes)(event.dataTransfer.types, 'text/html')) {
|
|
71
|
+
_type = 'html';
|
|
80
72
|
}
|
|
81
73
|
|
|
82
74
|
setType(_type);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/drop-zone/index.js"],"names":["DropZoneComponent","className","label","onFilesDrop","onHTMLDrop","onDrop","isDraggingOverDocument","setIsDraggingOverDocument","isDraggingOverElement","setIsDraggingOverElement","type","setType","ref","event","files","dataTransfer","html","getData","length","onDragStart","_type","types","onDragEnd","onDragEnter","onDragLeave","disableMotion","children","backdrop","hidden","scaleY","opacity","show","transition","duration","delay","delayChildren","exit","foreground","scale","upload","classes"],"mappings":";;;;;;;;;AAUA;;AAPA;;AACA;;AAKA;;AAEA;;AACA;;AACA;;AAQA;;AArBA;AACA;AACA;;AAIA;AACA;AACA;;AAUA;AACA;AACA;AAMe,SAASA,iBAAT,OAMX;AAAA,MANuC;AAC1CC,IAAAA,SAD0C;AAE1CC,IAAAA,KAF0C;AAG1CC,IAAAA,WAH0C;AAI1CC,IAAAA,UAJ0C;AAK1CC,IAAAA;AAL0C,GAMvC;AACH,QAAM,CAAEC,sBAAF,EAA0BC,yBAA1B,IAAwD,wBAA9D;AACA,QAAM,CAAEC,qBAAF,EAAyBC,wBAAzB,IAAsD,wBAA5D;AACA,QAAM,CAAEC,IAAF,EAAQC,OAAR,IAAoB,wBAA1B;AACA,QAAMC,GAAG,GAAG,wCAAa;AACxBP,IAAAA,MAAM,CAAEQ,KAAF,EAAU;AACf,YAAMC,KAAK,GAAG,mCAA0BD,KAAK,CAACE,YAAhC,CAAd;AACA,YAAMC,IAAI,GAAGH,KAAK,CAACE,YAAN,CAAmBE,OAAnB,CAA4B,WAA5B,CAAb
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/drop-zone/index.js"],"names":["DropZoneComponent","className","label","onFilesDrop","onHTMLDrop","onDrop","isDraggingOverDocument","setIsDraggingOverDocument","isDraggingOverElement","setIsDraggingOverElement","type","setType","ref","event","files","dataTransfer","html","getData","length","onDragStart","_type","types","onDragEnd","onDragEnter","onDragLeave","disableMotion","children","backdrop","hidden","scaleY","opacity","show","transition","duration","delay","delayChildren","exit","foreground","scale","upload","classes"],"mappings":";;;;;;;;;AAUA;;AAPA;;AACA;;AAKA;;AAEA;;AACA;;AACA;;AAQA;;AArBA;AACA;AACA;;AAIA;AACA;AACA;;AAUA;AACA;AACA;AAMe,SAASA,iBAAT,OAMX;AAAA,MANuC;AAC1CC,IAAAA,SAD0C;AAE1CC,IAAAA,KAF0C;AAG1CC,IAAAA,WAH0C;AAI1CC,IAAAA,UAJ0C;AAK1CC,IAAAA;AAL0C,GAMvC;AACH,QAAM,CAAEC,sBAAF,EAA0BC,yBAA1B,IAAwD,wBAA9D;AACA,QAAM,CAAEC,qBAAF,EAAyBC,wBAAzB,IAAsD,wBAA5D;AACA,QAAM,CAAEC,IAAF,EAAQC,OAAR,IAAoB,wBAA1B;AACA,QAAMC,GAAG,GAAG,wCAAa;AACxBP,IAAAA,MAAM,CAAEQ,KAAF,EAAU;AACf,YAAMC,KAAK,GAAG,mCAA0BD,KAAK,CAACE,YAAhC,CAAd;AACA,YAAMC,IAAI,GAAGH,KAAK,CAACE,YAAN,CAAmBE,OAAnB,CAA4B,WAA5B,CAAb;;AAEA,UAAKH,KAAK,CAACI,MAAN,IAAgBf,WAArB,EAAmC;AAClCA,QAAAA,WAAW,CAAEW,KAAF,CAAX;AACA,OAFD,MAEO,IAAKE,IAAI,IAAIZ,UAAb,EAA0B;AAChCA,QAAAA,UAAU,CAAEY,IAAF,CAAV;AACA,OAFM,MAEA,IAAKX,MAAL,EAAc;AACpBA,QAAAA,MAAM,CAAEQ,KAAF,CAAN;AACA;AACD,KAZuB;;AAaxBM,IAAAA,WAAW,CAAEN,KAAF,EAAU;AACpBN,MAAAA,yBAAyB,CAAE,IAAF,CAAzB;AAEA,UAAIa,KAAK,GAAG,SAAZ;;AAEA,WACC;AACA;AACA,4BAAUP,KAAK,CAACE,YAAN,CAAmBM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C,CAAhB;AAWA,SACC;AAAK,IAAA,GAAG,EAAGE,GAAX;AAAiB,IAAA,SAAS,EAAG4B;AAA7B,KACGf,aAAa,GACdC,QADc,GAGd,4BAAC,oCAAD,QAAmBA,QAAnB,CAJF,CADD;AASA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { upload, Icon } from '@wordpress/icons';\nimport { getFilesFromDataTransfer } from '@wordpress/dom';\nimport {\n\t__experimentalUseDropZone as useDropZone,\n\tuseReducedMotion,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '../animation';\n\nexport default function DropZoneComponent( {\n\tclassName,\n\tlabel,\n\tonFilesDrop,\n\tonHTMLDrop,\n\tonDrop,\n} ) {\n\tconst [ isDraggingOverDocument, setIsDraggingOverDocument ] = useState();\n\tconst [ isDraggingOverElement, setIsDraggingOverElement ] = useState();\n\tconst [ type, setType ] = useState();\n\tconst ref = useDropZone( {\n\t\tonDrop( event ) {\n\t\t\tconst files = getFilesFromDataTransfer( event.dataTransfer );\n\t\t\tconst html = event.dataTransfer.getData( 'text/html' );\n\n\t\t\tif ( files.length && onFilesDrop ) {\n\t\t\t\tonFilesDrop( files );\n\t\t\t} else if ( html && onHTMLDrop ) {\n\t\t\t\tonHTMLDrop( html );\n\t\t\t} else if ( onDrop ) {\n\t\t\t\tonDrop( event );\n\t\t\t}\n\t\t},\n\t\tonDragStart( event ) {\n\t\t\tsetIsDraggingOverDocument( true );\n\n\t\t\tlet _type = 'default';\n\n\t\t\tif (\n\t\t\t\t// Check for the types because sometimes the files themselves\n\t\t\t\t// are only available on drop.\n\t\t\t\tincludes( event.dataTransfer.types, 'Files' ) ||\n\t\t\t\tgetFilesFromDataTransfer( event.dataTransfer ).length > 0\n\t\t\t) {\n\t\t\t\t_type = 'file';\n\t\t\t} else if ( includes( event.dataTransfer.types, 'text/html' ) ) {\n\t\t\t\t_type = 'html';\n\t\t\t}\n\n\t\t\tsetType( _type );\n\t\t},\n\t\tonDragEnd() {\n\t\t\tsetIsDraggingOverDocument( false );\n\t\t\tsetType();\n\t\t},\n\t\tonDragEnter() {\n\t\t\tsetIsDraggingOverElement( true );\n\t\t},\n\t\tonDragLeave() {\n\t\t\tsetIsDraggingOverElement( false );\n\t\t},\n\t} );\n\tconst disableMotion = useReducedMotion();\n\n\tlet children;\n\n\tconst backdrop = {\n\t\thidden: { scaleY: 0, opacity: 0 },\n\t\tshow: {\n\t\t\tscaleY: 1,\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\ttype: 'tween',\n\t\t\t\tduration: 0.2,\n\t\t\t\tdelay: 0.1,\n\t\t\t\tdelayChildren: 0.2,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\tscaleY: 1,\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.3,\n\t\t\t\tdelayChildren: 0,\n\t\t\t},\n\t\t},\n\t};\n\n\tconst foreground = {\n\t\thidden: { opacity: 0, scale: 0.75 },\n\t\tshow: { opacity: 1, scale: 1 },\n\t\texit: { opacity: 0, scale: 0.9 },\n\t};\n\n\tif ( isDraggingOverElement ) {\n\t\tchildren = (\n\t\t\t<motion.div\n\t\t\t\tvariants={ backdrop }\n\t\t\t\tinitial={ disableMotion ? 'show' : 'hidden' }\n\t\t\t\tanimate=\"show\"\n\t\t\t\texit={ disableMotion ? 'show' : 'exit' }\n\t\t\t\tclassName=\"components-drop-zone__content\"\n\t\t\t>\n\t\t\t\t<motion.div variants={ foreground }>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\tclassName=\"components-drop-zone__content-icon\"\n\t\t\t\t\t/>\n\t\t\t\t\t<span className=\"components-drop-zone__content-text\">\n\t\t\t\t\t\t{ label ? label : __( 'Drop files to upload' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</motion.div>\n\t\t\t</motion.div>\n\t\t);\n\t}\n\n\tconst classes = classnames( 'components-drop-zone', className, {\n\t\t'is-active':\n\t\t\t( isDraggingOverDocument || isDraggingOverElement ) &&\n\t\t\t( ( type === 'file' && onFilesDrop ) ||\n\t\t\t\t( type === 'html' && onHTMLDrop ) ||\n\t\t\t\t( type === 'default' && onDrop ) ),\n\t\t'is-dragging-over-document': isDraggingOverDocument,\n\t\t'is-dragging-over-element': isDraggingOverElement,\n\t\t[ `is-dragging-${ type }` ]: !! type,\n\t} );\n\n\treturn (\n\t\t<div ref={ ref } className={ classes }>\n\t\t\t{ disableMotion ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<AnimatePresence>{ children }</AnimatePresence>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -17,7 +17,6 @@ function DropZoneProvider(_ref) {
|
|
|
17
17
|
children
|
|
18
18
|
} = _ref;
|
|
19
19
|
(0, _deprecated.default)('wp.components.DropZoneProvider', {
|
|
20
|
-
since: '5.8',
|
|
21
20
|
hint: 'wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code.'
|
|
22
21
|
});
|
|
23
22
|
return children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/drop-zone/provider.js"],"names":["DropZoneProvider","children","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/drop-zone/provider.js"],"names":["DropZoneProvider","children","hint"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGe,SAASA,gBAAT,OAA0C;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AACxD,2BAAY,gCAAZ,EAA8C;AAC7CC,IAAAA,IAAI,EACH;AAF4C,GAA9C;AAIA,SAAOD,QAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\nexport default function DropZoneProvider( { children } ) {\n\tdeprecated( 'wp.components.DropZoneProvider', {\n\t\thint:\n\t\t\t'wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code.',\n\t} );\n\treturn children;\n}\n"]}
|
package/build/flyout/styles.js
CHANGED
|
@@ -34,13 +34,13 @@ const FlyoutContentView = ( /*#__PURE__*/0, _base.default)(_reakit.Popover, proc
|
|
|
34
34
|
} : {
|
|
35
35
|
target: "e1vtu5161",
|
|
36
36
|
label: "FlyoutContentView"
|
|
37
|
-
})("z-index:", ZIndex.Flyout, ";box-sizing:border-box;opacity:0;outline:none;position:relative;transform-origin:center center;transition:opacity ", _configValues.default.transitionDurationFastest, " linear;width:100%;&[data-enter]{opacity:1;}&::before,&::after{display:none;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
37
|
+
})("z-index:", ZIndex.Flyout, ";box-sizing:border-box;opacity:0;outline:none;position:relative;transform-origin:center center;transition:opacity ", _configValues.default.transitionDurationFastest, " linear;width:100%;&[data-enter]{opacity:1;}&::before,&::after{display:none;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZmx5b3V0L3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFjd0QiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9mbHlvdXQvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXJlc3RyaWN0ZWQtaW1wb3J0c1xuaW1wb3J0IHsgUG9wb3ZlciBhcyBSZWFraXRQb3BvdmVyIH0gZnJvbSAncmVha2l0JztcblxuLyoqXG4gKiBJbnRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgQ2FyZCwgQ2FyZEJvZHkgfSBmcm9tICcuLi9jYXJkJztcbmltcG9ydCAqIGFzIFpJbmRleCBmcm9tICcuLi91dGlscy96LWluZGV4JztcbmltcG9ydCBDT05GSUcgZnJvbSAnLi4vdXRpbHMvY29uZmlnLXZhbHVlcyc7XG5cbmV4cG9ydCBjb25zdCBGbHlvdXRDb250ZW50VmlldyA9IHN0eWxlZCggUmVha2l0UG9wb3ZlciApYFxuXHR6LWluZGV4OiAkeyBaSW5kZXguRmx5b3V0IH07XG5cdGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG5cdG9wYWNpdHk6IDA7XG5cdG91dGxpbmU6IG5vbmU7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcblx0dHJhbnNmb3JtLW9yaWdpbjogY2VudGVyIGNlbnRlcjtcblx0dHJhbnNpdGlvbjogb3BhY2l0eSAkeyBDT05GSUcudHJhbnNpdGlvbkR1cmF0aW9uRmFzdGVzdCB9IGxpbmVhcjtcblx0d2lkdGg6IDEwMCU7XG5cblx0JltkYXRhLWVudGVyXSB7XG5cdFx0b3BhY2l0eTogMTtcblx0fVxuXG5cdCY6OmJlZm9yZSxcblx0Jjo6YWZ0ZXIge1xuXHRcdGRpc3BsYXk6IG5vbmU7XG5cdH1cbmA7XG5cbmV4cG9ydCBjb25zdCBDYXJkVmlldyA9IHN0eWxlZCggQ2FyZCApYFxuXHQkeyBDYXJkQm9keS5zZWxlY3RvciB9IHtcblx0XHRtYXgtaGVpZ2h0OiA4MHZoO1xuXHR9XG5gO1xuIl19 */"));
|
|
38
38
|
exports.FlyoutContentView = FlyoutContentView;
|
|
39
39
|
const CardView = ( /*#__PURE__*/0, _base.default)(_card.Card, process.env.NODE_ENV === "production" ? {
|
|
40
40
|
target: "e1vtu5160"
|
|
41
41
|
} : {
|
|
42
42
|
target: "e1vtu5160",
|
|
43
43
|
label: "CardView"
|
|
44
|
-
})(_card.CardBody.selector, "{max-height:80vh;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
44
|
+
})(_card.CardBody.selector, "{max-height:80vh;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZmx5b3V0L3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFrQ3NDIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZmx5b3V0L3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1yZXN0cmljdGVkLWltcG9ydHNcbmltcG9ydCB7IFBvcG92ZXIgYXMgUmVha2l0UG9wb3ZlciB9IGZyb20gJ3JlYWtpdCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IENhcmQsIENhcmRCb2R5IH0gZnJvbSAnLi4vY2FyZCc7XG5pbXBvcnQgKiBhcyBaSW5kZXggZnJvbSAnLi4vdXRpbHMvei1pbmRleCc7XG5pbXBvcnQgQ09ORklHIGZyb20gJy4uL3V0aWxzL2NvbmZpZy12YWx1ZXMnO1xuXG5leHBvcnQgY29uc3QgRmx5b3V0Q29udGVudFZpZXcgPSBzdHlsZWQoIFJlYWtpdFBvcG92ZXIgKWBcblx0ei1pbmRleDogJHsgWkluZGV4LkZseW91dCB9O1xuXHRib3gtc2l6aW5nOiBib3JkZXItYm94O1xuXHRvcGFjaXR5OiAwO1xuXHRvdXRsaW5lOiBub25lO1xuXHRwb3NpdGlvbjogcmVsYXRpdmU7XG5cdHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlciBjZW50ZXI7XG5cdHRyYW5zaXRpb246IG9wYWNpdHkgJHsgQ09ORklHLnRyYW5zaXRpb25EdXJhdGlvbkZhc3Rlc3QgfSBsaW5lYXI7XG5cdHdpZHRoOiAxMDAlO1xuXG5cdCZbZGF0YS1lbnRlcl0ge1xuXHRcdG9wYWNpdHk6IDE7XG5cdH1cblxuXHQmOjpiZWZvcmUsXG5cdCY6OmFmdGVyIHtcblx0XHRkaXNwbGF5OiBub25lO1xuXHR9XG5gO1xuXG5leHBvcnQgY29uc3QgQ2FyZFZpZXcgPSBzdHlsZWQoIENhcmQgKWBcblx0JHsgQ2FyZEJvZHkuc2VsZWN0b3IgfSB7XG5cdFx0bWF4LWhlaWdodDogODB2aDtcblx0fVxuYDtcbiJdfQ== */"));
|
|
45
45
|
exports.CardView = CardView;
|
|
46
46
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/flyout/styles.ts"],"names":["FlyoutContentView","ReakitPopover","ZIndex","Flyout","CONFIG","transitionDurationFastest","CardView","Card","CardBody","selector"],"mappings":";;;;;;;;;;;AAKA;;AAKA;;AACA;;AACA;;;;;;AAZA;AACA;AACA;AAEA;;AAGA;AACA;AACA;AAKO,MAAMA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/flyout/styles.ts"],"names":["FlyoutContentView","ReakitPopover","ZIndex","Flyout","CONFIG","transitionDurationFastest","CardView","Card","CardBody","selector"],"mappings":";;;;;;;;;;;AAKA;;AAKA;;AACA;;AACA;;;;;;AAZA;AACA;AACA;AAEA;;AAGA;AACA;AACA;AAKO,MAAMA,iBAAiB,GAAG,iCAAQC,eAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,aACjBC,MAAM,CAACC,MADU,wHAONC,sBAAOC,yBAPD,iiDAAvB;;AAoBA,MAAMC,QAAQ,GAAG,iCAAQC,UAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,CACjBC,eAASC,QADQ,0+CAAd","sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n// eslint-disable-next-line no-restricted-imports\nimport { Popover as ReakitPopover } from 'reakit';\n\n/**\n * Internal dependencies\n */\nimport { Card, CardBody } from '../card';\nimport * as ZIndex from '../utils/z-index';\nimport CONFIG from '../utils/config-values';\n\nexport const FlyoutContentView = styled( ReakitPopover )`\n\tz-index: ${ ZIndex.Flyout };\n\tbox-sizing: border-box;\n\topacity: 0;\n\toutline: none;\n\tposition: relative;\n\ttransform-origin: center center;\n\ttransition: opacity ${ CONFIG.transitionDurationFastest } linear;\n\twidth: 100%;\n\n\t&[data-enter] {\n\t\topacity: 1;\n\t}\n\n\t&::before,\n\t&::after {\n\t\tdisplay: none;\n\t}\n`;\n\nexport const CardView = styled( Card )`\n\t${ CardBody.selector } {\n\t\tmax-height: 80vh;\n\t}\n`;\n"]}
|
|
@@ -25,7 +25,6 @@ function FocusableIframe(_ref) {
|
|
|
25
25
|
} = _ref;
|
|
26
26
|
const ref = (0, _compose.useMergeRefs)([iframeRef, (0, _compose.useFocusableIframe)()]);
|
|
27
27
|
(0, _deprecated.default)('wp.components.FocusableIframe', {
|
|
28
|
-
since: '5.9',
|
|
29
28
|
alternative: 'wp.compose.useFocusableIframe'
|
|
30
29
|
}); // Disable reason: The rendered iframe is a pass-through component,
|
|
31
30
|
// assigning props inherited from the rendering parent. It's the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/focusable-iframe/index.js"],"names":["FocusableIframe","iframeRef","props","ref","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/focusable-iframe/index.js"],"names":["FocusableIframe","iframeRef","props","ref","alternative"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIe,SAASA,eAAT,OAAoD;AAAA,MAA1B;AAAEC,IAAAA,SAAF;AAAa,OAAGC;AAAhB,GAA0B;AAClE,QAAMC,GAAG,GAAG,2BAAc,CAAEF,SAAF,EAAa,kCAAb,CAAd,CAAZ;AACA,2BAAY,+BAAZ,EAA6C;AAC5CG,IAAAA,WAAW,EAAE;AAD+B,GAA7C,EAFkE,CAKlE;AACA;AACA;AACA;;AACA,SAAO;AAAQ,IAAA,GAAG,EAAGD;AAAd,KAAyBD,KAAzB,EAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMergeRefs, useFocusableIframe } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\nexport default function FocusableIframe( { iframeRef, ...props } ) {\n\tconst ref = useMergeRefs( [ iframeRef, useFocusableIframe() ] );\n\tdeprecated( 'wp.components.FocusableIframe', {\n\t\talternative: 'wp.compose.useFocusableIframe',\n\t} );\n\t// Disable reason: The rendered iframe is a pass-through component,\n\t// assigning props inherited from the rendering parent. It's the\n\t// responsibility of the parent to assign a title.\n\t// eslint-disable-next-line jsx-a11y/iframe-has-title\n\treturn <iframe ref={ ref } { ...props } />;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/higher-order/with-focus-outside/index.js"],"names":["WrappedComponent","props","handleFocusOutside","setHandleFocusOutside","bindFocusOutsideHandler","node","bind","undefined"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/higher-order/with-focus-outside/index.js"],"names":["WrappedComponent","props","handleFocusOutside","setHandleFocusOutside","bindFocusOutsideHandler","node","bind","undefined"],"mappings":";;;;;;;;;AAGA;;;;AACA;;AAJA;AACA;AACA;eAOe,yCACZA,gBAAF,IAA0BC,KAAF,IAAa;AACpC,QAAM,CAAEC,kBAAF,EAAsBC,qBAAtB,IAAgD,wBAAtD;AACA,QAAMC,uBAAuB,GAAG,0BAC7BC,IAAF,IACCF,qBAAqB,CAAE,MACtBE,IAAI,SAAJ,IAAAA,IAAI,WAAJ,IAAAA,IAAI,CAAEH,kBAAN,GACGG,IAAI,CAACH,kBAAL,CAAwBI,IAAxB,CAA8BD,IAA9B,CADH,GAEGE,SAHiB,CAFS,EAO/B,EAP+B,CAAhC;AAUA,SACC,mCAAU,4CAAiBL,kBAAjB,CAAV,EACC,4BAAC,gBAAD;AACC,IAAA,GAAG,EAAGE;AADP,KAEMH,KAFN,EADD,CADD;AAQA,CArBa,EAsBd,kBAtBc,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useState } from '@wordpress/element';\nimport {\n\tcreateHigherOrderComponent,\n\t__experimentalUseFocusOutside as useFocusOutside,\n} from '@wordpress/compose';\n\nexport default createHigherOrderComponent(\n\t( WrappedComponent ) => ( props ) => {\n\t\tconst [ handleFocusOutside, setHandleFocusOutside ] = useState();\n\t\tconst bindFocusOutsideHandler = useCallback(\n\t\t\t( node ) =>\n\t\t\t\tsetHandleFocusOutside( () =>\n\t\t\t\t\tnode?.handleFocusOutside\n\t\t\t\t\t\t? node.handleFocusOutside.bind( node )\n\t\t\t\t\t\t: undefined\n\t\t\t\t),\n\t\t\t[]\n\t\t);\n\n\t\treturn (\n\t\t\t<div { ...useFocusOutside( handleFocusOutside ) }>\n\t\t\t\t<WrappedComponent\n\t\t\t\t\tref={ bindFocusOutsideHandler }\n\t\t\t\t\t{ ...props }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t},\n\t'withFocusOutside'\n);\n"]}
|