@wordpress/components 20.0.1-next.d6164808d3.0 → 20.0.2-next.957ca95e4c.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 +29 -1
- package/CONTRIBUTING.md +12 -12
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +12 -12
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build/autocomplete/get-default-use-items.js +7 -1
- package/build/autocomplete/get-default-use-items.js.map +1 -1
- package/build/autocomplete/index.js +3 -1
- package/build/autocomplete/index.js.map +1 -1
- package/build/card/card/component.js +6 -11
- package/build/card/card/component.js.map +1 -1
- package/build/card/card/hook.js +0 -10
- package/build/card/card/hook.js.map +1 -1
- package/build/card/card/index.js.map +1 -1
- package/build/card/card-body/component.js +7 -8
- package/build/card/card-body/component.js.map +1 -1
- package/build/card/card-body/hook.js +0 -4
- package/build/card/card-body/hook.js.map +1 -1
- package/build/card/card-body/index.js.map +1 -1
- package/build/card/card-divider/component.js +7 -8
- package/build/card/card-divider/component.js.map +1 -1
- package/build/card/card-divider/hook.js +0 -4
- package/build/card/card-divider/hook.js.map +1 -1
- package/build/card/card-divider/index.js.map +1 -1
- package/build/card/card-footer/component.js +7 -8
- package/build/card/card-footer/component.js.map +1 -1
- package/build/card/card-footer/hook.js +0 -4
- package/build/card/card-footer/hook.js.map +1 -1
- package/build/card/card-footer/index.js.map +1 -1
- package/build/card/card-header/component.js +7 -8
- package/build/card/card-header/component.js.map +1 -1
- package/build/card/card-header/hook.js +0 -4
- package/build/card/card-header/hook.js.map +1 -1
- package/build/card/card-header/index.js.map +1 -1
- package/build/card/card-media/component.js +7 -7
- package/build/card/card-media/component.js.map +1 -1
- package/build/card/card-media/hook.js +0 -4
- package/build/card/card-media/hook.js.map +1 -1
- package/build/card/card-media/index.js.map +1 -1
- package/build/card/context.js.map +1 -1
- package/build/card/index.js.map +1 -1
- package/build/card/styles.js +17 -17
- package/build/card/styles.js.map +1 -1
- package/build/clipboard-button/index.js +16 -1
- package/build/clipboard-button/index.js.map +1 -1
- package/build/color-palette/index.js +6 -2
- package/build/color-palette/index.js.map +1 -1
- package/build/custom-gradient-picker/index.js +11 -0
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/date-time/date/index.js +25 -6
- package/build/date-time/date/index.js.map +1 -1
- package/build/date-time/date/styles.js +22 -12
- package/build/date-time/date/styles.js.map +1 -1
- package/build/date-time/date-time/index.js +1 -3
- package/build/date-time/date-time/index.js.map +1 -1
- package/build/date-time/date-time/styles.js +19 -5
- package/build/date-time/date-time/styles.js.map +1 -1
- package/build/date-time/time/styles.js +12 -12
- package/build/date-time/time/styles.js.map +1 -1
- package/build/drop-zone/index.js +2 -4
- package/build/drop-zone/index.js.map +1 -1
- package/build/dropdown-menu/index.js +1 -3
- package/build/dropdown-menu/index.js.map +1 -1
- package/build/dropdown-menu/index.native.js +0 -17
- package/build/dropdown-menu/index.native.js.map +1 -1
- package/build/focal-point-picker/controls.js +4 -4
- package/build/focal-point-picker/controls.js.map +1 -1
- package/build/focal-point-picker/focal-point.js +4 -6
- package/build/focal-point-picker/focal-point.js.map +1 -1
- package/build/focal-point-picker/grid.js +6 -35
- package/build/focal-point-picker/grid.js.map +1 -1
- package/build/focal-point-picker/index.js +160 -330
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/media.js +4 -34
- package/build/focal-point-picker/media.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-picker-style.js +14 -14
- package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build/focal-point-picker/utils.js +2 -6
- package/build/focal-point-picker/utils.js.map +1 -1
- package/build/focusable-iframe/index.js +6 -0
- package/build/focusable-iframe/index.js.map +1 -1
- package/build/form-token-field/index.js +18 -15
- package/build/form-token-field/index.js.map +1 -1
- package/build/gradient-picker/index.js +12 -1
- package/build/gradient-picker/index.js.map +1 -1
- package/build/guide/index.js +8 -6
- package/build/guide/index.js.map +1 -1
- package/build/higher-order/with-constrained-tabbing/index.js +1 -1
- package/build/higher-order/with-constrained-tabbing/index.js.map +1 -1
- package/build/higher-order/with-spoken-messages/index.js +2 -0
- package/build/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build/isolated-event-container/index.js +4 -0
- package/build/isolated-event-container/index.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/navigable-container/menu.js +3 -9
- package/build/navigable-container/menu.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +1 -3
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/palette-edit/index.js +6 -2
- package/build/palette-edit/index.js.map +1 -1
- package/build/popover/index.js +15 -35
- package/build/popover/index.js.map +1 -1
- package/build/text-highlight/index.js +4 -4
- package/build/text-highlight/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +23 -8
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/tooltip/index.js +1 -7
- package/build/tooltip/index.js.map +1 -1
- package/build/tree-grid/index.js +4 -10
- package/build/tree-grid/index.js.map +1 -1
- package/build/utils/strings.js +13 -0
- package/build/utils/strings.js.map +1 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +12 -12
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build-module/autocomplete/get-default-use-items.js +6 -1
- package/build-module/autocomplete/get-default-use-items.js.map +1 -1
- package/build-module/autocomplete/index.js +2 -1
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/card/card/component.js +5 -10
- package/build-module/card/card/component.js.map +1 -1
- package/build-module/card/card/hook.js +0 -9
- package/build-module/card/card/hook.js.map +1 -1
- package/build-module/card/card/index.js.map +1 -1
- package/build-module/card/card-body/component.js +7 -8
- package/build-module/card/card-body/component.js.map +1 -1
- package/build-module/card/card-body/hook.js +0 -4
- package/build-module/card/card-body/hook.js.map +1 -1
- package/build-module/card/card-body/index.js.map +1 -1
- package/build-module/card/card-divider/component.js +7 -8
- package/build-module/card/card-divider/component.js.map +1 -1
- package/build-module/card/card-divider/hook.js +0 -4
- package/build-module/card/card-divider/hook.js.map +1 -1
- package/build-module/card/card-divider/index.js.map +1 -1
- package/build-module/card/card-footer/component.js +7 -8
- package/build-module/card/card-footer/component.js.map +1 -1
- package/build-module/card/card-footer/hook.js +0 -4
- package/build-module/card/card-footer/hook.js.map +1 -1
- package/build-module/card/card-footer/index.js.map +1 -1
- package/build-module/card/card-header/component.js +7 -8
- package/build-module/card/card-header/component.js.map +1 -1
- package/build-module/card/card-header/hook.js +0 -4
- package/build-module/card/card-header/hook.js.map +1 -1
- package/build-module/card/card-header/index.js.map +1 -1
- package/build-module/card/card-media/component.js +7 -7
- package/build-module/card/card-media/component.js.map +1 -1
- package/build-module/card/card-media/hook.js +0 -4
- package/build-module/card/card-media/hook.js.map +1 -1
- package/build-module/card/card-media/index.js.map +1 -1
- package/build-module/card/context.js.map +1 -1
- package/build-module/card/index.js.map +1 -1
- package/build-module/card/styles.js +17 -17
- package/build-module/card/styles.js.map +1 -1
- package/build-module/clipboard-button/index.js +17 -1
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/color-palette/index.js +5 -2
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +10 -0
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/date-time/date/index.js +27 -8
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date/styles.js +21 -5
- package/build-module/date-time/date/styles.js.map +1 -1
- package/build-module/date-time/date-time/index.js +2 -3
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/date-time/date-time/styles.js +20 -1
- package/build-module/date-time/date-time/styles.js.map +1 -1
- package/build-module/date-time/time/styles.js +12 -12
- package/build-module/date-time/time/styles.js.map +1 -1
- package/build-module/drop-zone/index.js +2 -3
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/dropdown-menu/index.js +1 -2
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js +0 -16
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +4 -4
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/focal-point.js +4 -6
- package/build-module/focal-point-picker/focal-point.js.map +1 -1
- package/build-module/focal-point-picker/grid.js +6 -34
- package/build-module/focal-point-picker/grid.js.map +1 -1
- package/build-module/focal-point-picker/index.js +158 -325
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/media.js +4 -36
- package/build-module/focal-point-picker/media.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js +13 -14
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build-module/focal-point-picker/utils.js +2 -6
- package/build-module/focal-point-picker/utils.js.map +1 -1
- package/build-module/focusable-iframe/index.js +6 -0
- package/build-module/focusable-iframe/index.js.map +1 -1
- package/build-module/form-token-field/index.js +18 -14
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/gradient-picker/index.js +11 -1
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/guide/index.js +8 -5
- package/build-module/guide/index.js.map +1 -1
- package/build-module/higher-order/with-constrained-tabbing/index.js +1 -1
- package/build-module/higher-order/with-constrained-tabbing/index.js.map +1 -1
- package/build-module/higher-order/with-spoken-messages/index.js +2 -0
- package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build-module/isolated-event-container/index.js +3 -0
- package/build-module/isolated-event-container/index.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +2 -2
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/navigable-container/menu.js +3 -8
- package/build-module/navigable-container/menu.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +1 -2
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/palette-edit/index.js +6 -2
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/popover/index.js +15 -35
- package/build-module/popover/index.js.map +1 -1
- package/build-module/text-highlight/index.js +2 -5
- package/build-module/text-highlight/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +2 -1
- 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 +20 -6
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/tooltip/index.js +1 -6
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tree-grid/index.js +4 -9
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/utils/strings.js +11 -0
- package/build-module/utils/strings.js.map +1 -1
- package/build-style/style-rtl.css +2 -21
- package/build-style/style.css +2 -21
- package/build-types/animation/index.d.ts +2 -0
- package/build-types/animation/index.d.ts.map +1 -0
- package/build-types/card/card/component.d.ts +3 -3
- package/build-types/card/card/component.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +7 -2
- package/build-types/card/card/hook.d.ts.map +1 -1
- package/build-types/card/card/index.d.ts +2 -2
- package/build-types/card/card/index.d.ts.map +1 -1
- package/build-types/card/card-body/component.d.ts +3 -3
- package/build-types/card/card-body/component.d.ts.map +1 -1
- package/build-types/card/card-body/hook.d.ts +5 -2
- package/build-types/card/card-body/hook.d.ts.map +1 -1
- package/build-types/card/card-body/index.d.ts +2 -2
- package/build-types/card/card-body/index.d.ts.map +1 -1
- package/build-types/card/card-divider/component.d.ts +3 -3
- package/build-types/card/card-divider/component.d.ts.map +1 -1
- package/build-types/card/card-divider/hook.d.ts +5 -2
- package/build-types/card/card-divider/hook.d.ts.map +1 -1
- package/build-types/card/card-divider/index.d.ts +2 -2
- package/build-types/card/card-divider/index.d.ts.map +1 -1
- package/build-types/card/card-footer/component.d.ts +3 -3
- package/build-types/card/card-footer/component.d.ts.map +1 -1
- package/build-types/card/card-footer/hook.d.ts +5 -2
- package/build-types/card/card-footer/hook.d.ts.map +1 -1
- package/build-types/card/card-footer/index.d.ts +2 -2
- package/build-types/card/card-footer/index.d.ts.map +1 -1
- package/build-types/card/card-header/component.d.ts +3 -3
- package/build-types/card/card-header/component.d.ts.map +1 -1
- package/build-types/card/card-header/hook.d.ts +5 -2
- package/build-types/card/card-header/hook.d.ts.map +1 -1
- package/build-types/card/card-header/index.d.ts +2 -2
- package/build-types/card/card-header/index.d.ts.map +1 -1
- package/build-types/card/card-media/component.d.ts +3 -4
- package/build-types/card/card-media/component.d.ts.map +1 -1
- package/build-types/card/card-media/hook.d.ts +6 -5
- package/build-types/card/card-media/hook.d.ts.map +1 -1
- package/build-types/card/card-media/index.d.ts +2 -2
- package/build-types/card/card-media/index.d.ts.map +1 -1
- package/build-types/card/context.d.ts +3 -2
- package/build-types/card/context.d.ts.map +1 -1
- package/build-types/card/index.d.ts +6 -6
- package/build-types/card/index.d.ts.map +1 -1
- package/build-types/card/stories/index.d.ts +12 -0
- package/build-types/card/stories/index.d.ts.map +1 -0
- package/build-types/card/styles.d.ts +20 -22
- package/build-types/card/styles.d.ts.map +1 -1
- package/build-types/card/test/index.d.ts +2 -0
- package/build-types/card/test/index.d.ts.map +1 -0
- package/build-types/card/types.d.ts +7 -1
- package/build-types/card/types.d.ts.map +1 -1
- package/build-types/clipboard-button/index.d.ts +16 -0
- package/build-types/clipboard-button/index.d.ts.map +1 -0
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/composite/index.d.ts +2 -0
- package/build-types/composite/index.d.ts.map +1 -0
- package/build-types/date-time/date/index.d.ts +1 -1
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +4 -0
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/date-time/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/date-time/styles.d.ts +13 -0
- package/build-types/date-time/date-time/styles.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts.map +1 -1
- package/build-types/disclosure/index.d.ts +2 -0
- package/build-types/disclosure/index.d.ts.map +1 -0
- package/build-types/dropdown-menu/index.d.ts.map +1 -1
- package/build-types/focusable-iframe/index.d.ts +8 -0
- package/build-types/focusable-iframe/index.d.ts.map +1 -0
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/test/index.d.ts +2 -0
- package/build-types/form-token-field/test/index.d.ts.map +1 -0
- package/build-types/higher-order/with-constrained-tabbing/index.d.ts +3 -0
- package/build-types/higher-order/with-constrained-tabbing/index.d.ts.map +1 -0
- package/build-types/higher-order/with-spoken-messages/index.d.ts +4 -0
- package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -0
- package/build-types/isolated-event-container/index.d.ts +3 -0
- package/build-types/isolated-event-container/index.d.ts.map +1 -0
- package/build-types/mobile/inserter-button/sparkles.d.ts +3 -0
- package/build-types/mobile/inserter-button/sparkles.d.ts.map +1 -0
- package/build-types/navigable-container/menu.d.ts.map +1 -1
- package/build-types/popover/index.d.ts +0 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/radio-context/index.d.ts +6 -0
- package/build-types/radio-context/index.d.ts.map +1 -0
- package/build-types/text-highlight/index.d.ts +0 -3
- package/build-types/text-highlight/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 +4 -0
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/utils/strings.d.ts +8 -0
- package/build-types/utils/strings.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.js +1 -0
- package/src/autocomplete/get-default-use-items.js +6 -1
- package/src/autocomplete/index.js +2 -1
- package/src/card/card/{component.js → component.tsx} +13 -9
- package/src/card/card/{hook.js → hook.ts} +11 -11
- package/src/card/card/{index.js → index.ts} +0 -0
- package/src/card/card-body/{component.js → component.tsx} +13 -9
- package/src/card/card-body/{hook.js → hook.ts} +5 -5
- package/src/card/card-body/{index.js → index.ts} +0 -0
- package/src/card/card-divider/{component.js → component.tsx} +16 -10
- package/src/card/card-divider/{hook.js → hook.ts} +5 -5
- package/src/card/card-divider/{index.js → index.ts} +0 -0
- package/src/card/card-footer/{component.js → component.tsx} +13 -9
- package/src/card/card-footer/{hook.js → hook.ts} +5 -5
- package/src/card/card-footer/{index.js → index.ts} +0 -0
- package/src/card/card-header/{component.js → component.tsx} +13 -9
- package/src/card/card-header/{hook.js → hook.ts} +5 -5
- package/src/card/card-header/{index.js → index.ts} +0 -0
- package/src/card/card-media/{component.js → component.tsx} +13 -8
- package/src/card/card-media/{hook.js → hook.ts} +5 -5
- package/src/card/card-media/{index.js → index.ts} +0 -0
- package/src/card/{context.js → context.ts} +0 -0
- package/src/card/{index.js → index.ts} +0 -0
- package/src/card/stories/index.tsx +75 -0
- package/src/card/{styles.js → styles.ts} +0 -0
- package/src/card/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/card/test/{index.js → index.tsx} +3 -3
- package/src/card/types.ts +8 -1
- package/src/clipboard-button/index.js +13 -0
- package/src/color-palette/index.js +8 -5
- package/src/color-palette/style.scss +0 -14
- package/src/color-palette/test/__snapshots__/index.js.snap +11 -4
- package/src/custom-gradient-picker/index.js +12 -0
- package/src/custom-gradient-picker/stories/index.js +3 -0
- package/src/date-time/date/index.tsx +26 -6
- package/src/date-time/date/styles.ts +6 -0
- package/src/date-time/date/test/index.tsx +6 -2
- package/src/date-time/date-time/index.tsx +3 -4
- package/src/date-time/date-time/styles.ts +9 -0
- package/src/date-time/time/styles.ts +1 -0
- package/src/drop-zone/index.js +2 -3
- package/src/dropdown-menu/index.js +1 -2
- package/src/dropdown-menu/index.native.js +0 -13
- package/src/dropdown-menu/test/index.js +54 -58
- package/src/focal-point-picker/README.md +3 -6
- package/src/focal-point-picker/controls.js +4 -4
- package/src/focal-point-picker/focal-point.js +2 -8
- package/src/focal-point-picker/grid.js +5 -41
- package/src/focal-point-picker/index.js +161 -303
- package/src/focal-point-picker/media.js +4 -28
- package/src/focal-point-picker/styles/focal-point-picker-style.js +5 -8
- package/src/focal-point-picker/test/index.js +1 -1
- package/src/focal-point-picker/utils.js +2 -6
- package/src/focusable-iframe/index.js +5 -0
- package/src/form-token-field/index.tsx +17 -23
- package/src/form-token-field/test/index.tsx +2106 -0
- package/src/gradient-picker/README.md +9 -0
- package/src/gradient-picker/index.js +9 -0
- package/src/gradient-picker/stories/index.js +1 -0
- package/src/guide/index.js +6 -3
- package/src/guide/test/index.js +138 -1
- package/src/higher-order/with-constrained-tabbing/index.js +1 -1
- package/src/higher-order/with-spoken-messages/index.js +2 -0
- package/src/isolated-event-container/index.js +3 -0
- package/src/mobile/global-styles-context/utils.native.js +7 -2
- package/src/navigable-container/menu.js +3 -7
- package/src/navigation/menu/menu-title-search.js +1 -2
- package/src/palette-edit/index.js +14 -10
- package/src/palette-edit/style.scss +3 -11
- package/src/placeholder/style.scss +1 -4
- package/src/popover/index.js +17 -35
- package/src/popover/stories/index.js +0 -1
- package/src/text-highlight/index.tsx +1 -5
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +62 -44
- package/src/toggle-group-control/toggle-group-control/component.tsx +3 -2
- package/src/toggle-group-control/toggle-group-control/styles.ts +5 -0
- package/src/tooltip/index.js +1 -5
- package/src/tree-grid/index.js +4 -9
- package/src/utils/strings.ts +11 -0
- package/tsconfig.json +45 -76
- package/tsconfig.tsbuildinfo +1 -1
- package/build/ui/__storybook-utils/example-grid.js +0 -88
- package/build/ui/__storybook-utils/example-grid.js.map +0 -1
- package/build/ui/__storybook-utils/index.js +0 -19
- package/build/ui/__storybook-utils/index.js.map +0 -1
- package/build/ui/__storybook-utils/page.js +0 -43
- package/build/ui/__storybook-utils/page.js.map +0 -1
- package/build/utils/keyboard.js +0 -41
- package/build/utils/keyboard.js.map +0 -1
- package/build-module/ui/__storybook-utils/example-grid.js +0 -69
- package/build-module/ui/__storybook-utils/example-grid.js.map +0 -1
- package/build-module/ui/__storybook-utils/index.js +0 -2
- package/build-module/ui/__storybook-utils/index.js.map +0 -1
- package/build-module/ui/__storybook-utils/page.js +0 -32
- package/build-module/ui/__storybook-utils/page.js.map +0 -1
- package/build-module/utils/keyboard.js +0 -33
- package/build-module/utils/keyboard.js.map +0 -1
- package/build-types/form-token-field/test/lib/fixtures.d.ts +0 -26
- package/build-types/form-token-field/test/lib/fixtures.d.ts.map +0 -1
- package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts +0 -21
- package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts.map +0 -1
- package/build-types/utils/keyboard.d.ts +0 -12
- package/build-types/utils/keyboard.d.ts.map +0 -1
- package/src/card/stories/index.js +0 -209
- package/src/form-token-field/test/index.js +0 -442
- package/src/form-token-field/test/lib/fixtures.js +0 -89
- package/src/form-token-field/test/lib/token-field-wrapper.tsx +0 -71
- package/src/guide/test/page-control.js +0 -40
- package/src/ui/__storybook-utils/example-grid.js +0 -61
- package/src/ui/__storybook-utils/index.js +0 -1
- package/src/ui/__storybook-utils/page.js +0 -29
- package/src/utils/keyboard.js +0 -28
- package/src/utils/test/keyboard.js +0 -34
|
@@ -6,14 +6,14 @@ import { useMemo } from '@wordpress/element';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { useContextSystem } from '../../ui/context';
|
|
9
|
+
import { useContextSystem, WordPressComponentProps } from '../../ui/context';
|
|
10
10
|
import * as styles from '../styles';
|
|
11
11
|
import { useCx } from '../../utils/hooks/use-cx';
|
|
12
|
+
import type { MediaProps } from '../types';
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export function useCardMedia( props ) {
|
|
14
|
+
export function useCardMedia(
|
|
15
|
+
props: WordPressComponentProps< MediaProps, 'div' >
|
|
16
|
+
) {
|
|
17
17
|
const { className, ...otherProps } = useContextSystem( props, 'CardMedia' );
|
|
18
18
|
|
|
19
19
|
const cx = useCx();
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import {
|
|
10
|
+
Card,
|
|
11
|
+
CardHeader,
|
|
12
|
+
CardBody,
|
|
13
|
+
CardDivider,
|
|
14
|
+
CardMedia,
|
|
15
|
+
CardFooter,
|
|
16
|
+
} from '..';
|
|
17
|
+
import { Text } from '../../text';
|
|
18
|
+
import { Heading } from '../../heading';
|
|
19
|
+
import Button from '../../button';
|
|
20
|
+
|
|
21
|
+
const meta: ComponentMeta< typeof Card > = {
|
|
22
|
+
component: Card,
|
|
23
|
+
title: 'Components/Card',
|
|
24
|
+
subcomponents: { CardHeader, CardBody, CardDivider, CardMedia, CardFooter },
|
|
25
|
+
argTypes: {
|
|
26
|
+
as: {
|
|
27
|
+
control: { type: null },
|
|
28
|
+
},
|
|
29
|
+
children: {
|
|
30
|
+
control: { type: null },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
parameters: {
|
|
34
|
+
controls: {
|
|
35
|
+
expanded: true,
|
|
36
|
+
},
|
|
37
|
+
docs: { source: { state: 'open' } },
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default meta;
|
|
42
|
+
|
|
43
|
+
const Template: ComponentStory< typeof Card > = ( args ) => {
|
|
44
|
+
return (
|
|
45
|
+
<div style={ { maxWidth: '280px' } }>
|
|
46
|
+
<Card { ...args }>
|
|
47
|
+
<CardHeader>
|
|
48
|
+
<Heading>CardHeader</Heading>
|
|
49
|
+
</CardHeader>
|
|
50
|
+
<CardBody>
|
|
51
|
+
<Text>CardBody</Text>
|
|
52
|
+
</CardBody>
|
|
53
|
+
<CardBody>
|
|
54
|
+
<Text>CardBody (before CardDivider)</Text>
|
|
55
|
+
</CardBody>
|
|
56
|
+
<CardDivider />
|
|
57
|
+
<CardBody>
|
|
58
|
+
<Text>CardBody (after CardDivider)</Text>
|
|
59
|
+
</CardBody>
|
|
60
|
+
<CardMedia>
|
|
61
|
+
<img
|
|
62
|
+
alt="Card Media"
|
|
63
|
+
src="https://images.unsplash.com/photo-1566125882500-87e10f726cdc?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1867&q=80"
|
|
64
|
+
/>
|
|
65
|
+
</CardMedia>
|
|
66
|
+
<CardFooter>
|
|
67
|
+
<Text>CardFooter</Text>
|
|
68
|
+
<Button variant="secondary">Action Button</Button>
|
|
69
|
+
</CardFooter>
|
|
70
|
+
</Card>
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const Default: ComponentStory< typeof Card > = Template.bind( {} );
|
|
File without changes
|
|
File without changes
|
|
@@ -56,9 +56,9 @@ describe( 'Card', () => {
|
|
|
56
56
|
const { container: containerSquared } = render(
|
|
57
57
|
<Card isRounded={ false }>Code is Poetry</Card>
|
|
58
58
|
);
|
|
59
|
-
expect(
|
|
60
|
-
|
|
61
|
-
);
|
|
59
|
+
expect(
|
|
60
|
+
containerRounded.firstElementChild
|
|
61
|
+
).toMatchStyleDiffSnapshot( containerSquared.firstElementChild );
|
|
62
62
|
} );
|
|
63
63
|
|
|
64
64
|
it( 'should show a box shadow when the elevation prop is greater than 0', () => {
|
package/src/card/types.ts
CHANGED
|
@@ -74,6 +74,13 @@ export type BodyProps = BaseSubComponentProps & {
|
|
|
74
74
|
isScrollable?: boolean;
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
+
export type MediaProps = {
|
|
78
|
+
/**
|
|
79
|
+
* The children elements.
|
|
80
|
+
*/
|
|
81
|
+
children: React.ReactNode;
|
|
82
|
+
};
|
|
83
|
+
|
|
77
84
|
type MarginalSubComponentProps = BaseSubComponentProps & {
|
|
78
85
|
/**
|
|
79
86
|
* Renders without a border.
|
|
@@ -86,5 +93,5 @@ type MarginalSubComponentProps = BaseSubComponentProps & {
|
|
|
86
93
|
export type HeaderProps = MarginalSubComponentProps;
|
|
87
94
|
|
|
88
95
|
export type FooterProps = MarginalSubComponentProps & {
|
|
89
|
-
justify
|
|
96
|
+
justify?: CSSProperties[ 'justifyContent' ];
|
|
90
97
|
};
|
|
@@ -17,6 +17,14 @@ import Button from '../button';
|
|
|
17
17
|
|
|
18
18
|
const TIMEOUT = 4000;
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* @param {Object} props
|
|
22
|
+
* @param {string} [props.className]
|
|
23
|
+
* @param {import('react').ReactNode} props.children
|
|
24
|
+
* @param {() => void} props.onCopy
|
|
25
|
+
* @param {() => void} [props.onFinishCopy]
|
|
26
|
+
* @param {string} props.text
|
|
27
|
+
*/
|
|
20
28
|
export default function ClipboardButton( {
|
|
21
29
|
className,
|
|
22
30
|
children,
|
|
@@ -30,9 +38,11 @@ export default function ClipboardButton( {
|
|
|
30
38
|
alternative: 'wp.compose.useCopyToClipboard',
|
|
31
39
|
} );
|
|
32
40
|
|
|
41
|
+
/** @type {import('react').MutableRefObject<ReturnType<setTimeout> | undefined>} */
|
|
33
42
|
const timeoutId = useRef();
|
|
34
43
|
const ref = useCopyToClipboard( text, () => {
|
|
35
44
|
onCopy();
|
|
45
|
+
// @ts-expect-error: Should check if .current is defined, but not changing because this component is deprecated.
|
|
36
46
|
clearTimeout( timeoutId.current );
|
|
37
47
|
|
|
38
48
|
if ( onFinishCopy ) {
|
|
@@ -41,6 +51,7 @@ export default function ClipboardButton( {
|
|
|
41
51
|
} );
|
|
42
52
|
|
|
43
53
|
useEffect( () => {
|
|
54
|
+
// @ts-expect-error: Should check if .current is defined, but not changing because this component is deprecated.
|
|
44
55
|
clearTimeout( timeoutId.current );
|
|
45
56
|
}, [] );
|
|
46
57
|
|
|
@@ -51,7 +62,9 @@ export default function ClipboardButton( {
|
|
|
51
62
|
// This causes documentHasSelection() in the copy-handler component to
|
|
52
63
|
// mistakenly override the ClipboardButton, and copy a serialized string
|
|
53
64
|
// of the current block instead.
|
|
65
|
+
/** @type {import('react').ClipboardEventHandler<HTMLButtonElement>} */
|
|
54
66
|
const focusOnCopyEventTarget = ( event ) => {
|
|
67
|
+
// @ts-expect-error: Should be currentTarget, but not changing because this component is deprecated.
|
|
55
68
|
event.target.focus();
|
|
56
69
|
};
|
|
57
70
|
|
|
@@ -22,6 +22,7 @@ import { VStack } from '../v-stack';
|
|
|
22
22
|
import { Flex, FlexItem } from '../flex';
|
|
23
23
|
import { Truncate } from '../truncate';
|
|
24
24
|
import { ColorHeading } from './styles';
|
|
25
|
+
import DropdownContentWrapper from '../dropdown/dropdown-content-wrapper';
|
|
25
26
|
|
|
26
27
|
extend( [ namesPlugin, a11yPlugin ] );
|
|
27
28
|
|
|
@@ -202,11 +203,13 @@ export default function ColorPalette( {
|
|
|
202
203
|
const Component = showMultiplePalettes ? MultiplePalettes : SinglePalette;
|
|
203
204
|
|
|
204
205
|
const renderCustomColorPicker = () => (
|
|
205
|
-
<
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
206
|
+
<DropdownContentWrapper paddingSize="none">
|
|
207
|
+
<ColorPicker
|
|
208
|
+
color={ value }
|
|
209
|
+
onChange={ ( color ) => onChange( color ) }
|
|
210
|
+
enableAlpha={ enableAlpha }
|
|
211
|
+
/>
|
|
212
|
+
</DropdownContentWrapper>
|
|
210
213
|
);
|
|
211
214
|
|
|
212
215
|
const colordColor = colord( value );
|
|
@@ -31,20 +31,6 @@
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.components-dropdown__content.components-color-palette__custom-color-dropdown-content .components-popover__content {
|
|
35
|
-
overflow: visible;
|
|
36
|
-
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.05);
|
|
37
|
-
border: none;
|
|
38
|
-
outline: none;
|
|
39
|
-
border-radius: $radius-block-ui;
|
|
40
|
-
padding: 0;
|
|
41
|
-
|
|
42
|
-
.react-colorful__saturation {
|
|
43
|
-
border-top-right-radius: $radius-block-ui;
|
|
44
|
-
border-top-left-radius: $radius-block-ui;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
34
|
.components-color-palette__custom-color-name {
|
|
49
35
|
text-align: left;
|
|
50
36
|
}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`ColorPalette Dropdown .renderContent should render dropdown content 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
<DropdownContentWrapperDiv
|
|
5
|
+
className="components-dropdown-content-wrapper"
|
|
6
|
+
data-wp-c16t={true}
|
|
7
|
+
data-wp-component="DropdownContentWrapper"
|
|
8
|
+
paddingSize="none"
|
|
9
|
+
>
|
|
10
|
+
<LegacyAdapter
|
|
11
|
+
color="#f00"
|
|
12
|
+
onChange={[Function]}
|
|
13
|
+
/>
|
|
14
|
+
</DropdownContentWrapperDiv>
|
|
8
15
|
`;
|
|
9
16
|
|
|
10
17
|
exports[`ColorPalette Dropdown .renderToggle should render dropdown content 1`] = `
|
|
@@ -6,6 +6,7 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
+
import deprecated from '@wordpress/deprecated';
|
|
9
10
|
import { __ } from '@wordpress/i18n';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -125,6 +126,17 @@ export default function CustomGradientPicker( {
|
|
|
125
126
|
position: parseInt( colorStop.length.value ),
|
|
126
127
|
} ) );
|
|
127
128
|
|
|
129
|
+
if ( ! __nextHasNoMargin ) {
|
|
130
|
+
deprecated(
|
|
131
|
+
'Outer margin styles for wp.components.CustomGradientPicker',
|
|
132
|
+
{
|
|
133
|
+
since: '6.1',
|
|
134
|
+
version: '6.4',
|
|
135
|
+
hint: 'Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version',
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
128
140
|
return (
|
|
129
141
|
<VStack
|
|
130
142
|
spacing={ 5 }
|
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
subWeeks,
|
|
14
14
|
addWeeks,
|
|
15
15
|
isSameMonth,
|
|
16
|
+
startOfWeek,
|
|
17
|
+
endOfWeek,
|
|
16
18
|
} from 'date-fns';
|
|
17
19
|
|
|
18
20
|
/**
|
|
@@ -28,6 +30,7 @@ import { useState, useRef, useEffect } from '@wordpress/element';
|
|
|
28
30
|
*/
|
|
29
31
|
import type { DatePickerProps } from '../types';
|
|
30
32
|
import {
|
|
33
|
+
Wrapper,
|
|
31
34
|
Navigator,
|
|
32
35
|
NavigatorHeading,
|
|
33
36
|
Calendar,
|
|
@@ -63,7 +66,7 @@ export function DatePicker( {
|
|
|
63
66
|
events = [],
|
|
64
67
|
isInvalidDate,
|
|
65
68
|
onMonthPreviewed,
|
|
66
|
-
startOfWeek = 0,
|
|
69
|
+
startOfWeek: weekStartsOn = 0,
|
|
67
70
|
}: DatePickerProps ) {
|
|
68
71
|
const date = currentDate ? inputToDate( currentDate ) : new Date();
|
|
69
72
|
|
|
@@ -78,7 +81,7 @@ export function DatePicker( {
|
|
|
78
81
|
} = useLilius( {
|
|
79
82
|
selected: [ startOfDay( date ) ],
|
|
80
83
|
viewing: startOfDay( date ),
|
|
81
|
-
weekStartsOn
|
|
84
|
+
weekStartsOn,
|
|
82
85
|
} );
|
|
83
86
|
|
|
84
87
|
// Used to implement a roving tab index. Tracks the day that receives focus
|
|
@@ -101,7 +104,7 @@ export function DatePicker( {
|
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
return (
|
|
104
|
-
<
|
|
107
|
+
<Wrapper
|
|
105
108
|
className="components-datetime__date"
|
|
106
109
|
role="application"
|
|
107
110
|
aria-label={ __( 'Calendar' ) }
|
|
@@ -218,7 +221,22 @@ export function DatePicker( {
|
|
|
218
221
|
if ( event.key === 'ArrowDown' ) {
|
|
219
222
|
nextFocusable = addWeeks( day, 1 );
|
|
220
223
|
}
|
|
224
|
+
if ( event.key === 'PageUp' ) {
|
|
225
|
+
nextFocusable = subMonths( day, 1 );
|
|
226
|
+
}
|
|
227
|
+
if ( event.key === 'PageDown' ) {
|
|
228
|
+
nextFocusable = addMonths( day, 1 );
|
|
229
|
+
}
|
|
230
|
+
if ( event.key === 'Home' ) {
|
|
231
|
+
nextFocusable = startOfWeek( day );
|
|
232
|
+
}
|
|
233
|
+
if ( event.key === 'End' ) {
|
|
234
|
+
nextFocusable = startOfDay(
|
|
235
|
+
endOfWeek( day )
|
|
236
|
+
);
|
|
237
|
+
}
|
|
221
238
|
if ( nextFocusable ) {
|
|
239
|
+
event.preventDefault();
|
|
222
240
|
setFocusable( nextFocusable );
|
|
223
241
|
if (
|
|
224
242
|
! isSameMonth(
|
|
@@ -241,7 +259,7 @@ export function DatePicker( {
|
|
|
241
259
|
} )
|
|
242
260
|
) }
|
|
243
261
|
</Calendar>
|
|
244
|
-
</
|
|
262
|
+
</Wrapper>
|
|
245
263
|
);
|
|
246
264
|
}
|
|
247
265
|
|
|
@@ -274,12 +292,14 @@ function Day( {
|
|
|
274
292
|
|
|
275
293
|
// Focus the day when it becomes focusable, e.g. because an arrow key is
|
|
276
294
|
// pressed. Only do this if focus is allowed - this stops us stealing focus
|
|
277
|
-
// from e.g. a TimePicker input.
|
|
278
|
-
// there is no point calling focus() on an already focused element.
|
|
295
|
+
// from e.g. a TimePicker input.
|
|
279
296
|
useEffect( () => {
|
|
280
297
|
if ( ref.current && isFocusable && isFocusAllowed ) {
|
|
281
298
|
ref.current.focus();
|
|
282
299
|
}
|
|
300
|
+
// isFocusAllowed is not a dep as there is no point calling focus() on
|
|
301
|
+
// an already focused element.
|
|
302
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
283
303
|
}, [ isFocusable ] );
|
|
284
304
|
|
|
285
305
|
return (
|
|
@@ -12,6 +12,10 @@ import { HStack } from '../../h-stack';
|
|
|
12
12
|
import { Heading } from '../../heading';
|
|
13
13
|
import { space } from '../../ui/utils/space';
|
|
14
14
|
|
|
15
|
+
export const Wrapper = styled.div`
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
`;
|
|
18
|
+
|
|
15
19
|
export const Navigator = styled( HStack )`
|
|
16
20
|
margin-bottom: ${ space( 4 ) };
|
|
17
21
|
`;
|
|
@@ -35,6 +39,8 @@ export const Calendar = styled.div`
|
|
|
35
39
|
|
|
36
40
|
export const DayOfWeek = styled.div`
|
|
37
41
|
color: ${ COLORS.gray[ 700 ] };
|
|
42
|
+
font-size: ${ CONFIG.fontSize };
|
|
43
|
+
line-height: ${ CONFIG.fontLineHeightBase };
|
|
38
44
|
|
|
39
45
|
&:nth-of-type( 1 ) {
|
|
40
46
|
justify-self: start;
|
|
@@ -31,7 +31,9 @@ describe( 'DatePicker', () => {
|
|
|
31
31
|
} );
|
|
32
32
|
|
|
33
33
|
it( 'should call onChange when a day is selected', async () => {
|
|
34
|
-
const user = userEvent.setup( {
|
|
34
|
+
const user = userEvent.setup( {
|
|
35
|
+
advanceTimers: jest.advanceTimersByTime,
|
|
36
|
+
} );
|
|
35
37
|
|
|
36
38
|
const onChange = jest.fn();
|
|
37
39
|
|
|
@@ -50,7 +52,9 @@ describe( 'DatePicker', () => {
|
|
|
50
52
|
} );
|
|
51
53
|
|
|
52
54
|
it( 'should call onMonthPreviewed and onChange when a day in a different month is selected', async () => {
|
|
53
|
-
const user = userEvent.setup( {
|
|
55
|
+
const user = userEvent.setup( {
|
|
56
|
+
advanceTimers: jest.advanceTimersByTime,
|
|
57
|
+
} );
|
|
54
58
|
|
|
55
59
|
const onMonthPreviewed = jest.fn();
|
|
56
60
|
const onChange = jest.fn();
|
|
@@ -17,11 +17,10 @@ import Button from '../../button';
|
|
|
17
17
|
import { default as DatePicker } from '../date';
|
|
18
18
|
import { default as TimePicker } from '../time';
|
|
19
19
|
import type { DateTimePickerProps } from '../types';
|
|
20
|
-
import { CalendarHelp } from './styles';
|
|
20
|
+
import { Wrapper, CalendarHelp } from './styles';
|
|
21
21
|
import { HStack } from '../../h-stack';
|
|
22
22
|
import { Heading } from '../../heading';
|
|
23
23
|
import { Spacer } from '../../spacer';
|
|
24
|
-
import { VStack } from '../../v-stack';
|
|
25
24
|
|
|
26
25
|
export { DatePicker, TimePicker };
|
|
27
26
|
|
|
@@ -64,7 +63,7 @@ function UnforwardedDateTimePicker(
|
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
return (
|
|
67
|
-
<
|
|
66
|
+
<Wrapper ref={ ref } className="components-datetime" spacing={ 4 }>
|
|
68
67
|
{ ! calendarHelpIsVisible && (
|
|
69
68
|
<>
|
|
70
69
|
<TimePicker
|
|
@@ -187,7 +186,7 @@ function UnforwardedDateTimePicker(
|
|
|
187
186
|
) }
|
|
188
187
|
</HStack>
|
|
189
188
|
) }
|
|
190
|
-
</
|
|
189
|
+
</Wrapper>
|
|
191
190
|
);
|
|
192
191
|
}
|
|
193
192
|
|
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import styled from '@emotion/styled';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { VStack } from '../../v-stack';
|
|
10
|
+
|
|
11
|
+
export const Wrapper = styled( VStack )`
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
`;
|
|
14
|
+
|
|
6
15
|
export const CalendarHelp = styled.div`
|
|
7
16
|
min-width: 260px;
|
|
8
17
|
`;
|
package/src/drop-zone/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { includes } from 'lodash';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -60,12 +59,12 @@ export default function DropZoneComponent( {
|
|
|
60
59
|
* From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.
|
|
61
60
|
* The order of the checks is important to recognise the HTML drop.
|
|
62
61
|
*/
|
|
63
|
-
if (
|
|
62
|
+
if ( event.dataTransfer.types.includes( 'text/html' ) ) {
|
|
64
63
|
_type = 'html';
|
|
65
64
|
} else if (
|
|
66
65
|
// Check for the types because sometimes the files themselves
|
|
67
66
|
// are only available on drop.
|
|
68
|
-
|
|
67
|
+
event.dataTransfer.types.includes( 'Files' ) ||
|
|
69
68
|
getFilesFromDataTransfer( event.dataTransfer ).length > 0
|
|
70
69
|
) {
|
|
71
70
|
_type = 'file';
|
|
@@ -7,7 +7,6 @@ import classnames from 'classnames';
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
import { DOWN } from '@wordpress/keycodes';
|
|
11
10
|
import { menu } from '@wordpress/icons';
|
|
12
11
|
|
|
13
12
|
/**
|
|
@@ -87,7 +86,7 @@ function DropdownMenu( dropdownMenuProps ) {
|
|
|
87
86
|
return;
|
|
88
87
|
}
|
|
89
88
|
|
|
90
|
-
if ( ! isOpen && event.
|
|
89
|
+
if ( ! isOpen && event.code === 'ArrowDown' ) {
|
|
91
90
|
event.preventDefault();
|
|
92
91
|
onToggle();
|
|
93
92
|
}
|
|
@@ -6,7 +6,6 @@ import { Platform } from 'react-native';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { DOWN } from '@wordpress/keycodes';
|
|
10
9
|
import { BottomSheet, PanelBody } from '@wordpress/components';
|
|
11
10
|
import { withPreferredColorScheme } from '@wordpress/compose';
|
|
12
11
|
import { menu } from '@wordpress/icons';
|
|
@@ -76,12 +75,6 @@ function DropdownMenu( {
|
|
|
76
75
|
className={ classnames( 'components-dropdown-menu', className ) }
|
|
77
76
|
popoverProps={ mergedPopoverProps }
|
|
78
77
|
renderToggle={ ( { isOpen, onToggle } ) => {
|
|
79
|
-
const openOnArrowDown = ( event ) => {
|
|
80
|
-
if ( ! isOpen && event.keyCode === DOWN ) {
|
|
81
|
-
event.preventDefault();
|
|
82
|
-
onToggle();
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
78
|
const mergedToggleProps = mergeProps(
|
|
86
79
|
{
|
|
87
80
|
className: classnames(
|
|
@@ -104,12 +97,6 @@ function DropdownMenu( {
|
|
|
104
97
|
mergedToggleProps.onClick( event );
|
|
105
98
|
}
|
|
106
99
|
} }
|
|
107
|
-
onKeyDown={ ( event ) => {
|
|
108
|
-
openOnArrowDown( event );
|
|
109
|
-
if ( mergedToggleProps.onKeyDown ) {
|
|
110
|
-
mergedToggleProps.onKeyDown( event );
|
|
111
|
-
}
|
|
112
|
-
} }
|
|
113
100
|
aria-haspopup="true"
|
|
114
101
|
aria-expanded={ isOpen }
|
|
115
102
|
label={ label }
|