@wordpress/components 19.1.2 → 19.2.1-next.33ec3857e2.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 +53 -4
- package/README.md +0 -1
- package/build/angle-picker-control/index.js +2 -0
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/button/index.native.js +13 -3
- 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 +1 -2
- package/build/clipboard-button/index.js.map +1 -1
- package/build/color-palette/index.js +36 -9
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/color-display.js +4 -2
- package/build/color-picker/color-display.js.map +1 -1
- package/build/color-picker/hex-input.js +3 -1
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/input-with-slider.js +3 -1
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/confirm-dialog/component.js +103 -0
- package/build/confirm-dialog/component.js.map +1 -0
- package/build/confirm-dialog/index.js +16 -0
- package/build/confirm-dialog/index.js.map +1 -0
- package/build/confirm-dialog/types.js +6 -0
- package/build/confirm-dialog/types.js.map +1 -0
- package/build/custom-gradient-bar/constants.js +1 -6
- package/build/custom-gradient-bar/constants.js.map +1 -1
- package/build/custom-gradient-bar/control-points.js +52 -21
- package/build/custom-gradient-bar/control-points.js.map +1 -1
- package/build/custom-gradient-bar/index.js +5 -1
- package/build/custom-gradient-bar/index.js.map +1 -1
- package/build/custom-gradient-picker/index.js +4 -1
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/date-time/date.js +63 -86
- package/build/date-time/date.js.map +1 -1
- package/build/date-time/utils.js +32 -0
- package/build/date-time/utils.js.map +1 -0
- package/build/divider/component.js +8 -7
- package/build/divider/component.js.map +1 -1
- package/build/divider/styles.js +38 -13
- package/build/divider/styles.js.map +1 -1
- package/build/drop-zone/index.js +14 -6
- package/build/drop-zone/index.js.map +1 -1
- package/build/drop-zone/provider.js +1 -0
- package/build/drop-zone/provider.js.map +1 -1
- package/build/flyout/styles.js +2 -2
- package/build/flyout/styles.js.map +1 -1
- package/build/focusable-iframe/index.js +1 -0
- package/build/focusable-iframe/index.js.map +1 -1
- package/build/font-size-picker/index.js +10 -9
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/utils.js +28 -17
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/gradient-picker/index.js +3 -1
- package/build/gradient-picker/index.js.map +1 -1
- package/build/higher-order/with-focus-outside/index.js +2 -0
- package/build/higher-order/with-focus-outside/index.js.map +1 -1
- package/build/index.js +8 -0
- package/build/index.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +44 -32
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +10 -3
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js +4 -2
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +7 -6
- 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 +3 -1
- package/build/mobile/gridicons/index.native.js.map +1 -1
- package/build/mobile/link-picker/index.native.js +45 -4
- package/build/mobile/link-picker/index.native.js.map +1 -1
- package/build/mobile/link-settings/index.native.js +10 -0
- package/build/mobile/link-settings/index.native.js.map +1 -1
- package/build/modal/aria-helper.js +2 -0
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +17 -8
- package/build/modal/index.js.map +1 -1
- package/build/palette-edit/index.js +13 -11
- package/build/palette-edit/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +33 -9
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/style-provider/index.js +2 -0
- package/build/style-provider/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +7 -2
- 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 +25 -14
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option/styles.js +8 -8
- package/build/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
- package/build/tools-panel/styles.js +12 -10
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +6 -8
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +48 -17
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +5 -1
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +23 -41
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/z-stack/component.js.map +1 -1
- package/build/z-stack/styles.js +10 -8
- package/build/z-stack/styles.js.map +1 -1
- package/build-module/angle-picker-control/index.js +2 -0
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/button/index.native.js +13 -3
- 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 +1 -2
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/color-palette/index.js +34 -10
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/color-display.js +3 -2
- package/build-module/color-picker/color-display.js.map +1 -1
- package/build-module/color-picker/hex-input.js +2 -1
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +2 -1
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/confirm-dialog/component.js +84 -0
- package/build-module/confirm-dialog/component.js.map +1 -0
- package/build-module/confirm-dialog/index.js +6 -0
- package/build-module/confirm-dialog/index.js.map +1 -0
- package/build-module/confirm-dialog/types.js +2 -0
- package/build-module/confirm-dialog/types.js.map +1 -0
- package/build-module/custom-gradient-bar/constants.js +0 -4
- package/build-module/custom-gradient-bar/constants.js.map +1 -1
- package/build-module/custom-gradient-bar/control-points.js +54 -23
- package/build-module/custom-gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-gradient-bar/index.js +5 -1
- package/build-module/custom-gradient-bar/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +4 -1
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/date-time/date.js +63 -87
- package/build-module/date-time/date.js.map +1 -1
- package/build-module/date-time/utils.js +20 -0
- package/build-module/date-time/utils.js.map +1 -0
- package/build-module/divider/component.js +8 -7
- package/build-module/divider/component.js.map +1 -1
- package/build-module/divider/styles.js +37 -13
- package/build-module/divider/styles.js.map +1 -1
- package/build-module/drop-zone/index.js +14 -6
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/drop-zone/provider.js +1 -0
- package/build-module/drop-zone/provider.js.map +1 -1
- package/build-module/flyout/styles.js +2 -2
- package/build-module/flyout/styles.js.map +1 -1
- package/build-module/focusable-iframe/index.js +1 -0
- package/build-module/focusable-iframe/index.js.map +1 -1
- package/build-module/font-size-picker/index.js +10 -9
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/utils.js +28 -17
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/gradient-picker/index.js +3 -1
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/higher-order/with-focus-outside/index.js +1 -0
- package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +44 -32
- 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 +10 -4
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +4 -2
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +7 -6
- 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 +1 -0
- package/build-module/mobile/gridicons/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +50 -8
- package/build-module/mobile/link-picker/index.native.js.map +1 -1
- package/build-module/mobile/link-settings/index.native.js +10 -0
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/modal/aria-helper.js +2 -0
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +15 -8
- package/build-module/modal/index.js.map +1 -1
- package/build-module/palette-edit/index.js +13 -11
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +33 -9
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/style-provider/index.js +1 -0
- package/build-module/style-provider/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +8 -3
- 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 +25 -14
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option/styles.js +8 -8
- package/build-module/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
- package/build-module/tools-panel/styles.js +12 -11
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +5 -8
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +48 -17
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +5 -1
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +23 -41
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/z-stack/component.js.map +1 -1
- package/build-module/z-stack/styles.js +13 -8
- package/build-module/z-stack/styles.js.map +1 -1
- package/build-style/style-rtl.css +34 -12
- package/build-style/style.css +34 -12
- 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 +8 -7
- package/build-types/divider/component.d.ts.map +1 -1
- package/build-types/divider/styles.d.ts +2 -2
- package/build-types/divider/styles.d.ts.map +1 -1
- package/build-types/divider/types.d.ts +5 -5
- package/build-types/divider/types.d.ts.map +1 -1
- package/build-types/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 +7 -9
- 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 +1 -2
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +2 -1
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/item-group/item/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/toggle-group-control/toggle-group-control-option/styles.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/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +16 -16
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +16 -16
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +2 -1
- package/build-types/tools-panel/types.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 +1 -0
- 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 +21 -23
- package/src/alignment-matrix-control/stories/index.js +1 -1
- package/src/angle-picker-control/index.js +2 -0
- package/src/base-control/stories/index.js +1 -1
- package/src/button/index.native.js +15 -1
- package/src/button/stories/index.js +1 -1
- package/src/button/style.scss +14 -0
- package/src/card/card/README.md +3 -3
- package/src/card/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 +1 -2
- package/src/color-indicator/stories/index.js +1 -1
- package/src/color-indicator/style.scss +5 -8
- package/src/color-palette/index.js +37 -9
- package/src/color-palette/stories/index.js +1 -1
- package/src/color-palette/style.scss +10 -1
- package/src/color-palette/test/__snapshots__/index.js.snap +30 -21
- package/src/color-picker/color-display.tsx +3 -2
- package/src/color-picker/hex-input.tsx +2 -1
- package/src/color-picker/input-with-slider.tsx +2 -1
- package/src/color-picker/stories/index.js +1 -1
- package/src/combobox-control/README.md +2 -2
- package/src/confirm-dialog/README.md +128 -0
- package/src/confirm-dialog/component.tsx +114 -0
- package/src/confirm-dialog/index.tsx +6 -0
- package/src/confirm-dialog/stories/index.js +120 -0
- package/src/confirm-dialog/test/index.js +302 -0
- package/src/confirm-dialog/types.ts +26 -0
- package/src/custom-gradient-bar/constants.js +0 -5
- package/src/custom-gradient-bar/control-points.js +40 -9
- package/src/custom-gradient-bar/index.js +8 -0
- package/src/custom-gradient-picker/index.js +9 -1
- package/src/custom-gradient-picker/style.scss +0 -4
- package/src/date-time/README.md +7 -0
- package/src/date-time/date.js +67 -84
- package/src/date-time/stories/index.js +1 -1
- package/src/date-time/stories/time.js +1 -1
- package/src/date-time/test/date.js +3 -29
- package/src/date-time/test/utils.js +32 -0
- package/src/date-time/utils.js +18 -0
- package/src/dimension-control/README.md +1 -1
- package/src/divider/README.md +33 -5
- package/src/divider/component.tsx +8 -7
- package/src/divider/stories/index.js +43 -17
- package/src/divider/styles.ts +53 -16
- package/src/divider/test/__snapshots__/index.js.snap +11 -11
- package/src/divider/test/index.js +4 -4
- package/src/divider/types.ts +5 -5
- package/src/drop-zone/index.js +14 -6
- package/src/drop-zone/provider.js +1 -0
- package/src/dropdown-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 +4 -2
- package/src/focusable-iframe/index.js +1 -0
- package/src/font-size-picker/index.js +27 -13
- package/src/font-size-picker/stories/index.js +63 -1
- package/src/font-size-picker/test/index.js +87 -0
- package/src/font-size-picker/test/util.js +74 -0
- package/src/font-size-picker/utils.js +31 -17
- package/src/form-token-field/stories/index.js +1 -1
- package/src/gradient-picker/index.js +4 -0
- 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 +2 -0
- package/src/icon/stories/index.js +1 -1
- package/src/index.js +1 -0
- package/src/input-control/stories/index.js +2 -1
- package/src/input-control/styles/input-control-styles.tsx +16 -6
- package/src/input-control/types.ts +3 -1
- package/src/item-group/stories/index.js +84 -2
- package/src/menu-item/README.md +2 -2
- package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +6 -2
- package/src/mobile/color-settings/index.native.js +2 -0
- package/src/mobile/color-settings/palette.screen.native.js +8 -5
- 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 +1 -0
- package/src/mobile/link-picker/index.native.js +41 -7
- package/src/mobile/link-settings/index.native.js +11 -0
- package/src/mobile/link-settings/test/edit.native.js +432 -0
- package/src/modal/README.md +10 -0
- package/src/modal/aria-helper.js +2 -0
- package/src/modal/index.js +72 -55
- package/src/modal/stories/index.js +6 -1
- package/src/modal/style.scss +9 -0
- package/src/modal/test/index.js +11 -0
- package/src/navigation/README.md +0 -9
- package/src/notice/stories/index.js +1 -1
- package/src/number-control/stories/index.js +1 -1
- package/src/palette-edit/index.js +15 -16
- package/src/palette-edit/style.scss +5 -0
- 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 +138 -6
- package/src/radio-group/README.md +4 -1
- 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 +2 -1
- package/src/select-control/styles/select-control-styles.ts +25 -2
- package/src/select-control/types.ts +1 -1
- package/src/slot-fill/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 +2 -0
- 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 +7 -2
- package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +24 -9
- package/src/toggle-group-control/toggle-group-control-option/styles.ts +3 -0
- package/src/toolbar-button/stories/index.js +1 -1
- package/src/tools-panel/stories/index.js +237 -0
- package/src/tools-panel/styles.ts +41 -1
- package/src/tools-panel/test/index.js +234 -1
- package/src/tools-panel/tools-panel/README.md +9 -0
- package/src/tools-panel/tools-panel/component.tsx +2 -5
- package/src/tools-panel/tools-panel/hook.ts +50 -18
- package/src/tools-panel/tools-panel-item/hook.ts +5 -1
- package/src/tools-panel/types.ts +5 -1
- 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 +19 -1
- package/src/unit-control/styles/unit-control-styles.ts +33 -46
- package/src/unit-control/types.ts +5 -2
- 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 +7 -2
- package/tsconfig.json +6 -2
- package/tsconfig.tsbuildinfo +1 -1
package/src/index.js
CHANGED
|
@@ -47,6 +47,7 @@ export {
|
|
|
47
47
|
CompositeItem as __unstableCompositeItem,
|
|
48
48
|
useCompositeState as __unstableUseCompositeState,
|
|
49
49
|
} from './composite';
|
|
50
|
+
export { ConfirmDialog as __experimentalConfirmDialog } from './confirm-dialog';
|
|
50
51
|
export { default as CustomSelectControl } from './custom-select-control';
|
|
51
52
|
export { default as Dashicon } from './dashicon';
|
|
52
53
|
export { default as DateTimePicker, DatePicker, TimePicker } from './date-time';
|
|
@@ -17,7 +17,7 @@ export default {
|
|
|
17
17
|
title: 'Components/InputControl',
|
|
18
18
|
component: InputControl,
|
|
19
19
|
parameters: {
|
|
20
|
-
knobs: {
|
|
20
|
+
knobs: { disable: false },
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -44,6 +44,7 @@ function Example() {
|
|
|
44
44
|
{
|
|
45
45
|
default: 'default',
|
|
46
46
|
small: 'small',
|
|
47
|
+
'__unstable-large': '__unstable-large',
|
|
47
48
|
},
|
|
48
49
|
'default'
|
|
49
50
|
),
|
|
@@ -13,7 +13,7 @@ import type { WordPressComponentProps } from '../../ui/context';
|
|
|
13
13
|
import { Flex, FlexItem } from '../../flex';
|
|
14
14
|
import { Text } from '../../text';
|
|
15
15
|
import { COLORS, rtl } from '../../utils';
|
|
16
|
-
import type { LabelPosition } from '../types';
|
|
16
|
+
import type { LabelPosition, Size } from '../types';
|
|
17
17
|
|
|
18
18
|
type ContainerProps = {
|
|
19
19
|
disabled?: boolean;
|
|
@@ -105,8 +105,6 @@ export const Container = styled.div< ContainerProps >`
|
|
|
105
105
|
${ containerWidthStyles }
|
|
106
106
|
`;
|
|
107
107
|
|
|
108
|
-
type Size = 'default' | 'small';
|
|
109
|
-
|
|
110
108
|
type InputProps = {
|
|
111
109
|
disabled?: boolean;
|
|
112
110
|
inputSize?: Size;
|
|
@@ -126,6 +124,7 @@ const fontSizeStyles = ( { inputSize: size }: InputProps ) => {
|
|
|
126
124
|
const sizes = {
|
|
127
125
|
default: '13px',
|
|
128
126
|
small: '11px',
|
|
127
|
+
'__unstable-large': '13px',
|
|
129
128
|
};
|
|
130
129
|
|
|
131
130
|
const fontSize = sizes[ size as Size ] || sizes.default;
|
|
@@ -148,11 +147,22 @@ const sizeStyles = ( { inputSize: size }: InputProps ) => {
|
|
|
148
147
|
height: 30,
|
|
149
148
|
lineHeight: 1,
|
|
150
149
|
minHeight: 30,
|
|
150
|
+
paddingLeft: 8,
|
|
151
|
+
paddingRight: 8,
|
|
151
152
|
},
|
|
152
153
|
small: {
|
|
153
154
|
height: 24,
|
|
154
155
|
lineHeight: 1,
|
|
155
156
|
minHeight: 24,
|
|
157
|
+
paddingLeft: 8,
|
|
158
|
+
paddingRight: 8,
|
|
159
|
+
},
|
|
160
|
+
'__unstable-large': {
|
|
161
|
+
height: 40,
|
|
162
|
+
lineHeight: 1,
|
|
163
|
+
minHeight: 40,
|
|
164
|
+
paddingLeft: 16,
|
|
165
|
+
paddingRight: 16,
|
|
156
166
|
},
|
|
157
167
|
};
|
|
158
168
|
|
|
@@ -205,8 +215,6 @@ export const Input = styled.input< InputProps >`
|
|
|
205
215
|
display: block;
|
|
206
216
|
margin: 0;
|
|
207
217
|
outline: none;
|
|
208
|
-
padding-left: 8px;
|
|
209
|
-
padding-right: 8px;
|
|
210
218
|
width: 100%;
|
|
211
219
|
|
|
212
220
|
${ dragStyles }
|
|
@@ -315,6 +323,8 @@ export const Prefix = styled.span`
|
|
|
315
323
|
`;
|
|
316
324
|
|
|
317
325
|
export const Suffix = styled.span`
|
|
326
|
+
align-items: center;
|
|
327
|
+
align-self: stretch;
|
|
318
328
|
box-sizing: border-box;
|
|
319
|
-
display:
|
|
329
|
+
display: flex;
|
|
320
330
|
`;
|
|
@@ -23,12 +23,14 @@ export type DragDirection = 'n' | 's' | 'e' | 'w';
|
|
|
23
23
|
|
|
24
24
|
export type DragProps = Parameters< Parameters< typeof useDrag >[ 0 ] >[ 0 ];
|
|
25
25
|
|
|
26
|
+
export type Size = 'default' | 'small' | '__unstable-large';
|
|
27
|
+
|
|
26
28
|
interface BaseProps {
|
|
27
29
|
__unstableInputWidth?: CSSProperties[ 'width' ];
|
|
28
30
|
hideLabelFromVision?: boolean;
|
|
29
31
|
isFocused: boolean;
|
|
30
32
|
labelPosition?: LabelPosition;
|
|
31
|
-
size?:
|
|
33
|
+
size?: Size;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
export type InputChangeCallback<
|
|
@@ -4,15 +4,20 @@
|
|
|
4
4
|
* External dependencies
|
|
5
5
|
*/
|
|
6
6
|
import { boolean, select } from '@storybook/addon-knobs';
|
|
7
|
+
import { css } from '@emotion/react';
|
|
8
|
+
import styled from '@emotion/styled';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* WordPress dependencies
|
|
10
12
|
*/
|
|
11
|
-
import { typography } from '@wordpress/icons';
|
|
13
|
+
import { typography, chevronRight } from '@wordpress/icons';
|
|
14
|
+
import { useMemo } from '@wordpress/element';
|
|
15
|
+
import { isRTL } from '@wordpress/i18n';
|
|
12
16
|
|
|
13
17
|
/**
|
|
14
18
|
* Internal dependencies
|
|
15
19
|
*/
|
|
20
|
+
import { useCx } from '../../utils';
|
|
16
21
|
import { ItemGroup, Item } from '..';
|
|
17
22
|
import Button from '../../button';
|
|
18
23
|
import { FlexItem, FlexBlock } from '../../flex';
|
|
@@ -27,7 +32,7 @@ export default {
|
|
|
27
32
|
component: ItemGroup,
|
|
28
33
|
title: 'Components (Experimental)/ItemGroup',
|
|
29
34
|
parameters: {
|
|
30
|
-
knobs: {
|
|
35
|
+
knobs: { disable: false },
|
|
31
36
|
},
|
|
32
37
|
};
|
|
33
38
|
|
|
@@ -117,6 +122,58 @@ const SimpleColorSwatch = ( { color, style } ) => (
|
|
|
117
122
|
/>
|
|
118
123
|
);
|
|
119
124
|
|
|
125
|
+
const ChevronWrapper = styled( FlexItem )`
|
|
126
|
+
display: block;
|
|
127
|
+
fill: currentColor;
|
|
128
|
+
transition: transform 0.15s ease-out;
|
|
129
|
+
`;
|
|
130
|
+
|
|
131
|
+
const ItemWithChevron = ( {
|
|
132
|
+
children,
|
|
133
|
+
className,
|
|
134
|
+
alwaysVisible,
|
|
135
|
+
...otherProps
|
|
136
|
+
} ) => {
|
|
137
|
+
const isRtlLayout = isRTL();
|
|
138
|
+
const cx = useCx();
|
|
139
|
+
|
|
140
|
+
const appearingChevron = css`
|
|
141
|
+
&:not( :hover ):not( :focus ) ${ ChevronWrapper } {
|
|
142
|
+
display: none;
|
|
143
|
+
}
|
|
144
|
+
`;
|
|
145
|
+
|
|
146
|
+
const itemClassName = useMemo(
|
|
147
|
+
() => cx( ! alwaysVisible && appearingChevron, className ),
|
|
148
|
+
[ alwaysVisible, className ]
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
const chevronIconClassName = useMemo(
|
|
152
|
+
() =>
|
|
153
|
+
cx( css`
|
|
154
|
+
display: block;
|
|
155
|
+
fill: currentColor;
|
|
156
|
+
transform: ${ isRtlLayout ? 'scaleX( -100% )' : 'none' };
|
|
157
|
+
` ),
|
|
158
|
+
[ isRtlLayout ]
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<Item { ...otherProps } className={ itemClassName }>
|
|
163
|
+
<HStack justify="flex-start">
|
|
164
|
+
<FlexBlock>{ children }</FlexBlock>
|
|
165
|
+
<ChevronWrapper>
|
|
166
|
+
<Icon
|
|
167
|
+
className={ chevronIconClassName }
|
|
168
|
+
icon={ chevronRight }
|
|
169
|
+
size={ 24 }
|
|
170
|
+
/>
|
|
171
|
+
</ChevronWrapper>
|
|
172
|
+
</HStack>
|
|
173
|
+
</Item>
|
|
174
|
+
);
|
|
175
|
+
};
|
|
176
|
+
|
|
120
177
|
export const complexLayouts = () => {
|
|
121
178
|
const colors = [
|
|
122
179
|
{
|
|
@@ -177,6 +234,31 @@ export const complexLayouts = () => {
|
|
|
177
234
|
</FlexItem>
|
|
178
235
|
</HStack>
|
|
179
236
|
</Item>
|
|
237
|
+
|
|
238
|
+
<ItemWithChevron onClick={ () => alert( 'Single color setting' ) }>
|
|
239
|
+
<HStack justify="flex-start">
|
|
240
|
+
<SimpleColorSwatch
|
|
241
|
+
color="#2FB63F"
|
|
242
|
+
style={ { flexShrink: 0 } }
|
|
243
|
+
/>
|
|
244
|
+
|
|
245
|
+
<Truncate>Chevron on hover and focus</Truncate>
|
|
246
|
+
</HStack>
|
|
247
|
+
</ItemWithChevron>
|
|
248
|
+
|
|
249
|
+
<ItemWithChevron
|
|
250
|
+
alwaysVisible
|
|
251
|
+
onClick={ () => alert( 'Single color setting' ) }
|
|
252
|
+
>
|
|
253
|
+
<HStack justify="flex-start">
|
|
254
|
+
<SimpleColorSwatch
|
|
255
|
+
color="#D175D0"
|
|
256
|
+
style={ { flexShrink: 0 } }
|
|
257
|
+
/>
|
|
258
|
+
|
|
259
|
+
<Truncate>Chevron always visible</Truncate>
|
|
260
|
+
</HStack>
|
|
261
|
+
</ItemWithChevron>
|
|
180
262
|
</ItemGroup>
|
|
181
263
|
);
|
|
182
264
|
};
|
package/src/menu-item/README.md
CHANGED
|
@@ -67,10 +67,10 @@ Whether or not the menu item is currently selected.
|
|
|
67
67
|
|
|
68
68
|
### `shortcut`
|
|
69
69
|
|
|
70
|
-
- Type: `string`
|
|
70
|
+
- Type: `string` or `object`
|
|
71
71
|
- Required: No
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
If shortcut is a string, it is expecting the display text. If shortcut is an object, it will accept the properties of `display` (string) and `ariaLabel` (string).
|
|
74
74
|
|
|
75
75
|
### `role`
|
|
76
76
|
|
|
@@ -16,16 +16,19 @@ import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
|
16
16
|
import Cell from './cell';
|
|
17
17
|
import cellStyles from './styles.scss';
|
|
18
18
|
import suggestionStyles from './link-suggestion-styles.scss';
|
|
19
|
-
import { posts, pages, empty } from '../gridicons';
|
|
19
|
+
import { posts, pages, empty, clipboard } from '../gridicons';
|
|
20
20
|
|
|
21
21
|
const icons = {
|
|
22
22
|
URL: globe,
|
|
23
|
+
clipboard,
|
|
23
24
|
post: posts,
|
|
24
25
|
page: pages,
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
const getSummaryForType = ( type ) => {
|
|
28
29
|
switch ( type ) {
|
|
30
|
+
case 'clipboard':
|
|
31
|
+
return __( 'From clipboard' );
|
|
29
32
|
case 'mailto':
|
|
30
33
|
return __( 'Add this email link' );
|
|
31
34
|
case 'tel':
|
|
@@ -36,7 +39,7 @@ const getSummaryForType = ( type ) => {
|
|
|
36
39
|
};
|
|
37
40
|
|
|
38
41
|
// we use some Cell styles here with a column flex-direction
|
|
39
|
-
function LinkSuggestionItemCell( { suggestion, onLinkPicked } ) {
|
|
42
|
+
function LinkSuggestionItemCell( { suggestion, onLinkPicked, ...props } ) {
|
|
40
43
|
const { title: contentTitle, url, type, isDirectEntry } = suggestion;
|
|
41
44
|
const title = isDirectEntry ? url : contentTitle;
|
|
42
45
|
const summary = isDirectEntry ? getSummaryForType( type ) : url;
|
|
@@ -58,6 +61,7 @@ function LinkSuggestionItemCell( { suggestion, onLinkPicked } ) {
|
|
|
58
61
|
|
|
59
62
|
return (
|
|
60
63
|
<Cell
|
|
64
|
+
{ ...props }
|
|
61
65
|
icon={ icons[ type ] || empty }
|
|
62
66
|
onPress={ pickLink }
|
|
63
67
|
separatorType={ 'none' }
|
|
@@ -28,6 +28,7 @@ const ColorSettingsMemo = memo(
|
|
|
28
28
|
gradientValue,
|
|
29
29
|
onGradientChange,
|
|
30
30
|
label,
|
|
31
|
+
hideNavigation,
|
|
31
32
|
} ) => {
|
|
32
33
|
useEffect( () => {
|
|
33
34
|
shouldEnableBottomSheetMaxHeight( true );
|
|
@@ -44,6 +45,7 @@ const ColorSettingsMemo = memo(
|
|
|
44
45
|
gradientValue,
|
|
45
46
|
onGradientChange,
|
|
46
47
|
label,
|
|
48
|
+
hideNavigation,
|
|
47
49
|
} }
|
|
48
50
|
>
|
|
49
51
|
<PaletteScreen />
|
|
@@ -26,7 +26,7 @@ import { colorsUtils } from './utils';
|
|
|
26
26
|
|
|
27
27
|
import styles from './style.scss';
|
|
28
28
|
|
|
29
|
-
const HIT_SLOP = { top:
|
|
29
|
+
const HIT_SLOP = { top: 8, bottom: 8, left: 8, right: 8 };
|
|
30
30
|
|
|
31
31
|
const PaletteScreen = () => {
|
|
32
32
|
const route = useRoute();
|
|
@@ -38,6 +38,7 @@ const PaletteScreen = () => {
|
|
|
38
38
|
onGradientChange,
|
|
39
39
|
colorValue,
|
|
40
40
|
defaultSettings,
|
|
41
|
+
hideNavigation = false,
|
|
41
42
|
} = route.params || {};
|
|
42
43
|
const { segments, isGradient } = colorsUtils;
|
|
43
44
|
const [ currentValue, setCurrentValue ] = useState( colorValue );
|
|
@@ -164,10 +165,12 @@ const PaletteScreen = () => {
|
|
|
164
165
|
}
|
|
165
166
|
return (
|
|
166
167
|
<View>
|
|
167
|
-
|
|
168
|
-
<NavBar
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
{ ! hideNavigation && (
|
|
169
|
+
<NavBar>
|
|
170
|
+
<NavBar.BackButton onPress={ navigation.goBack } />
|
|
171
|
+
<NavBar.Heading>{ label } </NavBar.Heading>
|
|
172
|
+
</NavBar>
|
|
173
|
+
) }
|
|
171
174
|
<ColorPalette
|
|
172
175
|
setColor={ setColor }
|
|
173
176
|
activeColor={ currentValue }
|
|
@@ -162,7 +162,7 @@ export function getBlockTypography(
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
if ( blockStyleAttributes?.fontSize ) {
|
|
165
|
+
if ( blockStyleAttributes?.fontSize && baseGlobalStyles ) {
|
|
166
166
|
const mappedFontSize = find( fontSizes, {
|
|
167
167
|
slug: blockStyleAttributes?.fontSize,
|
|
168
168
|
} );
|
|
@@ -9,6 +9,9 @@ const fromPathData24x24 = ( pathData ) => (
|
|
|
9
9
|
</SVG>
|
|
10
10
|
);
|
|
11
11
|
|
|
12
|
+
export const clipboard = fromPathData24x24(
|
|
13
|
+
'M16 18H8v-2h8v2zm0-6H8v2h8v-2zm2-9h-2v2h2v15H6V5h2V3H6a2 2 0 00-2 2v15a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2zm-4 2V4a2 2 0 10-4 0v1a2 2 0 00-2 2v1h8V7a2 2 0 00-2-2z'
|
|
14
|
+
);
|
|
12
15
|
export const posts = fromPathData24x24(
|
|
13
16
|
'M16 19H3v-2h13v2zm5-10H3v2h18V9zM3 5v2h11V5H3zm14 0v2h4V5h-4zm-6 8v2h10v-2H11zm-8 0v2h5v-2H3z'
|
|
14
17
|
);
|
|
@@ -21,15 +24,12 @@ export const refresh = fromPathData24x24(
|
|
|
21
24
|
export const noticeOutline = fromPathData24x24(
|
|
22
25
|
'M12 4c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z'
|
|
23
26
|
);
|
|
24
|
-
|
|
25
27
|
export const empty = (
|
|
26
28
|
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" />
|
|
27
29
|
);
|
|
28
|
-
|
|
29
30
|
export const search = fromPathData24x24(
|
|
30
31
|
'M21,19l-5.154-5.154C16.574,12.742,17,11.421,17,10c0-3.866-3.134-7-7-7s-7,3.134-7,7c0,3.866,3.134,7,7,7 c1.421,0,2.742-0.426,3.846-1.154L19,21L21,19z M5,10c0-2.757,2.243-5,5-5s5,2.243,5,5s-2.243,5-5,5S5,12.757,5,10z'
|
|
31
32
|
);
|
|
32
|
-
|
|
33
33
|
export default {
|
|
34
34
|
empty,
|
|
35
35
|
posts,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { SafeAreaView, TouchableOpacity, View } from 'react-native';
|
|
4
|
+
import { Clipboard, SafeAreaView, TouchableOpacity, View } from 'react-native';
|
|
5
5
|
import { lowerCase, startsWith } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
import { useState } from '@wordpress/element';
|
|
11
|
-
import { __ } from '@wordpress/i18n';
|
|
10
|
+
import { useEffect, useState } from '@wordpress/element';
|
|
11
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
12
12
|
import { BottomSheet, Icon } from '@wordpress/components';
|
|
13
|
-
import { getProtocol, prependHTTP } from '@wordpress/url';
|
|
13
|
+
import { getProtocol, isURL, prependHTTP } from '@wordpress/url';
|
|
14
14
|
import { link, cancelCircleFilled } from '@wordpress/icons';
|
|
15
15
|
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
16
16
|
|
|
@@ -47,12 +47,20 @@ export const createDirectEntry = ( value ) => {
|
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
+
const getURLFromClipboard = async () => {
|
|
51
|
+
const text = await Clipboard.getString();
|
|
52
|
+
return !! text && isURL( text ) ? text : '';
|
|
53
|
+
};
|
|
54
|
+
|
|
50
55
|
export const LinkPicker = ( {
|
|
51
56
|
value: initialValue,
|
|
52
57
|
onLinkPicked,
|
|
53
58
|
onCancel: cancel,
|
|
54
59
|
} ) => {
|
|
55
|
-
const [ value, setValue ] = useState(
|
|
60
|
+
const [ { value, clipboardUrl }, setValue ] = useState( {
|
|
61
|
+
value: initialValue,
|
|
62
|
+
clipboardUrl: '',
|
|
63
|
+
} );
|
|
56
64
|
const directEntry = createDirectEntry( value );
|
|
57
65
|
|
|
58
66
|
// the title of a direct entry is displayed as the raw input value, but if we
|
|
@@ -66,7 +74,7 @@ export const LinkPicker = ( {
|
|
|
66
74
|
};
|
|
67
75
|
|
|
68
76
|
const clear = () => {
|
|
69
|
-
setValue( '' );
|
|
77
|
+
setValue( { value: '', clipboardUrl } );
|
|
70
78
|
};
|
|
71
79
|
|
|
72
80
|
const omniCellStyle = usePreferredColorSchemeStyle(
|
|
@@ -79,6 +87,14 @@ export const LinkPicker = ( {
|
|
|
79
87
|
styles.iconDark
|
|
80
88
|
);
|
|
81
89
|
|
|
90
|
+
useEffect( () => {
|
|
91
|
+
getURLFromClipboard()
|
|
92
|
+
.then( ( url ) => setValue( { value, clipboardUrl: url } ) )
|
|
93
|
+
.catch( () => setValue( { value, clipboardUrl: '' } ) );
|
|
94
|
+
}, [] );
|
|
95
|
+
|
|
96
|
+
// TODO: Localize the accessibility label.
|
|
97
|
+
// TODO: Decide on if `LinkSuggestionItemCell` with `isDirectEntry` makes sense.
|
|
82
98
|
return (
|
|
83
99
|
<SafeAreaView style={ styles.safeArea }>
|
|
84
100
|
<NavBar>
|
|
@@ -96,7 +112,9 @@ export const LinkPicker = ( {
|
|
|
96
112
|
autoCapitalize="none"
|
|
97
113
|
autoCorrect={ false }
|
|
98
114
|
keyboardType="url"
|
|
99
|
-
onChangeValue={
|
|
115
|
+
onChangeValue={ ( newValue ) => {
|
|
116
|
+
setValue( { value: newValue, clipboardUrl } );
|
|
117
|
+
} }
|
|
100
118
|
onSubmit={ onSubmit }
|
|
101
119
|
/* eslint-disable-next-line jsx-a11y/no-autofocus */
|
|
102
120
|
autoFocus
|
|
@@ -115,6 +133,22 @@ export const LinkPicker = ( {
|
|
|
115
133
|
</TouchableOpacity>
|
|
116
134
|
) }
|
|
117
135
|
</BottomSheet.Cell>
|
|
136
|
+
{ !! clipboardUrl && clipboardUrl !== value && (
|
|
137
|
+
<BottomSheet.LinkSuggestionItemCell
|
|
138
|
+
accessible
|
|
139
|
+
accessibilityLabel={ sprintf(
|
|
140
|
+
/* translators: Copy URL from the clipboard, https://sample.url */
|
|
141
|
+
__( 'Copy URL from the clipboard, %s' ),
|
|
142
|
+
clipboardUrl
|
|
143
|
+
) }
|
|
144
|
+
suggestion={ {
|
|
145
|
+
type: 'clipboard',
|
|
146
|
+
url: clipboardUrl,
|
|
147
|
+
isDirectEntry: true,
|
|
148
|
+
} }
|
|
149
|
+
onLinkPicked={ pickLink }
|
|
150
|
+
/>
|
|
151
|
+
) }
|
|
118
152
|
{ !! value && (
|
|
119
153
|
<LinkPickerResults
|
|
120
154
|
query={ value }
|
|
@@ -93,6 +93,7 @@ function LinkSettings( {
|
|
|
93
93
|
const [ urlInputValue, setUrlInputValue ] = useState( '' );
|
|
94
94
|
const [ labelInputValue, setLabelInputValue ] = useState( '' );
|
|
95
95
|
const [ linkRelInputValue, setLinkRelInputValue ] = useState( '' );
|
|
96
|
+
const onCloseSettingsSheetConsumed = useRef( false );
|
|
96
97
|
const prevEditorSidebarOpenedRef = useRef();
|
|
97
98
|
|
|
98
99
|
const { onHandleClosingBottomSheet } = useContext( BottomSheetContext );
|
|
@@ -123,6 +124,10 @@ function LinkSettings( {
|
|
|
123
124
|
|
|
124
125
|
useEffect( () => {
|
|
125
126
|
const isSettingSheetOpen = isVisible || editorSidebarOpened;
|
|
127
|
+
if ( isSettingSheetOpen ) {
|
|
128
|
+
onCloseSettingsSheetConsumed.current = false;
|
|
129
|
+
}
|
|
130
|
+
|
|
126
131
|
if ( options.url.autoFill && isSettingSheetOpen && ! url ) {
|
|
127
132
|
getURLFromClipboard();
|
|
128
133
|
}
|
|
@@ -174,6 +179,12 @@ function LinkSettings( {
|
|
|
174
179
|
}, [ urlInputValue, labelInputValue, linkRelInputValue, setAttributes ] );
|
|
175
180
|
|
|
176
181
|
const onCloseSettingsSheet = useCallback( () => {
|
|
182
|
+
if ( onCloseSettingsSheetConsumed.current ) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
onCloseSettingsSheetConsumed.current = true;
|
|
187
|
+
|
|
177
188
|
onSetAttributes();
|
|
178
189
|
|
|
179
190
|
if ( onClose ) {
|