@wordpress/components 19.4.0 → 19.5.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 +16 -1
- package/CONTRIBUTING.md +69 -2
- package/build/box-control/unit-control.js +2 -2
- package/build/box-control/unit-control.js.map +1 -1
- package/build/card/card/component.js +2 -2
- package/build/card/card/component.js.map +1 -1
- package/build/card/card-body/component.js +1 -1
- package/build/card/card-body/component.js.map +1 -1
- package/build/card/card-divider/component.js +1 -1
- package/build/card/card-divider/component.js.map +1 -1
- package/build/card/card-footer/component.js +1 -1
- package/build/card/card-footer/component.js.map +1 -1
- package/build/card/card-header/component.js +1 -1
- package/build/card/card-header/component.js.map +1 -1
- package/build/card/card-media/component.js +1 -1
- package/build/card/card-media/component.js.map +1 -1
- package/build/color-palette/index.native.js +35 -30
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/hex-input.js +6 -9
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/confirm-dialog/component.js.map +1 -1
- package/build/divider/component.js.map +1 -1
- package/build/elevation/component.js +1 -1
- package/build/elevation/component.js.map +1 -1
- package/build/flex/flex/component.js +1 -1
- package/build/flex/flex/component.js.map +1 -1
- package/build/flex/flex-block/component.js +1 -1
- package/build/flex/flex-block/component.js.map +1 -1
- package/build/flex/flex-item/component.js +1 -1
- package/build/flex/flex-item/component.js.map +1 -1
- package/build/flyout/flyout/component.js +1 -1
- package/build/flyout/flyout/component.js.map +1 -1
- package/build/flyout/flyout-content/component.js +1 -1
- package/build/flyout/flyout-content/component.js.map +1 -1
- package/build/focal-point-picker/index.js +18 -12
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/font-size-picker/index.js +0 -1
- package/build/font-size-picker/index.js.map +1 -1
- package/build/grid/component.js +1 -1
- package/build/grid/component.js.map +1 -1
- package/build/h-stack/component.js +1 -1
- package/build/h-stack/component.js.map +1 -1
- package/build/heading/component.js.map +1 -1
- package/build/index.js +12 -0
- package/build/index.js.map +1 -1
- package/build/index.native.js +15 -1
- package/build/index.native.js.map +1 -1
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/input-field.js +7 -7
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/reducer/reducer.js +3 -0
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/item-group/item/component.js.map +1 -1
- package/build/item-group/item-group/component.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +26 -9
- package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build/mobile/global-styles-context/utils.native.js +63 -9
- package/build/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build/mobile/inserter-button/index.native.js +3 -3
- package/build/mobile/inserter-button/index.native.js.map +1 -1
- package/build/mobile/inserter-button/sparkles.js +25 -0
- package/build/mobile/inserter-button/sparkles.js.map +1 -0
- package/build/navigator/index.js +16 -0
- package/build/navigator/index.js.map +1 -1
- package/build/navigator/navigator-back-button/component.js +72 -0
- package/build/navigator/navigator-back-button/component.js.map +1 -0
- package/build/navigator/navigator-back-button/hook.js +49 -0
- package/build/navigator/navigator-back-button/hook.js.map +1 -0
- package/build/navigator/navigator-back-button/index.js +16 -0
- package/build/navigator/navigator-back-button/index.js.map +1 -0
- package/build/navigator/navigator-button/component.js +71 -0
- package/build/navigator/navigator-button/component.js.map +1 -0
- package/build/navigator/navigator-button/hook.js +59 -0
- package/build/navigator/navigator-button/hook.js.map +1 -0
- package/build/navigator/navigator-button/index.js +16 -0
- package/build/navigator/navigator-button/index.js.map +1 -0
- package/build/navigator/navigator-provider/component.js +11 -21
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +14 -22
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/resizable-box/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build/scrollable/component.js +1 -1
- package/build/scrollable/component.js.map +1 -1
- package/build/select-control/index.js.map +1 -1
- package/build/spacer/component.js.map +1 -1
- package/build/surface/component.js +1 -1
- package/build/surface/component.js.map +1 -1
- package/build/text/component.js +1 -1
- package/build/text/component.js.map +1 -1
- package/build/text-control/index.js +2 -2
- package/build/text-control/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build/tree-grid/index.js +50 -6
- package/build/tree-grid/index.js.map +1 -1
- package/build/truncate/component.js +1 -1
- package/build/truncate/component.js.map +1 -1
- package/build/ui/control-group/component.js +1 -1
- package/build/ui/control-group/component.js.map +1 -1
- package/build/ui/control-label/component.js +1 -1
- package/build/ui/control-label/component.js.map +1 -1
- package/build/ui/form-group/form-group.js +1 -1
- package/build/ui/form-group/form-group.js.map +1 -1
- package/build/ui/shortcut/component.js.map +1 -1
- package/build/ui/spinner/component.js +1 -1
- package/build/ui/spinner/component.js.map +1 -1
- package/build/ui/tooltip/component.js +1 -1
- package/build/ui/tooltip/component.js.map +1 -1
- package/build/ui/tooltip/content.js +1 -1
- package/build/ui/tooltip/content.js.map +1 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/v-stack/component.js +1 -1
- package/build/v-stack/component.js.map +1 -1
- package/build/visually-hidden/component.js +1 -1
- package/build/visually-hidden/component.js.map +1 -1
- package/build/z-stack/component.js.map +1 -1
- package/build-module/box-control/unit-control.js +1 -1
- package/build-module/box-control/unit-control.js.map +1 -1
- package/build-module/card/card/component.js +2 -2
- package/build-module/card/card/component.js.map +1 -1
- package/build-module/card/card-body/component.js +1 -1
- package/build-module/card/card-body/component.js.map +1 -1
- package/build-module/card/card-divider/component.js +1 -1
- package/build-module/card/card-divider/component.js.map +1 -1
- package/build-module/card/card-footer/component.js +1 -1
- package/build-module/card/card-footer/component.js.map +1 -1
- package/build-module/card/card-header/component.js +1 -1
- package/build-module/card/card-header/component.js.map +1 -1
- package/build-module/card/card-media/component.js +1 -1
- package/build-module/card/card-media/component.js.map +1 -1
- package/build-module/color-palette/index.native.js +36 -31
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/hex-input.js +6 -9
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/divider/component.js.map +1 -1
- package/build-module/elevation/component.js +1 -1
- package/build-module/elevation/component.js.map +1 -1
- package/build-module/flex/flex/component.js +1 -1
- package/build-module/flex/flex/component.js.map +1 -1
- package/build-module/flex/flex-block/component.js +1 -1
- package/build-module/flex/flex-block/component.js.map +1 -1
- package/build-module/flex/flex-item/component.js +1 -1
- package/build-module/flex/flex-item/component.js.map +1 -1
- package/build-module/flyout/flyout/component.js +1 -1
- package/build-module/flyout/flyout/component.js.map +1 -1
- package/build-module/flyout/flyout-content/component.js +1 -1
- package/build-module/flyout/flyout-content/component.js.map +1 -1
- package/build-module/focal-point-picker/index.js +18 -12
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/font-size-picker/index.js +0 -1
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/grid/component.js +1 -1
- package/build-module/grid/component.js.map +1 -1
- package/build-module/h-stack/component.js +1 -1
- package/build-module/h-stack/component.js.map +1 -1
- package/build-module/heading/component.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/input-field.js +6 -6
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js +3 -0
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/item-group/item/component.js.map +1 -1
- package/build-module/item-group/item-group/component.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +27 -10
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +60 -10
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/mobile/inserter-button/index.native.js +1 -1
- package/build-module/mobile/inserter-button/index.native.js.map +1 -1
- package/build-module/mobile/inserter-button/sparkles.js +16 -0
- package/build-module/mobile/inserter-button/sparkles.js.map +1 -0
- package/build-module/navigator/index.js +2 -0
- package/build-module/navigator/index.js.map +1 -1
- package/build-module/navigator/navigator-back-button/component.js +59 -0
- package/build-module/navigator/navigator-back-button/component.js.map +1 -0
- package/build-module/navigator/navigator-back-button/hook.js +36 -0
- package/build-module/navigator/navigator-back-button/hook.js.map +1 -0
- package/build-module/navigator/navigator-back-button/index.js +2 -0
- package/build-module/navigator/navigator-back-button/index.js.map +1 -0
- package/build-module/navigator/navigator-button/component.js +58 -0
- package/build-module/navigator/navigator-button/component.js.map +1 -0
- package/build-module/navigator/navigator-button/hook.js +46 -0
- package/build-module/navigator/navigator-button/hook.js.map +1 -0
- package/build-module/navigator/navigator-button/index.js +2 -0
- package/build-module/navigator/navigator-button/index.js.map +1 -0
- package/build-module/navigator/navigator-provider/component.js +11 -21
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +13 -22
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build-module/scrollable/component.js +1 -1
- package/build-module/scrollable/component.js.map +1 -1
- package/build-module/select-control/index.js +1 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/spacer/component.js.map +1 -1
- package/build-module/surface/component.js +1 -1
- package/build-module/surface/component.js.map +1 -1
- package/build-module/text/component.js +1 -1
- package/build-module/text/component.js.map +1 -1
- package/build-module/text-control/index.js +2 -2
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build-module/tree-grid/index.js +51 -7
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/truncate/component.js +1 -1
- package/build-module/truncate/component.js.map +1 -1
- package/build-module/ui/control-group/component.js +1 -1
- package/build-module/ui/control-group/component.js.map +1 -1
- package/build-module/ui/control-label/component.js +1 -1
- package/build-module/ui/control-label/component.js.map +1 -1
- package/build-module/ui/form-group/form-group.js +1 -1
- package/build-module/ui/form-group/form-group.js.map +1 -1
- package/build-module/ui/shortcut/component.js.map +1 -1
- package/build-module/ui/spinner/component.js +1 -1
- package/build-module/ui/spinner/component.js.map +1 -1
- package/build-module/ui/tooltip/component.js +1 -1
- package/build-module/ui/tooltip/component.js.map +1 -1
- package/build-module/ui/tooltip/content.js +1 -1
- package/build-module/ui/tooltip/content.js.map +1 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/v-stack/component.js +1 -1
- package/build-module/v-stack/component.js.map +1 -1
- package/build-module/visually-hidden/component.js +1 -1
- package/build-module/visually-hidden/component.js.map +1 -1
- package/build-module/z-stack/component.js.map +1 -1
- package/build-types/card/card-divider/hook.d.ts +0 -1
- package/build-types/card/card-divider/hook.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +2 -4
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/confirm-dialog/component.d.ts +2 -6
- package/build-types/confirm-dialog/component.d.ts.map +1 -1
- package/build-types/flyout/flyout/hook.d.ts +0 -1
- package/build-types/flyout/flyout/hook.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts +3 -3
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-base.d.ts +2 -2
- package/build-types/input-control/input-base.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts +1 -3
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +1 -1
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/navigator/index.d.ts +2 -0
- package/build-types/navigator/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +38 -0
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -0
- package/build-types/navigator/navigator-back-button/hook.d.ts +282 -0
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -0
- package/build-types/navigator/navigator-back-button/index.d.ts +2 -0
- package/build-types/navigator/navigator-back-button/index.d.ts.map +1 -0
- package/build-types/navigator/navigator-button/component.d.ts +37 -0
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -0
- package/build-types/navigator/navigator-button/hook.d.ts +282 -0
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -0
- package/build-types/navigator/navigator-button/index.d.ts +2 -0
- package/build-types/navigator/navigator-button/index.d.ts.map +1 -0
- package/build-types/navigator/navigator-provider/component.d.ts +10 -20
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +10 -20
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/types.d.ts +21 -0
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/resizable-box/index.d.ts +2 -2
- package/build-types/resizable-box/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +1 -3
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/ui/context/wordpress-component.d.ts +2 -6
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +1 -3
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/z-stack/component.d.ts.map +1 -1
- package/package.json +8 -7
- package/src/alignment-matrix-control/README.md +4 -0
- package/src/alignment-matrix-control/stories/index.js +1 -1
- package/src/base-control/stories/index.js +65 -22
- package/src/box-control/stories/index.js +4 -1
- package/src/box-control/unit-control.js +1 -1
- package/src/card/card/component.js +1 -1
- package/src/card/card-body/component.js +1 -1
- package/src/card/card-divider/component.js +1 -1
- package/src/card/card-footer/component.js +1 -1
- package/src/card/card-header/component.js +1 -1
- package/src/card/card-media/component.js +1 -1
- package/src/color-palette/index.native.js +92 -75
- package/src/color-palette/style.native.scss +10 -5
- package/src/color-picker/component.tsx +2 -2
- package/src/color-picker/hex-input.tsx +9 -9
- package/src/confirm-dialog/component.tsx +2 -2
- package/src/divider/component.tsx +2 -2
- package/src/elevation/component.js +1 -1
- package/src/flex/flex/component.js +1 -1
- package/src/flex/flex-block/component.js +1 -1
- package/src/flex/flex-item/component.js +1 -1
- package/src/flyout/flyout/component.js +1 -1
- package/src/flyout/flyout-content/component.js +1 -1
- package/src/focal-point-picker/README.md +7 -0
- package/src/focal-point-picker/index.js +12 -7
- package/src/focal-point-picker/stories/index.js +30 -0
- package/src/focal-point-picker/test/index.js +44 -0
- package/src/font-size-picker/index.js +0 -1
- package/src/form-file-upload/README.md +1 -1
- package/src/form-file-upload/stories/index.js +51 -0
- package/src/grid/component.js +1 -1
- package/src/h-stack/component.js +1 -1
- package/src/heading/component.tsx +2 -2
- package/src/index.js +2 -0
- package/src/index.native.js +5 -1
- package/src/input-control/index.tsx +2 -2
- package/src/input-control/input-base.tsx +2 -2
- package/src/input-control/input-field.tsx +4 -6
- package/src/input-control/reducer/reducer.ts +3 -0
- package/src/input-control/stories/index.js +1 -1
- package/src/input-control/types.ts +1 -1
- package/src/item-group/item/component.tsx +2 -2
- package/src/item-group/item-group/component.tsx +2 -2
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +10 -1
- package/src/mobile/color-settings/palette.screen.native.js +39 -9
- package/src/mobile/color-settings/style.native.scss +4 -0
- package/src/mobile/global-styles-context/test/fixtures/theme.native.js +27 -0
- package/src/mobile/global-styles-context/test/utils.native.js +2 -2
- package/src/mobile/global-styles-context/utils.native.js +75 -6
- package/src/mobile/inserter-button/index.native.js +1 -2
- package/src/mobile/inserter-button/sparkles.js +15 -0
- package/src/navigation/stories/index.js +1 -1
- package/src/navigator/index.ts +2 -0
- package/src/navigator/navigator-back-button/README.md +31 -0
- package/src/navigator/navigator-back-button/component.tsx +62 -0
- package/src/navigator/navigator-back-button/hook.ts +40 -0
- package/src/navigator/navigator-back-button/index.ts +1 -0
- package/src/navigator/navigator-button/README.md +38 -0
- package/src/navigator/navigator-button/component.tsx +61 -0
- package/src/navigator/navigator-button/hook.ts +55 -0
- package/src/navigator/navigator-button/index.ts +1 -0
- package/src/navigator/navigator-provider/README.md +20 -33
- package/src/navigator/navigator-provider/component.tsx +12 -22
- package/src/navigator/navigator-screen/README.md +1 -1
- package/src/navigator/navigator-screen/component.tsx +14 -23
- package/src/navigator/stories/index.js +24 -37
- package/src/navigator/test/index.js +89 -34
- package/src/navigator/types.ts +26 -0
- package/src/number-control/stories/index.js +1 -1
- package/src/radio/stories/index.js +1 -1
- package/src/radio-group/stories/index.js +4 -1
- package/src/resizable-box/index.tsx +2 -2
- package/src/resizable-box/resize-tooltip/index.tsx +2 -2
- package/src/resizable-box/resize-tooltip/label.tsx +2 -2
- package/src/scrollable/component.js +1 -1
- package/src/select-control/index.tsx +2 -3
- package/src/spacer/component.tsx +2 -2
- package/src/surface/component.js +1 -1
- package/src/text/component.js +1 -1
- package/src/text-control/index.js +2 -2
- package/src/toggle-group-control/stories/index.js +1 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +2 -2
- package/src/toggle-group-control/toggle-group-control-option/component.tsx +2 -2
- package/src/tools-panel/stories/index.js +0 -1
- package/src/tools-panel/tools-panel/component.tsx +2 -2
- package/src/tools-panel/tools-panel-header/component.tsx +2 -2
- package/src/tools-panel/tools-panel-item/component.tsx +2 -2
- package/src/tree-grid/README.md +24 -1
- package/src/tree-grid/index.js +66 -7
- package/src/tree-grid/stories/index.js +4 -1
- package/src/tree-grid/test/__snapshots__/index.js.snap +1 -14
- package/src/tree-grid/test/index.js +226 -7
- package/src/truncate/component.js +1 -1
- package/src/ui/context/wordpress-component.ts +2 -2
- package/src/ui/control-group/component.js +1 -1
- package/src/ui/control-label/component.js +1 -1
- package/src/ui/form-group/form-group.js +1 -1
- package/src/ui/shortcut/component.tsx +2 -2
- package/src/ui/spinner/component.js +1 -1
- package/src/ui/tooltip/component.js +1 -1
- package/src/ui/tooltip/content.js +1 -1
- package/src/unit-control/index.tsx +2 -2
- package/src/unit-control/stories/index.js +1 -1
- package/src/v-stack/component.js +1 -1
- package/src/visually-hidden/component.js +1 -1
- package/src/z-stack/component.tsx +2 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/src/tools-panel/stories/typography-panel.js +0 -215
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/spacer/component.tsx"],"names":["Spacer","props","forwardedRef","spacerProps","ConnectedSpacer"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAMA,SAASA,MAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,WAAW,GAAG,qBAAWF,KAAX,CAApB;AAEA,SAAO,4BAAC,UAAD,6BAAWE,WAAX;AAAyB,IAAA,GAAG,EAAGD;AAA/B,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,eAAe,GAAG,6BAAgBJ,MAAhB,EAAwB,QAAxB,CAAxB;eAEeI,e","sourcesContent":["/**\n * External dependencies\n */\nimport type {
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/spacer/component.tsx"],"names":["Spacer","props","forwardedRef","spacerProps","ConnectedSpacer"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAMA,SAASA,MAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,WAAW,GAAG,qBAAWF,KAAX,CAApB;AAEA,SAAO,4BAAC,UAAD,6BAAWE,WAAX;AAAyB,IAAA,GAAG,EAAGD;AAA/B,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,eAAe,GAAG,6BAAgBJ,MAAhB,EAAwB,QAAxB,CAAxB;eAEeI,e","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, WordPressComponentProps } from '../ui/context';\nimport { View } from '../view';\nimport { useSpacer } from './hook';\nimport type { Props } from './types';\n\nfunction Spacer(\n\tprops: WordPressComponentProps< Props, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst spacerProps = useSpacer( props );\n\n\treturn <View { ...spacerProps } ref={ forwardedRef } />;\n}\n\n/**\n * `Spacer` is a primitive layout component that providers inner (`padding`) or outer (`margin`) space in-between components. It can also be used to adaptively provide space within an `HStack` or `VStack`.\n *\n * `Spacer` comes with a bunch of shorthand props to adjust `margin` and `padding`. The values of these props work as a multiplier to the library's grid system (base of `4px`).\n *\n * @example\n * ```jsx\n * import { Spacer } from `@wordpress/components`\n *\n * function Example() {\n * return (\n * <View>\n * <Spacer>\n * <Heading>WordPress.org</Heading>\n * </Spacer>\n * <Text>\n * Code is Poetry\n * </Text>\n * </View>\n * );\n * }\n * ```\n */\nconst ConnectedSpacer = contextConnect( Spacer, 'Spacer' );\n\nexport default ConnectedSpacer;\n"]}
|
|
@@ -23,7 +23,7 @@ var _hook = require("./hook");
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'div'>} props
|
|
26
|
-
* @param {import('react').
|
|
26
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
27
27
|
*/
|
|
28
28
|
function Surface(props, forwardedRef) {
|
|
29
29
|
const surfaceProps = (0, _hook.useSurface)(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/surface/component.js"],"names":["Surface","props","forwardedRef","surfaceProps","ConnectedSurface"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,OAAT,CAAkBC,KAAlB,EAAyBC,YAAzB,EAAwC;AACvC,QAAMC,YAAY,GAAG,sBAAYF,KAAZ,CAArB;AAEA,SAAO,4BAAC,UAAD,6BAAWE,YAAX;AAA0B,IAAA,GAAG,EAAGD;AAAhC,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,gBAAgB,GAAG,6BAAgBJ,OAAhB,EAAyB,SAAzB,CAAzB;eAEeI,gB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../ui/context';\nimport { View } from '../view';\nimport { useSurface } from './hook';\n\n/**\n * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'div'>} props\n * @param {import('react').
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/surface/component.js"],"names":["Surface","props","forwardedRef","surfaceProps","ConnectedSurface"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,OAAT,CAAkBC,KAAlB,EAAyBC,YAAzB,EAAwC;AACvC,QAAMC,YAAY,GAAG,sBAAYF,KAAZ,CAArB;AAEA,SAAO,4BAAC,UAAD,6BAAWE,YAAX;AAA0B,IAAA,GAAG,EAAGD;AAAhC,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,gBAAgB,GAAG,6BAAgBJ,OAAhB,EAAyB,SAAzB,CAAzB;eAEeI,gB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../ui/context';\nimport { View } from '../view';\nimport { useSurface } from './hook';\n\n/**\n * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'div'>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction Surface( props, forwardedRef ) {\n\tconst surfaceProps = useSurface( props );\n\n\treturn <View { ...surfaceProps } ref={ forwardedRef } />;\n}\n\n/**\n * `Surface` is a core component that renders a primary background color.\n *\n * In the example below, notice how the `Surface` renders in white (or dark gray if in dark mode).\n *\n * ```jsx\n * import {\n *\t__experimentalSurface as Surface,\n *\t__experimentalText as Text,\n * } from '@wordpress/components';\n *\n * function Example() {\n * \treturn (\n * \t\t<Surface>\n * \t\t\t<Text>Code is Poetry</Text>\n * \t\t</Surface>\n * \t);\n * }\n * ```\n */\nconst ConnectedSurface = contextConnect( Surface, 'Surface' );\n\nexport default ConnectedSurface;\n"]}
|
package/build/text/component.js
CHANGED
|
@@ -23,7 +23,7 @@ var _hook = _interopRequireDefault(require("./hook"));
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props
|
|
26
|
-
* @param {import('react').
|
|
26
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
27
27
|
*/
|
|
28
28
|
function Text(props, forwardedRef) {
|
|
29
29
|
const textProps = (0, _hook.default)(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/text/component.js"],"names":["Text","props","forwardedRef","textProps","ConnectedText"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,IAAT,CAAeC,KAAf,EAAsBC,YAAtB,EAAqC;AACpC,QAAMC,SAAS,GAAG,mBAASF,KAAT,CAAlB;AAEA,SAAO,4BAAC,UAAD;AAAM,IAAA,EAAE,EAAC;AAAT,KAAqBE,SAArB;AAAiC,IAAA,GAAG,EAAGD;AAAvC,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,aAAa,GAAG,6BAAgBJ,IAAhB,EAAsB,MAAtB,CAAtB;eAEeI,a","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../ui/context';\nimport { View } from '../view';\nimport useText from './hook';\n\n/**\n * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props\n * @param {import('react').
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/text/component.js"],"names":["Text","props","forwardedRef","textProps","ConnectedText"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,IAAT,CAAeC,KAAf,EAAsBC,YAAtB,EAAqC;AACpC,QAAMC,SAAS,GAAG,mBAASF,KAAT,CAAlB;AAEA,SAAO,4BAAC,UAAD;AAAM,IAAA,EAAE,EAAC;AAAT,KAAqBE,SAArB;AAAiC,IAAA,GAAG,EAAGD;AAAvC,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,aAAa,GAAG,6BAAgBJ,IAAhB,EAAsB,MAAtB,CAAtB;eAEeI,a","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../ui/context';\nimport { View } from '../view';\nimport useText from './hook';\n\n/**\n * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction Text( props, forwardedRef ) {\n\tconst textProps = useText( props );\n\n\treturn <View as=\"span\" { ...textProps } ref={ forwardedRef } />;\n}\n\n/**\n * `Text` is a core component that renders text in the library, using the\n * library's typography system.\n *\n * `Text` can be used to render any text-content, like an HTML `p` or `span`.\n *\n * @example\n *\n * ```jsx\n * import { __experimentalText as Text } from `@wordpress/components`;\n *\n * function Example() {\n * \treturn <Text>Code is Poetry</Text>;\n * }\n * ```\n */\nconst ConnectedText = contextConnect( Text, 'Text' );\n\nexport default ConnectedText;\n"]}
|
|
@@ -38,8 +38,8 @@ var _baseControl = _interopRequireDefault(require("../base-control"));
|
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
*
|
|
41
|
-
* @param {Props}
|
|
42
|
-
* @param {import('react').
|
|
41
|
+
* @param {Props} props Props
|
|
42
|
+
* @param {import('react').ForwardedRef<HTMLInputElement>} ref
|
|
43
43
|
*/
|
|
44
44
|
function TextControl(_ref, ref) {
|
|
45
45
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/text-control/index.js"],"names":["TextControl","ref","label","hideLabelFromVision","value","help","className","onChange","type","props","instanceId","id","onChangeValue","event","target","undefined"],"mappings":";;;;;;;;;AAIA;;;;AADA;;AAMA;;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAT,OAWCC,GAXD,EAYE;AAAA,MAXD;AACCC,IAAAA,KADD;AAECC,IAAAA,mBAFD;AAGCC,IAAAA,KAHD;AAICC,IAAAA,IAJD;AAKCC,IAAAA,SALD;AAMCC,IAAAA,QAND;AAOCC,IAAAA,IAAI,GAAG,MAPR;AAQC,OAAGC;AARJ,GAWC;AACD,QAAMC,UAAU,GAAG,4BAAeV,WAAf,CAAnB;AACA,QAAMW,EAAE,GAAI,0BAA0BD,UAAY,EAAlD;;AACA,QAAME,aAAa,GAAG;AACrB;AACAC,EAAAA,KAFqB,KAGjBN,QAAQ,CAAEM,KAAK,CAACC,MAAN,CAAaV,KAAf,CAHb;;AAKA,SACC,4BAAC,oBAAD;AACC,IAAA,KAAK,EAAGF,KADT;AAEC,IAAA,mBAAmB,EAAGC,mBAFvB;AAGC,IAAA,EAAE,EAAGQ,EAHN;AAIC,IAAA,IAAI,EAAGN,IAJR;AAKC,IAAA,SAAS,EAAGC;AALb,KAOC;AACC,IAAA,SAAS,EAAC,gCADX;AAEC,IAAA,IAAI,EAAGE,IAFR;AAGC,IAAA,EAAE,EAAGG,EAHN;AAIC,IAAA,KAAK,EAAGP,KAJT;AAKC,IAAA,QAAQ,EAAGQ,aALZ;AAMC,wBAAmB,CAAC,CAAEP,IAAH,GAAUM,EAAE,GAAG,QAAf,GAA0BI,SAN9C;AAOC,IAAA,GAAG,EAAGd;AAPP,KAQMQ,KARN,EAPD,CADD;AAoBA;;eAEc,yBAAYT,WAAZ,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\n\n/**\n * @typedef OwnProps\n * @property {string} label Label for the control.\n * @property {boolean} [hideLabelFromVision] Whether to accessibly hide the label.\n * @property {string} value Value of the input.\n * @property {string} [help] Optional help text for the control.\n * @property {string} [className] Classname passed to BaseControl wrapper\n * @property {(value: string) => void} onChange Handle changes.\n * @property {string} [type='text'] Type of the input.\n */\n\n/** @typedef {OwnProps & import('react').ComponentProps<'input'>} Props */\n\n/**\n *\n * @param {Props}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/text-control/index.js"],"names":["TextControl","ref","label","hideLabelFromVision","value","help","className","onChange","type","props","instanceId","id","onChangeValue","event","target","undefined"],"mappings":";;;;;;;;;AAIA;;;;AADA;;AAMA;;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAT,OAWCC,GAXD,EAYE;AAAA,MAXD;AACCC,IAAAA,KADD;AAECC,IAAAA,mBAFD;AAGCC,IAAAA,KAHD;AAICC,IAAAA,IAJD;AAKCC,IAAAA,SALD;AAMCC,IAAAA,QAND;AAOCC,IAAAA,IAAI,GAAG,MAPR;AAQC,OAAGC;AARJ,GAWC;AACD,QAAMC,UAAU,GAAG,4BAAeV,WAAf,CAAnB;AACA,QAAMW,EAAE,GAAI,0BAA0BD,UAAY,EAAlD;;AACA,QAAME,aAAa,GAAG;AACrB;AACAC,EAAAA,KAFqB,KAGjBN,QAAQ,CAAEM,KAAK,CAACC,MAAN,CAAaV,KAAf,CAHb;;AAKA,SACC,4BAAC,oBAAD;AACC,IAAA,KAAK,EAAGF,KADT;AAEC,IAAA,mBAAmB,EAAGC,mBAFvB;AAGC,IAAA,EAAE,EAAGQ,EAHN;AAIC,IAAA,IAAI,EAAGN,IAJR;AAKC,IAAA,SAAS,EAAGC;AALb,KAOC;AACC,IAAA,SAAS,EAAC,gCADX;AAEC,IAAA,IAAI,EAAGE,IAFR;AAGC,IAAA,EAAE,EAAGG,EAHN;AAIC,IAAA,KAAK,EAAGP,KAJT;AAKC,IAAA,QAAQ,EAAGQ,aALZ;AAMC,wBAAmB,CAAC,CAAEP,IAAH,GAAUM,EAAE,GAAG,QAAf,GAA0BI,SAN9C;AAOC,IAAA,GAAG,EAAGd;AAPP,KAQMQ,KARN,EAPD,CADD;AAoBA;;eAEc,yBAAYT,WAAZ,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\n\n/**\n * @typedef OwnProps\n * @property {string} label Label for the control.\n * @property {boolean} [hideLabelFromVision] Whether to accessibly hide the label.\n * @property {string} value Value of the input.\n * @property {string} [help] Optional help text for the control.\n * @property {string} [className] Classname passed to BaseControl wrapper\n * @property {(value: string) => void} onChange Handle changes.\n * @property {string} [type='text'] Type of the input.\n */\n\n/** @typedef {OwnProps & import('react').ComponentProps<'input'>} Props */\n\n/**\n *\n * @param {Props} props Props\n * @param {import('react').ForwardedRef<HTMLInputElement>} ref\n */\nfunction TextControl(\n\t{\n\t\tlabel,\n\t\thideLabelFromVision,\n\t\tvalue,\n\t\thelp,\n\t\tclassName,\n\t\tonChange,\n\t\ttype = 'text',\n\t\t...props\n\t},\n\tref\n) {\n\tconst instanceId = useInstanceId( TextControl );\n\tconst id = `inspector-text-control-${ instanceId }`;\n\tconst onChangeValue = (\n\t\t/** @type {import('react').ChangeEvent<HTMLInputElement>} */\n\t\tevent\n\t) => onChange( event.target.value );\n\n\treturn (\n\t\t<BaseControl\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t>\n\t\t\t<input\n\t\t\t\tclassName=\"components-text-control__input\"\n\t\t\t\ttype={ type }\n\t\t\t\tid={ id }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChangeValue }\n\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\tref={ ref }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t</BaseControl>\n\t);\n}\n\nexport default forwardRef( TextControl );\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control/component.tsx"],"names":["noop","ToggleGroupControl","props","forwardedRef","className","isAdaptiveWidth","isBlock","label","hideLabelFromVision","help","onChange","value","children","otherProps","cx","containerRef","baseId","toString","radio","state","previousValue","setState","classes","styles","block","View","ConnectedToggleGroupControl"],"mappings":";;;;;;;;;AAWA;;;;AANA;;AAOA;;AAKA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;;;;;AA3BA;AACA;AACA;AAEA;;AAUA;AACA;AACA;AAaA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,kBAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AACLC,IAAAA,SADK;AAELC,IAAAA,eAAe,GAAG,KAFb;AAGLC,IAAAA,OAAO,GAAG,KAHL;AAILC,IAAAA,KAJK;AAKLC,IAAAA,mBAAmB,GAAG,KALjB;AAMLC,IAAAA,IANK;AAOLC,IAAAA,QAAQ,GAAGV,IAPN;AAQLW,IAAAA,KARK;AASLC,IAAAA,QATK;AAUL,OAAGC;AAVE,MAWF,+BAAkBX,KAAlB,EAAyB,oBAAzB,CAXJ;AAYA,QAAMY,EAAE,GAAG,mBAAX;AACA,QAAMC,YAAY,GAAG,sBAArB;AACA,QAAMC,MAAM,GAAG,4BACdf,kBADc,EAEd,sBAFc,EAGbgB,QAHa,EAAf;AAIA,QAAMC,KAAK,GAAG,2BAAe;AAC5BF,IAAAA,MAD4B;AAE5BG,IAAAA,KAAK,EAAER;AAFqB,GAAf,CAAd;AAIA,QAAMS,aAAa,GAAG,0BAAaT,KAAb,CAAtB,CAvBC,CAyBD;;AACA,8BAAiB,MAAM;AACtB;AACA;AACA,QAAKS,aAAa,KAAKF,KAAK,CAACC,KAA7B,EAAqC;AACpCT,MAAAA,QAAQ,CAAEQ,KAAK,CAACC,KAAR,CAAR;AACA;AACD,GAND,EAMG,CAAED,KAAK,CAACC,KAAR,CANH,EA1BC,CAkCD;;AACA,8BAAiB,MAAM;AACtB,QAAKR,KAAK,KAAKO,KAAK,CAACC,KAArB,EAA6B;AAC5BD,MAAAA,KAAK,CAACG,QAAN,CAAgBV,KAAhB;AACA;AACD,GAJD,EAIG,CAAEA,KAAF,CAJH;AAMA,QAAMW,OAAO,GAAG,sBACf,MACCR,EAAE,CACDS,MAAM,CAACtB,kBADN,EAEDK,OAAO,IAAIiB,MAAM,CAACC,KAFjB,EAGD,QAHC,EAIDpB,SAJC,CAFY,EAQf,CAAEA,SAAF,EAAaU,EAAb,EAAiBR,OAAjB,CARe,CAAhB;AAUA,SACC,4BAAC,oBAAD;AAAa,IAAA,IAAI,EAAGG;AAApB,KACC,4BAAC,iBAAD,CAA2B,QAA3B;AACC,IAAA,KAAK,EAAG,EAAE,GAAGS,KAAL;AAAYZ,MAAAA,OAAO,EAAE,CAAED;AAAvB;AADT,KAGG,CAAEG,mBAAF,IACD,yCACC,4BAAC,oBAAD,CAAa,WAAb,QACGD,KADH,CADD,CAJF,EAUC,4BAAC,kBAAD,6BACMW,KADN;AAEC,kBAAaX,KAFd;AAGC,IAAA,EAAE,EAAGkB,UAHN;AAIC,IAAA,SAAS,EAAGH;AAJb,KAKMT,UALN;AAMC,IAAA,GAAG,EAAG,2BAAc,CAAEE,YAAF,EAAgBZ,YAAhB,CAAd;AANP,MAQGS,QARH,CAVD,CADD,CADD;AAyBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMc,2BAA2B,GAAG,6BACnCzB,kBADmC,EAEnC,oBAFmC,CAApC;eAKeyB,2B","sourcesContent":["/**\n * External dependencies\n */\nimport type {
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control/component.tsx"],"names":["noop","ToggleGroupControl","props","forwardedRef","className","isAdaptiveWidth","isBlock","label","hideLabelFromVision","help","onChange","value","children","otherProps","cx","containerRef","baseId","toString","radio","state","previousValue","setState","classes","styles","block","View","ConnectedToggleGroupControl"],"mappings":";;;;;;;;;AAWA;;;;AANA;;AAOA;;AAKA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;;;;;AA3BA;AACA;AACA;AAEA;;AAUA;AACA;AACA;AAaA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,kBAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AACLC,IAAAA,SADK;AAELC,IAAAA,eAAe,GAAG,KAFb;AAGLC,IAAAA,OAAO,GAAG,KAHL;AAILC,IAAAA,KAJK;AAKLC,IAAAA,mBAAmB,GAAG,KALjB;AAMLC,IAAAA,IANK;AAOLC,IAAAA,QAAQ,GAAGV,IAPN;AAQLW,IAAAA,KARK;AASLC,IAAAA,QATK;AAUL,OAAGC;AAVE,MAWF,+BAAkBX,KAAlB,EAAyB,oBAAzB,CAXJ;AAYA,QAAMY,EAAE,GAAG,mBAAX;AACA,QAAMC,YAAY,GAAG,sBAArB;AACA,QAAMC,MAAM,GAAG,4BACdf,kBADc,EAEd,sBAFc,EAGbgB,QAHa,EAAf;AAIA,QAAMC,KAAK,GAAG,2BAAe;AAC5BF,IAAAA,MAD4B;AAE5BG,IAAAA,KAAK,EAAER;AAFqB,GAAf,CAAd;AAIA,QAAMS,aAAa,GAAG,0BAAaT,KAAb,CAAtB,CAvBC,CAyBD;;AACA,8BAAiB,MAAM;AACtB;AACA;AACA,QAAKS,aAAa,KAAKF,KAAK,CAACC,KAA7B,EAAqC;AACpCT,MAAAA,QAAQ,CAAEQ,KAAK,CAACC,KAAR,CAAR;AACA;AACD,GAND,EAMG,CAAED,KAAK,CAACC,KAAR,CANH,EA1BC,CAkCD;;AACA,8BAAiB,MAAM;AACtB,QAAKR,KAAK,KAAKO,KAAK,CAACC,KAArB,EAA6B;AAC5BD,MAAAA,KAAK,CAACG,QAAN,CAAgBV,KAAhB;AACA;AACD,GAJD,EAIG,CAAEA,KAAF,CAJH;AAMA,QAAMW,OAAO,GAAG,sBACf,MACCR,EAAE,CACDS,MAAM,CAACtB,kBADN,EAEDK,OAAO,IAAIiB,MAAM,CAACC,KAFjB,EAGD,QAHC,EAIDpB,SAJC,CAFY,EAQf,CAAEA,SAAF,EAAaU,EAAb,EAAiBR,OAAjB,CARe,CAAhB;AAUA,SACC,4BAAC,oBAAD;AAAa,IAAA,IAAI,EAAGG;AAApB,KACC,4BAAC,iBAAD,CAA2B,QAA3B;AACC,IAAA,KAAK,EAAG,EAAE,GAAGS,KAAL;AAAYZ,MAAAA,OAAO,EAAE,CAAED;AAAvB;AADT,KAGG,CAAEG,mBAAF,IACD,yCACC,4BAAC,oBAAD,CAAa,WAAb,QACGD,KADH,CADD,CAJF,EAUC,4BAAC,kBAAD,6BACMW,KADN;AAEC,kBAAaX,KAFd;AAGC,IAAA,EAAE,EAAGkB,UAHN;AAIC,IAAA,SAAS,EAAGH;AAJb,KAKMT,UALN;AAMC,IAAA,GAAG,EAAG,2BAAc,CAAEE,YAAF,EAAgBZ,YAAhB,CAAd;AANP,MAQGS,QARH,CAVD,CADD,CADD;AAyBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMc,2BAA2B,GAAG,6BACnCzB,kBADmC,EAEnC,oBAFmC,CAApC;eAKeyB,2B","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport { RadioGroup, useRadioState } from 'reakit';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useRef, useMemo } from '@wordpress/element';\nimport { useMergeRefs, useInstanceId, usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useUpdateEffect, useCx } from '../../utils/hooks';\nimport { View } from '../../view';\nimport BaseControl from '../../base-control';\nimport type { ToggleGroupControlProps } from '../types';\nimport ToggleGroupControlContext from '../context';\nimport * as styles from './styles';\n\nconst noop = () => {};\n\nfunction ToggleGroupControl(\n\tprops: WordPressComponentProps< ToggleGroupControlProps, 'input' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\tclassName,\n\t\tisAdaptiveWidth = false,\n\t\tisBlock = false,\n\t\tlabel,\n\t\thideLabelFromVision = false,\n\t\thelp,\n\t\tonChange = noop,\n\t\tvalue,\n\t\tchildren,\n\t\t...otherProps\n\t} = useContextSystem( props, 'ToggleGroupControl' );\n\tconst cx = useCx();\n\tconst containerRef = useRef();\n\tconst baseId = useInstanceId(\n\t\tToggleGroupControl,\n\t\t'toggle-group-control'\n\t).toString();\n\tconst radio = useRadioState( {\n\t\tbaseId,\n\t\tstate: value,\n\t} );\n\tconst previousValue = usePrevious( value );\n\n\t// Propagate radio.state change\n\tuseUpdateEffect( () => {\n\t\t// Avoid calling onChange if radio state changed\n\t\t// from incoming value.\n\t\tif ( previousValue !== radio.state ) {\n\t\t\tonChange( radio.state );\n\t\t}\n\t}, [ radio.state ] );\n\n\t// Sync incoming value with radio.state\n\tuseUpdateEffect( () => {\n\t\tif ( value !== radio.state ) {\n\t\t\tradio.setState( value );\n\t\t}\n\t}, [ value ] );\n\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tstyles.ToggleGroupControl,\n\t\t\t\tisBlock && styles.block,\n\t\t\t\t'medium',\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ className, cx, isBlock ]\n\t);\n\treturn (\n\t\t<BaseControl help={ help }>\n\t\t\t<ToggleGroupControlContext.Provider\n\t\t\t\tvalue={ { ...radio, isBlock: ! isAdaptiveWidth } }\n\t\t\t>\n\t\t\t\t{ ! hideLabelFromVision && (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<RadioGroup\n\t\t\t\t\t{ ...radio }\n\t\t\t\t\taria-label={ label }\n\t\t\t\t\tas={ View }\n\t\t\t\t\tclassName={ classes }\n\t\t\t\t\t{ ...otherProps }\n\t\t\t\t\tref={ useMergeRefs( [ containerRef, forwardedRef ] ) }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</RadioGroup>\n\t\t\t</ToggleGroupControlContext.Provider>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * `ToggleGroupControl` is a form component that lets users choose options\n * represented in horizontal segments. To render options for this control use\n * `ToggleGroupControlOption` component.\n *\n * Only use this control when you know for sure the labels of items inside won't\n * wrap. For items with longer labels, you can consider a `SelectControl` or a\n * `CustomSelectControl` component instead.\n *\n * @example\n * ```jsx\n * import {\n * __experimentalToggleGroupControl as ToggleGroupControl,\n * __experimentalToggleGroupControlOption as ToggleGroupControlOption,\n * } from '@wordpress/components';\n *\n * function Example() {\n * return (\n * <ToggleGroupControl label=\"my label\" value=\"vertical\" isBlock>\n * <ToggleGroupControlOption value=\"horizontal\" label=\"Horizontal\" />\n * <ToggleGroupControlOption value=\"vertical\" label=\"Vertical\" />\n * </ToggleGroupControl>\n * );\n * }\n * ```\n */\nconst ConnectedToggleGroupControl = contextConnect(\n\tToggleGroupControl,\n\t'ToggleGroupControl'\n);\n\nexport default ConnectedToggleGroupControl;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control-option/component.tsx"],"names":["ButtonContentView","LabelPlaceholderView","LabelView","styles","WithToolTip","showTooltip","text","children","ToggleGroupControlOption","props","forwardedRef","toggleGroupControlContext","id","baseId","buttonProps","className","isBlock","label","value","radioProps","isActive","state","cx","labelViewClasses","labelBlock","classes","buttonView","buttonActive","opt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,GAAGH,EAAE,CACjBnB,MAAM,CAACuB,UADU,EAEjBX,SAFiB,EAGjBK,QAAQ,IAAIjB,MAAM,CAACwB,YAHF,CAAlB;AAKA,QAAMC,WAAW,GAAG,CAAC,CAAET,UAAU,CAAE,YAAF,CAAb,GACjBA,UAAU,CAAE,YAAF,CADO,GAEjBF,KAFH;AAIA,SACC,4BAAC,SAAD;AAAW,IAAA,SAAS,EAAGM,gBAAvB;AAA0C,mBAAcH;AAAxD,KACC,4BAAC,WAAD;AAAa,IAAA,WAAW,EAAGf,WAA3B;AAAyC,IAAA,IAAI,EAAGuB;AAAhD,KACC,4BAAC,aAAD,6BACMT,UADN;AAEC,IAAA,EAAE,EAAC,QAFJ;AAGC,kBAAaS,WAHd;AAIC,IAAA,SAAS,EAAGH,OAJb;AAKC,kBAAaP,KALd;AAMC,IAAA,GAAG,EAAGR,YANP;AAOC,IAAA,KAAK,EAAGQ;AAPT,MASC,4BAAC,iBAAD,QAAqBD,KAArB,CATD,EAUC,4BAAC,oBAAD;AAAsB;AAAtB,KACGA,KADH,CAVD,CADD,CADD,CADD;AAoBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMY,iCAAiC,GAAG,6BACzCrB,wBADyC,EAEzC,0BAFyC,CAA1C;eAKeqB,iC","sourcesContent":["/**\n * External dependencies\n */\nimport type {
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control-option/component.tsx"],"names":["ButtonContentView","LabelPlaceholderView","LabelView","styles","WithToolTip","showTooltip","text","children","ToggleGroupControlOption","props","forwardedRef","toggleGroupControlContext","id","baseId","buttonProps","className","isBlock","label","value","radioProps","isActive","state","cx","labelViewClasses","labelBlock","classes","buttonView","buttonActive","optionLabel","ConnectedToggleGroupControlOption"],"mappings":";;;;;;;;;;;;;AAKA;;AAKA;;AAKA;;AAMA;;AACA;;AACA;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AACwB,YAHF,CAAlB;AAKA,QAAMC,WAAW,GAAG,CAAC,CAAET,UAAU,CAAE,YAAF,CAAb,GACjBA,UAAU,CAAE,YAAF,CADO,GAEjBF,KAFH;AAIA,SACC,4BAAC,SAAD;AAAW,IAAA,SAAS,EAAGM,gBAAvB;AAA0C,mBAAcH;AAAxD,KACC,4BAAC,WAAD;AAAa,IAAA,WAAW,EAAGf,WAA3B;AAAyC,IAAA,IAAI,EAAGuB;AAAhD,KACC,4BAAC,aAAD,6BACMT,UADN;AAEC,IAAA,EAAE,EAAC,QAFJ;AAGC,kBAAaS,WAHd;AAIC,IAAA,SAAS,EAAGH,OAJb;AAKC,kBAAaP,KALd;AAMC,IAAA,GAAG,EAAGR,YANP;AAOC,IAAA,KAAK,EAAGQ;AAPT,MASC,4BAAC,iBAAD,QAAqBD,KAArB,CATD,EAUC,4BAAC,oBAAD;AAAsB;AAAtB,KACGA,KADH,CAVD,CADD,CADD,CADD;AAoBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMY,iCAAiC,GAAG,6BACzCrB,wBADyC,EAEzC,0BAFyC,CAA1C;eAKeqB,iC","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport { Radio } from 'reakit';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport type { ToggleGroupControlOptionProps, WithToolTipProps } from '../types';\nimport { useToggleGroupControlContext } from '../context';\nimport * as styles from './styles';\nimport { useCx } from '../../utils/hooks';\nimport Tooltip from '../../tooltip';\n\nconst { ButtonContentView, LabelPlaceholderView, LabelView } = styles;\n\nconst WithToolTip = ( { showTooltip, text, children }: WithToolTipProps ) => {\n\tif ( showTooltip && text ) {\n\t\treturn (\n\t\t\t<Tooltip text={ text } position=\"top center\">\n\t\t\t\t{ children }\n\t\t\t</Tooltip>\n\t\t);\n\t}\n\treturn <>{ children }</>;\n};\n\nfunction ToggleGroupControlOption(\n\tprops: WordPressComponentProps< ToggleGroupControlOptionProps, 'button' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst toggleGroupControlContext = useToggleGroupControlContext();\n\tconst id = useInstanceId(\n\t\tToggleGroupControlOption,\n\t\ttoggleGroupControlContext.baseId || 'toggle-group-control-option'\n\t) as string;\n\tconst buttonProps = useContextSystem(\n\t\t{ ...props, id },\n\t\t'ToggleGroupControlOption'\n\t);\n\n\tconst {\n\t\tclassName,\n\t\tisBlock = false,\n\t\tlabel,\n\t\tvalue,\n\t\tshowTooltip = false,\n\t\t...radioProps\n\t} = {\n\t\t...toggleGroupControlContext,\n\t\t...buttonProps,\n\t};\n\n\tconst isActive = radioProps.state === value;\n\tconst cx = useCx();\n\tconst labelViewClasses = cx( isBlock && styles.labelBlock );\n\tconst classes = cx(\n\t\tstyles.buttonView,\n\t\tclassName,\n\t\tisActive && styles.buttonActive\n\t);\n\tconst optionLabel = !! radioProps[ 'aria-label' ]\n\t\t? radioProps[ 'aria-label' ]\n\t\t: label;\n\n\treturn (\n\t\t<LabelView className={ labelViewClasses } data-active={ isActive }>\n\t\t\t<WithToolTip showTooltip={ showTooltip } text={ optionLabel }>\n\t\t\t\t<Radio\n\t\t\t\t\t{ ...radioProps }\n\t\t\t\t\tas=\"button\"\n\t\t\t\t\taria-label={ optionLabel }\n\t\t\t\t\tclassName={ classes }\n\t\t\t\t\tdata-value={ value }\n\t\t\t\t\tref={ forwardedRef }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t>\n\t\t\t\t\t<ButtonContentView>{ label }</ButtonContentView>\n\t\t\t\t\t<LabelPlaceholderView aria-hidden>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</LabelPlaceholderView>\n\t\t\t\t</Radio>\n\t\t\t</WithToolTip>\n\t\t</LabelView>\n\t);\n}\n\n/**\n * `ToggleGroupControlOption` is a form component and is meant to be used as a\n * child of `ToggleGroupControl`.\n *\n * @example\n * ```jsx\n * import {\n * __experimentalToggleGroupControl as ToggleGroupControl,\n * __experimentalToggleGroupControlOption as ToggleGroupControlOption,\n * } from '@wordpress/components';\n *\n * function Example() {\n * return (\n * <ToggleGroupControl label=\"my label\" value=\"vertical\" isBlock>\n * <ToggleGroupControlOption value=\"horizontal\" label=\"Horizontal\" />\n * <ToggleGroupControlOption value=\"vertical\" label=\"Vertical\" />\n * </ToggleGroupControl>\n * );\n * }\n * ```\n */\nconst ConnectedToggleGroupControlOption = contextConnect(\n\tToggleGroupControlOption,\n\t'ToggleGroupControlOption'\n);\n\nexport default ConnectedToggleGroupControlOption;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tools-panel/tools-panel/component.tsx"],"names":["ToolsPanel","props","forwardedRef","children","label","panelContext","resetAllItems","toggleItem","toolsPanelProps","ConnectedToolsPanel"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AACA;;AACA;;AACA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;AAQA,MAAMA,UAAU,GAAG,CAClBC,KADkB,EAElBC,YAFkB,KAGd;AACJ,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,KAFK;AAGLC,IAAAA,YAHK;AAILC,IAAAA,aAJK;AAKLC,IAAAA,UALK;AAML,OAAGC;AANE,MAOF,yBAAeP,KAAf,CAPJ;AASA,SACC,4BAAC,UAAD,6BAAWO,eAAX;AAA6B,IAAA,OAAO,EAAG,CAAvC;AAA2C,IAAA,GAAG,EAAGN;AAAjD,MACC,4BAAC,0BAAD,CAAmB,QAAnB;AAA4B,IAAA,KAAK,EAAGG;AAApC,KACC,4BAAC,yBAAD;AACC,IAAA,KAAK,EAAGD,KADT;AAEC,IAAA,QAAQ,EAAGE,aAFZ;AAGC,IAAA,UAAU,EAAGC;AAHd,IADD,EAMGJ,QANH,CADD,CADD;AAYA,CAzBD;;AA2BA,MAAMM,mBAAmB,GAAG,8BAAgBT,UAAhB,EAA4B,YAA5B,CAA5B;eAEeS,mB","sourcesContent":["/**\n * External dependencies\n */\nimport type {
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tools-panel/tools-panel/component.tsx"],"names":["ToolsPanel","props","forwardedRef","children","label","panelContext","resetAllItems","toggleItem","toolsPanelProps","ConnectedToolsPanel"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AACA;;AACA;;AACA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;AAQA,MAAMA,UAAU,GAAG,CAClBC,KADkB,EAElBC,YAFkB,KAGd;AACJ,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,KAFK;AAGLC,IAAAA,YAHK;AAILC,IAAAA,aAJK;AAKLC,IAAAA,UALK;AAML,OAAGC;AANE,MAOF,yBAAeP,KAAf,CAPJ;AASA,SACC,4BAAC,UAAD,6BAAWO,eAAX;AAA6B,IAAA,OAAO,EAAG,CAAvC;AAA2C,IAAA,GAAG,EAAGN;AAAjD,MACC,4BAAC,0BAAD,CAAmB,QAAnB;AAA4B,IAAA,KAAK,EAAGG;AAApC,KACC,4BAAC,yBAAD;AACC,IAAA,KAAK,EAAGD,KADT;AAEC,IAAA,QAAQ,EAAGE,aAFZ;AAGC,IAAA,UAAU,EAAGC;AAHd,IADD,EAMGJ,QANH,CADD,CADD;AAYA,CAzBD;;AA2BA,MAAMM,mBAAmB,GAAG,8BAAgBT,UAAhB,EAA4B,YAA5B,CAA5B;eAEeS,mB","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport ToolsPanelHeader from '../tools-panel-header';\nimport { ToolsPanelContext } from '../context';\nimport { useToolsPanel } from './hook';\nimport { Grid } from '../../grid';\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport type { ToolsPanelProps } from '../types';\n\nconst ToolsPanel = (\n\tprops: WordPressComponentProps< ToolsPanelProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tchildren,\n\t\tlabel,\n\t\tpanelContext,\n\t\tresetAllItems,\n\t\ttoggleItem,\n\t\t...toolsPanelProps\n\t} = useToolsPanel( props );\n\n\treturn (\n\t\t<Grid { ...toolsPanelProps } columns={ 2 } ref={ forwardedRef }>\n\t\t\t<ToolsPanelContext.Provider value={ panelContext }>\n\t\t\t\t<ToolsPanelHeader\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tresetAll={ resetAllItems }\n\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t/>\n\t\t\t\t{ children }\n\t\t\t</ToolsPanelContext.Provider>\n\t\t</Grid>\n\t);\n};\n\nconst ConnectedToolsPanel = contextConnect( ToolsPanel, 'ToolsPanel' );\n\nexport default ConnectedToolsPanel;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tools-panel/tools-panel-header/component.tsx"],"names":["noop","DefaultControlsGroup","items","onClose","toggleItem","length","map","label","hasValue","icon","reset","check","itemLabel","undefined","OptionalControlsGroup","isSelected","ToolsPanelHeader","props","forwardedRef","areAllOptionalControlsHidden","dropdownMenuClassName","hasMenuItems","headingClassName","labelText","menuItems","resetAll","headerProps","defaultItems","Object","entries","default","optionalItems","optional","dropDownMenuIcon","plus","moreVertical","dropDownMenuLabelText","className","isSmall","ConnectedToolsPanelHeader"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAaA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,MAAMC,oBAAoB,GAAG,QAIQ;AAAA,MAJN;AAC9BC,IAAAA,KAD8B;AAE9BC,IAAAA,OAF8B;AAG9BC,IAAAA;AA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S,EAAGI;AAAjC,KACGC,SADH,CADD,EAIGF,YAAY,IACb,4BAAC,qBAAD;AACC,IAAA,IAAI,EAAGY,gBADR;AAEC,IAAA,KAAK,EAAGG,qBAFT;AAGC,IAAA,SAAS,EAAG;AAAEC,MAAAA,SAAS,EAAEjB;AAAb,KAHb;AAIC,IAAA,WAAW,EAAG;AAAEkB,MAAAA,OAAO,EAAE;AAAX;AAJf,KAMG;AAAA,QAAE;AAAEnC,MAAAA,OAAO,GAAGH;AAAZ,KAAF;AAAA,WACD,qDACC,4BAAC,oBAAD;AACC,MAAA,KAAK,EAAG2B,YADT;AAEC,MAAA,OAAO,EAAGxB,OAFX;AAGC,MAAA,UAAU,EAAGC;AAHd,MADD,EAMC,4BAAC,qBAAD;AACC,MAAA,KAAK,EAAG2B,aADT;AAEC,MAAA,OAAO,EAAG5B,OAFX;AAGC,MAAA,UAAU,EAAGC;AAHd,MAND,EAWC,4BAAC,kBAAD,QACC,4BAAC,iBAAD;AACC,MAAA,OAAO,EAAG,UADX;AAEC,MAAA,OAAO,EAAG,MAAM;AACfqB,QAAAA,QAAQ;AACRtB,QAAAA,OAAO;AACP;AALF,OAOG,cAAI,WAAJ,CAPH,CADD,CAXD,CADC;AAAA,GANH,CALF,CADD;AAyCA,CAvED;;AAyEA,MAAMoC,yBAAyB,GAAG,6BACjCvB,gBADiC,EAEjC,kBAFiC,CAAlC;eAKeuB,yB","sourcesContent":["/**\n * External dependencies\n */\nimport type {
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tools-panel/tools-panel-header/component.tsx"],"names":["noop","DefaultControlsGroup","items","onClose","toggleItem","length","map","label","hasValue","icon","reset","check","itemLabel","undefined","OptionalControlsGroup","isSelected","ToolsPanelHeader","props","forwardedRef","areAllOptionalControlsHidden","dropdownMenuClassName","hasMenuItems","headingClassName","labelText","menuItems","resetAll","headerProps","defaultItems","Object","entries","default","optionalItems","optional","dropDownMenuIcon","plus","moreVertical","dropDownMenuLabelText","className","isSmall","Connect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ress dependencies\n */\nimport { check, reset, moreVertical, plus } from '@wordpress/icons';\nimport { __, _x, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport DropdownMenu from '../../dropdown-menu';\nimport MenuGroup from '../../menu-group';\nimport MenuItem from '../../menu-item';\nimport { HStack } from '../../h-stack';\nimport { Heading } from '../../heading';\nimport { useToolsPanelHeader } from './hook';\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport type {\n\tToolsPanelControlsGroupProps,\n\tToolsPanelHeaderProps,\n} from '../types';\n\nconst noop = () => {};\n\nconst DefaultControlsGroup = ( {\n\titems,\n\tonClose,\n\ttoggleItem,\n}: ToolsPanelControlsGroupProps ) => {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup>\n\t\t\t{ items.map( ( [ label, hasValue ] ) => {\n\t\t\t\tconst icon = hasValue ? reset : check;\n\t\t\t\tconst itemLabel = hasValue\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t__( 'Reset %s' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t )\n\t\t\t\t\t: undefined;\n\n\t\t\t\treturn (\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tisSelected={ true }\n\t\t\t\t\t\tdisabled={ ! hasValue }\n\t\t\t\t\t\tlabel={ itemLabel }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\ttoggleItem( label );\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\trole=\"menuitemcheckbox\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</MenuGroup>\n\t);\n};\n\nconst OptionalControlsGroup = ( {\n\titems,\n\tonClose,\n\ttoggleItem,\n}: ToolsPanelControlsGroupProps ) => {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup>\n\t\t\t{ items.map( ( [ label, isSelected ] ) => {\n\t\t\t\tconst itemLabel = isSelected\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// translators: %s: The name of the control being hidden and reset e.g. \"Padding\".\n\t\t\t\t\t\t\t__( 'Hide and reset %s' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t// translators: %s: The name of the control to display e.g. \"Padding\".\n\t\t\t\t\t\t\t__( 'Show %s' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t );\n\n\t\t\t\treturn (\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\ticon={ isSelected && check }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tlabel={ itemLabel }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\ttoggleItem( label );\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\trole=\"menuitemcheckbox\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</MenuGroup>\n\t);\n};\n\nconst ToolsPanelHeader = (\n\tprops: WordPressComponentProps< ToolsPanelHeaderProps, 'h2' >,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tareAllOptionalControlsHidden,\n\t\tdropdownMenuClassName,\n\t\thasMenuItems,\n\t\theadingClassName,\n\t\tlabel: labelText,\n\t\tmenuItems,\n\t\tresetAll,\n\t\ttoggleItem,\n\t\t...headerProps\n\t} = useToolsPanelHeader( props );\n\n\tif ( ! labelText ) {\n\t\treturn null;\n\t}\n\n\tconst defaultItems = Object.entries( menuItems?.default || {} );\n\tconst optionalItems = Object.entries( menuItems?.optional || {} );\n\tconst dropDownMenuIcon = areAllOptionalControlsHidden ? plus : moreVertical;\n\tconst dropDownMenuLabelText = areAllOptionalControlsHidden\n\t\t? _x(\n\t\t\t\t'View and add options',\n\t\t\t\t'Button label to reveal tool panel options'\n\t\t )\n\t\t: _x( 'View options', 'Button label to reveal tool panel options' );\n\n\treturn (\n\t\t<HStack { ...headerProps } ref={ forwardedRef }>\n\t\t\t<Heading level={ 2 } className={ headingClassName }>\n\t\t\t\t{ labelText }\n\t\t\t</Heading>\n\t\t\t{ hasMenuItems && (\n\t\t\t\t<DropdownMenu\n\t\t\t\t\ticon={ dropDownMenuIcon }\n\t\t\t\t\tlabel={ dropDownMenuLabelText }\n\t\t\t\t\tmenuProps={ { className: dropdownMenuClassName } }\n\t\t\t\t\ttoggleProps={ { isSmall: true } }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose = noop } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<DefaultControlsGroup\n\t\t\t\t\t\t\t\titems={ defaultItems }\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<OptionalControlsGroup\n\t\t\t\t\t\t\t\titems={ optionalItems }\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tvariant={ 'tertiary' }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tresetAll();\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset all' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</DropdownMenu>\n\t\t\t) }\n\t\t</HStack>\n\t);\n};\n\nconst ConnectedToolsPanelHeader = contextConnect(\n\tToolsPanelHeader,\n\t'ToolsPanelHeader'\n);\n\nexport default ConnectedToolsPanelHeader;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tools-panel/tools-panel-item/component.tsx"],"names":["ToolsPanelItem","props","forwardedRef","children","isShown","shouldRenderPlaceholder","toolsPanelItemProps","ConnectedToolsPanelItem"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAMA;AACA;AACA,MAAMA,cAAc,GAAG,CACtBC,KADsB,EAEtBC,YAFsB,KAGlB;AACJ,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,OAFK;AAGLC,IAAAA,uBAHK;AAIL,OAAGC;AAJE,MAKF,6BAAmBL,KAAnB,CALJ;;AAOA,MAAK,CAAEG,OAAP,EAAiB;AAChB,WAAOC,uBAAuB,GAC7B,4BAAC,UAAD,6BAAWC,mBAAX;AAAiC,MAAA,GAAG,EAAGJ;AAAvC,OAD6B,GAE1B,IAFJ;AAGA;;AAED,SACC,4BAAC,UAAD,6BAAWI,mBAAX;AAAiC,IAAA,GAAG,EAAGJ;AAAvC,MACGC,QADH,CADD;AAKA,CAtBD;;AAwBA,MAAMI,uBAAuB,GAAG,6BAC/BP,cAD+B,EAE/B,gBAF+B,CAAhC;eAKeO,uB","sourcesContent":["/**\n * External dependencies\n */\nimport type {
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tools-panel/tools-panel-item/component.tsx"],"names":["ToolsPanelItem","props","forwardedRef","children","isShown","shouldRenderPlaceholder","toolsPanelItemProps","ConnectedToolsPanelItem"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAMA;AACA;AACA,MAAMA,cAAc,GAAG,CACtBC,KADsB,EAEtBC,YAFsB,KAGlB;AACJ,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,OAFK;AAGLC,IAAAA,uBAHK;AAIL,OAAGC;AAJE,MAKF,6BAAmBL,KAAnB,CALJ;;AAOA,MAAK,CAAEG,OAAP,EAAiB;AAChB,WAAOC,uBAAuB,GAC7B,4BAAC,UAAD,6BAAWC,mBAAX;AAAiC,MAAA,GAAG,EAAGJ;AAAvC,OAD6B,GAE1B,IAFJ;AAGA;;AAED,SACC,4BAAC,UAAD,6BAAWI,mBAAX;AAAiC,IAAA,GAAG,EAAGJ;AAAvC,MACGC,QADH,CADD;AAKA,CAtBD;;AAwBA,MAAMI,uBAAuB,GAAG,6BAC/BP,cAD+B,EAE/B,gBAF+B,CAAhC;eAKeO,uB","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelItem } from './hook';\nimport { View } from '../../view';\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport type { ToolsPanelItemProps } from '../types';\n\n// This wraps controls to be conditionally displayed within a tools panel. It\n// prevents props being applied to HTML elements that would make them invalid.\nconst ToolsPanelItem = (\n\tprops: WordPressComponentProps< ToolsPanelItemProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tchildren,\n\t\tisShown,\n\t\tshouldRenderPlaceholder,\n\t\t...toolsPanelItemProps\n\t} = useToolsPanelItem( props );\n\n\tif ( ! isShown ) {\n\t\treturn shouldRenderPlaceholder ? (\n\t\t\t<View { ...toolsPanelItemProps } ref={ forwardedRef } />\n\t\t) : null;\n\t}\n\n\treturn (\n\t\t<View { ...toolsPanelItemProps } ref={ forwardedRef }>\n\t\t\t{ children }\n\t\t</View>\n\t);\n};\n\nconst ConnectedToolsPanelItem = contextConnect(\n\tToolsPanelItem,\n\t'ToolsPanelItem'\n);\n\nexport default ConnectedToolsPanelItem;\n"]}
|
package/build/tree-grid/index.js
CHANGED
|
@@ -84,6 +84,7 @@ function getRowFocusables(rowElement) {
|
|
|
84
84
|
* @param {WPElement} props.children Children to be rendered.
|
|
85
85
|
* @param {Function} props.onExpandRow Callback to fire when row is expanded.
|
|
86
86
|
* @param {Function} props.onCollapseRow Callback to fire when row is collapsed.
|
|
87
|
+
* @param {Function} props.onFocusRow Callback to fire when moving focus to a different row.
|
|
87
88
|
* @param {Object} ref A ref to the underlying DOM table element.
|
|
88
89
|
*/
|
|
89
90
|
|
|
@@ -93,6 +94,7 @@ function TreeGrid(_ref, ref) {
|
|
|
93
94
|
children,
|
|
94
95
|
onExpandRow = () => {},
|
|
95
96
|
onCollapseRow = () => {},
|
|
97
|
+
onFocusRow = () => {},
|
|
96
98
|
...props
|
|
97
99
|
} = _ref;
|
|
98
100
|
const onKeyDown = (0, _element.useCallback)(event => {
|
|
@@ -100,12 +102,13 @@ function TreeGrid(_ref, ref) {
|
|
|
100
102
|
keyCode,
|
|
101
103
|
metaKey,
|
|
102
104
|
ctrlKey,
|
|
103
|
-
altKey
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
altKey
|
|
106
|
+
} = event; // The shift key is intentionally absent from the following list,
|
|
107
|
+
// to enable shift + up/down to select items from the list.
|
|
108
|
+
|
|
109
|
+
const hasModifierKeyPressed = metaKey || ctrlKey || altKey;
|
|
107
110
|
|
|
108
|
-
if (hasModifierKeyPressed || !(0, _lodash.includes)([_keycodes.UP, _keycodes.DOWN, _keycodes.LEFT, _keycodes.RIGHT], keyCode)) {
|
|
111
|
+
if (hasModifierKeyPressed || !(0, _lodash.includes)([_keycodes.UP, _keycodes.DOWN, _keycodes.LEFT, _keycodes.RIGHT, _keycodes.HOME, _keycodes.END], keyCode)) {
|
|
109
112
|
return;
|
|
110
113
|
} // The event will be handled, stop propagation.
|
|
111
114
|
|
|
@@ -237,13 +240,54 @@ function TreeGrid(_ref, ref) {
|
|
|
237
240
|
} // Try to focus the element in the next row that's at a similar column to the activeElement.
|
|
238
241
|
|
|
239
242
|
|
|
243
|
+
const nextIndex = Math.min(currentColumnIndex, focusablesInNextRow.length - 1);
|
|
244
|
+
focusablesInNextRow[nextIndex].focus(); // Let consumers know the row that was originally focused,
|
|
245
|
+
// and the row that is now in focus.
|
|
246
|
+
|
|
247
|
+
onFocusRow(event, activeRow, rows[nextRowIndex]); // Prevent key use for anything else. This ensures Voiceover
|
|
248
|
+
// doesn't try to handle key navigation.
|
|
249
|
+
|
|
250
|
+
event.preventDefault();
|
|
251
|
+
} else if ((0, _lodash.includes)([_keycodes.HOME, _keycodes.END], keyCode)) {
|
|
252
|
+
// Calculate the rowIndex of the next row.
|
|
253
|
+
const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
|
|
254
|
+
const currentRowIndex = rows.indexOf(activeRow);
|
|
255
|
+
let nextRowIndex;
|
|
256
|
+
|
|
257
|
+
if (keyCode === _keycodes.HOME) {
|
|
258
|
+
nextRowIndex = 0;
|
|
259
|
+
} else {
|
|
260
|
+
nextRowIndex = rows.length - 1;
|
|
261
|
+
} // Focus is either at the top or bottom edge of the grid. Do nothing.
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
if (nextRowIndex === currentRowIndex) {
|
|
265
|
+
// Prevent key use for anything else. For example, Voiceover
|
|
266
|
+
// will start navigating horizontally when reaching the vertical
|
|
267
|
+
// bounds of a table.
|
|
268
|
+
event.preventDefault();
|
|
269
|
+
return;
|
|
270
|
+
} // Get the focusables in the next row.
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
const focusablesInNextRow = getRowFocusables(rows[nextRowIndex]); // If for some reason there are no focusables in the next row, do nothing.
|
|
274
|
+
|
|
275
|
+
if (!focusablesInNextRow || !focusablesInNextRow.length) {
|
|
276
|
+
// Prevent key use for anything else. For example, Voiceover
|
|
277
|
+
// will still focus text when using arrow keys, while this
|
|
278
|
+
// component should limit navigation to focusables.
|
|
279
|
+
event.preventDefault();
|
|
280
|
+
return;
|
|
281
|
+
} // Try to focus the element in the next row that's at a similar column to the activeElement.
|
|
282
|
+
|
|
283
|
+
|
|
240
284
|
const nextIndex = Math.min(currentColumnIndex, focusablesInNextRow.length - 1);
|
|
241
285
|
focusablesInNextRow[nextIndex].focus(); // Prevent key use for anything else. This ensures Voiceover
|
|
242
286
|
// doesn't try to handle key navigation.
|
|
243
287
|
|
|
244
288
|
event.preventDefault();
|
|
245
289
|
}
|
|
246
|
-
}, [onExpandRow, onCollapseRow]);
|
|
290
|
+
}, [onExpandRow, onCollapseRow, onFocusRow]);
|
|
247
291
|
/* Disable reason: A treegrid is implemented using a table element. */
|
|
248
292
|
|
|
249
293
|
/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-grid/index.js"],"names":["getRowFocusables","rowElement","focusablesInRow","focus","focusable","find","sequential","length","filter","closest","TreeGrid","ref","children","onExpandRow","onCollapseRow","props","onKeyDown","event","keyCode","metaKey","ctrlKey","altKey","shiftKey","hasModifierKeyPressed","UP","DOWN","LEFT","RIGHT","stopPropagation","activeElement","document","currentTarget","treeGridElement","contains","activeRow","currentColumnIndex","indexOf","canExpandCollapse","cannotFocusNextColumn","getAttribute","nextIndex","Math","max","min","preventDefault","level","parseInt","rows","Array","from","querySelectorAll","parentRow","currentRowIndex","i","focusableItems","nextRowIndex","focusablesInNextRow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AAKA;;AAqOA;;AACA;;AACA;;AAtPA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAT,CAA2BC,UAA3B,EAAwC;AACvC,QAAMC,eAAe,GAAGC,WAAMC,SAAN,CAAgBC,IAAhB,CAAsBJ,UAAtB,EAAkC;AACzDK,IAAAA,UAAU,EAAE;AAD6C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;AAIC,IAAA,GAAG,EAAGL;AAJP,MAMC,2CAASC,QAAT,CAND,CADD,CADD;AAYA;AACA;;eAEc,yBAAYF,QAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport { includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { forwardRef, useCallback } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexContainer from './roving-tab-index';\n\n/**\n * Return focusables in a row element, excluding those from other branches\n * nested within the row.\n *\n * @param {Element} rowElement The DOM element representing the row.\n *\n * @return {?Array} The array of focusables in the row.\n */\nfunction getRowFocusables( rowElement ) {\n\tconst focusablesInRow = focus.focusable.find( rowElement, {\n\t\tsequential: true,\n\t} );\n\n\tif ( ! focusablesInRow || ! focusablesInRow.length ) {\n\t\treturn;\n\t}\n\n\treturn focusablesInRow.filter( ( focusable ) => {\n\t\treturn focusable.closest( '[role=\"row\"]' ) === rowElement;\n\t} );\n}\n\n/**\n * Renders both a table and tbody element, used to create a tree hierarchy.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md\n * @param {Object} props Component props.\n * @param {WPElement} props.children Children to be rendered.\n * @param {Function} props.onExpandRow Callback to fire when row is expanded.\n * @param {Function} props.onCollapseRow Callback to fire when row is collapsed.\n * @param {Object} ref A ref to the underlying DOM table element.\n */\nfunction TreeGrid(\n\t{ children, onExpandRow = () => {}, onCollapseRow = () => {}, ...props },\n\tref\n) {\n\tconst onKeyDown = useCallback(\n\t\t( event ) => {\n\t\t\tconst { keyCode, metaKey, ctrlKey, altKey, shiftKey } = event;\n\n\t\t\tconst hasModifierKeyPressed =\n\t\t\t\tmetaKey || ctrlKey || altKey || shiftKey;\n\n\t\t\tif (\n\t\t\t\thasModifierKeyPressed ||\n\t\t\t\t! includes( [ UP, DOWN, LEFT, RIGHT ], keyCode )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The event will be handled, stop propagation.\n\t\t\tevent.stopPropagation();\n\n\t\t\tconst { activeElement } = document;\n\t\t\tconst { currentTarget: treeGridElement } = event;\n\t\t\tif ( ! treeGridElement.contains( activeElement ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Calculate the columnIndex of the active element.\n\t\t\tconst activeRow = activeElement.closest( '[role=\"row\"]' );\n\t\t\tconst focusablesInRow = getRowFocusables( activeRow );\n\t\t\tconst currentColumnIndex = focusablesInRow.indexOf( activeElement );\n\t\t\tconst canExpandCollapse = 0 === currentColumnIndex;\n\t\t\tconst cannotFocusNextColumn =\n\t\t\t\tcanExpandCollapse &&\n\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'false' &&\n\t\t\t\tkeyCode === RIGHT;\n\n\t\t\tif ( includes( [ LEFT, RIGHT ], keyCode ) ) {\n\t\t\t\t// Calculate to the next element.\n\t\t\t\tlet nextIndex;\n\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\tnextIndex = Math.max( 0, currentColumnIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextIndex = Math.min(\n\t\t\t\t\t\tcurrentColumnIndex + 1,\n\t\t\t\t\t\tfocusablesInRow.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is at the left most column.\n\t\t\t\tif ( canExpandCollapse ) {\n\t\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\t\t// Left:\n\t\t\t\t\t\t// If a row is focused, and it is expanded, collapses the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'true'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonCollapseRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, moves to the parent row (if there is one).\n\t\t\t\t\t\tconst level = Math.max(\n\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\tactiveRow?.getAttribute( 'aria-level' ) ?? 1,\n\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t) - 1,\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rows = Array.from(\n\t\t\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet parentRow = activeRow;\n\t\t\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\t\t\tfor ( let i = currentRowIndex; i >= 0; i-- ) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\trows[ i ].getAttribute( 'aria-level' ),\n\t\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t\t) === level\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tparentRow = rows[ i ];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowFocusables( parentRow )?.[ 0 ]?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( keyCode === RIGHT ) {\n\t\t\t\t\t\t// Right:\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, expands the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) ===\n\t\t\t\t\t\t\t'false'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonExpandRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is expanded, focuses the rightmost cell in the row.\n\t\t\t\t\t\tconst focusableItems = getRowFocusables( activeRow );\n\t\t\t\t\t\tif ( focusableItems.length > 0 ) {\n\t\t\t\t\t\t\tfocusableItems[\n\t\t\t\t\t\t\t\tfocusableItems.length - 1\n\t\t\t\t\t\t\t]?.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start reading text on continued use of left/right arrow\n\t\t\t\t\t// keys.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Focus the next element. If at most left column and row is collapsed, moving right is not allowed as this will expand. However, if row is collapsed, moving left is allowed.\n\t\t\t\tif ( cannotFocusNextColumn ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfocusablesInRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( includes( [ UP, DOWN ], keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === UP ) {\n\t\t\t\t\tnextRowIndex = Math.max( 0, currentRowIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = Math.min(\n\t\t\t\t\t\tcurrentRowIndex + 1,\n\t\t\t\t\t\trows.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ onExpandRow, onCollapseRow ]\n\t);\n\n\t/* Disable reason: A treegrid is implemented using a table element. */\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n\treturn (\n\t\t<RovingTabIndexContainer>\n\t\t\t<table\n\t\t\t\t{ ...props }\n\t\t\t\trole=\"treegrid\"\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t<tbody>{ children }</tbody>\n\t\t\t</table>\n\t\t</RovingTabIndexContainer>\n\t);\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */\n}\n\nexport default forwardRef( TreeGrid );\nexport { default as TreeGridRow } from './row';\nexport { default as TreeGridCell } from './cell';\nexport { default as TreeGridItem } from './item';\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-grid/index.js"],"names":["getRowFocusables","rowElement","focusablesInRow","focus","focusable","find","sequential","length","filter","closest","TreeGrid","ref","children","onExpandRow","onCollapseRow","onFocusRow","props","onKeyDown","event","keyCode","metaKey","ctrlKey","altKey","hasModifierKeyPressed","UP","DOWN","LEFT","RIGHT","HOME","END","stopPropagation","activeElement","document","currentTarget","treeGridElement","contains","activeRow","currentColumnIndex","indexOf","canExpandCollapse","cannotFocusNextColumn","getAttribute","nextIndex","Math","max","min","preventDefault","level","parseInt","rows","Array","from","querySelectorAll","parentRow","currentRowIndex","i","focusableItems","nextRowIndex","focusablesInNextRow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AAKA;;AAgSA;;AACA;;AACA;;AAjTA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAT,CAA2BC,UAA3B,EAAwC;AACvC,QAAMC,eAAe,GAAGC,WAAMC,SAAN,CAAgBC,IAAhB,CAAsBJ,UAAtB,EAAkC;AACzDK,IAAAA,UAAU,EAAE;AAD6C,GAAlC,CAAxB;;AAIA,MAAK,CAAEJ,eAAF,IAAqB,CAAEA,eAAe,CAACK,MAA5C,EAAqD;AACpD;AACA;;AAED,SAAOL,eAAe,CAACM,MAAhB,CAA0BJ,SAAF,IAAiB;AAC/C,WAAOA,SAAS,CAACK,OAAV,CAAmB,cAAnB,MAAwCR,UAA/C;AACA,GAFM,CAAP;AAGA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASS,QAAT,OAQCC,GARD,EASE;AAAA,MARD;AACCC,IAAAA,QADD;AAECC,IAAAA,WAAW,GAAG,MAAM,CAAE,CAFvB;AAGCC,IAAAA,aAAa,GAAG,MAAM,CAAE,CAHzB;AAICC,IAAAA,UAAU,GAAG,MAAM,CAAE,CAJtB;AAKC,OAAGC;AALJ,GAQC;AACD,QAAMC,SAAS,GAAG,0BACfC,KAAF,IAAa;AACZ,UAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA,OAAX;AAAoBC,MAAAA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ADuC,CAA5C,CAxBgD,CA4BhD;;AACA,UAAK,CAAEC,mBAAF,IAAyB,CAAEA,mBAAmB,CAACnD,MAApD,EAA6D;AAC5D;AACA;AACA;AACAW,QAAAA,KAAK,CAAC4B,cAAN;AACA;AACA,OAnC+C,CAqChD;;;AACA,YAAMJ,SAAS,GAAGC,IAAI,CAACE,GAAL,CACjBR,kBADiB,EAEjBqB,mBAAmB,CAACnD,MAApB,GAA6B,CAFZ,CAAlB;AAIAmD,MAAAA,mBAAmB,CAAEhB,SAAF,CAAnB,CAAiCvC,KAAjC,GA1CgD,CA4ChD;AACA;;AACAe,MAAAA,KAAK,CAAC4B,cAAN;AACA;AACD,GA7NgB,EA8NjB,CAAEjC,WAAF,EAAeC,aAAf,EAA8BC,UAA9B,CA9NiB,CAAlB;AAiOA;;AACA;;AACA,SACC,4BAAC,uBAAD,QACC,gEACMC,KADN;AAEC,IAAA,IAAI,EAAC,UAFN;AAGC,IAAA,SAAS,EAAGC,SAHb;AAIC,IAAA,GAAG,EAAGN;AAJP,MAMC,2CAASC,QAAT,CAND,CADD,CADD;AAYA;AACA;;eAEc,yBAAYF,QAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport { includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { forwardRef, useCallback } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT, HOME, END } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexContainer from './roving-tab-index';\n\n/**\n * Return focusables in a row element, excluding those from other branches\n * nested within the row.\n *\n * @param {Element} rowElement The DOM element representing the row.\n *\n * @return {?Array} The array of focusables in the row.\n */\nfunction getRowFocusables( rowElement ) {\n\tconst focusablesInRow = focus.focusable.find( rowElement, {\n\t\tsequential: true,\n\t} );\n\n\tif ( ! focusablesInRow || ! focusablesInRow.length ) {\n\t\treturn;\n\t}\n\n\treturn focusablesInRow.filter( ( focusable ) => {\n\t\treturn focusable.closest( '[role=\"row\"]' ) === rowElement;\n\t} );\n}\n\n/**\n * Renders both a table and tbody element, used to create a tree hierarchy.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md\n * @param {Object} props Component props.\n * @param {WPElement} props.children Children to be rendered.\n * @param {Function} props.onExpandRow Callback to fire when row is expanded.\n * @param {Function} props.onCollapseRow Callback to fire when row is collapsed.\n * @param {Function} props.onFocusRow Callback to fire when moving focus to a different row.\n * @param {Object} ref A ref to the underlying DOM table element.\n */\nfunction TreeGrid(\n\t{\n\t\tchildren,\n\t\tonExpandRow = () => {},\n\t\tonCollapseRow = () => {},\n\t\tonFocusRow = () => {},\n\t\t...props\n\t},\n\tref\n) {\n\tconst onKeyDown = useCallback(\n\t\t( event ) => {\n\t\t\tconst { keyCode, metaKey, ctrlKey, altKey } = event;\n\n\t\t\t// The shift key is intentionally absent from the following list,\n\t\t\t// to enable shift + up/down to select items from the list.\n\t\t\tconst hasModifierKeyPressed = metaKey || ctrlKey || altKey;\n\n\t\t\tif (\n\t\t\t\thasModifierKeyPressed ||\n\t\t\t\t! includes( [ UP, DOWN, LEFT, RIGHT, HOME, END ], keyCode )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The event will be handled, stop propagation.\n\t\t\tevent.stopPropagation();\n\n\t\t\tconst { activeElement } = document;\n\t\t\tconst { currentTarget: treeGridElement } = event;\n\t\t\tif ( ! treeGridElement.contains( activeElement ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Calculate the columnIndex of the active element.\n\t\t\tconst activeRow = activeElement.closest( '[role=\"row\"]' );\n\t\t\tconst focusablesInRow = getRowFocusables( activeRow );\n\t\t\tconst currentColumnIndex = focusablesInRow.indexOf( activeElement );\n\t\t\tconst canExpandCollapse = 0 === currentColumnIndex;\n\t\t\tconst cannotFocusNextColumn =\n\t\t\t\tcanExpandCollapse &&\n\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'false' &&\n\t\t\t\tkeyCode === RIGHT;\n\n\t\t\tif ( includes( [ LEFT, RIGHT ], keyCode ) ) {\n\t\t\t\t// Calculate to the next element.\n\t\t\t\tlet nextIndex;\n\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\tnextIndex = Math.max( 0, currentColumnIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextIndex = Math.min(\n\t\t\t\t\t\tcurrentColumnIndex + 1,\n\t\t\t\t\t\tfocusablesInRow.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is at the left most column.\n\t\t\t\tif ( canExpandCollapse ) {\n\t\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\t\t// Left:\n\t\t\t\t\t\t// If a row is focused, and it is expanded, collapses the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'true'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonCollapseRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, moves to the parent row (if there is one).\n\t\t\t\t\t\tconst level = Math.max(\n\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\tactiveRow?.getAttribute( 'aria-level' ) ?? 1,\n\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t) - 1,\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rows = Array.from(\n\t\t\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet parentRow = activeRow;\n\t\t\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\t\t\tfor ( let i = currentRowIndex; i >= 0; i-- ) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\trows[ i ].getAttribute( 'aria-level' ),\n\t\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t\t) === level\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tparentRow = rows[ i ];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowFocusables( parentRow )?.[ 0 ]?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( keyCode === RIGHT ) {\n\t\t\t\t\t\t// Right:\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, expands the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) ===\n\t\t\t\t\t\t\t'false'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonExpandRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is expanded, focuses the rightmost cell in the row.\n\t\t\t\t\t\tconst focusableItems = getRowFocusables( activeRow );\n\t\t\t\t\t\tif ( focusableItems.length > 0 ) {\n\t\t\t\t\t\t\tfocusableItems[\n\t\t\t\t\t\t\t\tfocusableItems.length - 1\n\t\t\t\t\t\t\t]?.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start reading text on continued use of left/right arrow\n\t\t\t\t\t// keys.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Focus the next element. If at most left column and row is collapsed, moving right is not allowed as this will expand. However, if row is collapsed, moving left is allowed.\n\t\t\t\tif ( cannotFocusNextColumn ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfocusablesInRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( includes( [ UP, DOWN ], keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === UP ) {\n\t\t\t\t\tnextRowIndex = Math.max( 0, currentRowIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = Math.min(\n\t\t\t\t\t\tcurrentRowIndex + 1,\n\t\t\t\t\t\trows.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( includes( [ HOME, END ], keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === HOME ) {\n\t\t\t\t\tnextRowIndex = 0;\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = rows.length - 1;\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ onExpandRow, onCollapseRow, onFocusRow ]\n\t);\n\n\t/* Disable reason: A treegrid is implemented using a table element. */\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n\treturn (\n\t\t<RovingTabIndexContainer>\n\t\t\t<table\n\t\t\t\t{ ...props }\n\t\t\t\trole=\"treegrid\"\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t<tbody>{ children }</tbody>\n\t\t\t</table>\n\t\t</RovingTabIndexContainer>\n\t);\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */\n}\n\nexport default forwardRef( TreeGrid );\nexport { default as TreeGridRow } from './row';\nexport { default as TreeGridCell } from './cell';\nexport { default as TreeGridItem } from './item';\n"]}
|
|
@@ -23,7 +23,7 @@ var _hook = _interopRequireDefault(require("./hook"));
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props
|
|
26
|
-
* @param {import('react').
|
|
26
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
27
27
|
*/
|
|
28
28
|
function Truncate(props, forwardedRef) {
|
|
29
29
|
const truncateProps = (0, _hook.default)(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/truncate/component.js"],"names":["Truncate","props","forwardedRef","truncateProps","ConnectedTruncate"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,QAAT,CAAmBC,KAAnB,EAA0BC,YAA1B,EAAyC;AACxC,QAAMC,aAAa,GAAG,mBAAaF,KAAb,CAAtB;AAEA,SAAO,4BAAC,UAAD;AAAM,IAAA,EAAE,EAAC;AAAT,KAAqBE,aAArB;AAAqC,IAAA,GAAG,EAAGD;AAA3C,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,iBAAiB,GAAG,6BAAgBJ,QAAhB,EAA0B,UAA1B,CAA1B;eAEeI,iB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../ui/context';\nimport { View } from '../view';\nimport useTruncate from './hook';\n\n/**\n * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props\n * @param {import('react').
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/truncate/component.js"],"names":["Truncate","props","forwardedRef","truncateProps","ConnectedTruncate"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,QAAT,CAAmBC,KAAnB,EAA0BC,YAA1B,EAAyC;AACxC,QAAMC,aAAa,GAAG,mBAAaF,KAAb,CAAtB;AAEA,SAAO,4BAAC,UAAD;AAAM,IAAA,EAAE,EAAC;AAAT,KAAqBE,aAArB;AAAqC,IAAA,GAAG,EAAGD;AAA3C,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,iBAAiB,GAAG,6BAAgBJ,QAAhB,EAA0B,UAA1B,CAA1B;eAEeI,iB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../ui/context';\nimport { View } from '../view';\nimport useTruncate from './hook';\n\n/**\n * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction Truncate( props, forwardedRef ) {\n\tconst truncateProps = useTruncate( props );\n\n\treturn <View as=\"span\" { ...truncateProps } ref={ forwardedRef } />;\n}\n\n/**\n * `Truncate` is a typography primitive that trims text content.\n * For almost all cases, it is recommended that `Text`, `Heading`, or\n * `Subheading` is used to render text content. However,`Truncate` is\n * available for custom implementations.\n *\n * @example\n * ```jsx\n * import { __experimentalTruncate as Truncate } from `@wordpress/components`;\n *\n * function Example() {\n * \treturn (\n * \t\t<Truncate>\n * \t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ex\n * \t\t\tneque, vulputate a diam et, luctus convallis lacus. Vestibulum ac\n * \t\t\tmollis mi. Morbi id elementum massa.\n * \t\t</Truncate>\n * \t);\n * }\n * ```\n */\nconst ConnectedTruncate = contextConnect( Truncate, 'Truncate' );\n\nexport default ConnectedTruncate;\n"]}
|
|
@@ -29,7 +29,7 @@ var _context = require("../context");
|
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* @param {import('../context').WordPressComponentProps<import('./types').Props, 'div'>} props
|
|
32
|
-
* @param {import('react').
|
|
32
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
33
33
|
*/
|
|
34
34
|
function ControlGroup(props, forwardedRef) {
|
|
35
35
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/control-group/component.js"],"names":["ControlGroup","props","forwardedRef","children","direction","templateColumns","otherProps","isGrid","ConnectedControlGroup"],"mappings":";;;;;;;;;;;;;AAOA;;AACA;;AACA;;AACA;;AAVA;AACA;AACA;;AAEA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA,SAASA,YAAT,CAAuBC,KAAvB,EAA8BC,YAA9B,EAA6C;AAC5C,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,SAAS,GAAG,KAFP;AAGLC,IAAAA,eAHK;AAIL,OAAGC;AAJE,MAKF,2BAAiBL,KAAjB,CALJ;AAOA,QAAMM,MAAM,GAAG,CAAC,CAAEF,eAAlB;;AAEA,MAAKE,MAAL,EAAc;AACb,WACC,4BAAC,UAAD;AACC,MAAA,GAAG,EAAG,CADP;AAEC,MAAA,eAAe,EAAGF;AAFnB,OAGMC,UAHN;AAIC,MAAA,GAAG,EAAGJ;AAJP,QAMGC,QANH,CADD;AAUA;;AAED,SACC,4BAAC,UAAD;AACC,IAAA,SAAS,EAAGC,SADb;AAEC,IAAA,GAAG,EAAI;AAFR,KAGME,UAHN;AAIC,IAAA,GAAG,EAAGJ;AAJP,MAMGC,QANH,CADD;AAUA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMK,qBAAqB,GAAG,6BAAgBR,YAAhB,EAA8B,cAA9B,CAA9B;eAEeQ,qB","sourcesContent":["/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\nimport { Flex } from '../../flex';\nimport { Grid } from '../../grid';\nimport { useControlGroup } from './hook';\nimport { contextConnect } from '../context';\n\n/**\n * @param {import('../context').WordPressComponentProps<import('./types').Props, 'div'>} props\n * @param {import('react').
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/ui/control-group/component.js"],"names":["ControlGroup","props","forwardedRef","children","direction","templateColumns","otherProps","isGrid","ConnectedControlGroup"],"mappings":";;;;;;;;;;;;;AAOA;;AACA;;AACA;;AACA;;AAVA;AACA;AACA;;AAEA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA,SAASA,YAAT,CAAuBC,KAAvB,EAA8BC,YAA9B,EAA6C;AAC5C,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,SAAS,GAAG,KAFP;AAGLC,IAAAA,eAHK;AAIL,OAAGC;AAJE,MAKF,2BAAiBL,KAAjB,CALJ;AAOA,QAAMM,MAAM,GAAG,CAAC,CAAEF,eAAlB;;AAEA,MAAKE,MAAL,EAAc;AACb,WACC,4BAAC,UAAD;AACC,MAAA,GAAG,EAAG,CADP;AAEC,MAAA,eAAe,EAAGF;AAFnB,OAGMC,UAHN;AAIC,MAAA,GAAG,EAAGJ;AAJP,QAMGC,QANH,CADD;AAUA;;AAED,SACC,4BAAC,UAAD;AACC,IAAA,SAAS,EAAGC,SADb;AAEC,IAAA,GAAG,EAAI;AAFR,KAGME,UAHN;AAIC,IAAA,GAAG,EAAGJ;AAJP,MAMGC,QANH,CADD;AAUA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMK,qBAAqB,GAAG,6BAAgBR,YAAhB,EAA8B,cAA9B,CAA9B;eAEeQ,qB","sourcesContent":["/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\nimport { Flex } from '../../flex';\nimport { Grid } from '../../grid';\nimport { useControlGroup } from './hook';\nimport { contextConnect } from '../context';\n\n/**\n * @param {import('../context').WordPressComponentProps<import('./types').Props, 'div'>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction ControlGroup( props, forwardedRef ) {\n\tconst {\n\t\tchildren,\n\t\tdirection = 'row',\n\t\ttemplateColumns,\n\t\t...otherProps\n\t} = useControlGroup( props );\n\n\tconst isGrid = !! templateColumns;\n\n\tif ( isGrid ) {\n\t\treturn (\n\t\t\t<Grid\n\t\t\t\tgap={ 0 }\n\t\t\t\ttemplateColumns={ templateColumns }\n\t\t\t\t{ ...otherProps }\n\t\t\t\tref={ forwardedRef }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</Grid>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Flex\n\t\t\tdirection={ direction }\n\t\t\tgap={ `-1px` }\n\t\t\t{ ...otherProps }\n\t\t\tref={ forwardedRef }\n\t\t>\n\t\t\t{ children }\n\t\t</Flex>\n\t);\n}\n\n/**\n * `ControlGroup` is a layout-based component for rendering a group of\n * control-based components, such as `Button`, `Select` or `TextInput`.\n * Control components that render within `ControlGroup` automatically\n * have their borders offset and border-radii rounded.\n *\n * @example\n * ```jsx\n * import { Button, ControlGroup, Select, TextInput } from `@wordpress/components/ui`;\n *\n * function Example() {\n * return (\n * <ControlGroup templateColumns=\"auto 1fr auto\">\n * <Select />\n * <TextInput placeholder=\"First name\" />\n * <Button variant=\"primary\" />\n * </ControlGroup>\n * );\n * }\n * ```\n */\nconst ConnectedControlGroup = contextConnect( ControlGroup, 'ControlGroup' );\n\nexport default ConnectedControlGroup;\n"]}
|
|
@@ -23,7 +23,7 @@ var _hook = require("./hook");
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* @param {import('../context').WordPressComponentProps<import('./types').Props, 'label', false>} props
|
|
26
|
-
* @param {import('react').
|
|
26
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
27
27
|
*/
|
|
28
28
|
function ControlLabel(props, forwardedRef) {
|
|
29
29
|
const controlLabelProps = (0, _hook.useControlLabel)(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/control-label/component.js"],"names":["ControlLabel","props","forwardedRef","controlLabelProps","ConnectedControlLabel"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,YAAT,CAAuBC,KAAvB,EAA8BC,YAA9B,EAA6C;AAC5C,QAAMC,iBAAiB,GAAG,2BAAiBF,KAAjB,CAA1B;AAEA,SAAO,4BAAC,UAAD;AAAM,IAAA,EAAE,EAAC;AAAT,KAAsBE,iBAAtB;AAA0C,IAAA,GAAG,EAAGD;AAAhD,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,qBAAqB,GAAG,6BAAgBJ,YAAhB,EAA8B,cAA9B,CAA9B;eAEeI,qB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../context';\nimport { View } from '../../view';\nimport { useControlLabel } from './hook';\n\n/**\n * @param {import('../context').WordPressComponentProps<import('./types').Props, 'label', false>} props\n * @param {import('react').
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/ui/control-label/component.js"],"names":["ControlLabel","props","forwardedRef","controlLabelProps","ConnectedControlLabel"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,YAAT,CAAuBC,KAAvB,EAA8BC,YAA9B,EAA6C;AAC5C,QAAMC,iBAAiB,GAAG,2BAAiBF,KAAjB,CAA1B;AAEA,SAAO,4BAAC,UAAD;AAAM,IAAA,EAAE,EAAC;AAAT,KAAsBE,iBAAtB;AAA0C,IAAA,GAAG,EAAGD;AAAhD,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,qBAAqB,GAAG,6BAAgBJ,YAAhB,EAA8B,cAA9B,CAA9B;eAEeI,qB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../context';\nimport { View } from '../../view';\nimport { useControlLabel } from './hook';\n\n/**\n * @param {import('../context').WordPressComponentProps<import('./types').Props, 'label', false>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction ControlLabel( props, forwardedRef ) {\n\tconst controlLabelProps = useControlLabel( props );\n\n\treturn <View as=\"label\" { ...controlLabelProps } ref={ forwardedRef } />;\n}\n\n/**\n * `ControlLabel` is a form component that works with `FormGroup` to provide a\n * label for form elements (e.g. `Switch` or `TextInput`).\n *\n * ```jsx\n * import { ControlLabel, FormGroup, TextInput } from '@wordpress/components/ui';\n *\n * function Example() {\n * \treturn (\n * \t\t<FormGroup>\n * \t\t\t<ControlLabel>First Name</ControlLabel>\n * \t\t\t<TextInput />\n * \t\t</FormGroup>\n * \t);\n * }\n * ```\n */\nconst ConnectedControlLabel = contextConnect( ControlLabel, 'ControlLabel' );\n\nexport default ConnectedControlLabel;\n"]}
|
|
@@ -27,7 +27,7 @@ var _useFormGroup = require("./use-form-group");
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* @param {import('../context').WordPressComponentProps<import('./types').FormGroupProps, 'div'>} props
|
|
30
|
-
* @param {import('react').
|
|
30
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
31
31
|
*/
|
|
32
32
|
function FormGroup(props, forwardedRef) {
|
|
33
33
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/form-group/form-group.js"],"names":["FormGroup","props","forwardedRef","contentProps","horizontal","otherProps","ConnectedFormGroup"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAPA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA,SAASA,SAAT,CAAoBC,KAApB,EAA2BC,YAA3B,EAA0C;AACzC,QAAM;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA,UAAhB;AAA4B,OAAGC;AAA/B,MAA8C,gCAAcJ,KAAd,CAApD;;AAEA,MAAKG,UAAL,EAAkB;AACjB,WACC,4BAAC,UAAD;AACC,MAAA,eAAe,EAAC;AADjB,OAEMC,UAFN;AAGC,MAAA,GAAG,EAAGH;AAHP,QAKC,4BAAC,yBAAD,EAAuBC,YAAvB,CALD,CADD;AASA;;AAED,SACC,4BAAC,UAAD,6BAAWE,UAAX;AAAwB,IAAA,GAAG,EAAGH;AAA9B,MACC,4BAAC,yBAAD,EAAuBC,YAAvB,CADD,CADD;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,kBAAkB,GAAG,6BAAgBN,SAAhB,EAA2B,WAA3B,CAA3B;eAEeM,kB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../context';\nimport { Grid } from '../../grid';\nimport { View } from '../../view';\nimport FormGroupContent from './form-group-content';\nimport { useFormGroup } from './use-form-group';\n\n/**\n * @param {import('../context').WordPressComponentProps<import('./types').FormGroupProps, 'div'>} props\n * @param {import('react').
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/ui/form-group/form-group.js"],"names":["FormGroup","props","forwardedRef","contentProps","horizontal","otherProps","ConnectedFormGroup"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAPA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA,SAASA,SAAT,CAAoBC,KAApB,EAA2BC,YAA3B,EAA0C;AACzC,QAAM;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA,UAAhB;AAA4B,OAAGC;AAA/B,MAA8C,gCAAcJ,KAAd,CAApD;;AAEA,MAAKG,UAAL,EAAkB;AACjB,WACC,4BAAC,UAAD;AACC,MAAA,eAAe,EAAC;AADjB,OAEMC,UAFN;AAGC,MAAA,GAAG,EAAGH;AAHP,QAKC,4BAAC,yBAAD,EAAuBC,YAAvB,CALD,CADD;AASA;;AAED,SACC,4BAAC,UAAD,6BAAWE,UAAX;AAAwB,IAAA,GAAG,EAAGH;AAA9B,MACC,4BAAC,yBAAD,EAAuBC,YAAvB,CADD,CADD;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,kBAAkB,GAAG,6BAAgBN,SAAhB,EAA2B,WAA3B,CAA3B;eAEeM,kB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../context';\nimport { Grid } from '../../grid';\nimport { View } from '../../view';\nimport FormGroupContent from './form-group-content';\nimport { useFormGroup } from './use-form-group';\n\n/**\n * @param {import('../context').WordPressComponentProps<import('./types').FormGroupProps, 'div'>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction FormGroup( props, forwardedRef ) {\n\tconst { contentProps, horizontal, ...otherProps } = useFormGroup( props );\n\n\tif ( horizontal ) {\n\t\treturn (\n\t\t\t<Grid\n\t\t\t\ttemplateColumns=\"minmax(0, 1fr) 2fr\"\n\t\t\t\t{ ...otherProps }\n\t\t\t\tref={ forwardedRef }\n\t\t\t>\n\t\t\t\t<FormGroupContent { ...contentProps } />\n\t\t\t</Grid>\n\t\t);\n\t}\n\n\treturn (\n\t\t<View { ...otherProps } ref={ forwardedRef }>\n\t\t\t<FormGroupContent { ...contentProps } />\n\t\t</View>\n\t);\n}\n\n/**\n * `FormGroup` is a form component that groups a label with a form element (e.g. `Switch` or `TextInput`).\n *\n * @example\n * ```jsx\n * import { FormGroup, TextInput } from `@wordpress/components/ui`;\n *\n * function Example() {\n * \treturn (\n * \t\t<FormGroup label=\"First name\">\n * \t\t\t<TextInput />\n * \t\t</FormGroup>\n * \t);\n * }\n * ```\n */\nconst ConnectedFormGroup = contextConnect( FormGroup, 'FormGroup' );\n\nexport default ConnectedFormGroup;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/shortcut/component.tsx"],"names":["Shortcut","props","forwardedRef","as","asProp","shortcut","className","otherProps","displayText","ariaLabel","display","ConnectedShortcut"],"mappings":";;;;;;;;;;;;;AAQA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;AAkBA,SAASA,QAAT,CACCC,KADD,EAECC,YAFD,EAGsB;AACrB,QAAM;AACLC,IAAAA,EAAE,EAAEC,MAAM,GAAG,MADR;AAELC,IAAAA,QAFK;AAGLC,IAAAA,SAHK;AAIL,OAAGC;AAJE,MAKF,+BAAkBN,KAAlB,EAAyB,UAAzB,CALJ;;AAMA,MAAK,CAAEI,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,MAAIG,WAAJ;AACA,MAAIC,SAAJ;;AAEA,MAAK,OAAOJ,QAAP,KAAoB,QAAzB,EAAoC;AACnCG,IAAAA,WAAW,GAAGH,QAAd;AACA,GAFD,MAEO;AACNG,IAAAA,WAAW,GAAGH,QAAQ,CAACK,OAAvB;AACAD,IAAAA,SAAS,GAAGJ,QAAQ,CAACI,SAArB;AACA;;AAED,SACC,4BAAC,UAAD;AACC,IAAA,EAAE,EAAGL,MADN;AAEC,IAAA,SAAS,EAAGE,SAFb;AAGC,kBAAaG,SAHd;AAIC,IAAA,GAAG,EAAGP;AAJP,KAKMK,UALN,GAOGC,WAPH,CADD;AAWA;;AAED,MAAMG,iBAAiB,GAAG,6BAAgBX,QAAhB,EAA0B,UAA1B,CAA1B;eAEeW,iB","sourcesContent":["/**\n * External dependencies\n */\nimport type {
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/ui/shortcut/component.tsx"],"names":["Shortcut","props","forwardedRef","as","asProp","shortcut","className","otherProps","displayText","ariaLabel","display","ConnectedShortcut"],"mappings":";;;;;;;;;;;;;AAQA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;AAkBA,SAASA,QAAT,CACCC,KADD,EAECC,YAFD,EAGsB;AACrB,QAAM;AACLC,IAAAA,EAAE,EAAEC,MAAM,GAAG,MADR;AAELC,IAAAA,QAFK;AAGLC,IAAAA,SAHK;AAIL,OAAGC;AAJE,MAKF,+BAAkBN,KAAlB,EAAyB,UAAzB,CALJ;;AAMA,MAAK,CAAEI,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,MAAIG,WAAJ;AACA,MAAIC,SAAJ;;AAEA,MAAK,OAAOJ,QAAP,KAAoB,QAAzB,EAAoC;AACnCG,IAAAA,WAAW,GAAGH,QAAd;AACA,GAFD,MAEO;AACNG,IAAAA,WAAW,GAAGH,QAAQ,CAACK,OAAvB;AACAD,IAAAA,SAAS,GAAGJ,QAAQ,CAACI,SAArB;AACA;;AAED,SACC,4BAAC,UAAD;AACC,IAAA,EAAE,EAAGL,MADN;AAEC,IAAA,SAAS,EAAGE,SAFb;AAGC,kBAAaG,SAHd;AAIC,IAAA,GAAG,EAAGP;AAJP,KAKMK,UALN,GAOGC,WAPH,CADD;AAWA;;AAED,MAAMG,iBAAiB,GAAG,6BAAgBX,QAAhB,EAA0B,UAA1B,CAA1B;eAEeW,iB","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseContextSystem,\n\tcontextConnect,\n\tWordPressComponentProps,\n} from '../context';\nimport { View } from '../../view';\n\nexport interface ShortcutDescription {\n\tdisplay: string;\n\tariaLabel: string;\n}\n\nexport interface Props {\n\tshortcut?: ShortcutDescription | string;\n\tclassName?: string;\n}\n\nfunction Shortcut(\n\tprops: WordPressComponentProps< Props, 'span' >,\n\tforwardedRef: ForwardedRef< any >\n): JSX.Element | null {\n\tconst {\n\t\tas: asProp = 'span',\n\t\tshortcut,\n\t\tclassName,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Shortcut' );\n\tif ( ! shortcut ) {\n\t\treturn null;\n\t}\n\n\tlet displayText: string;\n\tlet ariaLabel: string | undefined;\n\n\tif ( typeof shortcut === 'string' ) {\n\t\tdisplayText = shortcut;\n\t} else {\n\t\tdisplayText = shortcut.display;\n\t\tariaLabel = shortcut.ariaLabel;\n\t}\n\n\treturn (\n\t\t<View\n\t\t\tas={ asProp }\n\t\t\tclassName={ className }\n\t\t\taria-label={ ariaLabel }\n\t\t\tref={ forwardedRef }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t{ displayText }\n\t\t</View>\n\t);\n}\n\nconst ConnectedShortcut = contextConnect( Shortcut, 'Shortcut' );\n\nexport default ConnectedShortcut;\n"]}
|
|
@@ -36,7 +36,7 @@ var _colorsValues = require("../../utils/colors-values");
|
|
|
36
36
|
/**
|
|
37
37
|
*
|
|
38
38
|
* @param {import('../context').WordPressComponentProps<Props, 'div'>} props
|
|
39
|
-
* @param {import('react').
|
|
39
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
40
40
|
*/
|
|
41
41
|
function Spinner(props, forwardedRef) {
|
|
42
42
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/spinner/component.js"],"names":["Spinner","props","forwardedRef","color","COLORS","black","size","BASE_SIZE","otherProps","ratio","scale","WRAPPER_SIZE","transform","styles","height","width"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;;AAMA;;AACA;AACA;AACA;AACA;AACA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAT,CAAkBC,KAAlB,EAAyBC,YAAzB,EAAwC;AACvC,QAAM;AACLC,IAAAA,KAAK,GAAGC,qBAAOC,KADV;AAELC,IAAAA,IAAI,GAAGC,gBAFF;AAGL,OAAGC;AAHE,MAIF,+BAAkBP,KAAlB,EAAyB,SAAzB,CAJJ;AAKA,QAAMQ,KAAK,GAAGH,IAAI,GAAGC,gBAArB;AACA,QAAMG,KAAK,GAAKD,KAAK,GAAGF,gBAAV,GAAwBI,mBAAtC;AACA,QAAMC,SAAS,GAAI,SAASF,KAAO,GAAnC;AAEA,QAAMG,MAAM,GAAG;AAAED,IAAAA;AAAF,GAAf;AAEA,SACC,4BAAC,qBAAD,6BACMJ,UADN;AAEC,iBAAY,IAFb;AAGC,IAAA,GAAG,EAAGN,YAHP;AAIC,IAAA,KAAK,EAAG;AAAEY,MAAAA,MAAM,EAAER,IAAV;AAAgBS,MAAAA,KAAK,EAAET;AAAvB;AAJT,MAMC,4BAAC,uBAAD;AAAiB,mBAAc,IAA/B;AAAsC,IAAA,KAAK,EAAGO;AAA9C,KACC,4BAAC,gBAAD;AAAU,IAAA,KAAK,EAAG;AAAEV,MAAAA;AAAF;AAAlB,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,IADD,EAEC;AAAK,IAAA,SAAS,EAAC;AAAf,IAFD,EAGC;AAAK,IAAA,SAAS,EAAC;AAAf,IAHD,EAIC;AAAK,IAAA,SAAS,EAAC;AAAf,IAJD,EAKC;AAAK,IAAA,SAAS,EAAC;AAAf,IALD,EAMC;AAAK,IAAA,SAAS,EAAC;AAAf,IAND,EAOC;AAAK,IAAA,SAAS,EAAC;AAAf,IAPD,EAQC;AAAK,IAAA,SAAS,EAAC;AAAf,IARD,EASC;AAAK,IAAA,SAAS,EAAC;AAAf,IATD,EAUC;AAAK,IAAA,SAAS,EAAC;AAAf,IAVD,EAWC;AAAK,IAAA,SAAS,EAAC;AAAf,IAXD,EAYC;AAAK,IAAA,SAAS,EAAC;AAAf,IAZD,CADD,CAND,CADD;AAyBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;eACe,6BAAgBH,OAAhB,EAAyB,SAAzB,C","sourcesContent":["/**\n * Internal dependencies\n */\nimport { BarsView, BarsWrapperView, ContainerView } from './styles';\nimport { BASE_SIZE, WRAPPER_SIZE } from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport { COLORS } from '../../utils/colors-values';\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * @typedef Props\n * @property {import('react').CSSProperties['color']} [color] Color of `Spinner`.\n * @property {number} [size=16] Size of `Spinner`.\n */\n/* eslint-enable jsdoc/valid-types */\n\n/**\n *\n * @param {import('../context').WordPressComponentProps<Props, 'div'>} props\n * @param {import('react').
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/ui/spinner/component.js"],"names":["Spinner","props","forwardedRef","color","COLORS","black","size","BASE_SIZE","otherProps","ratio","scale","WRAPPER_SIZE","transform","styles","height","width"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;;AAMA;;AACA;AACA;AACA;AACA;AACA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAT,CAAkBC,KAAlB,EAAyBC,YAAzB,EAAwC;AACvC,QAAM;AACLC,IAAAA,KAAK,GAAGC,qBAAOC,KADV;AAELC,IAAAA,IAAI,GAAGC,gBAFF;AAGL,OAAGC;AAHE,MAIF,+BAAkBP,KAAlB,EAAyB,SAAzB,CAJJ;AAKA,QAAMQ,KAAK,GAAGH,IAAI,GAAGC,gBAArB;AACA,QAAMG,KAAK,GAAKD,KAAK,GAAGF,gBAAV,GAAwBI,mBAAtC;AACA,QAAMC,SAAS,GAAI,SAASF,KAAO,GAAnC;AAEA,QAAMG,MAAM,GAAG;AAAED,IAAAA;AAAF,GAAf;AAEA,SACC,4BAAC,qBAAD,6BACMJ,UADN;AAEC,iBAAY,IAFb;AAGC,IAAA,GAAG,EAAGN,YAHP;AAIC,IAAA,KAAK,EAAG;AAAEY,MAAAA,MAAM,EAAER,IAAV;AAAgBS,MAAAA,KAAK,EAAET;AAAvB;AAJT,MAMC,4BAAC,uBAAD;AAAiB,mBAAc,IAA/B;AAAsC,IAAA,KAAK,EAAGO;AAA9C,KACC,4BAAC,gBAAD;AAAU,IAAA,KAAK,EAAG;AAAEV,MAAAA;AAAF;AAAlB,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,IADD,EAEC;AAAK,IAAA,SAAS,EAAC;AAAf,IAFD,EAGC;AAAK,IAAA,SAAS,EAAC;AAAf,IAHD,EAIC;AAAK,IAAA,SAAS,EAAC;AAAf,IAJD,EAKC;AAAK,IAAA,SAAS,EAAC;AAAf,IALD,EAMC;AAAK,IAAA,SAAS,EAAC;AAAf,IAND,EAOC;AAAK,IAAA,SAAS,EAAC;AAAf,IAPD,EAQC;AAAK,IAAA,SAAS,EAAC;AAAf,IARD,EASC;AAAK,IAAA,SAAS,EAAC;AAAf,IATD,EAUC;AAAK,IAAA,SAAS,EAAC;AAAf,IAVD,EAWC;AAAK,IAAA,SAAS,EAAC;AAAf,IAXD,EAYC;AAAK,IAAA,SAAS,EAAC;AAAf,IAZD,CADD,CAND,CADD;AAyBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;eACe,6BAAgBH,OAAhB,EAAyB,SAAzB,C","sourcesContent":["/**\n * Internal dependencies\n */\nimport { BarsView, BarsWrapperView, ContainerView } from './styles';\nimport { BASE_SIZE, WRAPPER_SIZE } from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport { COLORS } from '../../utils/colors-values';\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * @typedef Props\n * @property {import('react').CSSProperties['color']} [color] Color of `Spinner`.\n * @property {number} [size=16] Size of `Spinner`.\n */\n/* eslint-enable jsdoc/valid-types */\n\n/**\n *\n * @param {import('../context').WordPressComponentProps<Props, 'div'>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction Spinner( props, forwardedRef ) {\n\tconst {\n\t\tcolor = COLORS.black,\n\t\tsize = BASE_SIZE,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Spinner' );\n\tconst ratio = size / BASE_SIZE;\n\tconst scale = ( ratio * BASE_SIZE ) / WRAPPER_SIZE;\n\tconst transform = `scale(${ scale })`;\n\n\tconst styles = { transform };\n\n\treturn (\n\t\t<ContainerView\n\t\t\t{ ...otherProps }\n\t\t\taria-busy={ true }\n\t\t\tref={ forwardedRef }\n\t\t\tstyle={ { height: size, width: size } }\n\t\t>\n\t\t\t<BarsWrapperView aria-hidden={ true } style={ styles }>\n\t\t\t\t<BarsView style={ { color } }>\n\t\t\t\t\t<div className=\"InnerBar1\" />\n\t\t\t\t\t<div className=\"InnerBar2\" />\n\t\t\t\t\t<div className=\"InnerBar3\" />\n\t\t\t\t\t<div className=\"InnerBar4\" />\n\t\t\t\t\t<div className=\"InnerBar5\" />\n\t\t\t\t\t<div className=\"InnerBar6\" />\n\t\t\t\t\t<div className=\"InnerBar7\" />\n\t\t\t\t\t<div className=\"InnerBar8\" />\n\t\t\t\t\t<div className=\"InnerBar9\" />\n\t\t\t\t\t<div className=\"InnerBar10\" />\n\t\t\t\t\t<div className=\"InnerBar11\" />\n\t\t\t\t\t<div className=\"InnerBar12\" />\n\t\t\t\t</BarsView>\n\t\t\t</BarsWrapperView>\n\t\t</ContainerView>\n\t);\n}\n\n/**\n * `Spinner` is a component that notify users that their action is being processed.\n *\n * @example\n * ```jsx\n * import { Spinner } from `@wordpress/components/ui`;\n *\n * function Example() {\n * \treturn (\n * \t\t<Spinner />\n * \t);\n * }\n * ```\n */\nexport default contextConnect( Spinner, 'Spinner' );\n"]}
|
|
@@ -36,7 +36,7 @@ var _styles = require("./styles");
|
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* @param {import('../context').WordPressComponentProps<import('./types').Props, 'div'>} props
|
|
39
|
-
* @param {import('react').
|
|
39
|
+
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
40
40
|
*/
|
|
41
41
|
function Tooltip(props, forwardedRef) {
|
|
42
42
|
const {
|