@wordpress/components 23.8.0 → 24.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 +71 -0
- package/CONTRIBUTING.md +65 -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/checkbox-control/index.js +2 -2
- package/build/checkbox-control/index.js.map +1 -1
- package/build/color-palette/index.native.js +12 -0
- package/build/color-palette/index.native.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/custom-gradient-picker/index.native.js +3 -1
- package/build/custom-gradient-picker/index.native.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 +8 -8
- package/build/draggable/index.js.map +1 -1
- 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.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +6 -6
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +0 -8
- package/build/mobile/color-settings/palette.screen.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/global-styles-context/utils.native.js +21 -4
- package/build/mobile/global-styles-context/utils.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/mobile/segmented-control/index.native.js +4 -2
- package/build/mobile/segmented-control/index.native.js.map +1 -1
- package/build/modal/index.js +2 -1
- package/build/modal/index.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/navigator/navigator-screen/component.js +1 -1
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/palette-edit/index.js +34 -12
- package/build/palette-edit/index.js.map +1 -1
- package/build/popover/index.js +1 -8
- package/build/popover/index.js.map +1 -1
- package/build/private-apis.js +4 -1
- package/build/private-apis.js.map +1 -1
- package/build/sandbox/index.native.js +10 -3
- 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 +20 -7
- 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/spinner/styles.js +4 -4
- package/build/spinner/styles.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/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/tree-grid/index.js +3 -3
- package/build/tree-grid/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/view/component.js +1 -2
- package/build/view/component.js.map +1 -1
- 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/checkbox-control/index.js +2 -2
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +13 -1
- package/build-module/color-palette/index.native.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/custom-gradient-picker/index.native.js +3 -1
- package/build-module/custom-gradient-picker/index.native.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 +8 -8
- package/build-module/draggable/index.js.map +1 -1
- 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.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +6 -5
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +0 -8
- package/build-module/mobile/color-settings/palette.screen.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/global-styles-context/utils.native.js +21 -3
- package/build-module/mobile/global-styles-context/utils.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/mobile/segmented-control/index.native.js +4 -2
- package/build-module/mobile/segmented-control/index.native.js.map +1 -1
- package/build-module/modal/index.js +2 -1
- package/build-module/modal/index.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/navigator/navigator-screen/component.js +1 -1
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/palette-edit/index.js +34 -13
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/popover/index.js +1 -8
- package/build-module/popover/index.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/sandbox/index.native.js +10 -3
- 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 +17 -8
- 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/spinner/styles.js +4 -4
- package/build-module/spinner/styles.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/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/tree-grid/index.js +3 -3
- package/build-module/tree-grid/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-module/view/component.js +1 -2
- package/build-module/view/component.js.map +1 -1
- package/build-style/style-rtl.css +83 -70
- package/build-style/style.css +83 -70
- 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/box-control/styles/box-control-styles.d.ts +1 -1
- package/build-types/button/deprecated.d.ts +12 -6
- 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/checkbox-control/index.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +1 -1
- package/build-types/color-picker/styles.d.ts +3 -3
- 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/styles.d.ts +1 -1
- package/build-types/date-time/time/styles.d.ts +4 -4
- package/build-types/dimension-control/index.d.ts +1 -1
- package/build-types/draggable/index.d.ts +1 -1
- package/build-types/draggable/index.d.ts.map +1 -1
- package/build-types/draggable/stories/index.d.ts +8 -0
- package/build-types/draggable/stories/index.d.ts.map +1 -1
- package/build-types/draggable/types.d.ts +7 -0
- package/build-types/draggable/types.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
- 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/index.d.ts +1 -0
- package/build-types/index.d.ts.map +1 -1
- package/build-types/modal/index.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/navigation/styles/navigation-styles.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +2 -1
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +2 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +2 -1
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +2 -1
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +2 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts +1 -1
- package/build-types/number-control/stories/index.d.ts +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/styles.d.ts +16 -10
- package/build-types/palette-edit/styles.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/popover/index.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/e2e/index.d.ts +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +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 +14 -3
- 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/spinner/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 +12 -6
- 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/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/wordpress-component.d.ts +1 -1
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +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/build-types/view/component.d.ts +1 -1
- package/build-types/view/component.d.ts.map +1 -1
- package/package.json +21 -22
- package/src/autocomplete/README.md +82 -54
- 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 +13 -6
- 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/index.tsx +6 -2
- package/src/checkbox-control/style.scss +1 -4
- package/src/color-palette/index.native.js +20 -1
- package/src/color-picker/test/index.tsx +99 -99
- 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/index.native.js +1 -1
- package/src/custom-gradient-picker/style.scss +2 -2
- package/src/dimension-control/README.md +1 -1
- package/src/dimension-control/index.tsx +1 -1
- package/src/draggable/README.md +8 -1
- package/src/draggable/index.tsx +7 -10
- package/src/draggable/stories/index.tsx +69 -33
- package/src/draggable/types.ts +7 -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.ts +1 -0
- package/src/mobile/bottom-sheet/cell.native.js +4 -5
- package/src/mobile/color-settings/palette.screen.native.js +0 -7
- package/src/mobile/global-styles-context/index.native.js +12 -1
- package/src/mobile/global-styles-context/utils.native.js +18 -3
- package/src/mobile/link-picker/link-picker-results.native.js +3 -0
- package/src/mobile/segmented-control/index.native.js +2 -2
- package/src/modal/index.tsx +6 -1
- package/src/modal/style.scss +21 -13
- 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/navigator/navigator-screen/component.tsx +1 -1
- 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/popover/index.tsx +2 -15
- package/src/private-apis.ts +2 -0
- package/src/sandbox/index.native.js +12 -1
- 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 +14 -8
- package/src/slot-fill/provider.js +0 -6
- package/src/slot-fill/slot.js +0 -5
- package/src/snackbar/style.scss +2 -1
- package/src/spinner/styles.ts +2 -0
- 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 +4 -4
- package/src/toolbar/stories/index.tsx +26 -24
- package/src/toolbar/toolbar-button/index.tsx +10 -13
- package/src/toolbar/toolbar-item/{index.js → index.tsx} +12 -3
- package/src/tree-grid/README.md +18 -0
- package/src/tree-grid/index.tsx +7 -2
- package/src/tree-grid/types.ts +7 -0
- package/src/ui/context/wordpress-component.ts +1 -1
- 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/src/view/component.tsx +2 -2
- package/tsconfig.json +3 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/src/CONTRIBUTING.md +0 -78
- package/src/README.md +0 -20
- 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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AAKF,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"]}
|
package/build/slot-fill/index.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.Fill = Fill;
|
|
9
9
|
exports.Provider = Provider;
|
|
10
|
-
exports.Slot = void 0;
|
|
10
|
+
exports.createPrivateSlotFill = exports.Slot = void 0;
|
|
11
11
|
exports.createSlotFill = createSlotFill;
|
|
12
12
|
Object.defineProperty(exports, "useSlot", {
|
|
13
13
|
enumerable: true,
|
|
@@ -82,22 +82,35 @@ function Provider(_ref2) {
|
|
|
82
82
|
return (0, _element.createElement)(_provider.default, props, (0, _element.createElement)(_slotFillProvider.default, null, children));
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
function createSlotFill(
|
|
85
|
+
function createSlotFill(key) {
|
|
86
|
+
const baseName = typeof key === 'symbol' ? key.description : key;
|
|
87
|
+
|
|
86
88
|
const FillComponent = props => (0, _element.createElement)(Fill, (0, _extends2.default)({
|
|
87
|
-
name:
|
|
89
|
+
name: key
|
|
88
90
|
}, props));
|
|
89
91
|
|
|
90
|
-
FillComponent.displayName =
|
|
92
|
+
FillComponent.displayName = `${baseName}Fill`;
|
|
91
93
|
|
|
92
94
|
const SlotComponent = props => (0, _element.createElement)(Slot, (0, _extends2.default)({
|
|
93
|
-
name:
|
|
95
|
+
name: key
|
|
94
96
|
}, props));
|
|
95
97
|
|
|
96
|
-
SlotComponent.displayName =
|
|
97
|
-
SlotComponent.__unstableName =
|
|
98
|
+
SlotComponent.displayName = `${baseName}Slot`;
|
|
99
|
+
SlotComponent.__unstableName = key;
|
|
98
100
|
return {
|
|
99
101
|
Fill: FillComponent,
|
|
100
102
|
Slot: SlotComponent
|
|
101
103
|
};
|
|
102
104
|
}
|
|
105
|
+
|
|
106
|
+
const createPrivateSlotFill = name => {
|
|
107
|
+
const privateKey = Symbol(name);
|
|
108
|
+
const privateSlotFill = createSlotFill(privateKey);
|
|
109
|
+
return {
|
|
110
|
+
privateKey,
|
|
111
|
+
...privateSlotFill
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
exports.createPrivateSlotFill = createPrivateSlotFill;
|
|
103
116
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/slot-fill/index.js"],"names":["Fill","props","Slot","ref","bubblesVirtually","Provider","children","createSlotFill","
|
|
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';\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,MAA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KAAKF,QAAjD,CADD,yEACgE,EADhE;AAEA,SAAKF,eAAL,CAAsBJ,IAAtB;AACA;;AAEDP,EAAAA,OAAO,CAAEO,IAAF,EAAS;AACf,WAAO,KAAKJ,KAAL,CAAYI,IAAZ,CAAP;AACA;;AAEDN,EAAAA,QAAQ,CAAEM,IAAF,EAAQS,YAAR,EAAuB;AAC9B;AACA;AACA,QAAK,KAAKb,KAAL,CAAYI,IAAZ,MAAuBS,YAA5B,EAA2C;AAC1C,aAAO,EAAP;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;AACA;AACA;AACA,SAASA,UAAT,CAAqBC,SAArB,EAAiC;AAChC,SAAO,OAAOA,SAAP,KAAqB,UAA5B;AACA;;AAED,MAAMC,aAAN,SAA4BC,kBAA5B,CAAsC;AACrCC,EAAAA,WAAW,GAAG;AACb,UAAO,GAAGC,SAAV;AAEA,SAAKC,WAAL,GAAmB,KAAnB;AACA;;AAEDC,EAAAA,iBAAiB,GAAG;AACnB,UAAM;AAAEC,MAAAA;AAAF,QAAmB,KAAKC,KAA9B;AACA,SAAKH,WAAL,GAAmB,KAAnB;AACAE,IAAAA,YAAY,CAAE,KAAKC,KAAL,CAAWC,IAAb,EAAmB,IAAnB,CAAZ;AACA;;AAEDC,EAAAA,oBAAoB,GAAG;AACtB,UAAM;AAAEC,MAAAA;AAAF,QAAqB,KAAKH,KAAhC;AACA,SAAKH,WAAL,GAAmB,IAAnB;AACAM,IAAAA,cAAc,CAAE,KAAKH,KAAL,CAAWC,IAAb,EAAmB,IAAnB,CAAd;AACA;;AAEDG,EAAAA,kBAAkB,CAAEC,SAAF,EAAc;AAC/B,UAAM;AAAEJ,MAAAA,IAAF;AAAQE,MAAAA,cAAR;AAAwBJ,MAAAA;AAAxB,QAAyC,KAAKC,KAApD;;AAEA,QAAKK,SAAS,CAACJ,IAAV,KAAmBA,IAAxB,EAA+B;AAC9BE,MAAAA,cAAc,CAAEE,SAAS,CAACJ,IAAZ,CAAd;AACAF,MAAAA,YAAY,CAAEE,IAAF,EAAQ,IAAR,CAAZ;AAC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AAA,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/spinner/styles.js
CHANGED
|
@@ -28,7 +28,7 @@ const StyledSpinner = (0, _base.default)("svg", process.env.NODE_ENV === "produc
|
|
|
28
28
|
} : {
|
|
29
29
|
target: "ea4tfvq2",
|
|
30
30
|
label: "StyledSpinner"
|
|
31
|
-
})("width:", _utils.CONFIG.spinnerSize, "px;height:", _utils.CONFIG.spinnerSize, "px;display:inline-block;margin:5px 11px 0;position:relative;color:", _utils.COLORS.ui.theme, ";overflow:visible;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
31
|
+
})("width:", _utils.CONFIG.spinnerSize, "px;height:", _utils.CONFIG.spinnerSize, "px;display:inline-block;margin:5px 11px 0;position:relative;color:", _utils.COLORS.ui.theme, ";overflow:visible;opacity:1;background-color:transparent;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJz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G5jb25zdCBjb21tb25QYXRoUHJvcHMgPSBjc3NgXG5cdGZpbGw6IHRyYW5zcGFyZW50O1xuXHRzdHJva2Utd2lkdGg6IDEuNXB4O1xuYDtcblxuZXhwb3J0IGNvbnN0IFNwaW5uZXJUcmFjayA9IHN0eWxlZC5jaXJjbGVgXG5cdCR7IGNvbW1vblBhdGhQcm9wcyB9O1xuXHRzdHJva2U6ICR7IENPTE9SUy5ncmF5WyAzMDAgXSB9O1xuYDtcblxuZXhwb3J0IGNvbnN0IFNwaW5uZXJJbmRpY2F0b3IgPSBzdHlsZWQucGF0aGBcblx0JHsgY29tbW9uUGF0aFByb3BzIH07XG5cdHN0cm9rZTogY3VycmVudENvbG9yO1xuXHRzdHJva2UtbGluZWNhcDogcm91bmQ7XG5cdHRyYW5zZm9ybS1vcmlnaW46IDUwJSA1MCU7XG5cdGFuaW1hdGlvbjogMS40cyBsaW5lYXIgaW5maW5pdGUgYm90aCAkeyBzcGluQW5pbWF0aW9uIH07XG5gO1xuIl19 */"));
|
|
32
32
|
exports.StyledSpinner = StyledSpinner;
|
|
33
33
|
const commonPathProps = process.env.NODE_ENV === "production" ? {
|
|
34
34
|
name: "9s4963",
|
|
@@ -36,7 +36,7 @@ const commonPathProps = process.env.NODE_ENV === "production" ? {
|
|
|
36
36
|
} : {
|
|
37
37
|
name: "o2zng0-commonPathProps",
|
|
38
38
|
styles: "fill:transparent;stroke-width:1.5px;label:commonPathProps;",
|
|
39
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
39
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvc3Bpbm5lci9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZ0MyQiIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3NwaW5uZXIvc3R5bGVzLn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m9wcyB9O1xuXHRzdHJva2U6ICR7IENPTE9SUy5ncmF5WyAzMDAgXSB9O1xuYDtcblxuZXhwb3J0IGNvbnN0IFNwaW5uZXJJbmRpY2F0b3IgPSBzdHlsZWQucGF0aGBcblx0JHsgY29tbW9uUGF0aFByb3BzIH07XG5cdHN0cm9rZTogY3VycmVudENvbG9yO1xuXHRzdHJva2UtbGluZWNhcDogcm91bmQ7XG5cdHRyYW5zZm9ybS1vcmlnaW46IDUwJSA1MCU7XG5cdGFuaW1hdGlvbjogMS40cyBsaW5lYXIgaW5maW5pdGUgYm90aCAkeyBzcGluQW5pbWF0aW9uIH07XG5gO1xuIl19 */",
|
|
40
40
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
41
41
|
};
|
|
42
42
|
const SpinnerTrack = (0, _base.default)("circle", process.env.NODE_ENV === "production" ? {
|
|
@@ -44,13 +44,13 @@ const SpinnerTrack = (0, _base.default)("circle", process.env.NODE_ENV === "prod
|
|
|
44
44
|
} : {
|
|
45
45
|
target: "ea4tfvq1",
|
|
46
46
|
label: "SpinnerTrack"
|
|
47
|
-
})(commonPathProps, ";stroke:", _utils.COLORS.gray[300], ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
47
|
+
})(commonPathProps, ";stroke:", _utils.COLORS.gray[300], ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvc3Bpbm5lci9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBcUN5QyIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3NwaW5uZXIvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW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nN0IFNwaW5uZXJJbmRpY2F0b3IgPSBzdHlsZWQucGF0aGBcblx0JHsgY29tbW9uUGF0aFByb3BzIH07XG5cdHN0cm9rZTogY3VycmVudENvbG9yO1xuXHRzdHJva2UtbGluZWNhcDogcm91bmQ7XG5cdHRyYW5zZm9ybS1vcmlnaW46IDUwJSA1MCU7XG5cdGFuaW1hdGlvbjogMS40cyBsaW5lYXIgaW5maW5pdGUgYm90aCAkeyBzcGluQW5pbWF0aW9uIH07XG5gO1xuIl19 */"));
|
|
48
48
|
exports.SpinnerTrack = SpinnerTrack;
|
|
49
49
|
const SpinnerIndicator = (0, _base.default)("path", process.env.NODE_ENV === "production" ? {
|
|
50
50
|
target: "ea4tfvq0"
|
|
51
51
|
} : {
|
|
52
52
|
target: "ea4tfvq0",
|
|
53
53
|
label: "SpinnerIndicator"
|
|
54
|
-
})(commonPathProps, ";stroke:currentColor;stroke-linecap:round;transform-origin:50% 50%;animation:1.4s linear infinite both ", spinAnimation, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
54
|
+
})(commonPathProps, ";stroke:currentColor;stroke-linecap:round;transform-origin:50% 50%;animation:1.4s linear infinite both ", spinAnimation, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvc3Bpbm5lci9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBMEMyQyIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3NwaW5uZXIvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgY3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0aFByb3BzIH07XG5cdHN0cm9rZTogY3VycmVudENvbG9yO1xuXHRzdHJva2UtbGluZWNhcDogcm91bmQ7XG5cdHRyYW5zZm9ybS1vcmlnaW46IDUwJSA1MCU7XG5cdGFuaW1hdGlvbjogMS40cyBsaW5lYXIgaW5maW5pdGUgYm90aCAkeyBzcGluQW5pbWF0aW9uIH07XG5gO1xuIl19 */"));
|
|
55
55
|
exports.SpinnerIndicator = SpinnerIndicator;
|
|
56
56
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/spinner/styles.ts"],"names":["spinAnimation","StyledSpinner","CONFIG","spinnerSize","COLORS","ui","theme","commonPathProps","SpinnerTrack","gray","SpinnerIndicator"],"mappings":";;;;;;;;;;;AAIA;;AAKA;;;;AAEA,MAAMA,aAAa,GAAG,qBAAU;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,EAPA;AASO,MAAMC,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,aACfC,cAAOC,WADQ,gBAEdD,cAAOC,WAFO,wEAMfC,cAAOC,EAAP,CAAUC,KANK,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/spinner/styles.ts"],"names":["spinAnimation","StyledSpinner","CONFIG","spinnerSize","COLORS","ui","theme","commonPathProps","SpinnerTrack","gray","SpinnerIndicator"],"mappings":";;;;;;;;;;;AAIA;;AAKA;;;;AAEA,MAAMA,aAAa,GAAG,qBAAU;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,EAPA;AASO,MAAMC,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,aACfC,cAAOC,WADQ,gBAEdD,cAAOC,WAFO,wEAMfC,cAAOC,EAAP,CAAUC,KANK,qxDAAnB;;AAYP,MAAMC,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAArB;AAKO,MAAMC,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,GACrBD,eADqB,cAEbH,cAAOK,IAAP,CAAa,GAAb,CAFa,6tDAAlB;;AAKA,MAAMC,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA,GACzBH,eADyB,6GAKYP,aALZ,6tDAAtB","sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport { css, keyframes } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG } from '../utils';\n\nconst spinAnimation = keyframes`\n\tfrom {\n\t\ttransform: rotate(0deg);\n\t}\n\tto {\n\t\ttransform: rotate(360deg);\n\t}\n `;\n\nexport const StyledSpinner = styled.svg`\n\twidth: ${ CONFIG.spinnerSize }px;\n\theight: ${ CONFIG.spinnerSize }px;\n\tdisplay: inline-block;\n\tmargin: 5px 11px 0;\n\tposition: relative;\n\tcolor: ${ COLORS.ui.theme };\n\toverflow: visible;\n\topacity: 1;\n\tbackground-color: transparent;\n`;\n\nconst commonPathProps = css`\n\tfill: transparent;\n\tstroke-width: 1.5px;\n`;\n\nexport const SpinnerTrack = styled.circle`\n\t${ commonPathProps };\n\tstroke: ${ COLORS.gray[ 300 ] };\n`;\n\nexport const SpinnerIndicator = styled.path`\n\t${ commonPathProps };\n\tstroke: currentColor;\n\tstroke-linecap: round;\n\ttransform-origin: 50% 50%;\n\tanimation: 1.4s linear infinite both ${ spinAnimation };\n`;\n"]}
|