@wordpress/components 28.7.0 → 28.8.1-next.5368f64a9.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 +30 -0
- package/build/composite/context.js +1 -1
- package/build/composite/context.js.map +1 -1
- package/build/composite/group-label.js +1 -1
- package/build/composite/group-label.js.map +1 -1
- package/build/composite/group.js +1 -1
- package/build/composite/group.js.map +1 -1
- package/build/composite/hover.js +1 -1
- package/build/composite/hover.js.map +1 -1
- package/build/composite/index.js +17 -26
- package/build/composite/index.js.map +1 -1
- package/build/composite/item.js +1 -1
- package/build/composite/item.js.map +1 -1
- package/build/composite/legacy/index.js +59 -8
- package/build/composite/legacy/index.js.map +1 -1
- package/build/composite/row.js +1 -1
- package/build/composite/row.js.map +1 -1
- package/build/composite/typeahead.js +1 -1
- package/build/composite/typeahead.js.map +1 -1
- package/build/composite/types.js.map +1 -1
- package/build/date-time/date/index.js +1 -1
- package/build/date-time/date/index.js.map +1 -1
- package/build/date-time/date/styles.js +35 -24
- package/build/date-time/date/styles.js.map +1 -1
- package/build/date-time/date/use-lilius/index.js +163 -0
- package/build/date-time/date/use-lilius/index.js.map +1 -0
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/modal/index.js +11 -4
- package/build/modal/index.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +5 -0
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/private-apis.js +0 -9
- package/build/private-apis.js.map +1 -1
- package/build/slot-fill/index.js +1 -0
- package/build/slot-fill/index.js.map +1 -1
- package/build/tabs/styles.js +3 -3
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tablist.js +5 -4
- package/build/tabs/tablist.js.map +1 -1
- package/build/utils/element-rect.js +73 -105
- package/build/utils/element-rect.js.map +1 -1
- package/build-module/composite/context.js +1 -1
- package/build-module/composite/context.js.map +1 -1
- package/build-module/composite/group-label.js +1 -1
- package/build-module/composite/group-label.js.map +1 -1
- package/build-module/composite/group.js +1 -1
- package/build-module/composite/group.js.map +1 -1
- package/build-module/composite/hover.js +1 -1
- package/build-module/composite/hover.js.map +1 -1
- package/build-module/composite/index.js +17 -26
- package/build-module/composite/index.js.map +1 -1
- package/build-module/composite/item.js +1 -1
- package/build-module/composite/item.js.map +1 -1
- package/build-module/composite/legacy/index.js +56 -8
- package/build-module/composite/legacy/index.js.map +1 -1
- package/build-module/composite/row.js +1 -1
- package/build-module/composite/row.js.map +1 -1
- package/build-module/composite/typeahead.js +1 -1
- package/build-module/composite/typeahead.js.map +1 -1
- package/build-module/composite/types.js.map +1 -1
- package/build-module/date-time/date/index.js +1 -2
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date/styles.js +31 -24
- package/build-module/date-time/date/styles.js.map +1 -1
- package/build-module/date-time/date/use-lilius/index.js +158 -0
- package/build-module/date-time/date/use-lilius/index.js.map +1 -0
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/modal/index.js +12 -4
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +4 -0
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/private-apis.js +0 -9
- package/build-module/private-apis.js.map +1 -1
- package/build-module/slot-fill/index.js +1 -0
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/tabs/styles.js +3 -3
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tablist.js +5 -4
- package/build-module/tabs/tablist.js.map +1 -1
- package/build-module/utils/element-rect.js +74 -105
- package/build-module/utils/element-rect.js.map +1 -1
- package/build-style/style-rtl.css +0 -4
- package/build-style/style.css +0 -4
- package/build-types/composite/context.d.ts.map +1 -1
- package/build-types/composite/index.d.ts +36 -24
- package/build-types/composite/index.d.ts.map +1 -1
- package/build-types/composite/legacy/index.d.ts +25 -2
- package/build-types/composite/legacy/index.d.ts.map +1 -1
- package/build-types/composite/legacy/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/stories/index.story.d.ts +9 -9
- package/build-types/composite/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/types.d.ts +11 -10
- package/build-types/composite/types.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts +0 -3
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/date-time/date/test/use-lilius.d.ts +2 -0
- package/build-types/date-time/date/test/use-lilius.d.ts.map +1 -0
- package/build-types/date-time/date/use-lilius/index.d.ts +169 -0
- package/build-types/date-time/date/use-lilius/index.d.ts.map +1 -0
- 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/modal/stories/index.story.d.ts +3 -0
- package/build-types/modal/stories/index.story.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/slot-fill/index.d.ts +3 -0
- package/build-types/slot-fill/index.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/utils/element-rect.d.ts +32 -74
- package/build-types/utils/element-rect.d.ts.map +1 -1
- package/package.json +19 -20
- package/src/composite/README.md +5 -24
- package/src/composite/{context.ts → context.tsx} +1 -2
- package/src/composite/group-label.tsx +1 -1
- package/src/composite/group.tsx +1 -1
- package/src/composite/hover.tsx +1 -1
- package/src/composite/index.tsx +17 -28
- package/src/composite/item.tsx +1 -1
- package/src/composite/legacy/index.tsx +72 -11
- package/src/composite/legacy/stories/index.story.tsx +2 -1
- package/src/composite/legacy/test/index.tsx +57 -1
- package/src/composite/row.tsx +1 -1
- package/src/composite/stories/index.story.tsx +185 -169
- package/src/composite/typeahead.tsx +1 -1
- package/src/composite/types.ts +13 -15
- package/src/date-time/date/index.tsx +1 -1
- package/src/date-time/date/styles.ts +31 -11
- package/src/date-time/date/test/use-lilius.ts +417 -0
- package/src/date-time/date/use-lilius/index.ts +394 -0
- package/src/index.ts +1 -0
- package/src/modal/index.tsx +16 -7
- package/src/modal/stories/index.story.tsx +8 -14
- package/src/modal/style.scss +0 -5
- package/src/navigator/navigator-screen/component.tsx +7 -0
- package/src/navigator/test/index.tsx +8 -0
- package/src/private-apis.ts +0 -9
- package/src/select-control/README.md +2 -2
- package/src/slot-fill/index.tsx +1 -0
- package/src/tabs/styles.ts +40 -11
- package/src/tabs/tablist.tsx +5 -4
- package/src/utils/element-rect.ts +93 -130
- package/tsconfig.tsbuildinfo +1 -1
- package/build/composite/store.js +0 -54
- package/build/composite/store.js.map +0 -1
- package/build-module/composite/store.js +0 -46
- package/build-module/composite/store.js.map +0 -1
- package/build-types/composite/store.d.ts +0 -25
- package/build-types/composite/store.d.ts.map +0 -1
- package/build-types/composite/stories/utils.d.ts +0 -29
- package/build-types/composite/stories/utils.d.ts.map +0 -1
- package/src/composite/store.ts +0 -46
- package/src/composite/stories/utils.tsx +0 -76
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 28.8.0-next.0 (2024-09-12)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- `Tabs`: indicator positioning under RTL direction ([#64926](https://github.com/WordPress/gutenberg/pull/64926)).
|
|
10
|
+
|
|
11
|
+
### Deprecations
|
|
12
|
+
|
|
13
|
+
- Deprecate `__unstableComposite`, `__unstableCompositeGroup`, `__unstableCompositeItem` and `__unstableUseCompositeState`. Consumers of the package should use the stable `Composite` component instead ([#63572](https://github.com/WordPress/gutenberg/pull/63572)).
|
|
14
|
+
|
|
15
|
+
### New Features
|
|
16
|
+
|
|
17
|
+
- `Composite`: add stable version of the component ([#63569](https://github.com/WordPress/gutenberg/pull/63569)).
|
|
18
|
+
|
|
19
|
+
### Enhancements
|
|
20
|
+
|
|
21
|
+
- `Navigator`: warn if a screen's `path` doesn't follow a URL-like scheme ([#65231](https://github.com/WordPress/gutenberg/pull/65231)).
|
|
22
|
+
- `Modal`: Decrease close button size and remove horizontal offset ([#65131](https://github.com/WordPress/gutenberg/pull/65131)).
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
- `DatePicker`: better hover/focus styles ([#65117](https://github.com/WordPress/gutenberg/pull/65117)).
|
|
27
|
+
|
|
28
|
+
### Internal
|
|
29
|
+
|
|
30
|
+
- `Tabs`: improved performance of the indicator animation ([#64926](https://github.com/WordPress/gutenberg/pull/64926)).
|
|
31
|
+
- `Composite`: Remove from private APIs ([#63569](https://github.com/WordPress/gutenberg/pull/63569)).
|
|
32
|
+
- use local copy of `use-lilius` instead of `npm` dependency ([#65097](https://github.com/WordPress/gutenberg/pull/65097)).
|
|
33
|
+
|
|
5
34
|
## 28.7.0 (2024-09-05)
|
|
6
35
|
|
|
7
36
|
### Deprecations
|
|
@@ -78,6 +107,7 @@
|
|
|
78
107
|
- `Composite` V2: fix Storybook docgen ([#64682](https://github.com/WordPress/gutenberg/pull/64682)).
|
|
79
108
|
- `Composite` V2: add "With Slot Fill" example ([#65051](https://github.com/WordPress/gutenberg/pull/65051)).
|
|
80
109
|
- `Composite` V2: accept store props on top-level component ([#64832](https://github.com/WordPress/gutenberg/pull/64832)).
|
|
110
|
+
- `Composite` V2: remove `store` prop and `useCompositeStore` hook ([#64723](https://github.com/WordPress/gutenberg/pull/64723)).
|
|
81
111
|
|
|
82
112
|
## 28.6.0 (2024-08-21)
|
|
83
113
|
|
|
@@ -13,7 +13,7 @@ var _element = require("@wordpress/element");
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
const CompositeContext = exports.CompositeContext = (0, _element.createContext)(
|
|
16
|
+
const CompositeContext = exports.CompositeContext = (0, _element.createContext)({});
|
|
17
17
|
const useCompositeContext = () => (0, _element.useContext)(CompositeContext);
|
|
18
18
|
exports.useCompositeContext = useCompositeContext;
|
|
19
19
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","CompositeContext","exports","createContext","
|
|
1
|
+
{"version":3,"names":["_element","require","CompositeContext","exports","createContext","useCompositeContext","useContext"],"sources":["@wordpress/components/src/composite/context.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { CompositeContextProps } from './types';\n\nexport const CompositeContext = createContext< CompositeContextProps >( {} );\n\nexport const useCompositeContext = () => useContext( CompositeContext );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAGO,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAAE,sBAAa,EAA2B,CAAC,CAAE,CAAC;AAErE,MAAMC,mBAAmB,GAAGA,CAAA,KAAM,IAAAC,mBAAU,EAAEJ,gBAAiB,CAAC;AAACC,OAAA,CAAAE,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -25,7 +25,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
25
25
|
const CompositeGroupLabel = exports.CompositeGroupLabel = (0, _element.forwardRef)(function CompositeGroupLabel(props, ref) {
|
|
26
26
|
const context = (0, _context.useCompositeContext)();
|
|
27
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Ariakit.CompositeGroupLabel, {
|
|
28
|
-
store: context
|
|
28
|
+
store: context.store,
|
|
29
29
|
...props,
|
|
30
30
|
ref: ref
|
|
31
31
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CompositeGroupLabel","exports","forwardRef","props","ref","context","useCompositeContext","jsx","store"],"sources":["@wordpress/components/src/composite/group-label.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeGroupLabelProps } from './types';\n\nexport const CompositeGroupLabel = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeGroupLabelProps, 'div', false >\n>( function CompositeGroupLabel( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeGroupLabel\n\t\t\tstore={ context
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CompositeGroupLabel","exports","forwardRef","props","ref","context","useCompositeContext","jsx","store"],"sources":["@wordpress/components/src/composite/group-label.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeGroupLabelProps } from './types';\n\nexport const CompositeGroupLabel = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeGroupLabelProps, 'div', false >\n>( function CompositeGroupLabel( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeGroupLabel\n\t\t\tstore={ context.store as Ariakit.CompositeStore }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,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,GAAAC,OAAA,CAAAD,mBAAA,GAAG,IAAAE,mBAAU,EAG1C,SAASF,mBAAmBA,CAAEG,KAAK,EAAEC,GAAG,EAAG;EAC7C,MAAMC,OAAO,GAAG,IAAAC,4BAAmB,EAAC,CAAC;EACrC,oBACC,IAAA3B,WAAA,CAAA4B,GAAA,EAACjC,OAAO,CAAC0B,mBAAmB;IAC3BQ,KAAK,EAAGH,OAAO,CAACG,KAAiC;IAAA,GAC5CL,KAAK;IACVC,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
|
package/build/composite/group.js
CHANGED
|
@@ -25,7 +25,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
25
25
|
const CompositeGroup = exports.CompositeGroup = (0, _element.forwardRef)(function CompositeGroup(props, ref) {
|
|
26
26
|
const context = (0, _context.useCompositeContext)();
|
|
27
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Ariakit.CompositeGroup, {
|
|
28
|
-
store: context
|
|
28
|
+
store: context.store,
|
|
29
29
|
...props,
|
|
30
30
|
ref: ref
|
|
31
31
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CompositeGroup","exports","forwardRef","props","ref","context","useCompositeContext","jsx","store"],"sources":["@wordpress/components/src/composite/group.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeGroupProps } from './types';\n\nexport const CompositeGroup = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeGroupProps, 'div', false >\n>( function CompositeGroup( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeGroup\n\t\t\tstore={ context
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CompositeGroup","exports","forwardRef","props","ref","context","useCompositeContext","jsx","store"],"sources":["@wordpress/components/src/composite/group.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeGroupProps } from './types';\n\nexport const CompositeGroup = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeGroupProps, 'div', false >\n>( function CompositeGroup( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeGroup\n\t\t\tstore={ context.store as Ariakit.CompositeStore }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AAAgD,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,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
|
@@ -25,7 +25,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
25
25
|
const CompositeHover = exports.CompositeHover = (0, _element.forwardRef)(function CompositeHover(props, ref) {
|
|
26
26
|
const context = (0, _context.useCompositeContext)();
|
|
27
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Ariakit.CompositeHover, {
|
|
28
|
-
store: context
|
|
28
|
+
store: context.store,
|
|
29
29
|
...props,
|
|
30
30
|
ref: ref
|
|
31
31
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CompositeHover","exports","forwardRef","props","ref","context","useCompositeContext","jsx","store"],"sources":["@wordpress/components/src/composite/hover.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeHoverProps } from './types';\n\nexport const CompositeHover = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeHoverProps, 'div', false >\n>( function CompositeHover( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeHover\n\t\t\tstore={ context
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CompositeHover","exports","forwardRef","props","ref","context","useCompositeContext","jsx","store"],"sources":["@wordpress/components/src/composite/hover.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeHoverProps } from './types';\n\nexport const CompositeHover = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeHoverProps, 'div', false >\n>( function CompositeHover( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeHover\n\t\t\tstore={ context.store as Ariakit.CompositeStore }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AAAgD,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAdhD;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAKO,MAAMW,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAAE,mBAAU,EAGrC,SAASF,cAAcA,CAAEG,KAAK,EAAEC,GAAG,EAAG;EACxC,MAAMC,OAAO,GAAG,IAAAC,4BAAmB,EAAC,CAAC;EACrC,oBACC,IAAA3B,WAAA,CAAA4B,GAAA,EAACjC,OAAO,CAAC0B,cAAc;IACtBQ,KAAK,EAAGH,OAAO,CAACG,KAAiC;IAAA,GAC5CL,KAAK;IACVC,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
|
package/build/composite/index.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Composite = void 0;
|
|
7
7
|
var Ariakit = _interopRequireWildcard(require("@ariakit/react"));
|
|
8
|
+
var _i18n = require("@wordpress/i18n");
|
|
8
9
|
var _element = require("@wordpress/element");
|
|
9
10
|
var _context = require("./context");
|
|
10
11
|
var _group = require("./group");
|
|
@@ -45,10 +46,9 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
45
46
|
*
|
|
46
47
|
* @example
|
|
47
48
|
* ```jsx
|
|
48
|
-
* import { Composite
|
|
49
|
+
* import { Composite } from '@wordpress/components';
|
|
49
50
|
*
|
|
50
|
-
*
|
|
51
|
-
* <Composite store={store}>
|
|
51
|
+
* <Composite>
|
|
52
52
|
* <Composite.Item>Item 1</Composite.Item>
|
|
53
53
|
* <Composite.Item>Item 2</Composite.Item>
|
|
54
54
|
* </Composite>
|
|
@@ -64,16 +64,14 @@ const Composite = exports.Composite = Object.assign((0, _element.forwardRef)(fun
|
|
|
64
64
|
focusShift = false,
|
|
65
65
|
virtualFocus = false,
|
|
66
66
|
orientation = 'both',
|
|
67
|
-
rtl =
|
|
67
|
+
rtl = (0, _i18n.isRTL)(),
|
|
68
68
|
// Composite component props
|
|
69
69
|
children,
|
|
70
70
|
disabled = false,
|
|
71
|
-
// To be removed
|
|
72
|
-
store: storeProp,
|
|
73
71
|
// Rest props
|
|
74
72
|
...props
|
|
75
73
|
}, ref) {
|
|
76
|
-
const
|
|
74
|
+
const store = Ariakit.useCompositeStore({
|
|
77
75
|
activeId,
|
|
78
76
|
defaultActiveId,
|
|
79
77
|
setActiveId,
|
|
@@ -84,7 +82,6 @@ const Composite = exports.Composite = Object.assign((0, _element.forwardRef)(fun
|
|
|
84
82
|
orientation,
|
|
85
83
|
rtl
|
|
86
84
|
});
|
|
87
|
-
const store = storeProp || newStore;
|
|
88
85
|
const contextValue = (0, _element.useMemo)(() => ({
|
|
89
86
|
store
|
|
90
87
|
}), [store]);
|
|
@@ -104,10 +101,9 @@ const Composite = exports.Composite = Object.assign((0, _element.forwardRef)(fun
|
|
|
104
101
|
*
|
|
105
102
|
* @example
|
|
106
103
|
* ```jsx
|
|
107
|
-
* import { Composite
|
|
104
|
+
* import { Composite } from '@wordpress/components';
|
|
108
105
|
*
|
|
109
|
-
*
|
|
110
|
-
* <Composite store={store}>
|
|
106
|
+
* <Composite>
|
|
111
107
|
* <Composite.Group>
|
|
112
108
|
* <Composite.GroupLabel>Label</Composite.GroupLabel>
|
|
113
109
|
* <Composite.Item>Item 1</Composite.Item>
|
|
@@ -126,10 +122,9 @@ const Composite = exports.Composite = Object.assign((0, _element.forwardRef)(fun
|
|
|
126
122
|
*
|
|
127
123
|
* @example
|
|
128
124
|
* ```jsx
|
|
129
|
-
* import { Composite
|
|
125
|
+
* import { Composite } from '@wordpress/components';
|
|
130
126
|
*
|
|
131
|
-
*
|
|
132
|
-
* <Composite store={store}>
|
|
127
|
+
* <Composite>
|
|
133
128
|
* <Composite.Group>
|
|
134
129
|
* <Composite.GroupLabel>Label</Composite.GroupLabel>
|
|
135
130
|
* <Composite.Item>Item 1</Composite.Item>
|
|
@@ -146,10 +141,9 @@ const Composite = exports.Composite = Object.assign((0, _element.forwardRef)(fun
|
|
|
146
141
|
*
|
|
147
142
|
* @example
|
|
148
143
|
* ```jsx
|
|
149
|
-
* import { Composite
|
|
144
|
+
* import { Composite } from '@wordpress/components';
|
|
150
145
|
*
|
|
151
|
-
*
|
|
152
|
-
* <Composite store={store}>
|
|
146
|
+
* <Composite>
|
|
153
147
|
* <Composite.Item>Item 1</Composite.Item>
|
|
154
148
|
* <Composite.Item>Item 2</Composite.Item>
|
|
155
149
|
* <Composite.Item>Item 3</Composite.Item>
|
|
@@ -166,10 +160,9 @@ const Composite = exports.Composite = Object.assign((0, _element.forwardRef)(fun
|
|
|
166
160
|
*
|
|
167
161
|
* @example
|
|
168
162
|
* ```jsx
|
|
169
|
-
* import { Composite
|
|
163
|
+
* import { Composite } from '@wordpress/components';
|
|
170
164
|
*
|
|
171
|
-
*
|
|
172
|
-
* <Composite store={store}>
|
|
165
|
+
* <Composite>
|
|
173
166
|
* <Composite.Row>
|
|
174
167
|
* <Composite.Item>Item 1.1</Composite.Item>
|
|
175
168
|
* <Composite.Item>Item 1.2</Composite.Item>
|
|
@@ -193,10 +186,9 @@ const Composite = exports.Composite = Object.assign((0, _element.forwardRef)(fun
|
|
|
193
186
|
*
|
|
194
187
|
* @example
|
|
195
188
|
* ```jsx
|
|
196
|
-
* import { Composite
|
|
189
|
+
* import { Composite } from '@wordpress/components';
|
|
197
190
|
*
|
|
198
|
-
*
|
|
199
|
-
* <Composite store={store}>
|
|
191
|
+
* <Composite>
|
|
200
192
|
* <Composite.Hover render={ <Composite.Item /> }>
|
|
201
193
|
* Item 1
|
|
202
194
|
* </Composite.Hover>
|
|
@@ -216,10 +208,9 @@ const Composite = exports.Composite = Object.assign((0, _element.forwardRef)(fun
|
|
|
216
208
|
*
|
|
217
209
|
* @example
|
|
218
210
|
* ```jsx
|
|
219
|
-
* import { Composite
|
|
211
|
+
* import { Composite } from '@wordpress/components';
|
|
220
212
|
*
|
|
221
|
-
*
|
|
222
|
-
* <Composite store={store} render={ <CompositeTypeahead /> }>
|
|
213
|
+
* <Composite render={ <CompositeTypeahead /> }>
|
|
223
214
|
* <Composite.Item>Item 1</Composite.Item>
|
|
224
215
|
* <Composite.Item>Item 2</Composite.Item>
|
|
225
216
|
* </Composite>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_context","_group","_groupLabel","_hover","_item","_row","_typeahead","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Composite","exports","assign","forwardRef","activeId","defaultActiveId","setActiveId","focusLoop","focusWrap","focusShift","virtualFocus","orientation","rtl","children","disabled","store","storeProp","props","ref","newStore","useCompositeStore","contextValue","useMemo","jsx","CompositeContext","Provider","value","Group","CompositeGroup","displayName","GroupLabel","CompositeGroupLabel","Item","CompositeItem","Row","CompositeRow","Hover","CompositeHover","Typeahead","CompositeTypeahead","Context"],"sources":["@wordpress/components/src/composite/index.tsx"],"sourcesContent":["/**\n * Composite is a component that may contain navigable items represented by\n * Composite.Item. It's inspired by the WAI-ARIA Composite Role and implements\n * all the keyboard navigation mechanisms to ensure that there's only one\n * tab stop for the whole Composite element. This means that it can behave as\n * a roving tabindex or aria-activedescendant container.\n *\n * @see https://ariakit.org/components/composite\n */\n\n/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { CompositeContext } from './context';\nimport { CompositeGroup } from './group';\nimport { CompositeGroupLabel } from './group-label';\nimport { CompositeHover } from './hover';\nimport { CompositeItem } from './item';\nimport { CompositeRow } from './row';\nimport { CompositeTypeahead } from './typeahead';\nimport type { CompositeProps } from './types';\n\n/**\n * Renders a widget based on the WAI-ARIA [`composite`](https://w3c.github.io/aria/#composite)\n * role, which provides a single tab stop on the page and arrow key navigation\n * through the focusable descendants.\n *\n * @example\n * ```jsx\n * import { Composite, useCompositeStore } from '@wordpress/components';\n *\n * const store = useCompositeStore();\n * <Composite store={store}>\n * <Composite.Item>Item 1</Composite.Item>\n * <Composite.Item>Item 2</Composite.Item>\n * </Composite>\n * ```\n */\nexport const Composite = Object.assign(\n\tforwardRef<\n\t\tHTMLDivElement,\n\t\tWordPressComponentProps< CompositeProps, 'div', false >\n\t>( function Composite(\n\t\t{\n\t\t\t// Composite store props\n\t\t\tactiveId,\n\t\t\tdefaultActiveId,\n\t\t\tsetActiveId,\n\t\t\tfocusLoop = false,\n\t\t\tfocusWrap = false,\n\t\t\tfocusShift = false,\n\t\t\tvirtualFocus = false,\n\t\t\torientation = 'both',\n\t\t\trtl = false,\n\n\t\t\t// Composite component props\n\t\t\tchildren,\n\t\t\tdisabled = false,\n\n\t\t\t// To be removed\n\t\t\tstore: storeProp,\n\n\t\t\t// Rest props\n\t\t\t...props\n\t\t},\n\t\tref\n\t) {\n\t\tconst newStore = Ariakit.useCompositeStore( {\n\t\t\tactiveId,\n\t\t\tdefaultActiveId,\n\t\t\tsetActiveId,\n\t\t\tfocusLoop,\n\t\t\tfocusWrap,\n\t\t\tfocusShift,\n\t\t\tvirtualFocus,\n\t\t\torientation,\n\t\t\trtl,\n\t\t} );\n\n\t\tconst store = storeProp || newStore;\n\n\t\tconst contextValue = useMemo(\n\t\t\t() => ( {\n\t\t\t\tstore,\n\t\t\t} ),\n\t\t\t[ store ]\n\t\t);\n\n\t\treturn (\n\t\t\t<Ariakit.Composite\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tstore={ store }\n\t\t\t\t{ ...props }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t<CompositeContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</CompositeContext.Provider>\n\t\t\t</Ariakit.Composite>\n\t\t);\n\t} ),\n\t{\n\t\t/**\n\t\t * Renders a group element for composite items.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Group>\n\t\t * <Composite.GroupLabel>Label</Composite.GroupLabel>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </CompositeGroup>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tGroup: Object.assign( CompositeGroup, {\n\t\t\tdisplayName: 'Composite.Group',\n\t\t} ),\n\t\t/**\n\t\t * Renders a label in a composite group. This component must be wrapped with\n\t\t * `Composite.Group` so the `aria-labelledby` prop is properly set on the\n\t\t * composite group element.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Group>\n\t\t * <Composite.GroupLabel>Label</Composite.GroupLabel>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </CompositeGroup>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tGroupLabel: Object.assign( CompositeGroupLabel, {\n\t\t\tdisplayName: 'Composite.GroupLabel',\n\t\t} ),\n\t\t/**\n\t\t * Renders a composite item.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * <Composite.Item>Item 3</Composite.Item>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tItem: Object.assign( CompositeItem, { displayName: 'Composite.Item' } ),\n\t\t/**\n\t\t * Renders a composite row. Wrapping `Composite.Item` elements within\n\t\t * `Composite.Row` will create a two-dimensional composite widget, such as a\n\t\t * grid.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Row>\n\t\t * <Composite.Item>Item 1.1</Composite.Item>\n\t\t * <Composite.Item>Item 1.2</Composite.Item>\n\t\t * <Composite.Item>Item 1.3</Composite.Item>\n\t\t * </Composite.Row>\n\t\t * <Composite.Row>\n\t\t * <Composite.Item>Item 2.1</Composite.Item>\n\t\t * <Composite.Item>Item 2.2</Composite.Item>\n\t\t * <Composite.Item>Item 2.3</Composite.Item>\n\t\t * </Composite.Row>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tRow: Object.assign( CompositeRow, { displayName: 'Composite.Row' } ),\n\t\t/**\n\t\t * Renders an element in a composite widget that receives focus on mouse move\n\t\t * and loses focus to the composite base element on mouse leave. This should\n\t\t * be combined with the `Composite.Item` component.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Hover render={ <Composite.Item /> }>\n\t\t * Item 1\n\t\t * </Composite.Hover>\n\t\t * <Composite.Hover render={ <Composite.Item /> }>\n\t\t * Item 2\n\t\t * </Composite.Hover>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tHover: Object.assign( CompositeHover, {\n\t\t\tdisplayName: 'Composite.Hover',\n\t\t} ),\n\t\t/**\n\t\t * Renders a component that adds typeahead functionality to composite\n\t\t * components. Hitting printable character keys will move focus to the next\n\t\t * composite item that begins with the input characters.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store} render={ <CompositeTypeahead /> }>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tTypeahead: Object.assign( CompositeTypeahead, {\n\t\t\tdisplayName: 'Composite.Typeahead',\n\t\t} ),\n\t\t/**\n\t\t * The React context used by the composite components. It can be used by\n\t\t * to access the composite store, and to forward the context when composite\n\t\t * sub-components are rendered across portals (ie. `SlotFill` components)\n\t\t * that would not otherwise forward the context to the `Fill` children.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite } from '@wordpress/components';\n\t\t * import { useContext } from '@wordpress/element';\n\t\t *\n\t\t * const compositeContext = useContext( Composite.Context );\n\t\t * ```\n\t\t */\n\t\tContext: Object.assign( CompositeContext, {\n\t\t\tdisplayName: 'Composite.Context',\n\t\t} ),\n\t}\n);\n"],"mappings":";;;;;;AAaA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAAiD,IAAAS,WA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;AACA;EACEc,KAAK,EAAEnC,MAAM,CAACU,MAAM,CAAE0B,qBAAc,EAAE;IACrCC,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,UAAU,EAAEtC,MAAM,CAACU,MAAM,CAAE6B,+BAAmB,EAAE;IAC/CF,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEG,IAAI,EAAExC,MAAM,CAACU,MAAM,CAAE+B,mBAAa,EAAE;IAAEJ,WAAW,EAAE;EAAiB,CAAE,CAAC;EACvE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,GAAG,EAAE1C,MAAM,CAACU,MAAM,CAAEiC,iBAAY,EAAE;IAAEN,WAAW,EAAE;EAAgB,CAAE,CAAC;EACpE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEO,KAAK,EAAE5C,MAAM,CAACU,MAAM,CAAEmC,qBAAc,EAAE;IACrCR,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACES,SAAS,EAAE9C,MAAM,CAACU,MAAM,CAAEqC,6BAAkB,EAAE;IAC7CV,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEW,OAAO,EAAEhD,MAAM,CAACU,MAAM,CAAEsB,yBAAgB,EAAE;IACzCK,WAAW,EAAE;EACd,CAAE;AACH,CACD,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_i18n","_element","_context","_group","_groupLabel","_hover","_item","_row","_typeahead","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Composite","exports","assign","forwardRef","activeId","defaultActiveId","setActiveId","focusLoop","focusWrap","focusShift","virtualFocus","orientation","rtl","isRTL","children","disabled","props","ref","store","useCompositeStore","contextValue","useMemo","jsx","CompositeContext","Provider","value","Group","CompositeGroup","displayName","GroupLabel","CompositeGroupLabel","Item","CompositeItem","Row","CompositeRow","Hover","CompositeHover","Typeahead","CompositeTypeahead","Context"],"sources":["@wordpress/components/src/composite/index.tsx"],"sourcesContent":["/**\n * Composite is a component that may contain navigable items represented by\n * Composite.Item. It's inspired by the WAI-ARIA Composite Role and implements\n * all the keyboard navigation mechanisms to ensure that there's only one\n * tab stop for the whole Composite element. This means that it can behave as\n * a roving tabindex or aria-activedescendant container.\n *\n * @see https://ariakit.org/components/composite\n */\n\n/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { isRTL } from '@wordpress/i18n';\nimport { useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { CompositeContext } from './context';\nimport { CompositeGroup } from './group';\nimport { CompositeGroupLabel } from './group-label';\nimport { CompositeHover } from './hover';\nimport { CompositeItem } from './item';\nimport { CompositeRow } from './row';\nimport { CompositeTypeahead } from './typeahead';\nimport type { CompositeProps } from './types';\n\n/**\n * Renders a widget based on the WAI-ARIA [`composite`](https://w3c.github.io/aria/#composite)\n * role, which provides a single tab stop on the page and arrow key navigation\n * through the focusable descendants.\n *\n * @example\n * ```jsx\n * import { Composite } from '@wordpress/components';\n *\n * <Composite>\n * <Composite.Item>Item 1</Composite.Item>\n * <Composite.Item>Item 2</Composite.Item>\n * </Composite>\n * ```\n */\nexport const Composite = Object.assign(\n\tforwardRef<\n\t\tHTMLDivElement,\n\t\tWordPressComponentProps< CompositeProps, 'div', false >\n\t>( function Composite(\n\t\t{\n\t\t\t// Composite store props\n\t\t\tactiveId,\n\t\t\tdefaultActiveId,\n\t\t\tsetActiveId,\n\t\t\tfocusLoop = false,\n\t\t\tfocusWrap = false,\n\t\t\tfocusShift = false,\n\t\t\tvirtualFocus = false,\n\t\t\torientation = 'both',\n\t\t\trtl = isRTL(),\n\n\t\t\t// Composite component props\n\t\t\tchildren,\n\t\t\tdisabled = false,\n\n\t\t\t// Rest props\n\t\t\t...props\n\t\t},\n\t\tref\n\t) {\n\t\tconst store = Ariakit.useCompositeStore( {\n\t\t\tactiveId,\n\t\t\tdefaultActiveId,\n\t\t\tsetActiveId,\n\t\t\tfocusLoop,\n\t\t\tfocusWrap,\n\t\t\tfocusShift,\n\t\t\tvirtualFocus,\n\t\t\torientation,\n\t\t\trtl,\n\t\t} );\n\n\t\tconst contextValue = useMemo(\n\t\t\t() => ( {\n\t\t\t\tstore,\n\t\t\t} ),\n\t\t\t[ store ]\n\t\t);\n\n\t\treturn (\n\t\t\t<Ariakit.Composite\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tstore={ store }\n\t\t\t\t{ ...props }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t<CompositeContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</CompositeContext.Provider>\n\t\t\t</Ariakit.Composite>\n\t\t);\n\t} ),\n\t{\n\t\t/**\n\t\t * Renders a group element for composite items.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite } from '@wordpress/components';\n\t\t *\n\t\t * <Composite>\n\t\t * <Composite.Group>\n\t\t * <Composite.GroupLabel>Label</Composite.GroupLabel>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </CompositeGroup>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tGroup: Object.assign( CompositeGroup, {\n\t\t\tdisplayName: 'Composite.Group',\n\t\t} ),\n\t\t/**\n\t\t * Renders a label in a composite group. This component must be wrapped with\n\t\t * `Composite.Group` so the `aria-labelledby` prop is properly set on the\n\t\t * composite group element.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite } from '@wordpress/components';\n\t\t *\n\t\t * <Composite>\n\t\t * <Composite.Group>\n\t\t * <Composite.GroupLabel>Label</Composite.GroupLabel>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </CompositeGroup>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tGroupLabel: Object.assign( CompositeGroupLabel, {\n\t\t\tdisplayName: 'Composite.GroupLabel',\n\t\t} ),\n\t\t/**\n\t\t * Renders a composite item.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite } from '@wordpress/components';\n\t\t *\n\t\t * <Composite>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * <Composite.Item>Item 3</Composite.Item>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tItem: Object.assign( CompositeItem, { displayName: 'Composite.Item' } ),\n\t\t/**\n\t\t * Renders a composite row. Wrapping `Composite.Item` elements within\n\t\t * `Composite.Row` will create a two-dimensional composite widget, such as a\n\t\t * grid.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite } from '@wordpress/components';\n\t\t *\n\t\t * <Composite>\n\t\t * <Composite.Row>\n\t\t * <Composite.Item>Item 1.1</Composite.Item>\n\t\t * <Composite.Item>Item 1.2</Composite.Item>\n\t\t * <Composite.Item>Item 1.3</Composite.Item>\n\t\t * </Composite.Row>\n\t\t * <Composite.Row>\n\t\t * <Composite.Item>Item 2.1</Composite.Item>\n\t\t * <Composite.Item>Item 2.2</Composite.Item>\n\t\t * <Composite.Item>Item 2.3</Composite.Item>\n\t\t * </Composite.Row>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tRow: Object.assign( CompositeRow, { displayName: 'Composite.Row' } ),\n\t\t/**\n\t\t * Renders an element in a composite widget that receives focus on mouse move\n\t\t * and loses focus to the composite base element on mouse leave. This should\n\t\t * be combined with the `Composite.Item` component.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite } from '@wordpress/components';\n\t\t *\n\t\t * <Composite>\n\t\t * <Composite.Hover render={ <Composite.Item /> }>\n\t\t * Item 1\n\t\t * </Composite.Hover>\n\t\t * <Composite.Hover render={ <Composite.Item /> }>\n\t\t * Item 2\n\t\t * </Composite.Hover>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tHover: Object.assign( CompositeHover, {\n\t\t\tdisplayName: 'Composite.Hover',\n\t\t} ),\n\t\t/**\n\t\t * Renders a component that adds typeahead functionality to composite\n\t\t * components. Hitting printable character keys will move focus to the next\n\t\t * composite item that begins with the input characters.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite } from '@wordpress/components';\n\t\t *\n\t\t * <Composite render={ <CompositeTypeahead /> }>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tTypeahead: Object.assign( CompositeTypeahead, {\n\t\t\tdisplayName: 'Composite.Typeahead',\n\t\t} ),\n\t\t/**\n\t\t * The React context used by the composite components. It can be used by\n\t\t * to access the composite store, and to forward the context when composite\n\t\t * sub-components are rendered across portals (ie. `SlotFill` components)\n\t\t * that would not otherwise forward the context to the `Fill` children.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite } from '@wordpress/components';\n\t\t * import { useContext } from '@wordpress/element';\n\t\t *\n\t\t * const compositeContext = useContext( Composite.Context );\n\t\t * ```\n\t\t */\n\t\tContext: Object.assign( CompositeContext, {\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GA,QAAU;IACrBG,KAAK,EAAGA,KAAO;IAAA,GACVF,KAAK;IACVC,GAAG,EAAGA,GAAK;IAAAH,QAAA,eAEX,IAAAnC,WAAA,CAAA2C,GAAA,EAAClD,QAAA,CAAAmD,gBAAgB,CAACC,QAAQ;MAACC,KAAK,EAAGL,YAAc;MAAAN,QAAA,EAC9CA;IAAQ,CACgB;EAAC,CACV,CAAC;AAEtB,CAAE,CAAC,EACH;EACC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEY,KAAK,EAAElC,MAAM,CAACU,MAAM,CAAEyB,qBAAc,EAAE;IACrCC,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,UAAU,EAAErC,MAAM,CAACU,MAAM,CAAE4B,+BAAmB,EAAE;IAC/CF,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEG,IAAI,EAAEvC,MAAM,CAACU,MAAM,CAAE8B,mBAAa,EAAE;IAAEJ,WAAW,EAAE;EAAiB,CAAE,CAAC;EACvE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,GAAG,EAAEzC,MAAM,CAACU,MAAM,CAAEgC,iBAAY,EAAE;IAAEN,WAAW,EAAE;EAAgB,CAAE,CAAC;EACpE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEO,KAAK,EAAE3C,MAAM,CAACU,MAAM,CAAEkC,qBAAc,EAAE;IACrCR,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACES,SAAS,EAAE7C,MAAM,CAACU,MAAM,CAAEoC,6BAAkB,EAAE;IAC7CV,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEW,OAAO,EAAE/C,MAAM,CAACU,MAAM,CAAEqB,yBAAgB,EAAE;IACzCK,WAAW,EAAE;EACd,CAAE;AACH,CACD,CAAC","ignoreList":[]}
|
package/build/composite/item.js
CHANGED
|
@@ -25,7 +25,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
25
25
|
const CompositeItem = exports.CompositeItem = (0, _element.forwardRef)(function CompositeItem(props, ref) {
|
|
26
26
|
const context = (0, _context.useCompositeContext)();
|
|
27
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Ariakit.CompositeItem, {
|
|
28
|
-
store: context
|
|
28
|
+
store: context.store,
|
|
29
29
|
...props,
|
|
30
30
|
ref: ref
|
|
31
31
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CompositeItem","exports","forwardRef","props","ref","context","useCompositeContext","jsx","store"],"sources":["@wordpress/components/src/composite/item.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeItemProps } from './types';\n\nexport const CompositeItem = forwardRef<\n\tHTMLButtonElement,\n\tWordPressComponentProps< CompositeItemProps, 'button', false >\n>( function CompositeItem( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeItem\n\t\t\tstore={ context
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CompositeItem","exports","forwardRef","props","ref","context","useCompositeContext","jsx","store"],"sources":["@wordpress/components/src/composite/item.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeItemProps } from './types';\n\nexport const CompositeItem = forwardRef<\n\tHTMLButtonElement,\n\tWordPressComponentProps< CompositeItemProps, 'button', false >\n>( function CompositeItem( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeItem\n\t\t\tstore={ context.store as Ariakit.CompositeStore }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AAAgD,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OA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ault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.CompositeItem = exports.CompositeGroup = exports.Composite = void 0;
|
|
7
8
|
exports.useCompositeState = useCompositeState;
|
|
9
|
+
var Ariakit = _interopRequireWildcard(require("@ariakit/react"));
|
|
8
10
|
var _element = require("@wordpress/element");
|
|
9
|
-
var _ = require("..");
|
|
10
|
-
var _store = require("../store");
|
|
11
11
|
var _compose = require("@wordpress/compose");
|
|
12
|
+
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
13
|
+
var _ = require("..");
|
|
12
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
17
|
/**
|
|
14
18
|
* Composite is a component that may contain navigable items represented by
|
|
15
19
|
* CompositeItem. It's inspired by the WAI-ARIA Composite Role and implements
|
|
@@ -25,6 +29,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
25
29
|
* @see https://ariakit.org/components/composite
|
|
26
30
|
*/
|
|
27
31
|
|
|
32
|
+
/**
|
|
33
|
+
* External dependencies
|
|
34
|
+
*/
|
|
35
|
+
|
|
28
36
|
/**
|
|
29
37
|
* WordPress dependencies
|
|
30
38
|
*/
|
|
@@ -58,9 +66,20 @@ function mapLegacyStatePropsToComponentProps(legacyProps) {
|
|
|
58
66
|
}
|
|
59
67
|
return legacyProps;
|
|
60
68
|
}
|
|
69
|
+
const LEGACY_TO_NEW_DISPLAY_NAME = {
|
|
70
|
+
__unstableComposite: 'Composite',
|
|
71
|
+
__unstableCompositeGroup: 'Composite.Group or Composite.Row',
|
|
72
|
+
__unstableCompositeItem: 'Composite.Item',
|
|
73
|
+
__unstableUseCompositeState: 'Composite'
|
|
74
|
+
};
|
|
61
75
|
function proxyComposite(ProxiedComponent, propMap = {}) {
|
|
62
|
-
|
|
76
|
+
var _ProxiedComponent$dis;
|
|
77
|
+
const displayName = (_ProxiedComponent$dis = ProxiedComponent.displayName) !== null && _ProxiedComponent$dis !== void 0 ? _ProxiedComponent$dis : '';
|
|
63
78
|
const Component = legacyProps => {
|
|
79
|
+
(0, _deprecated.default)(`wp.components.${displayName}`, {
|
|
80
|
+
since: '6.7',
|
|
81
|
+
alternative: LEGACY_TO_NEW_DISPLAY_NAME.hasOwnProperty(displayName) ? LEGACY_TO_NEW_DISPLAY_NAME[displayName] : undefined
|
|
82
|
+
});
|
|
64
83
|
const {
|
|
65
84
|
store,
|
|
66
85
|
...rest
|
|
@@ -89,7 +108,7 @@ function proxyComposite(ProxiedComponent, propMap = {}) {
|
|
|
89
108
|
// `CompositeRow`, but this has been split into two different
|
|
90
109
|
// components. We handle that difference by checking on the
|
|
91
110
|
// provided role, and returning the appropriate component.
|
|
92
|
-
const
|
|
111
|
+
const UnproxiedCompositeGroup = (0, _element.forwardRef)(({
|
|
93
112
|
role,
|
|
94
113
|
...props
|
|
95
114
|
}, ref) => {
|
|
@@ -100,14 +119,46 @@ const unproxiedCompositeGroup = (0, _element.forwardRef)(({
|
|
|
100
119
|
...props
|
|
101
120
|
});
|
|
102
121
|
});
|
|
103
|
-
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* _Note: please use the `Composite` component instead._
|
|
125
|
+
*
|
|
126
|
+
* @deprecated
|
|
127
|
+
*/
|
|
128
|
+
const Composite = exports.Composite = proxyComposite(Object.assign(_.Composite, {
|
|
129
|
+
displayName: '__unstableComposite'
|
|
130
|
+
}), {
|
|
104
131
|
baseId: 'id'
|
|
105
132
|
});
|
|
106
|
-
|
|
107
|
-
|
|
133
|
+
/**
|
|
134
|
+
* _Note: please use the `Composite.Row` or `Composite.Group` components instead._
|
|
135
|
+
*
|
|
136
|
+
* @deprecated
|
|
137
|
+
*/
|
|
138
|
+
const CompositeGroup = exports.CompositeGroup = proxyComposite(Object.assign(UnproxiedCompositeGroup, {
|
|
139
|
+
displayName: '__unstableCompositeGroup'
|
|
140
|
+
}));
|
|
141
|
+
/**
|
|
142
|
+
* _Note: please use the `Composite.Item` component instead._
|
|
143
|
+
*
|
|
144
|
+
* @deprecated
|
|
145
|
+
*/
|
|
146
|
+
const CompositeItem = exports.CompositeItem = proxyComposite(Object.assign(_.Composite.Item, {
|
|
147
|
+
displayName: '__unstableCompositeItem'
|
|
148
|
+
}), {
|
|
108
149
|
focusable: 'accessibleWhenDisabled'
|
|
109
150
|
});
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* _Note: please use the `Composite` component instead._
|
|
154
|
+
*
|
|
155
|
+
* @deprecated
|
|
156
|
+
*/
|
|
110
157
|
function useCompositeState(legacyStateOptions = {}) {
|
|
158
|
+
(0, _deprecated.default)(`wp.components.__unstableUseCompositeState`, {
|
|
159
|
+
since: '6.7',
|
|
160
|
+
alternative: LEGACY_TO_NEW_DISPLAY_NAME.__unstableUseCompositeState
|
|
161
|
+
});
|
|
111
162
|
const {
|
|
112
163
|
baseId,
|
|
113
164
|
currentId: defaultActiveId,
|
|
@@ -121,7 +172,7 @@ function useCompositeState(legacyStateOptions = {}) {
|
|
|
121
172
|
} = legacyStateOptions;
|
|
122
173
|
return {
|
|
123
174
|
baseId: (0, _compose.useInstanceId)(Composite, 'composite', baseId),
|
|
124
|
-
store:
|
|
175
|
+
store: Ariakit.useCompositeStore({
|
|
125
176
|
defaultActiveId,
|
|
126
177
|
rtl,
|
|
127
178
|
orientation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_","_store","_compose","_jsxRuntime","mapLegacyStatePropsToComponentProps","legacyProps","state","rest","store","props","proxyComposite","ProxiedComponent","propMap","displayName","Component","id","useInstanceId","baseId","Object","entries","forEach","from","to","hasOwnProperty","assign","jsx","unproxiedCompositeGroup","forwardRef","role","ref","Current","Row","Group","Composite","exports","CompositeGroup","CompositeItem","Item","focusable","useCompositeState","legacyStateOptions","currentId","defaultActiveId","orientation","rtl","loop","focusLoop","wrap","focusWrap","shift","focusShift","unstable_virtual","virtualFocus","useCompositeStore"],"sources":["@wordpress/components/src/composite/legacy/index.tsx"],"sourcesContent":["/**\n * Composite is a component that may contain navigable items represented by\n * CompositeItem. It's inspired by the WAI-ARIA Composite Role and implements\n * all the keyboard navigation mechanisms to ensure that there's only one\n * tab stop for the whole Composite element. This means that it can behave as\n * a roving tabindex or aria-activedescendant container.\n *\n * This file aims at providing components that are as close as possible to the\n * original `reakit`-based implementation (which was removed from the codebase),\n * although it is recommended that consumers of the package switch to the stable,\n * un-prefixed, `ariakit`-based version of `Composite`.\n *\n * @see https://ariakit.org/components/composite\n */\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Composite as Current } from '..';\nimport { useCompositeStore } from '../store';\nimport { useInstanceId } from '@wordpress/compose';\n\ntype Orientation = 'horizontal' | 'vertical';\n\nexport interface LegacyStateOptions {\n\t/**\n\t * ID that will serve as a base for all the items IDs.\n\t */\n\tbaseId?: string;\n\t/**\n\t * Determines how next and previous functions will behave. If `rtl` is set\n\t * to `true`, they will be inverted. This only affects the composite widget\n\t * behavior. You still need to set `dir=\"rtl\"` on HTML/CSS.\n\t *\n\t * @default false\n\t */\n\trtl?: boolean;\n\t/**\n\t * Defines the orientation of the composite widget. If the composite has a\n\t * single row or column (one-dimensional), the orientation value determines\n\t * which arrow keys can be used to move focus.\n\t */\n\torientation?: Orientation;\n\t/**\n\t * The current focused item `id`.\n\t */\n\tcurrentId?: string;\n\t/**\n\t * Determines how focus moves from the start and end of rows and columns.\n\t *\n\t * @default false\n\t */\n\tloop?: boolean | Orientation;\n\t/**\n\t * If enabled, moving to the next item from the last one in a row or column\n\t * will focus the first item in the next row or column and vice-versa.\n\t *\n\t * ** Has effect only on two-dimensional composites. **\n\t *\n\t * @default false\n\t */\n\twrap?: boolean | Orientation;\n\t/**\n\t * If enabled, moving up or down when there's no next item or the next item\n\t * is disabled will shift to the item right before it.\n\t *\n\t * ** Has effect only on two-dimensional composites. **\n\t *\n\t * @default false\n\t */\n\tshift?: boolean;\n\tunstable_virtual?: boolean;\n}\n\ntype Component = React.FunctionComponent< any >;\n\ntype CompositeStore = ReturnType< typeof useCompositeStore >;\ntype CompositeStoreState = { store: CompositeStore };\nexport type CompositeState = CompositeStoreState &\n\tRequired< Pick< LegacyStateOptions, 'baseId' > >;\n\n// Legacy composite components can either provide state through a\n// single `state` prop, or via individual props, usually through\n// spreading the state generated by `useCompositeState`.\n// That is, `<Composite* { ...state }>`.\nexport type CompositeStateProps =\n\t| { state: CompositeState }\n\t| ( CompositeState & { state?: never } );\ntype ComponentProps< C extends Component > = React.ComponentPropsWithRef< C >;\nexport type CompositeProps< C extends Component > = ComponentProps< C > &\n\tCompositeStateProps;\ntype CompositeComponent< C extends Component > = (\n\tprops: CompositeProps< C >\n) => React.ReactElement;\ntype CompositeComponentProps = CompositeState &\n\t(\n\t\t| ComponentProps< typeof Current.Group >\n\t\t| ComponentProps< typeof Current.Item >\n\t\t| ComponentProps< typeof Current.Row >\n\t);\n\nfunction mapLegacyStatePropsToComponentProps(\n\tlegacyProps: CompositeStateProps\n): CompositeComponentProps {\n\t// If a `state` prop is provided, we unpack that; otherwise,\n\t// the necessary props are provided directly in `legacyProps`.\n\tif ( legacyProps.state ) {\n\t\tconst { state, ...rest } = legacyProps;\n\t\tconst { store, ...props } =\n\t\t\tmapLegacyStatePropsToComponentProps( state );\n\t\treturn { ...rest, ...props, store };\n\t}\n\n\treturn legacyProps;\n}\n\nfunction proxyComposite< C extends Component >(\n\tProxiedComponent: C | React.ForwardRefExoticComponent< C >,\n\tpropMap: Record< string, string > = {}\n): CompositeComponent< C > {\n\tconst displayName = ProxiedComponent.displayName;\n\tconst Component = ( legacyProps: CompositeStateProps ) => {\n\t\tconst { store, ...rest } =\n\t\t\tmapLegacyStatePropsToComponentProps( legacyProps );\n\t\tconst props = rest as ComponentProps< C >;\n\t\tprops.id = useInstanceId( store, props.baseId, props.id );\n\n\t\tObject.entries( propMap ).forEach( ( [ from, to ] ) => {\n\t\t\tif ( props.hasOwnProperty( from ) ) {\n\t\t\t\tObject.assign( props, { [ to ]: props[ from ] } );\n\t\t\t\tdelete props[ from ];\n\t\t\t}\n\t\t} );\n\n\t\tdelete props.baseId;\n\n\t\treturn <ProxiedComponent { ...props } store={ store } />;\n\t};\n\tComponent.displayName = displayName;\n\treturn Component;\n}\n\n// The old `CompositeGroup` used to behave more like the current\n// `CompositeRow`, but this has been split into two different\n// components. We handle that difference by checking on the\n// provided role, and returning the appropriate component.\nconst unproxiedCompositeGroup = forwardRef<\n\tany,\n\tReact.ComponentPropsWithoutRef< typeof Current.Group | typeof Current.Row >\n>( ( { role, ...props }, ref ) => {\n\tconst Component = role === 'row' ? Current.Row : Current.Group;\n\treturn <Component ref={ ref } role={ role } { ...props } />;\n} );\n\nexport const Composite = proxyComposite( Current, { baseId: 'id' } );\nexport const CompositeGroup = proxyComposite( unproxiedCompositeGroup );\nexport const CompositeItem = proxyComposite( Current.Item, {\n\tfocusable: 'accessibleWhenDisabled',\n} );\n\nexport function useCompositeState(\n\tlegacyStateOptions: LegacyStateOptions = {}\n): CompositeState {\n\tconst {\n\t\tbaseId,\n\t\tcurrentId: defaultActiveId,\n\t\torientation,\n\t\trtl = false,\n\t\tloop: focusLoop = false,\n\t\twrap: focusWrap = false,\n\t\tshift: focusShift = false,\n\t\t// eslint-disable-next-line camelcase\n\t\tunstable_virtual: virtualFocus,\n\t} = legacyStateOptions;\n\n\treturn {\n\t\tbaseId: useInstanceId( Composite, 'composite', baseId ),\n\t\tstore: useCompositeStore( {\n\t\t\tdefaultActiveId,\n\t\t\trtl,\n\t\t\torientation,\n\t\t\tfocusLoop,\n\t\t\tfocusShift,\n\t\t\tfocusWrap,\n\t\t\tvirtualFocus,\n\t\t} ),\n\t};\n}\n"],"mappings":";;;;;;;AAkBA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,CAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAAmD,IAAAI,WAAA,GAAAJ,OAAA;AAzBnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAgEA;AACA;AACA;AACA;;AAiBA,SAASK,mCAAmCA,CAC3CC,WAAgC,EACN;EAC1B;EACA;EACA,IAAKA,WAAW,CAACC,KAAK,EAAG;IACxB,MAAM;MAAEA,KAAK;MAAE,GAAGC;IAAK,CAAC,GAAGF,WAAW;IACtC,MAAM;MAAEG,KAAK;MAAE,GAAGC;IAAM,CAAC,GACxBL,mCAAmC,CAAEE,KAAM,CAAC;IAC7C,OAAO;MAAE,GAAGC,IAAI;MAAE,GAAGE,KAAK;MAAED;IAAM,CAAC;EACpC;EAEA,OAAOH,WAAW;AACnB;AAEA,SAASK,cAAcA,CACtBC,gBAA0D,EAC1DC,OAAiC,GAAG,CAAC,CAAC,EACZ;EAC1B,MAAMC,WAAW,GAAGF,gBAAgB,CAACE,WAAW;EAChD,MAAMC,SAAS,GAAKT,WAAgC,IAAM;IACzD,MAAM;MAAEG,KAAK;MAAE,GAAGD;IAAK,CAAC,GACvBH,mCAAmC,CAAEC,WAAY,CAAC;IACnD,MAAMI,KAAK,G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AAAC,cAAA,GAAGzB,cAAc,CAAEgB,uBAAwB,CAAC;AAChE,MAAMU,aAAa,GAAAF,OAAA,CAAAE,aAAA,GAAG1B,cAAc,CAAEoB,WAAO,CAACO,IAAI,EAAE;EAC1DC,SAAS,EAAE;AACZ,CAAE,CAAC;AAEI,SAASC,iBAAiBA,CAChCC,kBAAsC,GAAG,CAAC,CAAC,EAC1B;EACjB,MAAM;IACLvB,MAAM;IACNwB,SAAS,EAAEC,eAAe;IAC1BC,WAAW;IACXC,GAAG,GAAG,KAAK;IACXC,IAAI,EAAEC,SAAS,GAAG,KAAK;IACvBC,IAAI,EAAEC,SAAS,GAAG,KAAK;IACvBC,KAAK,EAAEC,UAAU,GAAG,KAAK;IACzB;IACAC,gBAAgB,EAAEC;EACnB,CAAC,GAAGZ,kBAAkB;EAEtB,OAAO;IACNvB,MAAM,EAAE,IAAAD,sBAAa,EAAEiB,SAAS,EAAE,WAAW,EAAEhB,MAAO,CAAC;IACvDT,KAAK,EAAE,IAAA6C,wBAAiB,EAAE;MACzBX,eAAe;MACfE,GAAG;MACHD,WAAW;MACXG,SAAS;MACTI,UAAU;MACVF,SAAS;MACTI;IACD,CAAE;EACH,CAAC;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_compose","_deprecated","_interopRequireDefault","_","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","mapLegacyStatePropsToComponentProps","legacyProps","state","rest","store","props","LEGACY_TO_NEW_DISPLAY_NAME","__unstableComposite","__unstableCompositeGroup","__unstableCompositeItem","__unstableUseCompositeState","proxyComposite","ProxiedComponent","propMap","_ProxiedComponent$dis","displayName","Component","deprecated","since","alternative","undefined","id","useInstanceId","baseId","entries","forEach","from","to","assign","jsx","UnproxiedCompositeGroup","forwardRef","role","ref","Current","Row","Group","Composite","exports","CompositeGroup","CompositeItem","Item","focusable","useCompositeState","legacyStateOptions","currentId","defaultActiveId","orientation","rtl","loop","focusLoop","wrap","focusWrap","shift","focusShift","unstable_virtual","virtualFocus","useCompositeStore"],"sources":["@wordpress/components/src/composite/legacy/index.tsx"],"sourcesContent":["/**\n * Composite is a component that may contain navigable items represented by\n * CompositeItem. It's inspired by the WAI-ARIA Composite Role and implements\n * all the keyboard navigation mechanisms to ensure that there's only one\n * tab stop for the whole Composite element. This means that it can behave as\n * a roving tabindex or aria-activedescendant container.\n *\n * This file aims at providing components that are as close as possible to the\n * original `reakit`-based implementation (which was removed from the codebase),\n * although it is recommended that consumers of the package switch to the stable,\n * un-prefixed, `ariakit`-based version of `Composite`.\n *\n * @see https://ariakit.org/components/composite\n */\n\n/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { Composite as Current } from '..';\n\ntype Orientation = 'horizontal' | 'vertical';\n\nexport interface LegacyStateOptions {\n\t/**\n\t * ID that will serve as a base for all the items IDs.\n\t */\n\tbaseId?: string;\n\t/**\n\t * Determines how next and previous functions will behave. If `rtl` is set\n\t * to `true`, they will be inverted. This only affects the composite widget\n\t * behavior. You still need to set `dir=\"rtl\"` on HTML/CSS.\n\t *\n\t * @default false\n\t */\n\trtl?: boolean;\n\t/**\n\t * Defines the orientation of the composite widget. If the composite has a\n\t * single row or column (one-dimensional), the orientation value determines\n\t * which arrow keys can be used to move focus.\n\t */\n\torientation?: Orientation;\n\t/**\n\t * The current focused item `id`.\n\t */\n\tcurrentId?: string;\n\t/**\n\t * Determines how focus moves from the start and end of rows and columns.\n\t *\n\t * @default false\n\t */\n\tloop?: boolean | Orientation;\n\t/**\n\t * If enabled, moving to the next item from the last one in a row or column\n\t * will focus the first item in the next row or column and vice-versa.\n\t *\n\t * ** Has effect only on two-dimensional composites. **\n\t *\n\t * @default false\n\t */\n\twrap?: boolean | Orientation;\n\t/**\n\t * If enabled, moving up or down when there's no next item or the next item\n\t * is disabled will shift to the item right before it.\n\t *\n\t * ** Has effect only on two-dimensional composites. **\n\t *\n\t * @default false\n\t */\n\tshift?: boolean;\n\tunstable_virtual?: boolean;\n}\n\ntype Component = React.FunctionComponent< any >;\n\ntype CompositeStore = ReturnType< typeof Ariakit.useCompositeStore >;\ntype CompositeStoreState = { store: CompositeStore };\nexport type CompositeState = CompositeStoreState &\n\tRequired< Pick< LegacyStateOptions, 'baseId' > >;\n\n// Legacy composite components can either provide state through a\n// single `state` prop, or via individual props, usually through\n// spreading the state generated by `useCompositeState`.\n// That is, `<Composite* { ...state }>`.\nexport type CompositeStateProps =\n\t| { state: CompositeState }\n\t| ( CompositeState & { state?: never } );\ntype ComponentProps< C extends Component > = React.ComponentPropsWithRef< C >;\nexport type CompositeProps< C extends Component > = ComponentProps< C > &\n\tCompositeStateProps;\ntype CompositeComponent< C extends Component > = (\n\tprops: CompositeProps< C >\n) => React.ReactElement;\ntype CompositeComponentProps = CompositeState &\n\t(\n\t\t| ComponentProps< typeof Current.Group >\n\t\t| ComponentProps< typeof Current.Item >\n\t\t| ComponentProps< typeof Current.Row >\n\t);\n\nfunction mapLegacyStatePropsToComponentProps(\n\tlegacyProps: CompositeStateProps\n): CompositeComponentProps {\n\t// If a `state` prop is provided, we unpack that; otherwise,\n\t// the necessary props are provided directly in `legacyProps`.\n\tif ( legacyProps.state ) {\n\t\tconst { state, ...rest } = legacyProps;\n\t\tconst { store, ...props } =\n\t\t\tmapLegacyStatePropsToComponentProps( state );\n\t\treturn { ...rest, ...props, store };\n\t}\n\n\treturn legacyProps;\n}\n\nconst LEGACY_TO_NEW_DISPLAY_NAME = {\n\t__unstableComposite: 'Composite',\n\t__unstableCompositeGroup: 'Composite.Group or Composite.Row',\n\t__unstableCompositeItem: 'Composite.Item',\n\t__unstableUseCompositeState: 'Composite',\n};\n\nfunction proxyComposite< C extends Component >(\n\tProxiedComponent: C | React.ForwardRefExoticComponent< C >,\n\tpropMap: Record< string, string > = {}\n): CompositeComponent< C > {\n\tconst displayName = ProxiedComponent.displayName ?? '';\n\n\tconst Component = ( legacyProps: CompositeStateProps ) => {\n\t\tdeprecated( `wp.components.${ displayName }`, {\n\t\t\tsince: '6.7',\n\t\t\talternative: LEGACY_TO_NEW_DISPLAY_NAME.hasOwnProperty(\n\t\t\t\tdisplayName\n\t\t\t)\n\t\t\t\t? LEGACY_TO_NEW_DISPLAY_NAME[\n\t\t\t\t\t\tdisplayName as keyof typeof LEGACY_TO_NEW_DISPLAY_NAME\n\t\t\t\t ]\n\t\t\t\t: undefined,\n\t\t} );\n\n\t\tconst { store, ...rest } =\n\t\t\tmapLegacyStatePropsToComponentProps( legacyProps );\n\t\tconst props = rest as ComponentProps< C >;\n\t\tprops.id = useInstanceId( store, props.baseId, props.id );\n\n\t\tObject.entries( propMap ).forEach( ( [ from, to ] ) => {\n\t\t\tif ( props.hasOwnProperty( from ) ) {\n\t\t\t\tObject.assign( props, { [ to ]: props[ from ] } );\n\t\t\t\tdelete props[ from ];\n\t\t\t}\n\t\t} );\n\n\t\tdelete props.baseId;\n\n\t\treturn <ProxiedComponent { ...props } store={ store } />;\n\t};\n\tComponent.displayName = displayName;\n\treturn Component;\n}\n\n// The old `CompositeGroup` used to behave more like the current\n// `CompositeRow`, but this has been split into two different\n// components. We handle that difference by checking on the\n// provided role, and returning the appropriate component.\nconst UnproxiedCompositeGroup = forwardRef<\n\tany,\n\tReact.ComponentPropsWithoutRef< typeof Current.Group | typeof Current.Row >\n>( ( { role, ...props }, ref ) => {\n\tconst Component = role === 'row' ? Current.Row : Current.Group;\n\treturn <Component ref={ ref } role={ role } { ...props } />;\n} );\n\n/**\n * _Note: please use the `Composite` component instead._\n *\n * @deprecated\n */\nexport const Composite = proxyComposite(\n\tObject.assign( Current, { displayName: '__unstableComposite' } ),\n\t{ baseId: 'id' }\n);\n/**\n * _Note: please use the `Composite.Row` or `Composite.Group` components instead._\n *\n * @deprecated\n */\nexport const CompositeGroup = proxyComposite(\n\tObject.assign( UnproxiedCompositeGroup, {\n\t\tdisplayName: '__unstableCompositeGroup',\n\t} )\n);\n/**\n * _Note: please use the `Composite.Item` component instead._\n *\n * @deprecated\n */\nexport const CompositeItem = proxyComposite(\n\tObject.assign( Current.Item, {\n\t\tdisplayName: '__unstableCompositeItem',\n\t} ),\n\t{\n\t\tfocusable: 'accessibleWhenDisabled',\n\t}\n);\n\n/**\n * _Note: please use the `Composite` component instead._\n *\n * @deprecated\n */\nexport function useCompositeState(\n\tlegacyStateOptions: LegacyStateOptions = {}\n): CompositeState {\n\tdeprecated( `wp.components.__unstableUseCompositeState`, {\n\t\tsince: '6.7',\n\t\talternative: LEGACY_TO_NEW_DISPLAY_NAME.__unstableUseCompositeState,\n\t} );\n\n\tconst {\n\t\tbaseId,\n\t\tcurrentId: defaultActiveId,\n\t\torientation,\n\t\trtl = false,\n\t\tloop: focusLoop = false,\n\t\twrap: focusWrap = false,\n\t\tshift: focusShift = false,\n\t\t// eslint-disable-next-line camelcase\n\t\tunstable_virtual: virtualFocus,\n\t} = legacyStateOptions;\n\n\treturn {\n\t\tbaseId: useInstanceId( Composite, 'composite', baseId ),\n\t\tstore: Ariakit.useCompositeStore( {\n\t\t\tdefaultActiveId,\n\t\t\trtl,\n\t\t\torientation,\n\t\t\tfocusLoop,\n\t\t\tfocusShift,\n\t\t\tfocusWrap,\n\t\t\tvirtualFocus,\n\t\t} ),\n\t};\n}\n"],"mappings":";;;;;;;;AAkBA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAKA,IAAAK,CAAA,GAAAL,OAAA;AAA0C,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAO,yBAAAC,CAAA,6B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d,CAAE,CACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACO,MAAMyB,aAAa,GAAAF,OAAA,CAAAE,aAAA,GAAG7B,cAAc,CAC1CnB,MAAM,CAACoC,MAAM,CAAEM,WAAO,CAACO,IAAI,EAAE;EAC5B1B,WAAW,EAAE;AACd,CAAE,CAAC,EACH;EACC2B,SAAS,EAAE;AACZ,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACO,SAASC,iBAAiBA,CAChCC,kBAAsC,GAAG,CAAC,CAAC,EAC1B;EACjB,IAAA3B,mBAAU,EAAG,2CAA0C,EAAE;IACxDC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAEb,0BAA0B,CAACI;EACzC,CAAE,CAAC;EAEH,MAAM;IACLa,MAAM;IACNsB,SAAS,EAAEC,eAAe;IAC1BC,WAAW;IACXC,GAAG,GAAG,KAAK;IACXC,IAAI,EAAEC,SAAS,GAAG,KAAK;IACvBC,IAAI,EAAEC,SAAS,GAAG,KAAK;IACvBC,KAAK,EAAEC,UAAU,GAAG,KAAK;IACzB;IACAC,gBAAgB,EAAEC;EACnB,CAAC,GAAGZ,kBAAkB;EAEtB,OAAO;IACNrB,MAAM,EAAE,IAAAD,sBAAa,EAAEe,SAAS,EAAE,WAAW,EAAEd,MAAO,CAAC;IACvDnB,KAAK,EAAEjC,OAAO,CAACsF,iBAAiB,CAAE;MACjCX,eAAe;MACfE,GAAG;MACHD,WAAW;MACXG,SAAS;MACTI,UAAU;MACVF,SAAS;MACTI;IACD,CAAE;EACH,CAAC;AACF","ignoreList":[]}
|
package/build/composite/row.js
CHANGED
|
@@ -25,7 +25,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
25
25
|
const CompositeRow = exports.CompositeRow = (0, _element.forwardRef)(function CompositeRow(props, ref) {
|
|
26
26
|
const context = (0, _context.useCompositeContext)();
|
|
27
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Ariakit.CompositeRow, {
|
|
28
|
-
store: context
|
|
28
|
+
store: context.store,
|
|
29
29
|
...props,
|
|
30
30
|
ref: ref
|
|
31
31
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CompositeRow","exports","forwardRef","props","ref","context","useCompositeContext","jsx","store"],"sources":["@wordpress/components/src/composite/row.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeRowProps } from './types';\n\nexport const CompositeRow = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeRowProps, 'div', false >\n>( function CompositeRow( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeRow\n\t\t\tstore={ context
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CompositeRow","exports","forwardRef","props","ref","context","useCompositeContext","jsx","store"],"sources":["@wordpress/components/src/composite/row.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeRowProps } from './types';\n\nexport const CompositeRow = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeRowProps, 'div', false >\n>( function CompositeRow( props, ref ) {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AAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAdhD;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAKO,MAAMW,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,mBAAU,EAGnC,SAASF,YAAYA,CAAEG,KAAK,EAAEC,GAAG,EAAG;EACtC,MAAMC,OAAO,GAAG,IAAAC,4BAAmB,EAAC,CAAC;EACrC,oBACC,IAAA3B,WAAA,CAAA4B,GAAA,EAACjC,OAAO,CAAC0B,YAAY;IACpBQ,KAAK,EAAGH,OAAO,CAACG,KAAiC;IAAA,GAC5CL,KAAK;IACVC,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
|
|
@@ -25,7 +25,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
25
25
|
const CompositeTypeahead = exports.CompositeTypeahead = (0, _element.forwardRef)(function CompositeTypeahead(props, ref) {
|
|
26
26
|
const context = (0, _context.useCompositeContext)();
|
|
27
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Ariakit.CompositeTypeahead, {
|
|
28
|
-
store: context
|
|
28
|
+
store: context.store,
|
|
29
29
|
...props,
|
|
30
30
|
ref: ref
|
|
31
31
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CompositeTypeahead","exports","forwardRef","props","ref","context","useCompositeContext","jsx","store"],"sources":["@wordpress/components/src/composite/typeahead.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeTypeaheadProps } from './types';\n\nexport const CompositeTypeahead = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeTypeaheadProps, 'div', false >\n>( function CompositeTypeahead( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeTypeahead\n\t\t\tstore={ context
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CompositeTypeahead","exports","forwardRef","props","ref","context","useCompositeContext","jsx","store"],"sources":["@wordpress/components/src/composite/typeahead.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeTypeaheadProps } from './types';\n\nexport const CompositeTypeahead = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeTypeaheadProps, 'div', false >\n>( function CompositeTypeahead( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeTypeahead\n\t\t\tstore={ context.store as Ariakit.CompositeStore }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AAAgD,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC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