@wordpress/components 23.9.0 → 25.0.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 +62 -0
- package/CONTRIBUTING.md +75 -1
- package/README.md +1 -3
- package/build/autocomplete/autocompleter-ui.js +0 -2
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/index.js +2 -0
- package/build/autocomplete/index.js.map +1 -1
- package/build/button/index.js +2 -0
- package/build/button/index.js.map +1 -1
- package/build/card/card-media/component.js +2 -1
- package/build/card/card-media/component.js.map +1 -1
- package/build/color-picker/styles.js +8 -8
- package/build/color-picker/styles.js.map +1 -1
- package/build/combobox-control/index.js +7 -5
- package/build/combobox-control/index.js.map +1 -1
- package/build/combobox-control/styles.js +3 -3
- package/build/combobox-control/styles.js.map +1 -1
- package/build/date-time/date-time/index.js +3 -84
- package/build/date-time/date-time/index.js.map +1 -1
- package/build/date-time/date-time/styles.js +4 -19
- package/build/date-time/date-time/styles.js.map +1 -1
- package/build/dimension-control/index.js +1 -1
- package/build/dimension-control/index.js.map +1 -1
- package/build/draggable/index.js +2 -7
- package/build/draggable/index.js.map +1 -1
- package/build/dropdown-menu/index.js +87 -11
- package/build/dropdown-menu/index.js.map +1 -1
- package/build/dropdown-menu/types.js +6 -0
- package/build/dropdown-menu/types.js.map +1 -0
- package/build/dropdown-menu-v2/index.js +195 -0
- package/build/dropdown-menu-v2/index.js.map +1 -0
- package/build/dropdown-menu-v2/styles.js +176 -0
- package/build/dropdown-menu-v2/styles.js.map +1 -0
- package/build/dropdown-menu-v2/types.js +6 -0
- package/build/dropdown-menu-v2/types.js.map +1 -0
- package/build/form-token-field/index.js +5 -3
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/styles.js +3 -3
- package/build/form-token-field/styles.js.map +1 -1
- package/build/index.native.js +0 -9
- package/build/index.native.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +30 -23
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +16 -8
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-cell.native.js +3 -2
- package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js +4 -2
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/switch-cell.native.js +8 -2
- package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet-select-control/index.native.js +4 -2
- package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet-text-control/index.native.js +4 -2
- package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build/mobile/global-styles-context/index.native.js +13 -1
- package/build/mobile/global-styles-context/index.native.js.map +1 -1
- package/build/mobile/link-picker/link-picker-results.native.js +3 -1
- package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build/navigable-container/container.js +39 -19
- package/build/navigable-container/container.js.map +1 -1
- package/build/navigable-container/index.js.map +1 -1
- package/build/navigable-container/menu.js +37 -5
- package/build/navigable-container/menu.js.map +1 -1
- package/build/navigable-container/tabbable.js +45 -4
- package/build/navigable-container/tabbable.js.map +1 -1
- package/build/navigable-container/types.js +6 -0
- package/build/navigable-container/types.js.map +1 -0
- package/build/palette-edit/index.js +34 -12
- package/build/palette-edit/index.js.map +1 -1
- package/build/private-apis.js +13 -1
- package/build/private-apis.js.map +1 -1
- package/build/range-control/index.native.js +5 -2
- package/build/range-control/index.native.js.map +1 -1
- package/build/sandbox/index.native.js +6 -2
- package/build/sandbox/index.native.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/fill.js +2 -1
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +45 -35
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/use-slot.js +11 -26
- package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
- package/build/slot-fill/fill.js +7 -31
- package/build/slot-fill/fill.js.map +1 -1
- package/build/slot-fill/index.js.map +1 -1
- package/build/slot-fill/provider.js +0 -6
- package/build/slot-fill/provider.js.map +1 -1
- package/build/slot-fill/slot.js +0 -5
- package/build/slot-fill/slot.js.map +1 -1
- package/build/snackbar/list.js +0 -2
- package/build/snackbar/list.js.map +1 -1
- package/build/tab-panel/index.js.map +1 -1
- package/build/theme/color-algorithms.js +1 -1
- package/build/theme/color-algorithms.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toolbar/toolbar-button/index.js +1 -2
- package/build/toolbar/toolbar-button/index.js.map +1 -1
- package/build/toolbar/toolbar-item/index.js +4 -2
- package/build/toolbar/toolbar-item/index.js.map +1 -1
- package/build/utils/colors-values.js +3 -3
- package/build/utils/colors-values.js.map +1 -1
- package/build/utils/use-deprecated-props.js +35 -0
- package/build/utils/use-deprecated-props.js.map +1 -0
- package/build-module/autocomplete/autocompleter-ui.js +1 -3
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/index.js +3 -3
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/button/index.js +2 -0
- package/build-module/button/index.js.map +1 -1
- package/build-module/card/card-media/component.js +2 -1
- package/build-module/card/card-media/component.js.map +1 -1
- package/build-module/color-picker/styles.js +8 -8
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/combobox-control/index.js +6 -5
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/combobox-control/styles.js +3 -3
- package/build-module/combobox-control/styles.js.map +1 -1
- package/build-module/date-time/date-time/index.js +6 -81
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/date-time/date-time/styles.js +3 -17
- package/build-module/date-time/date-time/styles.js.map +1 -1
- package/build-module/dimension-control/index.js +1 -1
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/draggable/index.js +2 -7
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/dropdown-menu/index.js +87 -10
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/types.js +2 -0
- package/build-module/dropdown-menu/types.js.map +1 -0
- package/build-module/dropdown-menu-v2/index.js +149 -0
- package/build-module/dropdown-menu-v2/index.js.map +1 -0
- package/build-module/dropdown-menu-v2/styles.js +153 -0
- package/build-module/dropdown-menu-v2/styles.js.map +1 -0
- package/build-module/dropdown-menu-v2/types.js +2 -0
- package/build-module/dropdown-menu-v2/types.js.map +1 -0
- package/build-module/form-token-field/index.js +4 -3
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/styles.js +3 -3
- package/build-module/form-token-field/styles.js.map +1 -1
- package/build-module/index.native.js +0 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +30 -23
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +16 -8
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-cell.native.js +3 -2
- package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +4 -2
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/switch-cell.native.js +7 -2
- package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-select-control/index.native.js +4 -2
- package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-text-control/index.native.js +4 -2
- package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/index.native.js +13 -1
- package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-results.native.js +3 -1
- package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build-module/navigable-container/container.js +43 -19
- package/build-module/navigable-container/container.js.map +1 -1
- package/build-module/navigable-container/index.js +0 -2
- package/build-module/navigable-container/index.js.map +1 -1
- package/build-module/navigable-container/menu.js +36 -4
- package/build-module/navigable-container/menu.js.map +1 -1
- package/build-module/navigable-container/tabbable.js +44 -3
- package/build-module/navigable-container/tabbable.js.map +1 -1
- package/build-module/navigable-container/types.js +2 -0
- package/build-module/navigable-container/types.js.map +1 -0
- package/build-module/palette-edit/index.js +34 -13
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/private-apis.js +12 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/range-control/index.native.js +5 -2
- package/build-module/range-control/index.native.js.map +1 -1
- package/build-module/sandbox/index.native.js +6 -2
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js +2 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +46 -36
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot.js +12 -27
- package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
- package/build-module/slot-fill/fill.js +7 -31
- package/build-module/slot-fill/fill.js.map +1 -1
- package/build-module/slot-fill/index.js +1 -2
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/slot-fill/provider.js +0 -6
- package/build-module/slot-fill/provider.js.map +1 -1
- package/build-module/slot-fill/slot.js +0 -5
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/snackbar/list.js +0 -2
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/theme/color-algorithms.js +1 -1
- package/build-module/theme/color-algorithms.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toolbar/toolbar-button/index.js +1 -2
- package/build-module/toolbar/toolbar-button/index.js.map +1 -1
- package/build-module/toolbar/toolbar-item/index.js +5 -2
- package/build-module/toolbar/toolbar-item/index.js.map +1 -1
- package/build-module/utils/colors-values.js +3 -3
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-module/utils/use-deprecated-props.js +25 -0
- package/build-module/utils/use-deprecated-props.js.map +1 -0
- package/build-style/style-rtl.css +67 -67
- package/build-style/style.css +67 -67
- package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/autocomplete/types.d.ts +2 -18
- package/build-types/autocomplete/types.d.ts.map +1 -1
- package/build-types/button/deprecated.d.ts +6 -0
- package/build-types/button/deprecated.d.ts.map +1 -1
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/button/types.d.ts +7 -0
- package/build-types/button/types.d.ts.map +1 -1
- package/build-types/card/card-media/component.d.ts +2 -1
- package/build-types/card/card-media/component.d.ts.map +1 -1
- package/build-types/card/stories/index.d.ts +21 -1
- package/build-types/card/stories/index.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/combobox-control/index.d.ts +1 -1
- package/build-types/combobox-control/index.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.d.ts.map +1 -1
- package/build-types/combobox-control/styles.d.ts +1 -1
- package/build-types/combobox-control/types.d.ts +8 -1
- package/build-types/combobox-control/types.d.ts.map +1 -1
- package/build-types/date-time/date-time/index.d.ts +3 -4
- package/build-types/date-time/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/date-time/styles.d.ts +0 -4
- package/build-types/date-time/date-time/styles.d.ts.map +1 -1
- package/build-types/date-time/stories/date-time.d.ts.map +1 -1
- package/build-types/date-time/types.d.ts +0 -14
- package/build-types/date-time/types.d.ts.map +1 -1
- package/build-types/dimension-control/index.d.ts +1 -1
- package/build-types/draggable/index.d.ts.map +1 -1
- package/build-types/dropdown-menu/index.d.ts +83 -1
- package/build-types/dropdown-menu/index.d.ts.map +1 -1
- package/build-types/dropdown-menu/stories/index.d.ts +13 -0
- package/build-types/dropdown-menu/stories/index.d.ts.map +1 -0
- package/build-types/dropdown-menu/test/index.d.ts +2 -0
- package/build-types/dropdown-menu/test/index.d.ts.map +1 -0
- package/build-types/dropdown-menu/types.d.ts +134 -0
- package/build-types/dropdown-menu/types.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/index.d.ts +17 -0
- package/build-types/dropdown-menu-v2/index.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/stories/index.d.ts +13 -0
- package/build-types/dropdown-menu-v2/stories/index.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/styles.d.ts +41 -0
- package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/test/index.d.ts +2 -0
- package/build-types/dropdown-menu-v2/test/index.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/types.d.ts +242 -0
- package/build-types/dropdown-menu-v2/types.d.ts.map +1 -0
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/styles.d.ts +1 -1
- package/build-types/form-token-field/types.d.ts +8 -1
- package/build-types/form-token-field/types.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/navigable-container/container.d.ts +20 -1
- package/build-types/navigable-container/container.d.ts.map +1 -1
- package/build-types/navigable-container/index.d.ts +5 -2
- package/build-types/navigable-container/index.d.ts.map +1 -1
- package/build-types/navigable-container/menu.d.ts +45 -11
- package/build-types/navigable-container/menu.d.ts.map +1 -1
- package/build-types/navigable-container/stories/navigable-menu.d.ts +12 -0
- package/build-types/navigable-container/stories/navigable-menu.d.ts.map +1 -0
- package/build-types/navigable-container/stories/tabbable-container.d.ts +12 -0
- package/build-types/navigable-container/stories/tabbable-container.d.ts.map +1 -0
- package/build-types/navigable-container/tabbable.d.ts +52 -9
- package/build-types/navigable-container/tabbable.d.ts.map +1 -1
- package/build-types/navigable-container/test/navigable-menu.d.ts +2 -0
- package/build-types/navigable-container/test/navigable-menu.d.ts.map +1 -0
- package/build-types/navigable-container/test/tababble-container.d.ts +2 -0
- package/build-types/navigable-container/test/tababble-container.d.ts.map +1 -0
- package/build-types/navigable-container/types.d.ts +61 -0
- package/build-types/navigable-container/types.d.ts.map +1 -0
- package/build-types/navigator/navigator-back-button/component.d.ts +1 -0
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +1 -0
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +1 -0
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +1 -0
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -0
- package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
- package/build-types/palette-edit/index.d.ts +1 -1
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/palette-edit/stories/index.d.ts.map +1 -1
- package/build-types/palette-edit/types.d.ts +8 -0
- package/build-types/palette-edit/types.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
- package/build-types/slot-fill/fill.d.ts +4 -2
- package/build-types/slot-fill/fill.d.ts.map +1 -1
- package/build-types/slot-fill/index.d.ts +1 -2
- package/build-types/slot-fill/index.d.ts.map +1 -1
- package/build-types/slot-fill/provider.d.ts +0 -2
- package/build-types/slot-fill/provider.d.ts.map +1 -1
- package/build-types/slot-fill/slot.d.ts.map +1 -1
- package/build-types/snackbar/list.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
- package/build-types/toolbar/stories/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/index.d.ts +6 -0
- package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-item/index.d.ts +6 -4
- package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
- package/build-types/tree-grid/types.d.ts +7 -0
- package/build-types/tree-grid/types.d.ts.map +1 -1
- package/build-types/ui/context/get-styled-class-name-from-key.d.ts +1 -10
- package/build-types/ui/context/get-styled-class-name-from-key.d.ts.map +1 -1
- package/build-types/utils/use-deprecated-props.d.ts +9 -0
- package/build-types/utils/use-deprecated-props.d.ts.map +1 -0
- package/package.json +21 -20
- package/src/autocomplete/README.md +78 -52
- package/src/autocomplete/autocompleter-ui.tsx +0 -2
- package/src/autocomplete/index.tsx +1 -2
- package/src/autocomplete/types.ts +3 -19
- package/src/button/index.tsx +2 -0
- package/src/button/style.scss +18 -18
- package/src/button/types.ts +7 -0
- package/src/card/card-media/README.md +1 -1
- package/src/card/card-media/component.tsx +2 -1
- package/src/card/stories/index.tsx +47 -26
- package/src/checkbox-control/style.scss +1 -4
- package/src/color-picker/styles.ts +7 -2
- package/src/combobox-control/index.tsx +24 -18
- package/src/combobox-control/stories/index.tsx +0 -1
- package/src/combobox-control/styles.ts +4 -4
- package/src/combobox-control/types.ts +8 -1
- package/src/custom-gradient-picker/style.scss +2 -2
- package/src/date-time/README.md +0 -16
- package/src/date-time/date-time/index.tsx +17 -155
- package/src/date-time/date-time/styles.ts +0 -4
- package/src/date-time/stories/date-time.tsx +0 -4
- package/src/date-time/types.ts +0 -16
- package/src/dimension-control/index.tsx +1 -1
- package/src/draggable/index.tsx +1 -9
- package/src/dropdown-menu/README.md +12 -22
- package/src/dropdown-menu/{index.js → index.tsx} +111 -25
- package/src/dropdown-menu/stories/{index.js → index.tsx} +14 -22
- package/src/dropdown-menu/test/{index.js → index.tsx} +6 -5
- package/src/dropdown-menu/types.ts +143 -0
- package/src/dropdown-menu-v2/README.md +392 -0
- package/src/dropdown-menu-v2/index.tsx +241 -0
- package/src/dropdown-menu-v2/stories/index.tsx +193 -0
- package/src/dropdown-menu-v2/styles.ts +263 -0
- package/src/dropdown-menu-v2/test/index.tsx +816 -0
- package/src/dropdown-menu-v2/types.ts +250 -0
- package/src/form-toggle/style.scss +1 -5
- package/src/form-token-field/index.tsx +7 -3
- package/src/form-token-field/styles.ts +4 -4
- package/src/form-token-field/types.ts +8 -1
- package/src/index.native.js +0 -1
- package/src/input-control/styles/input-control-styles.tsx +7 -0
- package/src/mobile/bottom-sheet/cell.native.js +26 -5
- package/src/mobile/bottom-sheet/range-cell.native.js +2 -1
- package/src/mobile/bottom-sheet/stepper-cell/index.native.js +2 -0
- package/src/mobile/bottom-sheet/styles.native.scss +13 -1
- package/src/mobile/bottom-sheet/switch-cell.native.js +10 -2
- package/src/mobile/bottom-sheet-select-control/index.native.js +2 -0
- package/src/mobile/bottom-sheet-text-control/index.native.js +2 -0
- package/src/mobile/global-styles-context/index.native.js +12 -1
- package/src/mobile/link-picker/link-picker-results.native.js +3 -0
- package/src/modal/style.scss +1 -1
- package/src/navigable-container/README.md +24 -13
- package/src/navigable-container/{container.js → container.tsx} +57 -27
- package/src/navigable-container/{index.js → index.tsx} +0 -1
- package/src/navigable-container/menu.tsx +100 -0
- package/src/navigable-container/stories/{navigable-menu.js → navigable-menu.tsx} +15 -10
- package/src/navigable-container/stories/{tabbable-container.js → tabbable-container.tsx} +15 -6
- package/src/navigable-container/tabbable.tsx +92 -0
- package/src/navigable-container/test/{navigable-menu.js → navigable-menu.tsx} +3 -1
- package/src/navigable-container/test/{tababble-container.js → tababble-container.tsx} +53 -24
- package/src/navigable-container/types.ts +76 -0
- package/src/palette-edit/index.tsx +45 -7
- package/src/palette-edit/stories/index.tsx +4 -0
- package/src/palette-edit/types.ts +11 -0
- package/src/private-apis.ts +22 -0
- package/src/range-control/index.native.js +3 -0
- package/src/sandbox/index.native.js +4 -0
- package/src/search-control/style.scss +2 -0
- package/src/slot-fill/bubbles-virtually/fill.js +2 -1
- package/src/slot-fill/bubbles-virtually/slot-fill-provider.js +46 -60
- package/src/slot-fill/bubbles-virtually/use-slot.js +14 -41
- package/src/slot-fill/fill.js +4 -26
- package/src/slot-fill/index.js +1 -3
- package/src/slot-fill/provider.js +0 -6
- package/src/slot-fill/slot.js +0 -5
- package/src/snackbar/list.tsx +0 -1
- package/src/style.scss +6 -0
- package/src/tab-panel/index.tsx +1 -1
- package/src/theme/color-algorithms.ts +1 -1
- package/src/theme/stories/index.tsx +1 -1
- package/src/theme/test/color-algorithms.ts +2 -2
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +10 -6
- package/src/toggle-group-control/toggle-group-control/styles.ts +6 -1
- package/src/toolbar/stories/index.tsx +25 -26
- package/src/toolbar/toolbar-button/index.tsx +10 -13
- package/src/toolbar/toolbar-item/{index.js → index.tsx} +12 -3
- package/src/tooltip/style.scss +2 -2
- package/src/tree-grid/README.md +18 -0
- package/src/tree-grid/types.ts +7 -0
- package/src/utils/colors-values.js +3 -3
- package/src/utils/theme-variables.scss +4 -4
- package/src/utils/use-deprecated-props.ts +29 -0
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/mobile/readable-content-view/index.native.js +0 -97
- package/build/mobile/readable-content-view/index.native.js.map +0 -1
- package/build-module/mobile/readable-content-view/index.native.js +0 -81
- package/build-module/mobile/readable-content-view/index.native.js.map +0 -1
- package/src/CONTRIBUTING.md +0 -78
- package/src/README.md +0 -20
- package/src/mobile/readable-content-view/index.native.js +0 -85
- package/src/mobile/readable-content-view/style.native.scss +0 -30
- package/src/navigable-container/menu.js +0 -62
- package/src/navigable-container/tabbable.js +0 -46
|
@@ -30,68 +30,78 @@ var _slotFillContext = _interopRequireDefault(require("./slot-fill-context"));
|
|
|
30
30
|
/**
|
|
31
31
|
* Internal dependencies
|
|
32
32
|
*/
|
|
33
|
-
function
|
|
34
|
-
const slots = (0,
|
|
35
|
-
const fills = (0,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
slots.
|
|
33
|
+
function createSlotRegistry() {
|
|
34
|
+
const slots = (0, _utils.proxyMap)();
|
|
35
|
+
const fills = (0, _utils.proxyMap)();
|
|
36
|
+
|
|
37
|
+
function registerSlot(name, ref, fillProps) {
|
|
38
|
+
const slot = slots.get(name) || {};
|
|
39
|
+
slots.set(name, (0, _valtio.ref)({ ...slot,
|
|
39
40
|
ref: ref || slot.ref,
|
|
40
41
|
fillProps: fillProps || slot.fillProps || {}
|
|
41
42
|
}));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function unregisterSlot(name, ref) {
|
|
46
|
+
var _slots$get;
|
|
45
47
|
|
|
46
48
|
// Make sure we're not unregistering a slot registered by another element
|
|
47
49
|
// See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412
|
|
48
|
-
if (((_slots$
|
|
49
|
-
slots.
|
|
50
|
+
if (((_slots$get = slots.get(name)) === null || _slots$get === void 0 ? void 0 : _slots$get.ref) === ref) {
|
|
51
|
+
slots.delete(name);
|
|
50
52
|
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function updateSlot(name, fillProps) {
|
|
56
|
+
const slot = slots.get(name);
|
|
54
57
|
|
|
55
58
|
if (!slot) {
|
|
56
59
|
return;
|
|
57
60
|
}
|
|
58
61
|
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
if ((0, _isShallowEqual.default)(slot.fillProps, fillProps)) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
slot.fillProps = fillProps;
|
|
67
|
+
const slotFills = fills.get(name);
|
|
62
68
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
69
|
+
if (slotFills) {
|
|
70
|
+
// Force update fills.
|
|
71
|
+
slotFills.map(fill => fill.current.rerender());
|
|
67
72
|
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function registerFill(name, ref) {
|
|
76
|
+
fills.set(name, (0, _valtio.ref)([...(fills.get(name) || []), ref]));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function unregisterFill(name, ref) {
|
|
80
|
+
const fillsForName = fills.get(name);
|
|
81
|
+
|
|
82
|
+
if (!fillsForName) {
|
|
83
|
+
return;
|
|
75
84
|
}
|
|
76
|
-
}, []); // Memoizing the return value so it can be directly passed to Provider value
|
|
77
85
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
86
|
+
fills.set(name, (0, _valtio.ref)(fillsForName.filter(fillRef => fillRef !== ref)));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
slots,
|
|
91
|
+
fills,
|
|
81
92
|
registerSlot,
|
|
82
93
|
updateSlot,
|
|
83
94
|
unregisterSlot,
|
|
84
95
|
registerFill,
|
|
85
96
|
unregisterFill
|
|
86
|
-
}
|
|
87
|
-
return registry;
|
|
97
|
+
};
|
|
88
98
|
}
|
|
89
99
|
|
|
90
100
|
function SlotFillProvider(_ref) {
|
|
91
101
|
let {
|
|
92
102
|
children
|
|
93
103
|
} = _ref;
|
|
94
|
-
const registry =
|
|
104
|
+
const [registry] = (0, _element.useState)(createSlotRegistry);
|
|
95
105
|
return (0, _element.createElement)(_slotFillContext.default.Provider, {
|
|
96
106
|
value: registry
|
|
97
107
|
}, children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/slot-fill-provider.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/slot-fill-provider.js"],"names":["createSlotRegistry","slots","fills","registerSlot","name","ref","fillProps","slot","get","set","unregisterSlot","delete","updateSlot","slotFills","map","fill","current","rerender","registerFill","unregisterFill","fillsForName","filter","fillRef","SlotFillProvider","children","registry"],"mappings":";;;;;;;;;AAUA;;AANA;;AACA;;AAMA;;AAKA;;AAhBA;;AACA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;AAGA,SAASA,kBAAT,GAA8B;AAC7B,QAAMC,KAAK,GAAG,sBAAd;AACA,QAAMC,KAAK,GAAG,sBAAd;;AAEA,WAASC,YAAT,CAAuBC,IAAvB,EAA6BC,GAA7B,EAAkCC,SAAlC,EAA8C;AAC7C,UAAMC,IAAI,GAAGN,KAAK,CAACO,GAAN,CAAWJ,IAAX,KAAqB,EAAlC;AACAH,IAAAA,KAAK,CAACQ,GAAN,CACCL,IADD,EAEC,iBAAQ,EACP,GAAGG,IADI;AAEPF,MAAAA,GAAG,EAAEA,GAAG,IAAIE,IAAI,CAACF,GAFV;AAGPC,MAAAA,SAAS,EAAEA,SAAS,IAAIC,IAAI,CAACD,SAAlB,IAA+B;AAHnC,KAAR,CAFD;AAQA;;AAED,WAASI,cAAT,CAAyBN,IAAzB,EAA+BC,GAA/B,EAAqC;AAAA;;AACpC;AACA;AACA,QAAK,eAAAJ,KAAK,CAACO,GAAN,CAAWJ,IAAX,2DAAmBC,GAAnB,MAA2BA,GAAhC,EAAsC;AACrCJ,MAAAA,KAAK,CAACU,MAAN,CAAcP,IAAd;AACA;AACD;;AAED,WAASQ,UAAT,CAAqBR,IAArB,EAA2BE,SAA3B,EAAuC;AACtC,UAAMC,IAAI,GAAGN,KAAK,CAACO,GAAN,CAAWJ,IAAX,CAAb;;AACA,QAAK,CAAEG,IAAP,EAAc;AACb;AACA;;AAED,QAAK,6BAAgBA,IAAI,CAACD,SAArB,EAAgCA,SAAhC,CAAL,EAAmD;AAClD;AACA;;AAEDC,IAAAA,IAAI,CAACD,SAAL,GAAiBA,SAAjB;AACA,UAAMO,SAAS,GAAGX,KAAK,CAACM,GAAN,CAAWJ,IAAX,CAAlB;;AACA,QAAKS,SAAL,EAAiB;AAChB;AACAA,MAAAA,SAAS,CAACC,GAAV,CAAiBC,IAAF,IAAYA,IAAI,CAACC,OAAL,CAAaC,QAAb,EAA3B;AACA;AACD;;AAED,WAASC,YAAT,CAAuBd,IAAvB,EAA6BC,GAA7B,EAAmC;AAClCH,IAAAA,KAAK,CAACO,GAAN,CAAWL,IAAX,EAAiB,iBAAQ,CAAE,IAAKF,KAAK,CAACM,GAAN,CAAWJ,IAAX,KAAqB,EAA1B,CAAF,EAAkCC,GAAlC,CAAR,CAAjB;AACA;;AAED,WAASc,cAAT,CAAyBf,IAAzB,EAA+BC,GAA/B,EAAqC;AACpC,UAAMe,YAAY,GAAGlB,KAAK,CAACM,GAAN,CAAWJ,IAAX,CAArB;;AACA,QAAK,CAAEgB,YAAP,EAAsB;AACrB;AACA;;AAEDlB,IAAAA,KAAK,CAACO,GAAN,CACCL,IADD,EAEC,iBAAQgB,YAAY,CAACC,MAAb,CAAuBC,OAAF,IAAeA,OAAO,KAAKjB,GAAhD,CAAR,CAFD;AAIA;;AAED,SAAO;AACNJ,IAAAA,KADM;AAENC,IAAAA,KAFM;AAGNC,IAAAA,YAHM;AAINS,IAAAA,UAJM;AAKNF,IAAAA,cALM;AAMNQ,IAAAA,YANM;AAONC,IAAAA;AAPM,GAAP;AASA;;AAEc,SAASI,gBAAT,OAA0C;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AACxD,QAAM,CAAEC,QAAF,IAAe,uBAAUzB,kBAAV,CAArB;AACA,SACC,4BAAC,wBAAD,CAAiB,QAAjB;AAA0B,IAAA,KAAK,EAAGyB;AAAlC,KACGD,QADH,CADD;AAKA","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport { ref as valRef } from 'valtio';\nimport { proxyMap } from 'valtio/utils';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './slot-fill-context';\n\nfunction createSlotRegistry() {\n\tconst slots = proxyMap();\n\tconst fills = proxyMap();\n\n\tfunction registerSlot( name, ref, fillProps ) {\n\t\tconst slot = slots.get( name ) || {};\n\t\tslots.set(\n\t\t\tname,\n\t\t\tvalRef( {\n\t\t\t\t...slot,\n\t\t\t\tref: ref || slot.ref,\n\t\t\t\tfillProps: fillProps || slot.fillProps || {},\n\t\t\t} )\n\t\t);\n\t}\n\n\tfunction unregisterSlot( name, ref ) {\n\t\t// Make sure we're not unregistering a slot registered by another element\n\t\t// See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412\n\t\tif ( slots.get( name )?.ref === ref ) {\n\t\t\tslots.delete( name );\n\t\t}\n\t}\n\n\tfunction updateSlot( name, fillProps ) {\n\t\tconst slot = slots.get( name );\n\t\tif ( ! slot ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isShallowEqual( slot.fillProps, fillProps ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tslot.fillProps = fillProps;\n\t\tconst slotFills = fills.get( name );\n\t\tif ( slotFills ) {\n\t\t\t// Force update fills.\n\t\t\tslotFills.map( ( fill ) => fill.current.rerender() );\n\t\t}\n\t}\n\n\tfunction registerFill( name, ref ) {\n\t\tfills.set( name, valRef( [ ...( fills.get( name ) || [] ), ref ] ) );\n\t}\n\n\tfunction unregisterFill( name, ref ) {\n\t\tconst fillsForName = fills.get( name );\n\t\tif ( ! fillsForName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfills.set(\n\t\t\tname,\n\t\t\tvalRef( fillsForName.filter( ( fillRef ) => fillRef !== ref ) )\n\t\t);\n\t}\n\n\treturn {\n\t\tslots,\n\t\tfills,\n\t\tregisterSlot,\n\t\tupdateSlot,\n\t\tunregisterSlot,\n\t\tregisterFill,\n\t\tunregisterFill,\n\t};\n}\n\nexport default function SlotFillProvider( { children } ) {\n\tconst [ registry ] = useState( createSlotRegistry );\n\treturn (\n\t\t<SlotFillContext.Provider value={ registry }>\n\t\t\t{ children }\n\t\t</SlotFillContext.Provider>\n\t);\n}\n"]}
|
|
@@ -27,37 +27,22 @@ var _slotFillContext = _interopRequireDefault(require("./slot-fill-context"));
|
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
29
|
function useSlot(name) {
|
|
30
|
-
const
|
|
31
|
-
updateSlot: registryUpdateSlot,
|
|
32
|
-
unregisterSlot: registryUnregisterSlot,
|
|
33
|
-
registerFill: registryRegisterFill,
|
|
34
|
-
unregisterFill: registryUnregisterFill,
|
|
35
|
-
...registry
|
|
36
|
-
} = (0, _element.useContext)(_slotFillContext.default);
|
|
30
|
+
const registry = (0, _element.useContext)(_slotFillContext.default);
|
|
37
31
|
const slots = (0, _valtio.useSnapshot)(registry.slots, {
|
|
38
32
|
sync: true
|
|
39
|
-
}); // The important bit here is that
|
|
40
|
-
//
|
|
41
|
-
//
|
|
33
|
+
}); // The important bit here is that the `useSnapshot` call ensures that the
|
|
34
|
+
// hook only causes a re-render if the slot with the given name changes,
|
|
35
|
+
// not any other slot.
|
|
42
36
|
|
|
43
37
|
const slot = slots.get(name);
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, [name,
|
|
50
|
-
const registerFill = (0, _element.useCallback)(fillRef => {
|
|
51
|
-
registryRegisterFill(name, fillRef);
|
|
52
|
-
}, [name, registryRegisterFill]);
|
|
53
|
-
const unregisterFill = (0, _element.useCallback)(fillRef => {
|
|
54
|
-
registryUnregisterFill(name, fillRef);
|
|
55
|
-
}, [name, registryUnregisterFill]);
|
|
38
|
+
const api = (0, _element.useMemo)(() => ({
|
|
39
|
+
updateSlot: fillProps => registry.updateSlot(name, fillProps),
|
|
40
|
+
unregisterSlot: ref => registry.unregisterSlot(name, ref),
|
|
41
|
+
registerFill: ref => registry.registerFill(name, ref),
|
|
42
|
+
unregisterFill: ref => registry.unregisterFill(name, ref)
|
|
43
|
+
}), [name, registry]);
|
|
56
44
|
return { ...slot,
|
|
57
|
-
|
|
58
|
-
unregisterSlot,
|
|
59
|
-
registerFill,
|
|
60
|
-
unregisterFill
|
|
45
|
+
...api
|
|
61
46
|
};
|
|
62
47
|
}
|
|
63
48
|
//# sourceMappingURL=use-slot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/use-slot.js"],"names":["useSlot","name","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/use-slot.js"],"names":["useSlot","name","registry","SlotFillContext","slots","sync","slot","get","api","updateSlot","fillProps","unregisterSlot","ref","registerFill","unregisterFill"],"mappings":";;;;;;;;;AAIA;;AAKA;;AAKA;;AAdA;;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGe,SAASA,OAAT,CAAkBC,IAAlB,EAAyB;AACvC,QAAMC,QAAQ,GAAG,yBAAYC,wBAAZ,CAAjB;AACA,QAAMC,KAAK,GAAG,yBAAaF,QAAQ,CAACE,KAAtB,EAA6B;AAAEC,IAAAA,IAAI,EAAE;AAAR,GAA7B,CAAd,CAFuC,CAGvC;AACA;AACA;;AACA,QAAMC,IAAI,GAAGF,KAAK,CAACG,GAAN,CAAWN,IAAX,CAAb;AAEA,QAAMO,GAAG,GAAG,sBACX,OAAQ;AACPC,IAAAA,UAAU,EAAIC,SAAF,IAAiBR,QAAQ,CAACO,UAAT,CAAqBR,IAArB,EAA2BS,SAA3B,CADtB;AAEPC,IAAAA,cAAc,EAAIC,GAAF,IAAWV,QAAQ,CAACS,cAAT,CAAyBV,IAAzB,EAA+BW,GAA/B,CAFpB;AAGPC,IAAAA,YAAY,EAAID,GAAF,IAAWV,QAAQ,CAACW,YAAT,CAAuBZ,IAAvB,EAA6BW,GAA7B,CAHlB;AAIPE,IAAAA,cAAc,EAAIF,GAAF,IAAWV,QAAQ,CAACY,cAAT,CAAyBb,IAAzB,EAA+BW,GAA/B;AAJpB,GAAR,CADW,EAOX,CAAEX,IAAF,EAAQC,QAAR,CAPW,CAAZ;AAUA,SAAO,EACN,GAAGI,IADG;AAEN,OAAGE;AAFG,GAAP;AAIA","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport { useSnapshot } from 'valtio';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './slot-fill-context';\n\nexport default function useSlot( name ) {\n\tconst registry = useContext( SlotFillContext );\n\tconst slots = useSnapshot( registry.slots, { sync: true } );\n\t// The important bit here is that the `useSnapshot` call ensures that the\n\t// hook only causes a re-render if the slot with the given name changes,\n\t// not any other slot.\n\tconst slot = slots.get( name );\n\n\tconst api = useMemo(\n\t\t() => ( {\n\t\t\tupdateSlot: ( fillProps ) => registry.updateSlot( name, fillProps ),\n\t\t\tunregisterSlot: ( ref ) => registry.unregisterSlot( name, ref ),\n\t\t\tregisterFill: ( ref ) => registry.registerFill( name, ref ),\n\t\t\tunregisterFill: ( ref ) => registry.unregisterFill( name, ref ),\n\t\t} ),\n\t\t[ name, registry ]\n\t);\n\n\treturn {\n\t\t...slot,\n\t\t...api,\n\t};\n}\n"]}
|
package/build/slot-fill/fill.js
CHANGED
|
@@ -5,12 +5,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = Fill;
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
12
|
var _context = _interopRequireDefault(require("./context"));
|
|
15
13
|
|
|
16
14
|
var _useSlot = _interopRequireDefault(require("./use-slot"));
|
|
@@ -24,13 +22,15 @@ var _useSlot = _interopRequireDefault(require("./use-slot"));
|
|
|
24
22
|
/**
|
|
25
23
|
* Internal dependencies
|
|
26
24
|
*/
|
|
27
|
-
function
|
|
25
|
+
function Fill(_ref) {
|
|
28
26
|
let {
|
|
29
27
|
name,
|
|
30
|
-
children
|
|
28
|
+
children
|
|
29
|
+
} = _ref;
|
|
30
|
+
const {
|
|
31
31
|
registerFill,
|
|
32
32
|
unregisterFill
|
|
33
|
-
} =
|
|
33
|
+
} = (0, _element.useContext)(_context.default);
|
|
34
34
|
const slot = (0, _useSlot.default)(name);
|
|
35
35
|
const ref = (0, _element.useRef)({
|
|
36
36
|
name,
|
|
@@ -65,30 +65,6 @@ function FillComponent(_ref) {
|
|
|
65
65
|
// We'll leave them as-is until a more detailed investigation/refactor can be performed.
|
|
66
66
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
67
67
|
}, [name]);
|
|
68
|
-
|
|
69
|
-
if (!slot || !slot.node) {
|
|
70
|
-
return null;
|
|
71
|
-
} // If a function is passed as a child, provide it with the fillProps.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (typeof children === 'function') {
|
|
75
|
-
children = children(slot.props.fillProps);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return (0, _element.createPortal)(children, slot.node);
|
|
68
|
+
return null;
|
|
79
69
|
}
|
|
80
|
-
|
|
81
|
-
const Fill = props => (0, _element.createElement)(_context.default.Consumer, null, _ref2 => {
|
|
82
|
-
let {
|
|
83
|
-
registerFill,
|
|
84
|
-
unregisterFill
|
|
85
|
-
} = _ref2;
|
|
86
|
-
return (0, _element.createElement)(FillComponent, (0, _extends2.default)({}, props, {
|
|
87
|
-
registerFill: registerFill,
|
|
88
|
-
unregisterFill: unregisterFill
|
|
89
|
-
}));
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
var _default = Fill;
|
|
93
|
-
exports.default = _default;
|
|
94
70
|
//# sourceMappingURL=fill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/slot-fill/fill.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/slot-fill/fill.js"],"names":["Fill","name","children","registerFill","unregisterFill","SlotFillContext","slot","ref","refValue","current","forceUpdate"],"mappings":";;;;;;;;;AAKA;;AAKA;;AACA;;AAXA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;AAIe,SAASA,IAAT,OAAoC;AAAA,MAArB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAqB;AAClD,QAAM;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA;AAAhB,MAAmC,yBAAYC,gBAAZ,CAAzC;AACA,QAAMC,IAAI,GAAG,sBAASL,IAAT,CAAb;AAEA,QAAMM,GAAG,GAAG,qBAAQ;AACnBN,IAAAA,IADmB;AAEnBC,IAAAA;AAFmB,GAAR,CAAZ;AAKA,gCAAiB,MAAM;AACtB,UAAMM,QAAQ,GAAGD,GAAG,CAACE,OAArB;AACAN,IAAAA,YAAY,CAAEF,IAAF,EAAQO,QAAR,CAAZ;AACA,WAAO,MAAMJ,cAAc,CAAEH,IAAF,EAAQO,QAAR,CAA3B,CAHsB,CAItB;AACA;AACA;AACA,GAPD,EAOG,EAPH;AASA,gCAAiB,MAAM;AACtBD,IAAAA,GAAG,CAACE,OAAJ,CAAYP,QAAZ,GAAuBA,QAAvB;;AACA,QAAKI,IAAL,EAAY;AACXA,MAAAA,IAAI,CAACI,WAAL;AACA,KAJqB,CAKtB;AACA;AACA;;AACA,GARD,EAQG,CAAER,QAAF,CARH;AAUA,gCAAiB,MAAM;AACtB,QAAKD,IAAI,KAAKM,GAAG,CAACE,OAAJ,CAAYR,IAA1B,EAAiC;AAChC;AACA;AACA;;AACDG,IAAAA,cAAc,CAAEG,GAAG,CAACE,OAAJ,CAAYR,IAAd,EAAoBM,GAAG,CAACE,OAAxB,CAAd;AACAF,IAAAA,GAAG,CAACE,OAAJ,CAAYR,IAAZ,GAAmBA,IAAnB;AACAE,IAAAA,YAAY,CAAEF,IAAF,EAAQM,GAAG,CAACE,OAAZ,CAAZ,CAPsB,CAQtB;AACA;AACA;AACA,GAXD,EAWG,CAAER,IAAF,CAXH;AAaA,SAAO,IAAP;AACA","sourcesContent":["// @ts-nocheck\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useLayoutEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './context';\nimport useSlot from './use-slot';\n\nexport default function Fill( { name, children } ) {\n\tconst { registerFill, unregisterFill } = useContext( SlotFillContext );\n\tconst slot = useSlot( name );\n\n\tconst ref = useRef( {\n\t\tname,\n\t\tchildren,\n\t} );\n\n\tuseLayoutEffect( () => {\n\t\tconst refValue = ref.current;\n\t\tregisterFill( name, refValue );\n\t\treturn () => unregisterFill( name, refValue );\n\t\t// Ignore reason: the useLayoutEffects here are written to fire at specific times, and introducing new dependencies could cause unexpected changes in behavior.\n\t\t// We'll leave them as-is until a more detailed investigation/refactor can be performed.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tuseLayoutEffect( () => {\n\t\tref.current.children = children;\n\t\tif ( slot ) {\n\t\t\tslot.forceUpdate();\n\t\t}\n\t\t// Ignore reason: the useLayoutEffects here are written to fire at specific times, and introducing new dependencies could cause unexpected changes in behavior.\n\t\t// We'll leave them as-is until a more detailed investigation/refactor can be performed.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ children ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( name === ref.current.name ) {\n\t\t\t// Ignore initial effect.\n\t\t\treturn;\n\t\t}\n\t\tunregisterFill( ref.current.name, ref.current );\n\t\tref.current.name = name;\n\t\tregisterFill( name, ref.current );\n\t\t// Ignore reason: the useLayoutEffects here are written to fire at specific times, and introducing new dependencies could cause unexpected changes in behavior.\n\t\t// We'll leave them as-is until a more detailed investigation/refactor can be performed.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ name ] );\n\n\treturn null;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/slot-fill/index.js"],"names":["Fill","props","Slot","ref","bubblesVirtually","Provider","children","createSlotFill","key","baseName","description","FillComponent","displayName","SlotComponent","__unstableName","createPrivateSlotFill","name","privateKey","Symbol","privateSlotFill"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIA;;;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAhBA;;AACA;AACA;AACA;;AAGA;AACA;AACA;AAUO,SAASA,IAAT,CAAeC,KAAf,EAAuB;AAC7B;AACA;AACA;AACA,SACC,qDACC,4BAAC,aAAD,EAAeA,KAAf,CADD,EAEC,4BAAC,cAAD,EAA2BA,KAA3B,CAFD,CADD;AAMA;;AACM,MAAMC,IAAI,GAAG,yBAAY,OAAkCC,GAAlC,KAA2C;AAAA,MAAzC;AAAEC,IAAAA,gBAAF;AAAoB,OAAGH;AAAvB,GAAyC;;AAC1E,MAAKG,gBAAL,EAAwB;AACvB,WAAO,4BAAC,cAAD,6BAA2BH,KAA3B;AAAmC,MAAA,GAAG,EAAGE;AAAzC,OAAP;AACA;;AACD,SAAO,4BAAC,aAAD,EAAeF,KAAf,CAAP;AACA,CALmB,CAAb;;;AAOA,SAASI,QAAT,QAA4C;AAAA,MAAzB;AAAEC,IAAAA,QAAF;AAAY,OAAGL;AAAf,GAAyB;AAClD,SACC,4BAAC,iBAAD,EAAuBA,KAAvB,EACC,4BAAC,yBAAD,QACGK,QADH,CADD,CADD;AAOA;;AAEM,SAASC,cAAT,CAAyBC,GAAzB,EAA+B;AACrC,QAAMC,QAAQ,GAAG,OAAOD,GAAP,KAAe,QAAf,GAA0BA,GAAG,CAACE,WAA9B,GAA4CF,GAA7D;;AACA,QAAMG,aAAa,GAAKV,KAAF,IAAa,4BAAC,IAAD;AAAM,IAAA,IAAI,EAAGO;AAAb,KAAwBP,KAAxB,EAAnC;;AACAU,EAAAA,aAAa,CAACC,WAAd,GAA6B,GAAGH,QAAU,MAA1C;;AAEA,QAAMI,aAAa,GAAKZ,KAAF,IAAa,4BAAC,IAAD;AAAM,IAAA,IAAI,EAAGO;AAAb,KAAwBP,KAAxB,EAAnC;;AACAY,EAAAA,aAAa,CAACD,WAAd,GAA6B,GAAGH,QAAU,MAA1C;AACAI,EAAAA,aAAa,CAACC,cAAd,GAA+BN,GAA/B;AAEA,SAAO;AACNR,IAAAA,IAAI,EAAEW,aADA;AAENT,IAAAA,IAAI,EAAEW;AAFA,GAAP;AAIA;;AAEM,MAAME,qBAAqB,GAAKC,IAAF,IAAY;AAChD,QAAMC,UAAU,GAAGC,MAAM,CAAEF,IAAF,CAAzB;AACA,QAAMG,eAAe,GAAGZ,cAAc,CAAEU,UAAF,CAAtC;AAEA,SAAO;AAAEA,IAAAA,UAAF;AAAc,OAAGE;AAAjB,GAAP;AACA,CALM","sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseFill from './fill';\nimport BaseSlot from './slot';\nimport BubblesVirtuallyFill from './bubbles-virtually/fill';\nimport BubblesVirtuallySlot from './bubbles-virtually/slot';\nimport BubblesVirtuallySlotFillProvider from './bubbles-virtually/slot-fill-provider';\nimport SlotFillProvider from './provider';\
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/slot-fill/index.js"],"names":["Fill","props","Slot","ref","bubblesVirtually","Provider","children","createSlotFill","key","baseName","description","FillComponent","displayName","SlotComponent","__unstableName","createPrivateSlotFill","name","privateKey","Symbol","privateSlotFill"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIA;;;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAhBA;;AACA;AACA;AACA;;AAGA;AACA;AACA;AAUO,SAASA,IAAT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AqB,GAAKC,IAAF,IAAY;AAChD,QAAMC,UAAU,GAAGC,MAAM,CAAEF,IAAF,CAAzB;AACA,QAAMG,eAAe,GAAGZ,cAAc,CAAEU,UAAF,CAAtC;AAEA,SAAO;AAAEA,IAAAA,UAAF;AAAc,OAAGE;AAAjB,GAAP;AACA,CALM","sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseFill from './fill';\nimport BaseSlot from './slot';\nimport BubblesVirtuallyFill from './bubbles-virtually/fill';\nimport BubblesVirtuallySlot from './bubbles-virtually/slot';\nimport BubblesVirtuallySlotFillProvider from './bubbles-virtually/slot-fill-provider';\nimport SlotFillProvider from './provider';\nexport { default as useSlot } from './bubbles-virtually/use-slot';\nexport { default as useSlotFills } from './bubbles-virtually/use-slot-fills';\n\nexport function Fill( props ) {\n\t// We're adding both Fills here so they can register themselves before\n\t// their respective slot has been registered. Only the Fill that has a slot\n\t// will render. The other one will return null.\n\treturn (\n\t\t<>\n\t\t\t<BaseFill { ...props } />\n\t\t\t<BubblesVirtuallyFill { ...props } />\n\t\t</>\n\t);\n}\nexport const Slot = forwardRef( ( { bubblesVirtually, ...props }, ref ) => {\n\tif ( bubblesVirtually ) {\n\t\treturn <BubblesVirtuallySlot { ...props } ref={ ref } />;\n\t}\n\treturn <BaseSlot { ...props } />;\n} );\n\nexport function Provider( { children, ...props } ) {\n\treturn (\n\t\t<SlotFillProvider { ...props }>\n\t\t\t<BubblesVirtuallySlotFillProvider>\n\t\t\t\t{ children }\n\t\t\t</BubblesVirtuallySlotFillProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport function createSlotFill( key ) {\n\tconst baseName = typeof key === 'symbol' ? key.description : key;\n\tconst FillComponent = ( props ) => <Fill name={ key } { ...props } />;\n\tFillComponent.displayName = `${ baseName }Fill`;\n\n\tconst SlotComponent = ( props ) => <Slot name={ key } { ...props } />;\n\tSlotComponent.displayName = `${ baseName }Slot`;\n\tSlotComponent.__unstableName = key;\n\n\treturn {\n\t\tFill: FillComponent,\n\t\tSlot: SlotComponent,\n\t};\n}\n\nexport const createPrivateSlotFill = ( name ) => {\n\tconst privateKey = Symbol( name );\n\tconst privateSlotFill = createSlotFill( privateKey );\n\n\treturn { privateKey, ...privateSlotFill };\n};\n"]}
|
|
@@ -29,7 +29,6 @@ class SlotFillProvider extends _element.Component {
|
|
|
29
29
|
this.unregisterFill = this.unregisterFill.bind(this);
|
|
30
30
|
this.getSlot = this.getSlot.bind(this);
|
|
31
31
|
this.getFills = this.getFills.bind(this);
|
|
32
|
-
this.hasFills = this.hasFills.bind(this);
|
|
33
32
|
this.subscribe = this.subscribe.bind(this);
|
|
34
33
|
this.slots = {};
|
|
35
34
|
this.fills = {};
|
|
@@ -41,7 +40,6 @@ class SlotFillProvider extends _element.Component {
|
|
|
41
40
|
unregisterFill: this.unregisterFill,
|
|
42
41
|
getSlot: this.getSlot,
|
|
43
42
|
getFills: this.getFills,
|
|
44
|
-
hasFills: this.hasFills,
|
|
45
43
|
subscribe: this.subscribe
|
|
46
44
|
};
|
|
47
45
|
}
|
|
@@ -100,10 +98,6 @@ class SlotFillProvider extends _element.Component {
|
|
|
100
98
|
return this.fills[name];
|
|
101
99
|
}
|
|
102
100
|
|
|
103
|
-
hasFills(name) {
|
|
104
|
-
return this.fills[name] && !!this.fills[name].length;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
101
|
forceUpdateSlot(name) {
|
|
108
102
|
const slot = this.getSlot(name);
|
|
109
103
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/slot-fill/provider.js"],"names":["SlotFillProvider","Component","constructor","arguments","registerSlot","bind","registerFill","unregisterSlot","unregisterFill","getSlot","getFills","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/slot-fill/provider.js"],"names":["SlotFillProvider","Component","constructor","arguments","registerSlot","bind","registerFill","unregisterSlot","unregisterFill","getSlot","getFills","subscribe","slots","fills","listeners","contextValue","name","slot","previousSlot","triggerListeners","forceUpdateSlot","forceUpdate","instance","filter","fill","slotInstance","forEach","listener","push","l","render","props","children"],"mappings":";;;;;;;;;AAIA;;AAKA;;AATA;;AACA;AACA;AACA;;AAGA;AACA;AACA;AAGe,MAAMA,gBAAN,SAA+BC,kBAA/B,CAAyC;AACvDC,EAAAA,WAAW,GAAG;AACb,UAAO,GAAGC,SAAV;AAEA,SAAKC,YAAL,GAAoB,KAAKA,YAAL,CAAkBC,IAAlB,CAAwB,IAAxB,CAApB;AACA,SAAKC,YAAL,GAAoB,KAAKA,YAAL,CAAkBD,IAAlB,CAAwB,IAAxB,CAApB;AACA,SAAKE,cAAL,GAAsB,KAAKA,cAAL,CAAoBF,IAApB,CAA0B,IAA1B,CAAtB;AACA,SAAKG,cAAL,GAAsB,KAAKA,cAAL,CAAoBH,IAApB,CAA0B,IAA1B,CAAtB;AACA,SAAKI,OAAL,GAAe,KAAKA,OAAL,CAAaJ,IAAb,CAAmB,IAAnB,CAAf;AACA,SAAKK,QAAL,GAAgB,KAAKA,QAAL,CAAcL,IAAd,CAAoB,IAApB,CAAhB;AACA,SAAKM,SAAL,GAAiB,KAAKA,SAAL,CAAeN,IAAf,CAAqB,IAArB,CAAjB;AAEA,SAAKO,KAAL,GAAa,EAAb;AACA,SAAKC,KAAL,GAAa,EAAb;AACA,SAAKC,SAAL,GAAiB,EAAjB;AACA,SAAKC,YAAL,GAAoB;AACnBX,MAAAA,YAAY,EAAE,KAAKA,YADA;AAEnBG,MAAAA,cAAc,EAAE,KAAKA,cAFF;AAGnBD,MAAAA,YAAY,EAAE,KAAKA,YAHA;AAInBE,MAAAA,cAAc,EAAE,KAAKA,cAJF;AAKnBC,MAAAA,OAAO,EAAE,KAAKA,OALK;AAMnBC,MAAAA,QAAQ,EAAE,KAAKA,QANI;AAOnBC,MAAAA,SAAS,EAAE,KAAKA;AAPG,KAApB;AASA;;AAEDP,EAAAA,YAAY,CAAEY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AAP;AACA;;AACD,WAAO,KAAKZ,KAAL,CAAYG,IAAZ,CAAP;AACA;;AAEDI,EAAAA,eAAe,CAAEJ,IAAF,EAAS;AACvB,UAAMC,IAAI,GAAG,KAAKR,OAAL,CAAcO,IAAd,CAAb;;AAEA,QAAKC,IAAL,EAAY;AACXA,MAAAA,IAAI,CAACI,WAAL;AACA;AACD;;AAEDF,EAAAA,gBAAgB,GAAG;AAClB,SAAKL,SAAL,CAAeY,OAAf,CAA0BC,QAAF,IAAgBA,QAAQ,EAAhD;AACA;;AAEDhB,EAAAA,SAAS,CAAEgB,QAAF,EAAa;AACrB,SAAKb,SAAL,CAAec,IAAf,CAAqBD,QAArB;AAEA,WAAO,MAAM;AACZ,WAAKb,SAAL,GAAiB,KAAKA,SAAL,CAAeS,MAAf,CAAyBM,CAAF,IAASA,CAAC,KAAKF,QAAtC,CAAjB;AACA,KAFD;AAGA;;AAEDG,EAAAA,MAAM,GAAG;AACR,WACC,4BAAC,gBAAD,CAAiB,QAAjB;AAA0B,MAAA,KAAK,EAAG,KAAKf;AAAvC,OACG,KAAKgB,KAAL,CAAWC,QADd,CADD;AAKA;;AA1GsD","sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './context';\n\nexport default class SlotFillProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.registerSlot = this.registerSlot.bind( this );\n\t\tthis.registerFill = this.registerFill.bind( this );\n\t\tthis.unregisterSlot = this.unregisterSlot.bind( this );\n\t\tthis.unregisterFill = this.unregisterFill.bind( this );\n\t\tthis.getSlot = this.getSlot.bind( this );\n\t\tthis.getFills = this.getFills.bind( this );\n\t\tthis.subscribe = this.subscribe.bind( this );\n\n\t\tthis.slots = {};\n\t\tthis.fills = {};\n\t\tthis.listeners = [];\n\t\tthis.contextValue = {\n\t\t\tregisterSlot: this.registerSlot,\n\t\t\tunregisterSlot: this.unregisterSlot,\n\t\t\tregisterFill: this.registerFill,\n\t\t\tunregisterFill: this.unregisterFill,\n\t\t\tgetSlot: this.getSlot,\n\t\t\tgetFills: this.getFills,\n\t\t\tsubscribe: this.subscribe,\n\t\t};\n\t}\n\n\tregisterSlot( name, slot ) {\n\t\tconst previousSlot = this.slots[ name ];\n\t\tthis.slots[ name ] = slot;\n\t\tthis.triggerListeners();\n\n\t\t// Sometimes the fills are registered after the initial render of slot\n\t\t// But before the registerSlot call, we need to rerender the slot.\n\t\tthis.forceUpdateSlot( name );\n\n\t\t// If a new instance of a slot is being mounted while another with the\n\t\t// same name exists, force its update _after_ the new slot has been\n\t\t// assigned into the instance, such that its own rendering of children\n\t\t// will be empty (the new Slot will subsume all fills for this name).\n\t\tif ( previousSlot ) {\n\t\t\tpreviousSlot.forceUpdate();\n\t\t}\n\t}\n\n\tregisterFill( name, instance ) {\n\t\tthis.fills[ name ] = [ ...( this.fills[ name ] || [] ), instance ];\n\t\tthis.forceUpdateSlot( name );\n\t}\n\n\tunregisterSlot( name, instance ) {\n\t\t// If a previous instance of a Slot by this name unmounts, do nothing,\n\t\t// as the slot and its fills should only be removed for the current\n\t\t// known instance.\n\t\tif ( this.slots[ name ] !== instance ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdelete this.slots[ name ];\n\t\tthis.triggerListeners();\n\t}\n\n\tunregisterFill( name, instance ) {\n\t\tthis.fills[ name ] =\n\t\t\tthis.fills[ name ]?.filter( ( fill ) => fill !== instance ) ?? [];\n\t\tthis.forceUpdateSlot( name );\n\t}\n\n\tgetSlot( name ) {\n\t\treturn this.slots[ name ];\n\t}\n\n\tgetFills( name, slotInstance ) {\n\t\t// Fills should only be returned for the current instance of the slot\n\t\t// in which they occupy.\n\t\tif ( this.slots[ name ] !== slotInstance ) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this.fills[ name ];\n\t}\n\n\tforceUpdateSlot( name ) {\n\t\tconst slot = this.getSlot( name );\n\n\t\tif ( slot ) {\n\t\t\tslot.forceUpdate();\n\t\t}\n\t}\n\n\ttriggerListeners() {\n\t\tthis.listeners.forEach( ( listener ) => listener() );\n\t}\n\n\tsubscribe( listener ) {\n\t\tthis.listeners.push( listener );\n\n\t\treturn () => {\n\t\t\tthis.listeners = this.listeners.filter( ( l ) => l !== listener );\n\t\t};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<SlotFillContext.Provider value={ this.contextValue }>\n\t\t\t\t{ this.props.children }\n\t\t\t</SlotFillContext.Provider>\n\t\t);\n\t}\n}\n"]}
|
package/build/slot-fill/slot.js
CHANGED
|
@@ -37,7 +37,6 @@ class SlotComponent extends _element.Component {
|
|
|
37
37
|
constructor() {
|
|
38
38
|
super(...arguments);
|
|
39
39
|
this.isUnmounted = false;
|
|
40
|
-
this.bindNode = this.bindNode.bind(this);
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
componentDidMount() {
|
|
@@ -69,10 +68,6 @@ class SlotComponent extends _element.Component {
|
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
|
|
72
|
-
bindNode(node) {
|
|
73
|
-
this.node = node;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
71
|
forceUpdate() {
|
|
77
72
|
if (this.isUnmounted) {
|
|
78
73
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/slot-fill/slot.js"],"names":["isFunction","maybeFunc","SlotComponent","Component","constructor","arguments","isUnmounted","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/slot-fill/slot.js"],"names":["isFunction","maybeFunc","SlotComponent","Component","constructor","arguments","isUnmounted","componentDidMount","registerSlot","props","name","componentWillUnmount","unregisterSlot","componentDidUpdate","prevProps","forceUpdate","render","children","fillProps","getFills","fills","map","fill","fillChildren","Children","child","childIndex","childKey","key","filter","element","Slot"],"mappings":";;;;;;;;;AAIA;;;;AAUA;;AAdA;;AACA;AACA;AACA;;AAQA;AACA;AACA;;AAGA;AACA;AACA;AACA;A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AAET,IAAF,EAAQ,IAAR,CAAV,iDAA4B,EAA5B,EACZW,GADY,CACLC,IAAF,IAAY;AACjB,YAAMC,YAAY,GAAGvB,UAAU,CAAEsB,IAAI,CAACL,QAAP,CAAV,GAClBK,IAAI,CAACL,QAAL,CAAeC,SAAf,CADkB,GAElBI,IAAI,CAACL,QAFR;AAIA,aAAOO,kBAASH,GAAT,CAAcE,YAAd,EAA4B,CAAEE,KAAF,EAASC,UAAT,KAAyB;AAC3D,YAAK,CAAED,KAAF,IAAW,OAAOA,KAAP,KAAiB,QAAjC,EAA4C;AAC3C,iBAAOA,KAAP;AACA;;AAED,cAAME,QAAQ,GAAGF,KAAK,CAACG,GAAN,IAAaF,UAA9B;AACA,eAAO,2BAAcD,KAAd,EAAqB;AAAEG,UAAAA,GAAG,EAAED;AAAP,SAArB,CAAP;AACA,OAPM,CAAP;AAQA,KAdY,EAeZE,MAfY,EAgBZ;AACA;AACA;AACEC,IAAAA,OAAF,IAAe,CAAE,6BAAgBA,OAAhB,CAnBL,CAAd;AAsBA,WAAO,qDAAI9B,UAAU,CAAEiB,QAAF,CAAV,GAAyBA,QAAQ,CAAEG,KAAF,CAAjC,GAA6CA,KAAjD,CAAP;AACA;;AA7DoC;;AAgEtC,MAAMW,IAAI,GAAKtB,KAAF,IACZ,4BAAC,gBAAD,CAAiB,QAAjB,QACG;AAAA,MAAE;AAAED,IAAAA,YAAF;AAAgBI,IAAAA,cAAhB;AAAgCO,IAAAA;AAAhC,GAAF;AAAA,SACD,4BAAC,aAAD,6BACMV,KADN;AAEC,IAAA,YAAY,EAAGD,YAFhB;AAGC,IAAA,cAAc,EAAGI,cAHlB;AAIC,IAAA,QAAQ,EAAGO;AAJZ,KADC;AAAA,CADH,CADD;;eAaeY,I","sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport {\n\tChildren,\n\tComponent,\n\tcloneElement,\n\tisEmptyElement,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './context';\n\n/**\n * Whether the argument is a function.\n *\n * @param {*} maybeFunc The argument to check.\n * @return {boolean} True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc ) {\n\treturn typeof maybeFunc === 'function';\n}\n\nclass SlotComponent extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.isUnmounted = false;\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { registerSlot } = this.props;\n\t\tthis.isUnmounted = false;\n\t\tregisterSlot( this.props.name, this );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tconst { unregisterSlot } = this.props;\n\t\tthis.isUnmounted = true;\n\t\tunregisterSlot( this.props.name, this );\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { name, unregisterSlot, registerSlot } = this.props;\n\n\t\tif ( prevProps.name !== name ) {\n\t\t\tunregisterSlot( prevProps.name );\n\t\t\tregisterSlot( name, this );\n\t\t}\n\t}\n\n\tforceUpdate() {\n\t\tif ( this.isUnmounted ) {\n\t\t\treturn;\n\t\t}\n\t\tsuper.forceUpdate();\n\t}\n\n\trender() {\n\t\tconst { children, name, fillProps = {}, getFills } = this.props;\n\n\t\tconst fills = ( getFills( name, this ) ?? [] )\n\t\t\t.map( ( fill ) => {\n\t\t\t\tconst fillChildren = isFunction( fill.children )\n\t\t\t\t\t? fill.children( fillProps )\n\t\t\t\t\t: fill.children;\n\n\t\t\t\treturn Children.map( fillChildren, ( child, childIndex ) => {\n\t\t\t\t\tif ( ! child || typeof child === 'string' ) {\n\t\t\t\t\t\treturn child;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst childKey = child.key || childIndex;\n\t\t\t\t\treturn cloneElement( child, { key: childKey } );\n\t\t\t\t} );\n\t\t\t} )\n\t\t\t.filter(\n\t\t\t\t// In some cases fills are rendered only when some conditions apply.\n\t\t\t\t// This ensures that we only use non-empty fills when rendering, i.e.,\n\t\t\t\t// it allows us to render wrappers only when the fills are actually present.\n\t\t\t\t( element ) => ! isEmptyElement( element )\n\t\t\t);\n\n\t\treturn <>{ isFunction( children ) ? children( fills ) : fills }</>;\n\t}\n}\n\nconst Slot = ( props ) => (\n\t<SlotFillContext.Consumer>\n\t\t{ ( { registerSlot, unregisterSlot, getFills } ) => (\n\t\t\t<SlotComponent\n\t\t\t\t{ ...props }\n\t\t\t\tregisterSlot={ registerSlot }\n\t\t\t\tunregisterSlot={ unregisterSlot }\n\t\t\t\tgetFills={ getFills }\n\t\t\t/>\n\t\t) }\n\t</SlotFillContext.Consumer>\n);\n\nexport default Slot;\n"]}
|
package/build/snackbar/list.js
CHANGED
|
@@ -89,8 +89,6 @@ function SnackbarList(_ref) {
|
|
|
89
89
|
...restNotice
|
|
90
90
|
} = notice;
|
|
91
91
|
return (0, _element.createElement)(_animation.__unstableMotion.div, {
|
|
92
|
-
layout: !isReducedMotion // See https://www.framer.com/docs/animation/#layout-animations
|
|
93
|
-
,
|
|
94
92
|
initial: 'init',
|
|
95
93
|
animate: 'open',
|
|
96
94
|
exit: 'exit',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/snackbar/list.tsx"],"names":["SNACKBAR_VARIANTS","init","height","opacity","open","transition","stiffness","velocity","exit","duration","SnackbarList","notices","className","children","onRemove","listRef","isReducedMotion","removeNotice","notice","id","map","content","restNotice","undefined"],"mappings":";;;;;;;;;;AASA;;;;AANA;;AAKA;;AAMA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AASA,MAAMA,iBAAiB,GAAG;AACzBC,EAAAA,IAAI,EAAE;AACLC,IAAAA,MAAM,EAAE,CADH;AAELC,IAAAA,OAAO,EAAE;AAFJ,GADmB;AAKzBC,EAAAA,IAAI,EAAE;AACLF,IAAAA,MAAM,EAAE,MADH;AAELC,IAAAA,OAAO,EAAE,CAFJ;AAGLE,IAAAA,UAAU,EAAE;AACXH,MAAAA,MAAM,EAAE;AAAEI,QAAAA,SAAS,EAAE,IAAb;AAAmBC,QAAAA,QAAQ,EAAE,CAAC;AAA9B;AADG;AAHP,GALmB;AAYzBC,EAAAA,IAAI,EAAE;AACLL,IAAAA,OAAO,EAAE,CADJ;AAELE,IAAAA,UAAU,EAAE;AACXI,MAAAA,QAAQ,EAAE;AADC;AAFP;AAZmB,CAA1B;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,YAAT,OAKkD;AAAA,MAL3B;AAC7BC,IAAAA,OAD6B;AAE7BC,IAAAA,SAF6B;AAG7BC,IAAAA,QAH6B;AAI7BC,IAAAA;AAJ6B,GAK2B;AACxD,QAAMC,OAAO,GAAG,qBAAiC,IAAjC,CAAhB;AACA,QAAMC,eAAe,GAAG,gCAAxB;AACAJ,EAAAA,SAAS,GAAG,yBAAY,0BAAZ,EAAwCA,SAAxC,CAAZ;;AACA,QAAMK,YAAY,GACfC,MAAF,IAAwD,MACvDJ,QADuD,aACvDA,QADuD,uBACvDA,QAAQ,CAAII,MAAM,CAACC,EAAX,CAFV;;AAGA,SACC;AAAK,IAAA,SAAS,EAAGP,SAAjB;AAA6B,IAAA,QAAQ,EAAG,CAAC,CAAzC;AAA6C,IAAA,GAAG,EAAGG;AAAnD,KACGF,QADH,EAEC,4BAAC,oCAAD,QACGF,OAAO,CAACS,GAAR,CAAeF,MAAF,IAAc;AAC5B,UAAM;AAAEG,MAAAA,OAAF;AAAW,SAAGC;AAAd,QAA6BJ,MAAnC;AAEA,WACC,4BAAC,2BAAD,CAAQ,GAAR;AACC,MAAA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/snackbar/list.tsx"],"names":["SNACKBAR_VARIANTS","init","height","opacity","open","transition","stiffness","velocity","exit","duration","SnackbarList","notices","className","children","onRemove","listRef","isReducedMotion","removeNotice","notice","id","map","content","restNotice","undefined"],"mappings":";;;;;;;;;;AASA;;;;AANA;;AAKA;;AAMA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;A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,CAAQ,GAAR;AACC,MAAA,OAAO,EAAG,MADX;AAEC,MAAA,OAAO,EAAG,MAFX;AAGC,MAAA,IAAI,EAAG,MAHR;AAIC,MAAA,GAAG,EAAGA,MAAM,CAACC,EAJd;AAKC,MAAA,QAAQ,EACPH,eAAe,GAAGO,SAAH,GAAevB;AANhC,OASC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,SAAD,6BACMsB,UADN;AAEC,MAAA,QAAQ,EAAGL,YAAY,CAAEC,MAAF,CAFxB;AAGC,MAAA,OAAO,EAAGH;AAHX,QAKGG,MAAM,CAACG,OALV,CADD,CATD,CADD;AAqBA,GAxBC,CADH,CAFD,CADD;AAgCA;;eAEcX,Y","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion } from '@wordpress/compose';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Snackbar from '.';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '../animation';\nimport type { SnackbarListProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\nconst SNACKBAR_VARIANTS = {\n\tinit: {\n\t\theight: 0,\n\t\topacity: 0,\n\t},\n\topen: {\n\t\theight: 'auto',\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\theight: { stiffness: 1000, velocity: -100 },\n\t\t},\n\t},\n\texit: {\n\t\topacity: 0,\n\t\ttransition: {\n\t\t\tduration: 0.5,\n\t\t},\n\t},\n};\n\n/**\n * Renders a list of notices.\n *\n * ```jsx\n * const MySnackbarListNotice = () => (\n * <SnackbarList\n * notices={ notices }\n * onRemove={ removeNotice }\n * />\n * );\n * ```\n */\nexport function SnackbarList( {\n\tnotices,\n\tclassName,\n\tchildren,\n\tonRemove,\n}: WordPressComponentProps< SnackbarListProps, 'div' > ) {\n\tconst listRef = useRef< HTMLDivElement | null >( null );\n\tconst isReducedMotion = useReducedMotion();\n\tclassName = classnames( 'components-snackbar-list', className );\n\tconst removeNotice =\n\t\t( notice: SnackbarListProps[ 'notices' ][ number ] ) => () =>\n\t\t\tonRemove?.( notice.id );\n\treturn (\n\t\t<div className={ className } tabIndex={ -1 } ref={ listRef }>\n\t\t\t{ children }\n\t\t\t<AnimatePresence>\n\t\t\t\t{ notices.map( ( notice ) => {\n\t\t\t\t\tconst { content, ...restNotice } = notice;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tinitial={ 'init' }\n\t\t\t\t\t\t\tanimate={ 'open' }\n\t\t\t\t\t\t\texit={ 'exit' }\n\t\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\t\tvariants={\n\t\t\t\t\t\t\t\tisReducedMotion ? undefined : SNACKBAR_VARIANTS\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"components-snackbar-list__notice-container\">\n\t\t\t\t\t\t\t\t<Snackbar\n\t\t\t\t\t\t\t\t\t{ ...restNotice }\n\t\t\t\t\t\t\t\t\tonRemove={ removeNotice( notice ) }\n\t\t\t\t\t\t\t\t\tlistRef={ listRef }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ notice.content }\n\t\t\t\t\t\t\t\t</Snackbar>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</AnimatePresence>\n\t\t</div>\n\t);\n}\n\nexport default SnackbarList;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tab-panel/index.tsx"],"names":["TabButton","tabId","children","selected","rest","undefined","TabPanel","className","tabs","selectOnMove","initialTabName","orientation","activeClass","onSelect","instanceId","setSelected","handleTabSelection","tabKey","activateTabAutomatically","_childIndex","child","click","selectedTab","find","name","selectedId","initialTab","tab","disabled","firstEnabledTab","map","icon","title"],"mappings":";;;;;;;;;;A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,CAACI,IAAN,IAAcJ,GAAG,CAACK,KAlBrB,CADC,CARH,CADD,EAgCGV,WAAW,IACZ;AACC,IAAA,GAAG,EAAGG,UADP;AAEC,uBAAkBA,UAFnB;AAGC,IAAA,IAAI,EAAC,UAHN;AAIC,IAAA,EAAE,EAAI,GAAGA,UAAY,OAJtB;AAKC,IAAA,SAAS,EAAC;AALX,KAOGvB,QAAQ,CAAEoB,WAAF,CAPX,CAjCF,CADD;AA8CA;;eAEchB,Q","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseCallback,\n} from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { NavigableMenu } from '../navigable-container';\nimport Button from '../button';\nimport type { TabButtonProps, TabPanelProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\nconst TabButton = ( {\n\ttabId,\n\tchildren,\n\tselected,\n\t...rest\n}: TabButtonProps ) => (\n\t<Button\n\t\trole=\"tab\"\n\t\ttabIndex={ selected ? undefined : -1 }\n\t\taria-selected={ selected }\n\t\tid={ tabId }\n\t\t__experimentalIsFocusable\n\t\t{ ...rest }\n\t>\n\t\t{ children }\n\t</Button>\n);\n\n/**\n * TabPanel is an ARIA-compliant tabpanel.\n *\n * TabPanels organize content across different screens, data sets, and interactions.\n * It has two sections: a list of tabs, and the view to show when tabs are chosen.\n *\n * ```jsx\n * import { TabPanel } from '@wordpress/components';\n *\n * const onSelect = ( tabName ) => {\n * console.log( 'Selecting tab', tabName );\n * };\n *\n * const MyTabPanel = () => (\n * <TabPanel\n * className=\"my-tab-panel\"\n * activeClass=\"active-tab\"\n * onSelect={ onSelect }\n * tabs={ [\n * {\n * name: 'tab1',\n * title: 'Tab 1',\n * className: 'tab-one',\n * },\n * {\n * name: 'tab2',\n * title: 'Tab 2',\n * className: 'tab-two',\n * },\n * ] }\n * >\n * { ( tab ) => <p>{ tab.title }</p> }\n * </TabPanel>\n * );\n * ```\n */\nexport function TabPanel( {\n\tclassName,\n\tchildren,\n\ttabs,\n\tselectOnMove = true,\n\tinitialTabName,\n\torientation = 'horizontal',\n\tactiveClass = 'is-active',\n\tonSelect,\n}: WordPressComponentProps< TabPanelProps, 'div', false > ) {\n\tconst instanceId = useInstanceId( TabPanel, 'tab-panel' );\n\tconst [ selected, setSelected ] = useState< string >();\n\n\tconst handleTabSelection = useCallback(\n\t\t( tabKey: string ) => {\n\t\t\tsetSelected( tabKey );\n\t\t\tonSelect?.( tabKey );\n\t\t},\n\t\t[ onSelect ]\n\t);\n\n\t// Simulate a click on the newly focused tab, which causes the component\n\t// to show the `tab-panel` associated with the clicked tab.\n\tconst activateTabAutomatically = (\n\t\t_childIndex: number,\n\t\tchild:
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tab-panel/index.tsx"],"names":["TabButton","tabId","children","selected","rest","undefined","TabPanel","className","tabs","selectOnMove","initialTabName","orientation","activeClass","onSelect","instanceId","setSelected","handleTabSelection","tabKey","activateTabAutomatically","_childIndex","child","click","selectedTab","find","name","selectedId","initialTab","tab","disabled","firstEnabledTab","map","icon","title"],"mappings":";;;;;;;;;;AAQA;;;;AALA;;AAWA;;AAKA;;AACA;;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAMA,MAAMA,SAAS,GAAG;AAAA,MAAE;AACnBC,IAAAA,KADmB;AAEnBC,IAAAA,QAFmB;AAGnBC,IAAAA,QAHmB;AAInB,OAAGC;AAJgB,GAAF;AAAA,SAMjB,4BAAC,eAAD;AACC,IAAA,IAAI,EAAC,KADN;AAEC,IAAA,QAAQ,EAAGD,QAAQ,GAAGE,SAAH,GAAe,CAAC,CAFpC;AAGC,qBAAgBF,QAHjB;AAIC,IAAA,EAAE,EAAGF,KAJN;AAKC,IAAA,yBAAyB;AAL1B,KAMMG,IANN,GAQGF,QARH,CANiB;AAAA,CAAlB;AAk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MC,IAAA,SAAS,EAAC;AANX,KAQGG,IAAI,CAACsB,GAAL,CAAYH,GAAF,IACX,4BAAC,SAAD;AACC,IAAA,SAAS,EAAG,yBACX,iCADW,EAEXA,GAAG,CAACpB,SAFO,EAGX;AACC,OAAEK,WAAF,GAAiBe,GAAG,CAACH,IAAJ,KAAarB;AAD/B,KAHW,CADb;AAQC,IAAA,KAAK,EAAI,GAAGW,UAAY,IAAIa,GAAG,CAACH,IAAM,EARvC;AASC,qBAAiB,GAAGV,UAAY,IAAIa,GAAG,CAACH,IAAM,OAT/C;AAUC,IAAA,QAAQ,EAAGG,GAAG,CAACH,IAAJ,KAAarB,QAVzB;AAWC,IAAA,GAAG,EAAGwB,GAAG,CAACH,IAXX;AAYC,IAAA,OAAO,EAAG,MAAMR,kBAAkB,CAAEW,GAAG,CAACH,IAAN,CAZnC;AAaC,IAAA,QAAQ,EAAGG,GAAG,CAACC,QAbhB;AAcC,IAAA,KAAK,EAAGD,GAAG,CAACI,IAAJ,IAAYJ,GAAG,CAACK,KAdzB;AAeC,IAAA,IAAI,EAAGL,GAAG,CAACI,IAfZ;AAgBC,IAAA,WAAW,EAAG,CAAC,CAAEJ,GAAG,CAACI;AAhBtB,KAkBG,CAAEJ,GAAG,CAACI,IAAN,IAAcJ,GAAG,CAACK,KAlBrB,CADC,CARH,CADD,EAgCGV,WAAW,IACZ;AACC,IAAA,GAAG,EAAGG,UADP;AAEC,uBAAkBA,UAFnB;AAGC,IAAA,IAAI,EAAC,UAHN;AAIC,IAAA,EAAE,EAAI,GAAGA,UAAY,OAJtB;AAKC,IAAA,SAAS,EAAC;AALX,KAOGvB,QAAQ,CAAEoB,WAAF,CAPX,CAjCF,CADD;AA8CA;;eAEchB,Q","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseCallback,\n} from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { NavigableMenu } from '../navigable-container';\nimport Button from '../button';\nimport type { TabButtonProps, TabPanelProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\nconst TabButton = ( {\n\ttabId,\n\tchildren,\n\tselected,\n\t...rest\n}: TabButtonProps ) => (\n\t<Button\n\t\trole=\"tab\"\n\t\ttabIndex={ selected ? undefined : -1 }\n\t\taria-selected={ selected }\n\t\tid={ tabId }\n\t\t__experimentalIsFocusable\n\t\t{ ...rest }\n\t>\n\t\t{ children }\n\t</Button>\n);\n\n/**\n * TabPanel is an ARIA-compliant tabpanel.\n *\n * TabPanels organize content across different screens, data sets, and interactions.\n * It has two sections: a list of tabs, and the view to show when tabs are chosen.\n *\n * ```jsx\n * import { TabPanel } from '@wordpress/components';\n *\n * const onSelect = ( tabName ) => {\n * console.log( 'Selecting tab', tabName );\n * };\n *\n * const MyTabPanel = () => (\n * <TabPanel\n * className=\"my-tab-panel\"\n * activeClass=\"active-tab\"\n * onSelect={ onSelect }\n * tabs={ [\n * {\n * name: 'tab1',\n * title: 'Tab 1',\n * className: 'tab-one',\n * },\n * {\n * name: 'tab2',\n * title: 'Tab 2',\n * className: 'tab-two',\n * },\n * ] }\n * >\n * { ( tab ) => <p>{ tab.title }</p> }\n * </TabPanel>\n * );\n * ```\n */\nexport function TabPanel( {\n\tclassName,\n\tchildren,\n\ttabs,\n\tselectOnMove = true,\n\tinitialTabName,\n\torientation = 'horizontal',\n\tactiveClass = 'is-active',\n\tonSelect,\n}: WordPressComponentProps< TabPanelProps, 'div', false > ) {\n\tconst instanceId = useInstanceId( TabPanel, 'tab-panel' );\n\tconst [ selected, setSelected ] = useState< string >();\n\n\tconst handleTabSelection = useCallback(\n\t\t( tabKey: string ) => {\n\t\t\tsetSelected( tabKey );\n\t\t\tonSelect?.( tabKey );\n\t\t},\n\t\t[ onSelect ]\n\t);\n\n\t// Simulate a click on the newly focused tab, which causes the component\n\t// to show the `tab-panel` associated with the clicked tab.\n\tconst activateTabAutomatically = (\n\t\t_childIndex: number,\n\t\tchild: HTMLElement\n\t) => {\n\t\tchild.click();\n\t};\n\tconst selectedTab = tabs.find( ( { name } ) => name === selected );\n\tconst selectedId = `${ instanceId }-${ selectedTab?.name ?? 'none' }`;\n\n\t// Handle selecting the initial tab.\n\tuseLayoutEffect( () => {\n\t\t// If there's a selected tab, don't override it.\n\t\tif ( selectedTab ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst initialTab = tabs.find( ( tab ) => tab.name === initialTabName );\n\n\t\t// Wait for the denoted initial tab to be declared before making a\n\t\t// selection. This ensures that if a tab is declared lazily it can\n\t\t// still receive initial selection.\n\t\tif ( initialTabName && ! initialTab ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( initialTab && ! initialTab.disabled ) {\n\t\t\t// Select the initial tab if it's not disabled.\n\t\t\thandleTabSelection( initialTab.name );\n\t\t} else {\n\t\t\t// Fallback to the first enabled tab when the initial is disabled.\n\t\t\tconst firstEnabledTab = tabs.find( ( tab ) => ! tab.disabled );\n\t\t\tif ( firstEnabledTab ) handleTabSelection( firstEnabledTab.name );\n\t\t}\n\t}, [ tabs, selectedTab, initialTabName, handleTabSelection ] );\n\n\t// Handle the currently selected tab becoming disabled.\n\tuseEffect( () => {\n\t\t// This effect only runs when the selected tab is defined and becomes disabled.\n\t\tif ( ! selectedTab?.disabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst firstEnabledTab = tabs.find( ( tab ) => ! tab.disabled );\n\n\t\t// If the currently selected tab becomes disabled, select the first enabled tab.\n\t\t// (if there is one).\n\t\tif ( firstEnabledTab ) {\n\t\t\thandleTabSelection( firstEnabledTab.name );\n\t\t}\n\t}, [ tabs, selectedTab?.disabled, handleTabSelection ] );\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t<NavigableMenu\n\t\t\t\trole=\"tablist\"\n\t\t\t\torientation={ orientation }\n\t\t\t\tonNavigate={\n\t\t\t\t\tselectOnMove ? activateTabAutomatically : undefined\n\t\t\t\t}\n\t\t\t\tclassName=\"components-tab-panel__tabs\"\n\t\t\t>\n\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t<TabButton\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'components-tab-panel__tabs-item',\n\t\t\t\t\t\t\ttab.className,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[ activeClass ]: tab.name === selected,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\ttabId={ `${ instanceId }-${ tab.name }` }\n\t\t\t\t\t\taria-controls={ `${ instanceId }-${ tab.name }-view` }\n\t\t\t\t\t\tselected={ tab.name === selected }\n\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\tonClick={ () => handleTabSelection( tab.name ) }\n\t\t\t\t\t\tdisabled={ tab.disabled }\n\t\t\t\t\t\tlabel={ tab.icon && tab.title }\n\t\t\t\t\t\ticon={ tab.icon }\n\t\t\t\t\t\tshowTooltip={ !! tab.icon }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! tab.icon && tab.title }\n\t\t\t\t\t</TabButton>\n\t\t\t\t) ) }\n\t\t\t</NavigableMenu>\n\t\t\t{ selectedTab && (\n\t\t\t\t<div\n\t\t\t\t\tkey={ selectedId }\n\t\t\t\t\taria-labelledby={ selectedId }\n\t\t\t\t\trole=\"tabpanel\"\n\t\t\t\t\tid={ `${ selectedId }-view` }\n\t\t\t\t\tclassName=\"components-tab-panel__tab-content\"\n\t\t\t\t>\n\t\t\t\t\t{ children( selectedTab ) }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default TabPanel;\n"]}
|
|
@@ -49,7 +49,7 @@ function validateInputs(inputs) {
|
|
|
49
49
|
|
|
50
50
|
function checkContrasts(inputs, outputs) {
|
|
51
51
|
const background = inputs.background || _utils.COLORS.white;
|
|
52
|
-
const accent = inputs.accent || '#
|
|
52
|
+
const accent = inputs.accent || '#3858e9';
|
|
53
53
|
const foreground = outputs.foreground || _utils.COLORS.gray[900];
|
|
54
54
|
const gray = outputs.gray || _utils.COLORS.gray;
|
|
55
55
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/theme/color-algorithms.ts"],"names":["namesPlugin","a11yPlugin","generateThemeVariables","inputs","validateInputs","generatedColors","generateAccentDependentColors","accent","generateBackgroundDependentColors","background","warnContrastIssues","checkContrasts","colors","key","value","Object","entries","isValid","outputs","COLORS","white","foreground","gray","isReadable","undefined","grays","contrast","issues","error","values","accentDarker10","darken","toHex","accentDarker20","accentInverted","getForegroundForColor","foregroundInverted","generateShades","color","isDark","SHADES","limit","direction","range","Math","abs","toHsl","l","result","forEach","parseInt"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAMA;;AAhBA;AACA;AACA;;AAKA;AACA;AACA;AASA,oBAAQ,CAAEA,cAAF,EAAeC,aAAf,CAAR;;AAEO,SAASC,sBAAT,CACNC,MADM,EAEc;AACpBC,EAAAA,cAAc,CAAED,MAAF,CAAd;AAEA,QAAME,eAAe,GAAG,EACvB,GAAGC,6BAA6B,CAAEH,MAAM,CAACI,MAAT,CADT;AAEvB,OAAGC,iCAAiC,CAAEL,MAAM,CAACM,UAAT;AAFb,GAAxB;AAKAC,EAAAA,kBAAkB,CAAEC,cAAc,CAAER,MAAF,EAAUE,eAAV,CAAhB,CAAlB;AAEA,SAAO;AAAEO,IAAAA,MAAM,EAAEP;AAAV,GAAP;AACA;;AAED,SAASD,cAAT,CAAyBD,MAAzB,EAAoD;AACnD,OAAM,MAAM,CAAEU,GAAF,EAAOC,KAAP,CAAZ,IAA8BC,MAAM,CAACC,OAAP,CAAgBb,MAAhB,CAA9B,EAAyD;AACxD,QAAK,OAAOW,KAAP,KAAiB,WAAjB,IAAgC,CAAE,oBAAQA,KAAR,EAAgBG,OAAhB,EAAvC,EAAmE;AAClE,qHACE,yBAAyBH,KAAO,yCA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,EAAzC;AAEAjC,EAAAA,MAAM,CAACC,OAAP,CAAgBwB,MAAhB,EAAyBS,OAAzB,CAAkC,QAAsB;AAAA,QAApB,CAAEpC,GAAF,EAAOC,KAAP,CAAoB;AACvDkC,IAAAA,MAAM,CAAEE,QAAQ,CAAErC,GAAF,CAAV,CAAN,GAA4B,oBAAQJ,UAAR,EACzBiC,SADyB,EACV5B,KAAK,GAAG2B,KAAV,GAAoBE,KADR,EAE1BX,KAF0B,EAA5B;AAGA,GAJD;AAMA,SAAOgB,MAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { colord, extend } from 'colord';\nimport a11yPlugin from 'colord/plugins/a11y';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * WordPress dependencies\n */\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport type { ThemeInputValues, ThemeOutputValues } from './types';\nimport { COLORS } from '../utils';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\nexport function generateThemeVariables(\n\tinputs: ThemeInputValues\n): ThemeOutputValues {\n\tvalidateInputs( inputs );\n\n\tconst generatedColors = {\n\t\t...generateAccentDependentColors( inputs.accent ),\n\t\t...generateBackgroundDependentColors( inputs.background ),\n\t};\n\n\twarnContrastIssues( checkContrasts( inputs, generatedColors ) );\n\n\treturn { colors: generatedColors };\n}\n\nfunction validateInputs( inputs: ThemeInputValues ) {\n\tfor ( const [ key, value ] of Object.entries( inputs ) ) {\n\t\tif ( typeof value !== 'undefined' && ! colord( value ).isValid() ) {\n\t\t\twarning(\n\t\t\t\t`wp.components.Theme: \"${ value }\" is not a valid color value for the '${ key }' prop.`\n\t\t\t);\n\t\t}\n\t}\n}\n\nexport function checkContrasts(\n\tinputs: ThemeInputValues,\n\toutputs: ThemeOutputValues[ 'colors' ]\n) {\n\tconst background = inputs.background || COLORS.white;\n\tconst accent = inputs.accent || '#
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/theme/color-algorithms.ts"],"names":["namesPlugin","a11yPlugin","generateThemeVariables","inputs","validateInputs","generatedColors","generateAccentDependentColors","accent","generateBackgroundDependentColors","background","warnContrastIssues","checkContrasts","colors","key","value","Object","entries","isValid","outputs","COLORS","white","foreground","gray","isReadable","undefined","grays","contrast","issues","error","values","accentDarker10","darken","toHex","accentDarker20","accentInverted","getForegroundForColor","foregroundInverted","generateShades","color","isDark","SHADES","limit","direction","range","Math","abs","toHsl","l","result","forEach","parseInt"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAMA;;AAhBA;AACA;AACA;;AAKA;AACA;AACA;AASA,oBAAQ,CAAEA,cAAF,EAAeC,aAAf,CAAR;;AAEO,SAASC,sBAAT,CACNC,MADM,EAEc;AACpBC,EAAAA,cAAc,CAAED,MAAF,CAAd;AAEA,QAAME,eAAe,GAAG,EACvB,GAAGC,6BAA6B,CAAEH,MAAM,CAACI,MAAT,CADT;AAEvB,OAAGC,iCAAiC,CAAEL,MAAM,CAACM,UAAT;AAFb,GAAxB;AAKAC,EAAAA,kBAAkB,CAAEC,cAAc,CAAER,MAAF,EAAUE,eAAV,CAAhB,CAAlB;AAEA,SAAO;AAAEO,IAAAA,MAAM,EAAEP;AAAV,GAAP;AACA;;AAED,SAASD,cAAT,CAAyBD,MAAzB,EAAoD;AACnD,OAAM,MAAM,CAAEU,GAAF,EAAOC,KAAP,CAAZ,IAA8BC,MAAM,CAACC,OAAP,CAAgBb,MAAhB,CAA9B,EAAyD;AACxD,QAAK,OAAOW,KAAP,KAAiB,WAAjB,IAAgC,CAAE,oBAAQA,KAAR,EAAgBG,OAAhB,EAAvC,EAAmE;AAClE,qHACE,yBAAyBH,KAAO,yCAAyCD,GAAK,SADhF;AAGA;AACD;AACD;;AAEM,SAASF,cAAT,CACNR,MADM,EAENe,OAFM,EAGL;AACD,QAAMT,UAAU,GAAGN,MAAM,CAACM,UAAP,IAAqBU,cAAOC,KAA/C;AACA,QAAMb,MAAM,GAAGJ,MAAM,CAACI,MAAP,IAAiB,SAAhC;AACA,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,UAAR,EACzBiC,SADyB,EACV5B,KAAK,GAAG2B,KAAV,GAAoBE,KADR,EAE1BX,KAF0B,EAA5B;AAGA,GAJD;AAMA,SAAOgB,MAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { colord, extend } from 'colord';\nimport a11yPlugin from 'colord/plugins/a11y';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * WordPress dependencies\n */\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport type { ThemeInputValues, ThemeOutputValues } from './types';\nimport { COLORS } from '../utils';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\nexport function generateThemeVariables(\n\tinputs: ThemeInputValues\n): ThemeOutputValues {\n\tvalidateInputs( inputs );\n\n\tconst generatedColors = {\n\t\t...generateAccentDependentColors( inputs.accent ),\n\t\t...generateBackgroundDependentColors( inputs.background ),\n\t};\n\n\twarnContrastIssues( checkContrasts( inputs, generatedColors ) );\n\n\treturn { colors: generatedColors };\n}\n\nfunction validateInputs( inputs: ThemeInputValues ) {\n\tfor ( const [ key, value ] of Object.entries( inputs ) ) {\n\t\tif ( typeof value !== 'undefined' && ! colord( value ).isValid() ) {\n\t\t\twarning(\n\t\t\t\t`wp.components.Theme: \"${ value }\" is not a valid color value for the '${ key }' prop.`\n\t\t\t);\n\t\t}\n\t}\n}\n\nexport function checkContrasts(\n\tinputs: ThemeInputValues,\n\toutputs: ThemeOutputValues[ 'colors' ]\n) {\n\tconst background = inputs.background || COLORS.white;\n\tconst accent = inputs.accent || '#3858e9';\n\tconst foreground = outputs.foreground || COLORS.gray[ 900 ];\n\tconst gray = outputs.gray || COLORS.gray;\n\n\treturn {\n\t\taccent: colord( background ).isReadable( accent )\n\t\t\t? undefined\n\t\t\t: `The background color (\"${ background }\") does not have sufficient contrast against the accent color (\"${ accent }\").`,\n\t\tforeground: colord( background ).isReadable( foreground )\n\t\t\t? undefined\n\t\t\t: `The background color provided (\"${ background }\") does not have sufficient contrast against the standard foreground colors.`,\n\t\tgrays:\n\t\t\tcolord( background ).contrast( gray[ 600 ] ) >= 3 &&\n\t\t\tcolord( background ).contrast( gray[ 700 ] ) >= 4.5\n\t\t\t\t? undefined\n\t\t\t\t: `The background color provided (\"${ background }\") cannot generate a set of grayscale foreground colors with sufficient contrast. Try adjusting the color to be lighter or darker.`,\n\t};\n}\n\nfunction warnContrastIssues( issues: ReturnType< typeof checkContrasts > ) {\n\tfor ( const error of Object.values( issues ) ) {\n\t\tif ( error ) {\n\t\t\twarning( 'wp.components.Theme: ' + error );\n\t\t}\n\t}\n}\n\nfunction generateAccentDependentColors( accent?: string ) {\n\tif ( ! accent ) return {};\n\n\treturn {\n\t\taccent,\n\t\taccentDarker10: colord( accent ).darken( 0.1 ).toHex(),\n\t\taccentDarker20: colord( accent ).darken( 0.2 ).toHex(),\n\t\taccentInverted: getForegroundForColor( accent ),\n\t};\n}\n\nfunction generateBackgroundDependentColors( background?: string ) {\n\tif ( ! background ) return {};\n\n\tconst foreground = getForegroundForColor( background );\n\n\treturn {\n\t\tbackground,\n\t\tforeground,\n\t\tforegroundInverted: getForegroundForColor( foreground ),\n\t\tgray: generateShades( background, foreground ),\n\t};\n}\n\nfunction getForegroundForColor( color: string ) {\n\treturn colord( color ).isDark() ? COLORS.white : COLORS.gray[ 900 ];\n}\n\nexport function generateShades( background: string, foreground: string ) {\n\t// How much darkness you need to add to #fff to get the COLORS.gray[n] color\n\tconst SHADES = {\n\t\t100: 0.06,\n\t\t200: 0.121,\n\t\t300: 0.132,\n\t\t400: 0.2,\n\t\t600: 0.42,\n\t\t700: 0.543,\n\t\t800: 0.821,\n\t};\n\n\t// Darkness of COLORS.gray[ 900 ], relative to #fff\n\tconst limit = 0.884;\n\n\tconst direction = colord( background ).isDark() ? 'lighten' : 'darken';\n\n\t// Lightness delta between the background and foreground colors\n\tconst range =\n\t\tMath.abs(\n\t\t\tcolord( background ).toHsl().l - colord( foreground ).toHsl().l\n\t\t) / 100;\n\n\tconst result: Record< number, string > = {};\n\n\tObject.entries( SHADES ).forEach( ( [ key, value ] ) => {\n\t\tresult[ parseInt( key ) ] = colord( background )\n\t\t\t[ direction ]( ( value / limit ) * range )\n\t\t\t.toHex();\n\t} );\n\n\treturn result as NonNullable< ThemeOutputValues[ 'colors' ][ 'gray' ] >;\n}\n"]}
|